ublo-lib 1.42.27 → 1.42.28
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/collapsible/collapsible.d.ts.map +1 -1
- package/es/common/components/collapsible/collapsible.js +14 -4
- package/es/common/components/collapsible/collapsible.module.css +2 -0
- package/es/common/components/image-with-loader/image-with-loader.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../../src/common/components/collapsible/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAqBF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAsB,EACtB,MAAY,EACZ,IAAI,EACJ,IAAI,EACJ,QAAQ,GACT,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../../src/common/components/collapsible/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAqBF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAsB,EACtB,MAAY,EACZ,IAAI,EACJ,IAAI,EACJ,QAAQ,GACT,EAAE,KAAK,2CAqEP"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import Button from "dt-design-system/es/button";
|
|
4
|
-
import { motion } from "framer-motion";
|
|
5
4
|
import * as Icons from "dt-design-system/es/icons";
|
|
6
5
|
import classnames from "classnames";
|
|
7
6
|
import * as Cms from "../../utils/cms";
|
|
@@ -28,6 +27,7 @@ export default function Collapsible({ gradientColor = "#fff", height = 150, lang
|
|
|
28
27
|
const [opened, setOpened] = React.useState(false);
|
|
29
28
|
const [hasOverflow, setHasOverflow] = React.useState(false);
|
|
30
29
|
const [isConnected, setIsConnected] = React.useState(false);
|
|
30
|
+
const [containerHeight, setContainerHeight] = React.useState(height);
|
|
31
31
|
const classes = classnames(styles.collapsible, {
|
|
32
32
|
[styles.opened]: opened,
|
|
33
33
|
[styles.overflow]: hasOverflow,
|
|
@@ -50,8 +50,18 @@ export default function Collapsible({ gradientColor = "#fff", height = 150, lang
|
|
|
50
50
|
}
|
|
51
51
|
setOpened(false);
|
|
52
52
|
}, [lang, path]);
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
if (opened || !hasOverflow) {
|
|
55
|
+
const childrenHeight = childrenRef.current?.offsetHeight + 80;
|
|
56
|
+
setContainerHeight(childrenHeight);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
setContainerHeight(height);
|
|
60
|
+
}
|
|
61
|
+
}, [hasOverflow, height, opened]);
|
|
53
62
|
const key = !isConnected ? lang + path : undefined;
|
|
54
|
-
return (_jsxs(
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
return (_jsxs("div", { ref: parentRef, className: classes, style: {
|
|
64
|
+
"--gradient-color": gradientColor,
|
|
65
|
+
height: containerHeight,
|
|
66
|
+
}, children: [_jsx("div", { ref: childrenRef, children: children }), hasOverflow && (_jsxs(Button, { className: styles.message, onClick: toggleOpen, children: [message, _jsx(Icon, {})] }))] }, key));
|
|
57
67
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref" | "alt" | "src" | "height" | "
|
|
2
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "ref" | "alt" | "src" | "height" | "loading" | "width" | "srcSet"> & {
|
|
3
3
|
src: string | import("next/dist/shared/lib/get-img-props").StaticImport;
|
|
4
4
|
alt: string;
|
|
5
5
|
width?: number | `${number}`;
|