@jetbrains/ring-ui 4.2.6 → 4.2.7

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.
@@ -34,6 +34,7 @@ export default class Dialog extends PureComponent {
34
34
  show: PropTypes.bool.isRequired,
35
35
  showCloseButton: PropTypes.bool,
36
36
  closeButtonInside: PropTypes.bool,
37
+ closeButtonTitle: PropTypes.string,
37
38
  onOverlayClick: PropTypes.func,
38
39
  onEscPress: PropTypes.func,
39
40
  onCloseClick: PropTypes.func,
@@ -119,7 +120,7 @@ export default class Dialog extends PureComponent {
119
120
  render() {
120
121
  const {show, showCloseButton, onOverlayClick, onCloseAttempt, onEscPress, onCloseClick,
121
122
  children, className, contentClassName, trapFocus, 'data-test': dataTest, closeButtonInside,
122
- portalTarget, label, ...restProps} = this.props;
123
+ portalTarget, label, closeButtonTitle, ...restProps} = this.props;
123
124
  const classes = classNames(styles.container, className);
124
125
  const shortcutsMap = this.getShortcutsMap();
125
126
 
@@ -166,7 +167,8 @@ export default class Dialog extends PureComponent {
166
167
  })}
167
168
  iconClassName={styles.closeIcon}
168
169
  onClick={this.onCloseClick}
169
- aria-label="close dialog"
170
+ title={closeButtonTitle}
171
+ aria-label={closeButtonTitle || 'close dialog'}
170
172
  />
171
173
  )
172
174
  }
@@ -16,7 +16,7 @@ import composeRefs from '../global/composeRefs';
16
16
  import Cell from './cell';
17
17
  import style from './table.css';
18
18
 
19
- const DragHandle = ({alwaysShowDragHandle}) => {
19
+ const DragHandle = ({alwaysShowDragHandle, dragHandleTitle = 'Drag to reorder'}) => {
20
20
  const classes = classNames(style.dragHandle, {
21
21
  [style.visibleDragHandle]: alwaysShowDragHandle
22
22
  });
@@ -24,14 +24,15 @@ const DragHandle = ({alwaysShowDragHandle}) => {
24
24
  return (
25
25
  <Button
26
26
  data-movable-handle
27
- title="Drag"
27
+ title={dragHandleTitle}
28
28
  className={classes}
29
29
  icon={dragIcon}
30
30
  />
31
31
  );
32
32
  };
33
33
  DragHandle.propTypes = {
34
- alwaysShowDragHandle: PropTypes.bool
34
+ alwaysShowDragHandle: PropTypes.bool,
35
+ dragHandleTitle: PropTypes.string
35
36
  };
36
37
 
37
38
  export default class Row extends PureComponent {
@@ -43,6 +44,7 @@ export default class Row extends PureComponent {
43
44
  showFocus: PropTypes.bool,
44
45
  draggable: PropTypes.bool,
45
46
  alwaysShowDragHandle: PropTypes.bool,
47
+ dragHandleTitle: PropTypes.string,
46
48
  selected: PropTypes.bool,
47
49
  onHover: PropTypes.func,
48
50
  onSelect: PropTypes.func,
@@ -127,7 +129,7 @@ export default class Row extends PureComponent {
127
129
  render() {
128
130
  const {
129
131
  item, columns, selectable, selected,
130
- showFocus, draggable, alwaysShowDragHandle, level,
132
+ showFocus, draggable, alwaysShowDragHandle, dragHandleTitle, level,
131
133
  collapsible, parentCollapsible, collapsed,
132
134
  onCollapse, onExpand, showDisabledSelection,
133
135
  checkboxTooltip, innerRef, focused, autofocus, onFocusReset,
@@ -156,9 +158,12 @@ export default class Row extends PureComponent {
156
158
 
157
159
  const metaColumn = (
158
160
  <div className={metaColumnClasses} style={metaColumnStyle}>
159
- {draggable &&
160
- <DragHandle alwaysShowDragHandle={alwaysShowDragHandle}/>
161
- }
161
+ {draggable && (
162
+ <DragHandle
163
+ alwaysShowDragHandle={alwaysShowDragHandle}
164
+ dragHandleTitle={dragHandleTitle}
165
+ />
166
+ )}
162
167
 
163
168
  {selectable &&
164
169
  (
@@ -114,6 +114,7 @@ class BasicDemo extends Component {
114
114
  caption={withCaption ? 'Countries' : undefined}
115
115
  isItemSelectable={this.isItemSelectable}
116
116
  getItemDataTest={it => it.country}
117
+ dragHandleTitle="Drag me!"
117
118
  />
118
119
 
119
120
  <Grid>
@@ -42,6 +42,7 @@ export class Table extends PureComponent {
42
42
  sortOrder: PropTypes.bool,
43
43
  draggable: PropTypes.bool,
44
44
  alwaysShowDragHandle: PropTypes.bool,
45
+ dragHandleTitle: PropTypes.string,
45
46
  getItemLevel: PropTypes.func,
46
47
  isItemCollapsible: PropTypes.func,
47
48
  isParentCollapsible: PropTypes.func,
@@ -175,7 +176,7 @@ export class Table extends PureComponent {
175
176
  const {
176
177
  data, selection, columns, caption, getItemKey, selectable, focused,
177
178
  isItemSelectable, getItemLevel, getItemClassName, getItemDataTest,
178
- draggable, alwaysShowDragHandle,
179
+ draggable, alwaysShowDragHandle, dragHandleTitle,
179
180
  loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader,
180
181
  stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed,
181
182
  onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip,
@@ -262,6 +263,7 @@ export class Table extends PureComponent {
262
263
  className={classNames(getItemClassName(value), {[style.draggingRow]: isDragged})}
263
264
  draggable={draggable}
264
265
  alwaysShowDragHandle={alwaysShowDragHandle}
266
+ dragHandleTitle={dragHandleTitle}
265
267
  columns={columns}
266
268
  data-test={getItemDataTest(value)}
267
269
  {...restProps}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "4.2.6",
3
+ "version": "4.2.7",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -221,5 +221,5 @@
221
221
  "node": ">=7.4",
222
222
  "npm": ">=6.0.0"
223
223
  },
224
- "gitHead": "2859a8356ddd35e59398fb36699866f786126b2a"
224
+ "gitHead": "ae612df72a5c0acbcee32b391e8f131890e5e504"
225
225
  }