@telus-uds/components-community.sticky 1.5.2 → 1.5.3
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/CHANGELOG.md +12 -2
- package/lib/Sticky.js +6 -8
- package/lib-module/Sticky.js +6 -6
- package/package.json +4 -4
- package/src/Sticky.jsx +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-community.sticky
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 17 May 2024 16:25:38 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.5.3
|
|
8
|
+
|
|
9
|
+
Fri, 17 May 2024 16:25:38 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @telus-uds/components-base to v1.85.0
|
|
14
|
+
- Bump @telus-uds/system-theme-tokens to v2.56.0
|
|
15
|
+
- Bump @telus-uds/components-web to v2.34.0
|
|
16
|
+
|
|
7
17
|
## 1.5.2
|
|
8
18
|
|
|
9
|
-
Mon, 06 May 2024 16:
|
|
19
|
+
Mon, 06 May 2024 16:39:58 GMT
|
|
10
20
|
|
|
11
21
|
### Patches
|
|
12
22
|
|
package/lib/Sticky.js
CHANGED
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
10
10
|
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
|
11
11
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
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; }
|
|
16
14
|
function createObserver(ref, callback) {
|
|
17
15
|
let workWithViewport = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
18
16
|
const options = {
|
|
@@ -63,12 +61,12 @@ const Sticky = _ref2 => {
|
|
|
63
61
|
// eslint-disable-next-line no-param-reassign
|
|
64
62
|
variant = 'default';
|
|
65
63
|
}
|
|
66
|
-
const sentinelTopRef =
|
|
67
|
-
const sentinelBottomRef =
|
|
68
|
-
const stickyWrapperRef =
|
|
69
|
-
const [observer, setObserver] =
|
|
64
|
+
const sentinelTopRef = _react.default.useRef();
|
|
65
|
+
const sentinelBottomRef = _react.default.useRef();
|
|
66
|
+
const stickyWrapperRef = _react.default.useRef();
|
|
67
|
+
const [observer, setObserver] = _react.default.useState();
|
|
70
68
|
const onStickThrottled = (0, _lodash.default)(onStick, throttleTime, throttleConfig);
|
|
71
|
-
|
|
69
|
+
_react.default.useEffect(() => {
|
|
72
70
|
if (observer) {
|
|
73
71
|
observer.disconnect();
|
|
74
72
|
}
|
package/lib-module/Sticky.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { spacingProps, Box } from '@telus-uds/components-base';
|
|
4
4
|
import throttle from 'lodash.throttle';
|
|
@@ -56,12 +56,12 @@ const Sticky = _ref2 => {
|
|
|
56
56
|
// eslint-disable-next-line no-param-reassign
|
|
57
57
|
variant = 'default';
|
|
58
58
|
}
|
|
59
|
-
const sentinelTopRef = useRef();
|
|
60
|
-
const sentinelBottomRef = useRef();
|
|
61
|
-
const stickyWrapperRef = useRef();
|
|
62
|
-
const [observer, setObserver] = useState();
|
|
59
|
+
const sentinelTopRef = React.useRef();
|
|
60
|
+
const sentinelBottomRef = React.useRef();
|
|
61
|
+
const stickyWrapperRef = React.useRef();
|
|
62
|
+
const [observer, setObserver] = React.useState();
|
|
63
63
|
const onStickThrottled = throttle(onStick, throttleTime, throttleConfig);
|
|
64
|
-
useEffect(() => {
|
|
64
|
+
React.useEffect(() => {
|
|
65
65
|
if (observer) {
|
|
66
66
|
observer.disconnect();
|
|
67
67
|
}
|
package/package.json
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
"extends @telus-uds/browserslist-config"
|
|
5
5
|
],
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@telus-uds/components-base": "1.
|
|
7
|
+
"@telus-uds/components-base": "1.85.0",
|
|
8
8
|
"@telus-uds/system-constants": "^1.3.0",
|
|
9
|
-
"@telus-uds/system-theme-tokens": "^2.
|
|
9
|
+
"@telus-uds/system-theme-tokens": "^2.56.0",
|
|
10
10
|
"lodash.throttle": "^4.1.1",
|
|
11
11
|
"prop-types": "^15.7.2",
|
|
12
12
|
"styled-components": "^5.3.10"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@telus-uds/components-web": "^2.
|
|
15
|
+
"@telus-uds/components-web": "^2.34.0",
|
|
16
16
|
"@telus-uds/browserslist-config": "^1.0.5",
|
|
17
17
|
"@testing-library/jest-dom": "^5.16.1",
|
|
18
18
|
"@testing-library/react": "^13.3.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"standard-engine": {
|
|
47
47
|
"skip": true
|
|
48
48
|
},
|
|
49
|
-
"version": "1.5.
|
|
49
|
+
"version": "1.5.3"
|
|
50
50
|
}
|
package/src/Sticky.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { spacingProps, Box } from '@telus-uds/components-base'
|
|
4
4
|
import throttle from 'lodash.throttle'
|
|
@@ -37,14 +37,14 @@ const Sticky = ({
|
|
|
37
37
|
variant = 'default'
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
const sentinelTopRef = useRef()
|
|
41
|
-
const sentinelBottomRef = useRef()
|
|
42
|
-
const stickyWrapperRef = useRef()
|
|
43
|
-
const [observer, setObserver] = useState()
|
|
40
|
+
const sentinelTopRef = React.useRef()
|
|
41
|
+
const sentinelBottomRef = React.useRef()
|
|
42
|
+
const stickyWrapperRef = React.useRef()
|
|
43
|
+
const [observer, setObserver] = React.useState()
|
|
44
44
|
|
|
45
45
|
const onStickThrottled = throttle(onStick, throttleTime, throttleConfig)
|
|
46
46
|
|
|
47
|
-
useEffect(() => {
|
|
47
|
+
React.useEffect(() => {
|
|
48
48
|
if (observer) {
|
|
49
49
|
observer.disconnect()
|
|
50
50
|
}
|