linear-react-components-ui 1.0.15-rc.0 → 1.0.15
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/index.d.ts +1 -1
- package/lib/panel/Content.d.ts +1 -1
- package/lib/panel/Content.js +6 -2
- package/lib/panel/DangerPanel.d.ts +1 -1
- package/lib/panel/Default.d.ts +1 -1
- package/lib/panel/Header.d.ts +1 -1
- package/lib/panel/InfoPanel.d.ts +1 -1
- package/lib/panel/PrimaryPanel.d.ts +1 -1
- package/lib/panel/SuccessPanel.d.ts +1 -1
- package/lib/panel/ToolBar.d.ts +1 -1
- package/lib/panel/WarningPanel.d.ts +1 -1
- package/lib/panel/helpers.d.ts +1 -1
- package/lib/panel/helpers.js +9 -7
- package/lib/panel/index.d.ts +1 -1
- package/lib/panel/types.d.ts +1 -1
- package/lib/{types-b7be23b5.d.ts → types-c2a0f035.d.ts} +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { default as List } from './list/index.js';
|
|
|
7
7
|
export { default as Radio } from './radio/index.js';
|
|
8
8
|
export { default as Tab } from './tabs/index.js';
|
|
9
9
|
export { default as Dialog } from './dialog/base/index.js';
|
|
10
|
-
import './types-
|
|
10
|
+
import './types-c2a0f035.js';
|
|
11
11
|
import 'react';
|
|
12
12
|
import './@types/PermissionAttr.js';
|
|
13
13
|
import './internals/colorStyles.js';
|
package/lib/panel/Content.d.ts
CHANGED
package/lib/panel/Content.js
CHANGED
|
@@ -62,12 +62,15 @@ var PanelContent = function PanelContent(_ref) {
|
|
|
62
62
|
}, _callee);
|
|
63
63
|
})), [onEndReached, onEndReachedThreshold, rootElementRef.current, lastScrollHeight.current]);
|
|
64
64
|
(0, _react.useEffect)(function () {
|
|
65
|
+
var observer;
|
|
65
66
|
if (rootElementRef.current && onEndReached) {
|
|
66
|
-
|
|
67
|
+
observer = new ResizeObserver(function () {
|
|
67
68
|
var _ref3 = rootElementRef.current,
|
|
68
69
|
scrollHeight = _ref3.scrollHeight;
|
|
69
70
|
if (scrollHeight !== lastScrollHeight.current) {
|
|
71
|
+
var _observer;
|
|
70
72
|
enableOnEndReached.current = true;
|
|
73
|
+
(_observer = observer) === null || _observer === void 0 ? void 0 : _observer.disconnect();
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
76
|
observer.observe(rootElementRef.current);
|
|
@@ -75,9 +78,10 @@ var PanelContent = function PanelContent(_ref) {
|
|
|
75
78
|
rootElementRef.current.addEventListener('resize', onScrollEndReached);
|
|
76
79
|
}
|
|
77
80
|
return function () {
|
|
78
|
-
var _rootElementRef$curre, _rootElementRef$curre2;
|
|
81
|
+
var _rootElementRef$curre, _rootElementRef$curre2, _observer2;
|
|
79
82
|
(_rootElementRef$curre = rootElementRef.current) === null || _rootElementRef$curre === void 0 ? void 0 : _rootElementRef$curre.removeEventListener('scroll', onScrollEndReached);
|
|
80
83
|
(_rootElementRef$curre2 = rootElementRef.current) === null || _rootElementRef$curre2 === void 0 ? void 0 : _rootElementRef$curre2.removeEventListener('resize', onScrollEndReached);
|
|
84
|
+
(_observer2 = observer) === null || _observer2 === void 0 ? void 0 : _observer2.disconnect();
|
|
81
85
|
};
|
|
82
86
|
}, [onScrollEndReached]);
|
|
83
87
|
if (!opened) return null;
|
package/lib/panel/Default.d.ts
CHANGED
package/lib/panel/Header.d.ts
CHANGED
package/lib/panel/InfoPanel.d.ts
CHANGED
package/lib/panel/ToolBar.d.ts
CHANGED
package/lib/panel/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { P as default, g as getCurrentThreshold, n as numberAroundZeroAndOne } from '../types-
|
|
2
|
+
export { P as default, g as getCurrentThreshold, n as numberAroundZeroAndOne } from '../types-c2a0f035.js';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../internals/colorStyles.js';
|
|
5
5
|
import '../@types/Icon.js';
|
package/lib/panel/helpers.js
CHANGED
|
@@ -20,15 +20,17 @@ function numberAroundZeroAndOne(_ref) {
|
|
|
20
20
|
}
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
|
-
function getCurrentThreshold(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
function getCurrentThreshold(scrollableElement, scrollThreshold) {
|
|
24
|
+
var MIN_THRESHOLD = 0;
|
|
25
|
+
var MAX_THRESHOLD = 1;
|
|
26
|
+
if (scrollThreshold < MIN_THRESHOLD) return MIN_THRESHOLD;
|
|
27
|
+
if (scrollThreshold > MAX_THRESHOLD) return MAX_THRESHOLD;
|
|
28
|
+
var scrollHeight = scrollableElement.scrollHeight,
|
|
29
|
+
clientHeight = scrollableElement.clientHeight;
|
|
28
30
|
var offsetHeight = scrollHeight - clientHeight;
|
|
29
|
-
var
|
|
31
|
+
var calculatedScrollThreshold = Math.round(scrollHeight * scrollThreshold);
|
|
30
32
|
var maxScrollThreshold = Math.round(offsetHeight - offsetHeight * 0.3);
|
|
31
|
-
return Math.min(
|
|
33
|
+
return Math.min(calculatedScrollThreshold, maxScrollThreshold);
|
|
32
34
|
}
|
|
33
35
|
var PanelContext = /*#__PURE__*/_react.default.createContext({});
|
|
34
36
|
var _default = PanelContext;
|
package/lib/panel/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { default as SuccessPanel } from './SuccessPanel.js';
|
|
|
6
6
|
export { default as InfoPanel } from './InfoPanel.js';
|
|
7
7
|
export { default as PanelHeader } from './Header.js';
|
|
8
8
|
export { default as PanelContent } from './Content.js';
|
|
9
|
-
import '../types-
|
|
9
|
+
import '../types-c2a0f035.js';
|
|
10
10
|
import 'react';
|
|
11
11
|
import '../@types/PermissionAttr.js';
|
|
12
12
|
import '../internals/colorStyles.js';
|
package/lib/panel/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { A as AsyncFunc, C as ContextProps, F as Func, a as IPanelContentProps, b as IPanelHeaderProps, I as IPanelProps, c as IParameterFunction } from '../types-
|
|
2
|
+
export { A as AsyncFunc, C as ContextProps, F as Func, a as IPanelContentProps, b as IPanelHeaderProps, I as IPanelProps, c as IParameterFunction } from '../types-c2a0f035.js';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../internals/colorStyles.js';
|
|
5
5
|
import '../@types/Icon.js';
|
|
@@ -4,7 +4,7 @@ import ColorStyles from './internals/colorStyles.js';
|
|
|
4
4
|
import { IconNames } from './@types/Icon.js';
|
|
5
5
|
|
|
6
6
|
declare function numberAroundZeroAndOne({ props, propName, componentName }: IParameterFunction): number | Error | null;
|
|
7
|
-
declare function getCurrentThreshold(
|
|
7
|
+
declare function getCurrentThreshold(scrollableElement: HTMLDivElement, scrollThreshold: number): number;
|
|
8
8
|
declare const PanelContext: React__default.Context<ContextProps>;
|
|
9
9
|
|
|
10
10
|
type Func = () => void;
|