ublo-lib 1.19.23 → 1.19.24
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/es/common/components/editable-map/icons/index.js +2 -1
- package/es/common/components/editable-map/icons/viarmonia.js +45 -0
- package/es/common/components/scroll-spy.d.ts +14 -0
- package/es/common/components/scroll-spy.d.ts.map +1 -0
- package/es/common/components/scroll-spy.js +43 -57
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export function Location(props) {
|
|
5
|
+
return _jsxs(Icon, {
|
|
6
|
+
...props,
|
|
7
|
+
children: [_jsx("path", {
|
|
8
|
+
d: "M2 12a10 10 0 1 1 20 0 10 10 0 0 1-20 0Z"
|
|
9
|
+
}), _jsx("path", {
|
|
10
|
+
fillRule: "evenodd",
|
|
11
|
+
clipRule: "evenodd",
|
|
12
|
+
d: "M0 12a12 12 0 1 1 24 0 12 12 0 0 1-24 0ZM12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Z",
|
|
13
|
+
fill: "#fff"
|
|
14
|
+
})]
|
|
15
|
+
}, "1");
|
|
16
|
+
}
|
|
17
|
+
export function Pebbles(props) {
|
|
18
|
+
return _jsxs(Icon, {
|
|
19
|
+
...props,
|
|
20
|
+
children: [_jsx("path", {
|
|
21
|
+
d: "M2 12a10 10 0 1 1 20 0 10 10 0 0 1-20 0Z"
|
|
22
|
+
}), _jsx("path", {
|
|
23
|
+
fillRule: "evenodd",
|
|
24
|
+
clipRule: "evenodd",
|
|
25
|
+
d: "M0 12a12 12 0 1 1 24 0 12 12 0 0 1-24 0ZM12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Z",
|
|
26
|
+
fill: "#fff"
|
|
27
|
+
}), _jsx("path", {
|
|
28
|
+
d: "M19.84 17.57h-3.6c.3-.13.6-.24.9-.38.64-.26 1.2-.7 1.6-1.25.25-.38.36-.79.28-1.24-.1-.5-.38-.94-.79-1.24-.6-.5-1.3-.86-2.06-1.07-.33-.1-.67-.17-1.01-.25.28-.1.55-.18.81-.29a3.1 3.1 0 0 0 1.05-.68c.26-.27.41-.58.38-.97-.04-.42-.28-.72-.58-.97a4.57 4.57 0 0 0-1.85-.8c-.07-.03-.15-.03-.23-.08l.18-.07c.26-.11.5-.26.7-.45.51-.46.52-1.1.02-1.6-.23-.2-.5-.38-.8-.5-.19-.08-.4-.13-.62-.2l.14-.1c.28-.25.33-.62.12-.88-.1-.13-.24-.24-.39-.32a2.57 2.57 0 0 0-1.44-.21c-.35.03-.68.13-.96.35-.37.28-.41.7-.08 1.02.04.05.11.08.15.15l-.14.04c-.4.1-.76.26-1.09.5-.34.27-.6.59-.53 1.06.04.38.29.64.58.86.2.15.43.25.7.36l-.58.15c-.63.15-1.22.46-1.7.9-.54.53-.54 1.25 0 1.78.32.33.72.54 1.15.71.22.1.46.15.72.24-.55.1-1.05.23-1.53.42-.7.24-1.33.64-1.85 1.16a1.77 1.77 0 0 0 0 2.52c.4.42.87.72 1.4.96l.86.37H6.23c-.23 0-.23 0-.23.23 0 .2 0 .2.21.2h13.52c.27 0 .26 0 .28-.28 0-.13-.05-.15-.17-.15Zm-2.5-3.04h.1c.26 0 .22-.04.23.22v.11c0 .08-.03.1-.1.1h-.09c-.29 0-.28 0-.29-.3 0-.1.04-.15.16-.13Zm-6.32-.73a3.1 3.1 0 0 0-1.74.64c-.19.15-.34.33-.46.54-.04.08-.08.1-.15.04l-.04-.01c-.27-.14-.27-.14-.1-.4.39-.53.95-.92 1.58-1.08.26-.08.52-.13.79-.16.24-.03.24-.03.24.2v.1c.02.1-.03.12-.12.13Zm1.67-7.02c-.43.04-.82.2-1.1.55-.03.04-.06.04-.09.01l-.17-.11c-.15-.1-.15-.1-.03-.24.35-.39.84-.62 1.37-.66.07 0 .1.03.1.1v.25c0 .06-.01.08-.08.1Zm4.05 8.45c.23 0 .23 0 .23.2 0 .23 0 .23-.24.23-.23 0-.23 0-.23-.23 0-.2 0-.2.23-.2Zm-.7 1.14c-.27 0-.23.04-.23-.24-.01-.2 0-.2.23-.2s.23 0 .23.22c0 .26.03.22-.23.22Z",
|
|
29
|
+
fill: "#fff"
|
|
30
|
+
})]
|
|
31
|
+
}, "2");
|
|
32
|
+
}
|
|
33
|
+
function Icon({
|
|
34
|
+
width = 24,
|
|
35
|
+
height = 24,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
return _jsx("svg", {
|
|
39
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
40
|
+
width: width,
|
|
41
|
+
height: height,
|
|
42
|
+
...props,
|
|
43
|
+
children: props.children
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
className?: string;
|
|
4
|
+
items: string[];
|
|
5
|
+
Tag?: React.ElementType;
|
|
6
|
+
currentClassName: string;
|
|
7
|
+
onUpdate?: (target: Element | HTMLElement | undefined) => void;
|
|
8
|
+
rootMargin?: string;
|
|
9
|
+
container?: HTMLElement;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export default function ScrollSpy({ className, items, Tag, currentClassName, onUpdate, rootMargin, container, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=scroll-spy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-spy.d.ts","sourceRoot":"","sources":["../../../src/common/components/scroll-spy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,SAAS,EACT,KAAK,EACL,GAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,UAAuB,EACvB,SAAS,EACT,QAAQ,GACT,EAAE,KAAK,2CAmDP"}
|
|
@@ -1,60 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import classNames from "classnames";
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (!entry.isIntersecting) {
|
|
19
|
-
setCurrent(undefined);
|
|
20
|
-
onUpdate?.(undefined);
|
|
4
|
+
export default function ScrollSpy({ className, items, Tag = "div", currentClassName, onUpdate, rootMargin = "-50% 0px", container, children, }) {
|
|
5
|
+
const [current, setCurrent] = React.useState();
|
|
6
|
+
const callback = React.useCallback((entries) => {
|
|
7
|
+
for (const entry of entries) {
|
|
8
|
+
if (container === entry.target) {
|
|
9
|
+
if (!entry.isIntersecting) {
|
|
10
|
+
setCurrent(undefined);
|
|
11
|
+
onUpdate?.(undefined);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
else if (entry.isIntersecting) {
|
|
15
|
+
const index = items.indexOf(entry.target.id);
|
|
16
|
+
setCurrent(index);
|
|
17
|
+
onUpdate?.(entry.target);
|
|
18
|
+
}
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const className = classNames({
|
|
50
|
-
[props.className]: props.className,
|
|
51
|
-
[currentClassName]: current === i
|
|
52
|
-
});
|
|
53
|
-
return React.cloneElement(child, {
|
|
54
|
-
...props,
|
|
55
|
-
className
|
|
56
|
-
});
|
|
57
|
-
})
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
export default ScrollSpy;
|
|
20
|
+
}, [container, items, onUpdate]);
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
const defaultTargets = container ? [container] : [];
|
|
23
|
+
const targets = items.length
|
|
24
|
+
? items.reduce((acc, item) => {
|
|
25
|
+
const element = document.getElementById(item);
|
|
26
|
+
return element ? [...acc, element] : acc;
|
|
27
|
+
}, defaultTargets)
|
|
28
|
+
: defaultTargets;
|
|
29
|
+
const observer = new window.IntersectionObserver(callback, { rootMargin });
|
|
30
|
+
targets.forEach(observer.observe, observer);
|
|
31
|
+
return () => {
|
|
32
|
+
observer.disconnect();
|
|
33
|
+
};
|
|
34
|
+
}, [callback, container, items, rootMargin]);
|
|
35
|
+
return (_jsx(Tag, { className: className, children: children &&
|
|
36
|
+
children.map(({ props, ...child }, i) => {
|
|
37
|
+
const className = classNames({
|
|
38
|
+
[props.className]: props.className,
|
|
39
|
+
[currentClassName]: current === i,
|
|
40
|
+
});
|
|
41
|
+
return React.cloneElement(child, {
|
|
42
|
+
...props,
|
|
43
|
+
className,
|
|
44
|
+
});
|
|
45
|
+
}) }));
|
|
46
|
+
}
|