@laerdal/life-react-components 1.9.8-dev.8.full → 1.9.9-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/ContentAccordion.cjs +5 -5
- package/dist/Accordion/ContentAccordion.cjs.map +1 -1
- package/dist/Accordion/ContentAccordion.js +6 -6
- package/dist/Accordion/ContentAccordion.js.map +1 -1
- package/dist/Accordion/styles.cjs +1 -1
- package/dist/Accordion/styles.cjs.map +1 -1
- package/dist/Accordion/styles.js +1 -1
- package/dist/Accordion/styles.js.map +1 -1
- package/dist/Button/Button.cjs +3 -3
- package/dist/Button/Button.cjs.map +1 -1
- package/dist/Button/Button.js +3 -3
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Iconbutton.cjs +2 -1
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +1 -0
- package/dist/Button/Iconbutton.js +1 -1
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/Card/HorizontalCard/HorizontalCard.cjs +97 -0
- package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -0
- package/dist/Card/HorizontalCard/HorizontalCard.d.ts +4 -0
- package/dist/Card/HorizontalCard/HorizontalCard.js +74 -0
- package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -0
- package/dist/Card/HorizontalCard/HorizontalCardActions.cjs +118 -0
- package/dist/Card/HorizontalCard/HorizontalCardActions.cjs.map +1 -0
- package/dist/Card/HorizontalCard/HorizontalCardActions.d.ts +5 -0
- package/dist/Card/HorizontalCard/HorizontalCardActions.js +98 -0
- package/dist/Card/HorizontalCard/HorizontalCardActions.js.map +1 -0
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs +60 -0
- package/dist/Card/HorizontalCard/HorizontalCardBody.cjs.map +1 -0
- package/dist/Card/HorizontalCard/HorizontalCardBody.d.ts +5 -0
- package/dist/Card/HorizontalCard/HorizontalCardBody.js +40 -0
- package/dist/Card/HorizontalCard/HorizontalCardBody.js.map +1 -0
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +49 -0
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -0
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.d.ts +5 -0
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +33 -0
- package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -0
- package/dist/Card/HorizontalCard/index.cjs +33 -0
- package/dist/Card/HorizontalCard/index.cjs.map +1 -0
- package/dist/Card/HorizontalCard/index.d.ts +2 -0
- package/dist/Card/HorizontalCard/index.js +3 -0
- package/dist/Card/HorizontalCard/index.js.map +1 -0
- package/dist/Card/HorizontalCard/types.cjs +6 -0
- package/dist/Card/HorizontalCard/types.cjs.map +1 -0
- package/dist/Card/HorizontalCard/types.d.ts +40 -0
- package/dist/Card/HorizontalCard/types.js +2 -0
- package/dist/Card/HorizontalCard/types.js.map +1 -0
- package/dist/Card/{Card.cjs → VerticalCard/Card.cjs} +33 -9
- package/dist/Card/VerticalCard/Card.cjs.map +1 -0
- package/dist/Card/{Card.d.ts → VerticalCard/Card.d.ts} +2 -1
- package/dist/Card/{Card.js → VerticalCard/Card.js} +30 -8
- package/dist/Card/VerticalCard/Card.js.map +1 -0
- package/dist/Card/{CardBottomSection.cjs → VerticalCard/CardBottomSection.cjs} +42 -25
- package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -0
- package/dist/Card/{CardBottomSection.d.ts → VerticalCard/CardBottomSection.d.ts} +4 -4
- package/dist/Card/{CardBottomSection.js → VerticalCard/CardBottomSection.js} +27 -11
- package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -0
- package/dist/Card/{CardMiddleSection.cjs → VerticalCard/CardMiddleSection.cjs} +14 -13
- package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -0
- package/dist/Card/{CardMiddleSection.d.ts → VerticalCard/CardMiddleSection.d.ts} +2 -2
- package/dist/Card/{CardMiddleSection.js → VerticalCard/CardMiddleSection.js} +3 -2
- package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -0
- package/dist/Card/{CardTopSection.cjs → VerticalCard/CardTopSection.cjs} +14 -12
- package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -0
- package/dist/Card/{CardTopSection.d.ts → VerticalCard/CardTopSection.d.ts} +5 -5
- package/dist/Card/{CardTopSection.js → VerticalCard/CardTopSection.js} +12 -10
- package/dist/Card/VerticalCard/CardTopSection.js.map +1 -0
- package/dist/Card/VerticalCard/index.cjs +88 -0
- package/dist/Card/VerticalCard/index.cjs.map +1 -0
- package/dist/Card/VerticalCard/index.d.ts +7 -0
- package/dist/Card/VerticalCard/index.js +8 -0
- package/dist/Card/VerticalCard/index.js.map +1 -0
- package/dist/Card/index.cjs +8 -64
- package/dist/Card/index.cjs.map +1 -1
- package/dist/Card/index.d.ts +2 -7
- package/dist/Card/index.js +2 -7
- package/dist/Card/index.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs +67 -57
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.d.ts +14 -7
- package/dist/Dropdown/BasicDropdown.js +67 -58
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/DropdownButton.cjs +3 -3
- package/dist/Dropdown/DropdownButton.cjs.map +1 -1
- package/dist/Dropdown/DropdownButton.d.ts +5 -1
- package/dist/Dropdown/DropdownButton.js +3 -4
- package/dist/Dropdown/DropdownButton.js.map +1 -1
- package/dist/GlobalNavigationBar/__tests__/GlobalNavigationBar.tests.d.ts +1 -0
- package/dist/GlobalNavigationBar/__tests__/Logo.tests.d.ts +1 -0
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +2 -8
- package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js +2 -2
- package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs +5 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs.map +1 -1
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.d.ts +2 -0
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js +2 -2
- package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +44 -38
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.d.ts +17 -20
- package/dist/InputFields/DatepickerField.js +33 -20
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/NumberField.cjs +63 -52
- package/dist/InputFields/NumberField.cjs.map +1 -1
- package/dist/InputFields/NumberField.d.ts +14 -19
- package/dist/InputFields/NumberField.js +60 -53
- package/dist/InputFields/NumberField.js.map +1 -1
- package/dist/InputFields/RadioButton.cjs +1 -1
- package/dist/InputFields/RadioButton.cjs.map +1 -1
- package/dist/InputFields/RadioButton.d.ts +1 -1
- package/dist/InputFields/RadioButton.js +1 -1
- package/dist/InputFields/RadioButton.js.map +1 -1
- package/dist/InputFields/TextField.cjs +5 -3
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +2 -1
- package/dist/InputFields/TextField.js +5 -4
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/index.cjs +26 -0
- package/dist/InputFields/index.cjs.map +1 -1
- package/dist/InputFields/index.d.ts +1 -0
- package/dist/InputFields/index.js +1 -0
- package/dist/InputFields/index.js.map +1 -1
- package/dist/MenuItem/MenuItem.cjs +5 -3
- package/dist/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/MenuItem/MenuItem.js +5 -3
- package/dist/MenuItem/MenuItem.js.map +1 -1
- package/dist/Popover/Popover.cjs +38 -24
- package/dist/Popover/Popover.cjs.map +1 -1
- package/dist/Popover/Popover.d.ts +1 -0
- package/dist/Popover/Popover.js +38 -24
- package/dist/Popover/Popover.js.map +1 -1
- package/dist/ProfileButton/ProfileButton.cjs +5 -3
- package/dist/ProfileButton/ProfileButton.cjs.map +1 -1
- package/dist/ProfileButton/ProfileButton.d.ts +3 -0
- package/dist/ProfileButton/ProfileButton.js +2 -2
- package/dist/ProfileButton/ProfileButton.js.map +1 -1
- package/dist/Toggles/ToggleButton.cjs +3 -2
- package/dist/Toggles/ToggleButton.cjs.map +1 -1
- package/dist/Toggles/ToggleButton.d.ts +1 -1
- package/dist/Toggles/ToggleButton.js +3 -2
- package/dist/Toggles/ToggleButton.js.map +1 -1
- package/dist/Toggles/ToggleSwitch.cjs +24 -17
- package/dist/Toggles/ToggleSwitch.cjs.map +1 -1
- package/dist/Toggles/ToggleSwitch.d.ts +5 -1
- package/dist/Toggles/ToggleSwitch.js +21 -12
- package/dist/Toggles/ToggleSwitch.js.map +1 -1
- package/dist/Toggles/TogglerTypes.d.ts +1 -1
- package/dist/common/ActionWithin.cjs.map +1 -1
- package/dist/common/ActionWithin.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/Card/Card.cjs.map +0 -1
- package/dist/Card/Card.js.map +0 -1
- package/dist/Card/CardBottomSection.cjs.map +0 -1
- package/dist/Card/CardBottomSection.js.map +0 -1
- package/dist/Card/CardMiddleSection.cjs.map +0 -1
- package/dist/Card/CardMiddleSection.js.map +0 -1
- package/dist/Card/CardTopSection.cjs.map +0 -1
- package/dist/Card/CardTopSection.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuContent.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","ParagraphSStyling","ParagraphTextStyle","ParagraphXSStyling","scrollBarStyling","Size","HyperLink","useMediaQuery","Button","useNavigationHelper","MenuItem","SystemIcons","useDimensionsRef","HeaderText","div","Bold","neutral_600","SMALL","HeaderNote","Regular","HeaderContainer","neutral_200","ScrollableContainer","Small","MenuItemsContainer","MenuSectionContainer","MenuSectionHeader","neutral_20","neutral_500","MenuSectionList","PinnedContainer","FooterText","FooterNote","FooterLink","FooterContainer","ActionContainer","Wrapper","MobileMenuContent","header","items","footer","action","onSubMenuOpen","isSmallScreen","query","replace","navigate","isActiveRoute","useState","scrollable","setScrollable","updateOnResize","scrollContainerRef","dimensions","node","useEffect","clientHeight","scrollHeight","renderItem","item","index","type","label","map","Medium","value","disabled","icon","displayLabel","noteLabel","note","e","nativeEvent","stopImmediatePropagation","external","to","exact","filter","a","pinned","some","link","id","target","onClick","href"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AASA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SACEC,WADF,EAEEC,MAFF,EAGEC,iBAHF,EAIEC,iBAJF,EAKEC,kBALF,EAMEC,kBANF,EAOEC,iBAPF,EAQEC,kBARF,EASEC,kBATF,EAUEC,gBAVF,QAWO,cAXP;AAYA,SAAQC,IAAR,QAAmB,aAAnB;AACA,SAAQC,SAAR,QAAwB,iBAAxB;AACA,SAAQC,aAAR,QAA4B,kBAA5B;AACA,SAAQC,MAAR,QAAqB,cAArB;AACA,SAAQC,mBAAR,QAAkC,qBAAlC;AACA,SAAQC,QAAR,QAAuB,gBAAvB;AACA,SAAQC,WAAR,QAA0B,aAA1B;AACA,SAAQC,gBAAR,QAA+B,OAA/B;;;AAGA,IAAMC,UAAU,GAAGnB,MAAM,CAACoB,GAAV,yGACZhB,iBAAiB,CAACC,kBAAkB,CAACgB,IAApB,EAA0BnB,MAAM,CAACoB,WAAjC,CADL,EAEZrB,WAAW,CAACsB,KAFA,EAGVpB,iBAAiB,CAACE,kBAAkB,CAACgB,IAApB,EAA0BnB,MAAM,CA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AAD;AAAA,+BACE,KAAC,SAAD;AAAW,UAAA,OAAO,EAAE,SAApB;AACW,UAAA,EAAE,EAAEzC,MAAM,CAACyC,IAAP,CAAYC,EAD3B;AAEW,UAAA,MAAM,EAAE1C,MAAM,CAACyC,IAAP,CAAYE,MAF/B;AAGW,UAAA,OAAO,EAAE3C,MAAM,CAACyC,IAAP,CAAYG,OAHhC;AAIW,UAAA,IAAI,EAAE5C,MAAM,CAACyC,IAAP,CAAYI,IAJ7B;AAAA,oBAKG7C,MAAM,CAACyC,IAAP,CAAYnB;AALf;AADF,QAJJ;AAAA,MAxBJ,EAyCIrB,MAAM,iBACN,KAAC,eAAD;AAAA,6BACE,KAAC,MAAD;AAAQ,QAAA,OAAO,EAAE,WAAjB;AACQ,QAAA,IAAI,EAAEE,aAAa,GAAGtC,IAAI,CAAC2D,MAAR,GAAiB3D,IAAI,CAACkB,KADjD;AAEQ,QAAA,QAAQ,EAAEkB,MAAM,CAACyB,QAFzB;AAGQ,QAAA,IAAI,EAAEzB,MAAM,CAAC0B,IAHrB;AAIQ,QAAA,OAAO,EAAE1B,MAAM,CAACA,MAJxB;AAAA,kBAKGA,MAAM,CAACqB;AALV;AADF,MA1CJ;AAAA,IADF;AAuDD,CA/HD;;;AAPEvB,EAAAA,K;AAIAG,EAAAA,a;;AAoIF,eAAeL,iBAAf","sourcesContent":["import React from 'react';\nimport {\n MenuButton,\n MenuGroupFooter,\n MenuGroupHeader,\n MenuNavigationItemTypeGroup,\n MenuNavigationItemTypeItem,\n MenuNavigationItemTypeSection\n} from '../types';\nimport styled from 'styled-components';\nimport {\n BREAKPOINTS,\n COLORS,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling,\n ParagraphSStyling,\n ParagraphTextStyle,\n ParagraphXSStyling,\n scrollBarStyling\n} from '../../styles';\nimport {Size} from '../../types';\nimport {HyperLink} from '../../HyperLink';\nimport {useMediaQuery} from 'react-responsive';\nimport {Button} from '../../Button';\nimport {useNavigationHelper} from '../NavigationHelper';\nimport {MenuItem} from '../../MenuItem';\nimport {SystemIcons} from '../../icons';\nimport {useDimensionsRef} from 'rooks';\n\n\nconst HeaderText = styled.div`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\nconst HeaderNote = styled.div`\n ${ParagraphXSStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}\n`;\nconst HeaderContainer = styled.div`\n margin: 0 24px;\n padding-bottom: 8px;\n box-sizing: border-box;\n border-bottom: 1px solid ${COLORS.neutral_200};\n display: flex;\n flex-direction: column;\n`;\n\n\nconst ScrollableContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n max-height: 100%;\n\n &.scrollable {\n margin-right: 6px;\n padding-right: 10px;\n }\n\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst MenuItemsContainer = styled.div`\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 8px;\n`;\n\nconst MenuSectionContainer = styled.div`\n padding-bottom: 8px;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n &.divider {\n border-top: 1px solid ${COLORS.neutral_200};\n }\n`;\n\nconst MenuSectionHeader = styled.div`\n display: flex;\n align-items: center;\n padding: 8px 16px 4px 16px;\n box-sizing: border-box;\n min-height: 32px;\n background-color: ${COLORS.neutral_20};\n\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_500)}\n`;\n\nconst MenuSectionList = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\n\nconst PinnedContainer = styled.div`\n border-top: 1px solid ${COLORS.neutral_200};\n`;\n\nconst FooterText = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\nconst FooterNote = styled.div`\n ${ParagraphXSStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ParagraphSStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}\n }\n`;\nconst FooterLink = styled.div`\n a {\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n }\n }\n`;\n\nconst FooterContainer = styled.div`\n padding: 8px 16px;\n box-sizing: border-box;\n border-top: 1px solid ${COLORS.neutral_200};\n display: flex;\n flex-direction: column;\n background: ${COLORS.neutral_20};\n\n ${BREAKPOINTS.SMALL} {\n padding: 16px;\n }\n`;\n\nconst ActionContainer = styled.div`\n padding: 8px 16px;\n box-sizing: border-box;\n border-top: 1px solid ${COLORS.neutral_200};\n display: flex;\n flex-direction: column;\n\n ${BREAKPOINTS.SMALL} {\n padding: 16px;\n }\n`;\n\nconst Wrapper = styled.div`\n width: 100%;\n box-sizing: border-box;\n flex-flow: column;\n display: flex;\n flex: 1;\n overflow: hidden;\n`;\n\ninterface MobileMenuContentProps {\n header?: MenuGroupHeader;\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection)[];\n footer?: MenuGroupFooter;\n action?: MenuButton;\n\n onSubMenuOpen?: (item: MenuNavigationItemTypeGroup) => void;\n}\n\nconst MobileMenuContent: React.FunctionComponent<MobileMenuContentProps> = ({\n header,\n items,\n footer,\n action,\n onSubMenuOpen\n }) => {\n\n const isSmallScreen = useMediaQuery({query: BREAKPOINTS.SMALL.replace('@media ', '')});\n\n const {navigate, isActiveRoute} = useNavigationHelper();\n\n const [scrollable, setScrollable] = React.useState(false);\n\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({updateOnResize: true});\n\n React.useEffect(() => {\n const clientHeight = node?.clientHeight ?? 0;\n const scrollHeight = node?.scrollHeight ?? 0;\n setScrollable(scrollHeight > clientHeight);\n }, [header, dimensions, node, footer, action, items]);\n\n const renderItem = (item: MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection, index: number) => {\n switch (item.type) {\n case 'section':\n return (\n <MenuSectionContainer key={index}>\n {item.label && <MenuSectionHeader>{item.label}</MenuSectionHeader>}\n <MenuSectionList>\n {item.items.map((item, index) => renderItem(item, index))}\n </MenuSectionList>\n </MenuSectionContainer>\n );\n case 'group':\n return <MenuItem key={index}\n id={'menu-item-' + index}\n size={isSmallScreen ? Size.Medium : Size.Small}\n active={false}\n item={{\n value: item.label,\n disabled: item.disabled,\n icon: item.icon,\n displayLabel: item.label,\n noteLabel: item.note,\n }}\n iconRight={<SystemIcons.ArrowDropRight/>}\n onClickHandler={(e) => {\n e.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item);\n }}/>\n case 'item':\n default:\n return (\n <MenuItem key={index}\n id={'menu-item-' + index}\n active={!item.external && isActiveRoute(item.to, !!item.exact)}\n size={isSmallScreen ? Size.Medium : Size.Small}\n item={{\n value: item.to,\n disabled: item.disabled,\n icon: item.icon,\n displayLabel: item.label,\n noteLabel: item.note,\n }}\n onClickHandler={() => {\n item.action && item.action();\n navigate(item.to, !!item.external);\n }}/>\n );\n }\n }\n\n return (\n <Wrapper>\n <ScrollableContainer ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\n {\n !!header &&\n <HeaderContainer>\n <HeaderText>{header.header}</HeaderText>\n {header.note && <HeaderNote>{header.note}</HeaderNote>}\n </HeaderContainer>\n }\n <MenuItemsContainer>\n {items?.filter(a => !a.pinned).map((item, index) => renderItem(item, index))}\n </MenuItemsContainer>\n </ScrollableContainer>\n {\n items?.some(a => a.pinned) &&\n <PinnedContainer>\n <MenuItemsContainer>\n {items?.filter(a => !!a.pinned).map((item, index) => renderItem(item, index))}\n </MenuItemsContainer>\n </PinnedContainer>\n\n }\n {\n footer &&\n <FooterContainer>\n <FooterText>{footer.header}</FooterText>\n {footer.note && <FooterNote>{footer.note}</FooterNote>}\n {footer.link &&\n <FooterLink>\n <HyperLink variant={'default'}\n id={footer.link.id}\n target={footer.link.target}\n onClick={footer.link.onClick}\n href={footer.link.href}>\n {footer.link.label}\n </HyperLink>\n </FooterLink>\n }\n </FooterContainer>\n }\n {\n action &&\n <ActionContainer>\n <Button variant={'secondary'}\n size={isSmallScreen ? Size.Medium : Size.Small}\n disabled={action.disabled}\n icon={action.icon}\n onClick={action.action}>\n {action.label}\n </Button>\n </ActionContainer>\n }\n </Wrapper>\n )\n};\n\nexport default MobileMenuContent;\n"],"file":"MobileMenuContent.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuContent.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","ParagraphSStyling","ParagraphTextStyle","ParagraphXSStyling","scrollBarStyling","Size","HyperLink","useMediaQuery","Button","useNavigationHelper","MenuItem","SystemIcons","useDimensionsRef","HeaderText","div","Bold","neutral_600","SMALL","HeaderNote","Regular","HeaderContainer","neutral_200","ScrollableContainer","Small","MenuItemsContainer","MenuSectionContainer","MenuSectionHeader","neutral_20","neutral_500","MenuSectionList","PinnedContainer","FooterText","FooterNote","FooterLink","FooterContainer","ActionContainer","Wrapper","MobileMenuContent","header","items","footer","action","onSubMenuOpen","isSmallScreen","query","replace","navigate","isActiveRoute","useState","scrollable","setScrollable","updateOnResize","scrollContainerRef","dimensions","node","useEffect","clientHeight","scrollHeight","renderItem","item","index","type","label","map","Medium","value","disabled","icon","displayLabel","noteLabel","note","e","nativeEvent","stopImmediatePropagation","external","to","exact","filter","a","pinned","some","link","id","target","onClick","href"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AASA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SACEC,WADF,EAEEC,MAFF,EAGEC,iBAHF,EAIEC,iBAJF,EAKEC,kBALF,EAMEC,kBANF,EAOEC,iBAPF,EAQEC,kBAR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kBAKGA,MAAM,CAACqB;AALV;AADF,MA1CJ;AAAA,IADF;AAuDD,CA/HD;;;AAPEvB,EAAAA,K;AAIAG,EAAAA,a;;AAoIF,eAAeL,iBAAf","sourcesContent":["import React from 'react';\nimport {\n MenuButton,\n MenuGroupFooter,\n MenuGroupHeader,\n MenuNavigationItemTypeGroup,\n MenuNavigationItemTypeItem,\n MenuNavigationItemTypeSection\n} from '../types';\nimport styled from 'styled-components';\nimport {\n BREAKPOINTS,\n COLORS,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling,\n ParagraphSStyling,\n ParagraphTextStyle,\n ParagraphXSStyling,\n scrollBarStyling\n} from '../../styles';\nimport {Size} from '../../types';\nimport {HyperLink} from '../../HyperLink';\nimport {useMediaQuery} from 'react-responsive';\nimport {Button} from '../../Button';\nimport {useNavigationHelper} from '../NavigationHelper';\nimport {MenuItem} from '../../MenuItem';\nimport {SystemIcons} from '../../icons';\nimport {useDimensionsRef} from 'rooks';\n\n\nconst HeaderText = styled.div`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\nconst HeaderNote = styled.div`\n ${ParagraphXSStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}\n`;\n\nconst HeaderContainer = styled.div`\n margin: 0 24px;\n padding-bottom: 8px;\n box-sizing: border-box;\n border-bottom: 1px solid ${COLORS.neutral_200};\n display: flex;\n flex-direction: column;\n`;\n\n\nconst ScrollableContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n max-height: 100%;\n\n &.scrollable {\n margin-right: 6px;\n padding-right: 10px;\n }\n\n ${scrollBarStyling(Size.Small)}\n`;\n\nconst MenuItemsContainer = styled.div`\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: 8px;\n`;\n\nconst MenuSectionContainer = styled.div`\n padding-bottom: 8px;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n &.divider {\n border-top: 1px solid ${COLORS.neutral_200};\n }\n`;\n\nconst MenuSectionHeader = styled.div`\n display: flex;\n align-items: center;\n padding: 8px 16px 4px 16px;\n box-sizing: border-box;\n min-height: 32px;\n background-color: ${COLORS.neutral_20};\n\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_500)}\n`;\n\nconst MenuSectionList = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\n\nconst PinnedContainer = styled.div`\n border-top: 1px solid ${COLORS.neutral_200};\n`;\n\nconst FooterText = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\nconst FooterNote = styled.div`\n ${ParagraphXSStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ParagraphSStyling(ParagraphTextStyle.Regular, COLORS.neutral_600)}\n }\n`;\nconst FooterLink = styled.div`\n a {\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n }\n }\n`;\n\nconst FooterContainer = styled.div`\n padding: 8px 16px;\n box-sizing: border-box;\n border-top: 1px solid ${COLORS.neutral_200};\n display: flex;\n flex-direction: column;\n background: ${COLORS.neutral_20};\n\n ${BREAKPOINTS.SMALL} {\n padding: 16px;\n }\n`;\n\nconst ActionContainer = styled.div`\n padding: 8px 16px;\n box-sizing: border-box;\n border-top: 1px solid ${COLORS.neutral_200};\n display: flex;\n flex-direction: column;\n\n ${BREAKPOINTS.SMALL} {\n padding: 16px;\n }\n`;\n\nconst Wrapper = styled.div`\n width: 100%;\n box-sizing: border-box;\n flex-flow: column;\n display: flex;\n flex: 1;\n overflow: hidden;\n`;\n\ninterface MobileMenuContentProps {\n header?: MenuGroupHeader;\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection)[];\n footer?: MenuGroupFooter;\n action?: MenuButton;\n\n onSubMenuOpen?: (item: MenuNavigationItemTypeGroup) => void;\n}\n\nconst MobileMenuContent: React.FunctionComponent<MobileMenuContentProps> = ({\n header,\n items,\n footer,\n action,\n onSubMenuOpen\n }) => {\n\n const isSmallScreen = useMediaQuery({query: BREAKPOINTS.SMALL.replace('@media ', '')});\n\n const {navigate, isActiveRoute} = useNavigationHelper();\n\n const [scrollable, setScrollable] = React.useState(false);\n\n const [scrollContainerRef, dimensions, node] = useDimensionsRef({updateOnResize: true});\n\n React.useEffect(() => {\n const clientHeight = node?.clientHeight ?? 0;\n const scrollHeight = node?.scrollHeight ?? 0;\n setScrollable(scrollHeight > clientHeight);\n }, [header, dimensions, node, footer, action, items]);\n\n const renderItem = (item: MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection, index: number) => {\n switch (item.type) {\n case 'section':\n return (\n <MenuSectionContainer key={index}>\n {item.label && <MenuSectionHeader>{item.label}</MenuSectionHeader>}\n <MenuSectionList>\n {item.items.map((item, index) => renderItem(item, index))}\n </MenuSectionList>\n </MenuSectionContainer>\n );\n case 'group':\n return <MenuItem key={index}\n id={'menu-item-' + index}\n size={isSmallScreen ? Size.Medium : Size.Small}\n active={false}\n item={{\n value: item.label,\n disabled: item.disabled,\n icon: item.icon,\n displayLabel: item.label,\n noteLabel: item.note,\n }}\n iconRight={<SystemIcons.ArrowDropRight/>}\n onClickHandler={(e) => {\n e.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item);\n }}/>\n case 'item':\n default:\n return (\n <MenuItem key={index}\n id={'menu-item-' + index}\n active={!item.external && isActiveRoute(item.to, !!item.exact)}\n size={isSmallScreen ? Size.Medium : Size.Small}\n item={{\n value: item.to,\n disabled: item.disabled,\n icon: item.icon,\n displayLabel: item.label,\n noteLabel: item.note,\n }}\n onClickHandler={() => {\n item.action && item.action();\n navigate(item.to, !!item.external);\n }}/>\n );\n }\n }\n\n return (\n <Wrapper>\n <ScrollableContainer ref={scrollContainerRef as any} className={scrollable ? 'scrollable' : ''}>\n {\n !!header &&\n <HeaderContainer>\n <HeaderText>{header.header}</HeaderText>\n {header.note && <HeaderNote>{header.note}</HeaderNote>}\n </HeaderContainer>\n }\n <MenuItemsContainer>\n {items?.filter(a => !a.pinned).map((item, index) => renderItem(item, index))}\n </MenuItemsContainer>\n </ScrollableContainer>\n {\n items?.some(a => a.pinned) &&\n <PinnedContainer>\n <MenuItemsContainer>\n {items?.filter(a => !!a.pinned).map((item, index) => renderItem(item, index))}\n </MenuItemsContainer>\n </PinnedContainer>\n\n }\n {\n footer &&\n <FooterContainer>\n <FooterText>{footer.header}</FooterText>\n {footer.note && <FooterNote>{footer.note}</FooterNote>}\n {footer.link &&\n <FooterLink>\n <HyperLink variant={'default'}\n id={footer.link.id}\n target={footer.link.target}\n onClick={footer.link.onClick}\n href={footer.link.href}>\n {footer.link.label}\n </HyperLink>\n </FooterLink>\n }\n </FooterContainer>\n }\n {\n action &&\n <ActionContainer>\n <Button variant={'secondary'}\n size={isSmallScreen ? Size.Medium : Size.Small}\n disabled={action.disabled}\n icon={action.icon}\n onClick={action.action}>\n {action.label}\n </Button>\n </ActionContainer>\n }\n </Wrapper>\n )\n};\n\nexport default MobileMenuContent;\n"],"file":"MobileMenuContent.js"}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = void 0;
|
|
8
|
+
exports.default = exports.MobileMenuHeaderWrapper = exports.MobileMenuHeaderActions = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -37,10 +37,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
37
37
|
|
|
38
38
|
var MobileMenuHeaderActions = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n"])));
|
|
39
39
|
|
|
40
|
+
exports.MobileMenuHeaderActions = MobileMenuHeaderActions;
|
|
41
|
+
|
|
40
42
|
var MobileMenuHeaderLabel = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", " {\n ", "\n }\n"])), (0, _styles.ComponentXSStyling)(_styles.ComponentTextStyle.Bold, _styles.COLORS.neutral_600), _styles.BREAKPOINTS.SMALL, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Bold, _styles.COLORS.neutral_600));
|
|
41
43
|
|
|
42
44
|
var MobileMenuHeaderWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ", " {\n padding: 4px 8px;\n }\n\n ", " {\n display: none;\n }\n"])), _breakpoints.default.SMALL, _breakpoints.default.MEDIUM);
|
|
43
45
|
|
|
46
|
+
exports.MobileMenuHeaderWrapper = MobileMenuHeaderWrapper;
|
|
47
|
+
|
|
44
48
|
var MobileMenuHeader = function MobileMenuHeader(_ref) {
|
|
45
49
|
var onGoBack = _ref.onGoBack,
|
|
46
50
|
onClose = _ref.onClose,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"names":["MobileMenuHeaderActions","styled","div","MobileMenuHeaderLabel","ComponentTextStyle","Bold","COLORS","neutral_600","BREAKPOINTS","SMALL","MobileMenuHeaderWrapper","Breakpoints","MEDIUM","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","placement","marginLeft"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,uBAAuB,GAAGC,0BAAOC,GAAV,yKAA7B;;AAMA,IAAMC,qBAAqB,GAAGF,0BAAOC,GAAV,yHACvB,gCAAmBE,2BAAmBC,IAAtC,EAA4CC,eAAOC,WAAnD,CADuB,EAEvBC,oBAAYC,KAFW,EAGrB,+BAAkBL,2BAAmBC,IAArC,EAA2CC,eAAOC,WAAlD,CAHqB,CAA3B;;AAOA,IAAMG,uBAAuB,GAAGT,0BAAOC,GAAV,0PAMzBS,qBAAYF,KANa,EAUzBE,qBAAYC,MAVa,CAA7B;;AA2BA,IAAMC,gBAAgE,GAAG,SAAnEA,gBAAmE,OAOO;AAAA,MANJC,QAMI,QANJA,QAMI;AAAA,MALJC,OAKI,QALJA,OAKI;AAAA,MAJJC,KAII,QAJJA,KAII;AAAA,MAHJC,OAGI,QAHJA,OAGI;AAAA,MAFJC,OAEI,QAFJA,OAEI;AAAA,MADJC,aACI,QADJA,aACI;;AAE9E,MAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB;AAAA;;AAAA,WAAM,CAAC,CAACH,OAAF,GAAY;AAC5CI,MAAAA,IAAI,EAAE,OADsC;AAE5CL,MAAAA,KAAK,EAAEC,OAAO,CAACD,KAF6B;AAG5CM,MAAAA,MAAM,EAAE;AACNA,QAAAA,MAAM,EAAEL,OAAO,CAACM,IAAR,CAAaC,SAAb,GAAyB,GAAzB,GAA+BP,OAAO,CAACM,IAAR,CAAaE,QAD9C;AAENC,QAAAA,IAAI,EAAET,OAAO,CAACM,IAAR,CAAaI,KAFb;AAGNC,QAAAA,IAAI,EAAEX,OAAO,CAACM,IAAR,CAAaK;AAHb,OAHoC;AAQ5CC,MAAAA,MAAM,EAAE;AACNb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ton,\n MenuIconSubMenuButton,\n MenuNavigationItemTypeGroup,\n MenuProfileButton, ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nconst MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nconst MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.MEDIUM} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile':\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}/>\n case 'submenu':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}>\n {item.icon}\n </IconButton>\n case 'action':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}>\n {item.icon}\n </IconButton>\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"file":"MobileMenuHeader.cjs"}
|
|
1
|
+
{"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"names":["MobileMenuHeaderActions","styled","div","MobileMenuHeaderLabel","ComponentTextStyle","Bold","COLORS","neutral_600","BREAKPOINTS","SMALL","MobileMenuHeaderWrapper","Breakpoints","MEDIUM","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","placement","marginLeft"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,IAAMA,uBAAuB,GAAGC,0BAAOC,GAAV,yKAA7B;;;;AAMP,IAAMC,qBAAqB,GAAGF,0BAAOC,GAAV,yHACvB,gCAAmBE,2BAAmBC,IAAtC,EAA4CC,eAAOC,WAAnD,CADuB,EAEvBC,oBAAYC,KAFW,EAGrB,+BAAkBL,2BAAmBC,IAArC,EAA2CC,eAAOC,WAAlD,CAHqB,CAA3B;;AAOO,IAAMG,uBAAuB,GAAGT,0BAAOC,GAAV,0PAMhCS,qBAAYF,KANoB,EAUhCE,qBAAYC,MAVoB,CAA7B;;;;AA2BP,IAAMC,gBAAgE,GAAG,SAAnEA,gBAAmE,OAOO;AAAA,MANJC,QAMI,QANJA,QAMI;AAAA,MALJC,OAKI,QALJA,OAKI;AAAA,MAJJC,KAII,QAJJA,KAII;AAAA,MAHJC,OAGI,QAHJA,OAGI;AAAA,MAFJC,OAEI,QAFJA,OAEI;AAAA,MADJC,aACI,QADJA,aACI;;AAE9E,MAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB;AAAA;;AAAA,WAAM,CAAC,CAACH,OAAF,GAAY;AAC5CI,MAAAA,IAAI,EAAE,OADsC;AAE5CL,MAAAA,KAAK,EAAEC,OAAO,CAACD,KAF6B;AAG5CM,MAAAA,MAAM,EAAE;AACNA,QAAAA,MAAM,EAAEL,OAAO,CAACM,IAAR,CAAaC,SAAb,GAAyB,GAAzB,GAA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IADF;AA0CD,CAvGD;;;AAXED,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,K;AAGAE,EAAAA,O;AAEAC,EAAAA,a;;eA8GaN,gB","sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.MEDIUM} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile':\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}/>\n case 'submenu':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}>\n {item.icon}\n </IconButton>\n case 'action':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}>\n {item.icon}\n </IconButton>\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"file":"MobileMenuHeader.cjs"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MobileMenuButtonTypes, MenuNavigationItemTypeGroup, ProfileMenu, MenuNavigationCustomSubMenu } from '../types';
|
|
3
|
+
export declare const MobileMenuHeaderActions: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const MobileMenuHeaderWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
5
|
interface MobileMenuHeaderProps {
|
|
4
6
|
onGoBack?: () => void;
|
|
5
7
|
onClose: () => void;
|
|
@@ -17,9 +17,9 @@ import { BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXS
|
|
|
17
17
|
import { ProfileButton } from '../../ProfileButton';
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
var MobileMenuHeaderActions = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n"])));
|
|
20
|
+
export var MobileMenuHeaderActions = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n"])));
|
|
21
21
|
var MobileMenuHeaderLabel = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", " {\n ", "\n }\n"])), ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600), BREAKPOINTS.SMALL, ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600));
|
|
22
|
-
var MobileMenuHeaderWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ", " {\n padding: 4px 8px;\n }\n\n ", " {\n display: none;\n }\n"])), Breakpoints.SMALL, Breakpoints.MEDIUM);
|
|
22
|
+
export var MobileMenuHeaderWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ", " {\n padding: 4px 8px;\n }\n\n ", " {\n display: none;\n }\n"])), Breakpoints.SMALL, Breakpoints.MEDIUM);
|
|
23
23
|
|
|
24
24
|
var MobileMenuHeader = function MobileMenuHeader(_ref) {
|
|
25
25
|
var onGoBack = _ref.onGoBack,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"names":["React","styled","Breakpoints","IconButton","SystemIcons","BREAKPOINTS","COLORS","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","ProfileButton","MobileMenuHeaderActions","div","MobileMenuHeaderLabel","Bold","neutral_600","SMALL","MobileMenuHeaderWrapper","MEDIUM","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","placement","marginLeft"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAP,MAAyC,OAAzC;AAQA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,WAAP,MAAwB,0BAAxB;AACA,SAAQC,UAAR,QAAyB,cAAzB;AACA,SAAQC,WAAR,QAA0B,aAA1B;AACA,SAAQC,WAAR,EAAqBC,MAArB,EAA6BC,iBAA7B,EAAgDC,kBAAhD,EAAoEC,kBAApE,QAA6F,cAA7F;AACA,SAAQC,aAAR,QAA4B,qBAA5B;;;AAEA,IAAMC,uBAAuB,GAAGV,MAAM,CAACW,GAAV,2JAA7B;AAMA,IAAMC,qBAAqB,GAAGZ,MAAM,CAACW,GAAV,2GACvBH,kBAAkB,CAACD,kBAAkB,CAACM,IAApB,EAA0BR,MAAM,CAACS,WAAjC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AjB,EAA6Cb,GAA7C,CAAiDG,UAAjD,CAbJ,EAgBItB,KAAK,iBACL,KAAC,qBAAD;AAAA,gBAAwBA;AAAxB,MAjBJ,eAmBE,MAAC,uBAAD;AAAA,iBAEIE,OAFJ,aAEIA,OAFJ,uBAEIA,OAAO,CAAE6B,MAAT,CAAgB,UAAAX,CAAC;AAAA,eAAIA,CAAC,CAACY,SAAF,KAAgB,MAApB;AAAA,OAAjB,EAA6Cb,GAA7C,CAAiDG,UAAjD,CAFJ,EAMIvB,OAAO,iBACP;AAAK,QAAA,KAAK,EAAE;AAACkC,UAAAA,UAAU,EAAE;AAAb,SAAZ;AAAA,+BACE,KAAC,UAAD;AAAY,UAAA,OAAO,EAAE,WAArB;AACY,UAAA,MAAM,EAAE,gBAAAR,CAAC,EAAI;AACXA,YAAAA,CAAC,SAAD,IAAAA,CAAC,WAAD,YAAAA,CAAC,CAAEC,WAAH,CAAeC,wBAAf;AACA5B,YAAAA,OAAO;AACR,WAJb;AAKY,UAAA,KAAK,EAAE,UALnB;AAAA,iCAME,KAAC,WAAD,CAAa,KAAb;AANF;AADF,QAPJ;AAAA,MAnBF;AAAA,IADF;AA0CD,CAxGD;;;AAXED,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,K;AAGAE,EAAAA,O;AAEAC,EAAAA,a;;AA+GF,eAAeN,gBAAf","sourcesContent":["import React, {useImperativeHandle} from 'react';\nimport {\n MenuAccountInfo, MobileMenuButtonTypes,\n MenuIconButton,\n MenuIconSubMenuButton,\n MenuNavigationItemTypeGroup,\n MenuProfileButton, ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nconst MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nconst MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.MEDIUM} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile':\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}/>\n case 'submenu':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}>\n {item.icon}\n </IconButton>\n case 'action':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}>\n {item.icon}\n </IconButton>\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"file":"MobileMenuHeader.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"names":["React","styled","Breakpoints","IconButton","SystemIcons","BREAKPOINTS","COLORS","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","ProfileButton","MobileMenuHeaderActions","div","MobileMenuHeaderLabel","Bold","neutral_600","SMALL","MobileMenuHeaderWrapper","MEDIUM","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","e","nativeEvent","stopImmediatePropagation","target","charAt","menu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AA,IADF;AA0CD,CAvGD;;;AAXED,EAAAA,Q;AACAC,EAAAA,O;AACAC,EAAAA,K;AAGAE,EAAAA,O;AAEAC,EAAAA,a;;AA8GF,eAAeN,gBAAf","sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.MEDIUM} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile':\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}/>\n case 'submenu':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}>\n {item.icon}\n </IconButton>\n case 'action':\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}>\n {item.icon}\n </IconButton>\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"file":"MobileMenuHeader.js"}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -13,11 +11,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
11
|
|
|
14
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
13
|
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
16
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
17
|
|
|
18
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
21
|
|
|
22
22
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
23
23
|
|
|
@@ -39,21 +39,15 @@ var _styling = require("./styling");
|
|
|
39
39
|
|
|
40
40
|
require("react-datepicker/dist/react-datepicker.css");
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
var _zIndexes = require("../styles/z-indexes");
|
|
45
|
-
|
|
46
|
-
var _FocusVisible = require("../common/FocusVisible");
|
|
42
|
+
var _common = require("../common");
|
|
47
43
|
|
|
48
44
|
var _types = require("../types");
|
|
49
45
|
|
|
50
46
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
51
47
|
|
|
52
|
-
var
|
|
48
|
+
var _excluded = ["disabled", "readOnly", "onChange", "invalid", "value", "validationMessage", "dateFormat", "autoComplete", "placeholder", "required", "yearPicker", "yearsBeforeCurrentDate", "yearsAfterCurrentDate", "margin", "onBlur"];
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
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; }
|
|
50
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
57
51
|
|
|
58
52
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
59
53
|
|
|
@@ -62,21 +56,20 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
62
56
|
/**
|
|
63
57
|
* Add custom styles.
|
|
64
58
|
*/
|
|
65
|
-
var DatePickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .react-datepicker-popper {\n z-index: ", ";\n }\n\n > div {\n display: block;\n\n ", "\n .react-datepicker {\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\n border: 1px solid #e5e5e5;\n }\n\n .react-datepicker__navigation {\n line-height: normal;\n text-indent: inherit;\n border: none;\n border-radius: 4px;\n height: 32px;\n width: 32px;\n outline: none;\n margin: 0px;\n color: transparent;\n\n &:hover {\n background: ", ";\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n }\n\n &:focus {\n ", "\n
|
|
59
|
+
var DatePickerContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .react-datepicker-popper {\n z-index: ", ";\n }\n\n > div {\n display: block;\n\n ", "\n .react-datepicker {\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\n border: 1px solid #e5e5e5;\n }\n\n .react-datepicker__navigation {\n line-height: normal;\n text-indent: inherit;\n border: none;\n border-radius: 4px;\n height: 32px;\n width: 32px;\n outline: none;\n margin: 0px;\n color: transparent;\n\n &:hover {\n background: ", ";\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n }\n\n &:focus {\n ", "\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n }\n\n &::before {\n text-align: center;\n display: inline-block;\n content: '';\n height: 32px;\n width: 32px;\n vertical-align: middle;\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n }\n\n .react-datepicker__month-container,\n .react-datepicker__year--container {\n width: 336px;\n }\n\n .react-datepicker__month {\n margin: 0px;\n }\n\n .react-datepicker__triangle {\n left: 50% !important;\n display: none;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] {\n margin-top: 0;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] .react-datepicker__triangle {\n border-bottom-color: ", ";\n }\n\n .react-datepicker__header {\n border-bottom: 1px solid ", ";\n background: ", ";\n height: ", ";\n padding-top: 0px;\n }\n\n .react-datepicker__current-month {\n height: 48px;\n display: inline-flex;\n align-items: center;\n margin-right: 5px;\n\n ", "\n }\n\n .react-datepicker__year {\n max-height: 300px;\n overflow-y: scroll;\n\n ", "\n }\n\n .react-datepicker__year-wrapper {\n max-width: 100%;\n justify-content: space-around;\n }\n\n .react-datepicker__day-name {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 48px;\n margin: 0px;\n width: 48px;\n\n ", "\n }\n\n .react-datepicker__year-text {\n background: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-top: 20px;\n padding-top: 10px;\n padding-bottom: 10px;\n\n ", "\n &.react-datepicker__year-text--disabled {\n display: none;\n }\n\n &.react-datepicker__day--keyboard-selected {\n color: ", ";\n background: ", ";\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:focus {\n ", "\n }\n\n &.react-datepicker__year-text--selected {\n color: ", " !important;\n background: ", " !important;\n }\n }\n\n .react-datepicker__day {\n background: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n width: 40px;\n margin: 4px;\n\n ", "\n &.react-datepicker__day--keyboard-selected {\n color: ", ";\n background: ", ";\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:focus {\n ", "\n }\n\n &.react-datepicker__day--selected {\n color: ", " !important;\n background: ", " !important;\n }\n\n &.react-datepicker__day--today {\n border-radius: 0.3rem;\n color: ", ";\n background: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:focus {\n ", "\n }\n }\n }\n }\n"])), _styles.Z_INDEXES.dropdown, function (props) {
|
|
66
60
|
return props.margin ? "margin: ".concat(props.margin, ";") : '';
|
|
67
61
|
}, _colors.default.primary_20, _styles.focusStyles, _colors.default.neutral_20, _colors.default.neutral_200, _colors.default.neutral_20, function (props) {
|
|
68
62
|
return !props.yearPicker ? '96px' : '54px';
|
|
69
|
-
}, (0,
|
|
63
|
+
}, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Bold, _colors.default.neutral_600), (0, _styles.scrollBarStyling)(_types.Size.Small), (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _colors.default.neutral_600), _colors.default.white, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _colors.default.neutral_600), _colors.default.neutral_600, _colors.default.white, _colors.default.primary_700, _colors.default.primary_20, _styles.focusStyles, _colors.default.white, _colors.default.primary_500, _colors.default.white, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _colors.default.neutral_600), _colors.default.neutral_600, _colors.default.white, _colors.default.primary_700, _colors.default.primary_20, _styles.focusStyles, _colors.default.white, _colors.default.primary_500, _colors.default.neutral_700, _colors.default.neutral_100, _colors.default.primary_700, _colors.default.primary_20, _styles.focusStyles);
|
|
70
64
|
|
|
71
|
-
var IconWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n pointer-events: none;\n position: absolute;\n right: 16px;\n width: 24px;\n height: 24px;\n z-index: ", ";\n color: ", ";\n"])),
|
|
65
|
+
var IconWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n pointer-events: none;\n position: absolute;\n right: 16px;\n width: 24px;\n height: 24px;\n z-index: ", ";\n color: ", ";\n"])), _styles.Z_INDEXES.focus + 1, _colors.default.neutral_600);
|
|
72
66
|
|
|
73
67
|
var DatepickerRow = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n"])));
|
|
74
68
|
|
|
75
69
|
var StyledInputFieldStyling = (0, _styledComponents.default)(_styling.InputFieldStyling)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n &::placeholder {\n color: ", ";\n }\n\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ", ";\n\n ::placeholder {\n color: ", ";\n }\n\n cursor: pointer;\n background-color: ", ";\n color: ", ";\n }\n\n &:active,\n &.open {\n box-shadow: inset 0px 0px 0px 2px ", ";\n background-color: ", ";\n color: ", ";\n\n ::placeholder {\n color: ", ";\n }\n }\n\n &:disabled {\n background-color: ", ";\n }\n\n &:hover ~ ", " {\n color: ", ";\n }\n\n &:active ~ ", ", &.open ~ ", " {\n color: ", ";\n }\n\n &:disabled ~ ", ", &:read-only ~ ", " {\n color: ", ";\n }\n"])), _colors.default.neutral_500, _colors.default.primary_300, _colors.default.primary_200, _colors.default.primary_700, _colors.default.primary_20, _colors.default.primary_700, _colors.default.primary_300, _colors.default.primary_100, _colors.default.primary_800, _colors.default.primary_800, _colors.default.white, IconWrapper, _colors.default.primary_700, IconWrapper, IconWrapper, _colors.default.primary_800, IconWrapper, IconWrapper, _colors.default.neutral_300);
|
|
76
70
|
|
|
77
|
-
var DatepickerField = function
|
|
78
|
-
var
|
|
79
|
-
disabled = _ref.disabled,
|
|
71
|
+
var DatepickerField = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
72
|
+
var disabled = _ref.disabled,
|
|
80
73
|
readOnly = _ref.readOnly,
|
|
81
74
|
_onChange = _ref.onChange,
|
|
82
75
|
invalid = _ref.invalid,
|
|
@@ -89,29 +82,32 @@ var DatepickerField = function DatepickerField(_ref) {
|
|
|
89
82
|
yearPicker = _ref.yearPicker,
|
|
90
83
|
yearsBeforeCurrentDate = _ref.yearsBeforeCurrentDate,
|
|
91
84
|
yearsAfterCurrentDate = _ref.yearsAfterCurrentDate,
|
|
92
|
-
margin = _ref.margin
|
|
85
|
+
margin = _ref.margin,
|
|
86
|
+
onBlur = _ref.onBlur,
|
|
87
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
93
88
|
// Globally used variables within the component
|
|
94
|
-
var inputRef = (0,
|
|
95
|
-
var datepickerRef = React.useRef(null);
|
|
89
|
+
var inputRef = (0, _common.useFocusVisibleRef)();
|
|
96
90
|
|
|
97
|
-
var
|
|
91
|
+
var datepickerRef = _react.default.useRef(null);
|
|
92
|
+
|
|
93
|
+
var _React$useState = _react.default.useState(-1),
|
|
98
94
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
99
95
|
activeMonthPage = _React$useState2[0],
|
|
100
96
|
setActiveMonthPage = _React$useState2[1];
|
|
101
97
|
|
|
102
|
-
var _React$useState3 =
|
|
98
|
+
var _React$useState3 = _react.default.useState(false),
|
|
103
99
|
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
104
100
|
yearPickerMode = _React$useState4[0],
|
|
105
101
|
setYearPickerMode = _React$useState4[1];
|
|
106
102
|
|
|
107
|
-
var _React$useState5 =
|
|
103
|
+
var _React$useState5 = _react.default.useState(null),
|
|
108
104
|
_React$useState6 = (0, _slicedToArray2.default)(_React$useState5, 2),
|
|
109
105
|
openAt = _React$useState6[0],
|
|
110
106
|
setOpenAt = _React$useState6[1]; // 'open' flag is used only for tracking current state of the dropdown,
|
|
111
107
|
// for explicitly opening/closing the picker we are using 'datepickerRef.current.setOpen'
|
|
112
108
|
|
|
113
109
|
|
|
114
|
-
var _React$useState7 =
|
|
110
|
+
var _React$useState7 = _react.default.useState(false),
|
|
115
111
|
_React$useState8 = (0, _slicedToArray2.default)(_React$useState7, 2),
|
|
116
112
|
open = _React$useState8[0],
|
|
117
113
|
setOpen = _React$useState8[1];
|
|
@@ -120,10 +116,11 @@ var DatepickerField = function DatepickerField(_ref) {
|
|
|
120
116
|
*/
|
|
121
117
|
|
|
122
118
|
|
|
123
|
-
|
|
119
|
+
_react.default.useEffect(function () {
|
|
124
120
|
if (value) inputRef.current.value = (0, _moment.default)(value).format(dateFormat ? dateFormat : 'MMMM Do, YYYY');
|
|
125
121
|
}, [value]);
|
|
126
|
-
|
|
122
|
+
|
|
123
|
+
_react.default.useEffect(function () {
|
|
127
124
|
if (yearPickerMode) {
|
|
128
125
|
var _selectedDate$parentE;
|
|
129
126
|
|
|
@@ -136,12 +133,17 @@ var DatepickerField = function DatepickerField(_ref) {
|
|
|
136
133
|
}, [yearPickerMode]); //we have to manually reopen the calendar when needed, to guarantee that datepicker will show selected date after year selection
|
|
137
134
|
//otherwise after year selection datepicker will show January month of the selected year
|
|
138
135
|
|
|
139
|
-
|
|
136
|
+
|
|
137
|
+
_react.default.useEffect(function () {
|
|
140
138
|
if (openAt) {
|
|
141
139
|
datepickerRef.current.setOpen(true); //setOpenAt(null);
|
|
142
140
|
}
|
|
143
141
|
}, [openAt]);
|
|
144
142
|
|
|
143
|
+
_react.default.useImperativeHandle(ref, function () {
|
|
144
|
+
return inputRef.current;
|
|
145
|
+
}, [inputRef]);
|
|
146
|
+
|
|
145
147
|
var handleCalendarClose = function handleCalendarClose() {
|
|
146
148
|
var _inputRef$current;
|
|
147
149
|
|
|
@@ -165,10 +167,18 @@ var DatepickerField = function DatepickerField(_ref) {
|
|
|
165
167
|
if (e.key === 'Escape' || e.key === 'Esc') datepickerRef.current.setOpen(false);
|
|
166
168
|
};
|
|
167
169
|
|
|
170
|
+
var handleBlur = function handleBlur(e) {
|
|
171
|
+
// @ts-ignore
|
|
172
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
173
|
+
onBlur && onBlur(e);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
168
177
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
169
178
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(DatePickerContainer, {
|
|
170
179
|
yearPicker: yearPickerMode,
|
|
171
180
|
margin: margin || '',
|
|
181
|
+
onBlur: handleBlur,
|
|
172
182
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactDatepicker.default, {
|
|
173
183
|
ref: datepickerRef,
|
|
174
184
|
onCalendarOpen: handleCalendarOpen,
|
|
@@ -200,7 +210,7 @@ var DatepickerField = function DatepickerField(_ref) {
|
|
|
200
210
|
preventOpenOnFocus: true,
|
|
201
211
|
shouldCloseOnSelect: true,
|
|
202
212
|
renderCustomHeader: yearPicker ? function (params) {
|
|
203
|
-
return /*#__PURE__*/
|
|
213
|
+
return /*#__PURE__*/_react.default.createElement(_DatepickerFieldHeader.DatepickerFieldHeader, _objectSpread(_objectSpread({}, params), {}, {
|
|
204
214
|
setActiveMonthPage: setActiveMonthPage,
|
|
205
215
|
customHeaderCount: 0,
|
|
206
216
|
yearPickerMode: yearPickerMode,
|
|
@@ -216,8 +226,7 @@ var DatepickerField = function DatepickerField(_ref) {
|
|
|
216
226
|
margin: '4px 0px'
|
|
217
227
|
},
|
|
218
228
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(DatepickerRow, {
|
|
219
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInputFieldStyling, {
|
|
220
|
-
id: id,
|
|
229
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledInputFieldStyling, _objectSpread({
|
|
221
230
|
ref: inputRef,
|
|
222
231
|
type: "text",
|
|
223
232
|
name: "datepicker",
|
|
@@ -237,7 +246,7 @@ var DatepickerField = function DatepickerField(_ref) {
|
|
|
237
246
|
readOnly: true,
|
|
238
247
|
suppressReadOnlyStyles: !readOnly,
|
|
239
248
|
required: required
|
|
240
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconWrapper, {
|
|
249
|
+
}, rest)), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconWrapper, {
|
|
241
250
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SystemIcons.Calendar, {
|
|
242
251
|
size: "24"
|
|
243
252
|
})
|
|
@@ -254,20 +263,17 @@ var DatepickerField = function DatepickerField(_ref) {
|
|
|
254
263
|
})]
|
|
255
264
|
})]
|
|
256
265
|
});
|
|
257
|
-
};
|
|
266
|
+
});
|
|
258
267
|
|
|
259
268
|
DatepickerField.propTypes = {
|
|
260
|
-
|
|
261
|
-
disabled: _propTypes.default.bool,
|
|
262
|
-
readOnly: _propTypes.default.bool,
|
|
269
|
+
value: _propTypes.default.instanceOf(Date),
|
|
263
270
|
onChange: _propTypes.default.func,
|
|
271
|
+
onBlur: _propTypes.default.func,
|
|
264
272
|
invalid: _propTypes.default.bool,
|
|
265
|
-
value: _propTypes.default.instanceOf(Date),
|
|
266
273
|
dateFormat: _propTypes.default.string,
|
|
267
274
|
validationMessage: _propTypes.default.string,
|
|
268
275
|
autoComplete: _propTypes.default.string,
|
|
269
276
|
placeholder: _propTypes.default.string,
|
|
270
|
-
required: _propTypes.default.bool,
|
|
271
277
|
yearPicker: _propTypes.default.bool,
|
|
272
278
|
yearsBeforeCurrentDate: _propTypes.default.number,
|
|
273
279
|
yearsAfterCurrentDate: _propTypes.default.number,
|