@jetbrains/ring-ui 5.1.3 → 5.1.5

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.
@@ -70,7 +70,6 @@ export interface DatePopupBaseProps {
70
70
  fromPlaceholder?: string | null | undefined;
71
71
  toPlaceholder?: string | null | undefined;
72
72
  timePlaceholder?: string | null | undefined;
73
- hidden: boolean;
74
73
  locale?: Locale | undefined;
75
74
  parseDateInput: (text: Date | number | string | null | undefined) => Date | null;
76
75
  displayFormat: (date: Date, locale: Locale | undefined) => string;
@@ -25,7 +25,6 @@ export default class DateInput extends React.PureComponent<DateInputProps> {
25
25
  date: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
26
26
  time: PropTypes.Requireable<string>;
27
27
  displayFormat: PropTypes.Requireable<(...args: any[]) => any>;
28
- hidden: PropTypes.Requireable<boolean>;
29
28
  translations: PropTypes.Requireable<object>;
30
29
  fromPlaceholder: PropTypes.Requireable<string>;
31
30
  toPlaceholder: PropTypes.Requireable<string>;
@@ -16,7 +16,6 @@ export default class DateInput extends React.PureComponent {
16
16
  date: dateType,
17
17
  time: PropTypes.string,
18
18
  displayFormat: PropTypes.func,
19
- hidden: PropTypes.bool,
20
19
  translations: PropTypes.object,
21
20
  fromPlaceholder: PropTypes.string,
22
21
  toPlaceholder: PropTypes.string,
@@ -28,8 +27,8 @@ export default class DateInput extends React.PureComponent {
28
27
  locale: PropTypes.object
29
28
  };
30
29
  componentDidUpdate(prevProps) {
31
- const { hidden, text, active } = this.props;
32
- if (!hidden && prevProps.hidden || text !== prevProps.text || active !== prevProps.active) {
30
+ const { text, active } = this.props;
31
+ if (text !== prevProps.text || active !== prevProps.active) {
33
32
  this.updateInput({ text, active });
34
33
  }
35
34
  }
@@ -22,13 +22,13 @@ import DatePopup from './date-popup';
22
22
  import { dateType } from './consts';
23
23
  import styles from './date-picker.css';
24
24
  import formats from './formats';
25
- const PopupComponent = ({ hidden = false, className, popupRef, onClear, datePopupProps, onComplete, ...restProps }) => (<Popup hidden={hidden} keepMounted className={className} ref={popupRef} directions={[
25
+ const PopupComponent = ({ hidden = false, className, popupRef, onClear, datePopupProps, onComplete, ...restProps }) => (<Popup hidden={hidden} className={className} ref={popupRef} directions={[
26
26
  Popup.PopupProps.Directions.BOTTOM_RIGHT,
27
27
  Popup.PopupProps.Directions.BOTTOM_LEFT,
28
28
  Popup.PopupProps.Directions.TOP_LEFT,
29
29
  Popup.PopupProps.Directions.TOP_RIGHT
30
30
  ]} {...restProps}>
31
- <DatePopup onClear={onClear} {...datePopupProps} onComplete={onComplete} hidden={hidden}/>
31
+ <DatePopup onClear={onClear} {...datePopupProps} onComplete={onComplete}/>
32
32
  </Popup>);
33
33
  PopupComponent.propTypes = {
34
34
  hidden: PropTypes.bool,
@@ -20,7 +20,6 @@ export default class DatePopup extends Component<DatePopupProps, DatePopupState>
20
20
  onClear: PropTypes.Requireable<(...args: any[]) => any>;
21
21
  minDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
22
22
  maxDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
23
- hidden: PropTypes.Requireable<boolean>;
24
23
  fromPlaceholder: PropTypes.Requireable<string>;
25
24
  toPlaceholder: PropTypes.Requireable<string>;
26
25
  timePlaceholder: PropTypes.Requireable<string>;
@@ -36,7 +36,6 @@ export default class DatePopup extends Component {
36
36
  onClear: PropTypes.func,
37
37
  minDate: dateType,
38
38
  maxDate: dateType,
39
- hidden: PropTypes.bool,
40
39
  fromPlaceholder: PropTypes.string,
41
40
  toPlaceholder: PropTypes.string,
42
41
  timePlaceholder: PropTypes.string,
@@ -268,7 +267,7 @@ export default class DatePopup extends Component {
268
267
  this.componentRef.current?.querySelector('input')?.focus();
269
268
  };
270
269
  render() {
271
- const { range, hidden, withTime, locale } = this.props;
270
+ const { range, withTime, locale } = this.props;
272
271
  const { from, to, date, time, ...restProps } = this.props;
273
272
  const parsedDate = this.parse(this.props.date, 'date');
274
273
  const parsedTo = this.parse(this.props.to, 'to');
@@ -329,11 +328,11 @@ export default class DatePopup extends Component {
329
328
  if (clearable && name !== 'from' && !this.isInTimeMode()) {
330
329
  onClear = this.onClear.bind(this);
331
330
  }
332
- return (<DateInput {...this.props} {...this.state} divider={name === 'from' && (dates[name] != null || parsedTo != null)} name={name} key={name} date={dates[name]} active={this.state.active === name} hidden={hidden} onActivate={this.handleActivate(name)} onInput={this.handleInput} onConfirm={this.handleConfirm(name)} onClear={onClear} locale={locale}/>);
331
+ return (<DateInput {...this.props} {...this.state} divider={name === 'from' && (dates[name] != null || parsedTo != null)} name={name} key={name} date={dates[name]} active={this.state.active === name} onActivate={this.handleActivate(name)} onInput={this.handleInput} onConfirm={this.handleConfirm(name)} onClear={onClear} locale={locale}/>);
333
332
  })}
334
333
 
335
334
  {this.isInTimeMode()
336
- ? (<DateInput {...this.props} text={this.state.text} divider={!!parsedDate} hoverDate={null} name={'time'} key={'time'} date={null} time={time} active={this.state.active === 'time'} hidden={hidden} onActivate={this.handleActivate('time')} onInput={this.handleInput} onConfirm={this.handleConfirm('time')} onClear={clearable && this.onClear || undefined} locale={locale}/>)
335
+ ? (<DateInput {...this.props} text={this.state.text} divider={!!parsedDate} hoverDate={null} name={'time'} key={'time'} date={null} time={time} active={this.state.active === 'time'} onActivate={this.handleActivate('time')} onInput={this.handleInput} onConfirm={this.handleConfirm('time')} onClear={clearable && this.onClear || undefined} locale={locale}/>)
337
336
  : ('')}
338
337
  </div>
339
338
  <Weekdays locale={locale}/>
@@ -132,8 +132,8 @@ export const CollapsibleTabs = ({ children, selected, onSelect, moreClassName, m
132
132
  const container = measureRef.current;
133
133
  const descendants = [...container?.children ?? []];
134
134
  const moreButton = descendants.pop();
135
- let moreButtonWidth = moreButton.offsetWidth;
136
- const { marginLeft: moreButtonMarginLeft, marginRight: moreButtonMarginRight } = getComputedStyle(moreButton);
135
+ let moreButtonWidth = moreButton?.offsetWidth ?? 0;
136
+ const { marginLeft: moreButtonMarginLeft = '0', marginRight: moreButtonMarginRight = '0' } = moreButton ? getComputedStyle(moreButton) : {};
137
137
  moreButtonWidth += +moreButtonMarginLeft.replace('px', '') + +moreButtonMarginRight.replace('px', '');
138
138
  const tabsWidth = descendants.map(node => {
139
139
  const { marginLeft, marginRight } = getComputedStyle(node);
@@ -70,7 +70,6 @@ export interface DatePopupBaseProps {
70
70
  fromPlaceholder?: string | null | undefined;
71
71
  toPlaceholder?: string | null | undefined;
72
72
  timePlaceholder?: string | null | undefined;
73
- hidden: boolean;
74
73
  locale?: Locale | undefined;
75
74
  parseDateInput: (text: Date | number | string | null | undefined) => Date | null;
76
75
  displayFormat: (date: Date, locale: Locale | undefined) => string;
@@ -25,7 +25,6 @@ export default class DateInput extends React.PureComponent<DateInputProps> {
25
25
  date: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
26
26
  time: PropTypes.Requireable<string>;
27
27
  displayFormat: PropTypes.Requireable<(...args: any[]) => any>;
28
- hidden: PropTypes.Requireable<boolean>;
29
28
  translations: PropTypes.Requireable<object>;
30
29
  fromPlaceholder: PropTypes.Requireable<string>;
31
30
  toPlaceholder: PropTypes.Requireable<string>;
@@ -69,10 +69,9 @@ var DateInput = /*#__PURE__*/function (_React$PureComponent) {
69
69
  key: "componentDidUpdate",
70
70
  value: function componentDidUpdate(prevProps) {
71
71
  var _this$props = this.props,
72
- hidden = _this$props.hidden,
73
72
  text = _this$props.text,
74
73
  active = _this$props.active;
75
- if (!hidden && prevProps.hidden || text !== prevProps.text || active !== prevProps.active) {
74
+ if (text !== prevProps.text || active !== prevProps.active) {
76
75
  this.updateInput({
77
76
  text: text,
78
77
  active: active
@@ -167,7 +166,6 @@ _defineProperty(DateInput, "propTypes", {
167
166
  date: dateType,
168
167
  time: PropTypes.string,
169
168
  displayFormat: PropTypes.func,
170
- hidden: PropTypes.bool,
171
169
  translations: PropTypes.object,
172
170
  fromPlaceholder: PropTypes.string,
173
171
  toPlaceholder: PropTypes.string,
@@ -130,15 +130,13 @@ var PopupComponent = function PopupComponent(_ref) {
130
130
  restProps = _objectWithoutProperties(_ref, _excluded);
131
131
  return /*#__PURE__*/React.createElement(Popup, _extends({
132
132
  hidden: hidden,
133
- keepMounted: true,
134
133
  className: className,
135
134
  ref: popupRef,
136
135
  directions: [Popup.PopupProps.Directions.BOTTOM_RIGHT, Popup.PopupProps.Directions.BOTTOM_LEFT, Popup.PopupProps.Directions.TOP_LEFT, Popup.PopupProps.Directions.TOP_RIGHT]
137
136
  }, restProps), /*#__PURE__*/React.createElement(DatePopup, _extends({
138
137
  onClear: onClear
139
138
  }, datePopupProps, {
140
- onComplete: onComplete,
141
- hidden: hidden
139
+ onComplete: onComplete
142
140
  })));
143
141
  };
144
142
  PopupComponent.propTypes = {
@@ -20,7 +20,6 @@ export default class DatePopup extends Component<DatePopupProps, DatePopupState>
20
20
  onClear: PropTypes.Requireable<(...args: any[]) => any>;
21
21
  minDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
22
22
  maxDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
23
- hidden: PropTypes.Requireable<boolean>;
24
23
  fromPlaceholder: PropTypes.Requireable<string>;
25
24
  toPlaceholder: PropTypes.Requireable<string>;
26
25
  timePlaceholder: PropTypes.Requireable<string>;
@@ -354,7 +354,6 @@ var DatePopup = /*#__PURE__*/function (_Component) {
354
354
  var _this2 = this;
355
355
  var _this$props3 = this.props,
356
356
  range = _this$props3.range,
357
- hidden = _this$props3.hidden,
358
357
  withTime = _this$props3.withTime,
359
358
  locale = _this$props3.locale;
360
359
  var _this$props4 = this.props;
@@ -419,7 +418,6 @@ var DatePopup = /*#__PURE__*/function (_Component) {
419
418
  key: name,
420
419
  date: dates[name],
421
420
  active: _this2.state.active === name,
422
- hidden: hidden,
423
421
  onActivate: _this2.handleActivate(name),
424
422
  onInput: _this2.handleInput,
425
423
  onConfirm: _this2.handleConfirm(name),
@@ -435,7 +433,6 @@ var DatePopup = /*#__PURE__*/function (_Component) {
435
433
  date: null,
436
434
  time: time,
437
435
  active: this.state.active === 'time',
438
- hidden: hidden,
439
436
  onActivate: this.handleActivate('time'),
440
437
  onInput: this.handleInput,
441
438
  onConfirm: this.handleConfirm('time'),
@@ -478,7 +475,6 @@ _defineProperty(DatePopup, "propTypes", {
478
475
  onClear: PropTypes.func,
479
476
  minDate: dateType,
480
477
  maxDate: dateType,
481
- hidden: PropTypes.bool,
482
478
  fromPlaceholder: PropTypes.string,
483
479
  toPlaceholder: PropTypes.string,
484
480
  timePlaceholder: PropTypes.string,
@@ -262,19 +262,21 @@ var CollapsibleTabs = function CollapsibleTabs(_ref) {
262
262
  return undefined;
263
263
  }
264
264
  var measureTask = fastdom.measure(function () {
265
- var _container$children;
265
+ var _container$children, _moreButton$offsetWid;
266
266
  var container = measureRef.current;
267
267
  var descendants = _toConsumableArray((_container$children = container === null || container === void 0 ? void 0 : container.children) !== null && _container$children !== void 0 ? _container$children : []);
268
268
  var moreButton = descendants.pop();
269
- var moreButtonWidth = moreButton.offsetWidth;
270
- var _getComputedStyle = getComputedStyle(moreButton),
271
- moreButtonMarginLeft = _getComputedStyle.marginLeft,
272
- moreButtonMarginRight = _getComputedStyle.marginRight;
269
+ var moreButtonWidth = (_moreButton$offsetWid = moreButton === null || moreButton === void 0 ? void 0 : moreButton.offsetWidth) !== null && _moreButton$offsetWid !== void 0 ? _moreButton$offsetWid : 0;
270
+ var _ref2 = moreButton ? getComputedStyle(moreButton) : {},
271
+ _ref2$marginLeft = _ref2.marginLeft,
272
+ moreButtonMarginLeft = _ref2$marginLeft === void 0 ? '0' : _ref2$marginLeft,
273
+ _ref2$marginRight = _ref2.marginRight,
274
+ moreButtonMarginRight = _ref2$marginRight === void 0 ? '0' : _ref2$marginRight;
273
275
  moreButtonWidth += +moreButtonMarginLeft.replace('px', '') + +moreButtonMarginRight.replace('px', '');
274
276
  var tabsWidth = descendants.map(function (node) {
275
- var _getComputedStyle2 = getComputedStyle(node),
276
- marginLeft = _getComputedStyle2.marginLeft,
277
- marginRight = _getComputedStyle2.marginRight;
277
+ var _getComputedStyle = getComputedStyle(node),
278
+ marginLeft = _getComputedStyle.marginLeft,
279
+ marginRight = _getComputedStyle.marginRight;
278
280
  var width = node.getBoundingClientRect().width;
279
281
  return width + +marginLeft.replace('px', '') + +marginRight.replace('px', '');
280
282
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.1.3",
3
+ "version": "5.1.5",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -85,21 +85,21 @@
85
85
  "@rollup/plugin-json": "^6.0.0",
86
86
  "@rollup/plugin-node-resolve": "^15.2.1",
87
87
  "@rollup/plugin-replace": "^5.0.2",
88
- "@storybook/addon-a11y": "7.4.0",
89
- "@storybook/addon-docs": "7.4.0",
90
- "@storybook/addon-essentials": "7.4.0",
88
+ "@storybook/addon-a11y": "7.4.2",
89
+ "@storybook/addon-docs": "7.4.2",
90
+ "@storybook/addon-essentials": "7.4.2",
91
91
  "@storybook/addon-storyshots": "7.4.0",
92
- "@storybook/addon-storyshots-puppeteer": "7.4.0",
93
- "@storybook/addon-storysource": "7.4.0",
94
- "@storybook/addons": "7.4.0",
92
+ "@storybook/addon-storyshots-puppeteer": "7.4.2",
93
+ "@storybook/addon-storysource": "7.4.2",
94
+ "@storybook/addons": "7.4.2",
95
95
  "@storybook/html": "7.4.0",
96
- "@storybook/html-webpack5": "^7.4.0",
96
+ "@storybook/html-webpack5": "^7.4.2",
97
97
  "@storybook/preview-api": "7.4.0",
98
- "@storybook/react": "7.4.0",
99
- "@storybook/source-loader": "7.4.0",
100
- "@storybook/theming": "7.4.0",
98
+ "@storybook/react": "7.4.2",
99
+ "@storybook/source-loader": "7.4.2",
100
+ "@storybook/theming": "7.4.2",
101
101
  "@testing-library/react": "^14.0.0",
102
- "@testing-library/user-event": "^14.4.3",
102
+ "@testing-library/user-event": "^14.5.1",
103
103
  "@types/chai": "^4.3.6",
104
104
  "@types/chai-as-promised": "^7.1.6",
105
105
  "@types/chai-dom": "0.0.10",
@@ -109,8 +109,8 @@
109
109
  "@types/react-dom": "^18.2.7",
110
110
  "@types/sinon": "^10.0.16",
111
111
  "@types/sinon-chai": "^3.2.9",
112
- "@typescript-eslint/eslint-plugin": "^6.6.0",
113
- "@typescript-eslint/parser": "^6.6.0",
112
+ "@typescript-eslint/eslint-plugin": "^6.7.0",
113
+ "@typescript-eslint/parser": "^6.7.0",
114
114
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
115
115
  "acorn": "^8.10.0",
116
116
  "angular": "^1.8.3",
@@ -118,16 +118,16 @@
118
118
  "angular-route": "^1.8.3",
119
119
  "babel-plugin-react-docgen": "^4.2.1",
120
120
  "babel-plugin-require-context-hook": "^1.0.0",
121
- "caniuse-lite": "^1.0.30001527",
121
+ "caniuse-lite": "^1.0.30001534",
122
122
  "chai": "^4.3.8",
123
123
  "chai-as-promised": "^7.1.1",
124
124
  "chai-dom": "^1.10.0",
125
125
  "chai-enzyme": "1.0.0-beta.1",
126
126
  "cheerio": "^1.0.0-rc.12",
127
- "core-js": "^3.32.1",
127
+ "core-js": "^3.32.2",
128
128
  "cpy-cli": "^3.1.1",
129
129
  "enzyme": "^3.11.0",
130
- "eslint": "^8.48.0",
130
+ "eslint": "^8.49.0",
131
131
  "eslint-import-resolver-webpack": "^0.13.7",
132
132
  "eslint-plugin-angular": "^4.1.0",
133
133
  "eslint-plugin-bdd": "^2.1.1",
@@ -141,8 +141,8 @@
141
141
  "husky": "^8.0.3",
142
142
  "identity-obj-proxy": "^3.0.0",
143
143
  "imports-loader": "^4.0.1",
144
- "jest": "~29.6.4",
145
- "jest-environment-jsdom": "^29.6.4",
144
+ "jest": "~29.7.0",
145
+ "jest-environment-jsdom": "^29.7.0",
146
146
  "jest-teamcity": "^1.10.0",
147
147
  "karma": "^6.4.2",
148
148
  "karma-chrome-launcher": "3.2.0",
@@ -155,20 +155,20 @@
155
155
  "mocha": "^10.2.0",
156
156
  "pinst": "^3.0.0",
157
157
  "prettier": "^3.0.3",
158
- "puppeteer": "^21.1.1",
158
+ "puppeteer": "^21.2.1",
159
159
  "raw-loader": "^4.0.2",
160
160
  "react": "^18.2.0",
161
161
  "react-dom": "^18.2.0",
162
162
  "react-test-renderer": "^18.2.0",
163
163
  "regenerator-runtime": "^0.14.0",
164
164
  "rimraf": "^5.0.1",
165
- "rollup": "^3.28.1",
165
+ "rollup": "^3.29.1",
166
166
  "rollup-plugin-clear": "^2.0.7",
167
167
  "rollup-plugin-styles": "^4.0.0",
168
- "sinon": "^15.2.0",
168
+ "sinon": "^16.0.0",
169
169
  "sinon-chai": "^3.7.0",
170
170
  "storage-mock": "^2.1.0",
171
- "storybook": "^7.4.0",
171
+ "storybook": "^7.4.2",
172
172
  "storybook-addon-themes": "^6.1.0",
173
173
  "storybook-zeplin": "^2.0.2",
174
174
  "stylelint": "^15.10.3",
@@ -201,11 +201,11 @@
201
201
  }
202
202
  },
203
203
  "dependencies": {
204
- "@babel/core": "^7.22.15",
204
+ "@babel/core": "^7.22.20",
205
205
  "@babel/preset-typescript": "^7.22.15",
206
206
  "@jetbrains/babel-preset-jetbrains": "^2.3.2",
207
207
  "@jetbrains/icons": "^3.21.0",
208
- "@jetbrains/logos": "^2.2.16",
208
+ "@jetbrains/logos": "^2.2.18",
209
209
  "@jetbrains/postcss-require-hover": "^0.1.2",
210
210
  "@types/combokeys": "^2.4.7",
211
211
  "@types/deep-equal": "^1.0.1",