@laerdal/life-react-components 2.1.1-dev.9.full → 2.2.1-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/AccordionItem.cjs +8 -17
- package/dist/Accordion/AccordionItem.cjs.map +1 -1
- package/dist/Accordion/AccordionItem.d.ts +2 -0
- package/dist/Accordion/AccordionItem.js +9 -18
- package/dist/Accordion/AccordionItem.js.map +1 -1
- package/dist/Accordion/AccordionMenu.cjs +6 -2
- package/dist/Accordion/AccordionMenu.cjs.map +1 -1
- package/dist/Accordion/AccordionMenu.d.ts +3 -0
- package/dist/Accordion/AccordionMenu.js +6 -2
- package/dist/Accordion/AccordionMenu.js.map +1 -1
- package/dist/Accordion/styles.cjs +7 -11
- package/dist/Accordion/styles.cjs.map +1 -1
- package/dist/Accordion/styles.d.ts +1 -4
- package/dist/Accordion/styles.js +6 -9
- package/dist/Accordion/styles.js.map +1 -1
- package/dist/AuthPage/AuthPage.js +1 -1
- package/dist/Banners/Banner.cjs.map +1 -1
- package/dist/Banners/Banner.js.map +1 -1
- package/dist/Button/Button.js +1 -1
- package/dist/Card/HorizontalCard/HorizontalCard.cjs +16 -7
- package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCard.d.ts +2 -0
- package/dist/Card/HorizontalCard/HorizontalCard.js +13 -6
- package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs +13 -9
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardBody.d.ts +4 -0
- package/dist/Card/HorizontalCard/HorizontalCardBody.js +8 -8
- package/dist/Card/HorizontalCard/HorizontalCardBody.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +7 -5
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.d.ts +2 -0
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +5 -5
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -1
- package/dist/Card/HorizontalCard/index.cjs +33 -12
- package/dist/Card/HorizontalCard/index.cjs.map +1 -1
- package/dist/Card/HorizontalCard/index.d.ts +3 -1
- package/dist/Card/HorizontalCard/index.js +3 -1
- package/dist/Card/HorizontalCard/index.js.map +1 -1
- package/dist/Card/HorizontalCard/types.cjs.map +1 -1
- package/dist/Card/HorizontalCard/types.d.ts +2 -1
- package/dist/Card/HorizontalCard/types.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +1 -1
- package/dist/Dropdown/DropdownContent.cjs +1 -1
- package/dist/Dropdown/DropdownContent.js +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
- package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/GlobalNavigationBar/GlobalNavigationBar.js +1 -1
- package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
- package/dist/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +15 -10
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js +15 -10
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs +16 -4
- package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js +16 -4
- package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileActionContainer.cjs +2 -2
- 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/mobile/MobileMenu.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/GlobalNavigationBar/types.cjs.map +1 -1
- package/dist/GlobalNavigationBar/types.d.ts +4 -5
- package/dist/GlobalNavigationBar/types.js.map +1 -1
- package/dist/Image/ImageWithFallbacks.js +1 -1
- package/dist/InputFields/DatepickerField.js +1 -1
- package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
- package/dist/InputFields/DatepickerFieldHeader.js +1 -1
- package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
- package/dist/InputFields/NumberField.js +1 -1
- package/dist/InputFields/PasswordField.js +1 -1
- package/dist/InputFields/SearchBar.js +1 -1
- package/dist/InputFields/TextField.js +1 -1
- package/dist/LinearProgress/LinearProgress.js +1 -1
- package/dist/Paginator/Paginator.cjs.map +1 -1
- package/dist/Paginator/Paginator.js.map +1 -1
- package/dist/Table/Table.cjs +1 -1
- package/dist/Table/Table.js +1 -1
- package/dist/Table/TableFooter.cjs.map +1 -1
- package/dist/Table/TableFooter.js +1 -1
- package/dist/Table/TableFooter.js.map +1 -1
- package/dist/Tooltips/TooltipStyles.cjs +4 -2
- package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
- package/dist/Tooltips/TooltipStyles.d.ts +1 -0
- package/dist/Tooltips/TooltipStyles.js +4 -2
- package/dist/Tooltips/TooltipStyles.js.map +1 -1
- package/dist/Tooltips/TooltipTypes.cjs +0 -5
- package/dist/Tooltips/TooltipTypes.cjs.map +1 -1
- package/dist/Tooltips/TooltipTypes.d.ts +2 -0
- package/dist/Tooltips/TooltipTypes.js +0 -5
- package/dist/Tooltips/TooltipTypes.js.map +1 -1
- package/dist/Tooltips/TooltipWrapper.cjs +48 -1
- package/dist/Tooltips/TooltipWrapper.cjs.map +1 -1
- package/dist/Tooltips/TooltipWrapper.d.ts +1 -1
- package/dist/Tooltips/TooltipWrapper.js +50 -2
- package/dist/Tooltips/TooltipWrapper.js.map +1 -1
- package/dist/assets/index.cjs.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/common/ActionWithin.cjs +1 -1
- package/dist/common/ActionWithin.js +1 -1
- package/dist/common/FocusVisible.cjs +1 -1
- package/dist/common/FocusVisible.js +1 -1
- package/dist/icons/systemicons/SystemIcons.cjs.map +1 -1
- package/dist/icons/systemicons/SystemIcons.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginator.cjs","names":["Container","styled","nav","BREAKPOINTS","MEDIUM","Items","ul","Item","li","ComponentMStyling","ComponentTextStyle","Regular","COLORS","neutral_600","focusStyles","Z_INDEXES","hover","primary_800","primary_20","active","primary_700","primary_100","neutral_800","neutral_20","Dots","ItemContent","primary_500","Step","up","target","disabled","page","onPageChange","id","navigateHook","useNavigate","handleButtonClick","event","Paginator","pageCount","currentPage","baseUrl","pages","from","to","i","push","findIndex","item","map"],"sources":["../../src/Paginator/Paginator.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {NavLink} from 'react-router-dom';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {ComponentMStyling} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport { useNavigate } from 'react-router';\nimport {IconButton} from '../Button';\n\nconst Container = styled.nav`\n margin: 20px 0;\n display: flex;\n justify-content: center;\n\n ${BREAKPOINTS.MEDIUM} {\n width: 75%;\n }\n`;\n\nconst Items = styled.ul`\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n`;\n\nconst Item = styled.li`\n width: 48px;\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n text-decoration: none;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n &:focus,\n &:focus-within {\n ${focusStyles}\n }\n }\n & > a:hover {\n z-index: ${Z_INDEXES.hover};\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_20};\n }\n & > a:active {\n z-index: ${Z_INDEXES.active};\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_100};\n }\n & > a.active {\n z-index: ${Z_INDEXES.active};\n color: ${COLORS.neutral_800};\n background-color: ${COLORS.neutral_20};\n cursor: default;\n &:hover {\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_20};\n }\n &:active {\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_100};\n }\n }\n`;\n\nconst Dots = styled(Item)`\n cursor: not-allowed;\n &:after{\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n content: '...';\n }\n`;\n\nconst ItemContent = styled('div')`\n text-align:center;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n width: 100%;\n height: 100%;\n \n &.active:after{\n content: '';\n position: absolute;\n bottom: 4px;\n width: 32px;\n border-radius: 4px;\n height: 4px;\n background-color: ${COLORS.primary_500}\n }\n &.active:hover:after{\n background-color: ${COLORS.primary_700}\n }\n &.active:active:after{\n background-color: ${COLORS.primary_800}\n }\n`\n\ntype PaginatorProps = {\n pageCount: number;\n currentPage: number;\n baseUrl: string;\n onPageChange?: (page: number) => void;\n};\n\nconst Step = ({\n up = true,\n target = '',\n disabled = false,\n page,\n onPageChange,\n id,\n}: {\n up: boolean;\n target: string;\n disabled: boolean;\n page: number;\n onPageChange?: (page: number) => void;\n id?: string;\n}) => {\n const navigateHook = useNavigate();\n\n const handleButtonClick = () => {\n navigateHook(target);\n onPageChange && onPageChange(page);\n }\n\n return (\n <IconButton id={id}\n action={event => handleButtonClick()}\n variant={'secondary'}\n shape={'circular'}\n disabled={disabled}>\n {up ? <ChevronRight/> : <ChevronLeft/>}\n </IconButton>\n )\n};\n\nconst Paginator = ({ pageCount = 1, currentPage = 1, baseUrl = '', onPageChange }: PaginatorProps) => {\n const pages = [];\n let from = 2;\n let to = 4;\n if (pageCount === 0) return null;\n\n if (pageCount > 1) {\n if (currentPage >= 4 && currentPage <= pageCount - 2) {\n from = currentPage - 1;\n to = currentPage + 1;\n } else if (pageCount - 2 > 1 && currentPage > pageCount - 2) {\n from = pageCount - 3;\n to = pageCount - 1;\n }\n if (to > pageCount) {\n to = pageCount;\n }\n for (let i = from; i <= to; i += 1) {\n pages.push(i);\n }\n }\n\n return (\n <Container>\n <Items>\n <Step up={false}\n target={`${baseUrl}/${currentPage - 1}`}\n page={currentPage - 1}\n disabled={currentPage === 1}\n onPageChange={() => {\n if (onPageChange) onPageChange(currentPage - 1);\n }}\n id=\"paginator-left\"/>\n {pages.findIndex(item => item === 1) === -1 && (\n <Item>\n <NavLink\n to={`${baseUrl}/1`}\n onClick={() => {\n if (onPageChange) onPageChange(1);\n }}>\n <ItemContent className={currentPage === 1 ? 'active' : ''}>\n <span>1</span>\n </ItemContent>\n </NavLink>\n </Item>\n )}\n {currentPage >= 4 && pageCount > 5 && pageCount && pages.findIndex(item => item === 1) === -1 && (\n <Dots/>\n )}\n {pages.map(page => (\n <Item key={page}>\n <NavLink\n to={`${baseUrl}/${page}`}\n onClick={() => {\n if (onPageChange) onPageChange(page);\n }}>\n <ItemContent className={currentPage === page ? 'active' : ''}>\n <span>{page}</span>\n </ItemContent>\n </NavLink>\n </Item>\n ))}\n {pageCount > 5 && currentPage <= pageCount - 3 && (\n <Dots/>\n )}\n {pages.findIndex(item => item === pageCount) === -1 && pageCount !== 1 && (\n <Item>\n <NavLink\n to={`${baseUrl}/${pageCount}`}\n onClick={() => {\n if (onPageChange) onPageChange(pageCount);\n }}>\n <ItemContent className={currentPage === pageCount ? 'active' : ''}>\n <span>{pageCount}</span>\n </ItemContent>\n </NavLink>\n </Item>\n )}\n <Step up\n target={`${baseUrl}/${currentPage + 1}`}\n page={currentPage + 1}\n disabled={currentPage === pageCount}\n onPageChange={() => {\n if (onPageChange) onPageChange(currentPage + 1);\n }}\n id=\"paginator-right\"/>\n </Items>\n </Container>\n );\n};\n\nexport default Paginator;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAqC;AAAA;AAAA;AAAA;AAErC,IAAMA,SAAS,GAAGC,yBAAM,CAACC,GAAG,yLAKxBC,mBAAW,CAACC,MAAM,CAGrB;AAED,IAAMC,KAAK,GAAGJ,yBAAM,CAACK,EAAE,2JAKtB;AAED,IAAMC,IAAI,GAAGN,yBAAM,CAACO,EAAE,y1BAehB,IAAAC,6BAAiB,EAACC,0BAAkB,CAACC,OAAO,EAAEC,cAAM,CAACC,WAAW,CAAC,EAI/DC,mBAAW,EAIJC,mBAAS,CAACC,KAAK,EACjBJ,cAAM,CAACK,WAAW,EACPL,cAAM,CAACM,UAAU,EAG1BH,mBAAS,CAACI,MAAM,EAClBP,cAAM,CAACQ,WAAW,EACPR,cAAM,CAACS,WAAW,EAG3BN,mBAAS,CAACI,MAAM,EAClBP,cAAM,CAACU,WAAW,EACPV,cAAM,CAACW,UAAU,EAG1BX,cAAM,CAACK,WAAW,EACPL,cAAM,CAACM,UAAU,EAG5BN,cAAM,CAACQ,WAAW,EACPR,cAAM,CAACS,WAAW,CAG3C;AAED,IAAMG,IAAI,GAAG,IAAAvB,yBAAM,EAACM,IAAI,CAAC,gKAGnB,IAAAE,6BAAiB,EAACC,0BAAkB,CAACC,OAAO,EAAEC,cAAM,CAACC,WAAW,CAAC,CAGtE;AAED,IAAMY,WAAW,GAAG,IAAAxB,yBAAM,EAAC,KAAK,CAAC,mhBAgBTW,cAAM,CAACc,WAAW,EAGlBd,cAAM,CAACQ,WAAW,EAGlBR,cAAM,CAACK,WAAW,CAEzC;AASD,IAAMU,IAAI,GAAG,SAAPA,IAAI,OAcJ;EAAA,mBAbJC,EAAE;IAAFA,EAAE,wBAAG,IAAI;IAAA,mBACTC,MAAM;IAANA,MAAM,4BAAG,EAAE;I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CAAC;QACjD,CAAE;QACF,EAAE,EAAC;MAAiB,EAAE;IAAA;EACtB,EACE;AAEhB,CAAC;AAAC;EAhIAD,SAAS;EACTC,WAAW;EACXC,OAAO;EACPT,YAAY;AAAA;AAAA,eA+HCM,SAAS;AAAA"}
|
|
1
|
+
{"version":3,"file":"Paginator.cjs","names":["Container","styled","nav","BREAKPOINTS","MEDIUM","Items","ul","Item","li","ComponentMStyling","ComponentTextStyle","Regular","COLORS","neutral_600","focusStyles","Z_INDEXES","hover","primary_800","primary_20","active","primary_700","primary_100","neutral_800","neutral_20","Dots","ItemContent","primary_500","Step","up","target","disabled","page","onPageChange","id","navigateHook","useNavigate","handleButtonClick","event","Paginator","pageCount","currentPage","baseUrl","pages","from","to","i","push","findIndex","item","map"],"sources":["../../src/Paginator/Paginator.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {NavLink} from 'react-router-dom';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {ComponentMStyling} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport { useNavigate } from 'react-router';\nimport {IconButton} from '../Button';\n\nconst Container = styled.nav`\n margin: 20px 0;\n display: flex;\n justify-content: center;\n\n ${BREAKPOINTS.MEDIUM} {\n width: 75%;\n }\n`;\n\nconst Items = styled.ul`\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n`;\n\nconst Item = styled.li`\n width: 48px;\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n text-decoration: none;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n &:focus,\n &:focus-within {\n ${focusStyles}\n }\n }\n & > a:hover {\n z-index: ${Z_INDEXES.hover};\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_20};\n }\n & > a:active {\n z-index: ${Z_INDEXES.active};\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_100};\n }\n & > a.active {\n z-index: ${Z_INDEXES.active};\n color: ${COLORS.neutral_800};\n background-color: ${COLORS.neutral_20};\n cursor: default;\n &:hover {\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_20};\n }\n &:active {\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_100};\n }\n }\n`;\n\nconst Dots = styled(Item)`\n cursor: not-allowed;\n &:after{\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n content: '...';\n }\n`;\n\nconst ItemContent = styled('div')`\n text-align:center;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n width: 100%;\n height: 100%;\n \n &.active:after{\n content: '';\n position: absolute;\n bottom: 4px;\n width: 32px;\n border-radius: 4px;\n height: 4px;\n background-color: ${COLORS.primary_500}\n }\n &.active:hover:after{\n background-color: ${COLORS.primary_700}\n }\n &.active:active:after{\n background-color: ${COLORS.primary_800}\n }\n`\n\ntype PaginatorProps = {\n pageCount: number;\n currentPage: number;\n baseUrl: string;\n onPageChange?: (page: number) => void;\n};\n\nconst Step = ({\n up = true,\n target = '',\n disabled = false,\n page,\n onPageChange,\n id,\n}: {\n up: boolean;\n target: string;\n disabled: boolean;\n page: number;\n onPageChange?: (page: number) => void;\n id?: string;\n}) => {\n const navigateHook = useNavigate();\n\n const handleButtonClick = () => {\n navigateHook(target);\n onPageChange && onPageChange(page);\n }\n\n return (\n <IconButton id={id}\n action={event => handleButtonClick()}\n variant={'secondary'}\n shape={'circular'}\n disabled={disabled}>\n {up ? <ChevronRight/> : <ChevronLeft/>}\n </IconButton>\n )\n};\n\nconst Paginator = ({ pageCount = 1, currentPage = 1, baseUrl = '', onPageChange }: PaginatorProps) => {\n const pages = [];\n let from = 2;\n let to = 4;\n if (pageCount === 0) return null;\n\n if (pageCount > 1) {\n if (currentPage >= 4 && currentPage <= pageCount - 2) {\n from = currentPage - 1;\n to = currentPage + 1;\n } else if (pageCount - 2 > 1 && currentPage > pageCount - 2) {\n from = pageCount - 3;\n to = pageCount - 1;\n }\n if (to > pageCount) {\n to = pageCount;\n }\n for (let i = from; i <= to; i += 1) {\n pages.push(i);\n }\n }\n\n return (\n <Container>\n <Items>\n <Step up={false}\n target={`${baseUrl}/${currentPage - 1}`}\n page={currentPage - 1}\n disabled={currentPage === 1}\n onPageChange={() => {\n if (onPageChange) onPageChange(currentPage - 1);\n }}\n id=\"paginator-left\"/>\n {pages.findIndex(item => item === 1) === -1 && (\n <Item>\n <NavLink\n to={`${baseUrl}/1`}\n onClick={() => {\n if (onPageChange) onPageChange(1);\n }}>\n <ItemContent className={currentPage === 1 ? 'active' : ''}>\n <span>1</span>\n </ItemContent>\n </NavLink>\n </Item>\n )}\n {currentPage >= 4 && pageCount > 5 && pageCount && pages.findIndex(item => item === 1) === -1 && (\n <Dots/>\n )}\n {pages.map(page => (\n <Item key={page}>\n <NavLink\n to={`${baseUrl}/${page}`}\n onClick={() => {\n if (onPageChange) onPageChange(page);\n }}>\n <ItemContent className={currentPage === page ? 'active' : ''}>\n <span>{page}</span>\n </ItemContent>\n </NavLink>\n </Item>\n ))}\n {pageCount > 5 && currentPage <= pageCount - 3 && (\n <Dots/>\n )}\n {pages.findIndex(item => item === pageCount) === -1 && pageCount !== 1 && (\n <Item>\n <NavLink\n to={`${baseUrl}/${pageCount}`}\n onClick={() => {\n if (onPageChange) onPageChange(pageCount);\n }}>\n <ItemContent className={currentPage === pageCount ? 'active' : ''}>\n <span>{pageCount}</span>\n </ItemContent>\n </NavLink>\n </Item>\n )}\n <Step up\n target={`${baseUrl}/${currentPage + 1}`}\n page={currentPage + 1}\n disabled={currentPage === pageCount}\n onPageChange={() => {\n if (onPageChange) onPageChange(currentPage + 1);\n }}\n id=\"paginator-right\"/>\n </Items>\n </Container>\n );\n};\n\nexport default Paginator;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AA,eA+HCM,SAAS;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paginator.js","names":["React","styled","NavLink","BREAKPOINTS","COLORS","ComponentTextStyle","focusStyles","ChevronLeft","ChevronRight","ComponentMStyling","Z_INDEXES","useNavigate","IconButton","Container","nav","MEDIUM","Items","ul","Item","li","Regular","neutral_600","hover","primary_800","primary_20","active","primary_700","primary_100","neutral_800","neutral_20","Dots","ItemContent","primary_500","Step","up","target","disabled","page","onPageChange","id","navigateHook","handleButtonClick","event","Paginator","pageCount","currentPage","baseUrl","pages","from","to","i","push","findIndex","item","map"],"sources":["../../src/Paginator/Paginator.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {NavLink} from 'react-router-dom';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {ComponentMStyling} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport { useNavigate } from 'react-router';\nimport {IconButton} from '../Button';\n\nconst Container = styled.nav`\n margin: 20px 0;\n display: flex;\n justify-content: center;\n\n ${BREAKPOINTS.MEDIUM} {\n width: 75%;\n }\n`;\n\nconst Items = styled.ul`\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n`;\n\nconst Item = styled.li`\n width: 48px;\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n text-decoration: none;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n &:focus,\n &:focus-within {\n ${focusStyles}\n }\n }\n & > a:hover {\n z-index: ${Z_INDEXES.hover};\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_20};\n }\n & > a:active {\n z-index: ${Z_INDEXES.active};\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_100};\n }\n & > a.active {\n z-index: ${Z_INDEXES.active};\n color: ${COLORS.neutral_800};\n background-color: ${COLORS.neutral_20};\n cursor: default;\n &:hover {\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_20};\n }\n &:active {\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_100};\n }\n }\n`;\n\nconst Dots = styled(Item)`\n cursor: not-allowed;\n &:after{\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n content: '...';\n }\n`;\n\nconst ItemContent = styled('div')`\n text-align:center;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n width: 100%;\n height: 100%;\n \n &.active:after{\n content: '';\n position: absolute;\n bottom: 4px;\n width: 32px;\n border-radius: 4px;\n height: 4px;\n background-color: ${COLORS.primary_500}\n }\n &.active:hover:after{\n background-color: ${COLORS.primary_700}\n }\n &.active:active:after{\n background-color: ${COLORS.primary_800}\n }\n`\n\ntype PaginatorProps = {\n pageCount: number;\n currentPage: number;\n baseUrl: string;\n onPageChange?: (page: number) => void;\n};\n\nconst Step = ({\n up = true,\n target = '',\n disabled = false,\n page,\n onPageChange,\n id,\n}: {\n up: boolean;\n target: string;\n disabled: boolean;\n page: number;\n onPageChange?: (page: number) => void;\n id?: string;\n}) => {\n const navigateHook = useNavigate();\n\n const handleButtonClick = () => {\n navigateHook(target);\n onPageChange && onPageChange(page);\n }\n\n return (\n <IconButton id={id}\n action={event => handleButtonClick()}\n variant={'secondary'}\n shape={'circular'}\n disabled={disabled}>\n {up ? <ChevronRight/> : <ChevronLeft/>}\n </IconButton>\n )\n};\n\nconst Paginator = ({ pageCount = 1, currentPage = 1, baseUrl = '', onPageChange }: PaginatorProps) => {\n const pages = [];\n let from = 2;\n let to = 4;\n if (pageCount === 0) return null;\n\n if (pageCount > 1) {\n if (currentPage >= 4 && currentPage <= pageCount - 2) {\n from = currentPage - 1;\n to = currentPage + 1;\n } else if (pageCount - 2 > 1 && currentPage > pageCount - 2) {\n from = pageCount - 3;\n to = pageCount - 1;\n }\n if (to > pageCount) {\n to = pageCount;\n }\n for (let i = from; i <= to; i += 1) {\n pages.push(i);\n }\n }\n\n return (\n <Container>\n <Items>\n <Step up={false}\n target={`${baseUrl}/${currentPage - 1}`}\n page={currentPage - 1}\n disabled={currentPage === 1}\n onPageChange={() => {\n if (onPageChange) onPageChange(currentPage - 1);\n }}\n id=\"paginator-left\"/>\n {pages.findIndex(item => item === 1) === -1 && (\n <Item>\n <NavLink\n to={`${baseUrl}/1`}\n onClick={() => {\n if (onPageChange) onPageChange(1);\n }}>\n <ItemContent className={currentPage === 1 ? 'active' : ''}>\n <span>1</span>\n </ItemContent>\n </NavLink>\n </Item>\n )}\n {currentPage >= 4 && pageCount > 5 && pageCount && pages.findIndex(item => item === 1) === -1 && (\n <Dots/>\n )}\n {pages.map(page => (\n <Item key={page}>\n <NavLink\n to={`${baseUrl}/${page}`}\n onClick={() => {\n if (onPageChange) onPageChange(page);\n }}>\n <ItemContent className={currentPage === page ? 'active' : ''}>\n <span>{page}</span>\n </ItemContent>\n </NavLink>\n </Item>\n ))}\n {pageCount > 5 && currentPage <= pageCount - 3 && (\n <Dots/>\n )}\n {pages.findIndex(item => item === pageCount) === -1 && pageCount !== 1 && (\n <Item>\n <NavLink\n to={`${baseUrl}/${pageCount}`}\n onClick={() => {\n if (onPageChange) onPageChange(pageCount);\n }}>\n <ItemContent className={currentPage === pageCount ? 'active' : ''}>\n <span>{pageCount}</span>\n </ItemContent>\n </NavLink>\n </Item>\n )}\n <Step up\n target={`${baseUrl}/${currentPage + 1}`}\n page={currentPage + 1}\n disabled={currentPage === pageCount}\n onPageChange={() => {\n if (onPageChange) onPageChange(currentPage + 1);\n }}\n id=\"paginator-right\"/>\n </Items>\n </Container>\n );\n};\n\nexport default Paginator;\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,OAAO,QAAO,kBAAkB;AACxC,SAAQC,WAAW,EAAEC,MAAM,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CAACO,WAAW,GAAG,CAAC,CAAC;QACjD,CAAE;QACF,EAAE,EAAC;MAAiB,EAAE;IAAA;EACtB,EACE;AAEhB,CAAC;AAAC;EAhIAD,SAAS;EACTC,WAAW;EACXC,OAAO;EACPR,YAAY;AAAA;AA+Hd,eAAeK,SAAS"}
|
|
1
|
+
{"version":3,"file":"Paginator.js","names":["React","styled","NavLink","BREAKPOINTS","COLORS","ComponentTextStyle","focusStyles","ChevronLeft","ChevronRight","ComponentMStyling","Z_INDEXES","useNavigate","IconButton","Container","nav","MEDIUM","Items","ul","Item","li","Regular","neutral_600","hover","primary_800","primary_20","active","primary_700","primary_100","neutral_800","neutral_20","Dots","ItemContent","primary_500","Step","up","target","disabled","page","onPageChange","id","navigateHook","handleButtonClick","event","Paginator","pageCount","currentPage","baseUrl","pages","from","to","i","push","findIndex","item","map"],"sources":["../../src/Paginator/Paginator.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {NavLink} from 'react-router-dom';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {ComponentMStyling} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport { useNavigate } from 'react-router';\nimport {IconButton} from '../Button';\n\nconst Container = styled.nav`\n margin: 20px 0;\n display: flex;\n justify-content: center;\n\n ${BREAKPOINTS.MEDIUM} {\n width: 75%;\n }\n`;\n\nconst Items = styled.ul`\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n`;\n\nconst Item = styled.li`\n width: 48px;\n height: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > * {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n text-decoration: none;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n &:focus,\n &:focus-within {\n ${focusStyles}\n }\n }\n & > a:hover {\n z-index: ${Z_INDEXES.hover};\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_20};\n }\n & > a:active {\n z-index: ${Z_INDEXES.active};\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_100};\n }\n & > a.active {\n z-index: ${Z_INDEXES.active};\n color: ${COLORS.neutral_800};\n background-color: ${COLORS.neutral_20};\n cursor: default;\n &:hover {\n color: ${COLORS.primary_800};\n background-color: ${COLORS.primary_20};\n }\n &:active {\n color: ${COLORS.primary_700};\n background-color: ${COLORS.primary_100};\n }\n }\n`;\n\nconst Dots = styled(Item)`\n cursor: not-allowed;\n &:after{\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n content: '...';\n }\n`;\n\nconst ItemContent = styled('div')`\n text-align:center;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n width: 100%;\n height: 100%;\n \n &.active:after{\n content: '';\n position: absolute;\n bottom: 4px;\n width: 32px;\n border-radius: 4px;\n height: 4px;\n background-color: ${COLORS.primary_500}\n }\n &.active:hover:after{\n background-color: ${COLORS.primary_700}\n }\n &.active:active:after{\n background-color: ${COLORS.primary_800}\n }\n`\n\ntype PaginatorProps = {\n pageCount: number;\n currentPage: number;\n baseUrl: string;\n onPageChange?: (page: number) => void;\n};\n\nconst Step = ({\n up = true,\n target = '',\n disabled = false,\n page,\n onPageChange,\n id,\n}: {\n up: boolean;\n target: string;\n disabled: boolean;\n page: number;\n onPageChange?: (page: number) => void;\n id?: string;\n}) => {\n const navigateHook = useNavigate();\n\n const handleButtonClick = () => {\n navigateHook(target);\n onPageChange && onPageChange(page);\n }\n\n return (\n <IconButton id={id}\n action={event => handleButtonClick()}\n variant={'secondary'}\n shape={'circular'}\n disabled={disabled}>\n {up ? <ChevronRight/> : <ChevronLeft/>}\n </IconButton>\n )\n};\n\nconst Paginator = ({ pageCount = 1, currentPage = 1, baseUrl = '', onPageChange }: PaginatorProps) => {\n const pages = [];\n let from = 2;\n let to = 4;\n if (pageCount === 0) return null;\n\n if (pageCount > 1) {\n if (currentPage >= 4 && currentPage <= pageCount - 2) {\n from = currentPage - 1;\n to = currentPage + 1;\n } else if (pageCount - 2 > 1 && currentPage > pageCount - 2) {\n from = pageCount - 3;\n to = pageCount - 1;\n }\n if (to > pageCount) {\n to = pageCount;\n }\n for (let i = from; i <= to; i += 1) {\n pages.push(i);\n }\n }\n\n return (\n <Container>\n <Items>\n <Step up={false}\n target={`${baseUrl}/${currentPage - 1}`}\n page={currentPage - 1}\n disabled={currentPage === 1}\n onPageChange={() => {\n if (onPageChange) onPageChange(currentPage - 1);\n }}\n id=\"paginator-left\"/>\n {pages.findIndex(item => item === 1) === -1 && (\n <Item>\n <NavLink\n to={`${baseUrl}/1`}\n onClick={() => {\n if (onPageChange) onPageChange(1);\n }}>\n <ItemContent className={currentPage === 1 ? 'active' : ''}>\n <span>1</span>\n </ItemContent>\n </NavLink>\n </Item>\n )}\n {currentPage >= 4 && pageCount > 5 && pageCount && pages.findIndex(item => item === 1) === -1 && (\n <Dots/>\n )}\n {pages.map(page => (\n <Item key={page}>\n <NavLink\n to={`${baseUrl}/${page}`}\n onClick={() => {\n if (onPageChange) onPageChange(page);\n }}>\n <ItemContent className={currentPage === page ? 'active' : ''}>\n <span>{page}</span>\n </ItemContent>\n </NavLink>\n </Item>\n ))}\n {pageCount > 5 && currentPage <= pageCount - 3 && (\n <Dots/>\n )}\n {pages.findIndex(item => item === pageCount) === -1 && pageCount !== 1 && (\n <Item>\n <NavLink\n to={`${baseUrl}/${pageCount}`}\n onClick={() => {\n if (onPageChange) onPageChange(pageCount);\n }}>\n <ItemContent className={currentPage === pageCount ? 'active' : ''}>\n <span>{pageCount}</span>\n </ItemContent>\n </NavLink>\n </Item>\n )}\n <Step up\n target={`${baseUrl}/${currentPage + 1}`}\n page={currentPage + 1}\n disabled={currentPage === pageCount}\n onPageChange={() => {\n if (onPageChange) onPageChange(currentPage + 1);\n }}\n id=\"paginator-right\"/>\n </Items>\n </Container>\n );\n};\n\nexport default Paginator;\n"],"mappings":";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CAAC,CAAG;QACxC,IAAI,EAAEA,WAAW,GAAG,CAAE;QACtB,QAAQ,EAAEA,WAAW,KAAKD,SAAU;QACpC,YAAY,EAAE,wBAAM;UAClB,IAAIN,aAAY,EAAEA,aAAY,CAACO,WAAW,GAAG,CAAC,CAAC;QACjD,CAAE;QACF,EAAE,EAAC;MAAiB,EAAE;IAAA;EACtB,EACE;AAEhB,CAAC;AAAC;EAhIAD,SAAS;EACTC,WAAW;EACXC,OAAO;EACPR,YAAY;AAAA;AA+Hd,eAAeK,SAAS"}
|
package/dist/Table/Table.cjs
CHANGED
|
@@ -23,7 +23,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
23
23
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
24
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
25
25
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
26
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
26
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
27
27
|
var Table = function Table(props) {
|
|
28
28
|
var onPreviousPageClick = props.onPreviousPageClick,
|
|
29
29
|
onNextPageClick = props.onNextPageClick,
|
package/dist/Table/Table.js
CHANGED
|
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
9
|
/**
|
|
10
10
|
* Import React libraries.
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableFooter.cjs","names":["TableFooter","props","rowsPerPageValues","value","dropDownText","rowsPerPageLabel","rowsPerPage","accordion","setIsCollapsed","isCollapsed","defaultOnMouseDownHandler","rows","length","showMoreLabel","showFewerLabel","showLoadingIndicator","onRowsPerPageChange","total","from","to","prevPage","COLORS","neutral_600","nextPage"],"sources":["../../src/Table/TableFooter.tsx"],"sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownButton, DropdownItem} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\nimport {defaultOnMouseDownHandler} from '../common';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownItem[] = [{value: '10'}, {value: '20'}, {value: '50'}, {value: '100'}];\n\n const dropDownText = `${props.rowsPerPageLabel ?? 'Rows per page'} : ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={defaultOnMouseDownHandler}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>{props.showMoreLabel ?? 'Show more'} ({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>{props.showFewerLabel ?? 'Show fewer'}</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownButton\n type={'text'}\n items={rowsPerPageValues}\n disabled={props.showLoadingIndicator}\n value={[`${props.rowsPerPage}`]}\n onClick={(value) => props.onRowsPerPageChange(+value[0])}\n label={dropDownText}\n keepLabel={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1 || props.showLoadingIndicator}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total || props.showLoadingIndicator}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"mappings":";;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AAMA;AACA;AAAoD;AAepD,IAAMA,WAAsD,GAAG,SAAzDA,WAAsD,CAAIC,KAAK,EAAK;EAAA;EACxE,IAAMC,iBAAiC,GAAG,CAAC;IAACC,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAK,CAAC,CAAC;EAEvG,IAAMC,YAAY,sCAAMH,KAAK,CAACI,gBAAgB,yEAAI,eAAe,gBAAMJ,KAAK,CAACK,WAAW,CAAE;EAE1F,oBACE,sBAAC,8BAAiB;IAAC,eAAY,oBAAoB;IAAA,WAE3CL,KAAK,CAACM,SAAS,iBACf,sBAAC,4CAA+B;MAAC,OAAO,EAAE;QAAA,OAAMN,KAAK,CAACO,cAAc,CAAC,CAACP,KAAK,CAACQ,WAAW,CAAC;MAAA,CAAC;MACxD,WAAW,EAAEC,iCAA0B;MACvC,QAAQ,EAAET,KAAK,CAACQ,WAAW,IAAIR,KAAK,CAACU,IAAI,CAACC,MAAM,IAAIX,KAAK,CAACK,WAAY;MAAA,WAEnGL,KAAK,CAACQ,WAAW,iBACjB;QAAA,wBACE;UAAA,mCAAOR,KAAK,CAACY,aAAa,uEAAI,WAAW,
|
|
1
|
+
{"version":3,"file":"TableFooter.cjs","names":["TableFooter","props","rowsPerPageValues","value","dropDownText","rowsPerPageLabel","rowsPerPage","accordion","setIsCollapsed","isCollapsed","defaultOnMouseDownHandler","rows","length","showMoreLabel","showFewerLabel","showLoadingIndicator","onRowsPerPageChange","total","from","to","prevPage","COLORS","neutral_600","nextPage"],"sources":["../../src/Table/TableFooter.tsx"],"sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownButton, DropdownItem} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\nimport {defaultOnMouseDownHandler} from '../common';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownItem[] = [{value: '10'}, {value: '20'}, {value: '50'}, {value: '100'}];\n\n const dropDownText = `${props.rowsPerPageLabel ?? 'Rows per page'} : ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={defaultOnMouseDownHandler}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>{props.showMoreLabel ?? 'Show more'} ({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>{props.showFewerLabel ?? 'Show fewer'}</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownButton\n type={'text'}\n items={rowsPerPageValues}\n disabled={props.showLoadingIndicator}\n value={[`${props.rowsPerPage}`]}\n onClick={(value) => props.onRowsPerPageChange(+value[0])}\n label={dropDownText}\n keepLabel={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1 || props.showLoadingIndicator}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total || props.showLoadingIndicator}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"mappings":";;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AAMA;AACA;AAAoD;AAepD,IAAMA,WAAsD,GAAG,SAAzDA,WAAsD,CAAIC,KAAK,EAAK;EAAA;EACxE,IAAMC,iBAAiC,GAAG,CAAC;IAACC,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAK,CAAC,CAAC;EAEvG,IAAMC,YAAY,sCAAMH,KAAK,CAACI,gBAAgB,yEAAI,eAAe,gBAAMJ,KAAK,CAACK,WAAW,CAAE;EAE1F,oBACE,sBAAC,8BAAiB;IAAC,eAAY,oBAAoB;IAAA,WAE3CL,KAAK,CAACM,SAAS,iBACf,sBAAC,4CAA+B;MAAC,OAAO,EAAE;QAAA,OAAMN,KAAK,CAACO,cAAc,CAAC,CAACP,KAAK,CAACQ,WAAW,CAAC;MAAA,CAAC;MACxD,WAAW,EAAEC,iCAA0B;MACvC,QAAQ,EAAET,KAAK,CAACQ,WAAW,IAAIR,KAAK,CAACU,IAAI,CAACC,MAAM,IAAIX,KAAK,CAACK,WAAY;MAAA,WAEnGL,KAAK,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AqB;UAAA,uBACnE,qBAAC,wBAAW;YAAC,IAAI,EAAC,IAAI;YAAC,KAAK,EAAEM,cAAM,CAACC;UAAY;QAAE,EACxC,eACb,qBAAC,kBAAU;UAAC,OAAO,EAAC,WAAW;UAAC,KAAK,EAAC,UAAU;UAAC,MAAM,EAAE;YAAA,OAAMrB,KAAK,CAACsB,QAAQ,EAAE;UAAA,CAAC;UACpE,QAAQ,EAAEtB,KAAK,CAACkB,EAAE,KAAKlB,KAAK,CAACgB,KAAK,IAAIhB,KAAK,CAACc,oBAAqB;UAAA,uBAC3E,qBAAC,yBAAY;YAAC,IAAI,EAAC,IAAI;YAAC,KAAK,EAAEM,cAAM,CAACC;UAAY;QAAE,EACzC;MAAA,EACa;IAAA,EACH;EAAA,EAEf;AAExB,CAAC;AAAC;EApEAN,mBAAmB;EACnBV,WAAW;EACXY,IAAI;EACJC,EAAE;EACFF,KAAK;EACLM,QAAQ;EACRH,QAAQ;EACRZ,cAAc;EACdC,WAAW;AAAA;AAAA,eA+DET,WAAW;AAAA"}
|
|
@@ -7,9 +7,9 @@ import { COLORS } from '../styles';
|
|
|
7
7
|
import { StyledTableFooter, StyledTableFooterCollapseButton, StyledTableFooterContent, StyledTableFooterControls, StyledTableFooterCurrentInfo } from './TableStyles';
|
|
8
8
|
import { SystemIcons } from '../icons';
|
|
9
9
|
import { defaultOnMouseDownHandler } from '../common';
|
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
var TableFooter = function TableFooter(props) {
|
|
14
14
|
var _props$rowsPerPageLab, _props$showMoreLabel, _props$showFewerLabel;
|
|
15
15
|
var rowsPerPageValues = [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableFooter.js","names":["React","DropdownButton","IconButton","ChevronLeft","ChevronRight","COLORS","StyledTableFooter","StyledTableFooterCollapseButton","StyledTableFooterContent","StyledTableFooterControls","StyledTableFooterCurrentInfo","SystemIcons","defaultOnMouseDownHandler","TableFooter","props","rowsPerPageValues","value","dropDownText","rowsPerPageLabel","rowsPerPage","accordion","setIsCollapsed","isCollapsed","rows","length","showMoreLabel","showFewerLabel","showLoadingIndicator","onRowsPerPageChange","total","from","to","prevPage","neutral_600","nextPage"],"sources":["../../src/Table/TableFooter.tsx"],"sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownButton, DropdownItem} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\nimport {defaultOnMouseDownHandler} from '../common';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownItem[] = [{value: '10'}, {value: '20'}, {value: '50'}, {value: '100'}];\n\n const dropDownText = `${props.rowsPerPageLabel ?? 'Rows per page'} : ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={defaultOnMouseDownHandler}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>{props.showMoreLabel ?? 'Show more'} ({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>{props.showFewerLabel ?? 'Show fewer'}</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownButton\n type={'text'}\n items={rowsPerPageValues}\n disabled={props.showLoadingIndicator}\n value={[`${props.rowsPerPage}`]}\n onClick={(value) => props.onRowsPerPageChange(+value[0])}\n label={dropDownText}\n keepLabel={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1 || props.showLoadingIndicator}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total || props.showLoadingIndicator}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAAQC,cAAc,QAAqB,aAAa;AACxD,SAAQC,UAAU,QAAO,WAAW;AACpC,SAAQC,WAAW,EAAEC,YAAY,QAAO,kCAAkC;AAC1E,SAAQC,MAAM,QAAO,WAAW;AAChC,SACEC,iBAAiB,EAAEC,+BAA+B,EAClDC,wBAAwB,EACxBC,yBAAyB,EACzBC,4BAA4B,QACvB,eAAe;AACtB,SAAQC,WAAW,QAAO,UAAU;AACpC,SAAQC,yBAAyB,QAAO,WAAW;AAAC;AAAA;AAAA;AAepD,IAAMC,WAAsD,GAAG,SAAzDA,WAAsD,CAAIC,KAAK,EAAK;EAAA;EACxE,IAAMC,iBAAiC,GAAG,CAAC;IAACC,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAK,CAAC,CAAC;EAEvG,IAAMC,YAAY,sCAAMH,KAAK,CAACI,gBAAgB,yEAAI,eAAe,gBAAMJ,KAAK,CAACK,WAAW,CAAE;EAE1F,oBACE,MAAC,iBAAiB;IAAC,eAAY,oBAAoB;IAAA,WAE3CL,KAAK,CAACM,SAAS,iBACf,MAAC,+BAA+B;MAAC,OAAO,EAAE;QAAA,OAAMN,KAAK,CAACO,cAAc,CAAC,CAACP,KAAK,CAACQ,WAAW,CAAC;MAAA,CAAC;MACxD,WAAW,EAAEV,yBAA0B;MACvC,QAAQ,EAAEE,KAAK,CAACQ,WAAW,IAAIR,KAAK,CAACS,IAAI,CAACC,MAAM,IAAIV,KAAK,CAACK,WAAY;MAAA,WAEnGL,KAAK,CAACQ,WAAW,iBACjB;QAAA,wBACE;UAAA,mCAAOR,KAAK,CAACW,aAAa,uEAAI,WAAW,
|
|
1
|
+
{"version":3,"file":"TableFooter.js","names":["React","DropdownButton","IconButton","ChevronLeft","ChevronRight","COLORS","StyledTableFooter","StyledTableFooterCollapseButton","StyledTableFooterContent","StyledTableFooterControls","StyledTableFooterCurrentInfo","SystemIcons","defaultOnMouseDownHandler","TableFooter","props","rowsPerPageValues","value","dropDownText","rowsPerPageLabel","rowsPerPage","accordion","setIsCollapsed","isCollapsed","rows","length","showMoreLabel","showFewerLabel","showLoadingIndicator","onRowsPerPageChange","total","from","to","prevPage","neutral_600","nextPage"],"sources":["../../src/Table/TableFooter.tsx"],"sourcesContent":["import React from 'react';\nimport {TableProps} from './TableTypes';\nimport {DropdownButton, DropdownItem} from '../Dropdown';\nimport {IconButton} from '../Button';\nimport {ChevronLeft, ChevronRight} from '../icons/systemicons/SystemIcons';\nimport {COLORS} from '../styles';\nimport {\n StyledTableFooter, StyledTableFooterCollapseButton,\n StyledTableFooterContent,\n StyledTableFooterControls,\n StyledTableFooterCurrentInfo\n} from './TableStyles';\nimport {SystemIcons} from '../icons';\nimport {defaultOnMouseDownHandler} from '../common';\n\n\ninterface TableFooterProps extends TableProps {\n onRowsPerPageChange: (value: number) => void;\n rowsPerPage: number;\n from?: number;\n to?: number;\n total?: number;\n nextPage: () => void;\n prevPage: () => void;\n setIsCollapsed: (isCollapsed: boolean) => void;\n isCollapsed: boolean;\n}\n\nconst TableFooter: React.FunctionComponent<TableFooterProps> = (props) => {\n const rowsPerPageValues: DropdownItem[] = [{value: '10'}, {value: '20'}, {value: '50'}, {value: '100'}];\n\n const dropDownText = `${props.rowsPerPageLabel ?? 'Rows per page'} : ${props.rowsPerPage}`;\n\n return (\n <StyledTableFooter data-testid=\"TestTableFooterRow\">\n {\n props.accordion &&\n <StyledTableFooterCollapseButton onClick={() => props.setIsCollapsed(!props.isCollapsed)}\n onMouseDown={defaultOnMouseDownHandler}\n disabled={props.isCollapsed && props.rows.length <= props.rowsPerPage}>\n {\n props.isCollapsed &&\n <>\n <span>{props.showMoreLabel ?? 'Show more'} ({props.rows.length - props.rowsPerPage})</span>\n <SystemIcons.ArrowDropDown/>\n </>\n }\n {\n !props.isCollapsed &&\n <>\n <span>{props.showFewerLabel ?? 'Show fewer'}</span>\n <SystemIcons.ArrowDropUp/>\n </>\n }\n </StyledTableFooterCollapseButton>\n }\n {\n !props.accordion &&\n <StyledTableFooterContent>\n <DropdownButton\n type={'text'}\n items={rowsPerPageValues}\n disabled={props.showLoadingIndicator}\n value={[`${props.rowsPerPage}`]}\n onClick={(value) => props.onRowsPerPageChange(+value[0])}\n label={dropDownText}\n keepLabel={true}\n />\n <StyledTableFooterCurrentInfo>\n {props.total === 0 ? 0 : props.from}-{props.to} of {props.total}\n </StyledTableFooterCurrentInfo>\n <StyledTableFooterControls>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.prevPage()}\n disabled={props.from === 1 || props.showLoadingIndicator}>\n <ChevronLeft size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => props.nextPage()}\n disabled={props.to === props.total || props.showLoadingIndicator}>\n <ChevronRight size=\"24\" color={COLORS.neutral_600}/>\n </IconButton>\n </StyledTableFooterControls>\n </StyledTableFooterContent>\n }\n </StyledTableFooter>\n );\n};\n\n\nexport default TableFooter;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAAQC,cAAc,QAAqB,aAAa;AACxD,SAAQC,UAAU,QAAO,WAAW;AACpC,SAAQC,WAAW,EAAEC,YAAY,QAAO,kCAAkC;AAC1E,SAAQC,MAAM,QAAO,WAAW;AAChC,SACEC,iBAAiB,EAAEC,+BAA+B,EAClDC,wBAAwB,EACxBC,yBAAyB,EACzBC,4BAA4B,QACvB,eAAe;AACtB,SAAQC,WAAW,QAAO,UAAU;AACpC,SAAQC,yBAAyB,QAAO,WAAW;AAAC;AAAA;AAAA;AAepD,IAAMC,WAAsD,GAAG,SAAzDA,WAAsD,CAAIC,KAAK,EAAK;EAAA;EACxE,IAAMC,iBAAiC,GAAG,CAAC;IAACC,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAI,CAAC,EAAE;IAACA,KAAK,EAAE;EAAK,CAAC,CAAC;EAEvG,IAAMC,YAAY,sCAAMH,KAAK,CAACI,gBAAgB,yEAAI,eAAe,gBAAMJ,KAAK,CAACK,WAAW,CAAE;EAE1F,oBACE,MAAC,iBAAiB;IAAC,eAAY,oBAAoB;IAAA,WAE3CL,KAAK,CAACM,SAAS,iBACf,MAAC,+BAA+B;MAAC,OAAO,EAAE;QAAA,OAAMN,KAAK,CAACO,cAAc,CAAC,CAACP,KAAK,CAACQ,WAAW,CAAC;MAAA,CAAC;MACxD,WAAW,EAAEV,yBAA0B;MACvC,QAAQ,EAAEE,KAAK,CAACQ,WAAW,IAAIR,KAAK,CAACS,IAAI,CAACC,MAAM,IAAIV,K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IhB,KAAK,CAACa,oBAAqB;UAAA,uBACnE,KAAC,WAAW;YAAC,IAAI,EAAC,IAAI;YAAC,KAAK,EAAEtB,MAAM,CAAC4B;UAAY;QAAE,EACxC,eACb,KAAC,UAAU;UAAC,OAAO,EAAC,WAAW;UAAC,KAAK,EAAC,UAAU;UAAC,MAAM,EAAE;YAAA,OAAMnB,KAAK,CAACoB,QAAQ,EAAE;UAAA,CAAC;UACpE,QAAQ,EAAEpB,KAAK,CAACiB,EAAE,KAAKjB,KAAK,CAACe,KAAK,IAAIf,KAAK,CAACa,oBAAqB;UAAA,uBAC3E,KAAC,YAAY;YAAC,IAAI,EAAC,IAAI;YAAC,KAAK,EAAEtB,MAAM,CAAC4B;UAAY;QAAE,EACzC;MAAA,EACa;IAAA,EACH;EAAA,EAEf;AAExB,CAAC;AAAC;EApEAL,mBAAmB;EACnBT,WAAW;EACXW,IAAI;EACJC,EAAE;EACFF,KAAK;EACLK,QAAQ;EACRF,QAAQ;EACRX,cAAc;EACdC,WAAW;AAAA;AA+Db,eAAeT,WAAW"}
|
|
@@ -18,7 +18,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
18
18
|
var distanceToEdge = function distanceToEdge(size) {
|
|
19
19
|
return size == _types.Size.XSmall ? '8px' : !size || size == _types.Size.Small ? '12px' : '16px';
|
|
20
20
|
};
|
|
21
|
-
var Tooltip = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\n pointer-events: none;\n ", "\n ", "\n ", "\n ", "\n box-shadow: ", ";\n \n padding: ", ";\n border-radius: 2px;\n
|
|
21
|
+
var Tooltip = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\n pointer-events: none;\n ", "\n ", "\n ", "\n ", "\n box-shadow: ", ";\n \n padding: ", ";\n border-radius: 2px;\n ", "\n height: ", ";\n max-width: 34em;\n background: ", ";\n position: absolute; \n opacity: 0; \n z-index: ", ";\n ", "\n\n ", "\n ", "\n \n ", "\n\n\n&::after {\n ", "\n content: \"\";\n position: absolute;\n ", "\n \n ", "\n ", "\n\n ", "\n\n ", "\n margin: -0.5px;\n border-width: 4px;\n border-style: solid;\n border-color: ", " \n ", " \n ", " \n ", ";\n }\n"])), function (props) {
|
|
22
22
|
return props.size == _types.Size.Small || props.size != _types.Size.Medium ? (0, _typography.ComponentSStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.white) : '';
|
|
23
23
|
}, function (props) {
|
|
24
24
|
return props.size == _types.Size.XSmall ? (0, _typography.ComponentXSStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.white) : '';
|
|
@@ -28,6 +28,8 @@ var Tooltip = _styledComponents.default.div(_templateObject || (_templateObject
|
|
|
28
28
|
return props.align == 'center' ? 'text-align: center;' : '';
|
|
29
29
|
}, _styles.BOXSHADOWS.BOXSHADOW_L2, function (props) {
|
|
30
30
|
return props.size == _types.Size.XSmall ? '4px 8px' : props.size == _types.Size.Medium ? '8px 12px' : '6px 10px';
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return props.width ? "width: ".concat(props.width, ";") : 'width: max-content;';
|
|
31
33
|
}, function (props) {
|
|
32
34
|
return props.height;
|
|
33
35
|
}, _styles.COLORS.primary_800, _zIndexes.Z_INDEXES.tooltip, function (props) {
|
|
@@ -68,7 +70,7 @@ Tooltip.defaultProps = {
|
|
|
68
70
|
position: 'bottom'
|
|
69
71
|
};
|
|
70
72
|
var TooltipTrigger = function TooltipTrigger(delay) {
|
|
71
|
-
return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n &:hover ", ", &:focus-within ", ", &:focus ", " {\n
|
|
73
|
+
return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n &.hover {\n &:hover ", ", &:focus-within ", ", &:focus ", " {\n opacity: 1;\n transition: 0.5s;\n transition-delay: ", ";\n }\n }\n\n &.click ", " {\n transition: 0.5s;\n transition-delay: ", ";\n }\n\n &.click.show ", " {\n opacity: 1;\n }\n\n &.click.hide ", " {\n opacity: 0;\n }\n\n"])), Tooltip, Tooltip, Tooltip, delay !== null && delay !== void 0 ? delay : '1s', Tooltip, delay !== null && delay !== void 0 ? delay : '0s', Tooltip, Tooltip);
|
|
72
74
|
};
|
|
73
75
|
exports.TooltipTrigger = TooltipTrigger;
|
|
74
76
|
var TooltipContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n position: relative;\n\n ", "\n \n &:focus{\n ", "\n }\n"])), function (props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipStyles.cjs","names":["distanceToEdge","size","Size","XSmall","Small","Tooltip","styled","div","props","Medium","ComponentSStyling","ComponentTextStyle","Regular","COLORS","white","ComponentXSStyling","ComponentMStyling","align","BOXSHADOWS","BOXSHADOW_L2","height","primary_800","Z_INDEXES","tooltip","position","withArrow","defaultProps","TooltipTrigger","delay","css","TooltipContainer","focusStyles"],"sources":["../../src/Tooltips/TooltipStyles.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { Size } from '../types';\nimport {BOXSHADOWS, COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport { ComponentMStyling, ComponentSStyling, ComponentXSStyling } from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\nconst distanceToEdge = (size: Size | undefined) => {\n return size == Size.XSmall ? '8px' : (!size || size == Size.Small) ? '12px' : '16px';\n}\n\nexport const Tooltip = styled.div<{\n withArrow?: boolean;\n size?: Size;\n height?: string;\n align?: 'start' | 'end' | 'center' | undefined;\n position?: 'top' | 'right' | 'bottom' | 'left' | undefined;\n}>`\n\n pointer-events: none;\n ${props => (props.size == Size.Small || props.size != Size.Medium ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.size == Size.XSmall ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.size == Size.Medium ? ComponentMStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.align == 'center' ? 'text-align: center;' : '')}\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\n \n padding: ${props => props.size == Size.XSmall ? '4px 8px' : props.size == Size.Medium ? '8px 12px' : '6px 10px'};\n border-radius: 2px;\n width: max-content
|
|
1
|
+
{"version":3,"file":"TooltipStyles.cjs","names":["distanceToEdge","size","Size","XSmall","Small","Tooltip","styled","div","props","Medium","ComponentSStyling","ComponentTextStyle","Regular","COLORS","white","ComponentXSStyling","ComponentMStyling","align","BOXSHADOWS","BOXSHADOW_L2","width","height","primary_800","Z_INDEXES","tooltip","position","withArrow","defaultProps","TooltipTrigger","delay","css","TooltipContainer","focusStyles"],"sources":["../../src/Tooltips/TooltipStyles.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { Size } from '../types';\nimport {BOXSHADOWS, COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport { ComponentMStyling, ComponentSStyling, ComponentXSStyling } from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\nconst distanceToEdge = (size: Size | undefined) => {\n return size == Size.XSmall ? '8px' : (!size || size == Size.Small) ? '12px' : '16px';\n}\n\nexport const Tooltip = styled.div<{\n withArrow?: boolean;\n size?: Size;\n height?: string;\n align?: 'start' | 'end' | 'center' | undefined;\n position?: 'top' | 'right' | 'bottom' | 'left' | undefined;\n width?: string;\n}>`\n\n pointer-events: none;\n ${props => (props.size == Size.Small || props.size != Size.Medium ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.size == Size.XSmall ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.size == Size.Medium ? ComponentMStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.align == 'center' ? 'text-align: center;' : '')}\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\n \n padding: ${props => props.size == Size.XSmall ? '4px 8px' : props.size == Size.Medium ? '8px 12px' : '6px 10px'};\n border-radius: 2px;\n ${props => props.width ? `width: ${props.width};` : 'width: max-content;'}\n height: ${props => props.height};\n max-width: 34em;\n background: ${COLORS.primary_800};\n position: absolute; \n opacity: 0; \n z-index: ${Z_INDEXES.tooltip};\n ${props => (props.position == 'top' ? 'bottom: 110%;' : props.position == 'bottom' ? 'top: 110%;' : '')}\n\n ${props => (props.position == 'left' ? 'bottom: 50%; transform: translateX(-110%) translateY(50%);' : '')}\n ${props => (props.position == 'right' ? 'bottom: 50%;left: 110%; transform: translateY(50%);' : '')}\n \n ${props =>\n props.position == 'left' || props.position == 'right'\n ? ''\n : props.align == 'start'\n ? 'left: 0%;'\n : props.align == 'end'\n ? 'right: 0%;'\n : 'left: 50%; transform: translateX(-50%);'}\n\n\n&::after {\n ${props => (!props.withArrow ? 'display: none;' : '')}\n content: \"\";\n position: absolute;\n ${props => (props.position == 'top' ? 'top: 100%;' : props.position == 'bottom' ? 'bottom: 100%;' : '')}\n \n ${props => (props.position == 'right' ? 'right: 100%; bottom: 50%; transform: translateY(50%);' : '')}\n ${props => (props.position == 'left' ? 'left: 100%; bottom: 50%; transform: translateY(50%);' : '')}\n\n ${props =>\n props.position == 'left' || props.position == 'right' ? '' : \n props.align == 'start' ? `left: ${distanceToEdge(props.size)};` : props.align == 'end' ? `right: ${distanceToEdge(props.size)};` : 'left: 50%;'}\n\n ${props => (props.position == 'left' ? '' : 'margin-left: -5px;')}\n margin: -0.5px;\n border-width: 4px;\n border-style: solid;\n border-color: ${props => (props.position == 'top' ? COLORS.primary_800 : 'transparent')} \n ${props => (props.position == 'right' ? COLORS.primary_800 : 'transparent')} \n ${props => (props.position == 'bottom' ? COLORS.primary_800 : 'transparent')} \n ${props => (props.position == 'left' ? COLORS.primary_800 : 'transparent')};\n }\n`;\n\nTooltip.defaultProps = {\n withArrow: false,\n size: Size.Small,\n height: 'auto',\n align: 'center',\n position: 'bottom'\n}\n\nexport const TooltipTrigger = (delay?: string) => css`\n &.hover {\n &:hover ${Tooltip}, &:focus-within ${Tooltip}, &:focus ${Tooltip} {\n opacity: 1;\n transition: 0.5s;\n transition-delay: ${delay ?? '1s'};\n }\n }\n\n &.click ${Tooltip} {\n transition: 0.5s;\n transition-delay: ${delay ?? '0s'};\n }\n\n &.click.show ${Tooltip} {\n opacity: 1;\n }\n\n &.click.hide ${Tooltip} {\n opacity: 0;\n }\n\n`;\n\nexport const TooltipContainer = styled.div<{delay?: string}>`\n display: inline-block;\n position: relative;\n\n ${props => TooltipTrigger(props.delay)}\n \n &:focus{\n ${focusStyles}\n }\n`;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAA8C;AAAA;AAAA;AAE9C,IAAMA,cAAc,GAAG,SAAjBA,cAAc,CAAIC,IAAsB,EAAK;EACjD,OAAOA,IAAI,IAAIC,WAAI,CAACC,MAAM,GAAG,KAAK,GAAI,CAACF,IAAI,IAAIA,IAAI,IAAIC,WAAI,CAACE,KAAK,GAAI,MAAM,GAAG,MAAM;AACtF,CAAC;AAEM,IAAMC,OAAO,GAAGC,yBAAM,CAACC,GAAG,guBAU3B,UAAAC,KAAK;EAAA,OAAKA,KAAK,CAACP,IAAI,IAAIC,WAAI,CAACE,KAAK,IAAII,KAAK,CAACP,IAAI,IAAIC,WAAI,CAACO,MAAM,GAAG,IAAAC,6BAAiB,EAACC,0BAAkB,CAACC,OAAO,EAAEC,cAAM,CAACC,KAAK,CAAC,GAAG,EAAE;AAAA,CAAC,EACnI,UAAAN,KAAK;EAAA,OAAKA,KAAK,CAACP,IAAI,IAAIC,WAAI,CAACC,MAAM,GAAI,IAAAY,8BAAkB,EAACJ,0BAAkB,CAACC,OAAO,EAAEC,cAAM,CAACC,KAAK,CAAC,GAAG,EAAE;AAAA,CAAC,EACzG,UAAAN,KAAK;EAAA,OAAKA,KAAK,CAACP,IAAI,IAAIC,WAAI,CAACO,MAAM,GAAG,IAAA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A,KAAK,CAACiB,QAAQ,IAAI,MAAM,GAAGZ,cAAM,CAACS,WAAW,GAAG,aAAa;AAAA,CAAC,CAE7F;AAAC;AAEFjB,OAAO,CAACsB,YAAY,GAAG;EACrBD,SAAS,EAAE,KAAK;EAChBzB,IAAI,EAAEC,WAAI,CAACE,KAAK;EAChBiB,MAAM,EAAE,MAAM;EACdJ,KAAK,EAAE,QAAQ;EACfQ,QAAQ,EAAE;AACZ,CAAC;AAEM,IAAMG,cAAc,GAAG,SAAjBA,cAAc,CAAIC,KAAc;EAAA,WAAKC,qBAAG,iaAEvCzB,OAAO,EAAoBA,OAAO,EAAaA,OAAO,EAG1CwB,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,IAAI,EAI3BxB,OAAO,EAEKwB,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,IAAI,EAGpBxB,OAAO,EAIPA,OAAO;AAAA,CAIvB;AAAC;AAEK,IAAM0B,gBAAgB,GAAGzB,yBAAM,CAACC,GAAG,kLAItC,UAAAC,KAAK;EAAA,OAAIoB,cAAc,CAACpB,KAAK,CAACqB,KAAK,CAAC;AAAA,GAGlCG,mBAAW,CAEhB;AAAC"}
|
|
@@ -5,6 +5,7 @@ export declare const Tooltip: import("styled-components").StyledComponent<"div",
|
|
|
5
5
|
height?: string | undefined;
|
|
6
6
|
align?: 'start' | 'end' | 'center' | undefined;
|
|
7
7
|
position?: 'top' | 'right' | 'bottom' | 'left' | undefined;
|
|
8
|
+
width?: string | undefined;
|
|
8
9
|
}, never>;
|
|
9
10
|
export declare const TooltipTrigger: (delay?: string) => import("styled-components").FlattenSimpleInterpolation;
|
|
10
11
|
export declare const TooltipContainer: import("styled-components").StyledComponent<"div", any, {
|
|
@@ -8,7 +8,7 @@ import { Z_INDEXES } from '../styles/z-indexes';
|
|
|
8
8
|
var distanceToEdge = function distanceToEdge(size) {
|
|
9
9
|
return size == Size.XSmall ? '8px' : !size || size == Size.Small ? '12px' : '16px';
|
|
10
10
|
};
|
|
11
|
-
export var Tooltip = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n pointer-events: none;\n ", "\n ", "\n ", "\n ", "\n box-shadow: ", ";\n \n padding: ", ";\n border-radius: 2px;\n
|
|
11
|
+
export var Tooltip = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n pointer-events: none;\n ", "\n ", "\n ", "\n ", "\n box-shadow: ", ";\n \n padding: ", ";\n border-radius: 2px;\n ", "\n height: ", ";\n max-width: 34em;\n background: ", ";\n position: absolute; \n opacity: 0; \n z-index: ", ";\n ", "\n\n ", "\n ", "\n \n ", "\n\n\n&::after {\n ", "\n content: \"\";\n position: absolute;\n ", "\n \n ", "\n ", "\n\n ", "\n\n ", "\n margin: -0.5px;\n border-width: 4px;\n border-style: solid;\n border-color: ", " \n ", " \n ", " \n ", ";\n }\n"])), function (props) {
|
|
12
12
|
return props.size == Size.Small || props.size != Size.Medium ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.white) : '';
|
|
13
13
|
}, function (props) {
|
|
14
14
|
return props.size == Size.XSmall ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.white) : '';
|
|
@@ -18,6 +18,8 @@ export var Tooltip = styled.div(_templateObject || (_templateObject = _taggedTem
|
|
|
18
18
|
return props.align == 'center' ? 'text-align: center;' : '';
|
|
19
19
|
}, BOXSHADOWS.BOXSHADOW_L2, function (props) {
|
|
20
20
|
return props.size == Size.XSmall ? '4px 8px' : props.size == Size.Medium ? '8px 12px' : '6px 10px';
|
|
21
|
+
}, function (props) {
|
|
22
|
+
return props.width ? "width: ".concat(props.width, ";") : 'width: max-content;';
|
|
21
23
|
}, function (props) {
|
|
22
24
|
return props.height;
|
|
23
25
|
}, COLORS.primary_800, Z_INDEXES.tooltip, function (props) {
|
|
@@ -57,7 +59,7 @@ Tooltip.defaultProps = {
|
|
|
57
59
|
position: 'bottom'
|
|
58
60
|
};
|
|
59
61
|
export var TooltipTrigger = function TooltipTrigger(delay) {
|
|
60
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &:hover ", ", &:focus-within ", ", &:focus ", " {\n
|
|
62
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.hover {\n &:hover ", ", &:focus-within ", ", &:focus ", " {\n opacity: 1;\n transition: 0.5s;\n transition-delay: ", ";\n }\n }\n\n &.click ", " {\n transition: 0.5s;\n transition-delay: ", ";\n }\n\n &.click.show ", " {\n opacity: 1;\n }\n\n &.click.hide ", " {\n opacity: 0;\n }\n\n"])), Tooltip, Tooltip, Tooltip, delay !== null && delay !== void 0 ? delay : '1s', Tooltip, delay !== null && delay !== void 0 ? delay : '0s', Tooltip, Tooltip);
|
|
61
63
|
};
|
|
62
64
|
export var TooltipContainer = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: inline-block;\n position: relative;\n\n ", "\n \n &:focus{\n ", "\n }\n"])), function (props) {
|
|
63
65
|
return TooltipTrigger(props.delay);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipStyles.js","names":["styled","css","Size","BOXSHADOWS","COLORS","ComponentTextStyle","focusStyles","ComponentMStyling","ComponentSStyling","ComponentXSStyling","Z_INDEXES","distanceToEdge","size","XSmall","Small","Tooltip","div","props","Medium","Regular","white","align","BOXSHADOW_L2","height","primary_800","tooltip","position","withArrow","defaultProps","TooltipTrigger","delay","TooltipContainer"],"sources":["../../src/Tooltips/TooltipStyles.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { Size } from '../types';\nimport {BOXSHADOWS, COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport { ComponentMStyling, ComponentSStyling, ComponentXSStyling } from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\nconst distanceToEdge = (size: Size | undefined) => {\n return size == Size.XSmall ? '8px' : (!size || size == Size.Small) ? '12px' : '16px';\n}\n\nexport const Tooltip = styled.div<{\n withArrow?: boolean;\n size?: Size;\n height?: string;\n align?: 'start' | 'end' | 'center' | undefined;\n position?: 'top' | 'right' | 'bottom' | 'left' | undefined;\n}>`\n\n pointer-events: none;\n ${props => (props.size == Size.Small || props.size != Size.Medium ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.size == Size.XSmall ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.size == Size.Medium ? ComponentMStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.align == 'center' ? 'text-align: center;' : '')}\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\n \n padding: ${props => props.size == Size.XSmall ? '4px 8px' : props.size == Size.Medium ? '8px 12px' : '6px 10px'};\n border-radius: 2px;\n width: max-content
|
|
1
|
+
{"version":3,"file":"TooltipStyles.js","names":["styled","css","Size","BOXSHADOWS","COLORS","ComponentTextStyle","focusStyles","ComponentMStyling","ComponentSStyling","ComponentXSStyling","Z_INDEXES","distanceToEdge","size","XSmall","Small","Tooltip","div","props","Medium","Regular","white","align","BOXSHADOW_L2","width","height","primary_800","tooltip","position","withArrow","defaultProps","TooltipTrigger","delay","TooltipContainer"],"sources":["../../src/Tooltips/TooltipStyles.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { Size } from '../types';\nimport {BOXSHADOWS, COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport { ComponentMStyling, ComponentSStyling, ComponentXSStyling } from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\nconst distanceToEdge = (size: Size | undefined) => {\n return size == Size.XSmall ? '8px' : (!size || size == Size.Small) ? '12px' : '16px';\n}\n\nexport const Tooltip = styled.div<{\n withArrow?: boolean;\n size?: Size;\n height?: string;\n align?: 'start' | 'end' | 'center' | undefined;\n position?: 'top' | 'right' | 'bottom' | 'left' | undefined;\n width?: string;\n}>`\n\n pointer-events: none;\n ${props => (props.size == Size.Small || props.size != Size.Medium ? ComponentSStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.size == Size.XSmall ? ComponentXSStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.size == Size.Medium ? ComponentMStyling(ComponentTextStyle.Regular, COLORS.white) : '')}\n ${props => (props.align == 'center' ? 'text-align: center;' : '')}\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\n \n padding: ${props => props.size == Size.XSmall ? '4px 8px' : props.size == Size.Medium ? '8px 12px' : '6px 10px'};\n border-radius: 2px;\n ${props => props.width ? `width: ${props.width};` : 'width: max-content;'}\n height: ${props => props.height};\n max-width: 34em;\n background: ${COLORS.primary_800};\n position: absolute; \n opacity: 0; \n z-index: ${Z_INDEXES.tooltip};\n ${props => (props.position == 'top' ? 'bottom: 110%;' : props.position == 'bottom' ? 'top: 110%;' : '')}\n\n ${props => (props.position == 'left' ? 'bottom: 50%; transform: translateX(-110%) translateY(50%);' : '')}\n ${props => (props.position == 'right' ? 'bottom: 50%;left: 110%; transform: translateY(50%);' : '')}\n \n ${props =>\n props.position == 'left' || props.position == 'right'\n ? ''\n : props.align == 'start'\n ? 'left: 0%;'\n : props.align == 'end'\n ? 'right: 0%;'\n : 'left: 50%; transform: translateX(-50%);'}\n\n\n&::after {\n ${props => (!props.withArrow ? 'display: none;' : '')}\n content: \"\";\n position: absolute;\n ${props => (props.position == 'top' ? 'top: 100%;' : props.position == 'bottom' ? 'bottom: 100%;' : '')}\n \n ${props => (props.position == 'right' ? 'right: 100%; bottom: 50%; transform: translateY(50%);' : '')}\n ${props => (props.position == 'left' ? 'left: 100%; bottom: 50%; transform: translateY(50%);' : '')}\n\n ${props =>\n props.position == 'left' || props.position == 'right' ? '' : \n props.align == 'start' ? `left: ${distanceToEdge(props.size)};` : props.align == 'end' ? `right: ${distanceToEdge(props.size)};` : 'left: 50%;'}\n\n ${props => (props.position == 'left' ? '' : 'margin-left: -5px;')}\n margin: -0.5px;\n border-width: 4px;\n border-style: solid;\n border-color: ${props => (props.position == 'top' ? COLORS.primary_800 : 'transparent')} \n ${props => (props.position == 'right' ? COLORS.primary_800 : 'transparent')} \n ${props => (props.position == 'bottom' ? COLORS.primary_800 : 'transparent')} \n ${props => (props.position == 'left' ? COLORS.primary_800 : 'transparent')};\n }\n`;\n\nTooltip.defaultProps = {\n withArrow: false,\n size: Size.Small,\n height: 'auto',\n align: 'center',\n position: 'bottom'\n}\n\nexport const TooltipTrigger = (delay?: string) => css`\n &.hover {\n &:hover ${Tooltip}, &:focus-within ${Tooltip}, &:focus ${Tooltip} {\n opacity: 1;\n transition: 0.5s;\n transition-delay: ${delay ?? '1s'};\n }\n }\n\n &.click ${Tooltip} {\n transition: 0.5s;\n transition-delay: ${delay ?? '0s'};\n }\n\n &.click.show ${Tooltip} {\n opacity: 1;\n }\n\n &.click.hide ${Tooltip} {\n opacity: 0;\n }\n\n`;\n\nexport const TooltipContainer = styled.div<{delay?: string}>`\n display: inline-block;\n position: relative;\n\n ${props => TooltipTrigger(props.delay)}\n \n &:focus{\n ${focusStyles}\n }\n`;\n"],"mappings":";;AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,IAAI,QAAQ,UAAU;AAC/B,SAAQC,UAAU,EAAEC,MAAM,EAAEC,kBAAkB,EAAEC,WAAW,QAAO,WAAW;AAC7E,SAASC,iBAAiB,EAAEC,iBAAiB,EAAEC,kBAAkB,QAAQ,sBAAsB;AAC/F,SAAQC,SAAS,QAAO,qBAAqB;AAE7C,IAAMC,cAAc,GAAG,SAAjBA,cAAc,CAAIC,IAAsB,EAAK;EACjD,OAAOA,IAAI,IAAIV,IAAI,CAACW,MAAM,GAAG,KAAK,GAAI,CAACD,IAAI,IAAIA,IAAI,IAAIV,IAAI,CAACY,KAAK,GAAI,MAAM,GAAG,MAAM;AACtF,CAAC;AAED,OAAO,IAAMC,OAAO,GAAGf,MAAM,CAACgB,GAAG,ktBAU3B,UAAAC,KAAK;EAAA,OAAKA,KAAK,CAACL,IAAI,IAAIV,IAAI,CAACY,KAAK,I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D,UAAAV,KAAK;EAAA,OAAKA,KAAK,CAACU,QAAQ,IAAI,KAAK,GAAGvB,MAAM,CAACqB,WAAW,GAAG,aAAa;AAAA,CAAC,EACrE,UAAAR,KAAK;EAAA,OAAKA,KAAK,CAACU,QAAQ,IAAI,OAAO,GAAGvB,MAAM,CAACqB,WAAW,GAAG,aAAa;AAAA,CAAC,EACzE,UAAAR,KAAK;EAAA,OAAKA,KAAK,CAACU,QAAQ,IAAI,QAAQ,GAAGvB,MAAM,CAACqB,WAAW,GAAG,aAAa;AAAA,CAAC,EAC1E,UAAAR,KAAK;EAAA,OAAKA,KAAK,CAACU,QAAQ,IAAI,MAAM,GAAGvB,MAAM,CAACqB,WAAW,GAAG,aAAa;AAAA,CAAC,CAE7F;AAEDV,OAAO,CAACc,YAAY,GAAG;EACrBD,SAAS,EAAE,KAAK;EAChBhB,IAAI,EAAEV,IAAI,CAACY,KAAK;EAChBU,MAAM,EAAE,MAAM;EACdH,KAAK,EAAE,QAAQ;EACfM,QAAQ,EAAE;AACZ,CAAC;AAED,OAAO,IAAMG,cAAc,GAAG,SAAjBA,cAAc,CAAIC,KAAc;EAAA,OAAK9B,GAAG,kZAEvCc,OAAO,EAAoBA,OAAO,EAAaA,OAAO,EAG1CgB,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,IAAI,EAI3BhB,OAAO,EAEKgB,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,IAAI,EAGpBhB,OAAO,EAIPA,OAAO;AAAA,CAIvB;AAED,OAAO,IAAMiB,gBAAgB,GAAGhC,MAAM,CAACgB,GAAG,oKAItC,UAAAC,KAAK;EAAA,OAAIa,cAAc,CAACb,KAAK,CAACc,KAAK,CAAC;AAAA,GAGlCzB,WAAW,CAEhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipTypes.cjs","names":[],"sources":["../../src/Tooltips/TooltipTypes.tsx"],"sourcesContent":["import { Size } from \"../types\";\n\n/**\n * Types for the table.\n */\n export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n\n label?: string;\n withArrow?: boolean;\n width?: string;\n size?: Size;\n delay?: string;\n tabIndex?: number;\n height?: string;\n align? : 'start' | 'end' | 'center' | undefined;\n position? : 'top' | 'right' | 'bottom' | 'left' | undefined;\n children?: React.ReactNode;\n }
|
|
1
|
+
{"version":3,"file":"TooltipTypes.cjs","names":[],"sources":["../../src/Tooltips/TooltipTypes.tsx"],"sourcesContent":["import { Size } from \"../types\";\n\n/**\n * Types for the table.\n */\n export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n\n label?: string;\n withArrow?: boolean;\n width?: string;\n size?: Size;\n delay?: string;\n tabIndex?: number;\n height?: string;\n align? : 'start' | 'end' | 'center' | undefined;\n position? : 'top' | 'right' | 'bottom' | 'left' | undefined;\n children?: React.ReactNode;\n trigger?: 'hover' | 'click';\n hideAfter?: number;\n }\n"],"mappings":""}
|
|
@@ -13,4 +13,6 @@ export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
13
13
|
align?: 'start' | 'end' | 'center' | undefined;
|
|
14
14
|
position?: 'top' | 'right' | 'bottom' | 'left' | undefined;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
+
trigger?: 'hover' | 'click';
|
|
17
|
+
hideAfter?: number;
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipTypes.js","names":[],"sources":["../../src/Tooltips/TooltipTypes.tsx"],"sourcesContent":["import { Size } from \"../types\";\n\n/**\n * Types for the table.\n */\n export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n\n label?: string;\n withArrow?: boolean;\n width?: string;\n size?: Size;\n delay?: string;\n tabIndex?: number;\n height?: string;\n align? : 'start' | 'end' | 'center' | undefined;\n position? : 'top' | 'right' | 'bottom' | 'left' | undefined;\n children?: React.ReactNode;\n }
|
|
1
|
+
{"version":3,"file":"TooltipTypes.js","names":[],"sources":["../../src/Tooltips/TooltipTypes.tsx"],"sourcesContent":["import { Size } from \"../types\";\n\n/**\n * Types for the table.\n */\n export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n\n label?: string;\n withArrow?: boolean;\n width?: string;\n size?: Size;\n delay?: string;\n tabIndex?: number;\n height?: string;\n align? : 'start' | 'end' | 'center' | undefined;\n position? : 'top' | 'right' | 'bottom' | 'left' | undefined;\n children?: React.ReactNode;\n trigger?: 'hover' | 'click';\n hideAfter?: number;\n }\n"],"mappings":""}
|
|
@@ -7,12 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
12
|
var React = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _TooltipStyles = require("./TooltipStyles");
|
|
13
14
|
var _ = require("..");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["label", "children", "withArrow", "tabIndex", "size", "height", "delay", "align", "position"];
|
|
16
|
+
var _excluded = ["label", "children", "withArrow", "tabIndex", "size", "height", "delay", "align", "position", "trigger", "hideAfter"];
|
|
16
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -32,10 +33,56 @@ var TooltipWrapper = function TooltipWrapper(_ref) {
|
|
|
32
33
|
align = _ref$align === void 0 ? 'center' : _ref$align,
|
|
33
34
|
_ref$position = _ref.position,
|
|
34
35
|
position = _ref$position === void 0 ? 'bottom' : _ref$position,
|
|
36
|
+
_ref$trigger = _ref.trigger,
|
|
37
|
+
trigger = _ref$trigger === void 0 ? 'hover' : _ref$trigger,
|
|
38
|
+
_ref$hideAfter = _ref.hideAfter,
|
|
39
|
+
hideAfter = _ref$hideAfter === void 0 ? 5000 : _ref$hideAfter,
|
|
35
40
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
41
|
+
var _React$useState = React.useState(false),
|
|
42
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
43
|
+
showTooltip = _React$useState2[0],
|
|
44
|
+
setShowTooltip = _React$useState2[1];
|
|
45
|
+
var timeoutRef = (0, React.useRef)();
|
|
46
|
+
var ref = (0, _.useClickOutsideRef)(function () {
|
|
47
|
+
return setShowTooltip(false);
|
|
48
|
+
});
|
|
49
|
+
var handleClick = function handleClick(e) {
|
|
50
|
+
var _ref$current;
|
|
51
|
+
if (ref !== null && ref !== void 0 && (_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(e === null || e === void 0 ? void 0 : e.target)) {
|
|
52
|
+
setShowTooltip(true);
|
|
53
|
+
timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
54
|
+
timeoutRef.current = setTimeout(function () {
|
|
55
|
+
return setShowTooltip(false);
|
|
56
|
+
}, hideAfter);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var handleButtonDown = function handleButtonDown(e) {
|
|
60
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === 'Enter' || (e === null || e === void 0 ? void 0 : e.key) === ' ') {
|
|
61
|
+
setShowTooltip(true);
|
|
62
|
+
timeoutRef.current && clearTimeout(timeoutRef.current);
|
|
63
|
+
timeoutRef.current = setTimeout(function () {
|
|
64
|
+
return setShowTooltip(false);
|
|
65
|
+
}, hideAfter);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
(0, React.useEffect)(function () {
|
|
69
|
+
if (trigger == 'click') {
|
|
70
|
+
var _ref$current2;
|
|
71
|
+
document.addEventListener('mousedown', handleClick);
|
|
72
|
+
ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.addEventListener('keydown', handleButtonDown);
|
|
73
|
+
return function () {
|
|
74
|
+
var _ref$current3;
|
|
75
|
+
document.removeEventListener('mousedown', handleClick);
|
|
76
|
+
ref === null || ref === void 0 ? void 0 : (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.removeEventListener('keydown', handleButtonDown);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}, [trigger]);
|
|
80
|
+
var cls = "".concat(trigger, " ").concat(trigger === 'click' ? showTooltip ? 'show' : 'hide' : '');
|
|
36
81
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_TooltipStyles.TooltipContainer, {
|
|
82
|
+
ref: ref,
|
|
37
83
|
delay: delay,
|
|
38
84
|
tabIndex: tabIndex,
|
|
85
|
+
className: cls,
|
|
39
86
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TooltipStyles.Tooltip, _objectSpread(_objectSpread({
|
|
40
87
|
align: align,
|
|
41
88
|
height: height,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipWrapper.cjs","names":["TooltipWrapper","label","children","withArrow","tabIndex","size","Size","Small","height","delay","undefined","align","position","props"],"sources":["../../src/Tooltips/TooltipWrapper.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"TooltipWrapper.cjs","names":["TooltipWrapper","label","children","withArrow","tabIndex","size","Size","Small","height","delay","undefined","align","position","trigger","hideAfter","props","React","useState","showTooltip","setShowTooltip","timeoutRef","useRef","ref","useClickOutsideRef","handleClick","e","current","contains","target","clearTimeout","setTimeout","handleButtonDown","key","useEffect","document","addEventListener","removeEventListener","cls"],"sources":["../../src/Tooltips/TooltipWrapper.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {TooltipProps} from './TooltipTypes';\n\nimport {TooltipContainer, Tooltip} from './TooltipStyles';\nimport {Size, useClickOutsideRef} from '..';\nimport {useEffect, useRef} from \"react\";\n\nconst TooltipWrapper = ({\n label, children,\n withArrow,\n tabIndex,\n size = Size.Small,\n height = 'auto',\n delay = undefined,\n align = 'center',\n position = 'bottom',\n trigger = 'hover',\n hideAfter = 5000,\n ...props\n }: TooltipProps) => {\n\n const [showTooltip, setShowTooltip] = React.useState(false);\n const timeoutRef = useRef<any>();\n\n const ref = useClickOutsideRef(() => setShowTooltip(false));\n\n const handleClick = (e?: MouseEvent) => {\n if (ref?.current?.contains(e?.target as Node)) {\n setShowTooltip(true)\n timeoutRef.current && clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => setShowTooltip(false), hideAfter);\n }\n }\n const handleButtonDown = (e?: KeyboardEvent) => {\n if (e?.key === 'Enter' || e?.key === ' ') {\n setShowTooltip(true);\n timeoutRef.current && clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => setShowTooltip(false), hideAfter);\n }\n }\n\n useEffect(() => {\n if (trigger == 'click') {\n document.addEventListener('mousedown', handleClick);\n ref?.current?.addEventListener('keydown', handleButtonDown);\n\n return () => {\n document.removeEventListener('mousedown', handleClick);\n ref?.current?.removeEventListener('keydown', handleButtonDown);\n };\n }\n }, [trigger])\n\n const cls = `${trigger} ${trigger === 'click' ? showTooltip ? 'show' : 'hide' : ''}`;\n return <TooltipContainer ref={ref}\n delay={delay}\n tabIndex={tabIndex}\n className={cls}>\n <Tooltip align={align}\n height={height}\n role=\"tooltip\"\n size={size}\n withArrow={withArrow}\n position={position}\n {...props}>\n {label}\n </Tooltip>\n {children}\n </TooltipContainer>;\n};\n\nexport default TooltipWrapper;\n"],"mappings":";;;;;;;;;;;AAAA;AAIA;AACA;AAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAG5C,IAAMA,cAAc,GAAG,SAAjBA,cAAc,OAYwB;EAAA,IAXlBC,KAAK,QAALA,KAAK;IAAEC,QAAQ,QAARA,QAAQ;IACfC,SAAS,QAATA,SAAS;IACTC,QAAQ,QAARA,QAAQ;IAAA,iBACRC,IAAI;IAAJA,IAAI,0BAAGC,MAAI,CAACC,KAAK;IAAA,mBACjBC,MAAM;IAANA,MAAM,4BAAG,MAAM;IAAA,kBACfC,KAAK;IAALA,KAAK,2BAAGC,SAAS;IAAA,kBACjBC,KAAK;IAALA,KAAK,2BAAG,QAAQ;IAAA,qBAChBC,QAAQ;IAARA,QAAQ,8BAAG,QAAQ;IAAA,oBACnBC,OAAO;IAAPA,OAAO,6BAAG,OAAO;IAAA,sBACjBC,SAAS;IAATA,SAAS,+BAAG,IAAI;IACbC,KAAK;EAGhC,sBAAsCC,KAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAA;IAApDC,WAAW;IAAEC,cAAc;EAClC,IAAMC,UAAU,GAAG,IAAAC,YAAM,GAAO;EAEhC,IAAMC,GAAG,GAAG,IAAAC,oBAAkB,EAAC;IAAA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AAW,EAAEZ,WAAW,CAAC;QACtDF,GAAG,aAAHA,GAAG,wCAAHA,GAAG,CAAEI,OAAO,kDAAZ,cAAcU,mBAAmB,CAAC,SAAS,EAAEL,gBAAgB,CAAC;MAChE,CAAC;IACH;EACF,CAAC,EAAE,CAAClB,OAAO,CAAC,CAAC;EAEb,IAAMwB,GAAG,aAAMxB,OAAO,cAAIA,OAAO,KAAK,OAAO,GAAGK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,EAAE,CAAE;EACpF,oBAAO,sBAAC,+BAAgB;IAAC,GAAG,EAAEI,GAAI;IACT,KAAK,EAAEb,KAAM;IACb,QAAQ,EAAEL,QAAS;IACnB,SAAS,EAAEiC,GAAI;IAAA,wBACtC,qBAAC,sBAAO;MAAC,KAAK,EAAE1B,KAAM;MACb,MAAM,EAAEH,MAAO;MACf,IAAI,EAAC,SAAS;MACd,IAAI,EAAEH,IAAK;MACX,SAAS,EAAEF,SAAU;MACrB,QAAQ,EAAES;IAAS,GACfG,KAAK;MAAA,UACfd;IAAK,GACE,EACTC,QAAQ;EAAA,EACQ;AACrB,CAAC;AAAC,eAEaF,cAAc;AAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TooltipProps } from './TooltipTypes';
|
|
2
|
-
declare const TooltipWrapper: ({ label, children, withArrow, tabIndex, size, height, delay, align, position, ...props }: TooltipProps) => JSX.Element;
|
|
2
|
+
declare const TooltipWrapper: ({ label, children, withArrow, tabIndex, size, height, delay, align, position, trigger, hideAfter, ...props }: TooltipProps) => JSX.Element;
|
|
3
3
|
export default TooltipWrapper;
|