@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,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module animate
|
|
3
|
+
*/
|
|
4
|
+
(function (QLD) {
|
|
5
|
+
|
|
6
|
+
var animate = {}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Calculate the requirements for the desired animation
|
|
10
|
+
*
|
|
11
|
+
* @memberof module:animate
|
|
12
|
+
* @instance
|
|
13
|
+
* @private
|
|
14
|
+
*
|
|
15
|
+
* @param {integer} initialSize - The initial size of the element to animate
|
|
16
|
+
* @param {integer} endSize - The size the element after the animation completes
|
|
17
|
+
* @param {string} speed - The speed of the animation in ms
|
|
18
|
+
*
|
|
19
|
+
* @return {object} - Required steps, stepSize and intervalTime for the animation
|
|
20
|
+
*/
|
|
21
|
+
function CalculateAnimationSpecs(initialSize, endSize, speed) {
|
|
22
|
+
|
|
23
|
+
if (initialSize === endSize) {
|
|
24
|
+
return {
|
|
25
|
+
stepSize: 0,
|
|
26
|
+
steps: 0,
|
|
27
|
+
intervalTime: 0,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var distance = endSize - initialSize; // the overall distance the animation needs to travel
|
|
32
|
+
var intervalTime = (speed / distance); // the time each setInterval iteration will take
|
|
33
|
+
var stepSize = distance < 0 ? -1 : 1; // if distance is negative then we set stepSize to -1
|
|
34
|
+
var steps = Math.abs(distance / stepSize); // the amount of steps required to get to endSize
|
|
35
|
+
intervalTime = speed / steps;
|
|
36
|
+
|
|
37
|
+
// we need to adjust our animation specs if interval time exceeds 60FPS eg intervalTime < 16.67ms
|
|
38
|
+
if (Math.abs(intervalTime) < (1000 / 60)) {
|
|
39
|
+
intervalTime = (1000 / 60); // let’s not get lower that 60FPS
|
|
40
|
+
steps = Math.ceil(Math.abs(speed / intervalTime)); // we now need the steps and make sure we ceil them so -1 won't make them negative
|
|
41
|
+
stepSize = distance / steps; // last thing is step sizes which are derived from all of the above
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
stepSize: stepSize,
|
|
46
|
+
steps: (steps - 1),
|
|
47
|
+
intervalTime: intervalTime,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// export for node and babel environments
|
|
52
|
+
if (typeof module !== 'undefined') {
|
|
53
|
+
animate.CalculateAnimationSpecs = CalculateAnimationSpecs;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Getting computed CSS styles from normal browsers and IE
|
|
59
|
+
*
|
|
60
|
+
* @memberof module:animate
|
|
61
|
+
*
|
|
62
|
+
* @param {object} element - The DOM element we want to get the computed style from
|
|
63
|
+
* @param {string} property - The CSS property
|
|
64
|
+
*
|
|
65
|
+
* @return {string|integer} - The CSS value for the property
|
|
66
|
+
*/
|
|
67
|
+
animate.GetCSSPropertyBecauseIE = function (element, property) {
|
|
68
|
+
if (typeof getComputedStyle !== 'undefined') {
|
|
69
|
+
return window.getComputedStyle(element)[property];
|
|
70
|
+
} else {
|
|
71
|
+
var space = element.currentStyle[property];
|
|
72
|
+
|
|
73
|
+
if (space === 'auto') {
|
|
74
|
+
space = QLD.animate.CalculateAuto(element, property);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return space;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Calculate the size of the element when it’s dimension(height or width) is set to auto
|
|
84
|
+
*
|
|
85
|
+
* @memberof module:animate
|
|
86
|
+
*
|
|
87
|
+
* @param {object} element - The element to read auto height from
|
|
88
|
+
* @param {string} dimension - The dimension to measure
|
|
89
|
+
*
|
|
90
|
+
* @return {integer} - The size of the element when at dimension(height or width) is set to 'auto'
|
|
91
|
+
*/
|
|
92
|
+
animate.CalculateAuto = function (element, dimension) {
|
|
93
|
+
var initialSize;
|
|
94
|
+
var endSize;
|
|
95
|
+
|
|
96
|
+
if (dimension === 'height') {
|
|
97
|
+
initialSize = element.clientHeight; // get current height
|
|
98
|
+
element.style[dimension] = 'auto'; // set height to auto
|
|
99
|
+
endSize = element.clientHeight; // get height again
|
|
100
|
+
element.style[dimension] = initialSize + 'px'; // set back to initial height
|
|
101
|
+
} else {
|
|
102
|
+
initialSize = element.clientWidth;
|
|
103
|
+
element.style[dimension] = 'auto';
|
|
104
|
+
endSize = element.clientWidth;
|
|
105
|
+
element.style[dimension] = initialSize + 'px';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return parseInt(endSize);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Stop any au animation on a DOM element
|
|
114
|
+
*
|
|
115
|
+
* @memberof module:animate
|
|
116
|
+
*
|
|
117
|
+
* @param {object} element - The element to stop animating
|
|
118
|
+
*/
|
|
119
|
+
animate.Stop = function (element) {
|
|
120
|
+
clearInterval(element.QLDanimation);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The magical animation function
|
|
126
|
+
*
|
|
127
|
+
* @memberof module:animate
|
|
128
|
+
*
|
|
129
|
+
* @param {object} options - The options for the animation
|
|
130
|
+
* @param {object} options.element - Element/s we are animating (DOM nodes)
|
|
131
|
+
* @param {string} options.property - The CSS property to animate
|
|
132
|
+
* @param {integer|string} options.endSize - The size the element should animate to. Can be 'auto' or pixel value
|
|
133
|
+
* @param {integer} options.speed - The speed of the animation in milliseconds [optional] [default: 250]
|
|
134
|
+
* @param {function} options.callback - A function to be executed after the animation ends [optional]
|
|
135
|
+
*
|
|
136
|
+
* @return {unknown} - The return value passed on from our options.callback function [optional]
|
|
137
|
+
*/
|
|
138
|
+
animate.Run = function (options) {
|
|
139
|
+
// defaults
|
|
140
|
+
var elements = options.element;
|
|
141
|
+
var speed = options.speed || 250;
|
|
142
|
+
|
|
143
|
+
// making a single DOM element iteratable
|
|
144
|
+
if (elements.length === undefined) {
|
|
145
|
+
elements = [elements];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// making a callback if none was provided
|
|
149
|
+
if (typeof options.callback !== 'function') {
|
|
150
|
+
options.callback = function () {};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// adding iteration counts
|
|
154
|
+
elements[0].QLDinteration = 0;
|
|
155
|
+
elements[0].QLDinterations = elements.length;
|
|
156
|
+
|
|
157
|
+
// iterate over all DOM nodes
|
|
158
|
+
for (var i = 0; i < elements.length; i++) {
|
|
159
|
+
var element = elements[i]; // this element
|
|
160
|
+
QLD.animate.Stop(element); // stop any previous animations
|
|
161
|
+
var initialSize = parseInt(QLD.animate.GetCSSPropertyBecauseIE(element, options.property)); // the elements current size
|
|
162
|
+
var endSize = options.endSize; // the element end size
|
|
163
|
+
|
|
164
|
+
if (options.endSize === 'auto') { // calculate what 'auto' means in pixel
|
|
165
|
+
endSize = QLD.animate.CalculateAuto(element, options.property);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// calculate our animation specs
|
|
169
|
+
var animationSpecs = CalculateAnimationSpecs(initialSize, endSize, speed);
|
|
170
|
+
var iterateCounter = initialSize;
|
|
171
|
+
|
|
172
|
+
// set state
|
|
173
|
+
if (animationSpecs.stepSize < 0) {
|
|
174
|
+
element.QLDtoggleState = 'closing';
|
|
175
|
+
} else if (animationSpecs.stepSize > 0) {
|
|
176
|
+
element.QLDtoggleState = 'opening';
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// scoping variable
|
|
180
|
+
(function (element, initialSize, iterateCounter, animationSpecs, endSize) {
|
|
181
|
+
// keep track of animation by adding it to the DOM element
|
|
182
|
+
element.QLDanimation = setInterval(function () {
|
|
183
|
+
|
|
184
|
+
// when we are at the end
|
|
185
|
+
if (initialSize === endSize || animationSpecs.steps === 0) {
|
|
186
|
+
QLD.animate.Stop(element);
|
|
187
|
+
|
|
188
|
+
element.style[options.property] = endSize + 'px'; // set to endSize
|
|
189
|
+
element.QLDtoggleState = '';
|
|
190
|
+
|
|
191
|
+
elements[0].QLDinteration++;
|
|
192
|
+
|
|
193
|
+
// removing auto so CSS can take over
|
|
194
|
+
if (options.endSize === 'auto') {
|
|
195
|
+
element.style[options.property] = '';
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// when all iterations have finished, run the callback
|
|
199
|
+
if (elements[0].QLDinteration >= elements[0].QLDinterations) {
|
|
200
|
+
return options.callback();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// if we are still animating
|
|
205
|
+
else {
|
|
206
|
+
iterateCounter += animationSpecs.stepSize;
|
|
207
|
+
element.style[options.property] = iterateCounter + 'px';
|
|
208
|
+
|
|
209
|
+
animationSpecs.steps--;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
}, Math.abs(animationSpecs.intervalTime));
|
|
213
|
+
})(element, initialSize, iterateCounter, animationSpecs, endSize);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Toggle animation
|
|
220
|
+
*
|
|
221
|
+
* @memberof module:animate
|
|
222
|
+
*
|
|
223
|
+
* @param {object} options - The options for the animation
|
|
224
|
+
* @param {object} options.element - Element/s we are animating (DOM nodes)
|
|
225
|
+
* @param {string} options.property - The CSS property to animate [optional] [default: 'height']
|
|
226
|
+
* @param {integer|string} options.closeSize - The size the element should close to. Can be 'auto' or pixel value [optional] [default: 0]
|
|
227
|
+
* @param {integer|string} options.openSize - The size the element should open to. Can be 'auto' or pixel value [optional] [default: 'auto']
|
|
228
|
+
* @param {integer} options.speed - The speed of the animation in milliseconds [optional] [default: 250]
|
|
229
|
+
* @param {function} options.prefunction - A function to be executed before each animation starts, passes {object} element, {string} state [optional]
|
|
230
|
+
* @param {function} options.postfunction - A function to be executed after each animation ends, passes {object} element, {string} state [optional]
|
|
231
|
+
* @param {function} options.callback - A function to be executed after the animation ends, passes {object} element, {string} state [optional]
|
|
232
|
+
*
|
|
233
|
+
* @return {unknown} - The return value passed on from our options.callback function [optional]
|
|
234
|
+
*/
|
|
235
|
+
animate.Toggle = function (options) {
|
|
236
|
+
|
|
237
|
+
var elements = options.element;
|
|
238
|
+
var property = options.property || 'height';
|
|
239
|
+
var speed = options.speed || 250;
|
|
240
|
+
var closeSize = options.closeSize === undefined ? 0 : options.closeSize;
|
|
241
|
+
var openSize = options.openSize === undefined ? 'auto' : options.openSize;
|
|
242
|
+
|
|
243
|
+
// making a single DOM element iteratable
|
|
244
|
+
if (elements.length === undefined) {
|
|
245
|
+
elements = [elements];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// making a prefunction if none was provided
|
|
249
|
+
if (typeof options.prefunction !== 'function') {
|
|
250
|
+
options.prefunction = function () {};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// making a postfunction if none was provided
|
|
254
|
+
if (typeof options.postfunction !== 'function') {
|
|
255
|
+
options.postfunction = function () {};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// making a callback if none was provided
|
|
259
|
+
if (typeof options.callback !== 'function') {
|
|
260
|
+
options.callback = function () {};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// adding iteration counts
|
|
264
|
+
elements[0].QLDtoggleInteration = 0;
|
|
265
|
+
elements[0].QLDtoggleInterations = elements.length;
|
|
266
|
+
|
|
267
|
+
// iterate over all DOM nodes
|
|
268
|
+
for (var i = 0; i < elements.length; i++) {
|
|
269
|
+
var element = elements[i];
|
|
270
|
+
|
|
271
|
+
QLD.animate.Stop(element);
|
|
272
|
+
|
|
273
|
+
var targetSize; // the size the element should open/close to after toggle is clicked
|
|
274
|
+
var preState = ''; // the state we animate to for the prefunction and callback functions
|
|
275
|
+
var postState = ''; // the state we animate to for the prefunction and callback functions
|
|
276
|
+
var currentSize = parseInt(QLD.animate.GetCSSPropertyBecauseIE(element, options.property)); // the current size of the element
|
|
277
|
+
|
|
278
|
+
console.log(currentSize)
|
|
279
|
+
if (currentSize === closeSize || element.QLDtoggleState === 'closing') {
|
|
280
|
+
targetSize = openSize;
|
|
281
|
+
preState = 'opening';
|
|
282
|
+
postState = 'open';
|
|
283
|
+
} else if (currentSize !== closeSize || element.QLDtoggleState === 'opening') {
|
|
284
|
+
targetSize = closeSize;
|
|
285
|
+
preState = 'closing';
|
|
286
|
+
postState = 'closed';
|
|
287
|
+
} else {
|
|
288
|
+
throw new Error('QLD.animate.Toggle cannot determine state of element');
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// run prefunction once per element
|
|
292
|
+
options.prefunction(element, preState);
|
|
293
|
+
|
|
294
|
+
// shoot off animation
|
|
295
|
+
QLD.animate.Run({
|
|
296
|
+
element: element,
|
|
297
|
+
endSize: targetSize,
|
|
298
|
+
property: property,
|
|
299
|
+
speed: speed,
|
|
300
|
+
callback: function () { // making sure we fire the callback only once
|
|
301
|
+
elements[0].QLDtoggleInteration++;
|
|
302
|
+
|
|
303
|
+
if (elements[0].QLDtoggleInteration === elements[0].QLDinterations) {
|
|
304
|
+
var returnParam = options.callback(element, postState);
|
|
305
|
+
|
|
306
|
+
// run postfunction once per element
|
|
307
|
+
options.postfunction(element, postState);
|
|
308
|
+
|
|
309
|
+
return returnParam;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// run postfunction once per element
|
|
313
|
+
options.postfunction(element, postState);
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
var QLD = QLD ? QLD : {};
|
|
321
|
+
QLD.animate = animate;
|
|
322
|
+
window.QLD = QLD;
|
|
323
|
+
|
|
324
|
+
}(window.QLD));
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
(function(){
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var forms = {};
|
|
5
|
+
|
|
6
|
+
forms.init = function() {
|
|
7
|
+
$.validator.addMethod("nospaces", function(value, element) {
|
|
8
|
+
return this.optional(element) || (value.indexOf(' ') === -1);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
$.validator.addMethod("postcode", function(value, element) {
|
|
12
|
+
return this.optional(element) || (!isNaN(value) && value.length === 4);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
$('.qld__form--validate').each(function() {
|
|
16
|
+
var $form = $(this);
|
|
17
|
+
|
|
18
|
+
// Validate form
|
|
19
|
+
$form.validate({
|
|
20
|
+
|
|
21
|
+
// Error properties
|
|
22
|
+
errorElement: 'p',
|
|
23
|
+
errorClass: 'qld__input--error',
|
|
24
|
+
errorAttribute: 'tabindex=”0″',
|
|
25
|
+
|
|
26
|
+
// Place error appropriately in DOM
|
|
27
|
+
errorPlacement: function(error, element) {
|
|
28
|
+
if (element.closest(".sq-form-question-answer").length > 0) {
|
|
29
|
+
var errorPlacement = element.closest(".sq-form-question-answer").parent();
|
|
30
|
+
var errorID = '#' + error[0].id.replace( /(:|\.|\[|\]|,|=|@)/g, "\\$1" );
|
|
31
|
+
error.attr('tabindex','0');
|
|
32
|
+
if(errorPlacement.find(errorID).length === 0){
|
|
33
|
+
error.prependTo(errorPlacement);
|
|
34
|
+
}
|
|
35
|
+
error.focus();
|
|
36
|
+
|
|
37
|
+
} else if (element.closest(".qld__form-group").length > 0) {
|
|
38
|
+
error.attr('tabindex','0');
|
|
39
|
+
error.prependTo(element.closest(".qld__form-group"));
|
|
40
|
+
error.focus();
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// Set valid class
|
|
45
|
+
validClass: 'qld__input--valid',
|
|
46
|
+
|
|
47
|
+
// Check validation on focus out
|
|
48
|
+
onfocusout: function(element) {
|
|
49
|
+
$(element).valid();
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
// Check validation on click
|
|
53
|
+
onclick: function(element) {
|
|
54
|
+
if ( element.type === "radio" || element.type === "checkbox") {
|
|
55
|
+
$(element).valid();
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// Highlight invalid
|
|
60
|
+
highlight: function( element, errorClass, validClass ) {
|
|
61
|
+
if ( element.type === "radio" || element.type === "checkbox") {
|
|
62
|
+
this.findByName( element.name ).addClass( errorClass ).removeClass( validClass );
|
|
63
|
+
} else {
|
|
64
|
+
$( element ).addClass( errorClass ).removeClass( validClass );
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// Highlight valid
|
|
69
|
+
unhighlight: function( element, errorClass, validClass ) {
|
|
70
|
+
if ( element.type === "radio" || element.type === "checkbox") {
|
|
71
|
+
if(this.findByName(element.name).is(":checked") || this.findByName(element.name).is(":selected")){
|
|
72
|
+
this.findByName( element.name ).removeClass( errorClass ).addClass( validClass );
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
if ($( element ).val().length > 0){
|
|
76
|
+
$( element ).removeClass( errorClass ).addClass( validClass );
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Add custom rules if they exist
|
|
83
|
+
if (typeof(addCustomRules) !== 'undefined') {
|
|
84
|
+
addCustomRules();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Add required labels to fields
|
|
88
|
+
updateRequiredLabels($form);
|
|
89
|
+
$form.on('change', function() {
|
|
90
|
+
updateRequiredLabels($(this));
|
|
91
|
+
});
|
|
92
|
+
// Add aria tag to helper text
|
|
93
|
+
updateHelperText($form);
|
|
94
|
+
|
|
95
|
+
//Add data auto complete to date field ---Matrix bug fix---
|
|
96
|
+
dobFieldAutocomplete($form);
|
|
97
|
+
|
|
98
|
+
// Validate select fields when option is selected
|
|
99
|
+
$form.find('select').on('change', function() {
|
|
100
|
+
console.log('select change');
|
|
101
|
+
$(this).valid();
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Make forms available to public
|
|
107
|
+
QLD.forms = forms;
|
|
108
|
+
|
|
109
|
+
document.addEventListener("DOMContentLoaded", function(event) {
|
|
110
|
+
QLD.forms.init();
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
function updateRequiredLabels($form) {
|
|
114
|
+
var $requiredFields = $form.find('[required]');
|
|
115
|
+
|
|
116
|
+
$requiredFields.each(function() {
|
|
117
|
+
var $field = $(this);
|
|
118
|
+
var $question = $field.closest('.sq-form-question');
|
|
119
|
+
|
|
120
|
+
if ($question.length > 0) {
|
|
121
|
+
var $requiredLabel = $question.find('.sq-form-required-field');
|
|
122
|
+
|
|
123
|
+
if ($requiredLabel.length === 0) {
|
|
124
|
+
var $title = $question.find('.sq-form-question-title');
|
|
125
|
+
$title.append(' <abbr class="sq-form-required-field" title="required">*</abbr>');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
function updateHelperText($form) {
|
|
132
|
+
var $allFields = $form.find('input:not([type=hidden])');
|
|
133
|
+
|
|
134
|
+
$allFields.each(function() {
|
|
135
|
+
var currentField = $(this);
|
|
136
|
+
var currentID = $(this).attr('id');
|
|
137
|
+
|
|
138
|
+
if(currentField.parents('.sq-form-question-answer').siblings('.sq-form-question-note').length){
|
|
139
|
+
currentField.attr('aria-describedby', currentID + '_description');
|
|
140
|
+
currentField.parents('.sq-form-question-answer').siblings('.sq-form-question-note').attr('id', currentID + '_description');
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
function dobFieldAutocomplete($form) {
|
|
147
|
+
var $dateFieldWrapper = $form.find('.sq-form-question-datetime');
|
|
148
|
+
|
|
149
|
+
if($dateFieldWrapper.length){
|
|
150
|
+
var $dateFieldWrapperId = $form.find('.sq-form-question-datetime').attr('id');
|
|
151
|
+
var $dateFieldLegend = $dateFieldWrapper.find('legend');
|
|
152
|
+
var $dateFieldLegendId = $dateFieldWrapperId.replace( /(wrapper)/g, "legend" );
|
|
153
|
+
var $dateField = $dateFieldWrapper.find('input:not([type=hidden])');
|
|
154
|
+
|
|
155
|
+
var $dateHelperTextId = $dateFieldWrapper.find('em.sq-form-question-note').attr('id');
|
|
156
|
+
|
|
157
|
+
$dateFieldLegend.attr('id', $dateFieldLegendId);
|
|
158
|
+
$dateFieldLegend.attr('aria-labeledby', $dateFieldLegendId + " " + $dateHelperTextId);
|
|
159
|
+
|
|
160
|
+
if($dateFieldWrapper.find('.sq-form-question-title').text().toLowerCase().indexOf("birth") >= 0){
|
|
161
|
+
$dateField.each(function() {
|
|
162
|
+
var currentField = $(this);
|
|
163
|
+
var currentID = $(this).attr('id');
|
|
164
|
+
if(currentID.toLowerCase().indexOf("value_d") >= 0){
|
|
165
|
+
currentField.attr('autocomplete', 'bday-day');
|
|
166
|
+
}else if(currentID.toLowerCase().indexOf("value_m") >= 0){
|
|
167
|
+
currentField.attr('autocomplete', 'bday-month');
|
|
168
|
+
}else if(currentID.toLowerCase().indexOf("value_y") >= 0){
|
|
169
|
+
currentField.attr('autocomplete', 'bday-year');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
}());
|