pb-sxp-ui 1.15.38 → 1.15.39
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/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +4 -2
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +1 -1
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/ExpandableText.js +3 -2
- package/lib/core/components/SxpPageRender/ExpandableText.js +3 -2
- package/package.json +1 -1
@@ -16,10 +16,12 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
16
16
|
if (!realRef.current || !clampRef.current || !isPost || !text || isShowMore)
|
17
17
|
return;
|
18
18
|
requestAnimationFrame(() => {
|
19
|
+
realRef.current.style.position = 'relative';
|
19
20
|
const realHeight = realRef.current.getBoundingClientRect().height;
|
20
21
|
const clampHeight = clampRef.current.getBoundingClientRect().height;
|
21
22
|
const isActuallyClamped = realHeight > clampHeight + 1;
|
22
23
|
setIsShow(isActuallyClamped);
|
24
|
+
realRef.current.style.position = 'absolute';
|
23
25
|
});
|
24
26
|
}, [isPost, text, isShowMore]);
|
25
27
|
useEffect(() => {
|
@@ -53,8 +55,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
53
55
|
visibility: 'hidden',
|
54
56
|
opacity: 0,
|
55
57
|
clipPath: 'inset(100%)',
|
56
|
-
transform: 'translateX(-9999px)'
|
57
|
-
position: 'absolute'
|
58
|
+
transform: 'translateX(-9999px)'
|
58
59
|
}, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
|
59
60
|
text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
60
61
|
__html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', textStyle)
|
@@ -18,10 +18,12 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
18
18
|
if (!realRef.current || !clampRef.current || !isPost || !text || isShowMore)
|
19
19
|
return;
|
20
20
|
requestAnimationFrame(() => {
|
21
|
+
realRef.current.style.position = 'relative';
|
21
22
|
const realHeight = realRef.current.getBoundingClientRect().height;
|
22
23
|
const clampHeight = clampRef.current.getBoundingClientRect().height;
|
23
24
|
const isActuallyClamped = realHeight > clampHeight + 1;
|
24
25
|
setIsShow(isActuallyClamped);
|
26
|
+
realRef.current.style.position = 'absolute';
|
25
27
|
});
|
26
28
|
}, [isPost, text, isShowMore]);
|
27
29
|
(0, react_1.useEffect)(() => {
|
@@ -55,8 +57,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
55
57
|
visibility: 'hidden',
|
56
58
|
opacity: 0,
|
57
59
|
clipPath: 'inset(100%)',
|
58
|
-
transform: 'translateX(-9999px)'
|
59
|
-
position: 'absolute'
|
60
|
+
transform: 'translateX(-9999px)'
|
60
61
|
}, dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
|
61
62
|
text && isPost && isShow && (react_1.default.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
62
63
|
__html: (0, tool_1.setFontForText)(isShowMore ? unfoldText || 'show less' : foldText || 'show more', textStyle)
|