@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,38 @@
|
|
|
1
|
+
@import '../../../includes/scss/all';
|
|
2
|
+
|
|
3
|
+
.icon {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
vertical-align: middle;
|
|
6
|
+
fill: currentColor;
|
|
7
|
+
|
|
8
|
+
&--inverted {
|
|
9
|
+
-webkit-filter: invert(100%);
|
|
10
|
+
filter: invert(100%);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.iconWrapper {
|
|
15
|
+
&--bordered {
|
|
16
|
+
border: solid 3px $orange;
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
padding: 1.75em;
|
|
19
|
+
width: -moz-fit-content;
|
|
20
|
+
width: fit-content;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes fade-in {
|
|
25
|
+
0% {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@keyframes spin {
|
|
31
|
+
100% {
|
|
32
|
+
transform: rotate(360deg);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.loop-icon {
|
|
37
|
+
animation: spin 0.6s linear infinite, fade-in 0.6s ease-out both;
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="wcl-loading">
|
|
3
|
+
<strong>Loading...</strong>
|
|
4
|
+
<b-spinner class="float-right"></b-spinner>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { BSpinner } from 'bootstrap-vue-next';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: 'Loading',
|
|
13
|
+
components: { BSpinner }
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Container from '../../Containers/Container/index.vue'
|
|
2
|
+
import Row from '../../Containers/Row/index.vue'
|
|
3
|
+
import Column from '../../Containers/Column/index.vue'
|
|
4
|
+
import VideoPlayer from './index.vue'
|
|
5
|
+
|
|
6
|
+
const mockData = {
|
|
7
|
+
videoId: '3FLapMJUmZQ',
|
|
8
|
+
provider: { YouTube: 'youtube', Vimeo: 'vimeo' }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'SubComponents/MediaPlayer',
|
|
13
|
+
component: { VideoPlayer, Container, Row, Column },
|
|
14
|
+
argTypes: {
|
|
15
|
+
videoId: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
},
|
|
18
|
+
provider: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: mockData.provider
|
|
21
|
+
},
|
|
22
|
+
rtl: {
|
|
23
|
+
control: 'boolean'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const MediaDefault = (args) => ({
|
|
29
|
+
components: { VideoPlayer, Container, Row, Column },
|
|
30
|
+
setup () {
|
|
31
|
+
return { args }
|
|
32
|
+
},
|
|
33
|
+
template: `
|
|
34
|
+
<container>
|
|
35
|
+
<row>
|
|
36
|
+
<column>
|
|
37
|
+
<video-player v-bind="args" />
|
|
38
|
+
</column>
|
|
39
|
+
</row>
|
|
40
|
+
</container>
|
|
41
|
+
`
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export const Youtube = MediaDefault.bind({})
|
|
45
|
+
|
|
46
|
+
Youtube.args = {
|
|
47
|
+
videoId: mockData.videoId,
|
|
48
|
+
provider: mockData.provider.YouTube,
|
|
49
|
+
rtl: false
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const Vimeo = MediaDefault.bind({})
|
|
53
|
+
|
|
54
|
+
Vimeo.args = {
|
|
55
|
+
videoId: '60139366',
|
|
56
|
+
provider: mockData.provider.Vimeo,
|
|
57
|
+
rtl: false
|
|
58
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="video-player"
|
|
4
|
+
:class="`${rtl ? 'rtl ' : ''}${' --type-' + provider}`"
|
|
5
|
+
>
|
|
6
|
+
<iframe
|
|
7
|
+
v-if="provider === 'youtube'"
|
|
8
|
+
class="videoFrame"
|
|
9
|
+
:src="
|
|
10
|
+
`https://www.youtube-nocookie.com/embed/${videoId}?iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1`
|
|
11
|
+
"
|
|
12
|
+
allowfullscreen
|
|
13
|
+
allowtransparency
|
|
14
|
+
allow="autoplay"
|
|
15
|
+
></iframe>
|
|
16
|
+
<iframe
|
|
17
|
+
v-if="provider === 'vimeo'"
|
|
18
|
+
class="videoFrame"
|
|
19
|
+
:src="
|
|
20
|
+
`https://player.vimeo.com/video/${videoId}?color=02819e&autopause=0&byline=0&dnt=1&fun=0&playsinline=0&portrait=0&title=0&transparent=0`
|
|
21
|
+
"
|
|
22
|
+
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen;"
|
|
23
|
+
allowtransparency
|
|
24
|
+
></iframe>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
export default {
|
|
30
|
+
name: 'VideoPlayer',
|
|
31
|
+
props: {
|
|
32
|
+
videoId: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
provider: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
rtl: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style lang="scss">
|
|
49
|
+
@import '../../../includes/scss/all';
|
|
50
|
+
.video-player {
|
|
51
|
+
position: relative;
|
|
52
|
+
min-height: 411px;
|
|
53
|
+
|
|
54
|
+
.videoFrame {
|
|
55
|
+
position: absolute;
|
|
56
|
+
border: 0;
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: 100%;
|
|
59
|
+
border-radius: 6px;
|
|
60
|
+
top: 0;
|
|
61
|
+
left: 0;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
right: 0;
|
|
64
|
+
}
|
|
65
|
+
&.rtl {
|
|
66
|
+
margin-left: auto;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import Pagination from './index.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'SubComponents/Pagination',
|
|
5
|
+
component: Pagination,
|
|
6
|
+
argTypes: {
|
|
7
|
+
ariaLabel: {
|
|
8
|
+
control: 'text',
|
|
9
|
+
table: {
|
|
10
|
+
disable: true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
rows: {
|
|
14
|
+
control: 'number',
|
|
15
|
+
},
|
|
16
|
+
offset: {
|
|
17
|
+
control: 'number',
|
|
18
|
+
table: {
|
|
19
|
+
disable: true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
total: {
|
|
23
|
+
control: 'number',
|
|
24
|
+
table: {
|
|
25
|
+
disable: true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
align: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
table: {
|
|
31
|
+
disable: true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
maxPages: {
|
|
35
|
+
control: 'number',
|
|
36
|
+
},
|
|
37
|
+
pageClicked: {
|
|
38
|
+
table: { disable: true }
|
|
39
|
+
},
|
|
40
|
+
next: {
|
|
41
|
+
table: { disable: true }
|
|
42
|
+
},
|
|
43
|
+
prev: {
|
|
44
|
+
table: { disable: true }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const curPage = 1
|
|
49
|
+
|
|
50
|
+
const DefaultPagination = (args) => ({
|
|
51
|
+
components: { Pagination },
|
|
52
|
+
setup () {
|
|
53
|
+
return { args }
|
|
54
|
+
},
|
|
55
|
+
data: () => ({
|
|
56
|
+
cPage: curPage,
|
|
57
|
+
items: [
|
|
58
|
+
{ name: 'A', id: '1' },
|
|
59
|
+
{ name: 'B', id: '2' },
|
|
60
|
+
{ name: 'C', id: '3' },
|
|
61
|
+
{ name: 'D', id: '4' },
|
|
62
|
+
{ name: 'E', id: '5' },
|
|
63
|
+
{ name: 'F', id: '6' },
|
|
64
|
+
{ name: 'G', id: '7' },
|
|
65
|
+
{ name: 'H', id: '8' },
|
|
66
|
+
{ name: 'I', id: '9' },
|
|
67
|
+
{ name: 'J', id: '10' },
|
|
68
|
+
{ name: 'K', id: '11' },
|
|
69
|
+
{ name: 'L', id: '12' },
|
|
70
|
+
{ name: 'M', id: '13' },
|
|
71
|
+
{ name: 'N', id: '14' },
|
|
72
|
+
{ name: 'O', id: '15' },
|
|
73
|
+
{ name: 'P', id: '16' },
|
|
74
|
+
{ name: 'Q', id: '17' },
|
|
75
|
+
{ name: 'R', id: '18' },
|
|
76
|
+
{ name: 'S', id: '19' },
|
|
77
|
+
{ name: 'T', id: '20' },
|
|
78
|
+
{ name: 'U', id: '21' },
|
|
79
|
+
{ name: 'V', id: '22' },
|
|
80
|
+
{ name: 'W', id: '23' },
|
|
81
|
+
{ name: 'X', id: '24' },
|
|
82
|
+
{ name: 'Y', id: '25' },
|
|
83
|
+
{ name: 'Z', id: '26' }
|
|
84
|
+
]
|
|
85
|
+
}),
|
|
86
|
+
methods: {
|
|
87
|
+
change({ currentPage }) {
|
|
88
|
+
this.cPage = currentPage
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
template: `
|
|
92
|
+
<div >
|
|
93
|
+
<h4>Sample Table data</h4>
|
|
94
|
+
<table id="no-more-tables" class="table-bordered border">
|
|
95
|
+
<tr v-for="(row, index) in items.slice(((cPage-1)*args.rows), ((cPage)*args.rows))" :key="index">
|
|
96
|
+
<td data-title="Name">{{row.name}}</td>
|
|
97
|
+
<td data-title="ID">{{row.id}}</td>
|
|
98
|
+
</tr>
|
|
99
|
+
</table>
|
|
100
|
+
<br/>
|
|
101
|
+
<pagination v-bind="args"
|
|
102
|
+
:total="items.length"
|
|
103
|
+
@prev="cPage = cPage - 1"
|
|
104
|
+
@next="cPage = cPage + 1"
|
|
105
|
+
@pageClicked="change"
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
`
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
export const Default = DefaultPagination.bind({})
|
|
112
|
+
|
|
113
|
+
Default.args = {
|
|
114
|
+
ariaLabel: 'aria-label',
|
|
115
|
+
rows: 7,
|
|
116
|
+
offset: 0,
|
|
117
|
+
align: 'start',
|
|
118
|
+
maxPages: 3
|
|
119
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="pagination" class="wcl-pagination">
|
|
3
|
+
<div class="information">{{ information }}</div>
|
|
4
|
+
<nav :aria-label="ariaLabel">
|
|
5
|
+
<ul :class="`pagination justify-content-${align}`">
|
|
6
|
+
<li class="wcl-pagination__page-item">
|
|
7
|
+
<cta-button
|
|
8
|
+
:type="'white'"
|
|
9
|
+
:text-only="true"
|
|
10
|
+
:slim="true"
|
|
11
|
+
class="wcl-pagination__page-link"
|
|
12
|
+
:class="currentPage === 1 ? 'disabled' : ''"
|
|
13
|
+
@clicked="() => (currentPage === 1 ? null : previous())"
|
|
14
|
+
>Previous
|
|
15
|
+
</cta-button>
|
|
16
|
+
</li>
|
|
17
|
+
<li
|
|
18
|
+
v-for="(p, i) in pagination.pages"
|
|
19
|
+
:key="i"
|
|
20
|
+
class="wcl-pagination__page-item"
|
|
21
|
+
>
|
|
22
|
+
<cta-button
|
|
23
|
+
:type="pagination.currentPage === p ? 'gray' : 'white'"
|
|
24
|
+
:text-only="true"
|
|
25
|
+
:slim="true"
|
|
26
|
+
class="wcl-pagination__page-link"
|
|
27
|
+
:aria-current="pagination.currentPage === p ? 'page' : false"
|
|
28
|
+
@clicked="() => pageChanged(p)"
|
|
29
|
+
>{{ p }}
|
|
30
|
+
</cta-button>
|
|
31
|
+
</li>
|
|
32
|
+
<li class="wcl-pagination__page-item">
|
|
33
|
+
<cta-button
|
|
34
|
+
:type="'white'"
|
|
35
|
+
:text-only="true"
|
|
36
|
+
:slim="true"
|
|
37
|
+
class="wcl-pagination__page-link"
|
|
38
|
+
:class="currentPage === pagination.totalPages ? 'disabled' : ''"
|
|
39
|
+
@clicked="
|
|
40
|
+
() => (currentPage === pagination.totalPages ? null : next())
|
|
41
|
+
"
|
|
42
|
+
>Next
|
|
43
|
+
</cta-button>
|
|
44
|
+
</li>
|
|
45
|
+
</ul>
|
|
46
|
+
</nav>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
<script>
|
|
50
|
+
import paginate from './pagination'
|
|
51
|
+
import CtaButton from '../../SubComponents/CtaButton/index.vue'
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
components: {
|
|
55
|
+
CtaButton
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
ariaLabel: {
|
|
59
|
+
type: String,
|
|
60
|
+
required: true
|
|
61
|
+
},
|
|
62
|
+
rows: {
|
|
63
|
+
type: Number,
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
offset: {
|
|
67
|
+
type: Number,
|
|
68
|
+
required: true
|
|
69
|
+
},
|
|
70
|
+
total: {
|
|
71
|
+
type: Number,
|
|
72
|
+
required: true
|
|
73
|
+
},
|
|
74
|
+
align: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: 'start'
|
|
77
|
+
},
|
|
78
|
+
maxPages: {
|
|
79
|
+
type: Number,
|
|
80
|
+
default: 5
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
data() {
|
|
84
|
+
return {
|
|
85
|
+
currentPage: 1
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
computed: {
|
|
89
|
+
pagination() {
|
|
90
|
+
const currentPaginationSnapshot = paginate(
|
|
91
|
+
this.total,
|
|
92
|
+
this.currentPage,
|
|
93
|
+
this.rows,
|
|
94
|
+
this.maxPages
|
|
95
|
+
)
|
|
96
|
+
return currentPaginationSnapshot
|
|
97
|
+
},
|
|
98
|
+
information() {
|
|
99
|
+
const totalPages = this.pagination.totalPages
|
|
100
|
+
return `${totalPages} pages of results`
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
watch: {
|
|
104
|
+
offset() {
|
|
105
|
+
if (this.offset === 0 && this.total > 0) {
|
|
106
|
+
this.currentPage = 1
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
mounted() {
|
|
111
|
+
if (this.offset === 0) {
|
|
112
|
+
this.currentPage = 1
|
|
113
|
+
} else {
|
|
114
|
+
this.currentPage = this.offset / this.rows + 1
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
methods: {
|
|
118
|
+
pageChanged(currentPage) {
|
|
119
|
+
if (this.currentPage !== currentPage) {
|
|
120
|
+
this.currentPage = currentPage
|
|
121
|
+
this.$emit('pageClicked', {
|
|
122
|
+
...this.pagination
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
next(el) {
|
|
127
|
+
this.currentPage += 1
|
|
128
|
+
this.$emit('next', {
|
|
129
|
+
...this.pagination
|
|
130
|
+
})
|
|
131
|
+
},
|
|
132
|
+
previous() {
|
|
133
|
+
this.currentPage -= 1
|
|
134
|
+
this.$emit('prev', {
|
|
135
|
+
...this.pagination
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
</script>
|
|
141
|
+
<style lang="scss" scoped>
|
|
142
|
+
@import '../../../includes/scss/all';
|
|
143
|
+
.wcl-pagination {
|
|
144
|
+
.information {
|
|
145
|
+
margin-bottom: 16px;
|
|
146
|
+
}
|
|
147
|
+
.pagination {
|
|
148
|
+
margin-bottom: 0;
|
|
149
|
+
}
|
|
150
|
+
$spacing: 6px;
|
|
151
|
+
&__page-item {
|
|
152
|
+
margin-right: $spacing;
|
|
153
|
+
&:first-child {
|
|
154
|
+
margin-right: $spacing * 2;
|
|
155
|
+
}
|
|
156
|
+
&:last-child {
|
|
157
|
+
margin-left: $spacing;
|
|
158
|
+
margin-right: 0px;
|
|
159
|
+
}
|
|
160
|
+
@media screen and (max-width: 539px) {
|
|
161
|
+
&:first-child,
|
|
162
|
+
&:last-child {
|
|
163
|
+
display: none;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&__page-link {
|
|
169
|
+
&:hover {
|
|
170
|
+
background: $lightgray;
|
|
171
|
+
}
|
|
172
|
+
&.active {
|
|
173
|
+
background: $black;
|
|
174
|
+
color: $white;
|
|
175
|
+
font-weight: 700;
|
|
176
|
+
border: 1px solid transparent;
|
|
177
|
+
}
|
|
178
|
+
&.disabled {
|
|
179
|
+
opacity: 0.4;
|
|
180
|
+
cursor: not-allowed;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// source: https://jasonwatmore.com/post/2018/08/07/javascript-pure-pagination-logic-in-vanilla-js-typescript
|
|
2
|
+
export default function paginate(totalItems, currentPage, pageSize, maxPages) {
|
|
3
|
+
// calculate total pages
|
|
4
|
+
let totalPages = Math.ceil(totalItems / pageSize)
|
|
5
|
+
|
|
6
|
+
// ensure current page isn't out of range
|
|
7
|
+
if (currentPage < 1) {
|
|
8
|
+
currentPage = 1
|
|
9
|
+
} else if (currentPage > totalPages) {
|
|
10
|
+
currentPage = totalPages
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let startPage, endPage
|
|
14
|
+
if (totalPages <= maxPages) {
|
|
15
|
+
// total pages less than max so show all pages
|
|
16
|
+
startPage = 1
|
|
17
|
+
endPage = totalPages
|
|
18
|
+
} else {
|
|
19
|
+
// total pages more than max so calculate start and end pages
|
|
20
|
+
let maxPagesBeforeCurrentPage = Math.floor(maxPages / 2)
|
|
21
|
+
let maxPagesAfterCurrentPage = Math.ceil(maxPages / 2) - 1
|
|
22
|
+
if (currentPage <= maxPagesBeforeCurrentPage) {
|
|
23
|
+
// current page near the start
|
|
24
|
+
startPage = 1
|
|
25
|
+
endPage = maxPages
|
|
26
|
+
} else if (currentPage + maxPagesAfterCurrentPage >= totalPages) {
|
|
27
|
+
// current page near the end
|
|
28
|
+
startPage = totalPages - maxPages + 1
|
|
29
|
+
endPage = totalPages
|
|
30
|
+
} else {
|
|
31
|
+
// current page somewhere in the middle
|
|
32
|
+
startPage = currentPage - maxPagesBeforeCurrentPage
|
|
33
|
+
endPage = currentPage + maxPagesAfterCurrentPage
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// calculate start and end item indexes
|
|
38
|
+
let startIndex = (currentPage - 1) * pageSize
|
|
39
|
+
let endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1)
|
|
40
|
+
|
|
41
|
+
// create an array of pages to ng-repeat in the pager control
|
|
42
|
+
let pages = Array.from(Array(endPage + 1 - startPage).keys()).map(
|
|
43
|
+
(i) => startPage + i
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
// return object with all pager properties required by the view
|
|
47
|
+
return {
|
|
48
|
+
totalItems: totalItems,
|
|
49
|
+
currentPage: currentPage,
|
|
50
|
+
pageSize: pageSize,
|
|
51
|
+
totalPages: totalPages,
|
|
52
|
+
startPage: startPage,
|
|
53
|
+
endPage: endPage,
|
|
54
|
+
startIndex: startIndex,
|
|
55
|
+
endIndex: endIndex,
|
|
56
|
+
pages: pages
|
|
57
|
+
}
|
|
58
|
+
}
|