@laerdal/life-react-components 6.0.0-dev.26.full → 6.0.0-dev.27
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/README.md +1 -1
- package/dist/Button/DualFunctionButton.cjs +4 -4
- package/dist/Button/DualFunctionButton.cjs.map +1 -1
- package/dist/Button/DualFunctionButton.d.ts +2 -2
- package/dist/Button/DualFunctionButton.js +4 -4
- package/dist/Button/DualFunctionButton.js.map +1 -1
- package/dist/Button/{Button.cjs → TextButton.cjs} +179 -92
- package/dist/Button/TextButton.cjs.map +1 -0
- package/dist/Button/TextButton.d.ts +70 -0
- package/dist/Button/{Button.js → TextButton.js} +178 -91
- package/dist/Button/TextButton.js.map +1 -0
- package/dist/Button/__tests__/Button.test.tsx +8 -8
- package/dist/Button/__tests__/TextButton.test.tsx +45 -0
- package/dist/Button/index.cjs +11 -11
- package/dist/Button/index.cjs.map +1 -1
- package/dist/Button/index.d.ts +2 -2
- package/dist/Button/index.js +2 -2
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/VerticalCard/{Card.cjs → VerticalCard.cjs} +20 -20
- package/dist/Card/VerticalCard/VerticalCard.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCard.d.ts +25 -0
- package/dist/Card/VerticalCard/{Card.js → VerticalCard.js} +19 -19
- package/dist/Card/VerticalCard/VerticalCard.js.map +1 -0
- package/dist/Card/VerticalCard/{CardBottomSection.cjs → VerticalCardBottomSection.cjs} +21 -21
- package/dist/Card/VerticalCard/VerticalCardBottomSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardBottomSection.d.ts +53 -0
- package/dist/Card/VerticalCard/{CardBottomSection.js → VerticalCardBottomSection.js} +21 -21
- package/dist/Card/VerticalCard/VerticalCardBottomSection.js.map +1 -0
- package/dist/Card/VerticalCard/{CardMiddleSection.cjs → VerticalCardMiddleSection.cjs} +16 -16
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.d.ts +42 -0
- package/dist/Card/VerticalCard/{CardMiddleSection.js → VerticalCardMiddleSection.js} +15 -15
- package/dist/Card/VerticalCard/VerticalCardMiddleSection.js.map +1 -0
- package/dist/Card/VerticalCard/{CardTopSection.cjs → VerticalCardTopSection.cjs} +15 -15
- package/dist/Card/VerticalCard/VerticalCardTopSection.cjs.map +1 -0
- package/dist/Card/VerticalCard/{CardTopSection.d.ts → VerticalCardTopSection.d.ts} +8 -8
- package/dist/Card/VerticalCard/{CardTopSection.js → VerticalCardTopSection.js} +14 -14
- package/dist/Card/VerticalCard/VerticalCardTopSection.js.map +1 -0
- package/dist/Card/{HorizontalCard → VerticalCard}/__tests__/VerticalCard.test.tsx +15 -15
- package/dist/Card/VerticalCard/index.cjs +25 -25
- package/dist/Card/VerticalCard/index.cjs.map +1 -1
- package/dist/Card/VerticalCard/index.d.ts +7 -7
- package/dist/Card/VerticalCard/index.js +7 -7
- package/dist/Card/VerticalCard/index.js.map +1 -1
- package/dist/Dropdown/DropdownContent.cjs +2 -2
- package/dist/Dropdown/DropdownContent.cjs.map +1 -1
- package/dist/Dropdown/DropdownContent.js +2 -2
- package/dist/Dropdown/DropdownContent.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs +2 -2
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js +3 -3
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/UserMenu.js +2 -2
- package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.cjs +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.js +2 -2
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.js.map +1 -1
- package/dist/GlobalNavigationBar/types.cjs.map +1 -1
- package/dist/GlobalNavigationBar/types.d.ts +2 -2
- package/dist/GlobalNavigationBar/types.js.map +1 -1
- package/dist/Modals/ModalContent.cjs +2 -2
- package/dist/Modals/ModalContent.cjs.map +1 -1
- package/dist/Modals/ModalContent.js +3 -3
- package/dist/Modals/ModalContent.js.map +1 -1
- package/dist/Modals/ModalDialog.cjs +2 -2
- package/dist/Modals/ModalDialog.cjs.map +1 -1
- package/dist/Modals/ModalDialog.js +3 -3
- package/dist/Modals/ModalDialog.js.map +1 -1
- package/dist/Modals/ModalTypes.cjs.map +1 -1
- package/dist/Modals/ModalTypes.d.ts +3 -3
- package/dist/Modals/ModalTypes.js.map +1 -1
- package/dist/Popover/Popover.cjs +1 -1
- package/dist/Popover/Popover.cjs.map +1 -1
- package/dist/Popover/Popover.js +2 -2
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/SideMenu/SideMenuFooter.cjs +1 -1
- package/dist/SideMenu/SideMenuFooter.cjs.map +1 -1
- package/dist/SideMenu/SideMenuFooter.js +2 -2
- package/dist/SideMenu/SideMenuFooter.js.map +1 -1
- package/dist/SideMenu/types.cjs.map +1 -1
- package/dist/SideMenu/types.d.ts +2 -2
- package/dist/SideMenu/types.js.map +1 -1
- package/dist/Table/TableBody.cjs +1 -1
- package/dist/Table/TableBody.cjs.map +1 -1
- package/dist/Table/TableBody.js +2 -2
- package/dist/Table/TableBody.js.map +1 -1
- package/dist/Table/TableTypes.cjs.map +1 -1
- package/dist/Table/TableTypes.d.ts +2 -2
- package/dist/Table/TableTypes.js.map +1 -1
- package/dist/Tile/TileCommonItems.cjs +1 -1
- package/dist/Tile/TileCommonItems.cjs.map +1 -1
- package/dist/Tile/TileCommonItems.js +2 -2
- package/dist/Tile/TileCommonItems.js.map +1 -1
- package/dist/Tile/TileTypes.cjs.map +1 -1
- package/dist/Tile/TileTypes.d.ts +2 -2
- package/dist/Tile/TileTypes.js.map +1 -1
- package/dist/Toasters/Toast.cjs +1 -2
- package/dist/Toasters/Toast.cjs.map +1 -1
- package/dist/Toasters/Toast.js +2 -3
- package/dist/Toasters/Toast.js.map +1 -1
- package/package.json +148 -152
- package/dist/Button/Button.cjs.map +0 -1
- package/dist/Button/Button.d.ts +0 -70
- package/dist/Button/Button.js.map +0 -1
- package/dist/Card/VerticalCard/Card.cjs.map +0 -1
- package/dist/Card/VerticalCard/Card.d.ts +0 -25
- package/dist/Card/VerticalCard/Card.js.map +0 -1
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +0 -1
- package/dist/Card/VerticalCard/CardBottomSection.d.ts +0 -53
- package/dist/Card/VerticalCard/CardBottomSection.js.map +0 -1
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +0 -1
- package/dist/Card/VerticalCard/CardMiddleSection.d.ts +0 -42
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +0 -1
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +0 -1
- package/dist/Card/VerticalCard/CardTopSection.js.map +0 -1
- package/dist/Card/__tests__/Card.test.tsx +0 -146
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","names":["React","styled","useTheme","COLORS","ComponentTextStyle","ComponentXSStyling","Button","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","jsx","_jsx","jsxs","_jsxs","PopoverContainer","div","props","$size","Small","Large","generateToken","componentType","defaultVariant","theme","BOXSHADOW_CENTERED","popover","$position","Bottom","Top","Left","Right","$showArrowPointer","renderArrowStyles","PopoverTopSectionContainer","PopoverMiddleSectionContainer","PopoverBottomSectionContainer","TextContainer","renderMargins","$note","NoteContainer","Regular","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","$showOnClick","$showPopover","isNotePresent","size","position","Popover","_ref","Medium","topSectionProps","bottomSectionProps","mainContent","children","showOnClick","showArrowPointer","showPopover","setShowPopover","useState","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","ref","note","text","action","useTransparentBackground","iconColor","variant","shape","Close","textButton","icon","onClick","label","className","iconButtons","map","iconButton","propTypes","_pt","string","isRequired","arrayOf","node","func","bool"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { Button, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ $size: Size; $position: Position; $showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.$size === Size.Small ? '240px' : props.$size === Size.Large ? '480px' : '360px')};\r\n min-width: ${(props) => (props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px')};\r\n border-radius: 4px;\r\n background: ${props => COLORS.generateToken({ componentType: 'bg-surface', defaultVariant: 'high' }, props.theme)};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.$position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.$position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.$position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.$position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.$showArrowPointer ? renderArrowStyles(props.$position) : '')}\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ $size: Size }>`\r\n height: ${(props) => (props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ $size: Size }>`\r\n margin: 8px;\r\n height: ${(props) => (props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px')};\r\n padding: ${(props) => (props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px')};\r\n overflow-y: auto;\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ $size: Size }>`\r\n height: ${(props) => (props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px')}; \r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ $note: boolean; $size: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'default' }, props.theme)};\r\n margin: ${(props) => renderMargins(props.$note, props.$size)};\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ $size: Size }>`\r\n ${(props) =>\r\n props.$size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ $size: Size }>`\r\n ${(props) =>\r\n props.$size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ $position: Position; $showOnClick: boolean; $showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.$position === Position.Top || props.$position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.$position === Position.Left || props.$position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.$position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.$position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.$position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.$position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.$showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.$showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.$showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size = Size.Medium,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>(null);\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n return (\r\n <PopoverWrapper $position={position} $showOnClick={showOnClick} $showPopover={showPopover}>\r\n <PopoverContainer $size={size} $position={position} ref={popoverRef} $showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer $size={size}>\r\n <TextContainer $note={!!topSectionProps?.note} $size={size}>\r\n {topSectionProps?.note && <NoteContainer $size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer $size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer $size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground \r\n iconColor={COLORS.generateToken({ componentType: 'icon', defaultVariant: 'subtle' }, theme)} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer $size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer $size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer $size={size} data-testid={'textBtn'}>\r\n <Button size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </Button>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer $size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div onClick={() => showOnClick && setShowPopover(!showPopover)}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r\n};\r\n\r\nexport default Popover;\r\n"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SAASC,MAAM,EAAEC,kBAAkB,EAAEC,kBAAkB,QAAQ,IAAI;AACnE,SAASC,MAAM,EAAEC,UAAU,QAAQ,WAAW;AAC9C,SAASC,WAAW,QAAQ,UAAU;AACtC,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAEC,gBAAgB,EAAEC,SAAS,QAAQ,WAAW;AACjJ,SAASC,QAAQ,EAAEC,IAAI,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE1C,OAAO,MAAMC,gBAAgB,GAAGrB,MAAM,CAACsB,GAAqE;AAC5G,cAAeC,KAAK,IAAMA,KAAK,CAACC,KAAK,KAAKR,IAAI,CAACS,KAAK,GAAG,OAAO,GAAGF,KAAK,CAACC,KAAK,KAAKR,IAAI,CAACU,KAAK,GAAG,OAAO,GAAG,OAAQ;AAChH,eAAgBH,KAAK,IAAMA,KAAK,CAACC,KAAK,KAAKR,IAAI,CAACS,KAAK,GAAG,OAAO,GAAGF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K,IAAA,CAAAH,UAAA;MAKNR,KAAK,EAAAM,GAAA,CAAAC;IAAA;EAAA;EAoCLrC,WAAW,EAAAoC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAKXrC,QAAQ,EAAAmC,GAAA,CAAAI,IAAA,CAAAF,UAAA;EAWRpC,WAAW,EAAAkC,GAAA,CAAAM,IAAA,CAAAJ,UAAA;EAMXnC,gBAAgB,EAAAiC,GAAA,CAAAM;AAAA;AAsFlB,eAAe/C,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Popover.js","names":["React","styled","useTheme","COLORS","ComponentTextStyle","ComponentXSStyling","TextButton","IconButton","SystemIcons","BOXSHADOWS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXXSStyling","scrollBarStyling","Z_INDEXES","Position","Size","jsx","_jsx","jsxs","_jsxs","PopoverContainer","div","props","$size","Small","Large","generateToken","componentType","defaultVariant","theme","BOXSHADOW_CENTERED","popover","$position","Bottom","Top","Left","Right","$showArrowPointer","renderArrowStyles","PopoverTopSectionContainer","PopoverMiddleSectionContainer","PopoverBottomSectionContainer","TextContainer","renderMargins","$note","NoteContainer","Regular","LabelContainer","Bold","CloseButtonContainer","TextButtonContainer","IconButtonContainer","PopoverWrapper","$showOnClick","$showPopover","isNotePresent","size","position","Popover","_ref","Medium","topSectionProps","bottomSectionProps","mainContent","children","showOnClick","showArrowPointer","showPopover","setShowPopover","useState","popoverRef","useRef","useEffect","checkIfClickedOutside","e","current","contains","target","document","addEventListener","removeEventListener","ref","note","text","action","useTransparentBackground","iconColor","variant","shape","Close","textButton","icon","onClick","label","className","iconButtons","map","iconButton","propTypes","_pt","string","isRequired","arrayOf","node","func","bool"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentTextStyle, ComponentXSStyling } from '..';\r\nimport { TextButton, IconButton } from '../Button';\r\nimport { SystemIcons } from '../icons';\r\nimport { BOXSHADOWS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXXSStyling, scrollBarStyling, Z_INDEXES } from '../styles';\r\nimport { Position, Size } from '../types';\r\n\r\nexport const PopoverContainer = styled.div<{ $size: Size; $position: Position; $showArrowPointer: boolean }>`\r\n //height: ${(props) => (props.$size === Size.Small ? '240px' : props.$size === Size.Large ? '480px' : '360px')};\r\n min-width: ${(props) => (props.$size === Size.Small ? '320px' : props.$size === Size.Large ? '640px' : '480px')};\r\n border-radius: 4px;\r\n background: ${props => COLORS.generateToken({ componentType: 'bg-surface', defaultVariant: 'high' }, props.theme)};\r\n cursor: default;\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_CENTERED};\r\n\r\n position: absolute; \r\n visibility: hidden;\r\n opacity: 0;\r\n z-index: ${Z_INDEXES.popover};\r\n\r\n ${(props) => (props.$position == Position.Bottom ? 'right: 50%; top: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n ${(props) => (props.$position == Position.Top ? 'right: 50%; bottom: calc(100% + 16px); transform: translateX(50%);' : '')}\r\n\r\n ${(props) => (props.$position == Position.Left ? 'bottom: 50%; right: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n ${(props) => (props.$position == Position.Right ? 'bottom: 50%; left: calc(100% + 16px); transform: translateY(50%);' : '')}\r\n\r\n &::after {\r\n ${(props) => (props.$showArrowPointer ? renderArrowStyles(props.$position) : '')}\r\n`;\r\n\r\nexport const PopoverTopSectionContainer = styled.div<{ $size: Size }>`\r\n height: ${(props) => (props.$size === Size.Small ? '56px' : props.$size === Size.Large ? '72px' : '64px')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverMiddleSectionContainer = styled.div<{ $size: Size }>`\r\n margin: 8px;\r\n height: ${(props) => (props.$size === Size.Small ? '104px' : props.$size === Size.Large ? '304px' : '208px')};\r\n padding: ${(props) => (props.$size === Size.Small ? '0 8px' : props.$size === Size.Large ? '0 16px' : '0 12px')};\r\n overflow-y: auto;\r\n ${scrollBarStyling(Size.Small)}\r\n`;\r\n\r\nexport const PopoverBottomSectionContainer = styled.div<{ $size: Size }>`\r\n height: ${(props) => (props.$size === Size.Small ? '64px' : props.$size === Size.Large ? '88px' : '72px')}; \r\n display: flex;\r\n\r\n .bottom-flex {\r\n flex: 1;\r\n }\r\n`;\r\n\r\nconst TextContainer = styled.div<{ $note: boolean; $size: Size }>`\r\n display: flex;\r\n flex-direction: column;\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'default' }, props.theme)};\r\n margin: ${(props) => renderMargins(props.$note, props.$size)};\r\n flex-grow: 1;\r\n`;\r\n\r\nconst NoteContainer = styled.div<{ $size: Size }>`\r\n ${(props) =>\r\n props.$size === Size.Small\r\n ? ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : props.$size === Size.Large\r\n ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))\r\n : ComponentXSStyling(ComponentTextStyle.Regular, COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme))}\r\n`;\r\n\r\nconst LabelContainer = styled.div<{ $size: Size }>`\r\n ${(props) =>\r\n props.$size === Size.Small\r\n ? ComponentSStyling(ComponentTextStyle.Bold, null)\r\n : props.$size === Size.Large\r\n ? ComponentLStyling(ComponentTextStyle.Bold, null)\r\n : ComponentMStyling(ComponentTextStyle.Bold, null)}\r\n`;\r\n\r\nconst CloseButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '4px 16px 4px 0' : props.$size === Size.Large ? '12px 24px 12px 0' : '8px 20px 8px 0')};\r\n`;\r\n\r\nconst TextButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '8px 0 8px 16px' : props.$size === Size.Large ? '16px 0 16px 24px' : '12px 0 12px 20px')};\r\n`;\r\n\r\nconst IconButtonContainer = styled.div<{ $size: Size }>`\r\n margin: ${(props) => (props.$size === Size.Small ? '8px 16px 8px 0' : props.$size === Size.Large ? '16px 24px 16px 0' : '12px 20px 12px 0')};\r\n display: flex;\r\n`;\r\n\r\nexport const PopoverWrapper = styled.div<{ $position: Position; $showOnClick: boolean; $showPopover: boolean }>`\r\n position: relative;\r\n\r\n .pointer-space {\r\n height: ${(props) => (props.$position === Position.Top || props.$position === Position.Bottom ? '16px' : '100%')};\r\n width: ${(props) => (props.$position === Position.Left || props.$position === Position.Right ? '16px' : '100%')};\r\n position: absolute;\r\n\r\n ${(props) => (props.$position === Position.Left ? 'right:100%; bottom: 0%' : '')};\r\n ${(props) => (props.$position === Position.Right ? 'left:100%; bottom: 0%' : '')};\r\n\r\n ${(props) => (props.$position === Position.Top ? 'bottom: 100%' : '')};\r\n ${(props) => (props.$position === Position.Bottom ? 'top: 100%' : '')};\r\n }\r\n\r\n ${(props) =>\r\n props.$showOnClick\r\n ? `${PopoverContainer} {\r\n visibility: ${props.$showPopover ? 'visible' : 'hidden'};\r\n opacity: ${props.$showPopover ? '1' : '0'};\r\n }\r\n cursor: pointer;`\r\n : `&:hover {\r\n ${PopoverContainer} {\r\n visibility: visible;\r\n opacity: 1;\r\n }\r\n }`}\r\n`;\r\n\r\nconst renderMargins = (isNotePresent: boolean, size: Size): string => {\r\n if (isNotePresent) {\r\n return size === Size.Small ? '10px 16px' : size === Size.Large ? '14px 24px' : '12px 20px';\r\n } else {\r\n return size === Size.Small ? '18px 16px' : size === Size.Large ? '24px' : '20px';\r\n }\r\n};\r\n\r\nconst renderArrowStyles = (position: Position) => {\r\n if (position === Position.Bottom) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid transparent;\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid rgb(255,255,255);\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n bottom: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Top) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 16px solid rgb(255,255,255);\r\n border-right: 12px solid transparent;\r\n border-bottom: 16px solid transparent;\r\n border-left: 12px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(50% - 12px);\r\n top: calc(100% - 1px);`;\r\n }\r\n\r\n if (position === Position.Left) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid transparent;\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid rgb(255,255,255);\r\n content: \"\";\r\n position: absolute;\r\n left: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n\r\n if (position === Position.Right) {\r\n return `height: 0px;\r\n width: 0px;\r\n border-top: 12px solid transparent;\r\n border-right: 16px solid rgb(255,255,255);\r\n border-bottom: 12px solid transparent;\r\n border-left: 16px solid transparent;\r\n content: \"\";\r\n position: absolute;\r\n right: calc(100% - 1px);\r\n bottom: calc(50% - 12px);`;\r\n }\r\n};\r\n\r\nexport interface PopoverTopSectionProps {\r\n /**\r\n * Required. The main text to be displayed in the top section of the popover.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Optional. A note to be displayed below the main text in the top section of the popover.\r\n */\r\n note?: string;\r\n};\r\n\r\nexport interface PopoverActionButtonProps {\r\n /**\r\n * Required. The icon to be displayed on the button.\r\n */\r\n icon: React.ReactNode;\r\n\r\n /**\r\n * Required. The handler function to be called when the button is clicked.\r\n */\r\n action: () => void;\r\n\r\n /**\r\n * Optional. The label for the button. If provided, the button will display this text.\r\n */\r\n label?: string;\r\n};\r\n\r\nexport interface PopoverBottomSectionProps {\r\n /**\r\n * Optional. An array of PopoverActionButtonProps objects.\r\n * Each object represents an icon button to be displayed in the bottom section of the popover.\r\n */\r\n iconButtons?: PopoverActionButtonProps[];\r\n\r\n /**\r\n * Optional. A PopoverActionButtonProps object representing a text button to be displayed in the bottom section of the popover.\r\n */\r\n textButton?: PopoverActionButtonProps;\r\n};\r\n\r\nexport interface PopoverProps {\r\n /**\r\n * Optional. The size of the popover. It can be 'Small', 'Medium', or 'Large'.\r\n * Defaults to 'Medium' if not specified.\r\n */\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n\r\n /**\r\n * Optional. Properties for the top section of the popover.\r\n */\r\n topSectionProps?: PopoverTopSectionProps;\r\n\r\n /**\r\n * Optional. Properties for the bottom section of the popover.\r\n */\r\n bottomSectionProps?: PopoverBottomSectionProps;\r\n\r\n /**\r\n * Required. The main content to be displayed in the popover.\r\n */\r\n mainContent: React.ReactNode;\r\n\r\n /**\r\n * Required. The children to be rendered inside the popover.\r\n */\r\n children: React.ReactNode;\r\n\r\n /**\r\n * Required. The position of the popover relative to the target element.\r\n * It can be 'Top', 'Bottom', 'Right', or 'Left'.\r\n */\r\n position: Position.Top | Position.Bottom | Position.Right | Position.Left;\r\n\r\n /**\r\n * Required. A boolean indicating whether the popover should be shown when the target element is clicked. Defaults to 'false', meaning that popover will be shown on mouse hover.\r\n */\r\n showOnClick: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether an arrow pointer should be shown on the popover.\r\n * Defaults to 'false' if not specified.\r\n */\r\n showArrowPointer?: boolean;\r\n};\r\n\r\nconst Popover: React.FunctionComponent<PopoverProps> = ({\r\n size = Size.Medium,\r\n topSectionProps,\r\n bottomSectionProps,\r\n mainContent,\r\n children,\r\n position,\r\n showOnClick = false,\r\n showArrowPointer = false,\r\n}) => {\r\n const [showPopover, setShowPopover] = React.useState(false);\r\n const theme = useTheme();\r\n const popoverRef = React.useRef<any>(null);\r\n\r\n React.useEffect(() => {\r\n const checkIfClickedOutside = (e: { target: any }) => {\r\n if (showPopover && popoverRef.current && !popoverRef.current.contains(e.target)) {\r\n setShowPopover(false);\r\n }\r\n };\r\n\r\n document.addEventListener('mousedown', checkIfClickedOutside);\r\n\r\n return () => {\r\n document.removeEventListener('mousedown', checkIfClickedOutside);\r\n };\r\n }, [showPopover]);\r\n\r\n return (\r\n <PopoverWrapper $position={position} $showOnClick={showOnClick} $showPopover={showPopover}>\r\n <PopoverContainer $size={size} $position={position} ref={popoverRef} $showArrowPointer={showArrowPointer}>\r\n {!!topSectionProps && (\r\n <PopoverTopSectionContainer $size={size}>\r\n <TextContainer $note={!!topSectionProps?.note} $size={size}>\r\n {topSectionProps?.note && <NoteContainer $size={size}>{topSectionProps.note}</NoteContainer>}\r\n <LabelContainer $size={size}>{topSectionProps?.text}</LabelContainer>\r\n </TextContainer>\r\n\r\n {showOnClick && (\r\n <CloseButtonContainer $size={size} data-testid={'closeBtn'}>\r\n <IconButton action={() => setShowPopover(false)} useTransparentBackground \r\n iconColor={COLORS.generateToken({ componentType: 'icon', defaultVariant: 'subtle' }, theme)} variant=\"secondary\" shape=\"circular\">\r\n <SystemIcons.Close />\r\n </IconButton>\r\n </CloseButtonContainer>\r\n )}\r\n </PopoverTopSectionContainer>\r\n )}\r\n\r\n <PopoverMiddleSectionContainer $size={size}>{mainContent}</PopoverMiddleSectionContainer>\r\n\r\n {!!bottomSectionProps && (\r\n <PopoverBottomSectionContainer $size={size}>\r\n {!!bottomSectionProps?.textButton?.icon && (\r\n <TextButtonContainer $size={size} data-testid={'textBtn'}>\r\n <TextButton size={size} variant=\"secondary\" icon={bottomSectionProps.textButton.icon} onClick={bottomSectionProps.textButton.action}>\r\n {bottomSectionProps.textButton.label}\r\n </TextButton>\r\n </TextButtonContainer>\r\n )}\r\n\r\n <div className=\"bottom-flex\" />\r\n\r\n <IconButtonContainer $size={size} data-testid={'iconBtn'}>\r\n {bottomSectionProps?.iconButtons?.map((iconButton) => (\r\n <IconButton action={iconButton.action} variant=\"secondary\" shape=\"circular\" useTransparentBackground>\r\n {iconButton.icon}\r\n </IconButton>\r\n ))}\r\n </IconButtonContainer>\r\n </PopoverBottomSectionContainer>\r\n )}\r\n </PopoverContainer>\r\n\r\n <div onClick={() => showOnClick && setShowPopover(!showPopover)}>\r\n {children}\r\n\r\n <div className=\"pointer-space\" />\r\n </div>\r\n </PopoverWrapper>\r\n );\r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PURE__*/(0, _jsxRuntime.jsx)(ButtonsContainer, {
|
|
71
|
-
children: props.footer.buttons.map((button, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.
|
|
71
|
+
children: props.footer.buttons.map((button, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.TextButton, _objectSpread(_objectSpread({
|
|
72
72
|
size: props.size
|
|
73
73
|
}, button), {}, {
|
|
74
74
|
children: button.label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideMenuFooter.cjs","names":["_react","_interopRequireDefault","require","_styledComponents","_styles","_assets","_Button","_MenuItem","_jsxRuntime","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","Wrapper","styled","div","props","COLORS","getColor","theme","ItemsContainer","ButtonsContainer","LogoContainer","NoteContainer","ComponentXXSStyling","ComponentTextStyle","Regular","SideMenuFooter","jsxs","children","footer","items","jsx","map","item","index","MenuItem","size","buttons","button","
|
|
1
|
+
{"version":3,"file":"SideMenuFooter.cjs","names":["_react","_interopRequireDefault","require","_styledComponents","_styles","_assets","_Button","_MenuItem","_jsxRuntime","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","Wrapper","styled","div","props","COLORS","getColor","theme","ItemsContainer","ButtonsContainer","LogoContainer","NoteContainer","ComponentXXSStyling","ComponentTextStyle","Regular","SideMenuFooter","jsxs","children","footer","items","jsx","map","item","index","MenuItem","size","buttons","button","TextButton","label","LaerdalLogo","height","width","note","exports"],"sources":["../../src/SideMenu/SideMenuFooter.tsx"],"sourcesContent":["import React from 'react';\r\nimport {SideMenuProps} from './types';\r\nimport styled from 'styled-components';\r\nimport {\r\n COLORS,\r\n ComponentTextStyle,\r\n ComponentXXSStyling\r\n} from '../styles';\r\nimport {LaerdalLogo} from '../assets';\r\nimport {TextButton} from '../Button';\r\nimport {MenuItem} from '../MenuItem';\r\n\r\nconst Wrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n box-sizing: border-box;\r\n width: 100%;\r\n\r\n border-top: 1px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n`;\r\n\r\nconst ItemsContainer = styled.div`\r\n padding: 8px;\r\n display: flex;\r\n flex-direction: column;\r\n box-sizing: border-box;\r\n width: 100%;\r\n`;\r\n\r\nconst ButtonsContainer = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n box-sizing: border-box;\r\n padding: 8px 16px;\r\n gap: 10px;\r\n width: 100%;\r\n\r\n button {\r\n flex: 1;\r\n }\r\n\r\n .small & {\r\n gap: 0;\r\n flex-direction: column-reverse;\r\n }\r\n`;\r\n\r\nconst LogoContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n box-sizing: border-box;\r\n min-height: 80px;\r\n padding: 8px 16px;\r\n background-color: ${props => COLORS.getColor('neutral_20', props.theme)};\r\n width: 100%;\r\n`;\r\n\r\nconst NoteContainer = styled.div`\r\n ${props => ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_500', props.theme))}\r\n`;\r\n\r\nexport const SideMenuFooter = (props: SideMenuProps) => {\r\n\r\n return (\r\n <Wrapper>\r\n {\r\n !!props.footer?.items?.length &&\r\n <ItemsContainer>\r\n {props.footer.items.map((item, index) =>\r\n <MenuItem key={index} size={props.size} {...item}/>\r\n )}\r\n </ItemsContainer>\r\n }\r\n {\r\n !!props.footer?.buttons?.length &&\r\n <ButtonsContainer>\r\n {\r\n props.footer.buttons.map((button, index) =>\r\n <TextButton key={index} size={props.size} {...button} >\r\n {button.label}\r\n </TextButton>\r\n )\r\n }\r\n </ButtonsContainer>\r\n }\r\n {\r\n !props.footer?.buttons?.length &&\r\n <LogoContainer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AK,CAACE,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,kBAClC,IAAA7C,WAAA,CAAA0C,GAAA,EAAC3C,SAAA,CAAA+C,QAAQ,EAAAhC,aAAA;QAAaiC,IAAI,EAAErB,KAAK,CAACqB;MAAK,GAAKH,IAAI,GAAjCC,KAAmC,CACpD;IAAC,CACa,CAAC,EAGjB,CAAC,CAACnB,KAAK,CAACc,MAAM,EAAEQ,OAAO,EAAEhC,MAAM,iBAC/B,IAAAhB,WAAA,CAAA0C,GAAA,EAACX,gBAAgB;MAAAQ,QAAA,EAEbb,KAAK,CAACc,MAAM,CAACQ,OAAO,CAACL,GAAG,CAAC,CAACM,MAAM,EAAEJ,KAAK,kBACrC,IAAA7C,WAAA,CAAA0C,GAAA,EAAC5C,OAAA,CAAAoD,UAAU,EAAApC,aAAA,CAAAA,aAAA;QAAaiC,IAAI,EAAErB,KAAK,CAACqB;MAAK,GAAKE,MAAM;QAAAV,QAAA,EACjDU,MAAM,CAACE;MAAK,IADEN,KAEL,CACd;IAAC,CAEa,CAAC,EAGnB,CAACnB,KAAK,CAACc,MAAM,EAAEQ,OAAO,EAAEhC,MAAM,iBAC9B,IAAAhB,WAAA,CAAAsC,IAAA,EAACN,aAAa;MAAAO,QAAA,gBACZ,IAAAvC,WAAA,CAAA0C,GAAA,EAAC7C,OAAA,CAAAuD,WAAW;QAACC,MAAM,EAAE,MAAO;QAACC,KAAK,EAAE;MAAO,CAAC,CAAC,eAC7C,IAAAtD,WAAA,CAAA0C,GAAA,EAACT,aAAa;QAAAM,QAAA,EAAEb,KAAK,CAACc,MAAM,EAAEe;MAAI,CAAgB,CAAC;IAAA,CACtC,CAAC;EAAA,CAGX,CAAC;AAEd,CAAC;AAACC,OAAA,CAAAnB,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { COLORS, ComponentTextStyle, ComponentXXSStyling } from '../styles';
|
|
7
7
|
import { LaerdalLogo } from '../assets';
|
|
8
|
-
import {
|
|
8
|
+
import { TextButton } from '../Button';
|
|
9
9
|
import { MenuItem } from '../MenuItem';
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
const Wrapper = styled.div`
|
|
@@ -61,7 +61,7 @@ export const SideMenuFooter = props => {
|
|
|
61
61
|
size: props.size
|
|
62
62
|
}, item), index))
|
|
63
63
|
}), !!props.footer?.buttons?.length && /*#__PURE__*/_jsx(ButtonsContainer, {
|
|
64
|
-
children: props.footer.buttons.map((button, index) => /*#__PURE__*/_jsx(
|
|
64
|
+
children: props.footer.buttons.map((button, index) => /*#__PURE__*/_jsx(TextButton, _objectSpread(_objectSpread({
|
|
65
65
|
size: props.size
|
|
66
66
|
}, button), {}, {
|
|
67
67
|
children: button.label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideMenuFooter.js","names":["React","styled","COLORS","ComponentTextStyle","ComponentXXSStyling","LaerdalLogo","
|
|
1
|
+
{"version":3,"file":"SideMenuFooter.js","names":["React","styled","COLORS","ComponentTextStyle","ComponentXXSStyling","LaerdalLogo","TextButton","MenuItem","jsx","_jsx","jsxs","_jsxs","Wrapper","div","props","getColor","theme","ItemsContainer","ButtonsContainer","LogoContainer","NoteContainer","Regular","SideMenuFooter","children","footer","items","length","map","item","index","_objectSpread","size","buttons","button","label","height","width","note"],"sources":["../../src/SideMenu/SideMenuFooter.tsx"],"sourcesContent":["import React from 'react';\r\nimport {SideMenuProps} from './types';\r\nimport styled from 'styled-components';\r\nimport {\r\n COLORS,\r\n ComponentTextStyle,\r\n ComponentXXSStyling\r\n} from '../styles';\r\nimport {LaerdalLogo} from '../assets';\r\nimport {TextButton} from '../Button';\r\nimport {MenuItem} from '../MenuItem';\r\n\r\nconst Wrapper = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n box-sizing: border-box;\r\n width: 100%;\r\n\r\n border-top: 1px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n`;\r\n\r\nconst ItemsContainer = styled.div`\r\n padding: 8px;\r\n display: flex;\r\n flex-direction: column;\r\n box-sizing: border-box;\r\n width: 100%;\r\n`;\r\n\r\nconst ButtonsContainer = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n box-sizing: border-box;\r\n padding: 8px 16px;\r\n gap: 10px;\r\n width: 100%;\r\n\r\n button {\r\n flex: 1;\r\n }\r\n\r\n .small & {\r\n gap: 0;\r\n flex-direction: column-reverse;\r\n }\r\n`;\r\n\r\nconst LogoContainer = styled.div`\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n box-sizing: border-box;\r\n min-height: 80px;\r\n padding: 8px 16px;\r\n background-color: ${props => COLORS.getColor('neutral_20', props.theme)};\r\n width: 100%;\r\n`;\r\n\r\nconst NoteContainer = styled.div`\r\n ${props => ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.getColor('neutral_500', props.theme))}\r\n`;\r\n\r\nexport const SideMenuFooter = (props: SideMenuProps) => {\r\n\r\n return (\r\n <Wrapper>\r\n {\r\n !!props.footer?.items?.length &&\r\n <ItemsContainer>\r\n {props.footer.items.map((item, index) =>\r\n <MenuItem key={index} size={props.size} {...item}/>\r\n )}\r\n </ItemsContainer>\r\n }\r\n {\r\n !!props.footer?.buttons?.length &&\r\n <ButtonsContainer>\r\n {\r\n props.footer.buttons.map((button, index) =>\r\n <TextButton key={index} size={props.size} {...button} >\r\n {button.label}\r\n </TextButton>\r\n )\r\n }\r\n </ButtonsContainer>\r\n }\r\n {\r\n !props.footer?.buttons?.length &&\r\n <LogoContainer>\r\n <LaerdalLogo height={'36px'} width={'66px'}/>\r\n <NoteContainer>{props.footer?.note}</NoteContainer>\r\n </LogoContainer>\r\n }\r\n\r\n </Wrapper>\r\n )\r\n};\r\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,MAAM,MAAM,mBAAmB;AACtC,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IAAI,EAAEC,KAAK,kBAClCpB,IAAA,CAACF,QAAQ,EAAAuB,aAAA;QAAaC,IAAI,EAAEjB,KAAK,CAACiB;MAAK,GAAKH,IAAI,GAAjCC,KAAmC,CACpD;IAAC,CACa,CAAC,EAGjB,CAAC,CAACf,KAAK,CAACU,MAAM,EAAEQ,OAAO,EAAEN,MAAM,iBAC/BjB,IAAA,CAACS,gBAAgB;MAAAK,QAAA,EAEbT,KAAK,CAACU,MAAM,CAACQ,OAAO,CAACL,GAAG,CAAC,CAACM,MAAM,EAAEJ,KAAK,kBACrCpB,IAAA,CAACH,UAAU,EAAAwB,aAAA,CAAAA,aAAA;QAAaC,IAAI,EAAEjB,KAAK,CAACiB;MAAK,GAAKE,MAAM;QAAAV,QAAA,EACjDU,MAAM,CAACC;MAAK,IADEL,KAEL,CACd;IAAC,CAEa,CAAC,EAGnB,CAACf,KAAK,CAACU,MAAM,EAAEQ,OAAO,EAAEN,MAAM,iBAC9Bf,KAAA,CAACQ,aAAa;MAAAI,QAAA,gBACZd,IAAA,CAACJ,WAAW;QAAC8B,MAAM,EAAE,MAAO;QAACC,KAAK,EAAE;MAAO,CAAC,CAAC,eAC7C3B,IAAA,CAACW,aAAa;QAAAG,QAAA,EAAET,KAAK,CAACU,MAAM,EAAEa;MAAI,CAAgB,CAAC;IAAA,CACtC,CAAC;EAAA,CAGX,CAAC;AAEd,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","names":[],"sources":["../../src/SideMenu/types.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.cjs","names":[],"sources":["../../src/SideMenu/types.ts"],"sourcesContent":["import {TextButtonProps} from '../Button/TextButton';\r\nimport {IconButtonProps} from '../Button/Iconbutton';\r\nimport {MenuItemProps} from '../MenuItem/MenuItem';\r\nimport {Size} from '../types';\r\n\r\n\r\nexport type SideMenuAction = Omit<IconButtonProps, 'variant' |\r\n 'shape' |\r\n 'isInMobileMenu' |\r\n 'borderRadius' |\r\n 'flatEdge' |\r\n 'focusBackgroundColor' |\r\n 'useTransparentBackground' |\r\n 'unsetIconSize' |\r\n 'shouldNotInteract' |\r\n 'invertFocus' |\r\n 'hideOnLowWidth' | 'children'> & { icon: React.ReactNode };\r\n\r\nexport type SideMenuButton =\r\n Omit<TextButtonProps, 'size' | 'iconOnly' | 'minWidth' | 'testId' | 'width' | 'invertFocus' | 'colorTheme' | 'flatEdge' | 'children'>\r\n & { label: string };\r\n\r\nexport type SideMenuItem = Omit<MenuItemProps, 'size'>\r\n\r\nexport interface SideMenuHeader {\r\n actions?: SideMenuAction[];\r\n label?: string;\r\n}\r\n\r\nexport interface SideMenuFooter {\r\n items?: SideMenuItem[];\r\n buttons?: SideMenuButton[];\r\n note?: string;\r\n}\r\n\r\nexport interface SideMenuProps extends React.HTMLAttributes<HTMLDivElement> {\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n header?: SideMenuHeader;\r\n footer?: SideMenuFooter;\r\n onClose: () => void;\r\n children?: any;\r\n}\r\n"],"mappings":"","ignoreList":[]}
|
package/dist/SideMenu/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextButtonProps } from '../Button/TextButton';
|
|
2
2
|
import { IconButtonProps } from '../Button/Iconbutton';
|
|
3
3
|
import { MenuItemProps } from '../MenuItem/MenuItem';
|
|
4
4
|
import { Size } from '../types';
|
|
5
5
|
export type SideMenuAction = Omit<IconButtonProps, 'variant' | 'shape' | 'isInMobileMenu' | 'borderRadius' | 'flatEdge' | 'focusBackgroundColor' | 'useTransparentBackground' | 'unsetIconSize' | 'shouldNotInteract' | 'invertFocus' | 'hideOnLowWidth' | 'children'> & {
|
|
6
6
|
icon: React.ReactNode;
|
|
7
7
|
};
|
|
8
|
-
export type SideMenuButton = Omit<
|
|
8
|
+
export type SideMenuButton = Omit<TextButtonProps, 'size' | 'iconOnly' | 'minWidth' | 'testId' | 'width' | 'invertFocus' | 'colorTheme' | 'flatEdge' | 'children'> & {
|
|
9
9
|
label: string;
|
|
10
10
|
};
|
|
11
11
|
export type SideMenuItem = Omit<MenuItemProps, 'size'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/SideMenu/types.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/SideMenu/types.ts"],"sourcesContent":["import {TextButtonProps} from '../Button/TextButton';\r\nimport {IconButtonProps} from '../Button/Iconbutton';\r\nimport {MenuItemProps} from '../MenuItem/MenuItem';\r\nimport {Size} from '../types';\r\n\r\n\r\nexport type SideMenuAction = Omit<IconButtonProps, 'variant' |\r\n 'shape' |\r\n 'isInMobileMenu' |\r\n 'borderRadius' |\r\n 'flatEdge' |\r\n 'focusBackgroundColor' |\r\n 'useTransparentBackground' |\r\n 'unsetIconSize' |\r\n 'shouldNotInteract' |\r\n 'invertFocus' |\r\n 'hideOnLowWidth' | 'children'> & { icon: React.ReactNode };\r\n\r\nexport type SideMenuButton =\r\n Omit<TextButtonProps, 'size' | 'iconOnly' | 'minWidth' | 'testId' | 'width' | 'invertFocus' | 'colorTheme' | 'flatEdge' | 'children'>\r\n & { label: string };\r\n\r\nexport type SideMenuItem = Omit<MenuItemProps, 'size'>\r\n\r\nexport interface SideMenuHeader {\r\n actions?: SideMenuAction[];\r\n label?: string;\r\n}\r\n\r\nexport interface SideMenuFooter {\r\n items?: SideMenuItem[];\r\n buttons?: SideMenuButton[];\r\n note?: string;\r\n}\r\n\r\nexport interface SideMenuProps extends React.HTMLAttributes<HTMLDivElement> {\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n header?: SideMenuHeader;\r\n footer?: SideMenuFooter;\r\n onClose: () => void;\r\n children?: any;\r\n}\r\n"],"mappings":"","ignoreList":[]}
|
package/dist/Table/TableBody.cjs
CHANGED
|
@@ -84,7 +84,7 @@ const TableBody = props => {
|
|
|
84
84
|
size: _types.Size.Small,
|
|
85
85
|
tabIndex: props.showLoadingIndicator ? -1 : 0
|
|
86
86
|
}, column.additionalProps);
|
|
87
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.TextButton, _objectSpread(_objectSpread({
|
|
88
88
|
style: column.colorFn && {
|
|
89
89
|
color: column.colorFn(row, column.key)
|
|
90
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.cjs","names":["_Button","require","_types","React","_interopRequireWildcard","_InputFields","_Iconbutton","_interopRequireDefault","_HyperLink","_TableStyles","_common","_icons","_rooks","_styledComponents","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","ColumnLabel","styled","span","TableBody","props","scrollContainerRef","dimensions","node","useDimensionsRef","updateOnResize","scrollable","setScrollable","useState","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","variant","href","tabIndex","showLoadingIndicator","additionalProps","jsx","HyperLink","style","colorFn","color","key","onClick","preventDefault","stopPropagation","action","children","iconColor","shape","useTransparentBackground","icon","size","Size","Small","Button","Checkbox","selected","readOnly","customContent","jsxs","Fragment","StyledTableCellIcon","StyledTableCellTextWrapper","$textWrap","shortenText","StyledTableCellText","Boolean","noteKey","StyledTableCellNoteText","isSelected","multiSelect","indexOf","keyExpr","StyledTableBodyWrapper","ref","className","StyledTable","cellPadding","cellSpacing","layout","StyledTableHeaderRow","StyledTableHeaderColumns","StyledTableHeaderColumn","StyledTableHeaderColumnContent","selectAllState","disabled","semiSelected","select","onSelectAllClick","map","onMouseDown","defaultOnMouseDownHandler","sortable","sortByColumn","onKeyPress","sortProps","direction","undefined","width","justify","name","StyledTableHeaderColumnSortDirection","SystemIcons","ArrowLineUp","ArrowLineDown","StyledTableBody","currentPageRows","index","StyledTableBodyRow","selectable","onRowClick","StyledTableCell","StyledTableCellContent","maxWidth","title","$withNote","StyledTableNoRowsLabelRow","colSpan","noRowsLabel","propTypes","_propTypes","arrayOf","any","isRequired","func","oneOf","_default","exports"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import { TableColumn, TableProps } from './TableTypes';\r\nimport { Button } from '../Button';\r\nimport { Size } from '../types';\r\nimport * as React from 'react';\r\nimport { Checkbox } from '../InputFields';\r\nimport { ButtonProps } from '../Button/Button';\r\nimport IconButton, { IconButtonProps } from '../Button/Iconbutton';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { HyperLink } from '../HyperLink';\r\nimport {\r\n StyledTableBody,\r\n StyledTableBodyRow,\r\n StyledTableCell,\r\n StyledTableCellContent,\r\n StyledTableCellIcon,\r\n StyledTableCellText,\r\n StyledTableHeaderColumn,\r\n StyledTableHeaderColumnContent,\r\n StyledTableHeaderColumns,\r\n StyledTableNoRowsLabelRow,\r\n StyledTable,\r\n StyledTableBodyWrapper,\r\n StyledTableHeaderRow,\r\n StyledTableHeaderColumnSortDirection,\r\n StyledTableCellNoteText,\r\n StyledTableCellTextWrapper,\r\n} from './TableStyles';\r\nimport { defaultOnMouseDownHandler } from '../common';\r\nimport { SystemIcons } from '../icons';\r\nimport { useDimensionsRef } from 'rooks';\r\nimport styled from 'styled-components';\r\n\r\ninterface TableBodyProps extends TableProps {\r\n currentPageRows: any[];\r\n onRowClick?: (row: any) => void;\r\n selected?: any | any[];\r\n sortByColumn: (column: TableColumn) => void;\r\n onSelectAllClick: () => void;\r\n selectAllState: 'all' | 'some' | 'none';\r\n}\r\n\r\nconst ColumnLabel = styled.span`\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n`;\r\n\r\nconst TableBody: React.FC<TableBodyProps> = (props) => {\r\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({ updateOnResize: true });\r\n const [scrollable, setScrollable] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const clientWidth = node?.clientWidth ?? 0;\r\n const scrollWidth = node?.scrollWidth ?? 0;\r\n setScrollable(scrollWidth > clientWidth);\r\n }, [dimensions, node, props.columns, props.rows]);\r\n\r\n const renderCellBody = (column: TableColumn, row: any) => {\r\n switch (column.type) {\r\n case 'link': {\r\n const tmp = {\r\n variant: 'default',\r\n href: '#',\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n ...column.additionalProps,\r\n } as HyperlinkProps;\r\n return (\r\n <HyperLink\r\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\r\n {...tmp}\r\n onClick={(e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {row[column.key]}\r\n </HyperLink>\r\n );\r\n }\r\n case 'icon': {\r\n const tmp = {\r\n iconColor: column.colorFn && column.colorFn(row, column.key),\r\n variant: 'secondary',\r\n shape: 'circular',\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n useTransparentBackground: true,\r\n ...column.additionalProps,\r\n } as IconButtonProps;\r\n return (\r\n <IconButton\r\n {...tmp}\r\n action={(e) => {\r\n e?.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {column.icon}\r\n </IconButton>\r\n );\r\n }\r\n case 'button': {\r\n const tmp = {\r\n variant: 'tertiary',\r\n size: Size.Small,\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n ...column.additionalProps,\r\n } as ButtonProps;\r\n return (\r\n <Button\r\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\r\n {...tmp}\r\n onClick={(e) => {\r\n e?.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {row[column.key]}\r\n </Button>\r\n );\r\n }\r\n case 'boolean':\r\n return <Checkbox selected={!!row[column.key]} readOnly={true} />;\r\n case 'custom':\r\n return column.customContent && column.customContent(row, column.key);\r\n case 'number':\r\n case 'text':\r\n default:\r\n return (\r\n <>\r\n {column.icon && <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>}\r\n <StyledTableCellTextWrapper $textWrap={!column.shortenText}>\r\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\r\n {Boolean(column.noteKey) && Boolean(row[column.noteKey!]) && (\r\n <>\r\n <StyledTableCellNoteText>{row[column.noteKey!]}</StyledTableCellNoteText>\r\n </>\r\n )}\r\n </StyledTableCellTextWrapper>\r\n </>\r\n );\r\n }\r\n };\r\n\r\n const isSelected = (row: any) => {\r\n return (\r\n (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\r\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row))\r\n );\r\n };\r\n\r\n return (\r\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\r\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\r\n <StyledTableHeaderRow>\r\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\r\n {props.multiSelect && (\r\n <StyledTableHeaderColumn>\r\n <StyledTableHeaderColumnContent>\r\n <Checkbox\r\n selected={props.selectAllState === 'all'}\r\n disabled={props.showLoadingIndicator}\r\n semiSelected={props.selectAllState === 'some'}\r\n select={props.onSelectAllClick}\r\n />\r\n </StyledTableHeaderColumnContent>\r\n </StyledTableHeaderColumn>\r\n )}\r\n {props.columns.map((column: TableColumn) => (\r\n <StyledTableHeaderColumn\r\n key={column.key}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onClick={(e) => column.sortable && props.sortByColumn(column)}\r\n onKeyPress={(e) => {\r\n if (e.key === 'Enter' || e.key === ' ') {\r\n column.sortable && props.sortByColumn(column);\r\n }\r\n }}\r\n aria-selected={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\r\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending') : undefined}\r\n style={{ width: column.width }}\r\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\r\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${\r\n column.justify || ''\r\n }`}>\r\n <StyledTableHeaderColumnContent>\r\n <ColumnLabel>{column.name}</ColumnLabel>\r\n {column.key === props.sortProps?.column && (\r\n <StyledTableHeaderColumnSortDirection>\r\n {props.sortProps?.direction === 'asc' ? <SystemIcons.ArrowLineUp size={'20px'} /> : <SystemIcons.ArrowLineDown size={'20px'} />}\r\n </StyledTableHeaderColumnSortDirection>\r\n )}\r\n </StyledTableHeaderColumnContent>\r\n </StyledTableHeaderColumn>\r\n ))}\r\n </StyledTableHeaderColumns>\r\n </StyledTableHeaderRow>\r\n <StyledTableBody>\r\n {props.currentPageRows.length > 0 ? (\r\n props.currentPageRows.map((row: any, index: number) => (\r\n <StyledTableBodyRow\r\n key={`row_${index}`}\r\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\r\n onClick={() => props.onRowClick && props.onRowClick(row)}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onKeyPress={(e) => {\r\n if (e.key === 'Enter') {\r\n props.onRowClick && props.onRowClick(row);\r\n }\r\n }}\r\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\r\n data-testid=\"TestTableDataRow\">\r\n {props.multiSelect && (\r\n <StyledTableCell>\r\n <StyledTableCellContent>\r\n <Checkbox selected={isSelected(row)} />\r\n </StyledTableCellContent>\r\n </StyledTableCell>\r\n )}\r\n {props.columns.map((column: TableColumn) => (\r\n <StyledTableCell key={`row_${index}_${column.key}`} style={{ maxWidth: column.width }} title={column.shortenText ? `${row[column.key]} \\n ${column.noteKey ? row[column.noteKey!] : ''}` : ''}>\r\n <StyledTableCellContent\r\n $withNote={Boolean(column.noteKey)}\r\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\r\n style={{\r\n color: column.colorFn && column.colorFn(row, column.key),\r\n }}>\r\n {renderCellBody(column, row)}\r\n </StyledTableCellContent>\r\n </StyledTableCell>\r\n ))}\r\n </StyledTableBodyRow>\r\n ))\r\n ) : (\r\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\r\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\r\n <StyledTableCellContent className={'center'}>{props.noRowsLabel ?? 'There are no rows to display'}</StyledTableCellContent>\r\n </StyledTableCell>\r\n </StyledTableNoRowsLabelRow>\r\n )}\r\n </StyledTableBody>\r\n </StyledTable>\r\n </StyledTableBodyWrapper>\r\n );\r\n};\r\nexport default TableBody;\r\n"],"mappings":";;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAC,sBAAA,CAAAN,OAAA;AAEA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAkBA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAN,sBAAA,CAAAN,OAAA;AAAuC,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAc,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA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A;EACVpE,QAAQ,EAAAgE,UAAA,CAAA7I,OAAA,CAAA+I,GAAA;EACR7B,YAAY,EAAA2B,UAAA,CAAA7I,OAAA,CAAAiJ,IAAA,CAAAD,UAAA;EACZnC,gBAAgB,EAAAgC,UAAA,CAAA7I,OAAA,CAAAiJ,IAAA,CAAAD,UAAA;EAChBvC,cAAc,EAAAoC,UAAA,CAAA7I,OAAA,CAAAkJ,KAAA,EAAE,KAAK,EAAG,MAAM,EAAG,MAAM,GAAAF;AAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAApJ,OAAA,GA4M1BgC,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"TableBody.cjs","names":["_Button","require","_types","React","_interopRequireWildcard","_InputFields","_Iconbutton","_interopRequireDefault","_HyperLink","_TableStyles","_common","_icons","_rooks","_styledComponents","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","ColumnLabel","styled","span","TableBody","props","scrollContainerRef","dimensions","node","useDimensionsRef","updateOnResize","scrollable","setScrollable","useState","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","variant","href","tabIndex","showLoadingIndicator","additionalProps","jsx","HyperLink","style","colorFn","color","key","onClick","preventDefault","stopPropagation","action","children","iconColor","shape","useTransparentBackground","icon","size","Size","Small","TextButton","Checkbox","selected","readOnly","customContent","jsxs","Fragment","StyledTableCellIcon","StyledTableCellTextWrapper","$textWrap","shortenText","StyledTableCellText","Boolean","noteKey","StyledTableCellNoteText","isSelected","multiSelect","indexOf","keyExpr","StyledTableBodyWrapper","ref","className","StyledTable","cellPadding","cellSpacing","layout","StyledTableHeaderRow","StyledTableHeaderColumns","StyledTableHeaderColumn","StyledTableHeaderColumnContent","selectAllState","disabled","semiSelected","select","onSelectAllClick","map","onMouseDown","defaultOnMouseDownHandler","sortable","sortByColumn","onKeyPress","sortProps","direction","undefined","width","justify","name","StyledTableHeaderColumnSortDirection","SystemIcons","ArrowLineUp","ArrowLineDown","StyledTableBody","currentPageRows","index","StyledTableBodyRow","selectable","onRowClick","StyledTableCell","StyledTableCellContent","maxWidth","title","$withNote","StyledTableNoRowsLabelRow","colSpan","noRowsLabel","propTypes","_propTypes","arrayOf","any","isRequired","func","oneOf","_default","exports"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import { TableColumn, TableProps } from './TableTypes';\r\nimport { TextButton } from '../Button';\r\nimport { Size } from '../types';\r\nimport * as React from 'react';\r\nimport { Checkbox } from '../InputFields';\r\nimport { TextButtonProps } from '../Button/TextButton';\r\nimport IconButton, { IconButtonProps } from '../Button/Iconbutton';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { HyperLink } from '../HyperLink';\r\nimport {\r\n StyledTableBody,\r\n StyledTableBodyRow,\r\n StyledTableCell,\r\n StyledTableCellContent,\r\n StyledTableCellIcon,\r\n StyledTableCellText,\r\n StyledTableHeaderColumn,\r\n StyledTableHeaderColumnContent,\r\n StyledTableHeaderColumns,\r\n StyledTableNoRowsLabelRow,\r\n StyledTable,\r\n StyledTableBodyWrapper,\r\n StyledTableHeaderRow,\r\n StyledTableHeaderColumnSortDirection,\r\n StyledTableCellNoteText,\r\n StyledTableCellTextWrapper,\r\n} from './TableStyles';\r\nimport { defaultOnMouseDownHandler } from '../common';\r\nimport { SystemIcons } from '../icons';\r\nimport { useDimensionsRef } from 'rooks';\r\nimport styled from 'styled-components';\r\n\r\ninterface TableBodyProps extends TableProps {\r\n currentPageRows: any[];\r\n onRowClick?: (row: any) => void;\r\n selected?: any | any[];\r\n sortByColumn: (column: TableColumn) => void;\r\n onSelectAllClick: () => void;\r\n selectAllState: 'all' | 'some' | 'none';\r\n}\r\n\r\nconst ColumnLabel = styled.span`\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n`;\r\n\r\nconst TableBody: React.FC<TableBodyProps> = (props) => {\r\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({ updateOnResize: true });\r\n const [scrollable, setScrollable] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const clientWidth = node?.clientWidth ?? 0;\r\n const scrollWidth = node?.scrollWidth ?? 0;\r\n setScrollable(scrollWidth > clientWidth);\r\n }, [dimensions, node, props.columns, props.rows]);\r\n\r\n const renderCellBody = (column: TableColumn, row: any) => {\r\n switch (column.type) {\r\n case 'link': {\r\n const tmp = {\r\n variant: 'default',\r\n href: '#',\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n ...column.additionalProps,\r\n } as HyperlinkProps;\r\n return (\r\n <HyperLink\r\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\r\n {...tmp}\r\n onClick={(e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {row[column.key]}\r\n </HyperLink>\r\n );\r\n }\r\n case 'icon': {\r\n const tmp = {\r\n iconColor: column.colorFn && column.colorFn(row, column.key),\r\n variant: 'secondary',\r\n shape: 'circular',\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n useTransparentBackground: true,\r\n ...column.additionalProps,\r\n } as IconButtonProps;\r\n return (\r\n <IconButton\r\n {...tmp}\r\n action={(e) => {\r\n e?.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {column.icon}\r\n </IconButton>\r\n );\r\n }\r\n case 'button': {\r\n const tmp = {\r\n variant: 'tertiary',\r\n size: Size.Small,\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n ...column.additionalProps,\r\n } as TextButtonProps;\r\n return (\r\n <TextButton\r\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\r\n {...tmp}\r\n onClick={(e) => {\r\n e?.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {row[column.key]}\r\n </TextButton>\r\n );\r\n }\r\n case 'boolean':\r\n return <Checkbox selected={!!row[column.key]} readOnly={true} />;\r\n case 'custom':\r\n return column.customContent && column.customContent(row, column.key);\r\n case 'number':\r\n case 'text':\r\n default:\r\n return (\r\n <>\r\n {column.icon && <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>}\r\n <StyledTableCellTextWrapper $textWrap={!column.shortenText}>\r\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\r\n {Boolean(column.noteKey) && Boolean(row[column.noteKey!]) && (\r\n <>\r\n <StyledTableCellNoteText>{row[column.noteKey!]}</StyledTableCellNoteText>\r\n </>\r\n )}\r\n </StyledTableCellTextWrapper>\r\n </>\r\n );\r\n }\r\n };\r\n\r\n const isSelected = (row: any) => {\r\n return (\r\n (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\r\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row))\r\n );\r\n };\r\n\r\n return (\r\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\r\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\r\n <StyledTableHeaderRow>\r\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\r\n {props.multiSelect && (\r\n <StyledTableHeaderColumn>\r\n <StyledTableHeaderColumnContent>\r\n <Checkbox\r\n selected={props.selectAllState === 'all'}\r\n disabled={props.showLoadingIndicator}\r\n semiSelected={props.selectAllState === 'some'}\r\n select={props.onSelectAllClick}\r\n />\r\n </StyledTableHeaderColumnContent>\r\n </StyledTableHeaderColumn>\r\n )}\r\n {props.columns.map((column: TableColumn) => (\r\n <StyledTableHeaderColumn\r\n key={column.key}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onClick={(e) => column.sortable && props.sortByColumn(column)}\r\n onKeyPress={(e) => {\r\n if (e.key === 'Enter' || e.key === ' ') {\r\n column.sortable && props.sortByColumn(column);\r\n }\r\n }}\r\n aria-selected={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\r\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending') : undefined}\r\n style={{ width: column.width }}\r\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\r\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${\r\n column.justify || ''\r\n }`}>\r\n <StyledTableHeaderColumnContent>\r\n <ColumnLabel>{column.name}</ColumnLabel>\r\n {column.key === props.sortProps?.column && (\r\n <StyledTableHeaderColumnSortDirection>\r\n {props.sortProps?.direction === 'asc' ? <SystemIcons.ArrowLineUp size={'20px'} /> : <SystemIcons.ArrowLineDown size={'20px'} />}\r\n </StyledTableHeaderColumnSortDirection>\r\n )}\r\n </StyledTableHeaderColumnContent>\r\n </StyledTableHeaderColumn>\r\n ))}\r\n </StyledTableHeaderColumns>\r\n </StyledTableHeaderRow>\r\n <StyledTableBody>\r\n {props.currentPageRows.length > 0 ? (\r\n props.currentPageRows.map((row: any, index: number) => (\r\n <StyledTableBodyRow\r\n key={`row_${index}`}\r\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\r\n onClick={() => props.onRowClick && props.onRowClick(row)}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onKeyPress={(e) => {\r\n if (e.key === 'Enter') {\r\n props.onRowClick && props.onRowClick(row);\r\n }\r\n }}\r\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\r\n data-testid=\"TestTableDataRow\">\r\n {props.multiSelect && (\r\n <StyledTableCell>\r\n <StyledTableCellContent>\r\n <Checkbox selected={isSelected(row)} />\r\n </StyledTableCellContent>\r\n </StyledTableCell>\r\n )}\r\n {props.columns.map((column: TableColumn) => (\r\n <StyledTableCell key={`row_${index}_${column.key}`} style={{ maxWidth: column.width }} title={column.shortenText ? `${row[column.key]} \\n ${column.noteKey ? row[column.noteKey!] : ''}` : ''}>\r\n <StyledTableCellContent\r\n $withNote={Boolean(column.noteKey)}\r\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\r\n style={{\r\n color: column.colorFn && column.colorFn(row, column.key),\r\n }}>\r\n {renderCellBody(column, row)}\r\n </StyledTableCellContent>\r\n </StyledTableCell>\r\n ))}\r\n </StyledTableBodyRow>\r\n ))\r\n ) : (\r\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\r\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\r\n <StyledTableCellContent className={'center'}>{props.noRowsLabel ?? 'There are no rows to display'}</StyledTableCellContent>\r\n </StyledTableCell>\r\n </StyledTableNoRowsLabelRow>\r\n )}\r\n </StyledTableBody>\r\n </StyledTable>\r\n </StyledTableBodyWrapper>\r\n );\r\n};\r\nexport default TableBody;\r\n"],"mappings":";;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAC,sBAAA,CAAAN,OAAA;AAEA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AAkBA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAN,sBAAA,CAAAN,OAAA;AAAuC,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAc,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAA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I,OAAA,CAAAD,UAAA,CAAA7I,OAAA,CAAA+I,GAAA,EAAAC,UAAA;EACfb,UAAU,EAAAU,UAAA,CAAA7I,OAAA,CAAAiJ,IAAA;EACVpE,QAAQ,EAAAgE,UAAA,CAAA7I,OAAA,CAAA+I,GAAA;EACR7B,YAAY,EAAA2B,UAAA,CAAA7I,OAAA,CAAAiJ,IAAA,CAAAD,UAAA;EACZnC,gBAAgB,EAAAgC,UAAA,CAAA7I,OAAA,CAAAiJ,IAAA,CAAAD,UAAA;EAChBvC,cAAc,EAAAoC,UAAA,CAAA7I,OAAA,CAAAkJ,KAAA,EAAE,KAAK,EAAG,MAAM,EAAG,MAAM,GAAAF;AAAA;AAAA,IAAAG,QAAA,GAAAC,OAAA,CAAApJ,OAAA,GA4M1BgC,SAAS","ignoreList":[]}
|
package/dist/Table/TableBody.js
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
2
2
|
import _pt from "prop-types";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import {
|
|
5
|
+
import { TextButton } from '../Button';
|
|
6
6
|
import { Size } from '../types';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { Checkbox } from '../InputFields';
|
|
@@ -75,7 +75,7 @@ const TableBody = props => {
|
|
|
75
75
|
size: Size.Small,
|
|
76
76
|
tabIndex: props.showLoadingIndicator ? -1 : 0
|
|
77
77
|
}, column.additionalProps);
|
|
78
|
-
return /*#__PURE__*/_jsx(
|
|
78
|
+
return /*#__PURE__*/_jsx(TextButton, _objectSpread(_objectSpread({
|
|
79
79
|
style: column.colorFn && {
|
|
80
80
|
color: column.colorFn(row, column.key)
|
|
81
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.js","names":["Button","Size","React","Checkbox","IconButton","HyperLink","StyledTableBody","StyledTableBodyRow","StyledTableCell","StyledTableCellContent","StyledTableCellIcon","StyledTableCellText","StyledTableHeaderColumn","StyledTableHeaderColumnContent","StyledTableHeaderColumns","StyledTableNoRowsLabelRow","StyledTable","StyledTableBodyWrapper","StyledTableHeaderRow","StyledTableHeaderColumnSortDirection","StyledTableCellNoteText","StyledTableCellTextWrapper","defaultOnMouseDownHandler","SystemIcons","useDimensionsRef","styled","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ColumnLabel","span","TableBody","props","scrollContainerRef","dimensions","node","updateOnResize","scrollable","setScrollable","useState","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","_objectSpread","variant","href","tabIndex","showLoadingIndicator","additionalProps","style","colorFn","color","key","onClick","e","preventDefault","stopPropagation","action","children","iconColor","shape","useTransparentBackground","icon","size","Small","selected","readOnly","customContent","$textWrap","shortenText","Boolean","noteKey","isSelected","multiSelect","indexOf","keyExpr","ref","className","cellPadding","cellSpacing","layout","selectAllState","disabled","semiSelected","select","onSelectAllClick","map","onMouseDown","sortable","sortByColumn","onKeyPress","sortProps","direction","undefined","width","justify","name","ArrowLineUp","ArrowLineDown","currentPageRows","length","index","selectable","onRowClick","maxWidth","title","$withNote","colSpan","noRowsLabel","propTypes","_pt","arrayOf","any","isRequired","func","oneOf"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import { TableColumn, TableProps } from './TableTypes';\r\nimport { Button } from '../Button';\r\nimport { Size } from '../types';\r\nimport * as React from 'react';\r\nimport { Checkbox } from '../InputFields';\r\nimport { ButtonProps } from '../Button/Button';\r\nimport IconButton, { IconButtonProps } from '../Button/Iconbutton';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { HyperLink } from '../HyperLink';\r\nimport {\r\n StyledTableBody,\r\n StyledTableBodyRow,\r\n StyledTableCell,\r\n StyledTableCellContent,\r\n StyledTableCellIcon,\r\n StyledTableCellText,\r\n StyledTableHeaderColumn,\r\n StyledTableHeaderColumnContent,\r\n StyledTableHeaderColumns,\r\n StyledTableNoRowsLabelRow,\r\n StyledTable,\r\n StyledTableBodyWrapper,\r\n StyledTableHeaderRow,\r\n StyledTableHeaderColumnSortDirection,\r\n StyledTableCellNoteText,\r\n StyledTableCellTextWrapper,\r\n} from './TableStyles';\r\nimport { defaultOnMouseDownHandler } from '../common';\r\nimport { SystemIcons } from '../icons';\r\nimport { useDimensionsRef } from 'rooks';\r\nimport styled from 'styled-components';\r\n\r\ninterface TableBodyProps extends TableProps {\r\n currentPageRows: any[];\r\n onRowClick?: (row: any) => void;\r\n selected?: any | any[];\r\n sortByColumn: (column: TableColumn) => void;\r\n onSelectAllClick: () => void;\r\n selectAllState: 'all' | 'some' | 'none';\r\n}\r\n\r\nconst ColumnLabel = styled.span`\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n`;\r\n\r\nconst TableBody: React.FC<TableBodyProps> = (props) => {\r\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({ updateOnResize: true });\r\n const [scrollable, setScrollable] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const clientWidth = node?.clientWidth ?? 0;\r\n const scrollWidth = node?.scrollWidth ?? 0;\r\n setScrollable(scrollWidth > clientWidth);\r\n }, [dimensions, node, props.columns, props.rows]);\r\n\r\n const renderCellBody = (column: TableColumn, row: any) => {\r\n switch (column.type) {\r\n case 'link': {\r\n const tmp = {\r\n variant: 'default',\r\n href: '#',\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n ...column.additionalProps,\r\n } as HyperlinkProps;\r\n return (\r\n <HyperLink\r\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\r\n {...tmp}\r\n onClick={(e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {row[column.key]}\r\n </HyperLink>\r\n );\r\n }\r\n case 'icon': {\r\n const tmp = {\r\n iconColor: column.colorFn && column.colorFn(row, column.key),\r\n variant: 'secondary',\r\n shape: 'circular',\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n useTransparentBackground: true,\r\n ...column.additionalProps,\r\n } as IconButtonProps;\r\n return (\r\n <IconButton\r\n {...tmp}\r\n action={(e) => {\r\n e?.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {column.icon}\r\n </IconButton>\r\n );\r\n }\r\n case 'button': {\r\n const tmp = {\r\n variant: 'tertiary',\r\n size: Size.Small,\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n ...column.additionalProps,\r\n } as ButtonProps;\r\n return (\r\n <Button\r\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\r\n {...tmp}\r\n onClick={(e) => {\r\n e?.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {row[column.key]}\r\n </Button>\r\n );\r\n }\r\n case 'boolean':\r\n return <Checkbox selected={!!row[column.key]} readOnly={true} />;\r\n case 'custom':\r\n return column.customContent && column.customContent(row, column.key);\r\n case 'number':\r\n case 'text':\r\n default:\r\n return (\r\n <>\r\n {column.icon && <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>}\r\n <StyledTableCellTextWrapper $textWrap={!column.shortenText}>\r\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\r\n {Boolean(column.noteKey) && Boolean(row[column.noteKey!]) && (\r\n <>\r\n <StyledTableCellNoteText>{row[column.noteKey!]}</StyledTableCellNoteText>\r\n </>\r\n )}\r\n </StyledTableCellTextWrapper>\r\n </>\r\n );\r\n }\r\n };\r\n\r\n const isSelected = (row: any) => {\r\n return (\r\n (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\r\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row))\r\n );\r\n };\r\n\r\n return (\r\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\r\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\r\n <StyledTableHeaderRow>\r\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\r\n {props.multiSelect && (\r\n <StyledTableHeaderColumn>\r\n <StyledTableHeaderColumnContent>\r\n <Checkbox\r\n selected={props.selectAllState === 'all'}\r\n disabled={props.showLoadingIndicator}\r\n semiSelected={props.selectAllState === 'some'}\r\n select={props.onSelectAllClick}\r\n />\r\n </StyledTableHeaderColumnContent>\r\n </StyledTableHeaderColumn>\r\n )}\r\n {props.columns.map((column: TableColumn) => (\r\n <StyledTableHeaderColumn\r\n key={column.key}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onClick={(e) => column.sortable && props.sortByColumn(column)}\r\n onKeyPress={(e) => {\r\n if (e.key === 'Enter' || e.key === ' ') {\r\n column.sortable && props.sortByColumn(column);\r\n }\r\n }}\r\n aria-selected={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\r\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending') : undefined}\r\n style={{ width: column.width }}\r\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\r\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${\r\n column.justify || ''\r\n }`}>\r\n <StyledTableHeaderColumnContent>\r\n <ColumnLabel>{column.name}</ColumnLabel>\r\n {column.key === props.sortProps?.column && (\r\n <StyledTableHeaderColumnSortDirection>\r\n {props.sortProps?.direction === 'asc' ? <SystemIcons.ArrowLineUp size={'20px'} /> : <SystemIcons.ArrowLineDown size={'20px'} />}\r\n </StyledTableHeaderColumnSortDirection>\r\n )}\r\n </StyledTableHeaderColumnContent>\r\n </StyledTableHeaderColumn>\r\n ))}\r\n </StyledTableHeaderColumns>\r\n </StyledTableHeaderRow>\r\n <StyledTableBody>\r\n {props.currentPageRows.length > 0 ? (\r\n props.currentPageRows.map((row: any, index: number) => (\r\n <StyledTableBodyRow\r\n key={`row_${index}`}\r\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\r\n onClick={() => props.onRowClick && props.onRowClick(row)}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onKeyPress={(e) => {\r\n if (e.key === 'Enter') {\r\n props.onRowClick && props.onRowClick(row);\r\n }\r\n }}\r\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\r\n data-testid=\"TestTableDataRow\">\r\n {props.multiSelect && (\r\n <StyledTableCell>\r\n <StyledTableCellContent>\r\n <Checkbox selected={isSelected(row)} />\r\n </StyledTableCellContent>\r\n </StyledTableCell>\r\n )}\r\n {props.columns.map((column: TableColumn) => (\r\n <StyledTableCell key={`row_${index}_${column.key}`} style={{ maxWidth: column.width }} title={column.shortenText ? `${row[column.key]} \\n ${column.noteKey ? row[column.noteKey!] : ''}` : ''}>\r\n <StyledTableCellContent\r\n $withNote={Boolean(column.noteKey)}\r\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\r\n style={{\r\n color: column.colorFn && column.colorFn(row, column.key),\r\n }}>\r\n {renderCellBody(column, row)}\r\n </StyledTableCellContent>\r\n </StyledTableCell>\r\n ))}\r\n </StyledTableBodyRow>\r\n ))\r\n ) : (\r\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\r\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\r\n <StyledTableCellContent className={'center'}>{props.noRowsLabel ?? 'There are no rows to display'}</StyledTableCellContent>\r\n </StyledTableCell>\r\n </StyledTableNoRowsLabelRow>\r\n )}\r\n </StyledTableBody>\r\n </StyledTable>\r\n </StyledTableBodyWrapper>\r\n );\r\n};\r\nexport default TableBody;\r\n"],"mappings":";;;;AACA,SAASA,MAAM,QAAQ,WAAW;AAClC,SAASC,IAAI,QAAQ,UAAU;AAC/B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,OAAOC,UAAU,MAA2B,sBAAsB;AAElE,SAASC,SAAS,QAAQ,cAAc;AACxC,SACEC,eAAe,EACfC,kBAAkB,EAClBC,eAAe,EACfC,sBAAsB,EACtBC,mBAAmB,EACnBC,mBAAmB,EACnBC,uBAAuB,EACvBC,8BAA8B,EAC9BC,wBAAwB,EACxBC,yBAAyB,EACzBC,WAAW,EACXC,sBAAsB,EACtBC,oBAAoB,EACpBC,oCAAoC,EACpCC,uBAAuB,EACvBC,0BAA0B,QACrB,eAAe;AACtB,SAASC,yBAAyB,QAAQ,WAAW;AACrD,SAASC,WAAW,QAAQ,UAAU;AACtC,SAASC,gBAAgB,QAAQ,OAAO;AACxC,OAAOC,MAAM,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAWvC,MAAMC,WAAW,GAAGP,MAAM,CAACQ,IAAI;AAC/B;AACA;AACA;AACA,CAAC;AAED,MAAMC,SAAmC,GAAIC,KAAK,IAAK;EACrD,MAAM,CAACC,kBAAkB,EAAEC,UAAU,EAAEC,IAAI,CAAC,GAAGd,gBAAgB,CAAC;IAAEe,cAAc,EAAE;EAAK,CAAC,CAAC;EACzF,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGvC,KAAK,CAACwC,QAAQ,CAAC,KAAK,CAAC;EAEzDxC,KAAK,CA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EAAEjC,KAAK,CAACmF,WAAW,IAAI;YAA8B,CAAyB;UAAC,CAC5G;QAAC,CACO;MAC5B,CACc,CAAC;IAAA,CACP;EAAC,CACQ,CAAC;AAE7B,CAAC;AAACpF,SAAA,CAAAqF,SAAA;EAhNAV,eAAe,EAAAW,GAAA,CAAAC,OAAA,CAAAD,GAAA,CAAAE,GAAA,EAAAC,UAAA;EACfV,UAAU,EAAAO,GAAA,CAAAI,IAAA;EACVjD,QAAQ,EAAA6C,GAAA,CAAAE,GAAA;EACRvB,YAAY,EAAAqB,GAAA,CAAAI,IAAA,CAAAD,UAAA;EACZ5B,gBAAgB,EAAAyB,GAAA,CAAAI,IAAA,CAAAD,UAAA;EAChBhC,cAAc,EAAA6B,GAAA,CAAAK,KAAA,EAAE,KAAK,EAAG,MAAM,EAAG,MAAM,GAAAF;AAAA;AA4MzC,eAAezF,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"TableBody.js","names":["TextButton","Size","React","Checkbox","IconButton","HyperLink","StyledTableBody","StyledTableBodyRow","StyledTableCell","StyledTableCellContent","StyledTableCellIcon","StyledTableCellText","StyledTableHeaderColumn","StyledTableHeaderColumnContent","StyledTableHeaderColumns","StyledTableNoRowsLabelRow","StyledTable","StyledTableBodyWrapper","StyledTableHeaderRow","StyledTableHeaderColumnSortDirection","StyledTableCellNoteText","StyledTableCellTextWrapper","defaultOnMouseDownHandler","SystemIcons","useDimensionsRef","styled","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ColumnLabel","span","TableBody","props","scrollContainerRef","dimensions","node","updateOnResize","scrollable","setScrollable","useState","useEffect","clientWidth","scrollWidth","columns","rows","renderCellBody","column","row","type","tmp","_objectSpread","variant","href","tabIndex","showLoadingIndicator","additionalProps","style","colorFn","color","key","onClick","e","preventDefault","stopPropagation","action","children","iconColor","shape","useTransparentBackground","icon","size","Small","selected","readOnly","customContent","$textWrap","shortenText","Boolean","noteKey","isSelected","multiSelect","indexOf","keyExpr","ref","className","cellPadding","cellSpacing","layout","selectAllState","disabled","semiSelected","select","onSelectAllClick","map","onMouseDown","sortable","sortByColumn","onKeyPress","sortProps","direction","undefined","width","justify","name","ArrowLineUp","ArrowLineDown","currentPageRows","length","index","selectable","onRowClick","maxWidth","title","$withNote","colSpan","noRowsLabel","propTypes","_pt","arrayOf","any","isRequired","func","oneOf"],"sources":["../../src/Table/TableBody.tsx"],"sourcesContent":["import { TableColumn, TableProps } from './TableTypes';\r\nimport { TextButton } from '../Button';\r\nimport { Size } from '../types';\r\nimport * as React from 'react';\r\nimport { Checkbox } from '../InputFields';\r\nimport { TextButtonProps } from '../Button/TextButton';\r\nimport IconButton, { IconButtonProps } from '../Button/Iconbutton';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { HyperLink } from '../HyperLink';\r\nimport {\r\n StyledTableBody,\r\n StyledTableBodyRow,\r\n StyledTableCell,\r\n StyledTableCellContent,\r\n StyledTableCellIcon,\r\n StyledTableCellText,\r\n StyledTableHeaderColumn,\r\n StyledTableHeaderColumnContent,\r\n StyledTableHeaderColumns,\r\n StyledTableNoRowsLabelRow,\r\n StyledTable,\r\n StyledTableBodyWrapper,\r\n StyledTableHeaderRow,\r\n StyledTableHeaderColumnSortDirection,\r\n StyledTableCellNoteText,\r\n StyledTableCellTextWrapper,\r\n} from './TableStyles';\r\nimport { defaultOnMouseDownHandler } from '../common';\r\nimport { SystemIcons } from '../icons';\r\nimport { useDimensionsRef } from 'rooks';\r\nimport styled from 'styled-components';\r\n\r\ninterface TableBodyProps extends TableProps {\r\n currentPageRows: any[];\r\n onRowClick?: (row: any) => void;\r\n selected?: any | any[];\r\n sortByColumn: (column: TableColumn) => void;\r\n onSelectAllClick: () => void;\r\n selectAllState: 'all' | 'some' | 'none';\r\n}\r\n\r\nconst ColumnLabel = styled.span`\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n`;\r\n\r\nconst TableBody: React.FC<TableBodyProps> = (props) => {\r\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({ updateOnResize: true });\r\n const [scrollable, setScrollable] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const clientWidth = node?.clientWidth ?? 0;\r\n const scrollWidth = node?.scrollWidth ?? 0;\r\n setScrollable(scrollWidth > clientWidth);\r\n }, [dimensions, node, props.columns, props.rows]);\r\n\r\n const renderCellBody = (column: TableColumn, row: any) => {\r\n switch (column.type) {\r\n case 'link': {\r\n const tmp = {\r\n variant: 'default',\r\n href: '#',\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n ...column.additionalProps,\r\n } as HyperlinkProps;\r\n return (\r\n <HyperLink\r\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\r\n {...tmp}\r\n onClick={(e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {row[column.key]}\r\n </HyperLink>\r\n );\r\n }\r\n case 'icon': {\r\n const tmp = {\r\n iconColor: column.colorFn && column.colorFn(row, column.key),\r\n variant: 'secondary',\r\n shape: 'circular',\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n useTransparentBackground: true,\r\n ...column.additionalProps,\r\n } as IconButtonProps;\r\n return (\r\n <IconButton\r\n {...tmp}\r\n action={(e) => {\r\n e?.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {column.icon}\r\n </IconButton>\r\n );\r\n }\r\n case 'button': {\r\n const tmp = {\r\n variant: 'tertiary',\r\n size: Size.Small,\r\n tabIndex: props.showLoadingIndicator ? -1 : 0,\r\n ...column.additionalProps,\r\n } as TextButtonProps;\r\n return (\r\n <TextButton\r\n style={column.colorFn && { color: column.colorFn(row, column.key) }}\r\n {...tmp}\r\n onClick={(e) => {\r\n e?.stopPropagation();\r\n column.action && column.action(row, e);\r\n }}>\r\n {row[column.key]}\r\n </TextButton>\r\n );\r\n }\r\n case 'boolean':\r\n return <Checkbox selected={!!row[column.key]} readOnly={true} />;\r\n case 'custom':\r\n return column.customContent && column.customContent(row, column.key);\r\n case 'number':\r\n case 'text':\r\n default:\r\n return (\r\n <>\r\n {column.icon && <StyledTableCellIcon>{column.icon}</StyledTableCellIcon>}\r\n <StyledTableCellTextWrapper $textWrap={!column.shortenText}>\r\n <StyledTableCellText>{row[column.key]}</StyledTableCellText>\r\n {Boolean(column.noteKey) && Boolean(row[column.noteKey!]) && (\r\n <>\r\n <StyledTableCellNoteText>{row[column.noteKey!]}</StyledTableCellNoteText>\r\n </>\r\n )}\r\n </StyledTableCellTextWrapper>\r\n </>\r\n );\r\n }\r\n };\r\n\r\n const isSelected = (row: any) => {\r\n return (\r\n (props.multiSelect && props.selected?.indexOf(props.keyExpr ? row[props.keyExpr] : row) > -1) ||\r\n (!props.multiSelect && props.selected === (props.keyExpr ? row[props.keyExpr] : row))\r\n );\r\n };\r\n\r\n return (\r\n <StyledTableBodyWrapper ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\r\n <StyledTable cellPadding=\"0\" cellSpacing=\"0\" data-testid=\"TestTable\" className={`table ${props.layout || ''}`}>\r\n <StyledTableHeaderRow>\r\n <StyledTableHeaderColumns data-testid=\"TestTableColumnHeaderRow\">\r\n {props.multiSelect && (\r\n <StyledTableHeaderColumn>\r\n <StyledTableHeaderColumnContent>\r\n <Checkbox\r\n selected={props.selectAllState === 'all'}\r\n disabled={props.showLoadingIndicator}\r\n semiSelected={props.selectAllState === 'some'}\r\n select={props.onSelectAllClick}\r\n />\r\n </StyledTableHeaderColumnContent>\r\n </StyledTableHeaderColumn>\r\n )}\r\n {props.columns.map((column: TableColumn) => (\r\n <StyledTableHeaderColumn\r\n key={column.key}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onClick={(e) => column.sortable && props.sortByColumn(column)}\r\n onKeyPress={(e) => {\r\n if (e.key === 'Enter' || e.key === ' ') {\r\n column.sortable && props.sortByColumn(column);\r\n }\r\n }}\r\n aria-selected={column.key === props.sortProps?.column && !!props.sortProps?.direction ? true : undefined}\r\n aria-sort={column.key === props.sortProps?.column && !!props.sortProps?.direction ? (props.sortProps?.direction == 'asc' ? 'ascending' : 'descending') : undefined}\r\n style={{ width: column.width }}\r\n tabIndex={column.sortable && !props.showLoadingIndicator ? 0 : -1}\r\n className={`${!!column.sortable ? 'sortable' : ''} ${column.key === props.sortProps?.column && !!props.sortProps?.direction ? 'sorted' : ''} ${\r\n column.justify || ''\r\n }`}>\r\n <StyledTableHeaderColumnContent>\r\n <ColumnLabel>{column.name}</ColumnLabel>\r\n {column.key === props.sortProps?.column && (\r\n <StyledTableHeaderColumnSortDirection>\r\n {props.sortProps?.direction === 'asc' ? <SystemIcons.ArrowLineUp size={'20px'} /> : <SystemIcons.ArrowLineDown size={'20px'} />}\r\n </StyledTableHeaderColumnSortDirection>\r\n )}\r\n </StyledTableHeaderColumnContent>\r\n </StyledTableHeaderColumn>\r\n ))}\r\n </StyledTableHeaderColumns>\r\n </StyledTableHeaderRow>\r\n <StyledTableBody>\r\n {props.currentPageRows.length > 0 ? (\r\n props.currentPageRows.map((row: any, index: number) => (\r\n <StyledTableBodyRow\r\n key={`row_${index}`}\r\n className={`${props.selectable ? 'selectable' : ''} ${isSelected(row) ? 'selected' : ''}`}\r\n onClick={() => props.onRowClick && props.onRowClick(row)}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onKeyPress={(e) => {\r\n if (e.key === 'Enter') {\r\n props.onRowClick && props.onRowClick(row);\r\n }\r\n }}\r\n tabIndex={props.selectable && !props.showLoadingIndicator ? 0 : undefined}\r\n data-testid=\"TestTableDataRow\">\r\n {props.multiSelect && (\r\n <StyledTableCell>\r\n <StyledTableCellContent>\r\n <Checkbox selected={isSelected(row)} />\r\n </StyledTableCellContent>\r\n </StyledTableCell>\r\n )}\r\n {props.columns.map((column: TableColumn) => (\r\n <StyledTableCell key={`row_${index}_${column.key}`} style={{ maxWidth: column.width }} title={column.shortenText ? `${row[column.key]} \\n ${column.noteKey ? row[column.noteKey!] : ''}` : ''}>\r\n <StyledTableCellContent\r\n $withNote={Boolean(column.noteKey)}\r\n className={`${column.shortenText ? `truncate-text` : ''} ${column.justify || ''}`}\r\n style={{\r\n color: column.colorFn && column.colorFn(row, column.key),\r\n }}>\r\n {renderCellBody(column, row)}\r\n </StyledTableCellContent>\r\n </StyledTableCell>\r\n ))}\r\n </StyledTableBodyRow>\r\n ))\r\n ) : (\r\n <StyledTableNoRowsLabelRow data-testid=\"TestTableNoDataRow\">\r\n <StyledTableCell colSpan={props.columns.length + (props.multiSelect ? 1 : 0)}>\r\n <StyledTableCellContent className={'center'}>{props.noRowsLabel ?? 'There are no rows to display'}</StyledTableCellContent>\r\n </StyledTableCell>\r\n </StyledTableNoRowsLabelRow>\r\n )}\r\n </StyledTableBody>\r\n </StyledTable>\r\n </StyledTableBodyWrapper>\r\n );\r\n};\r\nexport default TableBody;\r\n"],"mappings":";;;;AACA,SAASA,UAAU,QAAQ,WAAW;AACtC,SAASC,IAAI,QAAQ,UAAU;AAC/B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,gBAAgB;AAEzC,OAAOC,UAAU,MAA2B,sBAAsB;AAElE,SAASC,SAAS,QAAQ,cAAc;AACxC,SACEC,eAAe,EACfC,kBAAkB,EAClBC,eAAe,EACfC,sBAAsB,EACtBC,mBAAmB,EACnBC,mBAAmB,EACnBC,uBAAuB,EACvBC,8BAA8B,EAC9BC,wBAAwB,EACxBC,yBAAyB,EACzBC,WAAW,EACXC,sBAAsB,EACtBC,oBAAoB,EACpBC,oCAAoC,EACpCC,uBAAuB,EACvBC,0BAA0B,QACrB,eAAe;AACtB,SAASC,yBAAyB,QAAQ,WAAW;AACrD,SAASC,WAAW,QAAQ,UAAU;AACtC,SAASC,gBAAgB,QAAQ,OAAO;AACxC,OAAOC,MAAM,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAWvC,MAAMC,WAAW,GAA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,KAAK,EA8BC,CACrB,CAAC,gBAEFpF,IAAA,CAACZ,yBAAyB;UAAC,eAAY,oBAAoB;UAAAqD,QAAA,eACzDzC,IAAA,CAACnB,eAAe;YAAC6G,OAAO,EAAElF,KAAK,CAACW,OAAO,CAACgE,MAAM,IAAI3E,KAAK,CAACgD,WAAW,GAAG,CAAC,GAAG,CAAC,CAAE;YAAAf,QAAA,eAC3EzC,IAAA,CAAClB,sBAAsB;cAAC8E,SAAS,EAAE,QAAS;cAAAnB,QAAA,EAAEjC,KAAK,CAACmF,WAAW,IAAI;YAA8B,CAAyB;UAAC,CAC5G;QAAC,CACO;MAC5B,CACc,CAAC;IAAA,CACP;EAAC,CACQ,CAAC;AAE7B,CAAC;AAACpF,SAAA,CAAAqF,SAAA;EAhNAV,eAAe,EAAAW,GAAA,CAAAC,OAAA,CAAAD,GAAA,CAAAE,GAAA,EAAAC,UAAA;EACfV,UAAU,EAAAO,GAAA,CAAAI,IAAA;EACVjD,QAAQ,EAAA6C,GAAA,CAAAE,GAAA;EACRvB,YAAY,EAAAqB,GAAA,CAAAI,IAAA,CAAAD,UAAA;EACZ5B,gBAAgB,EAAAyB,GAAA,CAAAI,IAAA,CAAAD,UAAA;EAChBhC,cAAc,EAAA6B,GAAA,CAAAK,KAAA,EAAE,KAAK,EAAG,MAAM,EAAG,MAAM,GAAAF;AAAA;AA4MzC,eAAezF,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableTypes.cjs","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\r\n * Types for the table.\r\n */\r\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\r\nimport {
|
|
1
|
+
{"version":3,"file":"TableTypes.cjs","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\r\n * Types for the table.\r\n */\r\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\r\nimport {TextButtonProps} from '../Button/TextButton';\r\nimport {IconButtonProps} from '../Button/Iconbutton';\r\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\r\n\r\nexport interface TableProps {\r\n /**\r\n * Optional. The title of the table. If provided, a header row will be rendered.\r\n */\r\n title?: string;\r\n\r\n /**\r\n * Required. An array of TableColumn objects, each representing a column in the table.\r\n */\r\n columns: TableColumn[];\r\n\r\n /**\r\n * Required. An array of objects, each representing a row in the table.\r\n */\r\n rows: any[];\r\n\r\n /**\r\n * Optional. A boolean indicating whether the table should have borders.\r\n */\r\n border?: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating whether the table should be rendered as an accordion table.\r\n * If set to 'true' then there will be no pagination, and all rows will be shown on the first page without pagination controls.\r\n */\r\n accordion?: boolean;\r\n\r\n /**\r\n * Optional. A boolean indicating initial state of the table if it is shown in 'accordion' mode, if set to true, it will be collapsed.\r\n */\r\n collapsed?: boolean;\r\n\r\n /**\r\n * Optional. The number of rows to show when the table is shown in accordion mode and collapsed.\r\n */\r\n collapsedRows?: number;\r\n\r\n /**\r\n * Optional. An object of type TableSortProps, representing the properties for sorting the table.\r\n */\r\n sortProps?: TableSortProps;\r\n\r\n /**\r\n * Optional. A boolean indicating whether pagination should be done remotely.\r\n */\r\n remoteOperations?: boolean;\r\n\r\n /**\r\n * Optional. An object of type TablePagination, representing the properties for paginating the table.\r\n * Required only if 'remoteOperations' is set to true.\r\n */\r\n pagination?: TablePagination;\r\n\r\n /**\r\n * Optional. A function to be called when the previous page button is clicked.\r\n * Will be called only if 'remoteOperations' is set to true.\r\n */\r\n onPreviousPageClick?: () => void;\r\n\r\n /**\r\n * Optional. A function to be called when the next page button is clicked.\r\n * Will be called only if 'remoteOperations' is set to true.\r\n */\r\n onNextPageClick?: () => void;\r\n\r\n /**\r\n * Optional. A function to be called when the number of rows per page changes.\r\n * Will be called only if 'remoteOperations' is set to true.\r\n */\r\n onRowsPerPageChange?: (count: number) => void;\r\n\r\n /**\r\n * Optional. A function to be called when the sorting direction changes.\r\n * Will be called only if 'remoteOperations' is set to true.\r\n */\r\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void;\r\n\r\n /**\r\n * Optional. A boolean indicating whether a loading indicator should be shown.\r\n */\r\n showLoadingIndicator?: boolean;\r\n\r\n /**\r\n * Optional. The label to be shown next to the rows per page selector.\r\n * Defaults to 'Rows per page'.\r\n */\r\n rowsPerPageLabel? :string;\r\n\r\n /**\r\n * Optional. The label to be shown when there are no rows in the grid.\r\n * Defaults to 'There are no rows to display'\r\n */\r\n noRowsLabel?: string;\r\n\r\n /**\r\n * Optional. The label to be shown for 'accordion' grid when table is in collapsed state.\r\n * Defaults to 'Show more'\r\n */\r\n showMoreLabel?: string;\r\n\r\n /**\r\n * Optional. The label to be shown for 'accordion' grid when user can 'collapse' some of the rows.\r\n * Defaults to 'Show more'\r\n */\r\n showFewerLabel?: string;\r\n\r\n /**\r\n * Optional. An object representing the properties for a dropdown menu shown in the header of table.\r\n */\r\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\r\n\r\n /**\r\n * Optional. A boolean indicating whether the rows in the table should be selectable.\r\n */\r\n selectable?: boolean;\r\n\r\n /**\r\n * Optional. A function to be called when some of the rows get selected or unselected.\r\n */\r\n onSelectionChange?: (value: any | any[]) => void;\r\n\r\n /**\r\n * Optional. A boolean indicating whether multiple rows can be selected at once.\r\n */\r\n multiSelect?: boolean;\r\n\r\n /**\r\n * Optional. The key to be used as the unique identifier for each row.\r\n */\r\n keyExpr?: string;\r\n\r\n /** Optional. Defines initial state of rows (selected/unselected). */\r\n selectedRows?: any[];\r\n\r\n /** Optional. Z-Index html attribute to be set to loading indicator. */\r\n loaderZIndex?: string;\r\n\r\n /** Optional. Sets value for 'table-layout' css props of Table tag.\r\n * If not provided then 'table-layout' will not be set.\r\n */\r\n layout?: TableLayout;\r\n}\r\n\r\nexport interface TableSortProps {\r\n column: string;\r\n direction: TableSortingDirection;\r\n allowClearingSort?: boolean;\r\n}\r\n\r\nexport interface TableColumn {\r\n /**\r\n * Required. The key of the column. This should match a key in the row data.\r\n */\r\n key: string;\r\n\r\n /**\r\n * Optional. The key of the note to be displayed in the column.\r\n */\r\n noteKey?: string;\r\n\r\n /**\r\n * Required. The name of the column. This will be displayed in the column header.\r\n */\r\n name: string;\r\n\r\n /**\r\n * Optional. The value to be used for filtering the column.\r\n */\r\n filterValue?: string;\r\n\r\n /**\r\n * Optional. The icon to be displayed in the column.\r\n */\r\n icon?: React.ReactNode;\r\n\r\n /**\r\n * Optional. The width of the column. Can be specified as a string (e.g., '100px') or a number (e.g., 100).\r\n */\r\n width?: string | number;\r\n\r\n /**\r\n * Optional. A function that returns the color for a cell in the column.\r\n */\r\n colorFn?: (row: any, key: string) => string;\r\n\r\n /**\r\n * Optional. The text alignment for the column. Can be 'right', 'left', or 'center'.\r\n */\r\n justify?: TableJustification;\r\n\r\n /**\r\n * Optional. A boolean indicating whether the text in the column should be shortened.\r\n */\r\n shortenText?: boolean;\r\n\r\n /**\r\n * Optional. A function to be called when an action is performed on a cell in the column.\r\n */\r\n action?: (row: any, event: any) => void;\r\n\r\n /**\r\n * Optional. The type of the column. Can be 'text', 'boolean', 'number', 'custom', 'button', 'icon', or 'link'.\r\n */\r\n type?: TableColumnTypes;\r\n\r\n /**\r\n * Optional. Additional properties for the column.\r\n */\r\n additionalProps?: Pick<TextButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled' | 'tooltip'> | Pick<HyperlinkProps, 'variant'>;\r\n\r\n /**\r\n * Optional. A function that returns custom content for a cell in the column.\r\n * Will be used only for button of type 'custom'\r\n */\r\n customContent?: (row: any, key: string) => any;\r\n\r\n /**\r\n * Optional. A boolean indicating whether the column is sortable.\r\n */\r\n sortable?: boolean;\r\n}\r\n\r\nexport type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';\r\n\r\nexport type TableJustification = 'right' | 'left' | 'center';\r\n\r\nexport type TableSortingDirection = 'asc' | 'desc';\r\n\r\nexport type TableLayout = 'auto' | 'fixed';\r\n\r\nexport interface TablePagination {\r\n from: number;\r\n to: number;\r\n total: number;\r\n currentPage: number;\r\n rowsPerPage: number;\r\n}\r\n\r\n// will override component properties in case of button, icon and link\r\n"],"mappings":"","ignoreList":[]}
|