@clayui/tooltip 3.52.0 → 3.58.0

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.
package/lib/Tooltip.d.ts CHANGED
@@ -1,7 +1,17 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ */
1
5
  import React from 'react';
2
6
  export declare const ALIGN_POSITIONS: readonly ["top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right", "left", "right"];
3
7
  interface IProps extends React.HTMLAttributes<HTMLDivElement> {
8
+ /**
9
+ * Position in which the tooltip will be aligned to the element.
10
+ */
4
11
  alignPosition?: typeof ALIGN_POSITIONS[number];
12
+ /**
13
+ * Flag to indicate if tooltip is displayed.
14
+ */
5
15
  show?: boolean;
6
16
  }
7
17
  declare const ClayTooltip: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLElement>>;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ */
1
5
  import { IPortalBaseProps } from '@clayui/shared';
2
6
  import React from 'react';
3
7
  declare type TContentRenderer = (props: {
@@ -5,9 +9,21 @@ declare type TContentRenderer = (props: {
5
9
  title: string;
6
10
  }) => React.ReactElement | React.ReactNode;
7
11
  interface IPropsBase {
12
+ /**
13
+ * Flag to indicate if tooltip should automatically align based on the window
14
+ */
8
15
  autoAlign?: boolean;
16
+ /**
17
+ * Props to add to the <ClayPortal/>.
18
+ */
9
19
  containerProps?: IPortalBaseProps;
20
+ /**
21
+ * Custom function for rendering the contents of the tooltip
22
+ */
10
23
  contentRenderer?: TContentRenderer;
24
+ /**
25
+ * Delay in miliseconds before showing tooltip
26
+ */
11
27
  delay?: number;
12
28
  }
13
29
  interface IPropsWithChildren extends IPropsBase {
@@ -16,6 +32,11 @@ interface IPropsWithChildren extends IPropsBase {
16
32
  }
17
33
  interface IPropsWithScope extends IPropsBase {
18
34
  children?: never;
35
+ /**
36
+ * CSS selector to scope provider to. All titles within this scope will be
37
+ * rendered in the tooltip. Titles outside of this scope will be styled
38
+ * as with the default browser.
39
+ */
19
40
  scope: string;
20
41
  }
21
42
  declare const TooltipProvider: React.FunctionComponent<IPropsWithChildren | IPropsWithScope>;
@@ -233,6 +233,7 @@ var TooltipProvider = function TooltipProvider(_ref2) {
233
233
 
234
234
  var _setAsHTML = !!titleNode.getAttribute('data-title-set-as-html');
235
235
 
236
+ clearTimeout(timeoutIdRef.current);
236
237
  timeoutIdRef.current = setTimeout(function () {
237
238
  dispatch({
238
239
  align: newAlign || align,
package/lib/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ */
1
5
  import ClayTooltip from './Tooltip';
2
6
  import ClayTooltipProvider from './TooltipProvider';
3
7
  export { ClayTooltipProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clayui/tooltip",
3
- "version": "3.52.0",
3
+ "version": "3.58.0",
4
4
  "description": "ClayTooltip component",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": "https://github.com/liferay/clay",
@@ -17,8 +17,8 @@
17
17
  ],
18
18
  "scripts": {
19
19
  "build": "cross-env NODE_ENV=production babel src --root-mode upward --out-dir lib --extensions .ts,.tsx",
20
- "build:types": "cross-env NODE_ENV=production tsc --project ./tsconfig.declarations.json",
21
- "prepublishOnly": "yarn build && yarn build:types",
20
+ "buildTypes": "cross-env NODE_ENV=production tsc --project ./tsconfig.declarations.json",
21
+ "prepublishOnly": "yarn build && yarn buildTypes",
22
22
  "test": "jest --config ../../jest.config.js"
23
23
  },
24
24
  "keywords": [
@@ -26,7 +26,7 @@
26
26
  "react"
27
27
  ],
28
28
  "dependencies": {
29
- "@clayui/shared": "^3.52.0",
29
+ "@clayui/shared": "^3.58.0",
30
30
  "classnames": "^2.2.6",
31
31
  "warning": "^4.0.3"
32
32
  },
@@ -38,5 +38,5 @@
38
38
  "browserslist": [
39
39
  "extends browserslist-config-clay"
40
40
  ],
41
- "gitHead": "eb7c98d6c746294376f10554c68cc48c30d8bd0e"
41
+ "gitHead": "db7f178a1a0dff04d700f8dca2b04f6a5321353b"
42
42
  }
@@ -290,6 +290,8 @@ const TooltipProvider: React.FunctionComponent<
290
290
  'data-title-set-as-html'
291
291
  );
292
292
 
293
+ clearTimeout(timeoutIdRef.current);
294
+
293
295
  timeoutIdRef.current = setTimeout(
294
296
  () => {
295
297
  dispatch({