@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,33 @@
|
|
|
1
|
+
module.exports = function(list, key, value, options) {
|
|
2
|
+
var result = "";
|
|
3
|
+
var arr = [];
|
|
4
|
+
var data = Handlebars.createFrame(options.data);
|
|
5
|
+
var index = 0;
|
|
6
|
+
|
|
7
|
+
for(var i in list) {
|
|
8
|
+
if(list[i][key] === value) {
|
|
9
|
+
arr.push({
|
|
10
|
+
key: i,
|
|
11
|
+
index: index,
|
|
12
|
+
first: 0 === index,
|
|
13
|
+
last: false,
|
|
14
|
+
value: list[i]
|
|
15
|
+
});
|
|
16
|
+
index++;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
arr[arr.length - 1].last = true;
|
|
21
|
+
|
|
22
|
+
for (var i = 0; i < arr.length; i++) {
|
|
23
|
+
data.key = arr[i].key;
|
|
24
|
+
data.index = arr[i].index;
|
|
25
|
+
data.first = arr[i].first;
|
|
26
|
+
data.last = arr[i].last;
|
|
27
|
+
result = result + options.fn(arr[i].value, {
|
|
28
|
+
data: data
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
33
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module.exports = function (datetime, formatStr) {
|
|
2
|
+
var date = new Date(datetime);
|
|
3
|
+
|
|
4
|
+
console.log(date);
|
|
5
|
+
|
|
6
|
+
if (isNaN(date.valueOf())) {
|
|
7
|
+
// date is not valid
|
|
8
|
+
return datetime;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var days = [
|
|
12
|
+
"Sunday",
|
|
13
|
+
"Monday",
|
|
14
|
+
"Tuesday",
|
|
15
|
+
"Wednesday",
|
|
16
|
+
"Thursday",
|
|
17
|
+
"Friday",
|
|
18
|
+
"Saturday",
|
|
19
|
+
];
|
|
20
|
+
var months = [
|
|
21
|
+
"January",
|
|
22
|
+
"February",
|
|
23
|
+
"March",
|
|
24
|
+
"April",
|
|
25
|
+
"May",
|
|
26
|
+
"June",
|
|
27
|
+
"July",
|
|
28
|
+
"August",
|
|
29
|
+
"September",
|
|
30
|
+
"October",
|
|
31
|
+
"November",
|
|
32
|
+
"December",
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
var day = days[date.getDay()];
|
|
36
|
+
var month = months[date.getMonth()];
|
|
37
|
+
|
|
38
|
+
// Tuesday 1 June 2021
|
|
39
|
+
var formatMap = {
|
|
40
|
+
s: String("0" + date.getSeconds()).slice(-2),
|
|
41
|
+
i: String("0" + date.getMinutes()).slice(-2),
|
|
42
|
+
h: String("0" + date.getHours()).slice(-2),
|
|
43
|
+
A: date.getHours() >= 12 ? 'PM' : 'AM',
|
|
44
|
+
a: date.getHours() >= 12 ? 'am' : 'am',
|
|
45
|
+
d: ("0" + date.getDate()).slice(-2), // 01
|
|
46
|
+
D: day.slice(0, 3), // Tue
|
|
47
|
+
F: month, // June
|
|
48
|
+
l: day, // Tuesday
|
|
49
|
+
m: ("0" + (date.getMonth() + 1)).slice(-2), // 06
|
|
50
|
+
M: month.slice(0, 3), // Jun
|
|
51
|
+
n: String(date.getMonth() + 1), // 6
|
|
52
|
+
j: String(date.getDate()), // 1
|
|
53
|
+
y: String(date.getFullYear()).slice(-2), // 21
|
|
54
|
+
Y: String(date.getFullYear()), // 2021
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var _formatStr = formatStr || "l j F Y";
|
|
58
|
+
|
|
59
|
+
return _formatStr.replace(/[sihAadDFlmMnjyY]/g, function (match) {
|
|
60
|
+
return formatMap[match] || match;
|
|
61
|
+
});
|
|
62
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
module.exports = function (dates) {
|
|
2
|
+
var dateArray = (dates === '' || dates === null) ? [] : dates.split(', ');
|
|
3
|
+
var pastDates = [];
|
|
4
|
+
var futureDates = [];
|
|
5
|
+
var yesterday = new Date();
|
|
6
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
7
|
+
var month = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
|
|
8
|
+
var html = '';
|
|
9
|
+
|
|
10
|
+
for (let i = 0; i < dateArray.length; i++) {
|
|
11
|
+
dateArray[i] = new Date(dateArray[i]);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
dateArray.sort(function(a,b){
|
|
15
|
+
return a - b;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
var pastDates = [];
|
|
19
|
+
var futureDates = [];
|
|
20
|
+
|
|
21
|
+
for (let i = 0; i < dateArray.length; i++) {
|
|
22
|
+
if (dateArray[i] < yesterday) {
|
|
23
|
+
pastDates.push(dateArray[i]);
|
|
24
|
+
} else {
|
|
25
|
+
futureDates.push(dateArray[i]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
convertIntoRange(futureDates, 'upcoming', '');
|
|
30
|
+
convertIntoRange(pastDates, 'past', 'hidden="hidden"');
|
|
31
|
+
|
|
32
|
+
function convertIntoRange(dateArray, type, hidden) {
|
|
33
|
+
var dateRange = false;
|
|
34
|
+
html += `<div role="tabpanel" id="qhealth__service_dates__tab-panel--${type}" aria-labelledby="qhealth__service_dates__tab-heading--${type}" class="qhealth__tab_panel mt-1" ${hidden}>`;
|
|
35
|
+
if (dateArray.length > 0) {
|
|
36
|
+
for (let i = 0; i < dateArray.length; i++) {
|
|
37
|
+
var j = i + 1;
|
|
38
|
+
var nextDate = new Date(dateArray[i]);
|
|
39
|
+
nextDate.setDate(dateArray[i].getDate() + 1);
|
|
40
|
+
if (dateArray.length > j) {
|
|
41
|
+
if (dateArray[j] - nextDate == 0) {
|
|
42
|
+
if (!dateRange) {
|
|
43
|
+
dateRange = true;
|
|
44
|
+
html += `<div>${("0" + dateArray[i].getDate()).slice(-2)} ${month[dateArray[i].getMonth()]} - `;
|
|
45
|
+
}
|
|
46
|
+
} else if (dateRange){
|
|
47
|
+
dateRange = false;
|
|
48
|
+
html += `${("0" + dateArray[i].getDate()).slice(-2)} ${month[dateArray[i].getMonth()]} ${dateArray[i].getFullYear()}</div>`;
|
|
49
|
+
} else {
|
|
50
|
+
dateRange = false;
|
|
51
|
+
html += `<div>${("0" + dateArray[i].getDate()).slice(-2)} ${month[dateArray[i].getMonth()]} ${dateArray[i].getFullYear()}</div>`;
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
if (dateRange){
|
|
55
|
+
dateRange = false;
|
|
56
|
+
html += `${("0" + dateArray[i].getDate()).slice(-2)} ${month[dateArray[i].getMonth()]} ${dateArray[i].getFullYear()}</div>`;
|
|
57
|
+
} else {
|
|
58
|
+
dateRange = false;
|
|
59
|
+
html += `<div>${("0" + dateArray[i].getDate()).slice(-2)} ${month[dateArray[i].getMonth()]} ${dateArray[i].getFullYear()}</div>`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
if (type == 'upcoming') {
|
|
65
|
+
html += '<div>No upcoming dates are scheduled at this stage. Please check again later.</div>';
|
|
66
|
+
} else {
|
|
67
|
+
html += '<div>There are no past dates for this service.</div>';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
html += '</div>';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return html;
|
|
74
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module.exports = function (lat, lng, userLat, userLong) {
|
|
2
|
+
var distanceAway = "";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Haversine formula - calculate distance "as the crow flies" between two sets of lat/long coordinates
|
|
6
|
+
* https://stackoverflow.com/questions/27928/calculate-distance-between-two-latitude-longitude-points-haversine-formula
|
|
7
|
+
*
|
|
8
|
+
* @param {number} lat1
|
|
9
|
+
* @param {number} lon1
|
|
10
|
+
* @param {number} lat2
|
|
11
|
+
* @param {number} lon2
|
|
12
|
+
*
|
|
13
|
+
* @returns {number}
|
|
14
|
+
*/
|
|
15
|
+
function getDistance(lat1, lon1, lat2, lon2) {
|
|
16
|
+
var p = 0.017453292519943295; // Math.PI / 180
|
|
17
|
+
var c = Math.cos;
|
|
18
|
+
var a = 0.5 - c((lat2 - lat1) * p)/2 +
|
|
19
|
+
c(lat1 * p) * c(lat2 * p) *
|
|
20
|
+
(1 - c((lon2 - lon1) * p))/2;
|
|
21
|
+
|
|
22
|
+
var result = 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km
|
|
23
|
+
|
|
24
|
+
if (result >= 10) {
|
|
25
|
+
return round(result);
|
|
26
|
+
} else {
|
|
27
|
+
return round(result, 1)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function round(value, precision) {
|
|
32
|
+
var multiplier = Math.pow(10, precision || 0);
|
|
33
|
+
return Math.round(value * multiplier) / multiplier;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Init
|
|
37
|
+
distanceAway = getDistance(lat, lng, userLat, userLong);
|
|
38
|
+
|
|
39
|
+
return distanceAway;
|
|
40
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = function(name,req) {
|
|
2
|
+
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
|
3
|
+
var regexS = "[\\?&]"+name+"=([^&#]*)";
|
|
4
|
+
var regex = new RegExp( regexS );
|
|
5
|
+
var results = regex.exec( req.originalUrl );
|
|
6
|
+
if( results == null ) {
|
|
7
|
+
return "";
|
|
8
|
+
} else {
|
|
9
|
+
return decodeURIComponent(results[1].replace(/\+/g, " "));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = function(obj,key) {
|
|
2
|
+
var possibleValues = [];
|
|
3
|
+
for(var i in obj) {
|
|
4
|
+
if (obj[i].hasOwnProperty(key)) {
|
|
5
|
+
var value = obj[i][key];
|
|
6
|
+
if (possibleValues.indexOf(value) === -1) {
|
|
7
|
+
possibleValues.push(value);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return possibleValues;
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = function(selectValues, tags, options) {
|
|
2
|
+
let output = "";
|
|
3
|
+
let splitSelectValues = [];
|
|
4
|
+
|
|
5
|
+
if(tags){
|
|
6
|
+
|
|
7
|
+
if(selectValues) {
|
|
8
|
+
splitSelectValues = selectValues.replace(/_/g, ' ').split('; ');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
for(let selectValue in splitSelectValues) {
|
|
12
|
+
if(splitSelectValues.hasOwnProperty(selectValue)) {
|
|
13
|
+
var key = splitSelectValues[selectValue].replace(/ /g, '_');
|
|
14
|
+
output = output + options.fn({key: key, value: tags[key]})
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return output;
|
|
20
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module.exports = function (v1, operator, v2, options) {
|
|
2
|
+
switch (operator) {
|
|
3
|
+
case '==':
|
|
4
|
+
return (v1 == v2) ? options.fn(this) : options.inverse(this);
|
|
5
|
+
case '===':
|
|
6
|
+
return (v1 === v2) ? options.fn(this) : options.inverse(this);
|
|
7
|
+
case '!=':
|
|
8
|
+
return (v1 != v2) ? options.fn(this) : options.inverse(this);
|
|
9
|
+
case '!==':
|
|
10
|
+
return (v1 !== v2) ? options.fn(this) : options.inverse(this);
|
|
11
|
+
case '<':
|
|
12
|
+
return (v1 < v2) ? options.fn(this) : options.inverse(this);
|
|
13
|
+
case '<=':
|
|
14
|
+
return (v1 <= v2) ? options.fn(this) : options.inverse(this);
|
|
15
|
+
case '>':
|
|
16
|
+
return (v1 > v2) ? options.fn(this) : options.inverse(this);
|
|
17
|
+
case '>=':
|
|
18
|
+
return (v1 >= v2) ? options.fn(this) : options.inverse(this);
|
|
19
|
+
case '&&':
|
|
20
|
+
return (v1 && v2) ? options.fn(this) : options.inverse(this);
|
|
21
|
+
case '||':
|
|
22
|
+
return (v1 || v2) ? options.fn(this) : options.inverse(this);
|
|
23
|
+
case 'contains':
|
|
24
|
+
if(typeof v1 == 'string' && typeof v2 == 'string') {
|
|
25
|
+
return (v1.toLowerCase().indexOf(v2.toLowerCase()) >= 0) ? options.fn(this) : options.inverse(this);
|
|
26
|
+
}
|
|
27
|
+
else return options.inverse(this);
|
|
28
|
+
default:
|
|
29
|
+
return options.inverse(this);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = function() {
|
|
2
|
+
var options = arguments[arguments.length-1];
|
|
3
|
+
// Assuming that all wanted operator are '||'
|
|
4
|
+
var valueToTest = arguments[0];
|
|
5
|
+
|
|
6
|
+
for (var i = 1; i < (arguments.length - 1); i++) {
|
|
7
|
+
if (valueToTest === arguments[i]) {
|
|
8
|
+
return options.fn(this);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return options.inverse(this);
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
module.exports = function () {
|
|
2
|
+
const args = Array.prototype.slice.call(arguments, 0, -1);
|
|
3
|
+
const options = arguments[arguments.length - 1];
|
|
4
|
+
const allEqual = args.every(function (expression) {
|
|
5
|
+
return args[0] === expression;
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
return allEqual ? options.fn(this) : options.inverse(this);
|
|
9
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module.exports = function(items, url, options) {
|
|
2
|
+
var html = '<li class="qhealth__services_a-z__list__item">';
|
|
3
|
+
var services = [];
|
|
4
|
+
var letters = [];
|
|
5
|
+
|
|
6
|
+
for(var i = 0; i < items.length; i++) {
|
|
7
|
+
var service = items[i].name;
|
|
8
|
+
var serviceUrl = items[i].web_path;
|
|
9
|
+
if(service == ""){
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var firstLetter = service.substring(0,1);
|
|
14
|
+
var arrayWithFirstLetter = services[firstLetter];
|
|
15
|
+
|
|
16
|
+
if(arrayWithFirstLetter == null){
|
|
17
|
+
services[firstLetter] = [];
|
|
18
|
+
letters.push(firstLetter);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
services[firstLetter].push({"web_path" : serviceUrl, "name" : service});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
services = services.sort(function(a, b){
|
|
25
|
+
if(a.name < b.name) { return -1; }
|
|
26
|
+
if(a.name > b.name) { return 1; }
|
|
27
|
+
return 0;
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
letters = letters.sort(function(a, b){
|
|
31
|
+
if(a < b) { return -1; }
|
|
32
|
+
if(a > b) { return 1; }
|
|
33
|
+
return 0;
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
url = url ? url : '';
|
|
37
|
+
|
|
38
|
+
for(var i = 0; i < letters.length; i++) {
|
|
39
|
+
html += '<h3 class="qhealth__services_a-z__list__item__header"><span id="'+letters[i]+'">'+letters[i]+'</span></h3>';
|
|
40
|
+
html += '<ul class="row qhealth__services_a-z__list__item__services">';
|
|
41
|
+
for(var k = 0; k < services[letters[i]].length; k++) {
|
|
42
|
+
html += '<li class="col-lg-4 col-md-6 col-xs-12 qhealth__services_a-z__list__item__services__item"><a class="qhealth__services_a-z__list__item__services__item__link" href="'+url+'/'+services[letters[i]][k].web_path+'"><span>'+services[letters[i]][k].name+'</span><i class="fas fa-arrow-right"></i></a></li>';
|
|
43
|
+
}
|
|
44
|
+
html += '</ul>';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
html += '</li>';
|
|
49
|
+
|
|
50
|
+
return html;
|
|
51
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module.exports = function(items, options) {
|
|
2
|
+
var html = '';
|
|
3
|
+
var services = [];
|
|
4
|
+
var letters = [];
|
|
5
|
+
for(var i = 0; i < items.length; i++) {
|
|
6
|
+
var service = items[i].name;
|
|
7
|
+
|
|
8
|
+
if(service == ""){
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var firstLetter = service.substring(0,1);
|
|
13
|
+
var arrayWithFirstLetter = services[firstLetter];
|
|
14
|
+
|
|
15
|
+
if(arrayWithFirstLetter == null){
|
|
16
|
+
services[firstLetter] = [];
|
|
17
|
+
letters.push(firstLetter);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
letters = letters.sort(function(a, b){
|
|
22
|
+
if(a < b) { return -1; }
|
|
23
|
+
if(a > b) { return 1; }
|
|
24
|
+
return 0;
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
for(var i = 0; i < letters.length; i++) {
|
|
28
|
+
|
|
29
|
+
html += '<li class="qld__services_a-z__options__item"><a class="qld__services_a-z__options__item__link" href="#' + letters[i] + '">' + letters[i] + '</a></li>';
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return html;
|
|
34
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
module.exports = function (arr, max, userLat, userLong, options) {
|
|
2
|
+
var item = "";
|
|
3
|
+
var totalCount = max < arr.length ? max : arr.length;
|
|
4
|
+
|
|
5
|
+
Array.prototype.polyMap = function(callbackFn) {
|
|
6
|
+
var arr = [];
|
|
7
|
+
for (var i = 0; i < this.length; i++) {
|
|
8
|
+
/* call the callback function for every value of this array and push the returned value into our resulting array
|
|
9
|
+
*/
|
|
10
|
+
arr.push(callbackFn(this[i], i, this));
|
|
11
|
+
}
|
|
12
|
+
return arr;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
arr = arr.polyMap(function(item) {
|
|
16
|
+
item.distanceAway = getDistance(item.latitude, item.longitude, userLat, userLong);
|
|
17
|
+
return item;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
arr.sort(function(a, b) {
|
|
21
|
+
return a.distanceAway - b.distanceAway;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
for (var i = 0; i < totalCount; i++) {
|
|
25
|
+
item = item + options.fn(arr[i]);
|
|
26
|
+
}
|
|
27
|
+
return item;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Haversine formula - calculate distance "as the crow flies" between two sets of lat/long coordinates
|
|
31
|
+
* https://stackoverflow.com/questions/27928/calculate-distance-between-two-latitude-longitude-points-haversine-formula
|
|
32
|
+
*
|
|
33
|
+
* @param {number} lat1
|
|
34
|
+
* @param {number} lon1
|
|
35
|
+
* @param {number} lat2
|
|
36
|
+
* @param {number} lon2
|
|
37
|
+
*
|
|
38
|
+
* @returns {number}
|
|
39
|
+
*/
|
|
40
|
+
function getDistance(lat1, lon1, lat2, lon2) {
|
|
41
|
+
var p = 0.017453292519943295; // Math.PI / 180
|
|
42
|
+
var c = Math.cos;
|
|
43
|
+
var a = 0.5 - c((lat2 - lat1) * p)/2 +
|
|
44
|
+
c(lat1 * p) * c(lat2 * p) *
|
|
45
|
+
(1 - c((lon2 - lon1) * p))/2;
|
|
46
|
+
|
|
47
|
+
var result = 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km
|
|
48
|
+
|
|
49
|
+
if (result >= 10) {
|
|
50
|
+
return round(result);
|
|
51
|
+
} else {
|
|
52
|
+
return round(result, 1)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function round(value, precision) {
|
|
57
|
+
var multiplier = Math.pow(10, precision || 0);
|
|
58
|
+
return Math.round(value * multiplier) / multiplier;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
module.exports = function (arr, max, offset, userLat, userLong, options) {
|
|
2
|
+
var item = "";
|
|
3
|
+
var totalCount = max < arr.length ? max : arr.length;
|
|
4
|
+
|
|
5
|
+
if(offset === null) {
|
|
6
|
+
offset = 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
Array.prototype.polyMap = function(callbackFn) {
|
|
10
|
+
var arr = [];
|
|
11
|
+
for (var i = 0; i < this.length; i++) {
|
|
12
|
+
arr.push(callbackFn(this[i], i, this));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return arr;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
arr = arr.polyMap(function(item) {
|
|
19
|
+
item.distanceAway = getDistance(item.latitude, item.longitude, userLat, userLong);
|
|
20
|
+
return item;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
arr.sort(function(a, b) {
|
|
24
|
+
return a.distanceAway - b.distanceAway;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
for (var i = 0 + offset; i < totalCount; i++) {
|
|
28
|
+
item = item + options.fn(arr[i]);
|
|
29
|
+
}
|
|
30
|
+
return item;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Haversine formula - calculate distance "as the crow flies" between two sets of lat/long coordinates
|
|
34
|
+
* https://stackoverflow.com/questions/27928/calculate-distance-between-two-latitude-longitude-points-haversine-formula
|
|
35
|
+
*
|
|
36
|
+
* @param {number} lat1
|
|
37
|
+
* @param {number} lon1
|
|
38
|
+
* @param {number} lat2
|
|
39
|
+
* @param {number} lon2
|
|
40
|
+
*
|
|
41
|
+
* @returns {number}
|
|
42
|
+
*/
|
|
43
|
+
function getDistance(lat1, lon1, lat2, lon2) {
|
|
44
|
+
var p = 0.017453292519943295; // Math.PI / 180
|
|
45
|
+
var c = Math.cos;
|
|
46
|
+
var a = 0.5 - c((lat2 - lat1) * p)/2 +
|
|
47
|
+
c(lat1 * p) * c(lat2 * p) *
|
|
48
|
+
(1 - c((lon2 - lon1) * p))/2;
|
|
49
|
+
|
|
50
|
+
var result = 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km
|
|
51
|
+
|
|
52
|
+
if (result >= 10) {
|
|
53
|
+
return round(result);
|
|
54
|
+
} else {
|
|
55
|
+
return round(result, 1)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function round(value, precision) {
|
|
60
|
+
var multiplier = Math.pow(10, precision || 0);
|
|
61
|
+
return Math.round(value * multiplier) / multiplier;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = function(lvalue, operator, rvalue) {
|
|
2
|
+
lvalue = parseFloat(lvalue);
|
|
3
|
+
rvalue = parseFloat(rvalue);
|
|
4
|
+
return {
|
|
5
|
+
"+": lvalue + rvalue,
|
|
6
|
+
"-": lvalue - rvalue,
|
|
7
|
+
"*": lvalue * rvalue,
|
|
8
|
+
"/": lvalue / rvalue,
|
|
9
|
+
"%": lvalue % rvalue
|
|
10
|
+
}[operator];
|
|
11
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = function(selectValues, options) {
|
|
2
|
+
let output = "";
|
|
3
|
+
let outputArr = [];
|
|
4
|
+
let splitSelectValues = [];
|
|
5
|
+
|
|
6
|
+
if(selectValues) {
|
|
7
|
+
splitSelectValues = selectValues.replace(/_/g, ' ').split('; ');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// if(num !== 0) {
|
|
11
|
+
// splitSelectValues.splice(num);
|
|
12
|
+
// }
|
|
13
|
+
|
|
14
|
+
for(let selectValue in splitSelectValues) {
|
|
15
|
+
if(splitSelectValues.hasOwnProperty(selectValue)) {
|
|
16
|
+
output = output + options.fn({key: splitSelectValues[selectValue].replace(/ /g, '_'), value:splitSelectValues[selectValue].charAt(0).toUpperCase() + splitSelectValues[selectValue].slice(1)})
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return output;
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
module.exports = function (str, search, replacement) {
|
|
2
|
+
var cleanReplacement = " " + replacement + " ";
|
|
3
|
+
if(typeof str == 'string') {
|
|
4
|
+
console.log(str);
|
|
5
|
+
var regex = new RegExp(search, "g"); // need double backslashes in search to use them in regex
|
|
6
|
+
return str.replace(regex, cleanReplacement);
|
|
7
|
+
}
|
|
8
|
+
else return '';
|
|
9
|
+
};
|