@homecode/ui 4.20.4 → 4.21.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/dist/esm/src/components/Autocomplete/Autocomplete.js +3 -3
- package/dist/esm/src/components/Icon/icons/brain.svg.js +19 -0
- package/dist/esm/src/components/Icon/icons/compas.svg.js +56 -0
- package/dist/esm/src/components/Icon/icons/globe.svg.js +17 -0
- package/dist/esm/src/components/Icon/icons/index.js +5 -0
- package/dist/esm/src/components/Icon/icons/routeFrom.svg.js +31 -0
- package/dist/esm/src/components/Icon/icons/routeTo.svg.js +31 -0
- package/dist/esm/src/components/Menu/Menu.js +3 -1
- package/dist/esm/src/components/Scroll/Scroll.js +228 -223
- package/dist/esm/src/components/Tabs/Tabs.js +3 -2
- package/dist/esm/src/components/Tabs/Tabs.styl.js +2 -2
- package/dist/esm/src/components/Virtualized/List/ListScroll.js +1 -0
- package/dist/esm/types/src/components/Icon/Icon.d.ts +5 -0
- package/dist/esm/types/src/components/Icon/icons/index.d.ts +5 -0
- package/dist/esm/types/src/components/Menu/Menu.d.ts +1 -1
- package/dist/esm/types/src/components/Scroll/Scroll.d.ts +1 -67
- package/dist/esm/types/src/hooks/useResizeObserver.d.ts +1 -0
- package/package.json +1 -1
|
@@ -19,11 +19,11 @@ import '../Label/Label.styl.js';
|
|
|
19
19
|
import { Popup } from '../Popup/Popup.js';
|
|
20
20
|
import '../RequiredStar/RequiredStar.styl.js';
|
|
21
21
|
import '../Select/Select.styl.js';
|
|
22
|
-
import 'justorm/react';
|
|
23
|
-
import 'lodash.omit';
|
|
24
22
|
import 'compareq';
|
|
25
23
|
import 'lodash.pick';
|
|
26
24
|
import '../Scroll/Scroll.styl.js';
|
|
25
|
+
import 'justorm/react';
|
|
26
|
+
import 'lodash.omit';
|
|
27
27
|
import 'nanoid';
|
|
28
28
|
import '../Checkbox/Checkbox.styl.js';
|
|
29
29
|
import '../Container/Container.styl.js';
|
|
@@ -72,7 +72,7 @@ function Autocomplete(props) {
|
|
|
72
72
|
// @ts-ignore
|
|
73
73
|
const inputRef = useRef(null);
|
|
74
74
|
const isOpen = options.length > 0;
|
|
75
|
-
const classes = cn(S.root, className);
|
|
75
|
+
const classes = cn(S.root, className, popupProps.className);
|
|
76
76
|
const handleFocus = (e) => {
|
|
77
77
|
isFocusedRef.current = true;
|
|
78
78
|
inputProps?.onFocus?.(e);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path, _path2;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
5
|
+
var SvgBrain = function SvgBrain(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
width: 604,
|
|
9
|
+
height: 618.667,
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
viewBox: "0 0 453 464"
|
|
12
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "M175.9 65.5c-10.3 3.3-18.8 11.3-22 20.7l-1.8 5.3-4.5-.3c-15.5-1.2-31.1 8.2-38 22.8-2.5 5.4-3.2 8-3.4 15.1l-.4 8.6-4.9 3.8c-9 6.8-15.7 19.7-17.4 33.5-1.1 9.1 2.3 21.7 8.5 31.7 1.2 1.9 1.1 2.4-1.9 4.9C77.6 222 70 238.2 70 254c0 17.5 10.4 36.7 25 46 4.9 3.2 5 3.3 5 8.4.1 16.7 10.9 33.9 26.1 41.3 3.5 1.7 7.2 3.4 8.1 3.7s2.9 3 4.3 6c7.6 16 24.7 25.8 42.5 24.3 11.9-1 23.1-6.8 29.3-15.2 1.7-2.4 3.4-4.4 3.7-4.4.3-.1 1.5 1.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.1 10.3-4 10.3-5.4 0-8.1-6.2-4.5-10.2 2-2.2 6.1-2.3 8.5-.1m62.3 76.9c2.5 2.5 1.6 7.5-1.7 9.4-2.5 1.3-3.1 1.3-5.5 0-5.4-3-3.4-11 2.8-11 1.5 0 3.5.7 4.4 1.6"
|
|
14
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
15
|
+
d: "M231.7 131.8c-5.6 6.2 5.2 16.1 19.5 17.8 9.7 1.1 24.5-5 26.8-11.2 2.2-5.8-3.6-10.4-8.9-7.1-8.5 5.3-10.4 5.9-16.2 5.5-4.6-.3-6.8-1.1-10.3-3.6-5-3.6-8.5-4.1-10.9-1.4m43.4 52.7c-1.6 1.4-4.3 5.2-5.8 8.3-2.3 4.8-2.8 7-2.8 13.7s.5 8.9 2.8 13.7c3 6.1 7.7 10.8 10.8 10.8 2.7 0 5.9-3.5 5.9-6.4 0-1.4-1.1-3.8-2.5-5.4-3.2-3.9-4.5-7.4-4.5-12.7s1.3-8.8 4.5-12.7c3-3.6 3.2-7.1.5-9.8s-5.2-2.5-8.9.5m-65.4 35.3c-2.2 2.4-2.1 6.5.1 8.5 4 3.6 10.2.9 10.2-4.5 0-5.1-6.9-7.8-10.3-4m50.7 49.6c-9.8 4.5-16.1 15.4-15.2 26.2.5 6.2 2.8 9.4 6.8 9.4 3.8 0 6.2-3 6-7.7-.1-2.1-.2-5-.1-6.5.1-3.1 5.2-9.4 8.4-10.4 3.2-.9 6.7-4.4 6.7-6.6s-4.3-6.8-6.2-6.8c-.7 0-3.6 1.1-6.4 2.4"
|
|
16
|
+
})));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { SvgBrain as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _linearGradient, _path;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
5
|
+
var SvgCompas = function SvgCompas(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
viewBox: "0 0 24 24"
|
|
11
|
+
}, props), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
12
|
+
id: "compas_svg__a"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("stop", {
|
|
14
|
+
offset: 0,
|
|
15
|
+
style: {
|
|
16
|
+
stopColor: "#e4641d",
|
|
17
|
+
stopOpacity: 1
|
|
18
|
+
}
|
|
19
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
20
|
+
offset: 0.438,
|
|
21
|
+
style: {
|
|
22
|
+
stopColor: "#e2771a",
|
|
23
|
+
stopOpacity: 0
|
|
24
|
+
}
|
|
25
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
26
|
+
offset: 0.563,
|
|
27
|
+
style: {
|
|
28
|
+
stopColor: "#0a69f2",
|
|
29
|
+
stopOpacity: 0
|
|
30
|
+
}
|
|
31
|
+
}), /*#__PURE__*/React.createElement("stop", {
|
|
32
|
+
offset: 1,
|
|
33
|
+
style: {
|
|
34
|
+
stopColor: "#2878e5",
|
|
35
|
+
stopOpacity: 1
|
|
36
|
+
}
|
|
37
|
+
})), _linearGradient || (_linearGradient = /*#__PURE__*/React.createElement("linearGradient", {
|
|
38
|
+
xlinkHref: "#compas_svg__a",
|
|
39
|
+
id: "compas_svg__b",
|
|
40
|
+
x1: 16.621,
|
|
41
|
+
x2: 40.144,
|
|
42
|
+
y1: 9.343,
|
|
43
|
+
y2: 9.343,
|
|
44
|
+
gradientTransform: "rotate(-91.68 21.524 18.62)",
|
|
45
|
+
gradientUnits: "userSpaceOnUse"
|
|
46
|
+
}))), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
47
|
+
d: "M12.05.285c-.588 0-.958.602-1.697 1.802-1.87 3.053-4.618 7.89-4.617 9.964 0 2.074 2.75 6.914 4.62 9.964.736 1.202 1.106 1.803 1.695 1.802.588 0 .958-.603 1.697-1.802 1.87-3.054 4.619-7.89 4.618-9.964s-2.75-6.911-4.621-9.96C13.009.887 12.639.283 12.05.284"
|
|
48
|
+
})), /*#__PURE__*/React.createElement("path", {
|
|
49
|
+
d: "M12.06.27c-.589 0-.96.601-1.7 1.8-1.872 3.052-4.625 7.886-4.626 9.96s2.744 6.917 4.611 9.97c.735 1.202 1.105 1.804 1.694 1.803.588 0 .958-.602 1.698-1.8 1.873-3.053 4.627-7.886 4.627-9.96.001-2.074-2.743-6.914-4.611-9.964C13.018.873 12.648.268 12.059.269",
|
|
50
|
+
style: {
|
|
51
|
+
fill: "url(#compas_svg__b)"
|
|
52
|
+
}
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { SvgCompas as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path, _path2;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
5
|
+
var SvgGlobe = function SvgGlobe(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
viewBox: "0 0 24 24"
|
|
10
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M20.73 16.336a.47.47 0 0 0-.661.073 10 10 0 0 1-.692.778.47.47 0 0 0 .005.666.47.47 0 0 0 .33.136.47.47 0 0 0 .336-.141 11 11 0 0 0 .756-.85.47.47 0 0 0-.073-.662m-1.85 1.958a.47.47 0 0 0-.66-.091c-1.78 1.35-3.939 2.132-6.24 2.262a.47.47 0 0 0 .025.941h.027c2.49-.141 4.826-.99 6.757-2.453a.47.47 0 0 0 .09-.66"
|
|
12
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "M23.492 9.514c-.268-1.022-.695-2-1.27-2.91a11.3 11.3 0 0 0-3.192-3.29c-2.045-1.398-4.473-2.137-7.023-2.137a13 13 0 0 0-2.129.177 12.26 12.26 0 0 0-5.41 2.333C2.18 5.441.698 7.9.298 10.61a10 10 0 0 0-.111 1.493c0 1.945.56 3.855 1.62 5.523 1.024 1.613 2.489 2.965 4.235 3.91v.001c.992.536 2.06.935 3.173 1.184a12.8 12.8 0 0 0 2.792.307c2.286 0 4.504-.604 6.414-1.747 1.866-1.116 3.35-2.688 4.292-4.544a10.188 10.188 0 0 0 .779-7.221m-4.275-4.888a10.3 10.3 0 0 1 1.581 1.595l-.93-.214a.97.97 0 0 0-.842.199.97.97 0 0 0-.355.788.04.04 0 0 1-.017.032l-.684.447a.04.04 0 0 1-.038 0l-.963-.548a.23.23 0 0 1-.107-.246l.216-.925a.224.224 0 0 1 .213-.173l.816-.023a1.174 1.174 0 0 0 1.11-.932M6.037 19.403l-.137.96c-2.96-1.848-4.771-4.957-4.771-8.26q0-.44.042-.882l.63.102q.24.039.482.039h.32c.442 0 .881.145 1.237.408l.484.359a.19.19 0 0 1 .073.129l.066.606a.185.185 0 0 1-.155.203c-.55.088-.958.574-.949 1.131l.035 2.135a1.12 1.12 0 0 0 .23.666l.768 1.006a3 3 0 0 0 1.416 1.022.346.346 0 0 1 .23.376m3.033 2.314a11.4 11.4 0 0 1-2.29-.858l.189-1.322a1.29 1.29 0 0 0-.855-1.4 2.07 2.07 0 0 1-.974-.704l-.768-1.005a.2.2 0 0 1-.038-.11l-.034-2.135a.186.186 0 0 1 .156-.186 1.126 1.126 0 0 0 .942-1.234l-.065-.606a1.13 1.13 0 0 0-.45-.785l-.483-.358a3.04 3.04 0 0 0-1.799-.594h-.319q-.166 0-.331-.027l-.644-.104c.457-2.285 1.77-4.35 3.733-5.854a11.3 11.3 0 0 1 4.795-2.117 2.1 2.1 0 0 1 .602.832l.026.067a2 2 0 0 1 .132.527l.024.205a2.1 2.1 0 0 1-.161 1.074l-.256.583a2.07 2.07 0 0 1-.796.923l-.319.201a1.06 1.06 0 0 0-.493.949l.043.861a.11.11 0 0 1-.036.09.11.11 0 0 1-.091.032.12.12 0 0 1-.092-.06l-.392-.728a1.06 1.06 0 0 0-.647-.518L5.995 6.97a1.6 1.6 0 0 0-1.098.084l-.33.15a1.614 1.614 0 0 0-.902 1.826 1.6 1.6 0 0 0 .43.776l.9.9a2 2 0 0 1 .145.16l.617.761a1.42 1.42 0 0 0 1.108.529h.005l1.68-.005h.002c.172 0 .333.092.42.24a1.43 1.43 0 0 0 .933.677l.63.135a.49.49 0 0 1 .325.243l.304.557a1.25 1.25 0 0 0 .533.518l1.43.726a.31.31 0 0 1 .169.32.3.3 0 0 1-.104.195l-.543.48a1.26 1.26 0 0 0-.343.5l-.119.316a.37.37 0 0 1-.206.213l-.578.24a1.31 1.31 0 0 0-.811 1.214.4.4 0 0 1-.043.172zm2.936.369a12 12 0 0 1-1.979-.166l1.355-2.585a1.3 1.3 0 0 0 .15-.61.37.37 0 0 1 .23-.345l.579-.24a1.32 1.32 0 0 0 .727-.752l.118-.315a.3.3 0 0 1 .086-.125l.543-.48a1.25 1.25 0 0 0 .414-.785 1.26 1.26 0 0 0-.677-1.275l-1.43-.727a.3.3 0 0 1-.132-.129l-.305-.558a1.43 1.43 0 0 0-.954-.712l-.63-.135a.49.49 0 0 1-.317-.23 1.43 1.43 0 0 0-1.233-.708h-.004l-1.681.005h-.002a.48.48 0 0 1-.377-.18l-.617-.76a3 3 0 0 0-.21-.234l-.9-.9a.67.67 0 0 1-.178-.321.67.67 0 0 1 .374-.757l.33-.15a.67.67 0 0 1 .455-.035l1.385.386a.12.12 0 0 1 .07.057l.393.728a1.06 1.06 0 0 0 .831.552 1.06 1.06 0 0 0 .832-.289 1.06 1.06 0 0 0 .326-.818l-.043-.861a.12.12 0 0 1 .054-.105l.319-.2a3 3 0 0 0 1.156-1.342l.256-.584a3 3 0 0 0 .235-1.56l-.024-.205a3 3 0 0 0-.192-.766l-.027-.067a3 3 0 0 0-.347-.639h.001q.52-.045 1.04-.045c2.275 0 4.444.634 6.288 1.837l.004.436a.226.226 0 0 1-.218.226l-.816.023a1.17 1.17 0 0 0-1.103.9l-.217.924c-.117.5.112 1.026.558 1.28l.963.548a1 1 0 0 0 .485.13 1 1 0 0 0 .534-.16l.684-.447a.98.98 0 0 0 .443-.853.03.03 0 0 1 .013-.03c.014-.011.027-.008.032-.007l1.056.242.08.015.746.107a9.47 9.47 0 0 1 .803 1.691l-.73-.176-.088-.018-.796-.128a2.67 2.67 0 0 0-2.353.786l-.12.125a2.67 2.67 0 0 0-.695 1.333l-.303 1.535a2.66 2.66 0 0 0 .17 1.583 2.68 2.68 0 0 0 2.148 1.591l.148.017a2.7 2.7 0 0 0 1.204-.139l.502-.18a.225.225 0 0 1 .25.07l.066.082a.23.23 0 0 1 .05.134l.024.819c-1.803 3.449-5.64 5.67-9.812 5.67m10.46-7.23-.055-.067a1.17 1.17 0 0 0-.908-.433q-.198 0-.392.068l-.502.18a1.74 1.74 0 0 1-.78.09l-.148-.016a1.74 1.74 0 0 1-1.391-1.03 1.72 1.72 0 0 1-.11-1.026l.303-1.535a1.73 1.73 0 0 1 .45-.863l.12-.125a1.73 1.73 0 0 1 1.524-.51l.796.13q.008 0 .017.003l1.257.303a9.2 9.2 0 0 1 .237 2.078c0 .943-.14 1.865-.419 2.754"
|
|
14
|
+
})));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { SvgGlobe as default };
|
|
@@ -2,11 +2,13 @@ var ICONS = {
|
|
|
2
2
|
avatar: () => import('./avatar.svg.js'),
|
|
3
3
|
bookmark: () => import('./bookmark.svg.js'),
|
|
4
4
|
bookmarkAdd: () => import('./bookmarkAdd.svg.js'),
|
|
5
|
+
brain: () => import('./brain.svg.js'),
|
|
5
6
|
brokenImage: () => import('./brokenImage.svg.js'),
|
|
6
7
|
camera: () => import('./camera.svg.js'),
|
|
7
8
|
check: () => import('./check.svg.js'),
|
|
8
9
|
close: () => import('./close.svg.js'),
|
|
9
10
|
colors: () => import('./colors.svg.js'),
|
|
11
|
+
compas: () => import('./compas.svg.js'),
|
|
10
12
|
copy: () => import('./copy.svg.js'),
|
|
11
13
|
chevronUp: () => import('./chevronUp.svg.js'),
|
|
12
14
|
chevronDown: () => import('./chevronDown.svg.js'),
|
|
@@ -28,6 +30,7 @@ var ICONS = {
|
|
|
28
30
|
flyover: () => import('./flyover.svg.js'),
|
|
29
31
|
gear: () => import('./gear.svg.js'),
|
|
30
32
|
geolocation: () => import('./geolocation.svg.js'),
|
|
33
|
+
globe: () => import('./globe.svg.js'),
|
|
31
34
|
group: () => import('./group.svg.js'),
|
|
32
35
|
history: () => import('./history.svg.js'),
|
|
33
36
|
image: () => import('./image.svg.js'),
|
|
@@ -50,6 +53,8 @@ var ICONS = {
|
|
|
50
53
|
requiredStar: () => import('./requiredStar.svg.js'),
|
|
51
54
|
rewind: () => import('./rewind.svg.js'),
|
|
52
55
|
route: () => import('./route.svg.js'),
|
|
56
|
+
routeFrom: () => import('./routeFrom.svg.js'),
|
|
57
|
+
routeTo: () => import('./routeTo.svg.js'),
|
|
53
58
|
save: () => import('./save.svg.js'),
|
|
54
59
|
search: () => import('./search.svg.js'),
|
|
55
60
|
send: () => import('./send.svg.js'),
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
5
|
+
var SvgRouteFrom = function SvgRouteFrom(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
viewBox: "0 0 24 24"
|
|
10
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M23.747 12.005c.084 1.132-2.652 5.013-2.652 5.013l-1.923-.269 2.285-3.717-5.815-.273V11.25l5.768-.203-2.216-4.163 1.983-.41s2.63 4.444 2.57 5.53",
|
|
12
|
+
style: {
|
|
13
|
+
strokeWidth: 1.50793
|
|
14
|
+
}
|
|
15
|
+
}), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
16
|
+
fill: "none",
|
|
17
|
+
d: "M24 24H0V0h24z"
|
|
18
|
+
})), /*#__PURE__*/React.createElement("path", {
|
|
19
|
+
d: "M11.07 15.674c-3.217 0-4.828-3.89-2.553-6.164 2.274-2.275 6.164-.664 6.164 2.553a3.61 3.61 0 0 1-3.611 3.61",
|
|
20
|
+
style: {
|
|
21
|
+
strokeWidth: 2.40717
|
|
22
|
+
}
|
|
23
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
24
|
+
d: "M.339 11.956c-.014 9.658 11.54 14.637 18.55 7.995l-1.731-.925C13.482 22.733 6.807 21.856 3.65 17.6c-1.115-1.504-1.804-3.388-1.826-5.548-.082-8.273 9.973-12.213 15.405-7.29l1.522-.926C11.697-2.629.324 2.387.34 11.956Z",
|
|
25
|
+
style: {
|
|
26
|
+
strokeWidth: 1.50793
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { SvgRouteFrom as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
5
|
+
var SvgRouteTo = function SvgRouteTo(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
viewBox: "0 0 24 24"
|
|
10
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M9.068 12.188c-.281-1.075-3.113-4.405-3.113-4.405l-2.511-.379 2.933 3.823-5.76.246v1.508l5.767.202-2.997 4.163 2.669-.629s2.707-3.443 3.012-4.529",
|
|
12
|
+
style: {
|
|
13
|
+
strokeWidth: 1.50793
|
|
14
|
+
}
|
|
15
|
+
}), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
16
|
+
fill: "none",
|
|
17
|
+
d: "M.01.054h24v24h-24Z"
|
|
18
|
+
})), /*#__PURE__*/React.createElement("path", {
|
|
19
|
+
d: "M12.94 8.38c3.218 0 4.828 3.89 2.554 6.164-2.275 2.275-6.164.664-6.164-2.553a3.61 3.61 0 0 1 3.61-3.61",
|
|
20
|
+
style: {
|
|
21
|
+
strokeWidth: 2.40717
|
|
22
|
+
}
|
|
23
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
24
|
+
d: "M23.672 12.098c.014-9.658-11.54-14.637-18.55-7.995l2.067.301c3.676-3.708 10.015-2.206 13.17 2.05 1.115 1.504 1.805 3.388 1.826 5.548.082 8.273-9.973 12.213-15.404 7.29l-1.523.926c7.055 6.465 18.429 1.449 18.412-8.12z",
|
|
25
|
+
style: {
|
|
26
|
+
strokeWidth: 1.50793
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { SvgRouteTo as default };
|
|
@@ -5,7 +5,9 @@ import { Scroll } from '../Scroll/Scroll.js';
|
|
|
5
5
|
import S from './Menu.styl.js';
|
|
6
6
|
|
|
7
7
|
const MenuComponent = forwardRef(({ children, className, ...props }, ref) => {
|
|
8
|
-
return (
|
|
8
|
+
return (
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
jsx(Scroll, { y: true, ref: ref, className: cn(S.root, className), ...props, children: children }));
|
|
9
11
|
});
|
|
10
12
|
const MenuItem = forwardRef((props, ref) => {
|
|
11
13
|
const { children, className, selected, focused, disabled, level = 0, onClick, size = 'm', ...rest } = props;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useRef, useState, useMemo, useCallback, useEffect, createElement } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
-
import { createStore } from 'justorm/react';
|
|
5
|
-
import omit from 'lodash.omit';
|
|
6
4
|
import Time from 'timen';
|
|
7
5
|
import { isTouch } from '../../tools/dom.js';
|
|
8
|
-
import {
|
|
6
|
+
import { observe, unobserve } from '../../tools/resizeObserver.js';
|
|
9
7
|
import S from './Scroll.styl.js';
|
|
10
|
-
import
|
|
8
|
+
import useEvent from '../../hooks/useEvent.js';
|
|
9
|
+
import { useDebounce } from '../../hooks/useDebounce.js';
|
|
11
10
|
|
|
12
11
|
const getEventCoords = e => ({
|
|
13
12
|
x: e.clientX,
|
|
14
13
|
y: e.clientY,
|
|
15
14
|
});
|
|
16
|
-
const
|
|
15
|
+
const OFFSET_THRESHOLD = 5;
|
|
17
16
|
const AXES = ['x', 'y'];
|
|
18
17
|
const BY_AXIS = {
|
|
19
18
|
x: {
|
|
@@ -33,268 +32,274 @@ const BY_AXIS = {
|
|
|
33
32
|
posField: 'top',
|
|
34
33
|
},
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (elem) {
|
|
45
|
-
this.updateAll();
|
|
46
|
-
observe(elem, this.updateAll);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
thumbELem = {
|
|
50
|
-
x: createRef(),
|
|
51
|
-
y: createRef(),
|
|
35
|
+
function Scroll(props) {
|
|
36
|
+
const { x, y, offset, size = 'm', fadeSize, smooth, className, innerClassName, xScrollbarClassName, yScrollbarClassName, innerProps, onInnerRef, thumbClassName, autoHide, children, onScroll, ...rest } = props;
|
|
37
|
+
const innerElemRef = useRef(null);
|
|
38
|
+
const thumbXRef = useRef(null);
|
|
39
|
+
const thumbYRef = useRef(null);
|
|
40
|
+
const thumbElemRef = {
|
|
41
|
+
x: thumbXRef,
|
|
42
|
+
y: thumbYRef,
|
|
52
43
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
componentDidMount() {
|
|
79
|
-
this.updateAll();
|
|
80
|
-
this.unsubscribeScrollHeightObserver = Time.every(100, this.observeScrollHeight);
|
|
81
|
-
document.addEventListener('scroll', this.onDocScroll);
|
|
82
|
-
}
|
|
83
|
-
componentWillUnmount() {
|
|
84
|
-
this.unsubscribeScrollHeightObserver?.();
|
|
85
|
-
this.unsubscribePointerMoveUp();
|
|
86
|
-
document.removeEventListener('scroll', this.onDocScroll);
|
|
87
|
-
}
|
|
88
|
-
eachAxis = fn => AXES.map(axis => this.props[axis] && fn(axis));
|
|
89
|
-
observeScrollHeight = () => {
|
|
90
|
-
this.eachAxis(axis => {
|
|
91
|
-
const needUpdate = (this.props[axis] && this.isScrollSizeChanged(axis)) ||
|
|
92
|
-
this.isBoudingsChanged(axis);
|
|
93
|
-
if (needUpdate)
|
|
94
|
-
this.update(axis);
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
isScrollSizeChanged(axis) {
|
|
98
|
-
const currScrolls = this.getScrollSize(axis);
|
|
99
|
-
const isChanged = this.prevScrolls[axis] !== currScrolls[axis];
|
|
100
|
-
if (isChanged)
|
|
101
|
-
this.prevScrolls[axis] = currScrolls;
|
|
102
|
-
return isChanged;
|
|
103
|
-
}
|
|
104
|
-
isBoudingsChanged(axis) {
|
|
105
|
-
const curroffsetSize = this.getoffsetSize(axis);
|
|
106
|
-
const isChanged = this.prevBoundings[axis] !== curroffsetSize[axis];
|
|
107
|
-
if (isChanged)
|
|
108
|
-
this.prevBoundings[axis] = curroffsetSize[axis];
|
|
109
|
-
return isChanged;
|
|
110
|
-
}
|
|
111
|
-
getoffsetSize = axis => this.innerElem[BY_AXIS[axis].offsetSize];
|
|
112
|
-
getInnerSize = axis => this.innerElem[BY_AXIS[axis].innerSize];
|
|
113
|
-
getScrollSize = axis => this.innerElem[BY_AXIS[axis].scrollSize];
|
|
114
|
-
getScrollPos = axis => this.innerElem[BY_AXIS[axis].scrollPos];
|
|
115
|
-
getThumbSize = axis => this.thumbELem[axis].current[BY_AXIS[axis].offsetSize];
|
|
116
|
-
getOffset(axis) {
|
|
117
|
-
const offset = this.props.offset?.[axis];
|
|
44
|
+
const [isScrolling, setIsScrolling] = useState(false);
|
|
45
|
+
const [activeAxis, setActiveAxis] = useState(null);
|
|
46
|
+
const [coeff, setCoeff] = useState({ x: 0, y: 0 });
|
|
47
|
+
const [hasOffset, setHasOffset] = useState({
|
|
48
|
+
top: false,
|
|
49
|
+
left: false,
|
|
50
|
+
right: false,
|
|
51
|
+
bottom: false,
|
|
52
|
+
});
|
|
53
|
+
const isTouchDevice = useMemo(() => isTouch(), []);
|
|
54
|
+
const posRef = useRef({ x: 0, y: 0 });
|
|
55
|
+
const prevCoordsRef = useRef({ x: 0, y: 0 });
|
|
56
|
+
const prevScrollsRef = useRef({ x: 0, y: 0 });
|
|
57
|
+
const prevBoundingsRef = useRef({ x: 0, y: 0 });
|
|
58
|
+
const eachAxis = useCallback(fn => AXES.map(axis => props[axis] && fn(axis)), [x, y]);
|
|
59
|
+
const getOffsetSize = axis => innerElemRef.current[BY_AXIS[axis].offsetSize];
|
|
60
|
+
const getInnerSize = axis => innerElemRef.current[BY_AXIS[axis].innerSize];
|
|
61
|
+
const getScrollSize = axis => innerElemRef.current[BY_AXIS[axis].scrollSize];
|
|
62
|
+
const getScrollPos = axis => innerElemRef.current[BY_AXIS[axis].scrollPos];
|
|
63
|
+
const getThumbSize = axis => thumbElemRef[axis].current[BY_AXIS[axis].offsetSize];
|
|
64
|
+
const getOffset = useCallback(axis => {
|
|
65
|
+
const axisOffset = offset?.[axis];
|
|
118
66
|
const isVertical = axis === 'y';
|
|
119
67
|
const before = isVertical ? 'top' : 'left';
|
|
120
68
|
const after = isVertical ? 'bottom' : 'right';
|
|
121
69
|
return {
|
|
122
|
-
[before]:
|
|
123
|
-
[after]:
|
|
70
|
+
[before]: axisOffset?.before || 0,
|
|
71
|
+
[after]: axisOffset?.after || 0,
|
|
124
72
|
};
|
|
125
|
-
}
|
|
126
|
-
getCoeffStyle = axis => `${
|
|
127
|
-
getPosStyle = axis => `${
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
73
|
+
}, [offset]);
|
|
74
|
+
const getCoeffStyle = useCallback(axis => `${coeff[axis] * 100}%`, [coeff]);
|
|
75
|
+
const getPosStyle = axis => `${posRef.current[axis]}px`;
|
|
76
|
+
const isScrollSizeChanged = useCallback(axis => {
|
|
77
|
+
const currScrolls = getScrollSize(axis);
|
|
78
|
+
const isChanged = prevScrollsRef.current[axis] !== currScrolls;
|
|
79
|
+
if (isChanged)
|
|
80
|
+
prevScrollsRef.current[axis] = currScrolls;
|
|
81
|
+
return isChanged;
|
|
82
|
+
}, [getScrollSize]);
|
|
83
|
+
const isBoudingsChanged = useCallback(axis => {
|
|
84
|
+
const curroffsetSize = getOffsetSize(axis);
|
|
85
|
+
const isChanged = prevBoundingsRef.current[axis] !== curroffsetSize;
|
|
86
|
+
if (isChanged)
|
|
87
|
+
prevBoundingsRef.current[axis] = curroffsetSize;
|
|
88
|
+
return isChanged;
|
|
89
|
+
}, [getOffsetSize]);
|
|
90
|
+
// Update functions
|
|
91
|
+
const updateCoeff = useCallback(axis => {
|
|
92
|
+
const thumb = thumbElemRef[axis].current;
|
|
93
|
+
if (!innerElemRef.current)
|
|
139
94
|
return;
|
|
140
95
|
const sizeField = BY_AXIS[axis].size;
|
|
141
|
-
|
|
96
|
+
const newCoeff = getInnerSize(axis) / getScrollSize(axis);
|
|
97
|
+
// Only update if the value has changed
|
|
98
|
+
if (coeff[axis] !== newCoeff) {
|
|
99
|
+
setCoeff(prev => ({
|
|
100
|
+
...prev,
|
|
101
|
+
[axis]: newCoeff,
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
142
104
|
if (thumb)
|
|
143
|
-
thumb.style[sizeField] =
|
|
144
|
-
}
|
|
145
|
-
updatePos(axis
|
|
146
|
-
const thumb =
|
|
147
|
-
if (!
|
|
105
|
+
thumb.style[sizeField] = `${newCoeff * 100}%`;
|
|
106
|
+
}, [coeff, getInnerSize, getScrollSize, thumbElemRef]);
|
|
107
|
+
const updatePos = useCallback(axis => {
|
|
108
|
+
const thumb = thumbElemRef[axis].current;
|
|
109
|
+
if (!innerElemRef.current || !thumb)
|
|
148
110
|
return;
|
|
149
|
-
const { offset } = this.props;
|
|
150
111
|
const offsetBefore = offset?.[axis]?.before || 0;
|
|
151
112
|
const offsetAfter = offset?.[axis]?.after || 0;
|
|
152
|
-
const innerSize =
|
|
153
|
-
const thumbSize =
|
|
154
|
-
const scrollSize =
|
|
155
|
-
const scrollPos =
|
|
113
|
+
const innerSize = getInnerSize(axis);
|
|
114
|
+
const thumbSize = getThumbSize(axis);
|
|
115
|
+
const scrollSize = getScrollSize(axis);
|
|
116
|
+
const scrollPos = getScrollPos(axis);
|
|
156
117
|
const posField = BY_AXIS[axis].posField;
|
|
157
|
-
// const AXIS = axis.toUpperCase();
|
|
158
118
|
const pos = thumbSize
|
|
159
119
|
? (innerSize - thumbSize - offsetBefore - offsetAfter) *
|
|
160
120
|
(scrollPos / (scrollSize - innerSize))
|
|
161
121
|
: 0;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
122
|
+
posRef.current[axis] = pos;
|
|
123
|
+
thumb.style[posField] = `${pos}px`;
|
|
124
|
+
}, [
|
|
125
|
+
getInnerSize,
|
|
126
|
+
getScrollPos,
|
|
127
|
+
getScrollSize,
|
|
128
|
+
getThumbSize,
|
|
129
|
+
offset,
|
|
130
|
+
thumbElemRef,
|
|
131
|
+
]);
|
|
132
|
+
const update = useCallback(axis => {
|
|
133
|
+
updateCoeff(axis);
|
|
134
|
+
updatePos(axis);
|
|
135
|
+
}, [updateCoeff, updatePos]);
|
|
136
|
+
const updateHasOffsets = useCallback(() => {
|
|
137
|
+
if (!innerElemRef.current)
|
|
138
|
+
return;
|
|
139
|
+
const { scrollTop, scrollLeft, scrollHeight, scrollWidth, offsetHeight, offsetWidth, } = innerElemRef.current;
|
|
140
|
+
setHasOffset(prev => {
|
|
141
|
+
const newHasOffset = { ...prev };
|
|
142
|
+
if (y) {
|
|
143
|
+
newHasOffset.top = scrollTop > 0;
|
|
144
|
+
newHasOffset.bottom =
|
|
145
|
+
scrollHeight - (scrollTop + offsetHeight) > OFFSET_THRESHOLD;
|
|
146
|
+
}
|
|
147
|
+
if (x && !(newHasOffset.top || newHasOffset.bottom)) {
|
|
148
|
+
newHasOffset.left = scrollLeft > 0;
|
|
149
|
+
newHasOffset.right =
|
|
150
|
+
scrollWidth - (scrollLeft + offsetWidth) > OFFSET_THRESHOLD;
|
|
151
|
+
}
|
|
152
|
+
return newHasOffset;
|
|
153
|
+
});
|
|
154
|
+
}, [x, y]);
|
|
155
|
+
const updateAll = useCallback(() => {
|
|
156
|
+
if (!innerElemRef.current)
|
|
157
|
+
return;
|
|
158
|
+
eachAxis(axis => update(axis));
|
|
159
|
+
updateHasOffsets();
|
|
160
|
+
}, [eachAxis, update, updateHasOffsets]);
|
|
161
|
+
const updateScroll = useCallback((axis, e) => {
|
|
167
162
|
const coords = getEventCoords(e);
|
|
168
163
|
const scrollPos = BY_AXIS[axis].scrollPos;
|
|
169
|
-
const pos = coords[axis] -
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (x && !(hasOffset.top || hasOffset.bottom)) {
|
|
183
|
-
hasOffset.left = scrollLeft > 0;
|
|
184
|
-
hasOffset.right =
|
|
185
|
-
scrollWidth - (scrollLeft + offsetWidth) > OFFSET_THRESHOL;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
dropScrollingState = debounce(() => (this.store.isScrolling = false), 2000);
|
|
189
|
-
subscribePointerMoveUp = () => {
|
|
190
|
-
document.addEventListener('pointermove', this.onPointerMove, {
|
|
191
|
-
passive: false, // do not generate passive event warning
|
|
164
|
+
const pos = coords[axis] - prevCoordsRef.current[axis];
|
|
165
|
+
prevCoordsRef.current = coords;
|
|
166
|
+
innerElemRef.current[scrollPos] += pos / coeff[axis];
|
|
167
|
+
}, [coeff]);
|
|
168
|
+
// Event handlers
|
|
169
|
+
const dropScrollingState = useDebounce(() => {
|
|
170
|
+
setIsScrolling(false);
|
|
171
|
+
}, 2000);
|
|
172
|
+
const observeScrollHeight = useCallback(() => {
|
|
173
|
+
eachAxis(axis => {
|
|
174
|
+
const needUpdate = (props[axis] && isScrollSizeChanged(axis)) || isBoudingsChanged(axis);
|
|
175
|
+
if (needUpdate)
|
|
176
|
+
update(axis);
|
|
192
177
|
});
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
unsubscribePointerMoveUp = () => {
|
|
196
|
-
document.removeEventListener('pointermove', this.onPointerMove);
|
|
197
|
-
document.removeEventListener('pointerup', this.onPointerUp);
|
|
198
|
-
};
|
|
199
|
-
onDocScroll = e => {
|
|
200
|
-
const { activeAxis } = this.store;
|
|
178
|
+
}, [props, isBoudingsChanged, isScrollSizeChanged, update]);
|
|
179
|
+
const onDocScroll = useCallback(e => {
|
|
201
180
|
// if dragging thumb - prevent any other scrolls
|
|
202
|
-
if (activeAxis &&
|
|
181
|
+
if (activeAxis && innerElemRef.current !== e.target) {
|
|
203
182
|
e.preventDefault();
|
|
204
183
|
e.stopPropagation();
|
|
205
184
|
}
|
|
206
|
-
};
|
|
207
|
-
onInnerScroll = e => {
|
|
208
|
-
if (
|
|
185
|
+
}, [activeAxis]);
|
|
186
|
+
const onInnerScroll = useCallback(e => {
|
|
187
|
+
if (innerElemRef.current !== e.target)
|
|
209
188
|
return;
|
|
210
|
-
|
|
211
|
-
const { activeAxis, isScrolling } = this.store;
|
|
212
|
-
this.updateHasOffsets();
|
|
189
|
+
updateHasOffsets();
|
|
213
190
|
onScroll?.(e);
|
|
214
|
-
if (!activeAxis)
|
|
215
|
-
|
|
216
|
-
if (this.isScrollSizeChanged(axis))
|
|
217
|
-
this.update(axis);
|
|
218
|
-
});
|
|
219
|
-
}
|
|
191
|
+
if (!activeAxis)
|
|
192
|
+
eachAxis(updatePos);
|
|
220
193
|
if (!isScrolling)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
194
|
+
setIsScrolling(true);
|
|
195
|
+
dropScrollingState();
|
|
196
|
+
}, [
|
|
197
|
+
activeAxis,
|
|
198
|
+
dropScrollingState,
|
|
199
|
+
eachAxis,
|
|
200
|
+
isScrollSizeChanged,
|
|
201
|
+
isScrolling,
|
|
202
|
+
onScroll,
|
|
203
|
+
update,
|
|
204
|
+
updateHasOffsets,
|
|
205
|
+
]);
|
|
206
|
+
const onPointerDown = useCallback((axis, e) => {
|
|
225
207
|
e.preventDefault();
|
|
226
208
|
e.stopPropagation();
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
};
|
|
232
|
-
onPointerMove = e => {
|
|
233
|
-
const { activeAxis } = this.store;
|
|
209
|
+
prevCoordsRef.current = getEventCoords(e);
|
|
210
|
+
setActiveAxis(axis);
|
|
211
|
+
}, []);
|
|
212
|
+
const onPointerMove = useCallback(e => {
|
|
234
213
|
if (!activeAxis)
|
|
235
214
|
return;
|
|
236
215
|
e.preventDefault();
|
|
237
216
|
e.stopPropagation();
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
};
|
|
241
|
-
onPointerUp = e => {
|
|
217
|
+
updateScroll(activeAxis, e);
|
|
218
|
+
updatePos(activeAxis);
|
|
219
|
+
}, [activeAxis, updatePos, updateScroll]);
|
|
220
|
+
const onPointerUp = useCallback(e => {
|
|
242
221
|
e.stopPropagation();
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
222
|
+
setActiveAxis(null);
|
|
223
|
+
dropScrollingState();
|
|
224
|
+
}, [dropScrollingState]);
|
|
225
|
+
useEffect(() => {
|
|
226
|
+
if (innerElemRef.current) {
|
|
227
|
+
// Initial update
|
|
228
|
+
updateAll();
|
|
229
|
+
// Set up resize observer
|
|
230
|
+
observe(innerElemRef.current, updateAll);
|
|
231
|
+
onInnerRef?.(innerElemRef.current);
|
|
232
|
+
return () => {
|
|
233
|
+
unobserve(innerElemRef.current, updateAll);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}, [onInnerRef]); // Remove updateAll from dependencies
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
const unsubscribeScrollHeightObserver = Time.every(100, observeScrollHeight);
|
|
239
|
+
return () => {
|
|
240
|
+
unsubscribeScrollHeightObserver?.();
|
|
241
|
+
};
|
|
242
|
+
}, [observeScrollHeight]);
|
|
243
|
+
useEvent({
|
|
244
|
+
elem: document,
|
|
245
|
+
event: 'scroll',
|
|
246
|
+
callback: onDocScroll,
|
|
247
|
+
});
|
|
248
|
+
useEvent({
|
|
249
|
+
elem: document,
|
|
250
|
+
event: ['pointermove', 'pointerup'],
|
|
251
|
+
callback: e => {
|
|
252
|
+
if (e.type === 'pointermove')
|
|
253
|
+
onPointerMove(e);
|
|
254
|
+
else if (e.type === 'pointerup')
|
|
255
|
+
onPointerUp(e);
|
|
256
|
+
},
|
|
257
|
+
isActive: !!activeAxis,
|
|
258
|
+
});
|
|
259
|
+
const renderBar = useCallback(axis => {
|
|
260
|
+
if (!props[axis] || coeff[axis] === 1)
|
|
251
261
|
return null;
|
|
252
262
|
const sizeField = BY_AXIS[axis].size;
|
|
253
263
|
const posField = BY_AXIS[axis].posField;
|
|
254
264
|
const thumbStyle = {
|
|
255
|
-
[sizeField]:
|
|
256
|
-
[posField]:
|
|
265
|
+
[sizeField]: getCoeffStyle(axis),
|
|
266
|
+
[posField]: getPosStyle(axis),
|
|
257
267
|
};
|
|
258
|
-
const className = cn(S.bar, S[axis], activeAxis === axis && S.isActive,
|
|
268
|
+
const className = cn(S.bar, S[axis], activeAxis === axis && S.isActive, props[`${axis}ScrollbarClassName`]);
|
|
259
269
|
const barProps = {
|
|
260
270
|
className,
|
|
261
|
-
style:
|
|
262
|
-
onPointerDown:
|
|
271
|
+
style: getOffset(axis),
|
|
272
|
+
onPointerDown: e => onPointerDown(axis, e),
|
|
263
273
|
};
|
|
264
274
|
return (createElement("div", { ...barProps, key: `bar-${axis}` },
|
|
265
|
-
jsx("div", { className: cn(S.thumb, thumbClassName), style: thumbStyle, ref:
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
275
|
+
jsx("div", { className: cn(S.thumb, thumbClassName), style: thumbStyle, ref: thumbElemRef[axis] })));
|
|
276
|
+
}, [
|
|
277
|
+
activeAxis,
|
|
278
|
+
coeff,
|
|
279
|
+
getCoeffStyle,
|
|
280
|
+
getOffset,
|
|
281
|
+
getPosStyle,
|
|
282
|
+
onPointerDown,
|
|
283
|
+
props,
|
|
284
|
+
thumbClassName,
|
|
285
|
+
thumbElemRef,
|
|
286
|
+
]);
|
|
287
|
+
const renderInner = useCallback(() => {
|
|
270
288
|
const innerClasses = cn(S.inner, innerProps?.className, innerClassName, !activeAxis && smooth && S.smooth, hasOffset.top && S.hasOffsetTop, hasOffset.bottom && S.hasOffsetBottom, hasOffset.right && S.hasOffsetRight, hasOffset.left && S.hasOffsetLeft);
|
|
271
289
|
const props = { ...innerProps };
|
|
272
|
-
props.onScrollCapture =
|
|
273
|
-
return (createElement("div", { ...props, className: innerClasses, ref:
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
'smooth',
|
|
286
|
-
'className',
|
|
287
|
-
'innerClassName',
|
|
288
|
-
'xScrollbarClassName',
|
|
289
|
-
'yScrollbarClassName',
|
|
290
|
-
'innerProps',
|
|
291
|
-
'onInnerRef',
|
|
292
|
-
'thumbClassName',
|
|
293
|
-
'autoHide',
|
|
294
|
-
'children',
|
|
295
|
-
]);
|
|
296
|
-
return (jsxs("div", { className: classes, ...props, children: [this.renderInner(), this.eachAxis(this.renderBar)] }));
|
|
297
|
-
}
|
|
290
|
+
props.onScrollCapture = onInnerScroll;
|
|
291
|
+
return (createElement("div", { ...props, className: innerClasses, ref: innerElemRef, key: "inner" }, children));
|
|
292
|
+
}, [
|
|
293
|
+
activeAxis,
|
|
294
|
+
children,
|
|
295
|
+
hasOffset,
|
|
296
|
+
innerClassName,
|
|
297
|
+
innerProps,
|
|
298
|
+
onInnerScroll,
|
|
299
|
+
smooth,
|
|
300
|
+
]);
|
|
301
|
+
const classes = cn(S.root, y && S.y, x && S.x, S[`size-${size}`], fadeSize && S[`fadeSize-${fadeSize}`], autoHide && S.autoHide, (isScrolling || activeAxis) && S.isScrolling, isTouchDevice ? S.isTouch : S.isDesktop, className);
|
|
302
|
+
return (jsxs("div", { className: classes, ...rest, children: [renderInner(), AXES.map(renderBar)] }));
|
|
298
303
|
}
|
|
299
304
|
|
|
300
305
|
export { Scroll };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback, createElement } from 'react';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import cn from 'classnames';
|
|
4
|
+
import { Scroll } from '../Scroll/Scroll.js';
|
|
4
5
|
import { Button } from '../Button/Button.js';
|
|
5
6
|
import { ButtonGroup } from '../ButtonGroup/ButtonGroup.js';
|
|
6
7
|
import S from './Tabs.styl.js';
|
|
@@ -32,9 +33,9 @@ function Tabs(props) {
|
|
|
32
33
|
if (renderAll || forceRender || isActive) {
|
|
33
34
|
tabsContent.push(jsx("div", { className: cn(contentClassName, currContentClassName, !isActive && S.inactive), children: tabContent }, id));
|
|
34
35
|
}
|
|
35
|
-
return (createElement(Button, { ...rest, size: size, key: id, onClick: e => onTabClick(e, params), checked: isActive }, label));
|
|
36
|
+
return (createElement(Button, { ...rest, className: cn(S.tab, rest.className), size: size, key: id, onClick: e => onTabClick(e, params), checked: isActive }, label));
|
|
36
37
|
});
|
|
37
|
-
const tabs = tabsButtons.length === 1 && hideTabsIfSingle ? null : (jsx(ButtonGroup, { className: className, ...rest, children: tabsButtons }));
|
|
38
|
+
const tabs = tabsButtons.length === 1 && hideTabsIfSingle ? null : (jsx(Scroll, { x: true, offset: { x: { before: 10, after: 10 } }, innerClassName: cn(S.tabsScroll, S[`size-${size}`]), autoHide: true, fadeSize: size, size: size, children: jsx(ButtonGroup, { className: className, ...rest, children: tabsButtons }) }));
|
|
38
39
|
if (typeof children === 'function') {
|
|
39
40
|
return children({
|
|
40
41
|
tabs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "div .Tabs_inactive__H0mPh{display:none}";
|
|
4
|
-
var S = {"inactive":"Tabs_inactive__H0mPh"};
|
|
3
|
+
var css_248z = "div .Tabs_inactive__H0mPh{display:none}.Tabs_tabsScroll__7Dj0S{padding-bottom:var(--indent-m)}.Tabs_size-l__emJzX.Tabs_tabsScroll__7Dj0S{padding-bottom:calc(var(--indent-m)*1.2)}.Tabs_tab__-oN-g{flex-shrink:0;white-space:nowrap}";
|
|
4
|
+
var S = {"inactive":"Tabs_inactive__H0mPh","tabsScroll":"Tabs_tabsScroll__7Dj0S","size-l":"Tabs_size-l__emJzX","tab":"Tabs_tab__-oN-g"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -3,11 +3,13 @@ export declare const icons: {
|
|
|
3
3
|
avatar: () => Promise<any>;
|
|
4
4
|
bookmark: () => Promise<any>;
|
|
5
5
|
bookmarkAdd: () => Promise<any>;
|
|
6
|
+
brain: () => Promise<any>;
|
|
6
7
|
brokenImage: () => Promise<any>;
|
|
7
8
|
camera: () => Promise<any>;
|
|
8
9
|
check: () => Promise<any>;
|
|
9
10
|
close: () => Promise<any>;
|
|
10
11
|
colors: () => Promise<any>;
|
|
12
|
+
compas: () => Promise<any>;
|
|
11
13
|
copy: () => Promise<any>;
|
|
12
14
|
chevronUp: () => Promise<any>;
|
|
13
15
|
chevronDown: () => Promise<any>;
|
|
@@ -29,6 +31,7 @@ export declare const icons: {
|
|
|
29
31
|
flyover: () => Promise<any>;
|
|
30
32
|
gear: () => Promise<any>;
|
|
31
33
|
geolocation: () => Promise<any>;
|
|
34
|
+
globe: () => Promise<any>;
|
|
32
35
|
group: () => Promise<any>;
|
|
33
36
|
history: () => Promise<any>;
|
|
34
37
|
image: () => Promise<any>;
|
|
@@ -51,6 +54,8 @@ export declare const icons: {
|
|
|
51
54
|
requiredStar: () => Promise<any>;
|
|
52
55
|
rewind: () => Promise<any>;
|
|
53
56
|
route: () => Promise<any>;
|
|
57
|
+
routeFrom: () => Promise<any>;
|
|
58
|
+
routeTo: () => Promise<any>;
|
|
54
59
|
save: () => Promise<any>;
|
|
55
60
|
search: () => Promise<any>;
|
|
56
61
|
send: () => Promise<any>;
|
|
@@ -2,11 +2,13 @@ declare const _default: {
|
|
|
2
2
|
avatar: () => Promise<any>;
|
|
3
3
|
bookmark: () => Promise<any>;
|
|
4
4
|
bookmarkAdd: () => Promise<any>;
|
|
5
|
+
brain: () => Promise<any>;
|
|
5
6
|
brokenImage: () => Promise<any>;
|
|
6
7
|
camera: () => Promise<any>;
|
|
7
8
|
check: () => Promise<any>;
|
|
8
9
|
close: () => Promise<any>;
|
|
9
10
|
colors: () => Promise<any>;
|
|
11
|
+
compas: () => Promise<any>;
|
|
10
12
|
copy: () => Promise<any>;
|
|
11
13
|
chevronUp: () => Promise<any>;
|
|
12
14
|
chevronDown: () => Promise<any>;
|
|
@@ -28,6 +30,7 @@ declare const _default: {
|
|
|
28
30
|
flyover: () => Promise<any>;
|
|
29
31
|
gear: () => Promise<any>;
|
|
30
32
|
geolocation: () => Promise<any>;
|
|
33
|
+
globe: () => Promise<any>;
|
|
31
34
|
group: () => Promise<any>;
|
|
32
35
|
history: () => Promise<any>;
|
|
33
36
|
image: () => Promise<any>;
|
|
@@ -50,6 +53,8 @@ declare const _default: {
|
|
|
50
53
|
requiredStar: () => Promise<any>;
|
|
51
54
|
rewind: () => Promise<any>;
|
|
52
55
|
route: () => Promise<any>;
|
|
56
|
+
routeFrom: () => Promise<any>;
|
|
57
|
+
routeTo: () => Promise<any>;
|
|
53
58
|
save: () => Promise<any>;
|
|
54
59
|
search: () => Promise<any>;
|
|
55
60
|
send: () => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Scroll } from 'uilib/components/Scroll/Scroll';
|
|
2
2
|
import { MenuGroupProps, MenuItemProps, MenuProps } from './Menu.types';
|
|
3
|
-
export declare const Menu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<Scroll>> & {
|
|
3
|
+
export declare const Menu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<typeof Scroll>> & {
|
|
4
4
|
Item: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
5
|
Group: import("react").FC<MenuGroupProps>;
|
|
6
6
|
};
|
|
@@ -1,68 +1,2 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
1
|
import * as T from './Scroll.types';
|
|
3
|
-
export declare
|
|
4
|
-
innerElem: HTMLDivElement;
|
|
5
|
-
onInnerRef: (elem: any) => void;
|
|
6
|
-
thumbELem: {
|
|
7
|
-
x: import("react").RefObject<HTMLDivElement>;
|
|
8
|
-
y: import("react").RefObject<HTMLDivElement>;
|
|
9
|
-
};
|
|
10
|
-
store: any;
|
|
11
|
-
isTouch: any;
|
|
12
|
-
timers: any;
|
|
13
|
-
currAxis: any;
|
|
14
|
-
pos: {
|
|
15
|
-
x: number;
|
|
16
|
-
y: number;
|
|
17
|
-
};
|
|
18
|
-
prevCoords: {
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
};
|
|
22
|
-
prevScrolls: {
|
|
23
|
-
x: number;
|
|
24
|
-
y: number;
|
|
25
|
-
};
|
|
26
|
-
prevBoundings: {
|
|
27
|
-
x: number;
|
|
28
|
-
y: number;
|
|
29
|
-
};
|
|
30
|
-
unsubscribeScrollHeightObserver: any;
|
|
31
|
-
static defaultProps: {
|
|
32
|
-
size: string;
|
|
33
|
-
};
|
|
34
|
-
constructor(props: any);
|
|
35
|
-
componentDidMount(): void;
|
|
36
|
-
componentWillUnmount(): void;
|
|
37
|
-
eachAxis: (fn: any) => any[];
|
|
38
|
-
observeScrollHeight: () => void;
|
|
39
|
-
isScrollSizeChanged(axis: any): boolean;
|
|
40
|
-
isBoudingsChanged(axis: any): boolean;
|
|
41
|
-
getoffsetSize: (axis: any) => any;
|
|
42
|
-
getInnerSize: (axis: any) => any;
|
|
43
|
-
getScrollSize: (axis: any) => any;
|
|
44
|
-
getScrollPos: (axis: any) => any;
|
|
45
|
-
getThumbSize: (axis: any) => any;
|
|
46
|
-
getOffset(axis: any): {
|
|
47
|
-
[x: string]: any;
|
|
48
|
-
};
|
|
49
|
-
getCoeffStyle: (axis: any) => string;
|
|
50
|
-
getPosStyle: (axis: any) => string;
|
|
51
|
-
updateAll: () => void;
|
|
52
|
-
update: (axis: any) => void;
|
|
53
|
-
updateCoeff(axis: any): void;
|
|
54
|
-
updatePos(axis: any): void;
|
|
55
|
-
updateScroll(axis: any, e: any): void;
|
|
56
|
-
updateHasOffsets(): void;
|
|
57
|
-
dropScrollingState: any;
|
|
58
|
-
subscribePointerMoveUp: () => void;
|
|
59
|
-
unsubscribePointerMoveUp: () => void;
|
|
60
|
-
onDocScroll: (e: any) => void;
|
|
61
|
-
onInnerScroll: (e: any) => void;
|
|
62
|
-
onPointerDown: (axis: any, e: any) => void;
|
|
63
|
-
onPointerMove: (e: any) => void;
|
|
64
|
-
onPointerUp: (e: any) => void;
|
|
65
|
-
renderBar: (axis: any) => JSX.Element;
|
|
66
|
-
renderInner(): JSX.Element;
|
|
67
|
-
render(): JSX.Element;
|
|
68
|
-
}
|
|
2
|
+
export declare function Scroll(props: T.Props): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useResizeObserver: (ref: React.RefObject<HTMLElement>, callback: (entry: ResizeObserverEntry) => void) => void;
|