@clayui/tooltip 3.37.0 → 3.45.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.js CHANGED
@@ -9,6 +9,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
+ var _excluded = ["alignPosition", "children", "className", "show"];
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
 
14
16
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -26,7 +28,7 @@ var ClayTooltip = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
26
28
  children = _ref.children,
27
29
  className = _ref.className,
28
30
  show = _ref.show,
29
- otherProps = _objectWithoutProperties(_ref, ["alignPosition", "children", "className", "show"]);
31
+ otherProps = _objectWithoutProperties(_ref, _excluded);
30
32
 
31
33
  return /*#__PURE__*/_react.default.createElement("div", _extends({
32
34
  className: (0, _classnames.default)(className, 'tooltip', "clay-tooltip-".concat(alignPosition), {
@@ -15,11 +15,13 @@ var _warning = _interopRequireDefault(require("warning"));
15
15
 
16
16
  var _Tooltip = _interopRequireDefault(require("./Tooltip"));
17
17
 
18
+ var _excluded = ["type"];
19
+
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
20
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
23
 
22
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
25
 
24
26
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
27
 
@@ -29,7 +31,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
29
31
 
30
32
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
31
33
 
32
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
34
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
33
35
 
34
36
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
35
37
 
@@ -37,7 +39,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
37
39
 
38
40
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
39
41
 
40
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
42
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
41
43
 
42
44
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
43
45
 
@@ -81,7 +83,7 @@ var TRIGGER_SHOW_EVENTS = ['mouseover', 'mouseup', 'pointerdown', 'touchstart'];
81
83
 
82
84
  var reducer = function reducer(state, _ref) {
83
85
  var type = _ref.type,
84
- payload = _objectWithoutProperties(_ref, ["type"]);
86
+ payload = _objectWithoutProperties(_ref, _excluded);
85
87
 
86
88
  switch (type) {
87
89
  case 'align':
@@ -116,10 +118,10 @@ function matches(element, selectorString) {
116
118
  }
117
119
 
118
120
  function closestAncestor(node, s) {
119
- var el = node;
121
+ var element = node;
120
122
  var ancestor = node;
121
123
 
122
- if (!document.documentElement.contains(el)) {
124
+ if (!document.documentElement.contains(element)) {
123
125
  return null;
124
126
  }
125
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clayui/tooltip",
3
- "version": "3.37.0",
3
+ "version": "3.45.0",
4
4
  "description": "ClayTooltip component",
5
5
  "license": "BSD-3-Clause",
6
6
  "repository": "https://github.com/liferay/clay",
@@ -26,7 +26,7 @@
26
26
  "react"
27
27
  ],
28
28
  "dependencies": {
29
- "@clayui/shared": "^3.37.0",
29
+ "@clayui/shared": "^3.45.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": "0079c5f752a4c2fd2885e507d466bfd63fe57a9f"
41
+ "gitHead": "82d19a7d31a21a6bb4ac92a0d709b32fc19502e9"
42
42
  }
@@ -122,10 +122,10 @@ function matches(
122
122
  }
123
123
 
124
124
  function closestAncestor(node: HTMLElement, s: string) {
125
- const el = node;
125
+ const element = node;
126
126
  let ancestor: HTMLElement | null = node;
127
127
 
128
- if (!document.documentElement.contains(el)) {
128
+ if (!document.documentElement.contains(element)) {
129
129
  return null;
130
130
  }
131
131
 
@@ -11,7 +11,7 @@ describe('ClayTooltip', () => {
11
11
  afterEach(cleanup);
12
12
 
13
13
  it('renders', () => {
14
- const {container} = render(<ClayTooltip show>{'Tooltip'}</ClayTooltip>);
14
+ const {container} = render(<ClayTooltip show>Tooltip</ClayTooltip>);
15
15
 
16
16
  expect(container).toMatchSnapshot();
17
17
  });
@@ -26,7 +26,7 @@ describe('ClayTooltip', () => {
26
26
  data-tooltip-align="bottom"
27
27
  title="Bottom"
28
28
  >
29
- {'tooltip'}
29
+ tooltip
30
30
  </button>
31
31
  </ClayTooltipProvider>
32
32
  );
package/CHANGELOG.md DELETED
@@ -1,180 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [3.37.0](https://github.com/liferay/clay/compare/v3.36.0...v3.37.0) (2021-10-06)
7
-
8
- **Note:** Version bump only for package @clayui/tooltip
9
-
10
- # [3.36.0](https://github.com/liferay/clay/compare/v3.35.3...v3.36.0) (2021-09-23)
11
-
12
- ### Bug Fixes
13
-
14
- - **@clayui/tooltip:** forces tooltip to be repositioned when the x-axis is modified ([b62313c](https://github.com/liferay/clay/commit/b62313c))
15
- - **@clayui/tooltip:** stop the always showing warnings ([3858bfe](https://github.com/liferay/clay/commit/3858bfe))
16
- - **@clyaui/tooltip:** fixes error when not forcing Tooltip repositioning when X axis is modified ([187f1ef](https://github.com/liferay/clay/commit/187f1ef))
17
-
18
- ## [3.35.3](https://github.com/liferay/clay/compare/v3.35.2...v3.35.3) (2021-09-09)
19
-
20
- **Note:** Version bump only for package @clayui/tooltip
21
-
22
- ## [3.35.2](https://github.com/liferay/clay/compare/v3.35.1...v3.35.2) (2021-08-30)
23
-
24
- **Note:** Version bump only for package @clayui/tooltip
25
-
26
- ## [3.35.1](https://github.com/liferay/clay/compare/v3.35.0...v3.35.1) (2021-08-30)
27
-
28
- **Note:** Version bump only for package @clayui/tooltip
29
-
30
- # [3.35.0](https://github.com/liferay/clay/compare/v3.34.0...v3.35.0) (2021-08-30)
31
-
32
- ### Features
33
-
34
- - **@clayui/tooltip:** replaces direct use of dom-align with doAlign with RTL support ([2afa54c](https://github.com/liferay/clay/commit/2afa54c))
35
-
36
- # [3.32.0](https://github.com/liferay/clay/compare/v3.31.0...v3.32.0) (2021-07-28)
37
-
38
- ### Bug Fixes
39
-
40
- - **@clayui/tooltip:** Hide tooltip on `dragstart` ([70d78da](https://github.com/liferay/clay/commit/70d78da))
41
-
42
- # [3.29.0](https://github.com/liferay/clay/compare/v3.28.0...v3.29.0) (2021-05-28)
43
-
44
- **Note:** Version bump only for package @clayui/tooltip
45
-
46
- # [3.28.0](https://github.com/liferay/clay/compare/v3.27.0...v3.28.0) (2021-05-19)
47
-
48
- ### Features
49
-
50
- - **@clayui/tooltip:** Add the new ContainerProps API ([728600c](https://github.com/liferay/clay/commit/728600c))
51
- - **@clayui/tooltip:** update logic to handle scoping and a global listener ([1c83d30](https://github.com/liferay/clay/commit/1c83d30))
52
-
53
- # [3.27.0](https://github.com/liferay/clay/compare/v3.26.0...v3.27.0) (2021-05-05)
54
-
55
- **Note:** Version bump only for package @clayui/tooltip
56
-
57
- ## [3.4.5](https://github.com/liferay/clay/compare/@clayui/tooltip@3.4.4...@clayui/tooltip@3.4.5) (2021-02-11)
58
-
59
- **Note:** Version bump only for package @clayui/tooltip
60
-
61
- ## [3.4.4](https://github.com/liferay/clay/compare/@clayui/tooltip@3.4.3...@clayui/tooltip@3.4.4) (2021-01-27)
62
-
63
- **Note:** Version bump only for package @clayui/tooltip
64
-
65
- ## [3.4.3](https://github.com/liferay/clay/compare/@clayui/tooltip@3.4.2...@clayui/tooltip@3.4.3) (2021-01-13)
66
-
67
- **Note:** Version bump only for package @clayui/tooltip
68
-
69
- ## [3.4.2](https://github.com/liferay/clay/compare/@clayui/tooltip@3.4.0...@clayui/tooltip@3.4.2) (2020-12-16)
70
-
71
- **Note:** Version bump only for package @clayui/tooltip
72
-
73
- ## [3.4.1](https://github.com/liferay/clay/compare/@clayui/tooltip@3.4.0...@clayui/tooltip@3.4.1) (2020-12-02)
74
-
75
- **Note:** Version bump only for package @clayui/tooltip
76
-
77
- # [3.4.0](https://github.com/liferay/clay/compare/@clayui/tooltip@3.3.5...@clayui/tooltip@3.4.0) (2020-10-01)
78
-
79
- ### Features
80
-
81
- - **clayui.com:** Move API tables to new files and update document tabs, rename files to use singular naming instead of plural, change mainTabURL of pagination-bar to a proper one ([d812ee9](https://github.com/liferay/clay/commit/d812ee9))
82
- - add displayName for all components ([cc3211d](https://github.com/liferay/clay/commit/cc3211d))
83
-
84
- ## [3.3.5](https://github.com/liferay/clay/compare/@clayui/tooltip@3.3.4...@clayui/tooltip@3.3.5) (2020-08-28)
85
-
86
- **Note:** Version bump only for package @clayui/tooltip
87
-
88
- ## [3.3.4](https://github.com/liferay/clay/compare/@clayui/tooltip@3.3.3...@clayui/tooltip@3.3.4) (2020-08-26)
89
-
90
- **Note:** Version bump only for package @clayui/tooltip
91
-
92
- ## [3.3.3](https://github.com/liferay/clay/compare/@clayui/tooltip@3.3.2...@clayui/tooltip@3.3.3) (2020-07-28)
93
-
94
- ### Bug Fixes
95
-
96
- - update packages to appropriate dependencies ([0026168](https://github.com/liferay/clay/commit/0026168))
97
-
98
- ## [3.3.2](https://github.com/liferay/clay/compare/@clayui/tooltip@3.3.1...@clayui/tooltip@3.3.2) (2020-07-07)
99
-
100
- **Note:** Version bump only for package @clayui/tooltip
101
-
102
- ## [3.3.1](https://github.com/liferay/clay/compare/@clayui/tooltip@3.3.0...@clayui/tooltip@3.3.1) (2020-06-18)
103
-
104
- **Note:** Version bump only for package @clayui/tooltip
105
-
106
- # [3.3.0](https://github.com/liferay/clay/compare/@clayui/tooltip@3.2.3...@clayui/tooltip@3.3.0) (2020-05-21)
107
-
108
- ### Features
109
-
110
- - **clayui.com:** Improve component docs by updating content - Pagination, Popover, Progress Bar, Slider, Toggle & Tooltip ([01b555a](https://github.com/liferay/clay/commit/01b555a))
111
- - **clayui.com:** Improve component docs by updating content - Typos, wording, and variable names ([f1d795c](https://github.com/liferay/clay/commit/f1d795c))
112
-
113
- ## [3.2.3](https://github.com/liferay/clay/compare/@clayui/tooltip@3.2.2...@clayui/tooltip@3.2.3) (2020-04-24)
114
-
115
- **Note:** Version bump only for package @clayui/tooltip
116
-
117
- ## [3.2.2](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.2.1...@clayui/tooltip@3.2.2) (2020-03-13)
118
-
119
- ### Bug Fixes
120
-
121
- - **@clayui/tooltip:** remove polyfill in favor of ponyfill(ponyfill.com) ([3a149e0](https://github.com/liferay/clay/commit/3a149e0))
122
-
123
- ## [3.2.1](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.2.0...@clayui/tooltip@3.2.1) (2020-03-12)
124
-
125
- ### Bug Fixes
126
-
127
- - **@clayui/tooltip:** add polyfill for element.matches ([a16ff00](https://github.com/liferay/clay/commit/a16ff00))
128
-
129
- # 3.2.0 (2020-02-28)
130
-
131
- ### Bug Fixes
132
-
133
- - **css:** allow newline characters to display properly for tooltips ([2265d10](https://github.com/liferay/clay/commit/2265d10))
134
- - **drop-down:** use dom-align instead of metal-position ([335ff38](https://github.com/liferay/clay/commit/335ff38))
135
- - **tooltip:** add missing dependency ([7203e50](https://github.com/liferay/clay/commit/7203e50))
136
- - **tooltip:** find closest node with title attribute ([7dc7fb0](https://github.com/liferay/clay/commit/7dc7fb0))
137
- - **tooltip+popover:** stories should be nested under Components ([f9799f9](https://github.com/liferay/clay/commit/f9799f9))
138
-
139
- ### Features
140
-
141
- - **tooltip:** allow custom renderer for TooltipProvider content ([bf64914](https://github.com/liferay/clay/commit/bf64914))
142
- - **tooltip:** create Tooltip component ([cb41eef](https://github.com/liferay/clay/commit/cb41eef))
143
-
144
- # [3.1.0](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.0.4...@clayui/tooltip@3.1.0) (2020-01-31)
145
-
146
- ### Bug Fixes
147
-
148
- - **css:** allow newline characters to display properly for tooltips ([2265d10](https://github.com/liferay/clay/commit/2265d10))
149
- - **drop-down:** use dom-align instead of metal-position ([335ff38](https://github.com/liferay/clay/commit/335ff38))
150
-
151
- ### Features
152
-
153
- - **tooltip:** allow custom renderer for TooltipProvider content ([bf64914](https://github.com/liferay/clay/commit/bf64914))
154
-
155
- ## [3.0.6](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.0.4...@clayui/tooltip@3.0.6) (2020-01-20)
156
-
157
- ### Bug Fixes
158
-
159
- - **css:** allow newline characters to display properly for tooltips ([2265d10](https://github.com/liferay/clay/commit/2265d10))
160
- - **drop-down:** use dom-align instead of metal-position ([335ff38](https://github.com/liferay/clay/commit/335ff38))
161
-
162
- ## [3.0.5](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.0.4...@clayui/tooltip@3.0.5) (2019-12-05)
163
-
164
- ### Bug Fixes
165
-
166
- - **drop-down:** use dom-align instead of metal-position ([335ff38](https://github.com/liferay/clay/commit/335ff38))
167
-
168
- ## [3.0.4](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.0.3...@clayui/tooltip@3.0.4) (2019-11-07)
169
-
170
- **Note:** Version bump only for package @clayui/tooltip
171
-
172
- ## [3.0.3](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.0.2...@clayui/tooltip@3.0.3) (2019-11-01)
173
-
174
- **Note:** Version bump only for package @clayui/tooltip
175
-
176
- ## [3.0.2](https://github.com/liferay/clay/tree/master/packages/clay-tooltip/compare/@clayui/tooltip@3.0.1...@clayui/tooltip@3.0.2) (2019-10-28)
177
-
178
- ### Bug Fixes
179
-
180
- - **tooltip:** find closest node with title attribute ([7dc7fb0](https://github.com/liferay/clay/commit/7dc7fb0))