@worksafevictoria/wcl7.5 1.0.0
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/.editorconfig +13 -0
- package/.env +4 -0
- package/.eslintrc.cjs +10 -0
- package/.eslintrc.js +25 -0
- package/.husky/commit-msg +4 -0
- package/.prettierrc +5 -0
- package/.prettierrc.json +8 -0
- package/.storybook/main.js +18 -0
- package/.storybook/preview.js +34 -0
- package/LICENSE +21 -0
- package/README.md +159 -0
- package/babel.config.js +8 -0
- package/bin/clean.sh +52 -0
- package/bin/deploy.sh +25 -0
- package/ci/build/Build_Validation.md +35 -0
- package/ci/build/build_validation.yml +47 -0
- package/ci/release/Release_Beta.md +39 -0
- package/ci/release/Release_Master.md +29 -0
- package/ci/release/beta.yml +69 -0
- package/ci/release/master.yml +39 -0
- package/commitlint.config.js +1 -0
- package/index.html +13 -0
- package/jest.config.js +21 -0
- package/lib/detect-browser.js +33 -0
- package/lib/utility.js +59 -0
- package/lib/utility.test.js +15 -0
- package/package.json +93 -0
- package/public/favicon.ico +0 -0
- package/src/assets/base.css +86 -0
- package/src/assets/fonts/VIC-Bold.eot +0 -0
- package/src/assets/fonts/VIC-Bold.ttf +0 -0
- package/src/assets/fonts/VIC-Bold.woff +0 -0
- package/src/assets/fonts/VIC-Bold.woff2 +0 -0
- package/src/assets/fonts/VIC-BoldItalic.eot +0 -0
- package/src/assets/fonts/VIC-BoldItalic.ttf +0 -0
- package/src/assets/fonts/VIC-BoldItalic.woff +0 -0
- package/src/assets/fonts/VIC-BoldItalic.woff2 +0 -0
- package/src/assets/fonts/VIC-ExtraLight.eot +0 -0
- package/src/assets/fonts/VIC-ExtraLight.ttf +0 -0
- package/src/assets/fonts/VIC-ExtraLight.woff +0 -0
- package/src/assets/fonts/VIC-ExtraLight.woff2 +0 -0
- package/src/assets/fonts/VIC-ExtraLightItalic.eot +0 -0
- package/src/assets/fonts/VIC-ExtraLightItalic.ttf +0 -0
- package/src/assets/fonts/VIC-ExtraLightItalic.woff +0 -0
- package/src/assets/fonts/VIC-ExtraLightItalic.woff2 +0 -0
- package/src/assets/fonts/VIC-Italic.eot +0 -0
- package/src/assets/fonts/VIC-Italic.ttf +0 -0
- package/src/assets/fonts/VIC-Italic.woff +0 -0
- package/src/assets/fonts/VIC-Italic.woff2 +0 -0
- package/src/assets/fonts/VIC-Light.eot +0 -0
- package/src/assets/fonts/VIC-Light.ttf +0 -0
- package/src/assets/fonts/VIC-Light.woff +0 -0
- package/src/assets/fonts/VIC-Light.woff2 +0 -0
- package/src/assets/fonts/VIC-LightItalic.eot +0 -0
- package/src/assets/fonts/VIC-LightItalic.ttf +0 -0
- package/src/assets/fonts/VIC-LightItalic.woff +0 -0
- package/src/assets/fonts/VIC-LightItalic.woff2 +0 -0
- package/src/assets/fonts/VIC-Medium.eot +0 -0
- package/src/assets/fonts/VIC-Medium.ttf +0 -0
- package/src/assets/fonts/VIC-Medium.woff +0 -0
- package/src/assets/fonts/VIC-Medium.woff2 +0 -0
- package/src/assets/fonts/VIC-MediumItalic.eot +0 -0
- package/src/assets/fonts/VIC-MediumItalic.ttf +0 -0
- package/src/assets/fonts/VIC-MediumItalic.woff +0 -0
- package/src/assets/fonts/VIC-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/VIC-Regular.eot +0 -0
- package/src/assets/fonts/VIC-Regular.ttf +0 -0
- package/src/assets/fonts/VIC-Regular.woff +0 -0
- package/src/assets/fonts/VIC-Regular.woff2 +0 -0
- package/src/assets/fonts/VIC-SemiBold.eot +0 -0
- package/src/assets/fonts/VIC-SemiBold.ttf +0 -0
- package/src/assets/fonts/VIC-SemiBold.woff +0 -0
- package/src/assets/fonts/VIC-SemiBold.woff2 +0 -0
- package/src/assets/fonts/VIC-SemiBoldItalic.eot +0 -0
- package/src/assets/fonts/VIC-SemiBoldItalic.ttf +0 -0
- package/src/assets/fonts/VIC-SemiBoldItalic.woff +0 -0
- package/src/assets/fonts/VIC-SemiBoldItalic.woff2 +0 -0
- package/src/assets/icons/AppFooter/australian-aboriginal-flag.svg +7 -0
- package/src/assets/icons/AppFooter/facebook-ws-footer.svg +58 -0
- package/src/assets/icons/AppFooter/facebook-ww-footer.svg +59 -0
- package/src/assets/icons/AppFooter/instagram-ww-footer.svg +70 -0
- package/src/assets/icons/AppFooter/linkedin-ws-footer.svg +59 -0
- package/src/assets/icons/AppFooter/linkedin-ww-footer.svg +60 -0
- package/src/assets/icons/AppFooter/logo-workwell-reversed.svg +45 -0
- package/src/assets/icons/AppFooter/pride-flag.svg +12 -0
- package/src/assets/icons/AppFooter/torres-strait-islanders-flag.svg +9 -0
- package/src/assets/icons/AppFooter/twitter-ws-footer.svg +58 -0
- package/src/assets/icons/AppFooter/twitter-ww-footer.svg +59 -0
- package/src/assets/icons/AppFooter/worksafe-footer-logo.svg +9 -0
- package/src/assets/icons/AppFooter/youtube-ws-footer.svg +55 -0
- package/src/assets/icons/AppFooter/youtube-ww-footer.svg +56 -0
- package/src/assets/icons/AppHeader/chev-down-16.svg +17 -0
- package/src/assets/icons/AppHeader/chev-left-24px.svg +13 -0
- package/src/assets/icons/AppHeader/chev-right-16px.svg +25 -0
- package/src/assets/icons/AppHeader/chev-right-24px.svg +13 -0
- package/src/assets/icons/AppHeader/close-32px.svg +15 -0
- package/src/assets/icons/AppHeader/menu-32px.svg +20 -0
- package/src/assets/icons/AppHeader/search-32px.svg +19 -0
- package/src/assets/icons/Email-circle-black.svg +4 -0
- package/src/assets/icons/Info-circle-fill.svg +10 -0
- package/src/assets/icons/Phone-circle-black.svg +4 -0
- package/src/assets/icons/SocialShare/bookmark-white.svg +3 -0
- package/src/assets/icons/SocialShare/bookmark-ww-footer.svg +57 -0
- package/src/assets/icons/SocialShare/bookmark.svg +56 -0
- package/src/assets/icons/SocialShare/email-white.svg +3 -0
- package/src/assets/icons/SocialShare/facebook-white.svg +3 -0
- package/src/assets/icons/SocialShare/facebook-ws-footer.svg +58 -0
- package/src/assets/icons/SocialShare/facebook-ww-footer.svg +59 -0
- package/src/assets/icons/SocialShare/facebook.svg +1 -0
- package/src/assets/icons/SocialShare/office-file-pdf.svg +1 -0
- package/src/assets/icons/SocialShare/print.svg +3 -0
- package/src/assets/icons/SocialShare/twitter-white.svg +3 -0
- package/src/assets/icons/SocialShare/twitter-ws-footer.svg +58 -0
- package/src/assets/icons/SocialShare/twitter-ww-footer.svg +59 -0
- package/src/assets/icons/SocialShare/twitter.svg +1 -0
- package/src/assets/icons/Strip/AlertDismiss.svg +4 -0
- package/src/assets/icons/Strip/Arrow right.svg +4 -0
- package/src/assets/icons/Strip/Chevron right.svg +3 -0
- package/src/assets/icons/Strip/Dismiss.svg +4 -0
- package/src/assets/icons/Strip/Exclamation triangle fill.svg +8 -0
- package/src/assets/icons/Strip/Info circle fill.svg +15 -0
- package/src/assets/icons/Strip/Information.svg +15 -0
- package/src/assets/icons/Strip/Warning.svg +8 -0
- package/src/assets/icons/arrow-left.svg +9 -0
- package/src/assets/icons/arrow-right.svg +9 -0
- package/src/assets/icons/bookmark.svg +56 -0
- package/src/assets/icons/brand-VicStateGov-logo-reversed.svg +72 -0
- package/src/assets/icons/bullet-empty.svg +3 -0
- package/src/assets/icons/bullet.svg +3 -0
- package/src/assets/icons/caret-down.svg +1 -0
- package/src/assets/icons/caret-left.svg +9 -0
- package/src/assets/icons/caret-right.svg +9 -0
- package/src/assets/icons/caret-up.svg +1 -0
- package/src/assets/icons/chev-down-white.svg +3 -0
- package/src/assets/icons/chev-down.svg +3 -0
- package/src/assets/icons/chev-left.svg +3 -0
- package/src/assets/icons/chev-right.svg +3 -0
- package/src/assets/icons/chev-up.svg +3 -0
- package/src/assets/icons/clock.svg +3 -0
- package/src/assets/icons/close.svg +1 -0
- package/src/assets/icons/cross.svg +3 -0
- package/src/assets/icons/document.svg +1 -0
- package/src/assets/icons/earth.svg +1 -0
- package/src/assets/icons/email.svg +6 -0
- package/src/assets/icons/external-link-16px.svg +18 -0
- package/src/assets/icons/external-link.svg +4 -0
- package/src/assets/icons/icon-close.svg +15 -0
- package/src/assets/icons/instagram.svg +3 -0
- package/src/assets/icons/key.svg +3 -0
- package/src/assets/icons/location.svg +10 -0
- package/src/assets/icons/phone.svg +3 -0
- package/src/assets/icons/refresh.svg +3 -0
- package/src/assets/icons/right-arrow.svg +3 -0
- package/src/assets/icons/search.svg +5 -0
- package/src/assets/icons/tick.svg +3 -0
- package/src/assets/icons/video-play.svg +4 -0
- package/src/assets/images/hero-header-chevron.svg +9 -0
- package/src/assets/images/hero-header-mask.png +0 -0
- package/src/assets/images/hero-header-mask.svg +3 -0
- package/src/assets/logo.svg +1 -0
- package/src/assets/main.css +35 -0
- package/src/assets/styles/button.scss +206 -0
- package/src/assets/styles/focus.scss +4 -0
- package/src/assets/styles/generated-icons.scss +374 -0
- package/src/assets/styles/modal.scss +12 -0
- package/src/assets/styles/rtl.scss +8 -0
- package/src/assets/styles/storybook.scss +9 -0
- package/src/assets/styles/stylesheet.scss +7 -0
- package/src/assets/styles/webfonts.css +155 -0
- package/src/components/Common/CardGrid/cardgrid.stories.js +269 -0
- package/src/components/Common/CardGrid/index.vue +321 -0
- package/src/components/Common/CardGridItem/card-grid-item-caret.vue +164 -0
- package/src/components/Common/CardGridItem/card-grid-item-icon.vue +163 -0
- package/src/components/Common/CardGridItem/index.vue +848 -0
- package/src/components/Common/FilterButton/index.vue +93 -0
- package/src/components/Containers/Column/index.stories.js +35 -0
- package/src/components/Containers/Column/index.vue +14 -0
- package/src/components/Containers/Container/index.stories.js +13 -0
- package/src/components/Containers/Container/index.vue +15 -0
- package/src/components/Containers/HomepageHeader/index.stories.js +78 -0
- package/src/components/Containers/HomepageHeader/index.vue +186 -0
- package/src/components/Containers/Row/index.stories.js +12 -0
- package/src/components/Containers/Row/index.vue +14 -0
- package/src/components/Containers/SectionGroup/index.stories.js +148 -0
- package/src/components/Containers/SectionGroup/index.vue +310 -0
- package/src/components/Containers/Subheader/index.stories.js +74 -0
- package/src/components/Containers/Subheader/index.vue +149 -0
- package/src/components/Global/AlertStrip/index.stories.js +13 -0
- package/src/components/Global/AlertStrip/index.vue +145 -0
- package/src/components/Global/AlertStrip/styles.scss +78 -0
- package/src/components/Global/AppFooter/FooterSocialShare/index.vue +105 -0
- package/src/components/Global/AppFooter/FooterSocialShare/styles.scss +41 -0
- package/src/components/Global/AppFooter/index.stories.js +24 -0
- package/src/components/Global/AppFooter/index.vue +632 -0
- package/src/components/Global/AppFooter/storiesConst.js +110 -0
- package/src/components/Global/AppFooter/styles.scss +393 -0
- package/src/components/Global/AppHeader/ModalSearch/index.vue +66 -0
- package/src/components/Global/AppHeader/ModalSearch/styles.scss +43 -0
- package/src/components/Global/AppHeader/includes.scss +68 -0
- package/src/components/Global/AppHeader/index.stories.js +82 -0
- package/src/components/Global/AppHeader/index.vue +878 -0
- package/src/components/Global/AppHeader/mobile.scss +240 -0
- package/src/components/Global/AppHeader/styles.scss +371 -0
- package/src/components/Global/BackToTop/index.stories.js +18 -0
- package/src/components/Global/BackToTop/index.vue +67 -0
- package/src/components/Global/BackToTop/styles.scss +46 -0
- package/src/components/Global/ContrastMode/index.stories.js +39 -0
- package/src/components/Global/ContrastMode/index.vue +308 -0
- package/src/components/Global/Cookies/Constants.js +72 -0
- package/src/components/Global/Cookies/index.storieshide.js +45 -0
- package/src/components/Global/Cookies/index.vue +453 -0
- package/src/components/Global/Cookies/styles.scss +259 -0
- package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +196 -0
- package/src/components/Global/DirectoryFilters/index.vue +176 -0
- package/src/components/Global/GlobalNotice/index.vue +266 -0
- package/src/components/Global/HeroHeader/index.stories.js +93 -0
- package/src/components/Global/HeroHeader/index.vue +343 -0
- package/src/components/Global/HeroHeader/styles.scss +480 -0
- package/src/components/Global/ProgressBar/index.stories.js +51 -0
- package/src/components/Global/ProgressBar/index.vue +58 -0
- package/src/components/Global/ProgressBar/styles.scss +116 -0
- package/src/components/Global/SocialShare/index.stories.js +18 -0
- package/src/components/Global/SocialShare/index.vue +318 -0
- package/src/components/Global/Strip/index.stories.js +70 -0
- package/src/components/Global/Strip/index.vue +357 -0
- package/src/components/HelloWorld.vue +44 -0
- package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +232 -0
- package/src/components/Paragraphs/Accordion/StepperItem/index.vue +274 -0
- package/src/components/Paragraphs/Accordion/index.stories.js +84 -0
- package/src/components/Paragraphs/Accordion/index.vue +202 -0
- package/src/components/Paragraphs/Breakout/index.stories.js +39 -0
- package/src/components/Paragraphs/Breakout/index.vue +115 -0
- package/src/components/Paragraphs/BrowseContent/index.stories.js +220 -0
- package/src/components/Paragraphs/BrowseContent/index.vue +298 -0
- package/src/components/Paragraphs/BrowseContent/switcher.vue +63 -0
- package/src/components/Paragraphs/Calculator/CardContainer/index.vue +278 -0
- package/src/components/Paragraphs/Calculator/CardContainer/styles.scss +152 -0
- package/src/components/Paragraphs/Calculator/Constants.js +246 -0
- package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +124 -0
- package/src/components/Paragraphs/Calculator/RiskLevel/styles.scss +73 -0
- package/src/components/Paragraphs/Calculator/index.stories.js +27 -0
- package/src/components/Paragraphs/Calculator/index.vue +284 -0
- package/src/components/Paragraphs/Calculator/styles.scss +49 -0
- package/src/components/Paragraphs/Directory/Records/CJ/index.vue +59 -0
- package/src/components/Paragraphs/Directory/Records/ISP/distance.js +46 -0
- package/src/components/Paragraphs/Directory/Records/ISP/index.vue +88 -0
- package/src/components/Paragraphs/Directory/Records/PRS/index.vue +59 -0
- package/src/components/Paragraphs/Directory/Records/PRS/recordContent.vue +91 -0
- package/src/components/Paragraphs/Directory/Records/PRS/recordDetails.vue +49 -0
- package/src/components/Paragraphs/Directory/Records/index.vue +203 -0
- package/src/components/Paragraphs/Directory/Records/styles.scss +129 -0
- package/src/components/Paragraphs/Directory/constants.js +79 -0
- package/src/components/Paragraphs/Directory/index.vue +334 -0
- package/src/components/Paragraphs/ListGroup/Constants.js +72 -0
- package/src/components/Paragraphs/ListGroup/Link/list-link.stories.js +71 -0
- package/src/components/Paragraphs/ListGroup/index.vue +333 -0
- package/src/components/Paragraphs/ListGroup/list-group.stories.js +64 -0
- package/src/components/Paragraphs/ListGroup/navigation-card.stories.js +66 -0
- package/src/components/Paragraphs/MarketingBanner/index.stories.js +65 -0
- package/src/components/Paragraphs/MarketingBanner/index.vue +118 -0
- package/src/components/Paragraphs/MarketingBanner/styles.scss +87 -0
- package/src/components/Paragraphs/ProofPoints/index.stories.js +173 -0
- package/src/components/Paragraphs/ProofPoints/index.vue +64 -0
- package/src/components/Paragraphs/RelatedInformation/index.stories.js +32 -0
- package/src/components/Paragraphs/RelatedInformation/index.vue +62 -0
- package/src/components/Paragraphs/RelatedInformation/styles.scss +50 -0
- package/src/components/Paragraphs/RichText/index.stories.js +393 -0
- package/src/components/Paragraphs/RichText/index.vue +113 -0
- package/src/components/Paragraphs/RichText/scss/base.scss +355 -0
- package/src/components/Paragraphs/RichText/scss/definition-list.scss +35 -0
- package/src/components/Paragraphs/RichText/scss/styled-list.scss +152 -0
- package/src/components/Paragraphs/RichText/scss/table.scss +85 -0
- package/src/components/Paragraphs/ScrollSpy/index.stories.js +184 -0
- package/src/components/Paragraphs/ScrollSpy/index.vue +147 -0
- package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +29 -0
- package/src/components/Paragraphs/SelectableCards/cardbody.vue +25 -0
- package/src/components/Paragraphs/SelectableCards/cardtop.vue +113 -0
- package/src/components/Paragraphs/SelectableCards/index.stories.js +27 -0
- package/src/components/Paragraphs/SelectableCards/index.vue +116 -0
- package/src/components/Paragraphs/Statistics/index.stories.js +106 -0
- package/src/components/Paragraphs/Statistics/index.vue +95 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/cake-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/commute-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/fire_extinguisher-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/free_breakfast-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/portrait-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/storefront-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/TempIcons/tag_faces-black-18dp.svg +1 -0
- package/src/components/Paragraphs/TabbedCards/index.stories.js +36 -0
- package/src/components/Paragraphs/TabbedCards/index.vue +393 -0
- package/src/components/Paragraphs/Tabs/index.stories.js +60 -0
- package/src/components/Paragraphs/Tabs/index.vue +127 -0
- package/src/components/Paragraphs/Tabs/styles.scss +150 -0
- package/src/components/Paragraphs/TabulatedData/Constants.js +158 -0
- package/src/components/Paragraphs/TabulatedData/index.stories.js +39 -0
- package/src/components/Paragraphs/TabulatedData/index.vue +145 -0
- package/src/components/Paragraphs/TaskFinder/index.stories.js +45 -0
- package/src/components/Paragraphs/TaskFinder/index.vue +192 -0
- package/src/components/Paragraphs/TaskFinder/pdf/index.vue +109 -0
- package/src/components/Paragraphs/TaskFinder/task-finder-column.vue +146 -0
- package/src/components/Paragraphs/TextMedia/MediaTypes/Image/index.vue +24 -0
- package/src/components/Paragraphs/TextMedia/MediaTypes/Video/index.vue +29 -0
- package/src/components/Paragraphs/TextMedia/index.stories.js +94 -0
- package/src/components/Paragraphs/TextMedia/index.vue +150 -0
- package/src/components/Paragraphs/VideoGrid/index.stories.js +167 -0
- package/src/components/Paragraphs/VideoGrid/index.vue +124 -0
- package/src/components/Paragraphs/VideoPlayer/index.stories.js +95 -0
- package/src/components/Paragraphs/VideoPlayer/index.vue +110 -0
- package/src/components/Paragraphs/Webform/index.stories.js +70 -0
- package/src/components/Paragraphs/Webform/index.vue +103 -0
- package/src/components/SubComponents/Breadcrumb/constants.js +15 -0
- package/src/components/SubComponents/Breadcrumb/index.stories.js +22 -0
- package/src/components/SubComponents/Breadcrumb/index.vue +91 -0
- package/src/components/SubComponents/CardGroup/cardbody.vue +109 -0
- package/src/components/SubComponents/CardGroup/cardtop.vue +106 -0
- package/src/components/SubComponents/CardGroup/index.stories.js +145 -0
- package/src/components/SubComponents/CardGroup/index.vue +297 -0
- package/src/components/SubComponents/CtaButton/index.stories.js +357 -0
- package/src/components/SubComponents/CtaButton/index.vue +256 -0
- package/src/components/SubComponents/FormAddressPostcode/index.stories.js +43 -0
- package/src/components/SubComponents/FormAddressPostcode/index.vue +314 -0
- package/src/components/SubComponents/FormInstance/index.stories.js +8 -0
- package/src/components/SubComponents/FormInstance/index.vue +12 -0
- package/src/components/SubComponents/GoogleSearch/index.stories.js +8 -0
- package/src/components/SubComponents/GoogleSearch/index.vue +405 -0
- package/src/components/SubComponents/Icon/README.md +40 -0
- package/src/components/SubComponents/Icon/example.js +41 -0
- package/src/components/SubComponents/Icon/index.stories.js +84 -0
- package/src/components/SubComponents/Icon/index.vue +127 -0
- package/src/components/SubComponents/Icon/styles.scss +38 -0
- package/src/components/SubComponents/Loading/index.stories.js +9 -0
- package/src/components/SubComponents/Loading/index.vue +15 -0
- package/src/components/SubComponents/MediaPlayer/index.stories.js +58 -0
- package/src/components/SubComponents/MediaPlayer/index.vue +69 -0
- package/src/components/SubComponents/Pagination/index.stories.js +119 -0
- package/src/components/SubComponents/Pagination/index.vue +184 -0
- package/src/components/SubComponents/Pagination/pagination.js +58 -0
- package/src/components/SubComponents/ResourceGroup/List/index.stories.js +268 -0
- package/src/components/SubComponents/ResourceGroup/cardbody.vue +221 -0
- package/src/components/SubComponents/ResourceGroup/cardfooter.vue +61 -0
- package/src/components/SubComponents/ResourceGroup/cardtop.vue +94 -0
- package/src/components/SubComponents/ResourceGroup/index.stories.js +268 -0
- package/src/components/SubComponents/ResourceGroup/index.vue +575 -0
- package/src/components/SubComponents/ResourceGroup/styles.scss +317 -0
- package/src/components/SubComponents/ResourceGroup/switcher.vue +63 -0
- package/src/components/SubComponents/Search/SearchListing/index.vue +217 -0
- package/src/components/SubComponents/Search/index.stories.js +43 -0
- package/src/components/SubComponents/Search/index.vue +238 -0
- package/src/components/SubComponents/SingleImage/index.stories.js +60 -0
- package/src/components/SubComponents/SingleImage/index.vue +98 -0
- package/src/components/SubComponents/VideoThumbnail/index.stories.js +41 -0
- package/src/components/SubComponents/VideoThumbnail/index.vue +239 -0
- package/src/components/TheWelcome.vue +88 -0
- package/src/components/WelcomeItem.vue +87 -0
- package/src/components/icons/IconCommunity.vue +7 -0
- package/src/components/icons/IconDocumentation.vue +7 -0
- package/src/components/icons/IconEcosystem.vue +7 -0
- package/src/components/icons/IconSupport.vue +7 -0
- package/src/components/icons/IconTooling.vue +19 -0
- package/src/includes/scss/all.scss +2 -0
- package/src/includes/scss/mixins/all.scss +6 -0
- package/src/includes/scss/mixins/src/focus.scss +38 -0
- package/src/includes/scss/mixins/src/fp.scss +31 -0
- package/src/includes/scss/mixins/src/grid.scss +125 -0
- package/src/includes/scss/mixins/src/mq.scss +30 -0
- package/src/includes/scss/mixins/src/rtl.scss +8 -0
- package/src/includes/scss/mixins/src/units.scss +110 -0
- package/src/includes/scss/vars/all.scss +2 -0
- package/src/includes/scss/vars/src/breakpoints.scss +20 -0
- package/src/includes/scss/vars/src/colors.module.scss +53 -0
- package/src/includes/scss/vars/src/colors.scss +53 -0
- package/src/index.js +116 -0
- package/src/main.js +18 -0
- package/src/mock/accordion.js +104 -0
- package/src/mock/app-header.js +683 -0
- package/src/mock/control-selectable-cards.js +58 -0
- package/src/mock/jest.svgtransformer.js +7 -0
- package/src/mock/list-group.js +46 -0
- package/src/mock/proof-points.js +55 -0
- package/src/mock/related-info.js +44 -0
- package/src/mock/selectable-cards.js +48 -0
- package/src/mock/statistics.js +63 -0
- package/src/mock/styleMock.js +1 -0
- package/src/mock/tabbed-cards.js +197 -0
- package/src/mock/task-finder.js +68 -0
- package/src/mock/video-grid.js +409 -0
- package/src/mock/video-media.js +51 -0
- package/src/public/places/api/v1/geocode/json +69 -0
- package/src/public/places/api/v1/place/autocomplete/json +226 -0
- package/stylelint.config.js +63 -0
- package/vite.config.js +19 -0
- package/vitest.config.js +14 -0
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header
|
|
3
|
+
v-if="headerMenu"
|
|
4
|
+
:class="'app-header' + (screen === 'mobile' ? ' ' + 'isMobile' : '')"
|
|
5
|
+
>
|
|
6
|
+
<div class="app-header__wrap" @keyup.esc="closeMegaMenu">
|
|
7
|
+
<div
|
|
8
|
+
v-if="
|
|
9
|
+
(!isSecondLevelOpen && screen === 'desktop') ||
|
|
10
|
+
(!isMobileMenuOpen && screen === 'mobile')
|
|
11
|
+
"
|
|
12
|
+
class="app-header__app-branding"
|
|
13
|
+
>
|
|
14
|
+
<nuxt-link class="dark" to="/">
|
|
15
|
+
<img
|
|
16
|
+
:alt="
|
|
17
|
+
isWorkWell
|
|
18
|
+
? 'Work Well Victoria - Logo'
|
|
19
|
+
: 'Work Safe Victoria - Logo'
|
|
20
|
+
"
|
|
21
|
+
width="127"
|
|
22
|
+
height="55"
|
|
23
|
+
:src="isWorkWell ? WorkWellLogo : WorkSafeLogo"
|
|
24
|
+
/>
|
|
25
|
+
</nuxt-link>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="app-header__close-button">
|
|
29
|
+
<button
|
|
30
|
+
v-if="
|
|
31
|
+
(isSecondLevelOpen && screen === 'desktop') ||
|
|
32
|
+
(isMobileMenuOpen && screen === 'mobile')
|
|
33
|
+
"
|
|
34
|
+
ref="closeMenuButton"
|
|
35
|
+
class="dark"
|
|
36
|
+
@click="closeMegaMenu"
|
|
37
|
+
>
|
|
38
|
+
<close class="app-header__close-icon" />
|
|
39
|
+
Close menu
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
<div
|
|
43
|
+
v-if="isMobileMenuOpen && isSecondLevelOpen && screen === 'mobile'"
|
|
44
|
+
class="app-header__back-button-container"
|
|
45
|
+
>
|
|
46
|
+
<button
|
|
47
|
+
ref="menuBackButton"
|
|
48
|
+
class="app-header__back-button dark"
|
|
49
|
+
@click="mobileGoBack"
|
|
50
|
+
@keydown.tab="submenuFocus"
|
|
51
|
+
>
|
|
52
|
+
<caret-left />
|
|
53
|
+
{{ isThirdLevelOpen ? firstLevelItemName : 'Main menu' }}
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
<nav
|
|
57
|
+
v-if="isMobileMenuOpen || screen === 'desktop'"
|
|
58
|
+
:class="{
|
|
59
|
+
'styled-scrollbar': screen === 'mobile' && !isSecondLevelOpen
|
|
60
|
+
}"
|
|
61
|
+
>
|
|
62
|
+
<ul class="app-header__nav-menu">
|
|
63
|
+
<li
|
|
64
|
+
v-for="(firstLevelLink, parentIndex) in headerMenu"
|
|
65
|
+
:key="firstLevelLink.key"
|
|
66
|
+
:ref="`firstLevelMenuItem-${parentIndex}`"
|
|
67
|
+
class="nav-item"
|
|
68
|
+
>
|
|
69
|
+
<a
|
|
70
|
+
v-if="firstLevelLink.below"
|
|
71
|
+
class="dark"
|
|
72
|
+
href
|
|
73
|
+
role="button"
|
|
74
|
+
aria-expanded="false"
|
|
75
|
+
@click.prevent="
|
|
76
|
+
firstLevelClick(
|
|
77
|
+
firstLevelLink,
|
|
78
|
+
`firstLevelMenuItem-${parentIndex}`
|
|
79
|
+
)
|
|
80
|
+
"
|
|
81
|
+
@mouseover="mouseHover('firstLevelMenuItem', parentIndex)"
|
|
82
|
+
@mouseleave="mouseLeave('firstLevelMenuItem', parentIndex)"
|
|
83
|
+
@focusin="mouseHover('firstLevelMenuItem', parentIndex)"
|
|
84
|
+
@focusout="mouseLeave('firstLevelMenuItem', parentIndex)"
|
|
85
|
+
>
|
|
86
|
+
<span>{{ firstLevelLink.title }}</span>
|
|
87
|
+
|
|
88
|
+
<caret-down v-if="screen === 'desktop'" class="caret-down" />
|
|
89
|
+
<caret-right
|
|
90
|
+
v-else-if="!isSecondLevelOpen && !isThirdLevelOpen"
|
|
91
|
+
class="caret-right"
|
|
92
|
+
/>
|
|
93
|
+
</a>
|
|
94
|
+
<a
|
|
95
|
+
v-else-if="!firstLevelLink.relative"
|
|
96
|
+
:href="firstLevelLink.absolute"
|
|
97
|
+
class="dark"
|
|
98
|
+
>
|
|
99
|
+
<span>{{ firstLevelLink.title }}</span>
|
|
100
|
+
</a>
|
|
101
|
+
<nuxt-link
|
|
102
|
+
v-else
|
|
103
|
+
class="dark"
|
|
104
|
+
:to="firstLevelLink.relative"
|
|
105
|
+
@click.native="fireAnalytics(firstLevelLink)"
|
|
106
|
+
>
|
|
107
|
+
<span>{{ firstLevelLink.title }}</span>
|
|
108
|
+
</nuxt-link>
|
|
109
|
+
<div v-if="isSecondLevelOpen" class="sub-nav-container">
|
|
110
|
+
<div
|
|
111
|
+
class="sub-nav-container__inner"
|
|
112
|
+
:class="{ 'styled-scrollbar': screen === 'desktop' }"
|
|
113
|
+
>
|
|
114
|
+
<div
|
|
115
|
+
class="sub-nav-container__wrap"
|
|
116
|
+
:class="{
|
|
117
|
+
'styled-scrollbar': screen === 'mobile' && isSecondLevelOpen
|
|
118
|
+
}"
|
|
119
|
+
>
|
|
120
|
+
<div
|
|
121
|
+
class="selected-title"
|
|
122
|
+
:class="{ 'selected-title--chrome': isChrome }"
|
|
123
|
+
>
|
|
124
|
+
<nuxt-link
|
|
125
|
+
v-if="firstLevelLink.relative"
|
|
126
|
+
:ref="`secondLevelSelectedTitle-${parentIndex}`"
|
|
127
|
+
:to="firstLevelLink.relative"
|
|
128
|
+
class="dark"
|
|
129
|
+
@click.native="fireAnalytics(firstLevelLink)"
|
|
130
|
+
@keydown.tab.native="backBtnFocus($event)"
|
|
131
|
+
>
|
|
132
|
+
<span>{{ firstLevelLink.title }}</span>
|
|
133
|
+
</nuxt-link>
|
|
134
|
+
<span v-else>{{ firstLevelLink.title }}</span>
|
|
135
|
+
</div>
|
|
136
|
+
<div class="selected-items">
|
|
137
|
+
<ul v-if="firstLevelLink.below" class="sub-nav-group">
|
|
138
|
+
<li
|
|
139
|
+
v-for="(secondLevelLink,
|
|
140
|
+
secondIndex) in firstLevelLink.below"
|
|
141
|
+
:key="secondLevelLink.key"
|
|
142
|
+
:ref="
|
|
143
|
+
`secondLevelMenuItem-${parentIndex}-${secondIndex}`
|
|
144
|
+
"
|
|
145
|
+
class="sub-nav-parent-item"
|
|
146
|
+
>
|
|
147
|
+
<a
|
|
148
|
+
v-if="secondLevelLink.below"
|
|
149
|
+
href
|
|
150
|
+
class="dark"
|
|
151
|
+
role="button"
|
|
152
|
+
aria-expanded="false"
|
|
153
|
+
@keydown.tab="
|
|
154
|
+
searchFocus(
|
|
155
|
+
secondIndex,
|
|
156
|
+
firstLevelLink.below.length,
|
|
157
|
+
$event
|
|
158
|
+
)
|
|
159
|
+
"
|
|
160
|
+
@click.prevent="
|
|
161
|
+
secondLevelClick(
|
|
162
|
+
secondLevelLink,
|
|
163
|
+
`secondLevelMenuItem-${parentIndex}-${secondIndex}`
|
|
164
|
+
)
|
|
165
|
+
"
|
|
166
|
+
@mouseover="
|
|
167
|
+
mouseHover(
|
|
168
|
+
'secondLevelMenuItem',
|
|
169
|
+
parentIndex,
|
|
170
|
+
secondIndex
|
|
171
|
+
)
|
|
172
|
+
"
|
|
173
|
+
@mouseleave="
|
|
174
|
+
mouseLeave(
|
|
175
|
+
'secondLevelMenuItem',
|
|
176
|
+
parentIndex,
|
|
177
|
+
secondIndex
|
|
178
|
+
)
|
|
179
|
+
"
|
|
180
|
+
@focusin="
|
|
181
|
+
mouseHover(
|
|
182
|
+
'secondLevelMenuItem',
|
|
183
|
+
parentIndex,
|
|
184
|
+
secondIndex
|
|
185
|
+
)
|
|
186
|
+
"
|
|
187
|
+
@focusout="
|
|
188
|
+
mouseLeave(
|
|
189
|
+
'secondLevelMenuItem',
|
|
190
|
+
parentIndex,
|
|
191
|
+
secondIndex
|
|
192
|
+
)
|
|
193
|
+
"
|
|
194
|
+
>
|
|
195
|
+
<span>{{ secondLevelLink.title }}</span>
|
|
196
|
+
<caret-right
|
|
197
|
+
v-if="!(screen === 'mobile' && isThirdLevelOpen)"
|
|
198
|
+
class="caret-right"
|
|
199
|
+
/>
|
|
200
|
+
</a>
|
|
201
|
+
<a
|
|
202
|
+
v-else-if="!secondLevelLink.relative"
|
|
203
|
+
:href="secondLevelLink.absolute"
|
|
204
|
+
class="dark"
|
|
205
|
+
>
|
|
206
|
+
<span>{{ secondLevelLink.title }}</span>
|
|
207
|
+
</a>
|
|
208
|
+
<nuxt-link
|
|
209
|
+
v-else
|
|
210
|
+
class="dark"
|
|
211
|
+
:to="secondLevelLink.relative"
|
|
212
|
+
@keydown.tab.native="
|
|
213
|
+
searchFocus(
|
|
214
|
+
secondIndex,
|
|
215
|
+
firstLevelLink.below.length,
|
|
216
|
+
$event
|
|
217
|
+
)
|
|
218
|
+
"
|
|
219
|
+
@mouseover.native="
|
|
220
|
+
mouseHover(
|
|
221
|
+
'secondLevelMenuItem',
|
|
222
|
+
parentIndex,
|
|
223
|
+
secondIndex
|
|
224
|
+
)
|
|
225
|
+
"
|
|
226
|
+
@mouseleave.native="
|
|
227
|
+
mouseLeave(
|
|
228
|
+
'secondLevelMenuItem',
|
|
229
|
+
parentIndex,
|
|
230
|
+
secondIndex
|
|
231
|
+
)
|
|
232
|
+
"
|
|
233
|
+
@focusin.native="
|
|
234
|
+
mouseHover(
|
|
235
|
+
'secondLevelMenuItem',
|
|
236
|
+
parentIndex,
|
|
237
|
+
secondIndex
|
|
238
|
+
)
|
|
239
|
+
"
|
|
240
|
+
@focusout.native="
|
|
241
|
+
mouseLeave(
|
|
242
|
+
'secondLevelMenuItem',
|
|
243
|
+
parentIndex,
|
|
244
|
+
secondIndex
|
|
245
|
+
)
|
|
246
|
+
"
|
|
247
|
+
@click.native="fireAnalytics(secondLevelLink)"
|
|
248
|
+
>
|
|
249
|
+
<span>{{ secondLevelLink.title }}</span>
|
|
250
|
+
</nuxt-link>
|
|
251
|
+
<div v-if="isThirdLevelOpen" class="sub-nav">
|
|
252
|
+
<div class="sub-nav__wrap">
|
|
253
|
+
<div class="selected-title">
|
|
254
|
+
<nuxt-link
|
|
255
|
+
v-if="secondLevelLink.relative"
|
|
256
|
+
:ref="
|
|
257
|
+
`secondLevelSelectedTitle-${parentIndex}-${secondIndex}`
|
|
258
|
+
"
|
|
259
|
+
:to="secondLevelLink.relative"
|
|
260
|
+
class="dark"
|
|
261
|
+
@click.native="fireAnalytics(secondLevelLink)"
|
|
262
|
+
@keydown.tab.native="backBtnFocus($event)"
|
|
263
|
+
>
|
|
264
|
+
<span>{{ secondLevelLink.title }}</span>
|
|
265
|
+
</nuxt-link>
|
|
266
|
+
<span v-else>{{ secondLevelLink.title }}</span>
|
|
267
|
+
</div>
|
|
268
|
+
<div class="selected-sub-nav">
|
|
269
|
+
<ul
|
|
270
|
+
v-if="secondLevelLink.below"
|
|
271
|
+
class="sub-nav-group"
|
|
272
|
+
>
|
|
273
|
+
<li
|
|
274
|
+
v-for="(thirdLevelLink,
|
|
275
|
+
thirdIndex) in secondLevelLink.below"
|
|
276
|
+
:key="thirdLevelLink.key"
|
|
277
|
+
:ref="
|
|
278
|
+
`thirdLevelMenuItem-${parentIndex}-${secondIndex}-${thirdIndex}`
|
|
279
|
+
"
|
|
280
|
+
>
|
|
281
|
+
<nuxt-link
|
|
282
|
+
v-if="thirdLevelLink.relative"
|
|
283
|
+
class="dark"
|
|
284
|
+
:to="thirdLevelLink.relative"
|
|
285
|
+
@keydown.tab.native="
|
|
286
|
+
searchFocus(
|
|
287
|
+
thirdIndex,
|
|
288
|
+
secondLevelLink.below.length,
|
|
289
|
+
$event
|
|
290
|
+
)
|
|
291
|
+
"
|
|
292
|
+
@mouseover.native="
|
|
293
|
+
mouseHover(
|
|
294
|
+
'thirdLevelMenuItem',
|
|
295
|
+
parentIndex,
|
|
296
|
+
secondIndex,
|
|
297
|
+
thirdIndex
|
|
298
|
+
)
|
|
299
|
+
"
|
|
300
|
+
@mouseleave.native="
|
|
301
|
+
mouseLeave(
|
|
302
|
+
'thirdLevelMenuItem',
|
|
303
|
+
parentIndex,
|
|
304
|
+
secondIndex,
|
|
305
|
+
thirdIndex
|
|
306
|
+
)
|
|
307
|
+
"
|
|
308
|
+
@focusin.native="
|
|
309
|
+
mouseHover(
|
|
310
|
+
'thirdLevelMenuItem',
|
|
311
|
+
parentIndex,
|
|
312
|
+
secondIndex,
|
|
313
|
+
thirdIndex
|
|
314
|
+
)
|
|
315
|
+
"
|
|
316
|
+
@focusout.native="
|
|
317
|
+
mouseLeave(
|
|
318
|
+
'thirdLevelMenuItem',
|
|
319
|
+
parentIndex,
|
|
320
|
+
secondIndex,
|
|
321
|
+
thirdIndex
|
|
322
|
+
)
|
|
323
|
+
"
|
|
324
|
+
@click.native="
|
|
325
|
+
fireAnalytics(thirdLevelLink)
|
|
326
|
+
"
|
|
327
|
+
>
|
|
328
|
+
<span>{{ thirdLevelLink.title }}</span>
|
|
329
|
+
</nuxt-link>
|
|
330
|
+
<a
|
|
331
|
+
v-else
|
|
332
|
+
class="dark"
|
|
333
|
+
:href="thirdLevelLink.absolute"
|
|
334
|
+
>
|
|
335
|
+
<span>{{ thirdLevelLink.title }}</span>
|
|
336
|
+
</a>
|
|
337
|
+
</li>
|
|
338
|
+
</ul>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</li>
|
|
343
|
+
</ul>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
</li>
|
|
349
|
+
<!-- start of workwell login code-->
|
|
350
|
+
<li v-if="isWorkWell && !authenticated">
|
|
351
|
+
<nuxt-link class="dark" to="/workwell-login">
|
|
352
|
+
<span>Login</span>
|
|
353
|
+
</nuxt-link>
|
|
354
|
+
</li>
|
|
355
|
+
<li v-if="isWorkWell && authenticated">
|
|
356
|
+
<nuxt-link class="dark" to="/toolkit/dashboard">
|
|
357
|
+
<span>My Actions</span>
|
|
358
|
+
</nuxt-link>
|
|
359
|
+
</li>
|
|
360
|
+
<li v-if="isWorkWell && authenticated">
|
|
361
|
+
<nuxt-link class="dark" to="/help">
|
|
362
|
+
<span>Help</span>
|
|
363
|
+
</nuxt-link>
|
|
364
|
+
</li>
|
|
365
|
+
<li v-if="isWorkWell && authenticated">
|
|
366
|
+
<nuxt-link class="dark" to="/account">
|
|
367
|
+
<span>Account</span>
|
|
368
|
+
</nuxt-link>
|
|
369
|
+
</li>
|
|
370
|
+
<!-- end workwell login code -->
|
|
371
|
+
<li v-if="!isWorkWell && screen === 'desktop'" class="nav-item">
|
|
372
|
+
<nuxt-link class="dark" to="/search" @keydown.tab="resetTab">
|
|
373
|
+
<span class="search-string">Search</span>
|
|
374
|
+
<search-icon class="search-icon" />
|
|
375
|
+
</nuxt-link>
|
|
376
|
+
</li>
|
|
377
|
+
<li v-if="isWorkWell && screen === 'desktop'" class="nav-item hide">
|
|
378
|
+
<a href="#" class="dark" @focus="resetTab"></a>
|
|
379
|
+
</li>
|
|
380
|
+
</ul>
|
|
381
|
+
</nav>
|
|
382
|
+
<div v-if="screen === 'mobile'" class="app-header__mobile-menu-container">
|
|
383
|
+
<ul>
|
|
384
|
+
<li v-if="!isWorkWell">
|
|
385
|
+
<nuxt-link
|
|
386
|
+
ref="searchButton"
|
|
387
|
+
class="dark"
|
|
388
|
+
to="/search"
|
|
389
|
+
@keydown.tab="resetTab"
|
|
390
|
+
>
|
|
391
|
+
<span>Search</span>
|
|
392
|
+
<search-icon class="search-icon" />
|
|
393
|
+
</nuxt-link>
|
|
394
|
+
</li>
|
|
395
|
+
<li v-else class="nav-item hide">
|
|
396
|
+
<a ref="searchButton" role="button" @focus="resetTab"></a>
|
|
397
|
+
</li>
|
|
398
|
+
<li v-if="!isMobileMenuOpen">
|
|
399
|
+
<a class="dark" role="button" @click.prevent="showMobileMenu">
|
|
400
|
+
<span>Menu</span>
|
|
401
|
+
<menu-icon class="menu-icon" />
|
|
402
|
+
</a>
|
|
403
|
+
</li>
|
|
404
|
+
</ul>
|
|
405
|
+
</div>
|
|
406
|
+
<div v-if="isSearchOpen && !isWorkWell" class="search-container">
|
|
407
|
+
<modal-search
|
|
408
|
+
:search-query="searchQuery"
|
|
409
|
+
:content-parser="contentParser"
|
|
410
|
+
@closed="closeSearch"
|
|
411
|
+
/>
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
</header>
|
|
415
|
+
</template>
|
|
416
|
+
|
|
417
|
+
<script>
|
|
418
|
+
import ModalSearch from './ModalSearch/index.vue'
|
|
419
|
+
import Close from './../../../assets/icons/close.svg'
|
|
420
|
+
import WorkSafeLogo from './../../../assets/icons/AppFooter/worksafe-footer-logo.svg'
|
|
421
|
+
import WorkWellLogo from './../../../assets/icons/AppFooter/logo-workwell-reversed.svg'
|
|
422
|
+
import CaretRight from './../../../assets/icons/caret-right.svg'
|
|
423
|
+
import CaretDown from './../../../assets/icons/caret-down.svg'
|
|
424
|
+
import SearchIcon from './../../../assets/icons/AppHeader/search-32px.svg'
|
|
425
|
+
import CaretLeft from './../../../assets/icons/caret-left.svg'
|
|
426
|
+
import MenuIcon from './../../../assets/icons/AppHeader/menu-32px.svg'
|
|
427
|
+
|
|
428
|
+
export default {
|
|
429
|
+
components: {
|
|
430
|
+
ModalSearch,
|
|
431
|
+
Close,
|
|
432
|
+
CaretRight,
|
|
433
|
+
CaretDown,
|
|
434
|
+
CaretLeft,
|
|
435
|
+
MenuIcon,
|
|
436
|
+
SearchIcon
|
|
437
|
+
},
|
|
438
|
+
props: {
|
|
439
|
+
headerMenu: {
|
|
440
|
+
type: Array,
|
|
441
|
+
required: true
|
|
442
|
+
},
|
|
443
|
+
contentParser: {
|
|
444
|
+
type: Function,
|
|
445
|
+
required: true
|
|
446
|
+
},
|
|
447
|
+
isWorkWell: {
|
|
448
|
+
type: Boolean,
|
|
449
|
+
default: false
|
|
450
|
+
},
|
|
451
|
+
authenticated: {
|
|
452
|
+
type: Boolean,
|
|
453
|
+
default: false
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
data() {
|
|
457
|
+
return {
|
|
458
|
+
screen: null,
|
|
459
|
+
isMobileMenuOpen: false,
|
|
460
|
+
isSecondLevelOpen: false,
|
|
461
|
+
isThirdLevelOpen: false,
|
|
462
|
+
isSearchOpen: false,
|
|
463
|
+
firstLevelItemName: null,
|
|
464
|
+
firstLevelItemRef: null,
|
|
465
|
+
secondLevelItemRef: null,
|
|
466
|
+
WorkSafeLogo,
|
|
467
|
+
WorkWellLogo,
|
|
468
|
+
CaretRight,
|
|
469
|
+
CaretDown,
|
|
470
|
+
SearchIcon,
|
|
471
|
+
Close,
|
|
472
|
+
CaretLeft,
|
|
473
|
+
MenuIcon,
|
|
474
|
+
windowWidth: 0,
|
|
475
|
+
searchQuery: null
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
computed: {
|
|
479
|
+
showSecondLevelCaret() {
|
|
480
|
+
return (
|
|
481
|
+
(this.screen === 'mobile' &&
|
|
482
|
+
this.isSecondLevelOpen &&
|
|
483
|
+
!this.isThirdLevelOpen) ||
|
|
484
|
+
this.screen === 'desktop'
|
|
485
|
+
)
|
|
486
|
+
},
|
|
487
|
+
isChrome() {
|
|
488
|
+
return !!window.chrome
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
watch: {
|
|
492
|
+
$route() {
|
|
493
|
+
if (this.screen) {
|
|
494
|
+
this.closeMegaMenu()
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
windowWidth(val) {
|
|
498
|
+
if (val > 980) {
|
|
499
|
+
this.screen = 'desktop'
|
|
500
|
+
} else if (val <= 980) {
|
|
501
|
+
this.screen = 'mobile'
|
|
502
|
+
if (this.isSecondLevelOpen === true) {
|
|
503
|
+
this.isMobileMenuOpen = true
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
destroyed() {
|
|
509
|
+
window.removeEventListener('resize', this.screenWidth)
|
|
510
|
+
},
|
|
511
|
+
created() {
|
|
512
|
+
if (typeof window !== 'undefined' && window) {
|
|
513
|
+
window.addEventListener('resize', this.screenWidth)
|
|
514
|
+
this.screenWidth()
|
|
515
|
+
}
|
|
516
|
+
if (this.$nuxt) {
|
|
517
|
+
this.$nuxt.$on('site-search', (query) => {
|
|
518
|
+
this.searchQuery = query
|
|
519
|
+
if (query) {
|
|
520
|
+
this.showSearch()
|
|
521
|
+
}
|
|
522
|
+
})
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
methods: {
|
|
526
|
+
screenWidth() {
|
|
527
|
+
this.windowWidth = window.innerWidth
|
|
528
|
+
},
|
|
529
|
+
firstLevelClick(item, ref) {
|
|
530
|
+
// Reset screen to fix whitespace
|
|
531
|
+
if (window && window.scrollTo && this.screen === 'desktop') {
|
|
532
|
+
window.scrollTo(0, 0)
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
let selectedItem = this.$refs[ref][0]
|
|
536
|
+
let previouslyOpenItem = this.getActiveParent()
|
|
537
|
+
|
|
538
|
+
// Set this for mobile
|
|
539
|
+
this.firstLevelItemName = item.title
|
|
540
|
+
this.firstLevelItemRef = ref
|
|
541
|
+
|
|
542
|
+
// Set the first item to the variable
|
|
543
|
+
if (previouslyOpenItem.length) {
|
|
544
|
+
previouslyOpenItem = previouslyOpenItem[0]
|
|
545
|
+
}
|
|
546
|
+
// If the menu is not open, open it
|
|
547
|
+
if (item.below && this.isSecondLevelOpen === false) {
|
|
548
|
+
selectedItem.classList.add('isActiveParent')
|
|
549
|
+
selectedItem
|
|
550
|
+
.getElementsByTagName('a')[0]
|
|
551
|
+
.setAttribute('aria-expanded', 'true')
|
|
552
|
+
this.isSecondLevelOpen = true
|
|
553
|
+
this.letBodyOverflow(false)
|
|
554
|
+
}
|
|
555
|
+
// If the menu is already open and the same item is clicked,
|
|
556
|
+
// close it
|
|
557
|
+
else if (
|
|
558
|
+
item.below &&
|
|
559
|
+
this.isSecondLevelOpen === true &&
|
|
560
|
+
selectedItem === previouslyOpenItem
|
|
561
|
+
) {
|
|
562
|
+
selectedItem.classList.remove('isActiveParent')
|
|
563
|
+
selectedItem
|
|
564
|
+
.getElementsByTagName('a')[0]
|
|
565
|
+
.setAttribute('aria-expanded', 'false')
|
|
566
|
+
this.isSecondLevelOpen = false
|
|
567
|
+
this.letBodyOverflow(true)
|
|
568
|
+
}
|
|
569
|
+
// If the link has no children then go to that page
|
|
570
|
+
else if (!item.below) {
|
|
571
|
+
if (item.relative !== '/') {
|
|
572
|
+
this.$router.push(item.relative)
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
// Otherwise just remove the existing open menu and add
|
|
576
|
+
// the isActive class on the new selected item
|
|
577
|
+
else {
|
|
578
|
+
previouslyOpenItem.classList.remove('isActiveParent')
|
|
579
|
+
selectedItem.classList.add('isActiveParent')
|
|
580
|
+
previouslyOpenItem
|
|
581
|
+
.getElementsByTagName('a')[0]
|
|
582
|
+
.setAttribute('aria-expanded', 'false')
|
|
583
|
+
selectedItem
|
|
584
|
+
.getElementsByTagName('a')[0]
|
|
585
|
+
.setAttribute('aria-expanded', 'true')
|
|
586
|
+
}
|
|
587
|
+
if (this.screen === 'mobile') {
|
|
588
|
+
this.focusOnNext(selectedItem)
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
secondLevelClick(item, ref) {
|
|
592
|
+
let selectedItem = this.$refs[ref][0]
|
|
593
|
+
let previouslyOpenItem = this.getActiveChild()
|
|
594
|
+
this.secondLevelItemRef = ref
|
|
595
|
+
|
|
596
|
+
// Set the first item to the variable
|
|
597
|
+
if (previouslyOpenItem.length) {
|
|
598
|
+
previouslyOpenItem = previouslyOpenItem[0]
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// If the menu is not open, open it
|
|
602
|
+
if (item.below && this.isThirdLevelOpen === false) {
|
|
603
|
+
selectedItem.classList.add('isActiveChild')
|
|
604
|
+
selectedItem
|
|
605
|
+
.getElementsByTagName('a')[0]
|
|
606
|
+
.setAttribute('aria-expanded', 'true')
|
|
607
|
+
this.isThirdLevelOpen = true
|
|
608
|
+
}
|
|
609
|
+
// If the link has no children then go to that page
|
|
610
|
+
else if (!item.below) {
|
|
611
|
+
if (item.relative !== '/') {
|
|
612
|
+
this.$router.push(item.relative)
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
// If the menu is already open and the same item is clicked,
|
|
616
|
+
// close it
|
|
617
|
+
else if (
|
|
618
|
+
item.below &&
|
|
619
|
+
this.isThirdLevelOpen === true &&
|
|
620
|
+
selectedItem === previouslyOpenItem
|
|
621
|
+
) {
|
|
622
|
+
selectedItem.classList.remove('isActiveChild')
|
|
623
|
+
selectedItem
|
|
624
|
+
.getElementsByTagName('a')[0]
|
|
625
|
+
.setAttribute('aria-expanded', 'false')
|
|
626
|
+
this.isThirdLevelOpen = false
|
|
627
|
+
}
|
|
628
|
+
// Otherwise just remove the existing open menu and add
|
|
629
|
+
// the isActive class on the new selected item
|
|
630
|
+
else {
|
|
631
|
+
previouslyOpenItem.classList.remove('isActiveChild')
|
|
632
|
+
previouslyOpenItem
|
|
633
|
+
.getElementsByTagName('a')[0]
|
|
634
|
+
.setAttribute('aria-expanded', 'false')
|
|
635
|
+
selectedItem.classList.add('isActiveChild')
|
|
636
|
+
selectedItem
|
|
637
|
+
.getElementsByTagName('a')[0]
|
|
638
|
+
.setAttribute('aria-expanded', 'true')
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
this.focusOnNext(selectedItem)
|
|
642
|
+
},
|
|
643
|
+
showMobileMenu() {
|
|
644
|
+
// Reset screen to top to fix whitespace issues
|
|
645
|
+
if (window) {
|
|
646
|
+
window.scrollTo(0, 0)
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
this.isMobileMenuOpen = true
|
|
650
|
+
this.letBodyOverflow(false)
|
|
651
|
+
this.$nextTick(() => {
|
|
652
|
+
this.$refs['firstLevelMenuItem-0'][0].firstElementChild.focus()
|
|
653
|
+
})
|
|
654
|
+
},
|
|
655
|
+
mouseHover(refID, parentIndex, secondIndex, thirdIndex) {
|
|
656
|
+
let theLI = this.getLIaboveHovered(
|
|
657
|
+
refID,
|
|
658
|
+
parentIndex,
|
|
659
|
+
secondIndex,
|
|
660
|
+
thirdIndex
|
|
661
|
+
)
|
|
662
|
+
if (theLI) {
|
|
663
|
+
let A = theLI.getElementsByTagName('A')[0]
|
|
664
|
+
A.style.borderBottom = '1px solid transparent'
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
mouseLeave(refID, parentIndex, secondIndex, thirdIndex) {
|
|
668
|
+
let theLI = this.getLIaboveHovered(
|
|
669
|
+
refID,
|
|
670
|
+
parentIndex,
|
|
671
|
+
secondIndex,
|
|
672
|
+
thirdIndex
|
|
673
|
+
)
|
|
674
|
+
if (theLI) {
|
|
675
|
+
let A = theLI.getElementsByTagName('A')[0]
|
|
676
|
+
A.removeAttribute('style')
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
getLIaboveHovered(refID, parentIndex, secondIndex, thirdIndex) {
|
|
680
|
+
// Check if its a first level link
|
|
681
|
+
if (secondIndex === undefined && thirdIndex === undefined) {
|
|
682
|
+
if (screen === 'desktop') {
|
|
683
|
+
return
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
let prevFirstIndex = parentIndex - 1
|
|
687
|
+
|
|
688
|
+
if (prevFirstIndex < 0) {
|
|
689
|
+
return
|
|
690
|
+
} else {
|
|
691
|
+
let aboveHovered = `${refID}-${prevFirstIndex}`
|
|
692
|
+
return this.$refs[aboveHovered][0]
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
// Check if its a second level link
|
|
696
|
+
else if (thirdIndex === undefined) {
|
|
697
|
+
let prevSecondIndex = secondIndex - 1
|
|
698
|
+
if (prevSecondIndex < 0) {
|
|
699
|
+
return
|
|
700
|
+
} else {
|
|
701
|
+
let aboveHovered = `${refID}-${parentIndex}-${prevSecondIndex}`
|
|
702
|
+
return this.$refs[aboveHovered][0]
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
// If its a third level link
|
|
706
|
+
else {
|
|
707
|
+
let prevThirdIndex = thirdIndex - 1
|
|
708
|
+
if (prevThirdIndex < 0) {
|
|
709
|
+
return
|
|
710
|
+
} else {
|
|
711
|
+
let aboveHovered = `${refID}-${parentIndex}-${secondIndex}-${prevThirdIndex}`
|
|
712
|
+
return this.$refs[aboveHovered][0]
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
showSearch() {
|
|
717
|
+
this.isSearchOpen = true
|
|
718
|
+
this.letBodyOverflow(false)
|
|
719
|
+
},
|
|
720
|
+
closeSearch() {
|
|
721
|
+
this.isSearchOpen = false
|
|
722
|
+
this.letBodyOverflow(true)
|
|
723
|
+
this.resetTab()
|
|
724
|
+
this.searchQuery = null
|
|
725
|
+
},
|
|
726
|
+
closeMegaMenu() {
|
|
727
|
+
let activeChild = this.getActiveChild()
|
|
728
|
+
let theActiveParent = this.getActiveParent()
|
|
729
|
+
|
|
730
|
+
if (theActiveParent.length) {
|
|
731
|
+
theActiveParent = theActiveParent[0]
|
|
732
|
+
theActiveParent.classList.remove('isActiveParent')
|
|
733
|
+
theActiveParent
|
|
734
|
+
.getElementsByTagName('a')[0]
|
|
735
|
+
.setAttribute('aria-expanded', 'false')
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
if (this.isThirdLevelOpen) {
|
|
739
|
+
activeChild = activeChild[0]
|
|
740
|
+
activeChild.classList.remove('isActiveChild')
|
|
741
|
+
activeChild
|
|
742
|
+
.getElementsByTagName('a')[0]
|
|
743
|
+
.setAttribute('aria-expanded', 'false')
|
|
744
|
+
this.isThirdLevelOpen = false
|
|
745
|
+
}
|
|
746
|
+
this.isMobileMenuOpen = false
|
|
747
|
+
this.isSecondLevelOpen = false
|
|
748
|
+
this.letBodyOverflow(true)
|
|
749
|
+
},
|
|
750
|
+
letBodyOverflow(state) {
|
|
751
|
+
let body = document.body
|
|
752
|
+
let main = document.getElementsByTagName('main')[0]
|
|
753
|
+
let footer = document.getElementsByTagName('footer')[0]
|
|
754
|
+
switch (state) {
|
|
755
|
+
case true:
|
|
756
|
+
body.removeAttribute('style')
|
|
757
|
+
if (main) {
|
|
758
|
+
main.removeAttribute('style')
|
|
759
|
+
}
|
|
760
|
+
if (footer) {
|
|
761
|
+
footer.removeAttribute('style')
|
|
762
|
+
}
|
|
763
|
+
break
|
|
764
|
+
case false:
|
|
765
|
+
body.style.overflow = 'hidden'
|
|
766
|
+
body.style.background = '#ffffff'
|
|
767
|
+
if (main) {
|
|
768
|
+
main.style.display = 'none'
|
|
769
|
+
}
|
|
770
|
+
if (footer) {
|
|
771
|
+
footer.style.display = 'none'
|
|
772
|
+
}
|
|
773
|
+
break
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
resetTab(el) {
|
|
777
|
+
if (this.$refs.closeMenuButton) {
|
|
778
|
+
if (el) {
|
|
779
|
+
el.preventDefault()
|
|
780
|
+
}
|
|
781
|
+
this.$refs.closeMenuButton.focus()
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
getActiveParent() {
|
|
785
|
+
return document.getElementsByClassName('isActiveParent')
|
|
786
|
+
},
|
|
787
|
+
getActiveChild() {
|
|
788
|
+
return document.getElementsByClassName('isActiveChild')
|
|
789
|
+
},
|
|
790
|
+
mobileGoBack() {
|
|
791
|
+
if (this.isThirdLevelOpen) {
|
|
792
|
+
let activeChild = this.getActiveChild()
|
|
793
|
+
activeChild = activeChild[0]
|
|
794
|
+
activeChild.classList.remove('isActiveChild')
|
|
795
|
+
activeChild
|
|
796
|
+
.getElementsByTagName('a')[0]
|
|
797
|
+
.setAttribute('aria-expanded', 'false')
|
|
798
|
+
this.isThirdLevelOpen = false
|
|
799
|
+
} else if (this.isSecondLevelOpen) {
|
|
800
|
+
let activeParent = this.getActiveParent()
|
|
801
|
+
activeParent = activeParent[0]
|
|
802
|
+
activeParent.classList.remove('isActiveParent')
|
|
803
|
+
activeParent
|
|
804
|
+
.getElementsByTagName('a')[0]
|
|
805
|
+
.setAttribute('aria-expanded', 'false')
|
|
806
|
+
this.isSecondLevelOpen = false
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
searchFocus(index, length, event) {
|
|
810
|
+
if (index === length - 1 && this.isMobileMenuOpen && !event.shiftKey) {
|
|
811
|
+
event.preventDefault()
|
|
812
|
+
this.$refs.searchButton.focus()
|
|
813
|
+
} else if (index === 0 && this.isMobileMenuOpen && event.shiftKey) {
|
|
814
|
+
event.preventDefault()
|
|
815
|
+
let firstIndex = this.firstLevelItemRef.split('-')[1]
|
|
816
|
+
let key = null
|
|
817
|
+
if (!this.isThirdLevelOpen) {
|
|
818
|
+
key = `secondLevelSelectedTitle-${firstIndex}`
|
|
819
|
+
} else if (this.isThirdLevelOpen) {
|
|
820
|
+
let secondIndex = this.secondLevelItemRef.split('-')[2]
|
|
821
|
+
key = `secondLevelSelectedTitle-${firstIndex}-${secondIndex}`
|
|
822
|
+
}
|
|
823
|
+
if (this.$refs[key][0].$el.nodeName === 'A') {
|
|
824
|
+
this.$refs[key][0].$el.focus()
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
submenuFocus(event) {
|
|
829
|
+
if (this.isMobileMenuOpen && !event.shiftKey && this.isSecondLevelOpen) {
|
|
830
|
+
event.preventDefault()
|
|
831
|
+
let firstIndex = this.firstLevelItemRef.split('-')[1]
|
|
832
|
+
let key = null
|
|
833
|
+
if (!this.isThirdLevelOpen) {
|
|
834
|
+
key = `secondLevelSelectedTitle-${firstIndex}`
|
|
835
|
+
} else if (this.isThirdLevelOpen) {
|
|
836
|
+
let secondIndex = this.secondLevelItemRef.split('-')[2]
|
|
837
|
+
key = `secondLevelSelectedTitle-${firstIndex}-${secondIndex}`
|
|
838
|
+
}
|
|
839
|
+
if (this.$refs[key][0].$el.nodeName === 'A') {
|
|
840
|
+
this.$refs[key][0].$el.focus()
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
},
|
|
844
|
+
backBtnFocus(event) {
|
|
845
|
+
if (this.isMobileMenuOpen && event.shiftKey && this.isSecondLevelOpen) {
|
|
846
|
+
event.preventDefault()
|
|
847
|
+
this.$refs.menuBackButton.focus()
|
|
848
|
+
}
|
|
849
|
+
},
|
|
850
|
+
focusOnNext(selectedItem) {
|
|
851
|
+
this.$nextTick(() => {
|
|
852
|
+
selectedItem
|
|
853
|
+
.getElementsByClassName('selected-title')[0]
|
|
854
|
+
.firstChild.focus()
|
|
855
|
+
})
|
|
856
|
+
},
|
|
857
|
+
fireAnalytics(content) {
|
|
858
|
+
let payload = {
|
|
859
|
+
event: 'custom.interaction.megamenu.click',
|
|
860
|
+
group: 'Mega Menu',
|
|
861
|
+
label: content.title,
|
|
862
|
+
url: content.relative
|
|
863
|
+
}
|
|
864
|
+
// this.$store.dispatch('tracking/event', payload)
|
|
865
|
+
},
|
|
866
|
+
skipToContent() {
|
|
867
|
+
if (this.$nuxt) {
|
|
868
|
+
this.$nuxt.$emit('scrollToTop')
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
</script>
|
|
874
|
+
|
|
875
|
+
<style lang="scss" scoped>
|
|
876
|
+
@import './styles';
|
|
877
|
+
@import './mobile';
|
|
878
|
+
</style>
|