@qhealth-design-system/core 1.0.38
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/.babelrc +15 -0
- package/.browserslistrc +5 -0
- package/.editorconfig +19 -0
- package/.eslintignore +1 -0
- package/.eslintrc +25 -0
- package/.gitattributes +2 -0
- package/.github/workflows/release_package.yml +103 -0
- package/CHANGELOG.md +14 -0
- package/README.md +534 -0
- package/dist/api/service_finder/schemas.json +1 -0
- package/dist/component-abstract.html +884 -0
- package/dist/component-accordion.html +1157 -0
- package/dist/component-banner.html +928 -0
- package/dist/component-banner_advanced.html +1524 -0
- package/dist/component-banner_basic.html +1189 -0
- package/dist/component-banner_intermediate.html +1288 -0
- package/dist/component-body.html +919 -0
- package/dist/component-breadcrumbs.html +881 -0
- package/dist/component-btn.html +829 -0
- package/dist/component-callout.html +964 -0
- package/dist/component-card_feature.html +1805 -0
- package/dist/component-card_multi_action.html +1965 -0
- package/dist/component-card_no_action.html +1632 -0
- package/dist/component-card_single_action.html +1772 -0
- package/dist/component-code.html +928 -0
- package/dist/component-footer.html +1131 -0
- package/dist/component-forms.html +1297 -0
- package/dist/component-global-elements.html +1243 -0
- package/dist/component-global_alert.html +891 -0
- package/dist/component-header.html +1155 -0
- package/dist/component-in_page_navigation.html +920 -0
- package/dist/component-internal_navigation.html +1097 -0
- package/dist/component-left_hand_navigation.html +995 -0
- package/dist/component-main_navigation.html +999 -0
- package/dist/component-mega_main_navigation.html +1145 -0
- package/dist/component-multi_column.html +1116 -0
- package/dist/component-page_alert.html +911 -0
- package/dist/component-pagination.html +971 -0
- package/dist/component-tag_list.html +979 -0
- package/dist/component-updated_date.html +778 -0
- package/dist/component-widgets.html +851 -0
- package/dist/components/_global/import.xml +95 -0
- package/dist/components/_global/manifest.json +11 -0
- package/dist/components/_global/presentation.js +50 -0
- package/dist/components/_global/static.html +30 -0
- package/dist/components/_template/import.xml +299 -0
- package/dist/components/_template/manifest.json +40 -0
- package/dist/components/_template/presentation.js +12 -0
- package/dist/components/_template/static.html +4 -0
- package/dist/components/abstract/import.xml +231 -0
- package/dist/components/abstract/manifest.json +29 -0
- package/dist/components/abstract/presentation.js +33 -0
- package/dist/components/abstract/static.html +9 -0
- package/dist/components/accordion/import.xml +1929 -0
- package/dist/components/accordion/manifest.json +427 -0
- package/dist/components/accordion/presentation.js +112 -0
- package/dist/components/accordion/static.html +56 -0
- package/dist/components/banner/import.xml +95 -0
- package/dist/components/banner/manifest.json +11 -0
- package/dist/components/banner/presentation.js +138 -0
- package/dist/components/banner/static.html +39 -0
- package/dist/components/banner_advanced/import.xml +1969 -0
- package/dist/components/banner_advanced/manifest.json +1450 -0
- package/dist/components/banner_advanced/presentation.js +564 -0
- package/dist/components/banner_advanced/static.html +159 -0
- package/dist/components/banner_basic/import.xml +907 -0
- package/dist/components/banner_basic/manifest.json +151 -0
- package/dist/components/banner_basic/presentation.js +325 -0
- package/dist/components/banner_basic/static.html +86 -0
- package/dist/components/banner_intermediate/import.xml +1473 -0
- package/dist/components/banner_intermediate/manifest.json +248 -0
- package/dist/components/banner_intermediate/presentation.js +410 -0
- package/dist/components/banner_intermediate/static.html +102 -0
- package/dist/components/body/import.xml +343 -0
- package/dist/components/body/manifest.json +46 -0
- package/dist/components/body/presentation.js +37 -0
- package/dist/components/body/static.html +5 -0
- package/dist/components/breadcrumbs/import.xml +95 -0
- package/dist/components/breadcrumbs/manifest.json +9 -0
- package/dist/components/breadcrumbs/presentation.js +99 -0
- package/dist/components/breadcrumbs/static.html +21 -0
- package/dist/components/callout/import.xml +953 -0
- package/dist/components/callout/manifest.json +121 -0
- package/dist/components/callout/presentation.js +103 -0
- package/dist/components/callout/static.html +10 -0
- package/dist/components/card_feature/import.xml +2355 -0
- package/dist/components/card_feature/manifest.json +1390 -0
- package/dist/components/card_feature/presentation.js +365 -0
- package/dist/components/card_feature/static.html +80 -0
- package/dist/components/card_multi_action/import.xml +1539 -0
- package/dist/components/card_multi_action/manifest.json +1314 -0
- package/dist/components/card_multi_action/presentation.js +638 -0
- package/dist/components/card_multi_action/static.html +120 -0
- package/dist/components/card_no_action/import.xml +1449 -0
- package/dist/components/card_no_action/manifest.json +1264 -0
- package/dist/components/card_no_action/presentation.js +454 -0
- package/dist/components/card_no_action/static.html +94 -0
- package/dist/components/card_single_action/import.xml +1539 -0
- package/dist/components/card_single_action/manifest.json +1273 -0
- package/dist/components/card_single_action/presentation.js +498 -0
- package/dist/components/card_single_action/static.html +103 -0
- package/dist/components/code/import.xml +569 -0
- package/dist/components/code/manifest.json +112 -0
- package/dist/components/code/presentation.js +124 -0
- package/dist/components/code/static.html +15 -0
- package/dist/components/footer/import.xml +95 -0
- package/dist/components/footer/manifest.json +9 -0
- package/dist/components/footer/presentation.js +409 -0
- package/dist/components/footer/static.html +146 -0
- package/dist/components/global_alert/import.xml +95 -0
- package/dist/components/global_alert/manifest.json +9 -0
- package/dist/components/global_alert/presentation.js +81 -0
- package/dist/components/global_alert/static.html +26 -0
- package/dist/components/header/import.xml +95 -0
- package/dist/components/header/manifest.json +11 -0
- package/dist/components/header/presentation.js +190 -0
- package/dist/components/header/static.html +158 -0
- package/dist/components/horizontal_rule/import.xml +547 -0
- package/dist/components/horizontal_rule/manifest.json +69 -0
- package/dist/components/horizontal_rule/presentation.js +50 -0
- package/dist/components/horizontal_rule/static.html +4 -0
- package/dist/components/in_page_navigation/import.xml +253 -0
- package/dist/components/in_page_navigation/manifest.json +35 -0
- package/dist/components/in_page_navigation/presentation.js +14 -0
- package/dist/components/in_page_navigation/static.html +13 -0
- package/dist/components/internal_navigation/import.xml +95 -0
- package/dist/components/internal_navigation/manifest.json +11 -0
- package/dist/components/internal_navigation/presentation.js +165 -0
- package/dist/components/internal_navigation/static.html +130 -0
- package/dist/components/left_hand_navigation/import.xml +299 -0
- package/dist/components/left_hand_navigation/manifest.json +40 -0
- package/dist/components/left_hand_navigation/presentation.js +178 -0
- package/dist/components/left_hand_navigation/static.html +64 -0
- package/dist/components/main_navigation/import.xml +95 -0
- package/dist/components/main_navigation/manifest.json +11 -0
- package/dist/components/main_navigation/presentation.js +150 -0
- package/dist/components/main_navigation/static.html +80 -0
- package/dist/components/mega_main_navigation/import.xml +95 -0
- package/dist/components/mega_main_navigation/manifest.json +9 -0
- package/dist/components/mega_main_navigation/presentation.js +380 -0
- package/dist/components/mega_main_navigation/static.html +153 -0
- package/dist/components/multi_column/import.xml +1631 -0
- package/dist/components/multi_column/manifest.json +233 -0
- package/dist/components/multi_column/presentation.js +249 -0
- package/dist/components/multi_column/static.html +36 -0
- package/dist/components/page_alert/import.xml +479 -0
- package/dist/components/page_alert/manifest.json +63 -0
- package/dist/components/page_alert/presentation.js +67 -0
- package/dist/components/page_alert/static.html +8 -0
- package/dist/components/pagination/import.xml +95 -0
- package/dist/components/pagination/manifest.json +42 -0
- package/dist/components/pagination/presentation.js +84 -0
- package/dist/components/pagination/static.html +5 -0
- package/dist/components/updated_date/import.xml +95 -0
- package/dist/components/updated_date/manifest.json +9 -0
- package/dist/components/updated_date/presentation.js +34 -0
- package/dist/components/updated_date/static.html +6 -0
- package/dist/components/widgets/import.xml +95 -0
- package/dist/components/widgets/manifest.json +9 -0
- package/dist/components/widgets/presentation.js +40 -0
- package/dist/components/widgets/static.html +0 -0
- package/dist/components.html +790 -0
- package/dist/externals/componentPreview.js +101 -0
- package/dist/externals/dsComponentLoader.js +410 -0
- package/dist/externals/esri-leaflet-vector.js +5 -0
- package/dist/externals/esri-leaflet.js +12 -0
- package/dist/externals/fb-handlebars.min.js +29 -0
- package/dist/externals/fb-typeahead.bundle.min.js +6 -0
- package/dist/externals/funnelback.autocompletion-2.6.0.js +678 -0
- package/dist/externals/getPagination.js +62 -0
- package/dist/externals/handlebars.min-v4.7.6.js +29 -0
- package/dist/externals/leaflet.js +6 -0
- package/dist/externals/populateDatastoreSim.js +381 -0
- package/dist/externals/tinymce_classes.css +62 -0
- package/dist/home.html +694 -0
- package/dist/index.html +710 -0
- package/dist/inner-with-nav.html +1853 -0
- package/dist/inner.html +671 -0
- package/dist/js/helpers.js +892 -0
- package/dist/js/main.js +55 -0
- package/dist/js/main.js.map +1 -0
- package/dist/js/runtime.js +2 -0
- package/dist/js/runtime.js.map +1 -0
- package/dist/main.css +918 -0
- package/dist/main.css.map +1 -0
- package/dist/mysource_files/ajax-loader.gif +0 -0
- package/dist/mysource_files/favicons/favicon.ico +0 -0
- package/dist/mysource_files/img/100x100.jpg +0 -0
- package/dist/mysource_files/img/600x260.jpg +0 -0
- package/dist/mysource_files/img/Heart-Pattern-Dark.png +0 -0
- package/dist/mysource_files/img/Heart-Pattern.png +0 -0
- package/dist/mysource_files/img/banner-background--desktop.png +0 -0
- package/dist/mysource_files/img/banner-background--mobile.png +0 -0
- package/dist/mysource_files/img/banner-bg.png +0 -0
- package/dist/mysource_files/img/banner.png +0 -0
- package/dist/mysource_files/img/card--brand.png +0 -0
- package/dist/mysource_files/img/card--components.png +0 -0
- package/dist/mysource_files/img/card--content.png +0 -0
- package/dist/mysource_files/img/header-logo-agov.png +0 -0
- package/dist/mysource_files/img/header-logo-qgov--dark.svg +63 -0
- package/dist/mysource_files/img/header-logo-qgov--light.svg +56 -0
- package/dist/mysource_files/img/header-logo-qgov--pre-dark.svg +56 -0
- package/dist/mysource_files/img/header-search.svg +3 -0
- package/dist/mysource_files/img/layers-2x.png +0 -0
- package/dist/mysource_files/img/layers.png +0 -0
- package/dist/mysource_files/img/marker-icon.png +0 -0
- package/dist/mysource_files/img/svg-icons.svg +155 -0
- package/dist/mysource_files/img/video-play.svg +3 -0
- package/dist/mysource_files/slick.eot +0 -0
- package/dist/mysource_files/slick.svg +14 -0
- package/dist/mysource_files/slick.ttf +0 -0
- package/dist/mysource_files/slick.woff +0 -0
- package/package-lock.json +14276 -0
- package/package.json +79 -0
- package/scripts/add_component.sh +109 -0
- package/src/assets/favicons/favicon.ico +0 -0
- package/src/assets/img/100x100.jpg +0 -0
- package/src/assets/img/600x260.jpg +0 -0
- package/src/assets/img/Heart-Pattern-Dark.png +0 -0
- package/src/assets/img/Heart-Pattern.png +0 -0
- package/src/assets/img/banner-background--desktop.png +0 -0
- package/src/assets/img/banner-background--mobile.png +0 -0
- package/src/assets/img/banner-bg.png +0 -0
- package/src/assets/img/banner.png +0 -0
- package/src/assets/img/card--brand.png +0 -0
- package/src/assets/img/card--components.png +0 -0
- package/src/assets/img/card--content.png +0 -0
- package/src/assets/img/header-logo-agov.png +0 -0
- package/src/assets/img/header-logo-qgov--dark.svg +63 -0
- package/src/assets/img/header-logo-qgov--light.svg +56 -0
- package/src/assets/img/header-logo-qgov--pre-dark.svg +56 -0
- package/src/assets/img/header-search.svg +3 -0
- package/src/assets/img/layers-2x.png +0 -0
- package/src/assets/img/layers.png +0 -0
- package/src/assets/img/marker-icon.png +0 -0
- package/src/assets/img/svg-icons.svg +155 -0
- package/src/assets/img/video-play.svg +3 -0
- package/src/components/_global/css/admin/component.scss +71 -0
- package/src/components/_global/css/body/component.scss +897 -0
- package/src/components/_global/css/btn/component.scss +564 -0
- package/src/components/_global/css/cta_links/component.scss +121 -0
- package/src/components/_global/css/direction_links/component.scss +196 -0
- package/src/components/_global/css/example/component.scss +54 -0
- package/src/components/_global/css/forms/control_inputs/component.scss +349 -0
- package/src/components/_global/css/forms/general/component.scss +298 -0
- package/src/components/_global/css/forms/select/component.scss +230 -0
- package/src/components/_global/css/forms/text/component.scss +402 -0
- package/src/components/_global/css/global.scss +42 -0
- package/src/components/_global/css/grid-12/component.scss +331 -0
- package/src/components/_global/css/headings/component.scss +172 -0
- package/src/components/_global/css/icons/component.scss +29 -0
- package/src/components/_global/css/link_columns/component.scss +194 -0
- package/src/components/_global/css/link_list/component.scss +37 -0
- package/src/components/_global/css/modal/component.scss +182 -0
- package/src/components/_global/css/slick/component.scss +25 -0
- package/src/components/_global/css/table/component.scss +211 -0
- package/src/components/_global/css/tabs/component.scss +43 -0
- package/src/components/_global/css/tags/component.scss +272 -0
- package/src/components/_global/css/user_location/component.scss +38 -0
- package/src/components/_global/css/version/component.scss +47 -0
- package/src/components/_global/html/component.hbs +108 -0
- package/src/components/_global/html/ds_component.hbs +30 -0
- package/src/components/_global/html/head.html +63 -0
- package/src/components/_global/html/scripts.html +58 -0
- package/src/components/_global/js/_polyfills/global.js +18 -0
- package/src/components/_global/js/animate/global.js +324 -0
- package/src/components/_global/js/forms/global.js +182 -0
- package/src/components/_global/js/global.js +302 -0
- package/src/components/_global/js/manifest.json +11 -0
- package/src/components/_global/js/modal/global.js +236 -0
- package/src/components/_global/js/slick/global.js +153 -0
- package/src/components/_global/js/tabs/global.js +305 -0
- package/src/components/_global/js/user_location/global.js +116 -0
- package/src/components/_template/css/component.scss +22 -0
- package/src/components/_template/html/component-page.html +85 -0
- package/src/components/_template/html/component.hbs +4 -0
- package/src/components/_template/js/global.js +6 -0
- package/src/components/_template/js/manifest.json +40 -0
- package/src/components/abstract/css/component.scss +91 -0
- package/src/components/abstract/html/component.hbs +9 -0
- package/src/components/abstract/js/manifest.json +29 -0
- package/src/components/accordion/css/component.scss +329 -0
- package/src/components/accordion/html/accordion-group.html +157 -0
- package/src/components/accordion/html/component.hbs +46 -0
- package/src/components/accordion/html/default.html +92 -0
- package/src/components/accordion/js/global.js +413 -0
- package/src/components/accordion/js/manifest.json +427 -0
- package/src/components/banner/css/component.scss +664 -0
- package/src/components/banner/html/component.hbs +52 -0
- package/src/components/banner/js/manifest.json +11 -0
- package/src/components/banner_advanced/css/component.scss +7 -0
- package/src/components/banner_advanced/html/component.hbs +213 -0
- package/src/components/banner_advanced/js/global.js +6 -0
- package/src/components/banner_advanced/js/manifest.json +1450 -0
- package/src/components/banner_basic/css/component.scss +52 -0
- package/src/components/banner_basic/html/component.hbs +130 -0
- package/src/components/banner_basic/js/global.js +6 -0
- package/src/components/banner_basic/js/manifest.json +151 -0
- package/src/components/banner_intermediate/css/component.scss +276 -0
- package/src/components/banner_intermediate/html/component.hbs +165 -0
- package/src/components/banner_intermediate/js/global.js +6 -0
- package/src/components/banner_intermediate/js/manifest.json +248 -0
- package/src/components/body/css/component.scss +16 -0
- package/src/components/body/html/component.hbs +5 -0
- package/src/components/body/js/manifest.json +46 -0
- package/src/components/breadcrumbs/css/component.scss +236 -0
- package/src/components/breadcrumbs/html/component.hbs +29 -0
- package/src/components/breadcrumbs/js/manifest.json +9 -0
- package/src/components/callout/css/component.scss +146 -0
- package/src/components/callout/html/component.hbs +28 -0
- package/src/components/callout/js/manifest.json +121 -0
- package/src/components/card_feature/css/component.scss +224 -0
- package/src/components/card_feature/html/component.hbs +129 -0
- package/src/components/card_feature/js/manifest.json +1390 -0
- package/src/components/card_multi_action/css/component.scss +229 -0
- package/src/components/card_multi_action/html/component.hbs +192 -0
- package/src/components/card_multi_action/js/manifest.json +1314 -0
- package/src/components/card_no_action/css/component.scss +551 -0
- package/src/components/card_no_action/html/component.hbs +127 -0
- package/src/components/card_no_action/js/global.js +6 -0
- package/src/components/card_no_action/js/manifest.json +1264 -0
- package/src/components/card_single_action/css/component.scss +164 -0
- package/src/components/card_single_action/html/component.hbs +161 -0
- package/src/components/card_single_action/js/manifest.json +1273 -0
- package/src/components/code/css/component.scss +355 -0
- package/src/components/code/html/component.hbs +84 -0
- package/src/components/code/js/global.js +160 -0
- package/src/components/code/js/manifest.json +112 -0
- package/src/components/footer/css/component.scss +437 -0
- package/src/components/footer/html/component.hbs +177 -0
- package/src/components/footer/js/manifest.json +9 -0
- package/src/components/global_alert/css/component.scss +169 -0
- package/src/components/global_alert/html/component.hbs +38 -0
- package/src/components/global_alert/js/global.js +39 -0
- package/src/components/global_alert/js/manifest.json +9 -0
- package/src/components/header/css/component.scss +697 -0
- package/src/components/header/html/component.hbs +186 -0
- package/src/components/header/js/global.js +188 -0
- package/src/components/header/js/manifest.json +11 -0
- package/src/components/horizontal_rule/css/component.scss +37 -0
- package/src/components/horizontal_rule/html/component.hbs +6 -0
- package/src/components/horizontal_rule/js/manifest.json +69 -0
- package/src/components/in_page_navigation/css/component.scss +54 -0
- package/src/components/in_page_navigation/html/component.hbs +17 -0
- package/src/components/in_page_navigation/js/global.js +51 -0
- package/src/components/in_page_navigation/js/manifest.json +35 -0
- package/src/components/internal_navigation/css/component.scss +437 -0
- package/src/components/internal_navigation/html/component.hbs +57 -0
- package/src/components/internal_navigation/js/manifest.json +11 -0
- package/src/components/left_hand_navigation/css/component.scss +280 -0
- package/src/components/left_hand_navigation/html/component.hbs +77 -0
- package/src/components/left_hand_navigation/js/global.js +36 -0
- package/src/components/left_hand_navigation/js/manifest.json +40 -0
- package/src/components/main_navigation/css/component.scss +706 -0
- package/src/components/main_navigation/html/component.hbs +87 -0
- package/src/components/main_navigation/js/global.js +373 -0
- package/src/components/main_navigation/js/manifest.json +11 -0
- package/src/components/mega_main_navigation/css/component.scss +535 -0
- package/src/components/mega_main_navigation/html/component.hbs +157 -0
- package/src/components/mega_main_navigation/js/global.js +170 -0
- package/src/components/mega_main_navigation/js/manifest.json +9 -0
- package/src/components/multi_column/css/component.scss +11 -0
- package/src/components/multi_column/html/component.hbs +98 -0
- package/src/components/multi_column/js/manifest.json +233 -0
- package/src/components/page_alert/css/component.scss +132 -0
- package/src/components/page_alert/html/component.hbs +26 -0
- package/src/components/page_alert/js/manifest.json +63 -0
- package/src/components/pagination/css/component.scss +196 -0
- package/src/components/pagination/html/component.hbs +41 -0
- package/src/components/pagination/html/default.html +30 -0
- package/src/components/pagination/js/manifest.json +42 -0
- package/src/components/search_box/css/component.scss +48 -0
- package/src/components/search_box/html/component.html +11 -0
- package/src/components/search_box/js/manifest.json +73 -0
- package/src/components/updated_date/css/component.scss +0 -0
- package/src/components/updated_date/html/component.hbs +31 -0
- package/src/components/updated_date/js/manifest.json +9 -0
- package/src/components/widgets/css/component.scss +82 -0
- package/src/components/widgets/html/component.hbs +19 -0
- package/src/components/widgets/html/default.html +4 -0
- package/src/components/widgets/js/current.json +483 -0
- package/src/components/widgets/js/manifest.json +9 -0
- package/src/components/widgets/js/site.json +358 -0
- package/src/data/current.json +522 -0
- package/src/data/current_admin.json +305 -0
- package/src/data/model_component.js +14 -0
- package/src/data/site.json +762 -0
- package/src/externals/componentPreview.js +101 -0
- package/src/externals/dsComponentLoader.js +410 -0
- package/src/externals/esri-leaflet-vector.js +5 -0
- package/src/externals/esri-leaflet.js +12 -0
- package/src/externals/fb-handlebars.min.js +29 -0
- package/src/externals/fb-typeahead.bundle.min.js +6 -0
- package/src/externals/funnelback.autocompletion-2.6.0.js +678 -0
- package/src/externals/getPagination.js +62 -0
- package/src/externals/handlebars.min-v4.7.6.js +29 -0
- package/src/externals/leaflet.js +6 -0
- package/src/externals/populateDatastoreSim.js +381 -0
- package/src/externals/tinymce_classes.css +62 -0
- package/src/helpers/Handlebars/appendIf.js +6 -0
- package/src/helpers/Handlebars/arrayLength.js +3 -0
- package/src/helpers/Handlebars/arrayWith.js +13 -0
- package/src/helpers/Handlebars/capitaliseFirst.js +8 -0
- package/src/helpers/Handlebars/charMax.js +8 -0
- package/src/helpers/Handlebars/checkIf.js +20 -0
- package/src/helpers/Handlebars/columnWidth.js +39 -0
- package/src/helpers/Handlebars/contains.js +7 -0
- package/src/helpers/Handlebars/createMap.js +19 -0
- package/src/helpers/Handlebars/dsMapFromID.js +8 -0
- package/src/helpers/Handlebars/dsMapFromProp.js +8 -0
- package/src/helpers/Handlebars/eachByName.js +18 -0
- package/src/helpers/Handlebars/eachDS.js +7 -0
- package/src/helpers/Handlebars/eachFrom.js +13 -0
- package/src/helpers/Handlebars/eachUpTo.js +8 -0
- package/src/helpers/Handlebars/eachWhen.js +33 -0
- package/src/helpers/Handlebars/formatDate.js +62 -0
- package/src/helpers/Handlebars/generateDates.js +74 -0
- package/src/helpers/Handlebars/getDistance.js +40 -0
- package/src/helpers/Handlebars/getObject.js +3 -0
- package/src/helpers/Handlebars/getParamaterByName.js +11 -0
- package/src/helpers/Handlebars/getPossibleValues.js +13 -0
- package/src/helpers/Handlebars/getProp.js +3 -0
- package/src/helpers/Handlebars/getTags.js +20 -0
- package/src/helpers/Handlebars/getTitle.js +4 -0
- package/src/helpers/Handlebars/ifAny.js +9 -0
- package/src/helpers/Handlebars/ifArray.js +3 -0
- package/src/helpers/Handlebars/ifCond.js +31 -0
- package/src/helpers/Handlebars/ifEqualsOrChained.js +12 -0
- package/src/helpers/Handlebars/ifProp.js +3 -0
- package/src/helpers/Handlebars/if_eq.js +9 -0
- package/src/helpers/Handlebars/inArray.js +8 -0
- package/src/helpers/Handlebars/isPage.js +7 -0
- package/src/helpers/Handlebars/itemAt.js +11 -0
- package/src/helpers/Handlebars/jsonParse.js +8 -0
- package/src/helpers/Handlebars/jsonStringify.js +3 -0
- package/src/helpers/Handlebars/listAZ.js +51 -0
- package/src/helpers/Handlebars/listAZOptions.js +34 -0
- package/src/helpers/Handlebars/listByClosest.js +60 -0
- package/src/helpers/Handlebars/listByClosestWithOffset.js +63 -0
- package/src/helpers/Handlebars/math.js +11 -0
- package/src/helpers/Handlebars/newLineToBreak.js +6 -0
- package/src/helpers/Handlebars/nonBreakingSpaces.js +6 -0
- package/src/helpers/Handlebars/objectFromSelect.js +21 -0
- package/src/helpers/Handlebars/partialReplace.js +9 -0
- package/src/helpers/Handlebars/printAccordion.js +24 -0
- package/src/helpers/Handlebars/replace.js +8 -0
- package/src/helpers/Handlebars/replaceMany.js +5 -0
- package/src/helpers/Handlebars/sizeFormat.js +11 -0
- package/src/helpers/Handlebars/split.js +6 -0
- package/src/helpers/Handlebars/toUpperCase.js +7 -0
- package/src/helpers/Handlebars/urldecode.js +3 -0
- package/src/helpers/Handlebars/urlencode.js +3 -0
- package/src/helpers/Handlebars/withinObject.js +13 -0
- package/src/html/component-abstract.html +86 -0
- package/src/html/component-accordion.html +87 -0
- package/src/html/component-banner.html +84 -0
- package/src/html/component-banner_advanced.html +97 -0
- package/src/html/component-banner_basic.html +163 -0
- package/src/html/component-banner_intermediate.html +91 -0
- package/src/html/component-body.html +116 -0
- package/src/html/component-breadcrumbs.html +88 -0
- package/src/html/component-btn.html +117 -0
- package/src/html/component-callout.html +86 -0
- package/src/html/component-card_feature.html +631 -0
- package/src/html/component-card_multi_action.html +793 -0
- package/src/html/component-card_no_action.html +521 -0
- package/src/html/component-card_single_action.html +631 -0
- package/src/html/component-code.html +84 -0
- package/src/html/component-footer.html +87 -0
- package/src/html/component-forms.html +585 -0
- package/src/html/component-global-elements.html +531 -0
- package/src/html/component-global_alert.html +87 -0
- package/src/html/component-header.html +88 -0
- package/src/html/component-in_page_navigation.html +109 -0
- package/src/html/component-internal_navigation.html +87 -0
- package/src/html/component-left_hand_navigation.html +85 -0
- package/src/html/component-main_navigation.html +87 -0
- package/src/html/component-mega_main_navigation.html +88 -0
- package/src/html/component-multi_column.html +86 -0
- package/src/html/component-page_alert.html +86 -0
- package/src/html/component-pagination.html +86 -0
- package/src/html/component-tag_list.html +340 -0
- package/src/html/component-updated_date.html +88 -0
- package/src/html/component-widgets.html +90 -0
- package/src/html/components.html +136 -0
- package/src/html/home.html +126 -0
- package/src/html/index.html +142 -0
- package/src/html/inner-with-nav.html +1126 -0
- package/src/html/inner.html +107 -0
- package/src/index.js +12 -0
- package/src/styles/global.scss +120 -0
- package/src/styles/imports/figma.scss +0 -0
- package/src/styles/imports/functions.scss +519 -0
- package/src/styles/imports/mixins.scss +658 -0
- package/src/styles/imports/placeholders.scss +68 -0
- package/src/styles/imports/utilities.scss +185 -0
- package/src/styles/imports/variables.scss +484 -0
- package/src/styles/postcss.config.js +4 -0
- package/webpack/JsonMergePlugin.js +35 -0
- package/webpack/PrecompilePlugin.js +369 -0
- package/webpack/webpack.common.js +151 -0
- package/webpack/webpack.dev.js +54 -0
- package/webpack/webpack.prod.js +70 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
(function(QLD) {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The main namespace for all QLDDS functions and variables
|
|
6
|
+
* @module _global
|
|
7
|
+
*/
|
|
8
|
+
var QLD = QLD ? QLD : {};
|
|
9
|
+
QLD.utils = {
|
|
10
|
+
/**
|
|
11
|
+
* Add 'js' body class if JS is enabled on the page
|
|
12
|
+
*
|
|
13
|
+
* @memberof module:_global
|
|
14
|
+
*/
|
|
15
|
+
'browserJS': function() {
|
|
16
|
+
document.querySelector("html").classList.remove("no-js");
|
|
17
|
+
document.querySelector("html").classList.add("js");
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns a function, that, as long as it continues to be invoked, will not
|
|
22
|
+
* be triggered. The function will be called after it stops being called for
|
|
23
|
+
* N milliseconds. If `immediate` is passed, trigger the function on the
|
|
24
|
+
* leading edge, instead of the trailing.
|
|
25
|
+
* https://davidwalsh.name/javascript-debounce-function
|
|
26
|
+
*
|
|
27
|
+
* @memberof module:_global
|
|
28
|
+
*
|
|
29
|
+
* @param {function} func
|
|
30
|
+
* @param {number} wait
|
|
31
|
+
* @param {boolean} immediate
|
|
32
|
+
*
|
|
33
|
+
* @returns {function}
|
|
34
|
+
*/
|
|
35
|
+
'debounce': function (func, wait, immediate) {
|
|
36
|
+
var timeout;
|
|
37
|
+
return function () {
|
|
38
|
+
var context = this,
|
|
39
|
+
args = arguments;
|
|
40
|
+
var later = function () {
|
|
41
|
+
timeout = null;
|
|
42
|
+
if (!immediate) func.apply(context, args);
|
|
43
|
+
};
|
|
44
|
+
var callNow = immediate && !timeout;
|
|
45
|
+
clearTimeout(timeout);
|
|
46
|
+
timeout = setTimeout(later, wait);
|
|
47
|
+
if (callNow) func.apply(context, args);
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Convert nodeList to Array (for IE11)
|
|
53
|
+
*
|
|
54
|
+
* @memberof module:_global
|
|
55
|
+
*
|
|
56
|
+
* @param {*} node_list
|
|
57
|
+
*
|
|
58
|
+
* @returns {Node[]}
|
|
59
|
+
*/
|
|
60
|
+
'listToArray': function(node_list) {
|
|
61
|
+
return Array.prototype.slice.call(node_list);
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Set browser cookie
|
|
66
|
+
*
|
|
67
|
+
* @memberof module:_global
|
|
68
|
+
*
|
|
69
|
+
* @param {string} cookie_name
|
|
70
|
+
* @param {string} cookie_value
|
|
71
|
+
*/
|
|
72
|
+
'setCookie': function(cookie_name, cookie_value) {
|
|
73
|
+
var cookie_entry = cookie_name + '=' + encodeURIComponent(cookie_value) + ';';
|
|
74
|
+
document.cookie = cookie_entry + '; path=/;';
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Get browser cookie
|
|
78
|
+
*
|
|
79
|
+
* @memberof module:_global
|
|
80
|
+
*
|
|
81
|
+
* @param {string} cookie_name
|
|
82
|
+
*
|
|
83
|
+
* @returns {c_value}
|
|
84
|
+
*/
|
|
85
|
+
'getCookie': function(cookie_name) {
|
|
86
|
+
var c_value = " " + document.cookie;
|
|
87
|
+
var c_start = c_value.indexOf(" " + cookie_name + "=");
|
|
88
|
+
if (c_start == -1) {
|
|
89
|
+
c_value = null;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
c_start = c_value.indexOf("=", c_start) + 1;
|
|
93
|
+
var c_end = c_value.indexOf(";", c_start);
|
|
94
|
+
if (c_end == -1) {
|
|
95
|
+
c_end = c_value.length;
|
|
96
|
+
}
|
|
97
|
+
c_value = unescape(c_value.substring(c_start,c_end));
|
|
98
|
+
}
|
|
99
|
+
return c_value;
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* Set browser local storage
|
|
103
|
+
*
|
|
104
|
+
* @memberof module:_global
|
|
105
|
+
*
|
|
106
|
+
* @param {string} storage_key
|
|
107
|
+
* @param {string} storage_value
|
|
108
|
+
*/
|
|
109
|
+
'setLocalStorage': function(storage_key, storage_value) {
|
|
110
|
+
if (typeof(storage_value) !== 'string') {
|
|
111
|
+
storage_value = JSON.stringify(storage_value);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
localStorage.setItem(storage_key, storage_value);
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* Get browser local storage from key
|
|
118
|
+
*
|
|
119
|
+
* @memberof module:_global
|
|
120
|
+
*
|
|
121
|
+
* @param {string} storage_key
|
|
122
|
+
*
|
|
123
|
+
* @returns {localStorage.getItem(storage_key)}
|
|
124
|
+
*/
|
|
125
|
+
'getLocalStorage': function(storage_key) {
|
|
126
|
+
return localStorage.getItem(storage_key);
|
|
127
|
+
},
|
|
128
|
+
/**
|
|
129
|
+
* Remove browser local storage item by key
|
|
130
|
+
*
|
|
131
|
+
* @memberof module:_global
|
|
132
|
+
*
|
|
133
|
+
* @param {string} storage_key
|
|
134
|
+
*/
|
|
135
|
+
'removeLocalStorage': function(storage_key) {
|
|
136
|
+
localStorage.removeItem(storage_key);
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* Determine the location of the user using HTML5 geolocation
|
|
140
|
+
*
|
|
141
|
+
* @memberof module:_global
|
|
142
|
+
*
|
|
143
|
+
* @param {Boolean} override
|
|
144
|
+
* @param {function} errorCallback
|
|
145
|
+
*/
|
|
146
|
+
'geolocateUser': function(override, errorCallback) {
|
|
147
|
+
|
|
148
|
+
var userLocationStorage = QLD.utils.getLocalStorage('qld_user_location');
|
|
149
|
+
if(userLocationStorage !== null && !override) {
|
|
150
|
+
return JSON.parse(userLocationStorage);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (navigator.geolocation) {
|
|
154
|
+
|
|
155
|
+
QLD.utils.setLoadingState(true);
|
|
156
|
+
navigator.geolocation.getCurrentPosition(function(position) {
|
|
157
|
+
var location = {
|
|
158
|
+
"latitude": position.coords.latitude,
|
|
159
|
+
"longitude": position.coords.longitude,
|
|
160
|
+
"isGeolocated": true,
|
|
161
|
+
"location": ''
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
QLD.utils.setUserLocation(location);
|
|
165
|
+
QLD.utils.removeLocalStorage('deny-location');
|
|
166
|
+
return `${position.coords.latitude},${position.coords.longitude}`;
|
|
167
|
+
}, function(error) {
|
|
168
|
+
console.log(error);
|
|
169
|
+
QLD.utils.setLoadingState(false);
|
|
170
|
+
if (errorCallback) {
|
|
171
|
+
errorCallback();
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
}, { timeout: 10000 });
|
|
175
|
+
|
|
176
|
+
} else {
|
|
177
|
+
console.log('Unable to locate');
|
|
178
|
+
if (errorCallback) {
|
|
179
|
+
errorCallback();
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Set the user location, including the HHS
|
|
187
|
+
*
|
|
188
|
+
* @memberof module:_global
|
|
189
|
+
*
|
|
190
|
+
* @param {object} location
|
|
191
|
+
*/
|
|
192
|
+
'setUserLocation': function(location, refresh = true) {
|
|
193
|
+
// If there is a site-wide HHS configured
|
|
194
|
+
var hhsDiv = document.getElementById('qld__hhs');
|
|
195
|
+
|
|
196
|
+
if (hhsDiv !== null && typeof(serviceFinderData) !== 'undefined') {
|
|
197
|
+
var hhsId = hhsDiv.getAttribute('data-hhs');
|
|
198
|
+
serviceFinderData.collection('hhs').doc(hhsId).get().then((response) => {
|
|
199
|
+
location.hhs_id = hhsId;
|
|
200
|
+
location.hhs_name = response.name;
|
|
201
|
+
|
|
202
|
+
QLD.utils.setUserLocationInStorage(location, refresh);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
} else {
|
|
206
|
+
QLD.utils.setUserLocationInStorage(location, refresh);
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Set the 'qld_user_location' cookie based on a provided location object
|
|
212
|
+
*
|
|
213
|
+
* @memberof module:_global
|
|
214
|
+
*
|
|
215
|
+
*/
|
|
216
|
+
'setUserLocationInStorage': function(newLocation, refresh) {
|
|
217
|
+
QLD.utils.setLocalStorage('qld_user_location', JSON.stringify(newLocation));
|
|
218
|
+
|
|
219
|
+
if(refresh) {
|
|
220
|
+
QLD.utils.setLoadingState(true);
|
|
221
|
+
|
|
222
|
+
setTimeout(function() {
|
|
223
|
+
window.location.reload(false);
|
|
224
|
+
}, 300);
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
/**
|
|
228
|
+
* Check the 'qld_user_location' cookie to determine
|
|
229
|
+
* whether the user is geolocated
|
|
230
|
+
*
|
|
231
|
+
* @memberof module:_global
|
|
232
|
+
*
|
|
233
|
+
* @return {boolean}
|
|
234
|
+
*
|
|
235
|
+
*/
|
|
236
|
+
'isGeolocated': function() {
|
|
237
|
+
var userLocationStorage = QLD.utils.getLocalStorage('qld_user_location');
|
|
238
|
+
var userLocationData = {};
|
|
239
|
+
|
|
240
|
+
if(userLocationStorage !== null) {
|
|
241
|
+
userLocationData = JSON.parse(userLocationStorage);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if(Object.keys(userLocationData).length > 0) {
|
|
245
|
+
|
|
246
|
+
return userLocationData.isGeolocated;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return false;
|
|
250
|
+
},
|
|
251
|
+
/**
|
|
252
|
+
* Set the loading state of the page. If 'true',
|
|
253
|
+
* this will show a loader animation overlay over
|
|
254
|
+
* the entire page. Use 'false' to remove this
|
|
255
|
+
* same animation
|
|
256
|
+
*
|
|
257
|
+
* @memberof module:_global
|
|
258
|
+
*
|
|
259
|
+
* @param {Boolean} isLoading
|
|
260
|
+
*/
|
|
261
|
+
'setLoadingState': function(isLoading) {
|
|
262
|
+
var loader = document.querySelector('.loader');
|
|
263
|
+
|
|
264
|
+
if (loader === null) {
|
|
265
|
+
loader = document.createElement('div');
|
|
266
|
+
loader.classList.add('loader');
|
|
267
|
+
var parentNode = document.querySelector('.main');
|
|
268
|
+
parentNode.insertBefore(loader, parentNode.firstChild);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (isLoading) {
|
|
272
|
+
loader.parentNode.classList.add('loading');
|
|
273
|
+
} else {
|
|
274
|
+
document.querySelector('.loading').classList.remove('loading');
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
/**
|
|
278
|
+
* Get Paramater from URL by name
|
|
279
|
+
*
|
|
280
|
+
* @memberof module:_global
|
|
281
|
+
*
|
|
282
|
+
* @param {*} name
|
|
283
|
+
*/
|
|
284
|
+
'getParamaterByName': function(name){
|
|
285
|
+
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
|
286
|
+
var regexS = "[\\?&]"+name+"=([^&#]*)";
|
|
287
|
+
var regex = new RegExp( regexS );
|
|
288
|
+
var results = regex.exec( window.location.href );
|
|
289
|
+
if( results == null )
|
|
290
|
+
return "";
|
|
291
|
+
else
|
|
292
|
+
return decodeURIComponent(results[1].replace(/\+/g, " "));
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// Make QLD variable available to the console for debugging
|
|
297
|
+
window.QLD = QLD;
|
|
298
|
+
|
|
299
|
+
QLD.utils.browserJS();
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
})(window.QLD);
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal module
|
|
3
|
+
*/
|
|
4
|
+
(function (QLD) {
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @module Modal
|
|
8
|
+
*/
|
|
9
|
+
var Modal = {
|
|
10
|
+
|
|
11
|
+
// Vars
|
|
12
|
+
'events': {},
|
|
13
|
+
'callbackFns': {},
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Initialise a specific modal
|
|
17
|
+
*
|
|
18
|
+
* @memberof module:Modal
|
|
19
|
+
*
|
|
20
|
+
* @param {Node} modalBtn The modal button element
|
|
21
|
+
*/
|
|
22
|
+
'init': function(modalBtn) {
|
|
23
|
+
|
|
24
|
+
// Init single modal btn
|
|
25
|
+
if (typeof(modalBtn) !== 'undefined') {
|
|
26
|
+
modalBtn.addEventListener('click', Modal.open);
|
|
27
|
+
|
|
28
|
+
// Else init all modal buttons on the page
|
|
29
|
+
} else {
|
|
30
|
+
var modalBtns = document.querySelectorAll('.qld__open-modal');
|
|
31
|
+
modalBtns.forEach((modalBtn) => {
|
|
32
|
+
modalBtn.addEventListener('click', Modal.open);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Open the modal
|
|
39
|
+
*
|
|
40
|
+
* @memberof module:Modal
|
|
41
|
+
*
|
|
42
|
+
* @param {Document.event} e
|
|
43
|
+
*/
|
|
44
|
+
'open': function(e) {
|
|
45
|
+
let modalOpenBtn = e.currentTarget ? e.currentTarget : null;
|
|
46
|
+
|
|
47
|
+
if(modalOpenBtn !== null) {
|
|
48
|
+
var modalTarget = modalOpenBtn.getAttribute('data-modaltarget');
|
|
49
|
+
var modalEl = document.querySelector(`#${modalTarget}`);
|
|
50
|
+
var modalCloseBtns = modalEl.querySelectorAll('button[data-action="close"]');
|
|
51
|
+
var modalUnderlay = modalEl.querySelector('.qld__modal__underlay');
|
|
52
|
+
} else {
|
|
53
|
+
var modalEl = e.get(0);
|
|
54
|
+
var modalCloseBtns = modalEl.querySelectorAll('button[data-action="close"], button[data-action="deny-location"]');
|
|
55
|
+
var modalUnderlay = modalEl.querySelector('.qld__modal__underlay');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// trap focus
|
|
61
|
+
// add all the elements inside modal that are focusable
|
|
62
|
+
let focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
63
|
+
let firstFocusableElement = modalEl.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal
|
|
64
|
+
let focusableContent = modalEl.querySelectorAll(focusableElements);
|
|
65
|
+
let lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal
|
|
66
|
+
|
|
67
|
+
// Add keydown listener
|
|
68
|
+
Modal.events.keydown = Modal.addEvent(document, 'keydown', function(e) {
|
|
69
|
+
// ESC
|
|
70
|
+
if (e.keyCode === 27) {
|
|
71
|
+
modalOpenBtn.focus();
|
|
72
|
+
Modal.close(e);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let isTabPressed = e.key === 'Tab' || e.keyCode === 9;
|
|
77
|
+
|
|
78
|
+
if (!isTabPressed) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (e.shiftKey) { // if shift key pressed for shift + tab combination
|
|
83
|
+
if (document.activeElement === firstFocusableElement || document.activeElement === modalEl) {
|
|
84
|
+
lastFocusableElement.focus(); // add focus for the last focusable element
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
}
|
|
87
|
+
} else { // if tab key is pressed
|
|
88
|
+
if (document.activeElement === lastFocusableElement) { // if focused has reached to last focusable element then focus first focusable element after pressing tab
|
|
89
|
+
firstFocusableElement.focus(); // add focus for the first focusable element
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Open modal
|
|
96
|
+
modalEl.classList.add('active');
|
|
97
|
+
modalEl.focus();
|
|
98
|
+
|
|
99
|
+
// Close button click listener
|
|
100
|
+
modalCloseBtns.forEach(function(button, index) {
|
|
101
|
+
Modal.events['close-' + index] = Modal.addEvent(button, 'click', function(e) {
|
|
102
|
+
modalOpenBtn !== null ? modalOpenBtn.focus() : null;
|
|
103
|
+
Modal.close(e);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Modal underlay listener
|
|
108
|
+
if(modalUnderlay) {
|
|
109
|
+
Modal.events.underlay = Modal.addEvent(modalUnderlay, 'click', Modal.close);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Add callback events
|
|
113
|
+
for (var key in Modal.callbackFns) {
|
|
114
|
+
var button = modalEl.querySelector('button[data-callback="' + key + '"]');
|
|
115
|
+
|
|
116
|
+
if (button !== null) {
|
|
117
|
+
Modal.events['callback-' + key] = Modal.addEvent(button, 'click', function(e) {
|
|
118
|
+
Modal.close(e);
|
|
119
|
+
var callbackKey = e.target.getAttribute('data-callback');
|
|
120
|
+
Modal.callbackFns[callbackKey](e);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Close the modal
|
|
129
|
+
*
|
|
130
|
+
* @memberof module:Modal
|
|
131
|
+
*
|
|
132
|
+
* @param {Document.event} e
|
|
133
|
+
*/
|
|
134
|
+
'close': function(e) {
|
|
135
|
+
console.log('close');
|
|
136
|
+
var modalEl = e.target.closest('.qld__modal');
|
|
137
|
+
modalEl.classList.remove('active');
|
|
138
|
+
|
|
139
|
+
for (var i in Modal.events) {
|
|
140
|
+
var event = Modal.events[i];
|
|
141
|
+
Modal.removeEvent(event);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Object representing an event listener
|
|
147
|
+
*
|
|
148
|
+
* @typedef {Object} event
|
|
149
|
+
* @property {Node} element Element the event is attached to
|
|
150
|
+
* @property {function} handler Event handler function
|
|
151
|
+
* @property {document#event} event DOM event to listen for
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Add event listener
|
|
156
|
+
*
|
|
157
|
+
* @memberof module:Modal
|
|
158
|
+
* @instance
|
|
159
|
+
* @private
|
|
160
|
+
*
|
|
161
|
+
* @param {Node} element DOM element to add event to
|
|
162
|
+
* @param {document#event} event The event to listen for
|
|
163
|
+
* @param {function} rawHandler The raw handler function
|
|
164
|
+
* @return {event}
|
|
165
|
+
*/
|
|
166
|
+
'addEvent': function(element, event, rawHandler) {
|
|
167
|
+
// Using local functions instead of anonymous for event handler
|
|
168
|
+
function listenHandler(event) {
|
|
169
|
+
var handler = rawHandler.apply(this, arguments);
|
|
170
|
+
if (handler === false) {
|
|
171
|
+
event.stopPropagation();
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
}
|
|
174
|
+
return (handler);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Make sure attachHandler is also going to work
|
|
178
|
+
function attachHandler() {
|
|
179
|
+
var handler = rawHandler.call(element, window.event);
|
|
180
|
+
if (handler === false) {
|
|
181
|
+
window.event.returnValue = false;
|
|
182
|
+
window.event.cancelBubble = true;
|
|
183
|
+
}
|
|
184
|
+
return (handler);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Return the token and add the correct listener
|
|
188
|
+
if (element.addEventListener) {
|
|
189
|
+
element.addEventListener(event, listenHandler, false);
|
|
190
|
+
return {
|
|
191
|
+
element: element,
|
|
192
|
+
handler: listenHandler,
|
|
193
|
+
event: event
|
|
194
|
+
};
|
|
195
|
+
} else {
|
|
196
|
+
element.attachEvent('on' + event, attachHandler);
|
|
197
|
+
return {
|
|
198
|
+
element: element,
|
|
199
|
+
handler: attachHandler,
|
|
200
|
+
event: event
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Remove event listener
|
|
208
|
+
*
|
|
209
|
+
* @memberof module:Modal
|
|
210
|
+
* @instance
|
|
211
|
+
* @private
|
|
212
|
+
*
|
|
213
|
+
* @param {event} token The event to remove
|
|
214
|
+
*/
|
|
215
|
+
'removeEvent': function(token) {
|
|
216
|
+
if (token.element.removeEventListener) {
|
|
217
|
+
token.element.removeEventListener(token.event, token.handler);
|
|
218
|
+
} else {
|
|
219
|
+
token.element.detachEvent('on' + token.event, token.handler);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
// Add to global QLD module
|
|
226
|
+
var QLD = QLD ? QLD : {};
|
|
227
|
+
QLD.Modal = Modal;
|
|
228
|
+
window.QLD = QLD;
|
|
229
|
+
|
|
230
|
+
window.addEventListener('DOMContentLoaded', function () {
|
|
231
|
+
if (document.querySelector('.qld__open-modal') !== null) {
|
|
232
|
+
QLD.Modal.init();
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
}(window.QLD));
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
|
|
2
|
+
(function(QLD) {
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @module carouselSlick
|
|
7
|
+
*/
|
|
8
|
+
var carouselSlick = {};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Initialise the location finder
|
|
12
|
+
*
|
|
13
|
+
* @memberof module:carouselSlick
|
|
14
|
+
*/
|
|
15
|
+
carouselSlick.init = function() {
|
|
16
|
+
var $slick = $(`[data-action="slick-slider"]`);
|
|
17
|
+
|
|
18
|
+
var breakpoint = {
|
|
19
|
+
"Lg": 991,
|
|
20
|
+
"Md": 698,
|
|
21
|
+
"Sm": 399
|
|
22
|
+
};
|
|
23
|
+
var slickSettingsMobileOnly = {
|
|
24
|
+
slidesToShow: 1.3,
|
|
25
|
+
slidesToScroll: 1,
|
|
26
|
+
mobileFirst: true,
|
|
27
|
+
infinite: false,
|
|
28
|
+
centerMode: false,
|
|
29
|
+
arrows: true,
|
|
30
|
+
prevArrow: '<button class="qld__slick-prev"><span class="fa fa-angle-left"></span><span class="sr-only">Prev</span></button>',
|
|
31
|
+
nextArrow: '<button class="qld__slick-next"><span class="fa fa-angle-right"></span><span class="sr-only">Next</span></button>',
|
|
32
|
+
responsive: [
|
|
33
|
+
{
|
|
34
|
+
breakpoint: breakpoint.Md,
|
|
35
|
+
settings: 'unslick'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var slickSettingsThree = {
|
|
41
|
+
slidesToShow: 1.4,
|
|
42
|
+
slidesToScroll: 1,
|
|
43
|
+
mobileFirst: true,
|
|
44
|
+
infinite: false,
|
|
45
|
+
centerMode: false,
|
|
46
|
+
arrows: true,
|
|
47
|
+
dots: false,
|
|
48
|
+
appendArrows: '',
|
|
49
|
+
appendArrows: '',
|
|
50
|
+
prevArrow: '<button class="qld__slick-prev"><span class="fa fa-angle-left"></span><span class="sr-only">Prev</span></button>',
|
|
51
|
+
nextArrow: '<button class="qld__slick-next"><span class="fa fa-angle-right"></span><span class="sr-only">Next</span></button>',
|
|
52
|
+
responsive: [
|
|
53
|
+
{
|
|
54
|
+
breakpoint: breakpoint.Lg,
|
|
55
|
+
settings: {
|
|
56
|
+
slidesToShow: 3,
|
|
57
|
+
slidesToScroll: 3
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
breakpoint: breakpoint.Md,
|
|
62
|
+
settings: {
|
|
63
|
+
slidesToShow: 2,
|
|
64
|
+
slidesToScroll: 2
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var slickSettingsFour = {
|
|
71
|
+
slidesToShow: 1.4,
|
|
72
|
+
slidesToScroll: 1,
|
|
73
|
+
mobileFirst: true,
|
|
74
|
+
infinite: false,
|
|
75
|
+
centerMode: false,
|
|
76
|
+
arrows: true,
|
|
77
|
+
dots: false,
|
|
78
|
+
appendArrows: '',
|
|
79
|
+
appendDots: '',
|
|
80
|
+
prevArrow: '<button class="qld__slick-prev"><span class="fa fa-angle-left"></span><span class="sr-only">Prev</span></button>',
|
|
81
|
+
nextArrow: '<button class="qld__slick-next"><span class="fa fa-angle-right"></span><span class="sr-only">Next</span></button>',
|
|
82
|
+
responsive: [
|
|
83
|
+
{
|
|
84
|
+
breakpoint: breakpoint.Lg,
|
|
85
|
+
settings: {
|
|
86
|
+
dots: true,
|
|
87
|
+
slidesToShow: 4,
|
|
88
|
+
slidesToScroll: 4
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
breakpoint: breakpoint.Md,
|
|
93
|
+
settings: {
|
|
94
|
+
slidesToShow: 2,
|
|
95
|
+
slidesToScroll: 2
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if($slick.length) {
|
|
102
|
+
$slick.each(function() {
|
|
103
|
+
var $this = $(this);
|
|
104
|
+
if ($this.attr('data-type') == 'mobile-only' && $this.children('li').length > 1) {
|
|
105
|
+
slickSettingsMobileOnly.appendArrows = $this.next().find('.qld__slick-controls');
|
|
106
|
+
$this.slick(slickSettingsMobileOnly);
|
|
107
|
+
} else if ($this.attr('data-type') == 'one'){
|
|
108
|
+
slickSettingsMobileOnly.appendArrows = $this.next().find('.qld__slick-controls');
|
|
109
|
+
slickSettingsMobileOnly.appendDots = $this.next().find('.qld__slick-controls');
|
|
110
|
+
$this.slick(slickSettingsMobileOnly);
|
|
111
|
+
}
|
|
112
|
+
else if ($this.attr('data-type') == 'two'){
|
|
113
|
+
slickSettingsMobileOnly.appendArrows = $this.next().find('.qld__slick-controls');
|
|
114
|
+
slickSettingsMobileOnly.appendDots = $this.next().find('.qld__slick-controls');
|
|
115
|
+
$this.slick(slickSettingsMobileOnly);
|
|
116
|
+
}
|
|
117
|
+
else if ($this.attr('data-type') == 'four'){
|
|
118
|
+
slickSettingsFour.appendArrows = $this.next().find('.qld__slick-controls');
|
|
119
|
+
slickSettingsFour.appendDots = $this.next().find('.qld__slick-controls');
|
|
120
|
+
$this.slick(slickSettingsFour);
|
|
121
|
+
} else if ($this.attr('data-type') == 'three'){
|
|
122
|
+
slickSettingsThree.appendArrows = $this.next().find('.qld__slick-controls');
|
|
123
|
+
slickSettingsThree.appendDots = $this.next().find('.qld__slick-controls');
|
|
124
|
+
$this.slick(slickSettingsThree);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
$(window).on("resize", function () {
|
|
129
|
+
if ($(window).width() > breakpoint.Md) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
$slick.each(function() {
|
|
134
|
+
var $this = $(this);
|
|
135
|
+
|
|
136
|
+
if (!$this.hasClass("slick-initialized") && $this.attr('data-type') == 'mobile-only' && $this.children('li').length > 1) {
|
|
137
|
+
$this.slick(slickSettingsMobileOnly);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
var QLD = QLD ? QLD : {};
|
|
145
|
+
QLD.carouselSlick = carouselSlick;
|
|
146
|
+
window.QLD = QLD;
|
|
147
|
+
|
|
148
|
+
document.addEventListener("DOMContentLoaded", function(event) {
|
|
149
|
+
if ($(`[data-action="slick-slider"]`).length > 0) {
|
|
150
|
+
QLD.carouselSlick.init();
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}(window.QLD));
|