@chayns-components/core 5.0.0-beta.1172 → 5.0.0-beta.1173
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/cjs/components/list/list-item/list-item-head/ListItemHead.js +8 -19
- package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
- package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js +1 -3
- package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
- package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js +8 -19
- package/lib/esm/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
- package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js +1 -3
- package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
- package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +0 -1
- package/package.json +2 -2
|
@@ -43,10 +43,6 @@ const ListItemHead = ({
|
|
|
43
43
|
const [, setIsFirstRender] = (0, _react.useState)(false);
|
|
44
44
|
const longPressTimeoutRef = (0, _react.useRef)();
|
|
45
45
|
const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string';
|
|
46
|
-
const {
|
|
47
|
-
ref: subTitleRef,
|
|
48
|
-
height: subTitleHeight = 0
|
|
49
|
-
} = (0, _reactResizeDetector.useResizeDetector)();
|
|
50
46
|
const shouldShowMultilineTitle = (0, _react.useMemo)(() => !subtitle, [subtitle]);
|
|
51
47
|
const handleShowTooltipResize = (0, _react.useCallback)(data => {
|
|
52
48
|
var _data$entry;
|
|
@@ -55,20 +51,17 @@ const ListItemHead = ({
|
|
|
55
51
|
setShouldEnableTooltip(el.scrollWidth > el.clientWidth);
|
|
56
52
|
}, [setShouldEnableTooltip]);
|
|
57
53
|
const {
|
|
58
|
-
ref: titleRef
|
|
59
|
-
height: titleHeight = 0,
|
|
60
|
-
width: titleWidth = 0
|
|
54
|
+
ref: titleRef
|
|
61
55
|
} = (0, _reactResizeDetector.useResizeDetector)({
|
|
62
|
-
onResize: handleShowTooltipResize
|
|
56
|
+
onResize: handleShowTooltipResize,
|
|
57
|
+
skipOnMount: true
|
|
63
58
|
});
|
|
64
59
|
const {
|
|
65
|
-
ref: ellipsisTitleRef
|
|
66
|
-
height: ellipsisTitleHeight = 0,
|
|
67
|
-
width: ellipsisTitleWidth = 0
|
|
60
|
+
ref: ellipsisTitleRef
|
|
68
61
|
} = (0, _reactResizeDetector.useResizeDetector)({
|
|
69
|
-
onResize: handleShowTooltipResize
|
|
62
|
+
onResize: handleShowTooltipResize,
|
|
63
|
+
skipOnMount: true
|
|
70
64
|
});
|
|
71
|
-
const height = (0, _react.useMemo)(() => (isOpen ? titleHeight : ellipsisTitleHeight) + (shouldShowSubtitleRow ? subTitleHeight + 4 : 0), [ellipsisTitleHeight, isOpen, shouldShowSubtitleRow, subTitleHeight, titleHeight]);
|
|
72
65
|
|
|
73
66
|
// This is used to trigger a rerender, so the head height can be calculated
|
|
74
67
|
(0, _react.useEffect)(() => {
|
|
@@ -125,8 +118,8 @@ const ListItemHead = ({
|
|
|
125
118
|
return undefined;
|
|
126
119
|
}, [careOfLocationId, cornerImage, icons, imageBackground, images, shouldHideImageOrIconBackground, shouldOpenImageOnClick, shouldShowRoundImageOrIcon]);
|
|
127
120
|
return /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHead, {
|
|
121
|
+
layout: true,
|
|
128
122
|
animate: {
|
|
129
|
-
height,
|
|
130
123
|
opacity: isTitleGreyed ? 0.5 : 1
|
|
131
124
|
},
|
|
132
125
|
initial: false,
|
|
@@ -158,7 +151,6 @@ const ListItemHead = ({
|
|
|
158
151
|
}, /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadTitle, null, /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadTitleContent, null, isOpen ? /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadTitleText, {
|
|
159
152
|
key: "title",
|
|
160
153
|
ref: titleRef,
|
|
161
|
-
$width: titleWidth,
|
|
162
154
|
$shouldShowMultilineTitle: shouldShowMultilineTitle,
|
|
163
155
|
initial: {
|
|
164
156
|
opacity: 0
|
|
@@ -176,7 +168,6 @@ const ListItemHead = ({
|
|
|
176
168
|
key: "ellipsisTitle",
|
|
177
169
|
$isEllipsis: true,
|
|
178
170
|
ref: ellipsisTitleRef,
|
|
179
|
-
$width: ellipsisTitleWidth,
|
|
180
171
|
$shouldShowMultilineTitle: shouldShowMultilineTitle,
|
|
181
172
|
initial: {
|
|
182
173
|
opacity: 0
|
|
@@ -190,9 +181,7 @@ const ListItemHead = ({
|
|
|
190
181
|
transition: {
|
|
191
182
|
duration: 0.3
|
|
192
183
|
}
|
|
193
|
-
}, title), /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadTitleElement, null, titleElement))), shouldShowSubtitleRow && /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadSubtitle, {
|
|
194
|
-
ref: subTitleRef
|
|
195
|
-
}, /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadSubtitleText, {
|
|
184
|
+
}, title), /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadTitleElement, null, titleElement))), shouldShowSubtitleRow && /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadSubtitle, null, /*#__PURE__*/_react.default.createElement(_ListItemHead.StyledListItemHeadSubtitleText, {
|
|
196
185
|
$isOpen: isOpen
|
|
197
186
|
}, subtitle))), rightElements && /*#__PURE__*/_react.default.createElement(_ListItemRightElements.default, {
|
|
198
187
|
rightElements: rightElements,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemHead.js","names":["_react","_interopRequireWildcard","require","_accordion","_Icon","_interopRequireDefault","_ListItemIcon","_ListItemImage","_ListItemRightElements","_ListItemHead","_reactResizeDetector","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ListItemHead","careOfLocationId","cornerImage","hoverItem","icons","imageBackground","images","isAnyItemExpandable","isExpandable","isOpen","isTitleGreyed","leftElements","onClick","onLongPress","rightElements","shouldHideImageOrIconBackground","shouldHideIndicator","shouldOpenImageOnClick","shouldShowRoundImageOrIcon","subtitle","shouldForceHover","title","titleElement","setShouldEnableTooltip","shouldShowHoverItem","setShouldShowHoverItem","useState","setIsFirstRender","longPressTimeoutRef","useRef","shouldShowSubtitleRow","ref","subTitleRef","height","subTitleHeight","useResizeDetector","shouldShowMultilineTitle","useMemo","handleShowTooltipResize","useCallback","data","_data$entry","el","entry","target","scrollWidth","clientWidth","titleRef","titleHeight","width","titleWidth","onResize","ellipsisTitleRef","ellipsisTitleHeight","ellipsisTitleWidth","useEffect","handleMouseEnter","handleMouseLeave","handleTouchStart","event","current","window","setTimeout","handleTouchEnd","clearTimeout","shouldPreventRightElementClick","bottom","getElementClickEvent","center","top","iconOrImageElement","createElement","shouldHideBackground","shouldShowRoundIcon","shouldShowRoundImage","undefined","StyledListItemHead","animate","opacity","initial","transition","duration","type","className","$isClickable","$isAnyItemExpandable","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","StyledListItemHeadLeftWrapper","StyledMotionListItemHeadIndicator","rotate","StyledListItemHeadContent","$isIconOrImageGiven","$isOpen","StyledListItemHeadTitle","StyledListItemHeadTitleContent","StyledListItemHeadTitleText","key","$width","$shouldShowMultilineTitle","exit","$isEllipsis","StyledListItemHeadTitleElement","StyledListItemHeadSubtitle","StyledListItemHeadSubtitleText","StyledMotionListItemHeadHoverItemWrapper","marginLeft","StyledMotionListItemHeadHoverItem","displayName","_default","exports"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactNode,\n TouchEventHandler,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { IListItemRightElements } from '../../../../types/list';\nimport { getElementClickEvent } from '../../../../utils/accordion';\nimport Icon from '../../../icon/Icon';\nimport ListItemIcon from './list-item-icon/ListItemIcon';\nimport ListItemImage from './list-item-image/ListItemImage';\nimport ListItemRightElements from './list-item-right-elements/ListItemRightElements';\nimport {\n StyledListItemHead,\n StyledListItemHeadContent,\n StyledListItemHeadLeftWrapper,\n StyledListItemHeadSubtitle,\n StyledListItemHeadSubtitleText,\n StyledListItemHeadTitle,\n StyledListItemHeadTitleContent,\n StyledListItemHeadTitleElement,\n StyledListItemHeadTitleText,\n StyledMotionListItemHeadHoverItem,\n StyledMotionListItemHeadHoverItemWrapper,\n StyledMotionListItemHeadIndicator,\n} from './ListItemHead.styles';\nimport { ResizePayload, useResizeDetector } from 'react-resize-detector';\nimport { OnRefChangeType } from 'react-resize-detector/build/types';\n\ninterface HeadHeight {\n closed: number;\n open: number;\n}\n\ntype ListItemHeadProps = {\n careOfLocationId?: number;\n cornerImage?: string;\n hoverItem?: ReactNode;\n icons?: string[];\n imageBackground?: CSSProperties['background'];\n images?: string[];\n isAnyItemExpandable: boolean;\n isExpandable: boolean;\n isOpen: boolean;\n isTitleGreyed?: boolean;\n leftElements?: ReactNode;\n onClick?: MouseEventHandler<HTMLDivElement>;\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n rightElements?: IListItemRightElements;\n shouldHideImageOrIconBackground?: boolean;\n shouldHideIndicator?: boolean;\n shouldOpenImageOnClick: boolean;\n shouldShowRoundImageOrIcon?: boolean;\n subtitle?: ReactNode;\n title: ReactNode;\n titleElement?: ReactNode;\n shouldForceHover?: boolean;\n setShouldEnableTooltip: (value: boolean) => void;\n};\n\nconst ListItemHead: FC<ListItemHeadProps> = ({\n careOfLocationId,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isAnyItemExpandable,\n isExpandable,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onLongPress,\n rightElements,\n shouldHideImageOrIconBackground,\n shouldHideIndicator,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n subtitle,\n shouldForceHover,\n title,\n titleElement,\n setShouldEnableTooltip,\n}) => {\n const [shouldShowHoverItem, setShouldShowHoverItem] = useState(false);\n const [, setIsFirstRender] = useState(false);\n\n const longPressTimeoutRef = useRef<number>();\n\n const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string';\n\n const { ref: subTitleRef, height: subTitleHeight = 0 } = useResizeDetector();\n\n const shouldShowMultilineTitle = useMemo(() => !subtitle, [subtitle]);\n\n const handleShowTooltipResize = useCallback(\n (data: ResizePayload) => {\n const el = data.entry?.target;\n if (!el) return;\n setShouldEnableTooltip(el.scrollWidth > el.clientWidth);\n },\n [setShouldEnableTooltip],\n );\n\n const {\n ref: titleRef,\n height: titleHeight = 0,\n width: titleWidth = 0,\n } = useResizeDetector<HTMLDivElement>({\n onResize: handleShowTooltipResize,\n });\n\n const {\n ref: ellipsisTitleRef,\n height: ellipsisTitleHeight = 0,\n width: ellipsisTitleWidth = 0,\n } = useResizeDetector<HTMLDivElement>({\n onResize: handleShowTooltipResize,\n });\n\n const height = useMemo(\n () =>\n (isOpen ? titleHeight : ellipsisTitleHeight) +\n (shouldShowSubtitleRow ? subTitleHeight + 4 : 0),\n [ellipsisTitleHeight, isOpen, shouldShowSubtitleRow, subTitleHeight, titleHeight],\n );\n\n // This is used to trigger a rerender, so the head height can be calculated\n useEffect(() => {\n setIsFirstRender(true);\n }, []);\n\n const handleMouseEnter = useCallback(() => setShouldShowHoverItem(true), []);\n\n const handleMouseLeave = useCallback(() => setShouldShowHoverItem(false), []);\n\n const handleTouchStart = useCallback<TouchEventHandler<HTMLDivElement>>(\n (event) => {\n longPressTimeoutRef.current = window.setTimeout(() => {\n if (typeof onLongPress === 'function') {\n onLongPress(event);\n }\n }, 400);\n },\n [onLongPress],\n );\n\n const handleTouchEnd = useCallback(() => {\n clearTimeout(longPressTimeoutRef.current);\n }, []);\n\n const shouldPreventRightElementClick = useMemo(() => {\n if (!rightElements) return false;\n\n if (\n typeof rightElements === 'object' &&\n ('bottom' in rightElements || 'center' in rightElements || 'top' in rightElements)\n ) {\n if (rightElements.bottom && getElementClickEvent(rightElements.bottom)) {\n return true;\n }\n\n if (rightElements.center && getElementClickEvent(rightElements.center)) {\n return true;\n }\n\n if (rightElements.top && getElementClickEvent(rightElements.top)) {\n return true;\n }\n } else {\n return getElementClickEvent(rightElements as ReactNode);\n }\n\n return false;\n }, [rightElements]);\n\n const iconOrImageElement = useMemo(() => {\n if (icons) {\n return (\n <ListItemIcon\n icons={icons}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundIcon={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n if (images) {\n return (\n <ListItemImage\n imageBackground={imageBackground}\n careOfLocationId={careOfLocationId}\n cornerImage={cornerImage}\n images={images}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundImage={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n return undefined;\n }, [\n careOfLocationId,\n cornerImage,\n icons,\n imageBackground,\n images,\n shouldHideImageOrIconBackground,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n ]);\n\n return (\n <StyledListItemHead\n animate={{\n height,\n opacity: isTitleGreyed ? 0.5 : 1,\n }}\n initial={false}\n transition={{ duration: 0.2, type: 'tween' }}\n className=\"beta-chayns-list-item-head\"\n $isClickable={typeof onClick === 'function' || isExpandable}\n $isAnyItemExpandable={isAnyItemExpandable}\n onClick={onClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onTouchStart={typeof onLongPress === 'function' ? handleTouchStart : undefined}\n onTouchEnd={typeof onLongPress === 'function' ? handleTouchEnd : undefined}\n >\n <StyledListItemHeadLeftWrapper>\n {isAnyItemExpandable && (\n <StyledMotionListItemHeadIndicator\n animate={{ rotate: isOpen ? 90 : 0 }}\n initial={false}\n transition={{ type: 'tween' }}\n >\n {isExpandable && !shouldHideIndicator && (\n <Icon icons={['fa fa-chevron-right']} />\n )}\n </StyledMotionListItemHeadIndicator>\n )}\n {leftElements}\n {iconOrImageElement}\n </StyledListItemHeadLeftWrapper>\n <StyledListItemHeadContent\n $isIconOrImageGiven={iconOrImageElement !== undefined}\n $isOpen={isOpen}\n >\n <StyledListItemHeadTitle>\n <StyledListItemHeadTitleContent>\n {isOpen ? (\n <StyledListItemHeadTitleText\n key=\"title\"\n ref={titleRef}\n $width={titleWidth}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.4 }}\n >\n {title}\n </StyledListItemHeadTitleText>\n ) : (\n <StyledListItemHeadTitleText\n key=\"ellipsisTitle\"\n $isEllipsis\n ref={ellipsisTitleRef}\n $width={ellipsisTitleWidth}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3 }}\n >\n {title}\n </StyledListItemHeadTitleText>\n )}\n <StyledListItemHeadTitleElement>\n {titleElement}\n </StyledListItemHeadTitleElement>\n </StyledListItemHeadTitleContent>\n </StyledListItemHeadTitle>\n {shouldShowSubtitleRow && (\n <StyledListItemHeadSubtitle ref={subTitleRef}>\n <StyledListItemHeadSubtitleText $isOpen={isOpen}>\n {subtitle}\n </StyledListItemHeadSubtitleText>\n </StyledListItemHeadSubtitle>\n )}\n </StyledListItemHeadContent>\n {rightElements && (\n <ListItemRightElements\n rightElements={rightElements}\n shouldPreventRightElementClick={shouldPreventRightElementClick}\n />\n )}\n {hoverItem && (\n <StyledMotionListItemHeadHoverItemWrapper\n className=\"beta-chayns-list-item-hover-item\"\n animate={{\n marginLeft: shouldForceHover || shouldShowHoverItem ? 8 : 0,\n opacity: shouldForceHover || shouldShowHoverItem ? 1 : 0,\n width: shouldForceHover || shouldShowHoverItem ? 'auto' : 0,\n }}\n initial={false}\n transition={{ duration: 0.15, type: 'tween' }}\n >\n <StyledMotionListItemHeadHoverItem>\n {hoverItem}\n </StyledMotionListItemHeadHoverItem>\n </StyledMotionListItemHeadHoverItemWrapper>\n )}\n </StyledListItemHead>\n );\n};\n\nListItemHead.displayName = 'ListItemHead';\n\nexport default ListItemHead;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAaA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,cAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,sBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AAcA,IAAAQ,oBAAA,GAAAR,OAAA;AAAyE,SAAAG,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAU,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAAAN,CAAA,IAAAH,CAAA,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AC,kCAAkC;IAC5CN,OAAO,EAAE;MACL+B,UAAU,EAAExF,gBAAgB,IAAII,mBAAmB,GAAG,CAAC,GAAG,CAAC;MAC3DsD,OAAO,EAAE1D,gBAAgB,IAAII,mBAAmB,GAAG,CAAC,GAAG,CAAC;MACxDyB,KAAK,EAAE7B,gBAAgB,IAAII,mBAAmB,GAAG,MAAM,GAAG;IAC9D,CAAE;IACFuD,OAAO,EAAE,KAAM;IACfC,UAAU,EAAE;MAAEC,QAAQ,EAAE,IAAI;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBAE9ChH,MAAA,CAAAa,OAAA,CAAAwF,aAAA,CAAC5F,aAAA,CAAAkI,iCAAiC,QAC7B1G,SAC8B,CACG,CAE9B,CAAC;AAE7B,CAAC;AAEDH,YAAY,CAAC8G,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjI,OAAA,GAE3BiB,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ListItemHead.js","names":["_react","_interopRequireWildcard","require","_accordion","_Icon","_interopRequireDefault","_ListItemIcon","_ListItemImage","_ListItemRightElements","_ListItemHead","_reactResizeDetector","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ListItemHead","careOfLocationId","cornerImage","hoverItem","icons","imageBackground","images","isAnyItemExpandable","isExpandable","isOpen","isTitleGreyed","leftElements","onClick","onLongPress","rightElements","shouldHideImageOrIconBackground","shouldHideIndicator","shouldOpenImageOnClick","shouldShowRoundImageOrIcon","subtitle","shouldForceHover","title","titleElement","setShouldEnableTooltip","shouldShowHoverItem","setShouldShowHoverItem","useState","setIsFirstRender","longPressTimeoutRef","useRef","shouldShowSubtitleRow","shouldShowMultilineTitle","useMemo","handleShowTooltipResize","useCallback","data","_data$entry","el","entry","target","scrollWidth","clientWidth","ref","titleRef","useResizeDetector","onResize","skipOnMount","ellipsisTitleRef","useEffect","handleMouseEnter","handleMouseLeave","handleTouchStart","event","current","window","setTimeout","handleTouchEnd","clearTimeout","shouldPreventRightElementClick","bottom","getElementClickEvent","center","top","iconOrImageElement","createElement","shouldHideBackground","shouldShowRoundIcon","shouldShowRoundImage","undefined","StyledListItemHead","layout","animate","opacity","initial","transition","duration","type","className","$isClickable","$isAnyItemExpandable","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","StyledListItemHeadLeftWrapper","StyledMotionListItemHeadIndicator","rotate","StyledListItemHeadContent","$isIconOrImageGiven","$isOpen","StyledListItemHeadTitle","StyledListItemHeadTitleContent","StyledListItemHeadTitleText","key","$shouldShowMultilineTitle","exit","$isEllipsis","StyledListItemHeadTitleElement","StyledListItemHeadSubtitle","StyledListItemHeadSubtitleText","StyledMotionListItemHeadHoverItemWrapper","marginLeft","width","StyledMotionListItemHeadHoverItem","displayName","_default","exports"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactNode,\n TouchEventHandler,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { IListItemRightElements } from '../../../../types/list';\nimport { getElementClickEvent } from '../../../../utils/accordion';\nimport Icon from '../../../icon/Icon';\nimport ListItemIcon from './list-item-icon/ListItemIcon';\nimport ListItemImage from './list-item-image/ListItemImage';\nimport ListItemRightElements from './list-item-right-elements/ListItemRightElements';\nimport {\n StyledListItemHead,\n StyledListItemHeadContent,\n StyledListItemHeadLeftWrapper,\n StyledListItemHeadSubtitle,\n StyledListItemHeadSubtitleText,\n StyledListItemHeadTitle,\n StyledListItemHeadTitleContent,\n StyledListItemHeadTitleElement,\n StyledListItemHeadTitleText,\n StyledMotionListItemHeadHoverItem,\n StyledMotionListItemHeadHoverItemWrapper,\n StyledMotionListItemHeadIndicator,\n} from './ListItemHead.styles';\nimport { ResizePayload, useResizeDetector } from 'react-resize-detector';\n\ntype ListItemHeadProps = {\n careOfLocationId?: number;\n cornerImage?: string;\n hoverItem?: ReactNode;\n icons?: string[];\n imageBackground?: CSSProperties['background'];\n images?: string[];\n isAnyItemExpandable: boolean;\n isExpandable: boolean;\n isOpen: boolean;\n isTitleGreyed?: boolean;\n leftElements?: ReactNode;\n onClick?: MouseEventHandler<HTMLDivElement>;\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n rightElements?: IListItemRightElements;\n shouldHideImageOrIconBackground?: boolean;\n shouldHideIndicator?: boolean;\n shouldOpenImageOnClick: boolean;\n shouldShowRoundImageOrIcon?: boolean;\n subtitle?: ReactNode;\n title: ReactNode;\n titleElement?: ReactNode;\n shouldForceHover?: boolean;\n setShouldEnableTooltip: (value: boolean) => void;\n};\n\nconst ListItemHead: FC<ListItemHeadProps> = ({\n careOfLocationId,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isAnyItemExpandable,\n isExpandable,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onLongPress,\n rightElements,\n shouldHideImageOrIconBackground,\n shouldHideIndicator,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n subtitle,\n shouldForceHover,\n title,\n titleElement,\n setShouldEnableTooltip,\n}) => {\n const [shouldShowHoverItem, setShouldShowHoverItem] = useState(false);\n const [, setIsFirstRender] = useState(false);\n\n const longPressTimeoutRef = useRef<number>();\n\n const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string';\n\n const shouldShowMultilineTitle = useMemo(() => !subtitle, [subtitle]);\n\n const handleShowTooltipResize = useCallback(\n (data: ResizePayload) => {\n const el = data.entry?.target;\n if (!el) return;\n setShouldEnableTooltip(el.scrollWidth > el.clientWidth);\n },\n [setShouldEnableTooltip],\n );\n\n const { ref: titleRef } = useResizeDetector<HTMLDivElement>({\n onResize: handleShowTooltipResize,\n skipOnMount: true,\n });\n const { ref: ellipsisTitleRef } = useResizeDetector<HTMLDivElement>({\n onResize: handleShowTooltipResize,\n skipOnMount: true,\n });\n\n // This is used to trigger a rerender, so the head height can be calculated\n useEffect(() => {\n setIsFirstRender(true);\n }, []);\n\n const handleMouseEnter = useCallback(() => setShouldShowHoverItem(true), []);\n\n const handleMouseLeave = useCallback(() => setShouldShowHoverItem(false), []);\n\n const handleTouchStart = useCallback<TouchEventHandler<HTMLDivElement>>(\n (event) => {\n longPressTimeoutRef.current = window.setTimeout(() => {\n if (typeof onLongPress === 'function') {\n onLongPress(event);\n }\n }, 400);\n },\n [onLongPress],\n );\n\n const handleTouchEnd = useCallback(() => {\n clearTimeout(longPressTimeoutRef.current);\n }, []);\n\n const shouldPreventRightElementClick = useMemo(() => {\n if (!rightElements) return false;\n\n if (\n typeof rightElements === 'object' &&\n ('bottom' in rightElements || 'center' in rightElements || 'top' in rightElements)\n ) {\n if (rightElements.bottom && getElementClickEvent(rightElements.bottom)) {\n return true;\n }\n\n if (rightElements.center && getElementClickEvent(rightElements.center)) {\n return true;\n }\n\n if (rightElements.top && getElementClickEvent(rightElements.top)) {\n return true;\n }\n } else {\n return getElementClickEvent(rightElements as ReactNode);\n }\n\n return false;\n }, [rightElements]);\n\n const iconOrImageElement = useMemo(() => {\n if (icons) {\n return (\n <ListItemIcon\n icons={icons}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundIcon={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n if (images) {\n return (\n <ListItemImage\n imageBackground={imageBackground}\n careOfLocationId={careOfLocationId}\n cornerImage={cornerImage}\n images={images}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundImage={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n return undefined;\n }, [\n careOfLocationId,\n cornerImage,\n icons,\n imageBackground,\n images,\n shouldHideImageOrIconBackground,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n ]);\n\n return (\n <StyledListItemHead\n layout\n animate={{\n opacity: isTitleGreyed ? 0.5 : 1,\n }}\n initial={false}\n transition={{ duration: 0.2, type: 'tween' }}\n className=\"beta-chayns-list-item-head\"\n $isClickable={typeof onClick === 'function' || isExpandable}\n $isAnyItemExpandable={isAnyItemExpandable}\n onClick={onClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onTouchStart={typeof onLongPress === 'function' ? handleTouchStart : undefined}\n onTouchEnd={typeof onLongPress === 'function' ? handleTouchEnd : undefined}\n >\n <StyledListItemHeadLeftWrapper>\n {isAnyItemExpandable && (\n <StyledMotionListItemHeadIndicator\n animate={{ rotate: isOpen ? 90 : 0 }}\n initial={false}\n transition={{ type: 'tween' }}\n >\n {isExpandable && !shouldHideIndicator && (\n <Icon icons={['fa fa-chevron-right']} />\n )}\n </StyledMotionListItemHeadIndicator>\n )}\n {leftElements}\n {iconOrImageElement}\n </StyledListItemHeadLeftWrapper>\n <StyledListItemHeadContent\n $isIconOrImageGiven={iconOrImageElement !== undefined}\n $isOpen={isOpen}\n >\n <StyledListItemHeadTitle>\n <StyledListItemHeadTitleContent>\n {isOpen ? (\n <StyledListItemHeadTitleText\n key=\"title\"\n ref={titleRef}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.4 }}\n >\n {title}\n </StyledListItemHeadTitleText>\n ) : (\n <StyledListItemHeadTitleText\n key=\"ellipsisTitle\"\n $isEllipsis\n ref={ellipsisTitleRef}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3 }}\n >\n {title}\n </StyledListItemHeadTitleText>\n )}\n <StyledListItemHeadTitleElement>\n {titleElement}\n </StyledListItemHeadTitleElement>\n </StyledListItemHeadTitleContent>\n </StyledListItemHeadTitle>\n {shouldShowSubtitleRow && (\n <StyledListItemHeadSubtitle>\n <StyledListItemHeadSubtitleText $isOpen={isOpen}>\n {subtitle}\n </StyledListItemHeadSubtitleText>\n </StyledListItemHeadSubtitle>\n )}\n </StyledListItemHeadContent>\n {rightElements && (\n <ListItemRightElements\n rightElements={rightElements}\n shouldPreventRightElementClick={shouldPreventRightElementClick}\n />\n )}\n {hoverItem && (\n <StyledMotionListItemHeadHoverItemWrapper\n className=\"beta-chayns-list-item-hover-item\"\n animate={{\n marginLeft: shouldForceHover || shouldShowHoverItem ? 8 : 0,\n opacity: shouldForceHover || shouldShowHoverItem ? 1 : 0,\n width: shouldForceHover || shouldShowHoverItem ? 'auto' : 0,\n }}\n initial={false}\n transition={{ duration: 0.15, type: 'tween' }}\n >\n <StyledMotionListItemHeadHoverItem>\n {hoverItem}\n </StyledMotionListItemHeadHoverItem>\n </StyledMotionListItemHeadHoverItemWrapper>\n )}\n </StyledListItemHead>\n );\n};\n\nListItemHead.displayName = 'ListItemHead';\n\nexport default ListItemHead;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAaA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,cAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,sBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AAcA,IAAAQ,oBAAA,GAAAR,OAAA;AAAyE,SAAAG,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAU,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAA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GAAG;IAC9D,CAAE;IACFiD,OAAO,EAAE,KAAM;IACfC,UAAU,EAAE;MAAEC,QAAQ,EAAE,IAAI;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBAE9C1G,MAAA,CAAAa,OAAA,CAAAiF,aAAA,CAACrF,aAAA,CAAA4H,iCAAiC,QAC7BpG,SAC8B,CACG,CAE9B,CAAC;AAE7B,CAAC;AAEDH,YAAY,CAACwG,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3H,OAAA,GAE3BiB,YAAY","ignoreList":[]}
|
|
@@ -82,9 +82,7 @@ const StyledListItemHeadTitleText = exports.StyledListItemHeadTitleText = (0, _s
|
|
|
82
82
|
white-space: ${({
|
|
83
83
|
$isEllipsis
|
|
84
84
|
}) => $isEllipsis ? 'nowrap' : 'normal'};
|
|
85
|
-
min-width:
|
|
86
|
-
$width
|
|
87
|
-
}) => `${$width}px`};
|
|
85
|
+
min-width: 0;
|
|
88
86
|
overflow: hidden;
|
|
89
87
|
text-overflow: ellipsis;
|
|
90
88
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemHead.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledListItemHead","exports","styled","motion","div","theme","text","$isClickable","$isAnyItemExpandable","css","StyledListItemHeadLeftWrapper","StyledMotionListItemHeadIndicator","StyledListItemHeadContent","$isOpen","$isIconOrImageGiven","undefined","StyledListItemHeadTitle","StyledListItemHeadTitleContent","StyledListItemHeadTitleElement","StyledListItemHeadTitleText","span","$isEllipsis","$
|
|
1
|
+
{"version":3,"file":"ListItemHead.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","StyledListItemHead","exports","styled","motion","div","theme","text","$isClickable","$isAnyItemExpandable","css","StyledListItemHeadLeftWrapper","StyledMotionListItemHeadIndicator","StyledListItemHeadContent","$isOpen","$isIconOrImageGiven","undefined","StyledListItemHeadTitle","StyledListItemHeadTitleContent","StyledListItemHeadTitleElement","StyledListItemHeadTitleText","span","$isEllipsis","$shouldShowMultilineTitle","StyledListItemHeadSubtitle","StyledListItemHeadSubtitleText","StyledMotionListItemHeadHoverItemWrapper","StyledMotionListItemHeadHoverItem"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledListItemHeadProps = WithTheme<{\n $isClickable: boolean;\n $isAnyItemExpandable: boolean;\n}>;\n\nexport const StyledListItemHead = styled(motion.div)<StyledListItemHeadProps>`\n //align-items: center;\n overflow: hidden;\n color: ${({ theme }: StyledListItemHeadProps) => theme.text};\n display: flex;\n min-height: 64px;\n padding: 12px 9px;\n position: relative;\n width: 100%;\n justify-content: center;\n cursor: ${({ $isClickable }) => ($isClickable ? 'pointer' : 'default')};\n\n ${({ $isAnyItemExpandable }) =>\n !$isAnyItemExpandable &&\n css`\n padding-left: 12px;\n `}\n`;\n\nexport const StyledListItemHeadLeftWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: auto 0;\n`;\n\nexport const StyledMotionListItemHeadIndicator = styled(motion.div)`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n height: 26px;\n justify-content: center;\n width: 26px;\n`;\n\ntype StyledListItemHeadContentProps = {\n $isIconOrImageGiven: boolean;\n $isOpen: boolean;\n};\n\nexport const StyledListItemHeadContent = styled.div<StyledListItemHeadContentProps>`\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n font-weight: ${({ $isOpen }) => ($isOpen ? 'bold' : 'normal')};\n justify-content: center;\n line-height: normal;\n margin-left: ${({ $isIconOrImageGiven }) => ($isIconOrImageGiven ? '10px' : undefined)};\n min-width: 0;\n`;\n\nexport const StyledListItemHeadTitle = styled.div`\n align-items: center;\n display: flex;\n justify-content: space-between;\n`;\n\nexport const StyledListItemHeadTitleContent = styled(motion.div)`\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n max-width: 100%;\n min-width: 0;\n position: relative;\n`;\n\nexport const StyledListItemHeadTitleElement = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n margin-left: 8px;\n`;\n\ntype StyledListItemHeadTitleTextProps = WithTheme<{\n $shouldShowMultilineTitle: boolean;\n $isEllipsis?: boolean;\n}>;\n\nexport const StyledListItemHeadTitleText = styled(motion.span)<StyledListItemHeadTitleTextProps>`\n font-weight: ${({ $isEllipsis }) => ($isEllipsis ? 'normal' : 'bold')};\n white-space: ${({ $isEllipsis }) => ($isEllipsis ? 'nowrap' : 'normal')};\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n ${({ $shouldShowMultilineTitle, $isEllipsis }) =>\n $shouldShowMultilineTitle &&\n $isEllipsis &&\n css`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n white-space: normal;\n `}\n`;\n\nexport const StyledListItemHeadSubtitle = styled.div`\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin-top: 2px;\n`;\n\ntype StyledListItemHeadSubtitleTextProps = WithTheme<{ $isOpen: boolean }>;\n\nexport const StyledListItemHeadSubtitleText = styled.span<StyledListItemHeadSubtitleTextProps>`\n font-weight: ${({ $isOpen }) => ($isOpen ? 'bold' : 'normal')};\n white-space: ${({ $isOpen }) => ($isOpen ? 'normal' : 'nowrap')};\n overflow: hidden;\n text-overflow: ellipsis;\n\n flex: 1 1 auto;\n font-size: 85%;\n min-width: 0;\n opacity: 0.75;\n`;\n\ntype StyledMotionListItemHeadHoverItemWrapperProps = WithTheme<unknown>;\n\nexport const StyledMotionListItemHeadHoverItemWrapper = styled(\n motion.div,\n)<StyledMotionListItemHeadHoverItemWrapperProps>`\n overflow: hidden;\n flex-shrink: 0;\n margin: auto 0;\n position: absolute;\n right: 0;\n\n background: ${({ theme }: StyledMotionListItemHeadHoverItemWrapperProps) =>\n `linear-gradient(to right, transparent 0px, rgb(${theme['000-rgb'] ?? ''}) 40px)`};\n`;\n\nexport const StyledMotionListItemHeadHoverItem = styled.div`\n padding-left: 40px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA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A,GAAGxB,yBAAM,CAACE,GAAG;AAC3D;AACA,CAAC","ignoreList":[]}
|
|
@@ -35,10 +35,6 @@ const ListItemHead = ({
|
|
|
35
35
|
const [, setIsFirstRender] = useState(false);
|
|
36
36
|
const longPressTimeoutRef = useRef();
|
|
37
37
|
const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string';
|
|
38
|
-
const {
|
|
39
|
-
ref: subTitleRef,
|
|
40
|
-
height: subTitleHeight = 0
|
|
41
|
-
} = useResizeDetector();
|
|
42
38
|
const shouldShowMultilineTitle = useMemo(() => !subtitle, [subtitle]);
|
|
43
39
|
const handleShowTooltipResize = useCallback(data => {
|
|
44
40
|
const el = data.entry?.target;
|
|
@@ -46,20 +42,17 @@ const ListItemHead = ({
|
|
|
46
42
|
setShouldEnableTooltip(el.scrollWidth > el.clientWidth);
|
|
47
43
|
}, [setShouldEnableTooltip]);
|
|
48
44
|
const {
|
|
49
|
-
ref: titleRef
|
|
50
|
-
height: titleHeight = 0,
|
|
51
|
-
width: titleWidth = 0
|
|
45
|
+
ref: titleRef
|
|
52
46
|
} = useResizeDetector({
|
|
53
|
-
onResize: handleShowTooltipResize
|
|
47
|
+
onResize: handleShowTooltipResize,
|
|
48
|
+
skipOnMount: true
|
|
54
49
|
});
|
|
55
50
|
const {
|
|
56
|
-
ref: ellipsisTitleRef
|
|
57
|
-
height: ellipsisTitleHeight = 0,
|
|
58
|
-
width: ellipsisTitleWidth = 0
|
|
51
|
+
ref: ellipsisTitleRef
|
|
59
52
|
} = useResizeDetector({
|
|
60
|
-
onResize: handleShowTooltipResize
|
|
53
|
+
onResize: handleShowTooltipResize,
|
|
54
|
+
skipOnMount: true
|
|
61
55
|
});
|
|
62
|
-
const height = useMemo(() => (isOpen ? titleHeight : ellipsisTitleHeight) + (shouldShowSubtitleRow ? subTitleHeight + 4 : 0), [ellipsisTitleHeight, isOpen, shouldShowSubtitleRow, subTitleHeight, titleHeight]);
|
|
63
56
|
|
|
64
57
|
// This is used to trigger a rerender, so the head height can be calculated
|
|
65
58
|
useEffect(() => {
|
|
@@ -116,8 +109,8 @@ const ListItemHead = ({
|
|
|
116
109
|
return undefined;
|
|
117
110
|
}, [careOfLocationId, cornerImage, icons, imageBackground, images, shouldHideImageOrIconBackground, shouldOpenImageOnClick, shouldShowRoundImageOrIcon]);
|
|
118
111
|
return /*#__PURE__*/React.createElement(StyledListItemHead, {
|
|
112
|
+
layout: true,
|
|
119
113
|
animate: {
|
|
120
|
-
height,
|
|
121
114
|
opacity: isTitleGreyed ? 0.5 : 1
|
|
122
115
|
},
|
|
123
116
|
initial: false,
|
|
@@ -149,7 +142,6 @@ const ListItemHead = ({
|
|
|
149
142
|
}, /*#__PURE__*/React.createElement(StyledListItemHeadTitle, null, /*#__PURE__*/React.createElement(StyledListItemHeadTitleContent, null, isOpen ? /*#__PURE__*/React.createElement(StyledListItemHeadTitleText, {
|
|
150
143
|
key: "title",
|
|
151
144
|
ref: titleRef,
|
|
152
|
-
$width: titleWidth,
|
|
153
145
|
$shouldShowMultilineTitle: shouldShowMultilineTitle,
|
|
154
146
|
initial: {
|
|
155
147
|
opacity: 0
|
|
@@ -167,7 +159,6 @@ const ListItemHead = ({
|
|
|
167
159
|
key: "ellipsisTitle",
|
|
168
160
|
$isEllipsis: true,
|
|
169
161
|
ref: ellipsisTitleRef,
|
|
170
|
-
$width: ellipsisTitleWidth,
|
|
171
162
|
$shouldShowMultilineTitle: shouldShowMultilineTitle,
|
|
172
163
|
initial: {
|
|
173
164
|
opacity: 0
|
|
@@ -181,9 +172,7 @@ const ListItemHead = ({
|
|
|
181
172
|
transition: {
|
|
182
173
|
duration: 0.3
|
|
183
174
|
}
|
|
184
|
-
}, title), /*#__PURE__*/React.createElement(StyledListItemHeadTitleElement, null, titleElement))), shouldShowSubtitleRow && /*#__PURE__*/React.createElement(StyledListItemHeadSubtitle, {
|
|
185
|
-
ref: subTitleRef
|
|
186
|
-
}, /*#__PURE__*/React.createElement(StyledListItemHeadSubtitleText, {
|
|
175
|
+
}, title), /*#__PURE__*/React.createElement(StyledListItemHeadTitleElement, null, titleElement))), shouldShowSubtitleRow && /*#__PURE__*/React.createElement(StyledListItemHeadSubtitle, null, /*#__PURE__*/React.createElement(StyledListItemHeadSubtitleText, {
|
|
187
176
|
$isOpen: isOpen
|
|
188
177
|
}, subtitle))), rightElements && /*#__PURE__*/React.createElement(ListItemRightElements, {
|
|
189
178
|
rightElements: rightElements,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemHead.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","getElementClickEvent","Icon","ListItemIcon","ListItemImage","ListItemRightElements","StyledListItemHead","StyledListItemHeadContent","StyledListItemHeadLeftWrapper","StyledListItemHeadSubtitle","StyledListItemHeadSubtitleText","StyledListItemHeadTitle","StyledListItemHeadTitleContent","StyledListItemHeadTitleElement","StyledListItemHeadTitleText","StyledMotionListItemHeadHoverItem","StyledMotionListItemHeadHoverItemWrapper","StyledMotionListItemHeadIndicator","useResizeDetector","ListItemHead","careOfLocationId","cornerImage","hoverItem","icons","imageBackground","images","isAnyItemExpandable","isExpandable","isOpen","isTitleGreyed","leftElements","onClick","onLongPress","rightElements","shouldHideImageOrIconBackground","shouldHideIndicator","shouldOpenImageOnClick","shouldShowRoundImageOrIcon","subtitle","shouldForceHover","title","titleElement","setShouldEnableTooltip","shouldShowHoverItem","setShouldShowHoverItem","setIsFirstRender","longPressTimeoutRef","shouldShowSubtitleRow","ref","subTitleRef","height","subTitleHeight","shouldShowMultilineTitle","handleShowTooltipResize","data","el","entry","target","scrollWidth","clientWidth","titleRef","titleHeight","width","titleWidth","onResize","ellipsisTitleRef","ellipsisTitleHeight","ellipsisTitleWidth","handleMouseEnter","handleMouseLeave","handleTouchStart","event","current","window","setTimeout","handleTouchEnd","clearTimeout","shouldPreventRightElementClick","bottom","center","top","iconOrImageElement","createElement","shouldHideBackground","shouldShowRoundIcon","shouldShowRoundImage","undefined","animate","opacity","initial","transition","duration","type","className","$isClickable","$isAnyItemExpandable","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","rotate","$isIconOrImageGiven","$isOpen","key","$width","$shouldShowMultilineTitle","exit","$isEllipsis","marginLeft","displayName"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactNode,\n TouchEventHandler,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { IListItemRightElements } from '../../../../types/list';\nimport { getElementClickEvent } from '../../../../utils/accordion';\nimport Icon from '../../../icon/Icon';\nimport ListItemIcon from './list-item-icon/ListItemIcon';\nimport ListItemImage from './list-item-image/ListItemImage';\nimport ListItemRightElements from './list-item-right-elements/ListItemRightElements';\nimport {\n StyledListItemHead,\n StyledListItemHeadContent,\n StyledListItemHeadLeftWrapper,\n StyledListItemHeadSubtitle,\n StyledListItemHeadSubtitleText,\n StyledListItemHeadTitle,\n StyledListItemHeadTitleContent,\n StyledListItemHeadTitleElement,\n StyledListItemHeadTitleText,\n StyledMotionListItemHeadHoverItem,\n StyledMotionListItemHeadHoverItemWrapper,\n StyledMotionListItemHeadIndicator,\n} from './ListItemHead.styles';\nimport { ResizePayload, useResizeDetector } from 'react-resize-detector';\nimport { OnRefChangeType } from 'react-resize-detector/build/types';\n\ninterface HeadHeight {\n closed: number;\n open: number;\n}\n\ntype ListItemHeadProps = {\n careOfLocationId?: number;\n cornerImage?: string;\n hoverItem?: ReactNode;\n icons?: string[];\n imageBackground?: CSSProperties['background'];\n images?: string[];\n isAnyItemExpandable: boolean;\n isExpandable: boolean;\n isOpen: boolean;\n isTitleGreyed?: boolean;\n leftElements?: ReactNode;\n onClick?: MouseEventHandler<HTMLDivElement>;\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n rightElements?: IListItemRightElements;\n shouldHideImageOrIconBackground?: boolean;\n shouldHideIndicator?: boolean;\n shouldOpenImageOnClick: boolean;\n shouldShowRoundImageOrIcon?: boolean;\n subtitle?: ReactNode;\n title: ReactNode;\n titleElement?: ReactNode;\n shouldForceHover?: boolean;\n setShouldEnableTooltip: (value: boolean) => void;\n};\n\nconst ListItemHead: FC<ListItemHeadProps> = ({\n careOfLocationId,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isAnyItemExpandable,\n isExpandable,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onLongPress,\n rightElements,\n shouldHideImageOrIconBackground,\n shouldHideIndicator,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n subtitle,\n shouldForceHover,\n title,\n titleElement,\n setShouldEnableTooltip,\n}) => {\n const [shouldShowHoverItem, setShouldShowHoverItem] = useState(false);\n const [, setIsFirstRender] = useState(false);\n\n const longPressTimeoutRef = useRef<number>();\n\n const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string';\n\n const { ref: subTitleRef, height: subTitleHeight = 0 } = useResizeDetector();\n\n const shouldShowMultilineTitle = useMemo(() => !subtitle, [subtitle]);\n\n const handleShowTooltipResize = useCallback(\n (data: ResizePayload) => {\n const el = data.entry?.target;\n if (!el) return;\n setShouldEnableTooltip(el.scrollWidth > el.clientWidth);\n },\n [setShouldEnableTooltip],\n );\n\n const {\n ref: titleRef,\n height: titleHeight = 0,\n width: titleWidth = 0,\n } = useResizeDetector<HTMLDivElement>({\n onResize: handleShowTooltipResize,\n });\n\n const {\n ref: ellipsisTitleRef,\n height: ellipsisTitleHeight = 0,\n width: ellipsisTitleWidth = 0,\n } = useResizeDetector<HTMLDivElement>({\n onResize: handleShowTooltipResize,\n });\n\n const height = useMemo(\n () =>\n (isOpen ? titleHeight : ellipsisTitleHeight) +\n (shouldShowSubtitleRow ? subTitleHeight + 4 : 0),\n [ellipsisTitleHeight, isOpen, shouldShowSubtitleRow, subTitleHeight, titleHeight],\n );\n\n // This is used to trigger a rerender, so the head height can be calculated\n useEffect(() => {\n setIsFirstRender(true);\n }, []);\n\n const handleMouseEnter = useCallback(() => setShouldShowHoverItem(true), []);\n\n const handleMouseLeave = useCallback(() => setShouldShowHoverItem(false), []);\n\n const handleTouchStart = useCallback<TouchEventHandler<HTMLDivElement>>(\n (event) => {\n longPressTimeoutRef.current = window.setTimeout(() => {\n if (typeof onLongPress === 'function') {\n onLongPress(event);\n }\n }, 400);\n },\n [onLongPress],\n );\n\n const handleTouchEnd = useCallback(() => {\n clearTimeout(longPressTimeoutRef.current);\n }, []);\n\n const shouldPreventRightElementClick = useMemo(() => {\n if (!rightElements) return false;\n\n if (\n typeof rightElements === 'object' &&\n ('bottom' in rightElements || 'center' in rightElements || 'top' in rightElements)\n ) {\n if (rightElements.bottom && getElementClickEvent(rightElements.bottom)) {\n return true;\n }\n\n if (rightElements.center && getElementClickEvent(rightElements.center)) {\n return true;\n }\n\n if (rightElements.top && getElementClickEvent(rightElements.top)) {\n return true;\n }\n } else {\n return getElementClickEvent(rightElements as ReactNode);\n }\n\n return false;\n }, [rightElements]);\n\n const iconOrImageElement = useMemo(() => {\n if (icons) {\n return (\n <ListItemIcon\n icons={icons}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundIcon={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n if (images) {\n return (\n <ListItemImage\n imageBackground={imageBackground}\n careOfLocationId={careOfLocationId}\n cornerImage={cornerImage}\n images={images}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundImage={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n return undefined;\n }, [\n careOfLocationId,\n cornerImage,\n icons,\n imageBackground,\n images,\n shouldHideImageOrIconBackground,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n ]);\n\n return (\n <StyledListItemHead\n animate={{\n height,\n opacity: isTitleGreyed ? 0.5 : 1,\n }}\n initial={false}\n transition={{ duration: 0.2, type: 'tween' }}\n className=\"beta-chayns-list-item-head\"\n $isClickable={typeof onClick === 'function' || isExpandable}\n $isAnyItemExpandable={isAnyItemExpandable}\n onClick={onClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onTouchStart={typeof onLongPress === 'function' ? handleTouchStart : undefined}\n onTouchEnd={typeof onLongPress === 'function' ? handleTouchEnd : undefined}\n >\n <StyledListItemHeadLeftWrapper>\n {isAnyItemExpandable && (\n <StyledMotionListItemHeadIndicator\n animate={{ rotate: isOpen ? 90 : 0 }}\n initial={false}\n transition={{ type: 'tween' }}\n >\n {isExpandable && !shouldHideIndicator && (\n <Icon icons={['fa fa-chevron-right']} />\n )}\n </StyledMotionListItemHeadIndicator>\n )}\n {leftElements}\n {iconOrImageElement}\n </StyledListItemHeadLeftWrapper>\n <StyledListItemHeadContent\n $isIconOrImageGiven={iconOrImageElement !== undefined}\n $isOpen={isOpen}\n >\n <StyledListItemHeadTitle>\n <StyledListItemHeadTitleContent>\n {isOpen ? (\n <StyledListItemHeadTitleText\n key=\"title\"\n ref={titleRef}\n $width={titleWidth}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.4 }}\n >\n {title}\n </StyledListItemHeadTitleText>\n ) : (\n <StyledListItemHeadTitleText\n key=\"ellipsisTitle\"\n $isEllipsis\n ref={ellipsisTitleRef}\n $width={ellipsisTitleWidth}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3 }}\n >\n {title}\n </StyledListItemHeadTitleText>\n )}\n <StyledListItemHeadTitleElement>\n {titleElement}\n </StyledListItemHeadTitleElement>\n </StyledListItemHeadTitleContent>\n </StyledListItemHeadTitle>\n {shouldShowSubtitleRow && (\n <StyledListItemHeadSubtitle ref={subTitleRef}>\n <StyledListItemHeadSubtitleText $isOpen={isOpen}>\n {subtitle}\n </StyledListItemHeadSubtitleText>\n </StyledListItemHeadSubtitle>\n )}\n </StyledListItemHeadContent>\n {rightElements && (\n <ListItemRightElements\n rightElements={rightElements}\n shouldPreventRightElementClick={shouldPreventRightElementClick}\n />\n )}\n {hoverItem && (\n <StyledMotionListItemHeadHoverItemWrapper\n className=\"beta-chayns-list-item-hover-item\"\n animate={{\n marginLeft: shouldForceHover || shouldShowHoverItem ? 8 : 0,\n opacity: shouldForceHover || shouldShowHoverItem ? 1 : 0,\n width: shouldForceHover || shouldShowHoverItem ? 'auto' : 0,\n }}\n initial={false}\n transition={{ duration: 0.15, type: 'tween' }}\n >\n <StyledMotionListItemHeadHoverItem>\n {hoverItem}\n </StyledMotionListItemHeadHoverItem>\n </StyledMotionListItemHeadHoverItemWrapper>\n )}\n </StyledListItemHead>\n );\n};\n\nListItemHead.displayName = 'ListItemHead';\n\nexport default ListItemHead;\n"],"mappings":"AAAA,OAAOA,KAAK,IAMRC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACL,OAAO;AAEd,SAASC,oBAAoB,QAAQ,6BAA6B;AAClE,OAAOC,IAAI,MAAM,oBAAoB;AACrC,OAAOC,YAAY,MAAM,+BAA+B;AACxD,OAAOC,aAAa,MAAM,iCAAiC;AAC3D,OAAOC,qBAAqB,MAAM,kDAAkD;AACpF,SACIC,kBAAkB,EAClBC,yBAAyB,EACzBC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,uBAAuB,EACvBC,8BAA8B,EAC9BC,8BAA8B,EAC9BC,2BAA2B,EAC3BC,iCAAiC,EACjCC,wCAAwC,EACxCC,iCAAiC,QAC9B,uBAAuB;AAC9B,SAAwBC,iBAAiB,QAAQ,uBAAuB;AAkCxE,MAAMC,YAAmC,GAAGA,CAAC;EACzCC,gBAAgB;EAChBC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,eAAe;EACfC,MAAM;EACNC,mBAAmB;EACnBC,YAAY;EACZC,MAAM;EACNC,aAAa;EACbC,YAA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SAAS,iBACN3B,KAAA,CAAAuF,aAAA,CAAClE,wCAAwC;IACrC6E,SAAS,EAAC,kCAAkC;IAC5CN,OAAO,EAAE;MACLqB,UAAU,EAAErE,gBAAgB,IAAII,mBAAmB,GAAG,CAAC,GAAG,CAAC;MAC3D6C,OAAO,EAAEjD,gBAAgB,IAAII,mBAAmB,GAAG,CAAC,GAAG,CAAC;MACxDmB,KAAK,EAAEvB,gBAAgB,IAAII,mBAAmB,GAAG,MAAM,GAAG;IAC9D,CAAE;IACF8C,OAAO,EAAE,KAAM;IACfC,UAAU,EAAE;MAAEC,QAAQ,EAAE,IAAI;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBAE9CjG,KAAA,CAAAuF,aAAA,CAACnE,iCAAiC,QAC7BO,SAC8B,CACG,CAE9B,CAAC;AAE7B,CAAC;AAEDH,YAAY,CAAC0F,WAAW,GAAG,cAAc;AAEzC,eAAe1F,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ListItemHead.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","getElementClickEvent","Icon","ListItemIcon","ListItemImage","ListItemRightElements","StyledListItemHead","StyledListItemHeadContent","StyledListItemHeadLeftWrapper","StyledListItemHeadSubtitle","StyledListItemHeadSubtitleText","StyledListItemHeadTitle","StyledListItemHeadTitleContent","StyledListItemHeadTitleElement","StyledListItemHeadTitleText","StyledMotionListItemHeadHoverItem","StyledMotionListItemHeadHoverItemWrapper","StyledMotionListItemHeadIndicator","useResizeDetector","ListItemHead","careOfLocationId","cornerImage","hoverItem","icons","imageBackground","images","isAnyItemExpandable","isExpandable","isOpen","isTitleGreyed","leftElements","onClick","onLongPress","rightElements","shouldHideImageOrIconBackground","shouldHideIndicator","shouldOpenImageOnClick","shouldShowRoundImageOrIcon","subtitle","shouldForceHover","title","titleElement","setShouldEnableTooltip","shouldShowHoverItem","setShouldShowHoverItem","setIsFirstRender","longPressTimeoutRef","shouldShowSubtitleRow","shouldShowMultilineTitle","handleShowTooltipResize","data","el","entry","target","scrollWidth","clientWidth","ref","titleRef","onResize","skipOnMount","ellipsisTitleRef","handleMouseEnter","handleMouseLeave","handleTouchStart","event","current","window","setTimeout","handleTouchEnd","clearTimeout","shouldPreventRightElementClick","bottom","center","top","iconOrImageElement","createElement","shouldHideBackground","shouldShowRoundIcon","shouldShowRoundImage","undefined","layout","animate","opacity","initial","transition","duration","type","className","$isClickable","$isAnyItemExpandable","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","rotate","$isIconOrImageGiven","$isOpen","key","$shouldShowMultilineTitle","exit","$isEllipsis","marginLeft","width","displayName"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.tsx"],"sourcesContent":["import React, {\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactNode,\n TouchEventHandler,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { IListItemRightElements } from '../../../../types/list';\nimport { getElementClickEvent } from '../../../../utils/accordion';\nimport Icon from '../../../icon/Icon';\nimport ListItemIcon from './list-item-icon/ListItemIcon';\nimport ListItemImage from './list-item-image/ListItemImage';\nimport ListItemRightElements from './list-item-right-elements/ListItemRightElements';\nimport {\n StyledListItemHead,\n StyledListItemHeadContent,\n StyledListItemHeadLeftWrapper,\n StyledListItemHeadSubtitle,\n StyledListItemHeadSubtitleText,\n StyledListItemHeadTitle,\n StyledListItemHeadTitleContent,\n StyledListItemHeadTitleElement,\n StyledListItemHeadTitleText,\n StyledMotionListItemHeadHoverItem,\n StyledMotionListItemHeadHoverItemWrapper,\n StyledMotionListItemHeadIndicator,\n} from './ListItemHead.styles';\nimport { ResizePayload, useResizeDetector } from 'react-resize-detector';\n\ntype ListItemHeadProps = {\n careOfLocationId?: number;\n cornerImage?: string;\n hoverItem?: ReactNode;\n icons?: string[];\n imageBackground?: CSSProperties['background'];\n images?: string[];\n isAnyItemExpandable: boolean;\n isExpandable: boolean;\n isOpen: boolean;\n isTitleGreyed?: boolean;\n leftElements?: ReactNode;\n onClick?: MouseEventHandler<HTMLDivElement>;\n onLongPress?: TouchEventHandler<HTMLDivElement>;\n rightElements?: IListItemRightElements;\n shouldHideImageOrIconBackground?: boolean;\n shouldHideIndicator?: boolean;\n shouldOpenImageOnClick: boolean;\n shouldShowRoundImageOrIcon?: boolean;\n subtitle?: ReactNode;\n title: ReactNode;\n titleElement?: ReactNode;\n shouldForceHover?: boolean;\n setShouldEnableTooltip: (value: boolean) => void;\n};\n\nconst ListItemHead: FC<ListItemHeadProps> = ({\n careOfLocationId,\n cornerImage,\n hoverItem,\n icons,\n imageBackground,\n images,\n isAnyItemExpandable,\n isExpandable,\n isOpen,\n isTitleGreyed,\n leftElements,\n onClick,\n onLongPress,\n rightElements,\n shouldHideImageOrIconBackground,\n shouldHideIndicator,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n subtitle,\n shouldForceHover,\n title,\n titleElement,\n setShouldEnableTooltip,\n}) => {\n const [shouldShowHoverItem, setShouldShowHoverItem] = useState(false);\n const [, setIsFirstRender] = useState(false);\n\n const longPressTimeoutRef = useRef<number>();\n\n const shouldShowSubtitleRow = subtitle || typeof subtitle === 'string';\n\n const shouldShowMultilineTitle = useMemo(() => !subtitle, [subtitle]);\n\n const handleShowTooltipResize = useCallback(\n (data: ResizePayload) => {\n const el = data.entry?.target;\n if (!el) return;\n setShouldEnableTooltip(el.scrollWidth > el.clientWidth);\n },\n [setShouldEnableTooltip],\n );\n\n const { ref: titleRef } = useResizeDetector<HTMLDivElement>({\n onResize: handleShowTooltipResize,\n skipOnMount: true,\n });\n const { ref: ellipsisTitleRef } = useResizeDetector<HTMLDivElement>({\n onResize: handleShowTooltipResize,\n skipOnMount: true,\n });\n\n // This is used to trigger a rerender, so the head height can be calculated\n useEffect(() => {\n setIsFirstRender(true);\n }, []);\n\n const handleMouseEnter = useCallback(() => setShouldShowHoverItem(true), []);\n\n const handleMouseLeave = useCallback(() => setShouldShowHoverItem(false), []);\n\n const handleTouchStart = useCallback<TouchEventHandler<HTMLDivElement>>(\n (event) => {\n longPressTimeoutRef.current = window.setTimeout(() => {\n if (typeof onLongPress === 'function') {\n onLongPress(event);\n }\n }, 400);\n },\n [onLongPress],\n );\n\n const handleTouchEnd = useCallback(() => {\n clearTimeout(longPressTimeoutRef.current);\n }, []);\n\n const shouldPreventRightElementClick = useMemo(() => {\n if (!rightElements) return false;\n\n if (\n typeof rightElements === 'object' &&\n ('bottom' in rightElements || 'center' in rightElements || 'top' in rightElements)\n ) {\n if (rightElements.bottom && getElementClickEvent(rightElements.bottom)) {\n return true;\n }\n\n if (rightElements.center && getElementClickEvent(rightElements.center)) {\n return true;\n }\n\n if (rightElements.top && getElementClickEvent(rightElements.top)) {\n return true;\n }\n } else {\n return getElementClickEvent(rightElements as ReactNode);\n }\n\n return false;\n }, [rightElements]);\n\n const iconOrImageElement = useMemo(() => {\n if (icons) {\n return (\n <ListItemIcon\n icons={icons}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundIcon={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n if (images) {\n return (\n <ListItemImage\n imageBackground={imageBackground}\n careOfLocationId={careOfLocationId}\n cornerImage={cornerImage}\n images={images}\n shouldOpenImageOnClick={shouldOpenImageOnClick}\n shouldHideBackground={!!shouldHideImageOrIconBackground}\n shouldShowRoundImage={!!shouldShowRoundImageOrIcon}\n />\n );\n }\n\n return undefined;\n }, [\n careOfLocationId,\n cornerImage,\n icons,\n imageBackground,\n images,\n shouldHideImageOrIconBackground,\n shouldOpenImageOnClick,\n shouldShowRoundImageOrIcon,\n ]);\n\n return (\n <StyledListItemHead\n layout\n animate={{\n opacity: isTitleGreyed ? 0.5 : 1,\n }}\n initial={false}\n transition={{ duration: 0.2, type: 'tween' }}\n className=\"beta-chayns-list-item-head\"\n $isClickable={typeof onClick === 'function' || isExpandable}\n $isAnyItemExpandable={isAnyItemExpandable}\n onClick={onClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onTouchStart={typeof onLongPress === 'function' ? handleTouchStart : undefined}\n onTouchEnd={typeof onLongPress === 'function' ? handleTouchEnd : undefined}\n >\n <StyledListItemHeadLeftWrapper>\n {isAnyItemExpandable && (\n <StyledMotionListItemHeadIndicator\n animate={{ rotate: isOpen ? 90 : 0 }}\n initial={false}\n transition={{ type: 'tween' }}\n >\n {isExpandable && !shouldHideIndicator && (\n <Icon icons={['fa fa-chevron-right']} />\n )}\n </StyledMotionListItemHeadIndicator>\n )}\n {leftElements}\n {iconOrImageElement}\n </StyledListItemHeadLeftWrapper>\n <StyledListItemHeadContent\n $isIconOrImageGiven={iconOrImageElement !== undefined}\n $isOpen={isOpen}\n >\n <StyledListItemHeadTitle>\n <StyledListItemHeadTitleContent>\n {isOpen ? (\n <StyledListItemHeadTitleText\n key=\"title\"\n ref={titleRef}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.4 }}\n >\n {title}\n </StyledListItemHeadTitleText>\n ) : (\n <StyledListItemHeadTitleText\n key=\"ellipsisTitle\"\n $isEllipsis\n ref={ellipsisTitleRef}\n $shouldShowMultilineTitle={shouldShowMultilineTitle}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3 }}\n >\n {title}\n </StyledListItemHeadTitleText>\n )}\n <StyledListItemHeadTitleElement>\n {titleElement}\n </StyledListItemHeadTitleElement>\n </StyledListItemHeadTitleContent>\n </StyledListItemHeadTitle>\n {shouldShowSubtitleRow && (\n <StyledListItemHeadSubtitle>\n <StyledListItemHeadSubtitleText $isOpen={isOpen}>\n {subtitle}\n </StyledListItemHeadSubtitleText>\n </StyledListItemHeadSubtitle>\n )}\n </StyledListItemHeadContent>\n {rightElements && (\n <ListItemRightElements\n rightElements={rightElements}\n shouldPreventRightElementClick={shouldPreventRightElementClick}\n />\n )}\n {hoverItem && (\n <StyledMotionListItemHeadHoverItemWrapper\n className=\"beta-chayns-list-item-hover-item\"\n animate={{\n marginLeft: shouldForceHover || shouldShowHoverItem ? 8 : 0,\n opacity: shouldForceHover || shouldShowHoverItem ? 1 : 0,\n width: shouldForceHover || shouldShowHoverItem ? 'auto' : 0,\n }}\n initial={false}\n transition={{ duration: 0.15, type: 'tween' }}\n >\n <StyledMotionListItemHeadHoverItem>\n {hoverItem}\n </StyledMotionListItemHeadHoverItem>\n </StyledMotionListItemHeadHoverItemWrapper>\n )}\n </StyledListItemHead>\n );\n};\n\nListItemHead.displayName = 'ListItemHead';\n\nexport default ListItemHead;\n"],"mappings":"AAAA,OAAOA,KAAK,IAMRC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACL,OAAO;AAEd,SAASC,oBAAoB,QAAQ,6BAA6B;AAClE,OAAOC,IAAI,MAAM,oBAAoB;AACrC,OAAOC,YAAY,MAAM,+BAA+B;AACxD,OAAOC,aAAa,MAAM,iCAAiC;AAC3D,OAAOC,qBAAqB,MAAM,kDAAkD;AACpF,SACIC,kBAAkB,EAClBC,yBAAyB,EACzBC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,uBAAuB,EACvBC,8BAA8B,EAC9BC,8BAA8B,EAC9BC,2BAA2B,EAC3BC,iCAAiC,EACjCC,wCAAwC,EACxCC,iCAAiC,QAC9B,uBAAuB;AAC9B,SAAwBC,iBAAiB,QAAQ,uBAAuB;AA4BxE,MAAMC,YAAmC,GAAGA,CAAC;EACzCC,gBAAgB;EAChBC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,eAAe;EACfC,MAAM;EACNC,mBAAmB;EACnBC,YAAY;EACZC,MAAM;EACNC,aAAa;EACbC,YAAY;EACZC,OAAO;EACPC,WAAW;EACXC,aAAa;EACbC,+BAA+B;EAC/BC,mBAAmB;EACnBC,sBAAsB;EACtBC,0BAA0B;EAC1BC,QAAQ;EACRC,gBAAgB;EAChBC,KA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isEllipsis ? 'nowrap' : 'normal'};
|
|
78
|
-
min-width:
|
|
79
|
-
$width
|
|
80
|
-
}) => `${$width}px`};
|
|
78
|
+
min-width: 0;
|
|
81
79
|
overflow: hidden;
|
|
82
80
|
text-overflow: ellipsis;
|
|
83
81
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemHead.styles.js","names":["motion","styled","css","StyledListItemHead","div","theme","text","$isClickable","$isAnyItemExpandable","StyledListItemHeadLeftWrapper","StyledMotionListItemHeadIndicator","StyledListItemHeadContent","$isOpen","$isIconOrImageGiven","undefined","StyledListItemHeadTitle","StyledListItemHeadTitleContent","StyledListItemHeadTitleElement","StyledListItemHeadTitleText","span","$isEllipsis","$
|
|
1
|
+
{"version":3,"file":"ListItemHead.styles.js","names":["motion","styled","css","StyledListItemHead","div","theme","text","$isClickable","$isAnyItemExpandable","StyledListItemHeadLeftWrapper","StyledMotionListItemHeadIndicator","StyledListItemHeadContent","$isOpen","$isIconOrImageGiven","undefined","StyledListItemHeadTitle","StyledListItemHeadTitleContent","StyledListItemHeadTitleElement","StyledListItemHeadTitleText","span","$isEllipsis","$shouldShowMultilineTitle","StyledListItemHeadSubtitle","StyledListItemHeadSubtitleText","StyledMotionListItemHeadHoverItemWrapper","StyledMotionListItemHeadHoverItem"],"sources":["../../../../../../src/components/list/list-item/list-item-head/ListItemHead.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledListItemHeadProps = WithTheme<{\n $isClickable: boolean;\n $isAnyItemExpandable: boolean;\n}>;\n\nexport const StyledListItemHead = styled(motion.div)<StyledListItemHeadProps>`\n //align-items: center;\n overflow: hidden;\n color: ${({ theme }: StyledListItemHeadProps) => theme.text};\n display: flex;\n min-height: 64px;\n padding: 12px 9px;\n position: relative;\n width: 100%;\n justify-content: center;\n cursor: ${({ $isClickable }) => ($isClickable ? 'pointer' : 'default')};\n\n ${({ $isAnyItemExpandable }) =>\n !$isAnyItemExpandable &&\n css`\n padding-left: 12px;\n `}\n`;\n\nexport const StyledListItemHeadLeftWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: auto 0;\n`;\n\nexport const StyledMotionListItemHeadIndicator = styled(motion.div)`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n height: 26px;\n justify-content: center;\n width: 26px;\n`;\n\ntype StyledListItemHeadContentProps = {\n $isIconOrImageGiven: boolean;\n $isOpen: boolean;\n};\n\nexport const StyledListItemHeadContent = styled.div<StyledListItemHeadContentProps>`\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n font-weight: ${({ $isOpen }) => ($isOpen ? 'bold' : 'normal')};\n justify-content: center;\n line-height: normal;\n margin-left: ${({ $isIconOrImageGiven }) => ($isIconOrImageGiven ? '10px' : undefined)};\n min-width: 0;\n`;\n\nexport const StyledListItemHeadTitle = styled.div`\n align-items: center;\n display: flex;\n justify-content: space-between;\n`;\n\nexport const StyledListItemHeadTitleContent = styled(motion.div)`\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n max-width: 100%;\n min-width: 0;\n position: relative;\n`;\n\nexport const StyledListItemHeadTitleElement = styled.div`\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n margin-left: 8px;\n`;\n\ntype StyledListItemHeadTitleTextProps = WithTheme<{\n $shouldShowMultilineTitle: boolean;\n $isEllipsis?: boolean;\n}>;\n\nexport const StyledListItemHeadTitleText = styled(motion.span)<StyledListItemHeadTitleTextProps>`\n font-weight: ${({ $isEllipsis }) => ($isEllipsis ? 'normal' : 'bold')};\n white-space: ${({ $isEllipsis }) => ($isEllipsis ? 'nowrap' : 'normal')};\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n ${({ $shouldShowMultilineTitle, $isEllipsis }) =>\n $shouldShowMultilineTitle &&\n $isEllipsis &&\n css`\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n white-space: normal;\n `}\n`;\n\nexport const StyledListItemHeadSubtitle = styled.div`\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin-top: 2px;\n`;\n\ntype StyledListItemHeadSubtitleTextProps = WithTheme<{ $isOpen: boolean }>;\n\nexport const StyledListItemHeadSubtitleText = styled.span<StyledListItemHeadSubtitleTextProps>`\n font-weight: ${({ $isOpen }) => ($isOpen ? 'bold' : 'normal')};\n white-space: ${({ $isOpen }) => ($isOpen ? 'normal' : 'nowrap')};\n overflow: hidden;\n text-overflow: ellipsis;\n\n flex: 1 1 auto;\n font-size: 85%;\n min-width: 0;\n opacity: 0.75;\n`;\n\ntype StyledMotionListItemHeadHoverItemWrapperProps = WithTheme<unknown>;\n\nexport const StyledMotionListItemHeadHoverItemWrapper = styled(\n motion.div,\n)<StyledMotionListItemHeadHoverItemWrapperProps>`\n overflow: hidden;\n flex-shrink: 0;\n margin: auto 0;\n position: absolute;\n right: 0;\n\n background: ${({ theme }: StyledMotionListItemHeadHoverItemWrapperProps) =>\n `linear-gradient(to right, transparent 0px, rgb(${theme['000-rgb'] ?? ''}) 40px)`};\n`;\n\nexport const StyledMotionListItemHeadHoverItem = styled.div`\n padding-left: 40px;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAc;AACrC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAQ/C,OAAO,MAAMC,kBAAkB,GAAGF,MAAM,CAACD,MAAM,CAACI,GAAG,CAA0B;AAC7E;AACA;AACA,aAAa,CAAC;EAAEC;AAA+B,CAAC,KAAKA,KAAK,CAACC,IAAI;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,CAAC;EAAEC;AAAa,CAAC,KAAMA,YAAY,GAAG,SAAS,GAAG,SAAU;AAC1E;AACA,MAAM,CAAC;EAAEC;AAAqB,CAAC,KACvB,CAACA,oBAAoB,IACrBN,GAAG;AACX;AACA,SAAS;AACT,CAAC;AAED,OAAO,MAAMO,6BAA6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9F,mBAAmB,CAAC;EAAEP;AAAQ,CAAC,KAAMA,OAAO,GAAG,MAAM,GAAG,QAAS;AACjE,mBAAmB,CAAC;EAAEA;AAAQ,CAAC,KAAMA,OAAO,GAAG,QAAQ,GAAG,QAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAID,OAAO,MAAMY,wCAAwC,GAAGvB,MAAM,CAC1DD,MAAM,CAACI,GACX,CAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,CAAC;EAAEC;AAAqD,CAAC,KACnE,kDAAkDA,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS;AACzF,CAAC;AAED,OAAO,MAAMoB,iCAAiC,GAAGxB,MAAM,CAACG,GAAG;AAC3D;AACA,CAAC","ignoreList":[]}
|
|
@@ -21,7 +21,6 @@ export declare const StyledListItemHeadTitleContent: import("styled-components/d
|
|
|
21
21
|
}, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
22
22
|
export declare const StyledListItemHeadTitleElement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
23
23
|
type StyledListItemHeadTitleTextProps = WithTheme<{
|
|
24
|
-
$width: number;
|
|
25
24
|
$shouldShowMultilineTitle: boolean;
|
|
26
25
|
$isEllipsis?: boolean;
|
|
27
26
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.1173",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "8f50953689840c348169f8b0856114ce5b18c695"
|
|
90
90
|
}
|