@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,256 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button v-if="!url" :class="generatedClass" @click="clicked()">
|
|
3
|
+
<span class="wcl-cta__link-text" :class="textClass"><slot></slot></span>
|
|
4
|
+
<span
|
|
5
|
+
v-if="!textOnly"
|
|
6
|
+
class="wcl-cta__spacer"
|
|
7
|
+
aria-hidden="true"
|
|
8
|
+
:class="{ ['wcl-cta__spacer--centered']: isCentred }"
|
|
9
|
+
></span>
|
|
10
|
+
<icon
|
|
11
|
+
v-if="glyph && !textOnly"
|
|
12
|
+
:width="glyphWidth"
|
|
13
|
+
:height="glyphHeight"
|
|
14
|
+
:glyph="glyph"
|
|
15
|
+
:class="glyphClass"
|
|
16
|
+
/>
|
|
17
|
+
<arrow-right v-else-if="!rtl && !textOnly" :class="glyphClass" />
|
|
18
|
+
<arrow-left v-else-if="!textOnly" :class="glyphClass" />
|
|
19
|
+
</button>
|
|
20
|
+
<a
|
|
21
|
+
v-else-if="isAbsolute"
|
|
22
|
+
:alt="alt"
|
|
23
|
+
:href="url"
|
|
24
|
+
:class="generatedClass"
|
|
25
|
+
@click.prevent="clicked()"
|
|
26
|
+
>
|
|
27
|
+
<span class="wcl-cta__link-text" :class="textClass"><slot></slot></span>
|
|
28
|
+
<span
|
|
29
|
+
v-if="!textOnly"
|
|
30
|
+
class="wcl-cta__spacer"
|
|
31
|
+
:class="{ ['wcl-cta__spacer--centered']: isCentred }"
|
|
32
|
+
></span>
|
|
33
|
+
<icon
|
|
34
|
+
v-if="glyph && !textOnly"
|
|
35
|
+
:width="glyphWidth"
|
|
36
|
+
:height="glyphHeight"
|
|
37
|
+
:glyph="glyph"
|
|
38
|
+
:class="glyphClass"
|
|
39
|
+
/>
|
|
40
|
+
<arrow-right v-else-if="!rtl && !textOnly" :class="glyphClass" />
|
|
41
|
+
<arrow-left v-else-if="!textOnly" :class="glyphClass" />
|
|
42
|
+
</a>
|
|
43
|
+
<nuxt-link
|
|
44
|
+
v-else
|
|
45
|
+
:alt="alt"
|
|
46
|
+
:to="linkUriProcessed"
|
|
47
|
+
:class="generatedClass"
|
|
48
|
+
@click.prevent="clicked()"
|
|
49
|
+
>
|
|
50
|
+
<span class="wcl-cta__link-text" :class="textClass"><slot></slot></span>
|
|
51
|
+
<span
|
|
52
|
+
v-if="!textOnly"
|
|
53
|
+
class="wcl-cta__spacer"
|
|
54
|
+
:class="{ ['wcl-cta__spacer--centered']: isCentred }"
|
|
55
|
+
></span>
|
|
56
|
+
<icon
|
|
57
|
+
v-if="glyph && !textOnly"
|
|
58
|
+
:width="glyphWidth"
|
|
59
|
+
:height="glyphHeight"
|
|
60
|
+
:glyph="glyph"
|
|
61
|
+
:class="glyphClass"
|
|
62
|
+
/>
|
|
63
|
+
<arrow-right v-else-if="!rtl && !textOnly" :class="glyphClass" />
|
|
64
|
+
<arrow-left v-else-if="!textOnly" :class="glyphClass" />
|
|
65
|
+
</nuxt-link>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script>
|
|
69
|
+
import arrowRight from '../../../assets/icons/arrow-right.svg?component'
|
|
70
|
+
import arrowLeft from '../../../assets/icons/arrow-left.svg?component'
|
|
71
|
+
import icon from './../Icon/index.vue'
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
name: 'CtaButton',
|
|
75
|
+
components: {
|
|
76
|
+
arrowRight,
|
|
77
|
+
arrowLeft,
|
|
78
|
+
icon
|
|
79
|
+
},
|
|
80
|
+
props: {
|
|
81
|
+
type: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: 'default',
|
|
84
|
+
validator: (value) =>
|
|
85
|
+
['default', 'white', 'gray', 'workwell', 'dark'].indexOf(value) >= 0
|
|
86
|
+
},
|
|
87
|
+
url: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: false,
|
|
90
|
+
default: ''
|
|
91
|
+
},
|
|
92
|
+
alt: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: ''
|
|
95
|
+
},
|
|
96
|
+
rtl: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: false
|
|
99
|
+
},
|
|
100
|
+
glyph: {
|
|
101
|
+
type: [Object, String],
|
|
102
|
+
required: false,
|
|
103
|
+
default: () => null
|
|
104
|
+
},
|
|
105
|
+
glyphHeight: {
|
|
106
|
+
type: Number,
|
|
107
|
+
required: false,
|
|
108
|
+
default: 15
|
|
109
|
+
},
|
|
110
|
+
glyphWidth: {
|
|
111
|
+
type: Number,
|
|
112
|
+
required: false,
|
|
113
|
+
default: 25
|
|
114
|
+
},
|
|
115
|
+
workwell: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: false
|
|
118
|
+
},
|
|
119
|
+
isCentred: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false
|
|
122
|
+
},
|
|
123
|
+
textOnly: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false
|
|
126
|
+
},
|
|
127
|
+
isFluid: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: true
|
|
130
|
+
},
|
|
131
|
+
stretch: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: false
|
|
134
|
+
},
|
|
135
|
+
slim: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: false
|
|
138
|
+
},
|
|
139
|
+
focusOutline: {
|
|
140
|
+
type: String,
|
|
141
|
+
default: 'default',
|
|
142
|
+
validator: (value) => ['default', 'light', 'dark'].indexOf(value) >= 0
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
data() {
|
|
146
|
+
return {
|
|
147
|
+
arrowRight,
|
|
148
|
+
arrowLeft
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
computed: {
|
|
152
|
+
// var r = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
153
|
+
// r.test('http://example.com'); // true - regular http absolute URL
|
|
154
|
+
// r.test('HTTP://EXAMPLE.COM'); // true - HTTP upper-case absolute URL
|
|
155
|
+
// r.test('https://www.exmaple.com'); // true - secure http absolute URL
|
|
156
|
+
// r.test('ftp://example.com/file.txt'); // true - file transfer absolute URL
|
|
157
|
+
// r.test('//cdn.example.com/lib.js'); // true - protocol-relative absolute URL
|
|
158
|
+
// r.test('/myfolder/test.txt'); // false - relative URL
|
|
159
|
+
// r.test('test'); // false - also relative URL
|
|
160
|
+
isAbsolute() {
|
|
161
|
+
let r = new RegExp('^(?:[a-z]+:)?//', 'i')
|
|
162
|
+
return r.test(this.url)
|
|
163
|
+
},
|
|
164
|
+
// Some links come out of Drupal in the format `entity:node/551`
|
|
165
|
+
// As an interim solution, make the link go to `node/551` and it
|
|
166
|
+
// will render correctly. Not ideal as it doesn't forward to the
|
|
167
|
+
// friendly link. Should come out of Drupal with a proper alias.
|
|
168
|
+
linkUriProcessed() {
|
|
169
|
+
if (this.url?.indexOf('entity:') === 0) {
|
|
170
|
+
return this.url.slice(7)
|
|
171
|
+
} else if (this.url?.indexOf('internal:') === 0) {
|
|
172
|
+
return this.url.slice(9)
|
|
173
|
+
} else {
|
|
174
|
+
return this.url
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
generatedClass() {
|
|
178
|
+
return `wcl-cta ${this.type} ${this.rtl ? 'rtl' : ''} ${
|
|
179
|
+
this.workwell ? 'workwell' : ''
|
|
180
|
+
} ${this.isCentred ? 'text-center' : ''} ${
|
|
181
|
+
this.textOnly ? 'wcl-cta--text-only' : ''
|
|
182
|
+
} ${this.stretch ? 'wcl-cta--stretch' : ''} ${
|
|
183
|
+
this.slim ? 'wcl-cta--slim' : ''
|
|
184
|
+
} ${'wcl-cta--focus-' + this.focusOutline}`
|
|
185
|
+
},
|
|
186
|
+
glyphClass() {
|
|
187
|
+
const hasArrow = !this.glyph && !this.textOnly
|
|
188
|
+
return this.isCentred
|
|
189
|
+
? { ['wcl-cta__arrow']: hasArrow }
|
|
190
|
+
: {
|
|
191
|
+
['wcl-cta__arrow']: hasArrow
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
textClass() {
|
|
195
|
+
return this.isCentred ? {} : {}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
methods: {
|
|
199
|
+
clicked() {
|
|
200
|
+
var theEl = this.$el.getElementsByClassName('wcl-cta__link-text')
|
|
201
|
+
var attrs
|
|
202
|
+
if (theEl && theEl.length > 0) {
|
|
203
|
+
attrs = {
|
|
204
|
+
group: this.$store?.state?.page?.content?.title,
|
|
205
|
+
label: theEl[0]?.innerText?.split('\n')[0],
|
|
206
|
+
data: this.url
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
attrs = {
|
|
210
|
+
group: this.$store?.state?.page?.content?.title,
|
|
211
|
+
label: '',
|
|
212
|
+
data: this.url
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
// push event to gtm
|
|
216
|
+
if (this.$gtm) {
|
|
217
|
+
this.$gtm.push({ event: 'custom.interaction.cta.click', ...attrs })
|
|
218
|
+
}
|
|
219
|
+
// navigate to url
|
|
220
|
+
if (!this.url) {
|
|
221
|
+
//donothing
|
|
222
|
+
} else if (this.isAbsolute) {
|
|
223
|
+
window.open(this.url)
|
|
224
|
+
} else {
|
|
225
|
+
this.$router.push(this.url)
|
|
226
|
+
}
|
|
227
|
+
this.$emit('clicked')
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
</script>
|
|
232
|
+
<style lang="scss" scoped>
|
|
233
|
+
@import '../../../includes/scss/all';
|
|
234
|
+
// styles can be found in global src/assets/styles/stylesheet.scss
|
|
235
|
+
// this is because rich text html can dynamically specify cta button class
|
|
236
|
+
.wcl-cta {
|
|
237
|
+
&__arrow {
|
|
238
|
+
margin-top: 3px;
|
|
239
|
+
}
|
|
240
|
+
&--text-only {
|
|
241
|
+
min-width: auto;
|
|
242
|
+
}
|
|
243
|
+
&--focus {
|
|
244
|
+
&-light {
|
|
245
|
+
&:focus {
|
|
246
|
+
@include focus-outline('light');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
&-dark {
|
|
250
|
+
&:focus {
|
|
251
|
+
@include focus-outline('dark');
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import FormAddressPostcode from './index.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'SubComponents/FormAddressPostcode',
|
|
5
|
+
component: FormAddressPostcode,
|
|
6
|
+
argTypes: {
|
|
7
|
+
showShadow: {
|
|
8
|
+
control: 'boolean'
|
|
9
|
+
},
|
|
10
|
+
inputPlaceholder: {
|
|
11
|
+
control: 'text'
|
|
12
|
+
},
|
|
13
|
+
showFullAddress: {
|
|
14
|
+
control: 'boolean'
|
|
15
|
+
},
|
|
16
|
+
geocode: {
|
|
17
|
+
control: 'boolean'
|
|
18
|
+
},
|
|
19
|
+
reverseGeocode: {
|
|
20
|
+
control: 'boolean'
|
|
21
|
+
},
|
|
22
|
+
baseUrl: {
|
|
23
|
+
control: 'text'
|
|
24
|
+
},
|
|
25
|
+
inputClassName: {
|
|
26
|
+
control: 'text'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export const Default = {
|
|
33
|
+
|
|
34
|
+
args: {
|
|
35
|
+
showShadow: false,
|
|
36
|
+
inputPlaceholder: 'Search for a suburb or postcode',
|
|
37
|
+
showFullAddress: false,
|
|
38
|
+
geocode: false,
|
|
39
|
+
reverseGeocode: false,
|
|
40
|
+
baseUrl: 'https://www.worksafe.vic.gov.au',
|
|
41
|
+
inputClassName: 'class-name'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="suburb-postcode-search">
|
|
3
|
+
<input
|
|
4
|
+
:id="`suburb-postcode-search-input-${_uid}`"
|
|
5
|
+
v-model="suburb.text"
|
|
6
|
+
autocomplete="no"
|
|
7
|
+
:placeholder="inputPlaceholder"
|
|
8
|
+
type="text"
|
|
9
|
+
aria-haspopup="true"
|
|
10
|
+
aria-controls="sp-suggestions"
|
|
11
|
+
:class="{
|
|
12
|
+
'suburb-postcode-search--show-shadow': showShadow,
|
|
13
|
+
[inputClassName]: true
|
|
14
|
+
}"
|
|
15
|
+
@keyup.prevent="searchSuburbPostcodeDebounce($event)"
|
|
16
|
+
/>
|
|
17
|
+
<div class="suggestion-wrapper">
|
|
18
|
+
<ul v-if="show" id="sp-suggestions" ref="suggestions">
|
|
19
|
+
<li
|
|
20
|
+
v-for="(r, i) in results"
|
|
21
|
+
:key="i"
|
|
22
|
+
tabindex="0"
|
|
23
|
+
@keydown.prevent="handleKeydownforListItem($event, r)"
|
|
24
|
+
@click.prevent="updateValue(r)"
|
|
25
|
+
>
|
|
26
|
+
{{ r.description }}
|
|
27
|
+
</li>
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
<div v-if="reverseGeocode && !isIE" class="detect-location">
|
|
31
|
+
<button :disabled="searchingAddress" @click="getLocation()">
|
|
32
|
+
Get Location
|
|
33
|
+
</button>
|
|
34
|
+
<b-spinner
|
|
35
|
+
v-if="searchingAddress"
|
|
36
|
+
small
|
|
37
|
+
label="Small Spinner"
|
|
38
|
+
></b-spinner>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<script>
|
|
43
|
+
import axios from 'axios'
|
|
44
|
+
import debounce from 'lodash/debounce'
|
|
45
|
+
import { detectBrowser } from '../../../../lib/detect-browser'
|
|
46
|
+
import { BSpinner } from 'bootstrap-vue-next'
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
name: 'SuburbPostcodeSearch',
|
|
50
|
+
components: { BSpinner },
|
|
51
|
+
props: {
|
|
52
|
+
showShadow: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
inputPlaceholder: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'Search for a suburb or postcode'
|
|
59
|
+
},
|
|
60
|
+
showFullAddress: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
geocode: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
reverseGeocode: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
baseUrl: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ''
|
|
75
|
+
},
|
|
76
|
+
inputClassName: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: ''
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
return {
|
|
83
|
+
suburb: {
|
|
84
|
+
text: null,
|
|
85
|
+
value: null,
|
|
86
|
+
location: null
|
|
87
|
+
},
|
|
88
|
+
results: [],
|
|
89
|
+
show: false,
|
|
90
|
+
searchSuburbPostcodeDebounce: debounce(this.searchSuburbPostcode, 500, {
|
|
91
|
+
trailing: true
|
|
92
|
+
}),
|
|
93
|
+
options: {
|
|
94
|
+
enableHighAccuracy: true,
|
|
95
|
+
timeout: 5000,
|
|
96
|
+
maximumAge: 0
|
|
97
|
+
},
|
|
98
|
+
searchingAddress: false
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
computed: {
|
|
102
|
+
queryString() {
|
|
103
|
+
const types = this.showFullAddress ? 'address' : '(regions)'
|
|
104
|
+
return `input=${this.suburb.text}&types=${types}&components=country:au`
|
|
105
|
+
},
|
|
106
|
+
isIE() {
|
|
107
|
+
return window && navigator && this.detectBrowser(navigator) === 'IE'
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
watch: {
|
|
111
|
+
suburb: {
|
|
112
|
+
immediate: false,
|
|
113
|
+
deep: true,
|
|
114
|
+
handler() {
|
|
115
|
+
if (!this.suburb.location && this.suburb.text.length === 0) {
|
|
116
|
+
this.$emit('cleared')
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
methods: {
|
|
122
|
+
detectBrowser,
|
|
123
|
+
async searchSuburbPostcode(e) {
|
|
124
|
+
// Not enter key
|
|
125
|
+
if (e.keyCode !== 13) {
|
|
126
|
+
this.suburb.value = ''
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// On Arrow Down
|
|
130
|
+
if (e.keyCode === 40 && this.show === true) {
|
|
131
|
+
this.$refs.suggestions.children[0].focus()
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Trap backspace e.keyCode
|
|
135
|
+
if (e.keyCode === 8) {
|
|
136
|
+
this.suburb.text = ''
|
|
137
|
+
if (this.suburb.location) {
|
|
138
|
+
delete this.suburb.location
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (this.suburb.text === '') {
|
|
143
|
+
this.show = false
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
try {
|
|
147
|
+
const response = await (this?.$axios || axios).get(
|
|
148
|
+
`${this.baseUrl ||
|
|
149
|
+
window.origin}/places/api/v1/place/autocomplete/json?${
|
|
150
|
+
this.queryString
|
|
151
|
+
}`
|
|
152
|
+
)
|
|
153
|
+
const predictions = response?.data?.predictions || []
|
|
154
|
+
if (
|
|
155
|
+
!(
|
|
156
|
+
predictions.length === 1 &&
|
|
157
|
+
predictions[0].structured_formatting.main_text === this.suburb.value
|
|
158
|
+
) &&
|
|
159
|
+
predictions.length > 0
|
|
160
|
+
) {
|
|
161
|
+
this.results = predictions
|
|
162
|
+
this.show = true
|
|
163
|
+
}
|
|
164
|
+
// this.$emit('suburbChange', this.suburb)
|
|
165
|
+
} catch (e) {
|
|
166
|
+
console.log('there was an error in SuburbPostcodeSearch', e)
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
handleKeydownforListItem(e, r) {
|
|
170
|
+
// On Enter
|
|
171
|
+
if (e.keyCode == 13 && this.show == true) {
|
|
172
|
+
this.updateValue(r)
|
|
173
|
+
}
|
|
174
|
+
// On Arrow Down
|
|
175
|
+
if (e.keyCode == 40 && this.show == true) {
|
|
176
|
+
this.focusNext(e)
|
|
177
|
+
}
|
|
178
|
+
// On Arrow Up
|
|
179
|
+
if (e.keyCode == 38 && this.show == true) {
|
|
180
|
+
this.focusPrevious(e)
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
async getLatLng(address) {
|
|
184
|
+
const geocodedAddress = await (this.$axios || axios).get(
|
|
185
|
+
`${this.baseUrl}/places/api/v1/geocode/json?address=${address}&components=country:au&sensor=false`
|
|
186
|
+
)
|
|
187
|
+
if (geocodedAddress.data?.results[0]) {
|
|
188
|
+
return Promise.resolve(
|
|
189
|
+
geocodedAddress.data.results[0].geometry.location
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
async searchAddressByLatLng(lat, lng) {
|
|
194
|
+
const geocodedAddress = await (this.$axios || axios).get(
|
|
195
|
+
`${this.baseUrl}/places/api/v1/geocode/json?latlng=${lat},${lng}`
|
|
196
|
+
)
|
|
197
|
+
if (geocodedAddress.data?.results[0]) {
|
|
198
|
+
return Promise.resolve(
|
|
199
|
+
geocodedAddress.data.results[0].formatted_address
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
async updateValue(v) {
|
|
204
|
+
this.suburb = {
|
|
205
|
+
text: v.description,
|
|
206
|
+
value: v.structured_formatting.main_text
|
|
207
|
+
}
|
|
208
|
+
if (this.geocode && this.suburb.value) {
|
|
209
|
+
this.suburb.location = await this.getLatLng(this.suburb.value)
|
|
210
|
+
}
|
|
211
|
+
this.$emit('suburbChange', this.suburb)
|
|
212
|
+
this.show = false
|
|
213
|
+
// Next tick is too fast
|
|
214
|
+
// have to wait for DOM to update
|
|
215
|
+
let self = this
|
|
216
|
+
setTimeout(function() {
|
|
217
|
+
document
|
|
218
|
+
.getElementById(`suburb-postcode-search-input-${_uid}`)
|
|
219
|
+
.focus()
|
|
220
|
+
}, 100)
|
|
221
|
+
},
|
|
222
|
+
focusPrevious(e) {
|
|
223
|
+
if (e.target.previousElementSibling != null) {
|
|
224
|
+
e.target.previousElementSibling.focus()
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
focusNext(e) {
|
|
228
|
+
if (e.target.nextElementSibling != null) {
|
|
229
|
+
e.target.nextElementSibling.focus()
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
getLocation() {
|
|
233
|
+
this.searchingAddress = true
|
|
234
|
+
if (navigator.geolocation) {
|
|
235
|
+
var self = this
|
|
236
|
+
return navigator.geolocation.getCurrentPosition(
|
|
237
|
+
self.findAndUpdateAddress,
|
|
238
|
+
self.errorFindingLocation,
|
|
239
|
+
self.options
|
|
240
|
+
)
|
|
241
|
+
} else {
|
|
242
|
+
return false
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
async findAndUpdateAddress(pos) {
|
|
246
|
+
let {
|
|
247
|
+
coords: { latitude, longitude }
|
|
248
|
+
} = pos
|
|
249
|
+
let foundAddress = await this.searchAddressByLatLng(latitude, longitude)
|
|
250
|
+
this.suburb = {
|
|
251
|
+
text: foundAddress,
|
|
252
|
+
value: foundAddress,
|
|
253
|
+
location: {
|
|
254
|
+
lat: latitude,
|
|
255
|
+
lng: longitude
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
this.searchingAddress = false
|
|
259
|
+
this.$emit('suburbChange', this.suburb)
|
|
260
|
+
},
|
|
261
|
+
errorFindingLocation(err) {
|
|
262
|
+
console.warn(err)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
</script>
|
|
267
|
+
<style lang="scss" scoped>
|
|
268
|
+
@import '../../../includes/scss/all';
|
|
269
|
+
|
|
270
|
+
.suburb-postcode-search {
|
|
271
|
+
position: relative;
|
|
272
|
+
|
|
273
|
+
input {
|
|
274
|
+
z-index: 2;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.suburb-postcode-search--show-shadow {
|
|
278
|
+
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.1);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.suggestion-wrapper {
|
|
282
|
+
position: absolute;
|
|
283
|
+
width: 100%;
|
|
284
|
+
z-index: 1;
|
|
285
|
+
box-shadow: 0 3px 16px rgba(0, 0, 0, 0.18);
|
|
286
|
+
border-radius: 0 0 15px 15px;
|
|
287
|
+
top: 40px;
|
|
288
|
+
ul {
|
|
289
|
+
margin: 0;
|
|
290
|
+
padding: 0;
|
|
291
|
+
display: block;
|
|
292
|
+
background: #ffffff;
|
|
293
|
+
border: 1px solid $gray-alt;
|
|
294
|
+
border-radius: 0 0 15px 15px;
|
|
295
|
+
padding-top: 15px;
|
|
296
|
+
border-top: 0 none;
|
|
297
|
+
|
|
298
|
+
li {
|
|
299
|
+
list-style: none;
|
|
300
|
+
margin: 0;
|
|
301
|
+
cursor: pointer;
|
|
302
|
+
display: block;
|
|
303
|
+
padding: 10px 16px;
|
|
304
|
+
font-weight: bold;
|
|
305
|
+
text-decoration: none;
|
|
306
|
+
|
|
307
|
+
&:hover {
|
|
308
|
+
background: $gray-alt;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h1>Form Instance</h1>
|
|
3
|
+
<p>
|
|
4
|
+
The .vue and .stories.js files for SubComponents/FormInstance (displayed in Storybook under Form) must be copied from current Storybook 6 branch when time to upgrade them. They are causing errors preventing Storybook from being rendered and therefore tested.
|
|
5
|
+
</p>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
name: 'FormInstance'
|
|
11
|
+
}
|
|
12
|
+
</script>
|