@jetbrains/ring-ui-built 6.0.66 → 6.0.68

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.
@@ -45,6 +45,7 @@ declare class SimpleTable<T extends SelectionItem> extends PureComponent<SimpleT
45
45
  stickyHeaderOffset?: import("react").Validator<string | null | undefined> | undefined;
46
46
  renderEmpty?: import("react").Validator<(() => import("react").ReactNode) | null | undefined> | undefined;
47
47
  RowComponent?: import("react").Validator<typeof import("./row-with-focus-sensor").default | null | undefined> | undefined;
48
+ customLoader?: import("react").Validator<((loaderClassName?: string) => import("react").ReactNode) | null | undefined> | undefined;
48
49
  shortcuts?: import("react").Validator<import("../shortcuts/core").ShortcutsMap | null | undefined> | undefined;
49
50
  };
50
51
  static defaultProps: {
@@ -49,6 +49,7 @@ declare class SmartTable<T extends SelectionItem> extends PureComponent<SmartTab
49
49
  stickyHeaderOffset?: import("react").Validator<string | null | undefined> | undefined;
50
50
  renderEmpty?: import("react").Validator<(() => import("react").ReactNode) | null | undefined> | undefined;
51
51
  RowComponent?: import("react").Validator<typeof import("./row-with-focus-sensor").default | null | undefined> | undefined;
52
+ customLoader?: import("react").Validator<((loaderClassName?: string) => import("react").ReactNode) | null | undefined> | undefined;
52
53
  selectable?: import("react").Validator<boolean | null | undefined> | undefined;
53
54
  shortcuts?: import("react").Validator<import("../shortcuts/core").ShortcutsMap | null | undefined> | undefined;
54
55
  onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -50,6 +50,7 @@ export interface TableProps<T extends SelectionItem> extends FocusSensorAddProps
50
50
  stickyHeaderOffset?: string | undefined;
51
51
  renderEmpty?: (() => ReactNode) | null | undefined;
52
52
  RowComponent: typeof Row;
53
+ customLoader?: ((loaderClassName?: string) => ReactNode) | null | undefined;
53
54
  }
54
55
  /**
55
56
  * Interactive table with selection and keyboard navigation support.
@@ -220,7 +220,8 @@ var Table = /*#__PURE__*/function (_PureComponent) {
220
220
  onItemDoubleClick = _this$props4.onItemDoubleClick,
221
221
  onItemClick = _this$props4.onItemClick,
222
222
  renderEmpty = _this$props4.renderEmpty,
223
- RowComponent = _this$props4.RowComponent;
223
+ RowComponent = _this$props4.RowComponent,
224
+ customLoader = _this$props4.customLoader;
224
225
  // NOTE: Do not construct new object per render because it causes all rows rerendering
225
226
  var columnsArray = typeof columns === 'function' ? columns(null) : columns;
226
227
  var headerProps = {
@@ -346,7 +347,7 @@ var Table = /*#__PURE__*/function (_PureComponent) {
346
347
  })
347
348
  }), loading && /*#__PURE__*/jsx("div", {
348
349
  className: modules_1db4bbca.loadingOverlay,
349
- children: /*#__PURE__*/jsx(Loader, {
350
+ children: customLoader ? customLoader(loaderClassName) : /*#__PURE__*/jsx(Loader, {
350
351
  className: loaderClassName
351
352
  })
352
353
  })]
@@ -56,6 +56,7 @@ export default class Tooltip extends Component<TooltipProps> {
56
56
  showPopup: () => void;
57
57
  hidePopup: () => void;
58
58
  addListeners(): void;
59
+ hideIfMovedOutsidePopup: (ev: React.SyntheticEvent<HTMLElement>) => void;
59
60
  popup?: Popup | null;
60
61
  popupRef: (el: Popup | null) => void;
61
62
  onNestedTooltipShow: () => void;
@@ -113,6 +113,13 @@ var Tooltip = /*#__PURE__*/function (_Component) {
113
113
  showPopup: false
114
114
  });
115
115
  });
116
+ _defineProperty(_this, "hideIfMovedOutsidePopup", function (ev) {
117
+ var _this$popup;
118
+ if (!('relatedTarget' in ev) || (_this$popup = _this.popup) !== null && _this$popup !== void 0 && (_this$popup = _this$popup.container) !== null && _this$popup !== void 0 && _this$popup.contains(ev.relatedTarget)) {
119
+ return;
120
+ }
121
+ _this.hidePopup();
122
+ });
116
123
  _defineProperty(_this, "popup", void 0);
117
124
  _defineProperty(_this, "popupRef", function (el) {
118
125
  _this.popup = el;
@@ -208,7 +215,7 @@ var Tooltip = /*#__PURE__*/function (_Component) {
208
215
  [modules_cd5e45a9.long]: long
209
216
  }),
210
217
  attached: false,
211
- onMouseOut: this.hidePopup,
218
+ onMouseOut: this.hideIfMovedOutsidePopup,
212
219
  top: 4,
213
220
  dontCloseOnAnchorClick: true,
214
221
  ref: this.popupRef
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui-built",
3
- "version": "6.0.66",
3
+ "version": "6.0.68",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",