@ongov/ontario-design-system-component-library 6.0.0-alpha.5 → 6.0.0-alpha.8
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/components/index.d.ts +43 -0
- package/components/index.js +2169 -0
- package/components/index.js.map +1 -0
- package/components/ontario-accordion.d.ts +11 -0
- package/components/ontario-accordion.js +378 -0
- package/components/ontario-accordion.js.map +1 -0
- package/components/ontario-aside.d.ts +11 -0
- package/components/ontario-aside.js +171 -0
- package/components/ontario-aside.js.map +1 -0
- package/components/ontario-back-to-top.d.ts +11 -0
- package/components/ontario-back-to-top.js +119 -0
- package/components/ontario-back-to-top.js.map +1 -0
- package/components/ontario-badge.d.ts +11 -0
- package/components/ontario-badge.js +9 -0
- package/components/ontario-badge.js.map +1 -0
- package/components/ontario-blockquote.d.ts +11 -0
- package/components/ontario-blockquote.js +145 -0
- package/components/ontario-blockquote.js.map +1 -0
- package/components/ontario-button.d.ts +11 -0
- package/components/ontario-button.js +237 -0
- package/components/ontario-button.js.map +1 -0
- package/components/ontario-callout.d.ts +11 -0
- package/components/ontario-callout.js +170 -0
- package/components/ontario-callout.js.map +1 -0
- package/components/ontario-card-collection.d.ts +11 -0
- package/components/ontario-card-collection.js +111 -0
- package/components/ontario-card-collection.js.map +1 -0
- package/components/ontario-card.d.ts +11 -0
- package/components/ontario-card.js +389 -0
- package/components/ontario-card.js.map +1 -0
- package/components/ontario-checkboxes.d.ts +11 -0
- package/components/ontario-checkboxes.js +428 -0
- package/components/ontario-checkboxes.js.map +1 -0
- package/components/ontario-critical-alert.d.ts +11 -0
- package/components/ontario-critical-alert.js +128 -0
- package/components/ontario-critical-alert.js.map +1 -0
- package/components/ontario-date-input.d.ts +11 -0
- package/components/ontario-date-input.js +623 -0
- package/components/ontario-date-input.js.map +1 -0
- package/components/ontario-dropdown-list.d.ts +11 -0
- package/components/ontario-dropdown-list.js +449 -0
- package/components/ontario-dropdown-list.js.map +1 -0
- package/components/ontario-fieldset.d.ts +11 -0
- package/components/ontario-fieldset.js +167 -0
- package/components/ontario-fieldset.js.map +1 -0
- package/components/ontario-footer.d.ts +11 -0
- package/components/ontario-footer.js +455 -0
- package/components/ontario-footer.js.map +1 -0
- package/components/ontario-form-container.d.ts +11 -0
- package/components/ontario-form-container.js +74 -0
- package/components/ontario-form-container.js.map +1 -0
- package/components/ontario-header-overflow-menu.d.ts +11 -0
- package/components/ontario-header-overflow-menu.js +9 -0
- package/components/ontario-header-overflow-menu.js.map +1 -0
- package/components/ontario-header.d.ts +11 -0
- package/components/ontario-header.js +900 -0
- package/components/ontario-header.js.map +1 -0
- package/components/ontario-hint-expander.d.ts +11 -0
- package/components/ontario-hint-expander.js +9 -0
- package/components/ontario-hint-expander.js.map +1 -0
- package/components/ontario-hint-text.d.ts +11 -0
- package/components/ontario-hint-text.js +9 -0
- package/components/ontario-hint-text.js.map +1 -0
- package/components/ontario-icon-accessibility.d.ts +11 -0
- package/components/ontario-icon-accessibility.js +170 -0
- package/components/ontario-icon-accessibility.js.map +1 -0
- package/components/ontario-icon-account.d.ts +11 -0
- package/components/ontario-icon-account.js +170 -0
- package/components/ontario-icon-account.js.map +1 -0
- package/components/ontario-icon-add-alt.d.ts +11 -0
- package/components/ontario-icon-add-alt.js +171 -0
- package/components/ontario-icon-add-alt.js.map +1 -0
- package/components/ontario-icon-add.d.ts +11 -0
- package/components/ontario-icon-add.js +171 -0
- package/components/ontario-icon-add.js.map +1 -0
- package/components/ontario-icon-alert-error.d.ts +11 -0
- package/components/ontario-icon-alert-error.js +9 -0
- package/components/ontario-icon-alert-error.js.map +1 -0
- package/components/ontario-icon-alert-information.d.ts +11 -0
- package/components/ontario-icon-alert-information.js +9 -0
- package/components/ontario-icon-alert-information.js.map +1 -0
- package/components/ontario-icon-alert-success.d.ts +11 -0
- package/components/ontario-icon-alert-success.js +9 -0
- package/components/ontario-icon-alert-success.js.map +1 -0
- package/components/ontario-icon-alert-warning.d.ts +11 -0
- package/components/ontario-icon-alert-warning.js +9 -0
- package/components/ontario-icon-alert-warning.js.map +1 -0
- package/components/ontario-icon-arrow-up.d.ts +11 -0
- package/components/ontario-icon-arrow-up.js +171 -0
- package/components/ontario-icon-arrow-up.js.map +1 -0
- package/components/ontario-icon-attach.d.ts +11 -0
- package/components/ontario-icon-attach.js +172 -0
- package/components/ontario-icon-attach.js.map +1 -0
- package/components/ontario-icon-bookmark-off.d.ts +11 -0
- package/components/ontario-icon-bookmark-off.js +170 -0
- package/components/ontario-icon-bookmark-off.js.map +1 -0
- package/components/ontario-icon-bookmark-on.d.ts +11 -0
- package/components/ontario-icon-bookmark-on.js +170 -0
- package/components/ontario-icon-bookmark-on.js.map +1 -0
- package/components/ontario-icon-calendar.d.ts +11 -0
- package/components/ontario-icon-calendar.js +170 -0
- package/components/ontario-icon-calendar.js.map +1 -0
- package/components/ontario-icon-camera.d.ts +11 -0
- package/components/ontario-icon-camera.js +170 -0
- package/components/ontario-icon-camera.js.map +1 -0
- package/components/ontario-icon-chevron-down.d.ts +11 -0
- package/components/ontario-icon-chevron-down.js +9 -0
- package/components/ontario-icon-chevron-down.js.map +1 -0
- package/components/ontario-icon-chevron-left.d.ts +11 -0
- package/components/ontario-icon-chevron-left.js +9 -0
- package/components/ontario-icon-chevron-left.js.map +1 -0
- package/components/ontario-icon-chevron-right.d.ts +11 -0
- package/components/ontario-icon-chevron-right.js +171 -0
- package/components/ontario-icon-chevron-right.js.map +1 -0
- package/components/ontario-icon-chevron-up.d.ts +11 -0
- package/components/ontario-icon-chevron-up.js +9 -0
- package/components/ontario-icon-chevron-up.js.map +1 -0
- package/components/ontario-icon-clock.d.ts +11 -0
- package/components/ontario-icon-clock.js +170 -0
- package/components/ontario-icon-clock.js.map +1 -0
- package/components/ontario-icon-close-header.d.ts +11 -0
- package/components/ontario-icon-close-header.js +171 -0
- package/components/ontario-icon-close-header.js.map +1 -0
- package/components/ontario-icon-close.d.ts +11 -0
- package/components/ontario-icon-close.js +171 -0
- package/components/ontario-icon-close.js.map +1 -0
- package/components/ontario-icon-cloud.d.ts +11 -0
- package/components/ontario-icon-cloud.js +170 -0
- package/components/ontario-icon-cloud.js.map +1 -0
- package/components/ontario-icon-collapse.d.ts +11 -0
- package/components/ontario-icon-collapse.js +168 -0
- package/components/ontario-icon-collapse.js.map +1 -0
- package/components/ontario-icon-credit-card.d.ts +11 -0
- package/components/ontario-icon-credit-card.js +171 -0
- package/components/ontario-icon-credit-card.js.map +1 -0
- package/components/ontario-icon-critical-alert-warning.d.ts +11 -0
- package/components/ontario-icon-critical-alert-warning.js +188 -0
- package/components/ontario-icon-critical-alert-warning.js.map +1 -0
- package/components/ontario-icon-delete.d.ts +11 -0
- package/components/ontario-icon-delete.js +170 -0
- package/components/ontario-icon-delete.js.map +1 -0
- package/components/ontario-icon-document.d.ts +11 -0
- package/components/ontario-icon-document.js +170 -0
- package/components/ontario-icon-document.js.map +1 -0
- package/components/ontario-icon-download.d.ts +11 -0
- package/components/ontario-icon-download.js +170 -0
- package/components/ontario-icon-download.js.map +1 -0
- package/components/ontario-icon-dropdown-arrow.d.ts +11 -0
- package/components/ontario-icon-dropdown-arrow.js +142 -0
- package/components/ontario-icon-dropdown-arrow.js.map +1 -0
- package/components/ontario-icon-edit.d.ts +11 -0
- package/components/ontario-icon-edit.js +170 -0
- package/components/ontario-icon-edit.js.map +1 -0
- package/components/ontario-icon-email.d.ts +11 -0
- package/components/ontario-icon-email.js +171 -0
- package/components/ontario-icon-email.js.map +1 -0
- package/components/ontario-icon-expand.d.ts +11 -0
- package/components/ontario-icon-expand.js +168 -0
- package/components/ontario-icon-expand.js.map +1 -0
- package/components/ontario-icon-export.d.ts +11 -0
- package/components/ontario-icon-export.js +170 -0
- package/components/ontario-icon-export.js.map +1 -0
- package/components/ontario-icon-facebook-alt.d.ts +11 -0
- package/components/ontario-icon-facebook-alt.js +170 -0
- package/components/ontario-icon-facebook-alt.js.map +1 -0
- package/components/ontario-icon-facebook.d.ts +11 -0
- package/components/ontario-icon-facebook.js +170 -0
- package/components/ontario-icon-facebook.js.map +1 -0
- package/components/ontario-icon-favourite-off.d.ts +11 -0
- package/components/ontario-icon-favourite-off.js +170 -0
- package/components/ontario-icon-favourite-off.js.map +1 -0
- package/components/ontario-icon-favourite-on.d.ts +11 -0
- package/components/ontario-icon-favourite-on.js +170 -0
- package/components/ontario-icon-favourite-on.js.map +1 -0
- package/components/ontario-icon-filter.d.ts +11 -0
- package/components/ontario-icon-filter.js +170 -0
- package/components/ontario-icon-filter.js.map +1 -0
- package/components/ontario-icon-flickr.d.ts +11 -0
- package/components/ontario-icon-flickr.js +170 -0
- package/components/ontario-icon-flickr.js.map +1 -0
- package/components/ontario-icon-grid.d.ts +11 -0
- package/components/ontario-icon-grid.js +170 -0
- package/components/ontario-icon-grid.js.map +1 -0
- package/components/ontario-icon-help.d.ts +11 -0
- package/components/ontario-icon-help.js +171 -0
- package/components/ontario-icon-help.js.map +1 -0
- package/components/ontario-icon-instagram.d.ts +11 -0
- package/components/ontario-icon-instagram.js +170 -0
- package/components/ontario-icon-instagram.js.map +1 -0
- package/components/ontario-icon-interac-en-alt.d.ts +11 -0
- package/components/ontario-icon-interac-en-alt.js +203 -0
- package/components/ontario-icon-interac-en-alt.js.map +1 -0
- package/components/ontario-icon-interac-en.d.ts +11 -0
- package/components/ontario-icon-interac-en.js +202 -0
- package/components/ontario-icon-interac-en.js.map +1 -0
- package/components/ontario-icon-interac-fr-alt.d.ts +11 -0
- package/components/ontario-icon-interac-fr-alt.js +203 -0
- package/components/ontario-icon-interac-fr-alt.js.map +1 -0
- package/components/ontario-icon-interac-fr.d.ts +11 -0
- package/components/ontario-icon-interac-fr.js +183 -0
- package/components/ontario-icon-interac-fr.js.map +1 -0
- package/components/ontario-icon-linkedin-alt.d.ts +11 -0
- package/components/ontario-icon-linkedin-alt.js +170 -0
- package/components/ontario-icon-linkedin-alt.js.map +1 -0
- package/components/ontario-icon-linkedin.d.ts +11 -0
- package/components/ontario-icon-linkedin.js +170 -0
- package/components/ontario-icon-linkedin.js.map +1 -0
- package/components/ontario-icon-list.d.ts +11 -0
- package/components/ontario-icon-list.js +170 -0
- package/components/ontario-icon-list.js.map +1 -0
- package/components/ontario-icon-live-chat.d.ts +11 -0
- package/components/ontario-icon-live-chat.js +170 -0
- package/components/ontario-icon-live-chat.js.map +1 -0
- package/components/ontario-icon-location-off.d.ts +11 -0
- package/components/ontario-icon-location-off.js +170 -0
- package/components/ontario-icon-location-off.js.map +1 -0
- package/components/ontario-icon-location-on.d.ts +11 -0
- package/components/ontario-icon-location-on.js +170 -0
- package/components/ontario-icon-location-on.js.map +1 -0
- package/components/ontario-icon-lock-off.d.ts +11 -0
- package/components/ontario-icon-lock-off.js +170 -0
- package/components/ontario-icon-lock-off.js.map +1 -0
- package/components/ontario-icon-lock-on.d.ts +11 -0
- package/components/ontario-icon-lock-on.js +170 -0
- package/components/ontario-icon-lock-on.js.map +1 -0
- package/components/ontario-icon-map.d.ts +11 -0
- package/components/ontario-icon-map.js +170 -0
- package/components/ontario-icon-map.js.map +1 -0
- package/components/ontario-icon-mastercard-alt.d.ts +11 -0
- package/components/ontario-icon-mastercard-alt.js +161 -0
- package/components/ontario-icon-mastercard-alt.js.map +1 -0
- package/components/ontario-icon-mastercard.d.ts +11 -0
- package/components/ontario-icon-mastercard.js +173 -0
- package/components/ontario-icon-mastercard.js.map +1 -0
- package/components/ontario-icon-media-fast-forward.d.ts +11 -0
- package/components/ontario-icon-media-fast-forward.js +167 -0
- package/components/ontario-icon-media-fast-forward.js.map +1 -0
- package/components/ontario-icon-media-fast-rewind.d.ts +11 -0
- package/components/ontario-icon-media-fast-rewind.js +170 -0
- package/components/ontario-icon-media-fast-rewind.js.map +1 -0
- package/components/ontario-icon-media-pause.d.ts +11 -0
- package/components/ontario-icon-media-pause.js +167 -0
- package/components/ontario-icon-media-pause.js.map +1 -0
- package/components/ontario-icon-media-play.d.ts +11 -0
- package/components/ontario-icon-media-play.js +167 -0
- package/components/ontario-icon-media-play.js.map +1 -0
- package/components/ontario-icon-media-stop.d.ts +11 -0
- package/components/ontario-icon-media-stop.js +167 -0
- package/components/ontario-icon-media-stop.js.map +1 -0
- package/components/ontario-icon-menu-header.d.ts +11 -0
- package/components/ontario-icon-menu-header.js +171 -0
- package/components/ontario-icon-menu-header.js.map +1 -0
- package/components/ontario-icon-menu.d.ts +11 -0
- package/components/ontario-icon-menu.js +171 -0
- package/components/ontario-icon-menu.js.map +1 -0
- package/components/ontario-icon-microphone-off.d.ts +11 -0
- package/components/ontario-icon-microphone-off.js +170 -0
- package/components/ontario-icon-microphone-off.js.map +1 -0
- package/components/ontario-icon-microphone-on.d.ts +11 -0
- package/components/ontario-icon-microphone-on.js +170 -0
- package/components/ontario-icon-microphone-on.js.map +1 -0
- package/components/ontario-icon-more-vertical.d.ts +11 -0
- package/components/ontario-icon-more-vertical.js +170 -0
- package/components/ontario-icon-more-vertical.js.map +1 -0
- package/components/ontario-icon-new-window.d.ts +11 -0
- package/components/ontario-icon-new-window.js +171 -0
- package/components/ontario-icon-new-window.js.map +1 -0
- package/components/ontario-icon-next.d.ts +11 -0
- package/components/ontario-icon-next.js +170 -0
- package/components/ontario-icon-next.js.map +1 -0
- package/components/ontario-icon-notification.d.ts +11 -0
- package/components/ontario-icon-notification.js +170 -0
- package/components/ontario-icon-notification.js.map +1 -0
- package/components/ontario-icon-password-hide.d.ts +11 -0
- package/components/ontario-icon-password-hide.js +170 -0
- package/components/ontario-icon-password-hide.js.map +1 -0
- package/components/ontario-icon-password-show.d.ts +11 -0
- package/components/ontario-icon-password-show.js +170 -0
- package/components/ontario-icon-password-show.js.map +1 -0
- package/components/ontario-icon-phone.d.ts +11 -0
- package/components/ontario-icon-phone.js +171 -0
- package/components/ontario-icon-phone.js.map +1 -0
- package/components/ontario-icon-photo.d.ts +11 -0
- package/components/ontario-icon-photo.js +170 -0
- package/components/ontario-icon-photo.js.map +1 -0
- package/components/ontario-icon-pin-location-off.d.ts +11 -0
- package/components/ontario-icon-pin-location-off.js +170 -0
- package/components/ontario-icon-pin-location-off.js.map +1 -0
- package/components/ontario-icon-pin-location-on.d.ts +11 -0
- package/components/ontario-icon-pin-location-on.js +170 -0
- package/components/ontario-icon-pin-location-on.js.map +1 -0
- package/components/ontario-icon-previous.d.ts +11 -0
- package/components/ontario-icon-previous.js +170 -0
- package/components/ontario-icon-previous.js.map +1 -0
- package/components/ontario-icon-print.d.ts +11 -0
- package/components/ontario-icon-print.js +170 -0
- package/components/ontario-icon-print.js.map +1 -0
- package/components/ontario-icon-remove-alt.d.ts +11 -0
- package/components/ontario-icon-remove-alt.js +171 -0
- package/components/ontario-icon-remove-alt.js.map +1 -0
- package/components/ontario-icon-remove.d.ts +11 -0
- package/components/ontario-icon-remove.js +171 -0
- package/components/ontario-icon-remove.js.map +1 -0
- package/components/ontario-icon-replay.d.ts +11 -0
- package/components/ontario-icon-replay.js +170 -0
- package/components/ontario-icon-replay.js.map +1 -0
- package/components/ontario-icon-rss-feed.d.ts +11 -0
- package/components/ontario-icon-rss-feed.js +170 -0
- package/components/ontario-icon-rss-feed.js.map +1 -0
- package/components/ontario-icon-save.d.ts +11 -0
- package/components/ontario-icon-save.js +170 -0
- package/components/ontario-icon-save.js.map +1 -0
- package/components/ontario-icon-search-white.d.ts +11 -0
- package/components/ontario-icon-search-white.js +173 -0
- package/components/ontario-icon-search-white.js.map +1 -0
- package/components/ontario-icon-search.d.ts +11 -0
- package/components/ontario-icon-search.js +171 -0
- package/components/ontario-icon-search.js.map +1 -0
- package/components/ontario-icon-sentiment-1.d.ts +11 -0
- package/components/ontario-icon-sentiment-1.js +170 -0
- package/components/ontario-icon-sentiment-1.js.map +1 -0
- package/components/ontario-icon-sentiment-2.d.ts +11 -0
- package/components/ontario-icon-sentiment-2.js +170 -0
- package/components/ontario-icon-sentiment-2.js.map +1 -0
- package/components/ontario-icon-sentiment-3.d.ts +11 -0
- package/components/ontario-icon-sentiment-3.js +170 -0
- package/components/ontario-icon-sentiment-3.js.map +1 -0
- package/components/ontario-icon-sentiment-4.d.ts +11 -0
- package/components/ontario-icon-sentiment-4.js +170 -0
- package/components/ontario-icon-sentiment-4.js.map +1 -0
- package/components/ontario-icon-sentiment-5.d.ts +11 -0
- package/components/ontario-icon-sentiment-5.js +170 -0
- package/components/ontario-icon-sentiment-5.js.map +1 -0
- package/components/ontario-icon-settings.d.ts +11 -0
- package/components/ontario-icon-settings.js +170 -0
- package/components/ontario-icon-settings.js.map +1 -0
- package/components/ontario-icon-share.d.ts +11 -0
- package/components/ontario-icon-share.js +170 -0
- package/components/ontario-icon-share.js.map +1 -0
- package/components/ontario-icon-sort-alphabetical-ascending.d.ts +11 -0
- package/components/ontario-icon-sort-alphabetical-ascending.js +170 -0
- package/components/ontario-icon-sort-alphabetical-ascending.js.map +1 -0
- package/components/ontario-icon-sort-alphabetical-descending.d.ts +11 -0
- package/components/ontario-icon-sort-alphabetical-descending.js +170 -0
- package/components/ontario-icon-sort-alphabetical-descending.js.map +1 -0
- package/components/ontario-icon-sort-ascending.d.ts +11 -0
- package/components/ontario-icon-sort-ascending.js +170 -0
- package/components/ontario-icon-sort-ascending.js.map +1 -0
- package/components/ontario-icon-sort-descending.d.ts +11 -0
- package/components/ontario-icon-sort-descending.js +170 -0
- package/components/ontario-icon-sort-descending.js.map +1 -0
- package/components/ontario-icon-sort-variant.d.ts +11 -0
- package/components/ontario-icon-sort-variant.js +167 -0
- package/components/ontario-icon-sort-variant.js.map +1 -0
- package/components/ontario-icon-sort.d.ts +11 -0
- package/components/ontario-icon-sort.js +170 -0
- package/components/ontario-icon-sort.js.map +1 -0
- package/components/ontario-icon-tag.d.ts +11 -0
- package/components/ontario-icon-tag.js +170 -0
- package/components/ontario-icon-tag.js.map +1 -0
- package/components/ontario-icon-text-message.d.ts +11 -0
- package/components/ontario-icon-text-message.js +170 -0
- package/components/ontario-icon-text-message.js.map +1 -0
- package/components/ontario-icon-timer.d.ts +11 -0
- package/components/ontario-icon-timer.js +170 -0
- package/components/ontario-icon-timer.js.map +1 -0
- package/components/ontario-icon-transport-bicycle.d.ts +11 -0
- package/components/ontario-icon-transport-bicycle.js +170 -0
- package/components/ontario-icon-transport-bicycle.js.map +1 -0
- package/components/ontario-icon-transport-bus.d.ts +11 -0
- package/components/ontario-icon-transport-bus.js +170 -0
- package/components/ontario-icon-transport-bus.js.map +1 -0
- package/components/ontario-icon-transport-car.d.ts +11 -0
- package/components/ontario-icon-transport-car.js +170 -0
- package/components/ontario-icon-transport-car.js.map +1 -0
- package/components/ontario-icon-transport-walk.d.ts +11 -0
- package/components/ontario-icon-transport-walk.js +170 -0
- package/components/ontario-icon-transport-walk.js.map +1 -0
- package/components/ontario-icon-tty.d.ts +11 -0
- package/components/ontario-icon-tty.js +171 -0
- package/components/ontario-icon-tty.js.map +1 -0
- package/components/ontario-icon-twitter-alt.d.ts +11 -0
- package/components/ontario-icon-twitter-alt.js +170 -0
- package/components/ontario-icon-twitter-alt.js.map +1 -0
- package/components/ontario-icon-twitter.d.ts +11 -0
- package/components/ontario-icon-twitter.js +170 -0
- package/components/ontario-icon-twitter.js.map +1 -0
- package/components/ontario-icon-upload.d.ts +11 -0
- package/components/ontario-icon-upload.js +170 -0
- package/components/ontario-icon-upload.js.map +1 -0
- package/components/ontario-icon-video.d.ts +11 -0
- package/components/ontario-icon-video.js +170 -0
- package/components/ontario-icon-video.js.map +1 -0
- package/components/ontario-icon-visa.d.ts +11 -0
- package/components/ontario-icon-visa.js +148 -0
- package/components/ontario-icon-visa.js.map +1 -0
- package/components/ontario-icon-vote-dislike.d.ts +11 -0
- package/components/ontario-icon-vote-dislike.js +170 -0
- package/components/ontario-icon-vote-dislike.js.map +1 -0
- package/components/ontario-icon-vote-like.d.ts +11 -0
- package/components/ontario-icon-vote-like.js +170 -0
- package/components/ontario-icon-vote-like.js.map +1 -0
- package/components/ontario-icon-vpn-key.d.ts +11 -0
- package/components/ontario-icon-vpn-key.js +170 -0
- package/components/ontario-icon-vpn-key.js.map +1 -0
- package/components/ontario-icon-wheelchair.d.ts +11 -0
- package/components/ontario-icon-wheelchair.js +170 -0
- package/components/ontario-icon-wheelchair.js.map +1 -0
- package/components/ontario-icon-wifi.d.ts +11 -0
- package/components/ontario-icon-wifi.js +170 -0
- package/components/ontario-icon-wifi.js.map +1 -0
- package/components/ontario-icon-youtube.d.ts +11 -0
- package/components/ontario-icon-youtube.js +170 -0
- package/components/ontario-icon-youtube.js.map +1 -0
- package/components/ontario-input.d.ts +11 -0
- package/components/ontario-input.js +419 -0
- package/components/ontario-input.js.map +1 -0
- package/components/ontario-language-toggle.d.ts +11 -0
- package/components/ontario-language-toggle.js +9 -0
- package/components/ontario-language-toggle.js.map +1 -0
- package/components/ontario-loading-indicator.d.ts +11 -0
- package/components/ontario-loading-indicator.js +181 -0
- package/components/ontario-loading-indicator.js.map +1 -0
- package/components/ontario-page-alert.d.ts +11 -0
- package/components/ontario-page-alert.js +172 -0
- package/components/ontario-page-alert.js.map +1 -0
- package/components/ontario-radio-buttons.d.ts +11 -0
- package/components/ontario-radio-buttons.js +430 -0
- package/components/ontario-radio-buttons.js.map +1 -0
- package/components/ontario-search-box.d.ts +11 -0
- package/components/ontario-search-box.js +283 -0
- package/components/ontario-search-box.js.map +1 -0
- package/components/ontario-step-indicator.d.ts +11 -0
- package/components/ontario-step-indicator.js +172 -0
- package/components/ontario-step-indicator.js.map +1 -0
- package/components/ontario-table.d.ts +11 -0
- package/components/ontario-table.js +392 -0
- package/components/ontario-table.js.map +1 -0
- package/components/ontario-task-list.d.ts +11 -0
- package/components/ontario-task-list.js +211 -0
- package/components/ontario-task-list.js.map +1 -0
- package/components/ontario-task.d.ts +11 -0
- package/components/ontario-task.js +327 -0
- package/components/ontario-task.js.map +1 -0
- package/components/ontario-textarea.d.ts +11 -0
- package/components/ontario-textarea.js +327 -0
- package/components/ontario-textarea.js.map +1 -0
- package/components/p-6uqsTY-M.js +171 -0
- package/components/p-6uqsTY-M.js.map +1 -0
- package/components/p-A8xwC5QP.js +24 -0
- package/components/p-A8xwC5QP.js.map +1 -0
- package/components/p-BBhl-3u7.js +169 -0
- package/components/p-BBhl-3u7.js.map +1 -0
- package/components/p-BF0_OXTe.js +64 -0
- package/components/p-BF0_OXTe.js.map +1 -0
- package/components/p-BHTls9cv.js +286 -0
- package/components/p-BHTls9cv.js.map +1 -0
- package/components/p-BOcd5PoR.js +330 -0
- package/components/p-BOcd5PoR.js.map +1 -0
- package/components/p-BxXM4eur.js +29 -0
- package/components/p-BxXM4eur.js.map +1 -0
- package/components/p-C-t5TNzY.js +10 -0
- package/components/p-C-t5TNzY.js.map +1 -0
- package/components/p-C0Xvjp7G.js +282 -0
- package/components/p-C0Xvjp7G.js.map +1 -0
- package/components/p-C73HZQcq.js +89 -0
- package/components/p-C73HZQcq.js.map +1 -0
- package/components/p-CI209psv.js +271 -0
- package/components/p-CI209psv.js.map +1 -0
- package/components/p-CIdZS10A.js +20 -0
- package/components/p-CIdZS10A.js.map +1 -0
- package/components/p-CNDrx73J.js +145 -0
- package/components/p-CNDrx73J.js.map +1 -0
- package/components/p-CNqFEifG.js +34 -0
- package/components/p-CNqFEifG.js.map +1 -0
- package/components/p-CRMogYVY.js +168 -0
- package/components/p-CRMogYVY.js.map +1 -0
- package/components/p-CXTm9jmr.js +141 -0
- package/components/p-CXTm9jmr.js.map +1 -0
- package/components/p-CXfntdg5.js +7 -0
- package/components/p-CXfntdg5.js.map +1 -0
- package/components/p-C__FBxsY.js +145 -0
- package/components/p-C__FBxsY.js.map +1 -0
- package/components/p-Cdm-Ot0O.js +95 -0
- package/components/p-Cdm-Ot0O.js.map +1 -0
- package/components/p-CeFeBwzQ.js +331 -0
- package/components/p-CeFeBwzQ.js.map +1 -0
- package/components/p-DGFFJaKo.js +168 -0
- package/components/p-DGFFJaKo.js.map +1 -0
- package/components/p-DIe1tcOp.js +197 -0
- package/components/p-DIe1tcOp.js.map +1 -0
- package/components/p-DJOzeqZ-.js +168 -0
- package/components/p-DJOzeqZ-.js.map +1 -0
- package/components/p-DMH_JI3w.js +6 -0
- package/components/p-DMH_JI3w.js.map +1 -0
- package/components/p-DgMhpSmi.js +324 -0
- package/components/p-DgMhpSmi.js.map +1 -0
- package/components/p-TS9NoIOc.js +11 -0
- package/components/p-TS9NoIOc.js.map +1 -0
- package/components/p-V_1wpeJe.js +17 -0
- package/components/p-V_1wpeJe.js.map +1 -0
- package/components/p-dXtLd1df.js +63 -0
- package/components/p-dXtLd1df.js.map +1 -0
- package/components/p-vdzS-daB.js +145 -0
- package/components/p-vdzS-daB.js.map +1 -0
- package/package.json +11 -9
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { h, p as proxyCustomElement, H } from './index.js';
|
|
2
|
+
import { c as convertStringToBoolean } from './p-DIe1tcOp.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This function generates the menu items in a <li>, accordingly, to the given parameters.
|
|
6
|
+
*
|
|
7
|
+
* href and title are necessary, but rest are not.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} href - the href of the menu item
|
|
10
|
+
* @param {string} title - the title of the menu item
|
|
11
|
+
* @param {boolean} [linkIsActive] - when set to true, this will add the classes necessary to style the link in a way that indicates to the user what the active page/link is
|
|
12
|
+
* @param {string} [liClass] - if there is a class that is related to the <a> portion of the menu item, put it here
|
|
13
|
+
* @param {function(PointerEvent): void} [onClickHandler] - for any custom onClick functionality a user might want to add to their menu links
|
|
14
|
+
*/
|
|
15
|
+
const generateMenuItem = (href, title, linkIsActive, liClass, onClickHandler) => {
|
|
16
|
+
return h(
|
|
17
|
+
'li',
|
|
18
|
+
{ class: liClass },
|
|
19
|
+
h(
|
|
20
|
+
'a',
|
|
21
|
+
{ class: `ontario-menu-item ${linkIsActive ? 'ontario-link--active' : ''}`, href: href, onClick: onClickHandler },
|
|
22
|
+
title,
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const ontarioHeaderOverflowMenuCss =
|
|
28
|
+
'.ontario-application-navigation a:focus,.ontario-application-navigation a:active{box-shadow:0 0 0 4px #009ADB;outline:4px solid transparent;transition:box-shadow 0.1s ease-in-out}.ontario-row{margin:0 auto;max-width:72rem;width:100%}.ontario-row:before,.ontario-row:after{content:"";display:table}.ontario-row:after{clear:both}.ontario-row.ontario-row--collapse>.ontario-column,.ontario-row.ontario-row--collapse>.ontario-columns{padding-left:0;padding-right:0}.ontario-row.ontario-row--collapse .ontario-row{margin-left:0;margin-right:0}.ontario-row .ontario-row{margin:0 -1rem;max-width:none;width:auto}.ontario-row .ontario-row:before,.ontario-row .ontario-row:after{content:"";display:table}.ontario-row .ontario-row:after{clear:both}.ontario-row .ontario-row.ontario-row--collapse{margin:0;max-width:none;width:auto}.ontario-row .ontario-row.ontario-row--collapse:before,.ontario-row .ontario-row.ontario-row--collapse:after{content:"";display:table}.ontario-row .ontario-row.ontario-row--collapse:after{clear:both}.ontario-column,.ontario-columns{padding-left:1rem;padding-right:1rem;box-sizing:border-box;width:100%;float:left}.ontario-column+.ontario-column:last-child,.ontario-column+.ontario-columns:last-child,.ontario-columns+.ontario-column:last-child,.ontario-columns+.ontario-columns:last-child{float:right}.ontario-column+.ontario-column.ontario-end,.ontario-column+.ontario-columns.ontario-end,.ontario-columns+.ontario-column.ontario-end,.ontario-columns+.ontario-columns.ontario-end{float:left}@media only screen{.ontario-small-push-0{position:relative;left:0;right:auto}.ontario-small-pull-0{position:relative;right:0;left:auto}.ontario-small-push-1{position:relative;left:8.3333333333%;right:auto}.ontario-small-pull-1{position:relative;right:8.3333333333%;left:auto}.ontario-small-push-2{position:relative;left:16.6666666667%;right:auto}.ontario-small-pull-2{position:relative;right:16.6666666667%;left:auto}.ontario-small-push-3{position:relative;left:25%;right:auto}.ontario-small-pull-3{position:relative;right:25%;left:auto}.ontario-small-push-4{position:relative;left:33.3333333333%;right:auto}.ontario-small-pull-4{position:relative;right:33.3333333333%;left:auto}.ontario-small-push-5{position:relative;left:41.6666666667%;right:auto}.ontario-small-pull-5{position:relative;right:41.6666666667%;left:auto}.ontario-small-push-6{position:relative;left:50%;right:auto}.ontario-small-pull-6{position:relative;right:50%;left:auto}.ontario-small-push-7{position:relative;left:58.3333333333%;right:auto}.ontario-small-pull-7{position:relative;right:58.3333333333%;left:auto}.ontario-small-push-8{position:relative;left:66.6666666667%;right:auto}.ontario-small-pull-8{position:relative;right:66.6666666667%;left:auto}.ontario-small-push-9{position:relative;left:75%;right:auto}.ontario-small-pull-9{position:relative;right:75%;left:auto}.ontario-small-push-10{position:relative;left:83.3333333333%;right:auto}.ontario-small-pull-10{position:relative;right:83.3333333333%;left:auto}.ontario-small-push-11{position:relative;left:91.6666666667%;right:auto}.ontario-small-pull-11{position:relative;right:91.6666666667%;left:auto}.ontario-column,.ontario-columns{position:relative;padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}.ontario-small-1{width:8.3333333333%}.ontario-small-2{width:16.6666666667%}.ontario-small-3{width:25%}.ontario-small-4{width:33.3333333333%}.ontario-small-5{width:41.6666666667%}.ontario-small-6{width:50%}.ontario-small-7{width:58.3333333333%}.ontario-small-8{width:66.6666666667%}.ontario-small-9{width:75%}.ontario-small-10{width:83.3333333333%}.ontario-small-11{width:91.6666666667%}.ontario-small-12{width:100%}.ontario-small-offset-0{margin-left:0 !important}.ontario-small-offset-1{margin-left:8.3333333333% !important}.ontario-small-offset-2{margin-left:16.6666666667% !important}.ontario-small-offset-3{margin-left:25% !important}.ontario-small-offset-4{margin-left:33.3333333333% !important}.ontario-small-offset-5{margin-left:41.6666666667% !important}.ontario-small-offset-6{margin-left:50% !important}.ontario-small-offset-7{margin-left:58.3333333333% !important}.ontario-small-offset-8{margin-left:66.6666666667% !important}.ontario-small-offset-9{margin-left:75% !important}.ontario-small-offset-10{margin-left:83.3333333333% !important}.ontario-small-offset-11{margin-left:91.6666666667% !important}.ontario-small-reset-order{float:left;left:auto;margin-left:0;margin-right:0;right:auto}.ontario-column.ontario-small-centered,.ontario-columns.ontario-small-centered{margin-left:auto;margin-right:auto;float:none}.ontario-column.ontario-small-uncentered,.ontario-columns.ontario-small-uncentered{float:left;margin-left:0;margin-right:0}.ontario-column.ontario-small-centered:last-child,.ontario-columns.ontario-small-centered:last-child{float:none}.ontario-column.ontario-small-uncentered:last-child,.ontario-columns.ontario-small-uncentered:last-child{float:left}.ontario-column.ontario-small-uncentered.ontario-opposite,.ontario-columns.ontario-small-uncentered.ontario-opposite{float:right}.ontario-row.ontario-small-collapse>.ontario-column,.ontario-row.ontario-small-collapse>.ontario-columns{padding-left:0;padding-right:0}.ontario-row.ontario-small-collapse .ontario-row{margin-left:0;margin-right:0}.ontario-row.ontario-small-uncollapse>.ontario-column,.ontario-row.ontario-small-uncollapse>.ontario-columns{padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}}@media only screen and (min-width:40.063em){.ontario-medium-push-0{position:relative;left:0;right:auto}.ontario-medium-pull-0{position:relative;right:0;left:auto}.ontario-medium-push-1{position:relative;left:8.3333333333%;right:auto}.ontario-medium-pull-1{position:relative;right:8.3333333333%;left:auto}.ontario-medium-push-2{position:relative;left:16.6666666667%;right:auto}.ontario-medium-pull-2{position:relative;right:16.6666666667%;left:auto}.ontario-medium-push-3{position:relative;left:25%;right:auto}.ontario-medium-pull-3{position:relative;right:25%;left:auto}.ontario-medium-push-4{position:relative;left:33.3333333333%;right:auto}.ontario-medium-pull-4{position:relative;right:33.3333333333%;left:auto}.ontario-medium-push-5{position:relative;left:41.6666666667%;right:auto}.ontario-medium-pull-5{position:relative;right:41.6666666667%;left:auto}.ontario-medium-push-6{position:relative;left:50%;right:auto}.ontario-medium-pull-6{position:relative;right:50%;left:auto}.ontario-medium-push-7{position:relative;left:58.3333333333%;right:auto}.ontario-medium-pull-7{position:relative;right:58.3333333333%;left:auto}.ontario-medium-push-8{position:relative;left:66.6666666667%;right:auto}.ontario-medium-pull-8{position:relative;right:66.6666666667%;left:auto}.ontario-medium-push-9{position:relative;left:75%;right:auto}.ontario-medium-pull-9{position:relative;right:75%;left:auto}.ontario-medium-push-10{position:relative;left:83.3333333333%;right:auto}.ontario-medium-pull-10{position:relative;right:83.3333333333%;left:auto}.ontario-medium-push-11{position:relative;left:91.6666666667%;right:auto}.ontario-medium-pull-11{position:relative;right:91.6666666667%;left:auto}.ontario-column,.ontario-columns{position:relative;padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}.ontario-medium-1{width:8.3333333333%}.ontario-medium-2{width:16.6666666667%}.ontario-medium-3{width:25%}.ontario-medium-4{width:33.3333333333%}.ontario-medium-5{width:41.6666666667%}.ontario-medium-6{width:50%}.ontario-medium-7{width:58.3333333333%}.ontario-medium-8{width:66.6666666667%}.ontario-medium-9{width:75%}.ontario-medium-10{width:83.3333333333%}.ontario-medium-11{width:91.6666666667%}.ontario-medium-12{width:100%}.ontario-medium-offset-0{margin-left:0 !important}.ontario-medium-offset-1{margin-left:8.3333333333% !important}.ontario-medium-offset-2{margin-left:16.6666666667% !important}.ontario-medium-offset-3{margin-left:25% !important}.ontario-medium-offset-4{margin-left:33.3333333333% !important}.ontario-medium-offset-5{margin-left:41.6666666667% !important}.ontario-medium-offset-6{margin-left:50% !important}.ontario-medium-offset-7{margin-left:58.3333333333% !important}.ontario-medium-offset-8{margin-left:66.6666666667% !important}.ontario-medium-offset-9{margin-left:75% !important}.ontario-medium-offset-10{margin-left:83.3333333333% !important}.ontario-medium-offset-11{margin-left:91.6666666667% !important}.ontario-medium-reset-order{float:left;left:auto;margin-left:0;margin-right:0;right:auto}.ontario-column.ontario-medium-centered,.ontario-columns.ontario-medium-centered{margin-left:auto;margin-right:auto;float:none}.ontario-column.ontario-medium-uncentered,.ontario-columns.ontario-medium-uncentered{float:left;margin-left:0;margin-right:0}.ontario-column.ontario-medium-centered:last-child,.ontario-columns.ontario-medium-centered:last-child{float:none}.ontario-column.ontario-medium-uncentered:last-child,.ontario-columns.ontario-medium-uncentered:last-child{float:left}.ontario-column.ontario-medium-uncentered.ontario-opposite,.ontario-columns.ontario-medium-uncentered.ontario-opposite{float:right}.ontario-row.ontario-medium-collapse>.ontario-column,.ontario-row.ontario-medium-collapse>.ontario-columns{padding-left:0;padding-right:0}.ontario-row.ontario-medium-collapse .ontario-row{margin-left:0;margin-right:0}.ontario-row.ontario-medium-uncollapse>.ontario-column,.ontario-row.ontario-medium-uncollapse>.ontario-columns{padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}}@media only screen and (min-width:73.063em){.ontario-large-push-0{position:relative;left:0;right:auto}.ontario-large-pull-0{position:relative;right:0;left:auto}.ontario-large-push-1{position:relative;left:8.3333333333%;right:auto}.ontario-large-pull-1{position:relative;right:8.3333333333%;left:auto}.ontario-large-push-2{position:relative;left:16.6666666667%;right:auto}.ontario-large-pull-2{position:relative;right:16.6666666667%;left:auto}.ontario-large-push-3{position:relative;left:25%;right:auto}.ontario-large-pull-3{position:relative;right:25%;left:auto}.ontario-large-push-4{position:relative;left:33.3333333333%;right:auto}.ontario-large-pull-4{position:relative;right:33.3333333333%;left:auto}.ontario-large-push-5{position:relative;left:41.6666666667%;right:auto}.ontario-large-pull-5{position:relative;right:41.6666666667%;left:auto}.ontario-large-push-6{position:relative;left:50%;right:auto}.ontario-large-pull-6{position:relative;right:50%;left:auto}.ontario-large-push-7{position:relative;left:58.3333333333%;right:auto}.ontario-large-pull-7{position:relative;right:58.3333333333%;left:auto}.ontario-large-push-8{position:relative;left:66.6666666667%;right:auto}.ontario-large-pull-8{position:relative;right:66.6666666667%;left:auto}.ontario-large-push-9{position:relative;left:75%;right:auto}.ontario-large-pull-9{position:relative;right:75%;left:auto}.ontario-large-push-10{position:relative;left:83.3333333333%;right:auto}.ontario-large-pull-10{position:relative;right:83.3333333333%;left:auto}.ontario-large-push-11{position:relative;left:91.6666666667%;right:auto}.ontario-large-pull-11{position:relative;right:91.6666666667%;left:auto}.ontario-column,.ontario-columns{position:relative;padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}.ontario-large-1{width:8.3333333333%}.ontario-large-2{width:16.6666666667%}.ontario-large-3{width:25%}.ontario-large-4{width:33.3333333333%}.ontario-large-5{width:41.6666666667%}.ontario-large-6{width:50%}.ontario-large-7{width:58.3333333333%}.ontario-large-8{width:66.6666666667%}.ontario-large-9{width:75%}.ontario-large-10{width:83.3333333333%}.ontario-large-11{width:91.6666666667%}.ontario-large-12{width:100%}.ontario-large-offset-0{margin-left:0 !important}.ontario-large-offset-1{margin-left:8.3333333333% !important}.ontario-large-offset-2{margin-left:16.6666666667% !important}.ontario-large-offset-3{margin-left:25% !important}.ontario-large-offset-4{margin-left:33.3333333333% !important}.ontario-large-offset-5{margin-left:41.6666666667% !important}.ontario-large-offset-6{margin-left:50% !important}.ontario-large-offset-7{margin-left:58.3333333333% !important}.ontario-large-offset-8{margin-left:66.6666666667% !important}.ontario-large-offset-9{margin-left:75% !important}.ontario-large-offset-10{margin-left:83.3333333333% !important}.ontario-large-offset-11{margin-left:91.6666666667% !important}.ontario-large-reset-order{float:left;left:auto;margin-left:0;margin-right:0;right:auto}.ontario-column.ontario-large-centered,.ontario-columns.ontario-large-centered{margin-left:auto;margin-right:auto;float:none}.ontario-column.ontario-large-uncentered,.ontario-columns.ontario-large-uncentered{float:left;margin-left:0;margin-right:0}.ontario-column.ontario-large-centered:last-child,.ontario-columns.ontario-large-centered:last-child{float:none}.ontario-column.ontario-large-uncentered:last-child,.ontario-columns.ontario-large-uncentered:last-child{float:left}.ontario-column.ontario-large-uncentered.ontario-opposite,.ontario-columns.ontario-large-uncentered.ontario-opposite{float:right}.ontario-row.ontario-large-collapse>.ontario-column,.ontario-row.ontario-large-collapse>.ontario-columns{padding-left:0;padding-right:0}.ontario-row.ontario-large-collapse .ontario-row{margin-left:0;margin-right:0}.ontario-row.ontario-large-uncollapse>.ontario-column,.ontario-row.ontario-large-uncollapse>.ontario-columns{padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}.ontario-push-0{position:relative;left:0;right:auto}.ontario-pull-0{position:relative;right:0;left:auto}.ontario-push-1{position:relative;left:8.3333333333%;right:auto}.ontario-pull-1{position:relative;right:8.3333333333%;left:auto}.ontario-push-2{position:relative;left:16.6666666667%;right:auto}.ontario-pull-2{position:relative;right:16.6666666667%;left:auto}.ontario-push-3{position:relative;left:25%;right:auto}.ontario-pull-3{position:relative;right:25%;left:auto}.ontario-push-4{position:relative;left:33.3333333333%;right:auto}.ontario-pull-4{position:relative;right:33.3333333333%;left:auto}.ontario-push-5{position:relative;left:41.6666666667%;right:auto}.ontario-pull-5{position:relative;right:41.6666666667%;left:auto}.ontario-push-6{position:relative;left:50%;right:auto}.ontario-pull-6{position:relative;right:50%;left:auto}.ontario-push-7{position:relative;left:58.3333333333%;right:auto}.ontario-pull-7{position:relative;right:58.3333333333%;left:auto}.ontario-push-8{position:relative;left:66.6666666667%;right:auto}.ontario-pull-8{position:relative;right:66.6666666667%;left:auto}.ontario-push-9{position:relative;left:75%;right:auto}.ontario-pull-9{position:relative;right:75%;left:auto}.ontario-push-10{position:relative;left:83.3333333333%;right:auto}.ontario-pull-10{position:relative;right:83.3333333333%;left:auto}.ontario-push-11{position:relative;left:91.6666666667%;right:auto}.ontario-pull-11{position:relative;right:91.6666666667%;left:auto}}@media only screen and (min-width:96.063em){.ontario-xlarge-push-0{position:relative;left:0;right:auto}.ontario-xlarge-pull-0{position:relative;right:0;left:auto}.ontario-xlarge-push-1{position:relative;left:8.3333333333%;right:auto}.ontario-xlarge-pull-1{position:relative;right:8.3333333333%;left:auto}.ontario-xlarge-push-2{position:relative;left:16.6666666667%;right:auto}.ontario-xlarge-pull-2{position:relative;right:16.6666666667%;left:auto}.ontario-xlarge-push-3{position:relative;left:25%;right:auto}.ontario-xlarge-pull-3{position:relative;right:25%;left:auto}.ontario-xlarge-push-4{position:relative;left:33.3333333333%;right:auto}.ontario-xlarge-pull-4{position:relative;right:33.3333333333%;left:auto}.ontario-xlarge-push-5{position:relative;left:41.6666666667%;right:auto}.ontario-xlarge-pull-5{position:relative;right:41.6666666667%;left:auto}.ontario-xlarge-push-6{position:relative;left:50%;right:auto}.ontario-xlarge-pull-6{position:relative;right:50%;left:auto}.ontario-xlarge-push-7{position:relative;left:58.3333333333%;right:auto}.ontario-xlarge-pull-7{position:relative;right:58.3333333333%;left:auto}.ontario-xlarge-push-8{position:relative;left:66.6666666667%;right:auto}.ontario-xlarge-pull-8{position:relative;right:66.6666666667%;left:auto}.ontario-xlarge-push-9{position:relative;left:75%;right:auto}.ontario-xlarge-pull-9{position:relative;right:75%;left:auto}.ontario-xlarge-push-10{position:relative;left:83.3333333333%;right:auto}.ontario-xlarge-pull-10{position:relative;right:83.3333333333%;left:auto}.ontario-xlarge-push-11{position:relative;left:91.6666666667%;right:auto}.ontario-xlarge-pull-11{position:relative;right:91.6666666667%;left:auto}.ontario-column,.ontario-columns{position:relative;padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}.ontario-xlarge-1{width:8.3333333333%}.ontario-xlarge-2{width:16.6666666667%}.ontario-xlarge-3{width:25%}.ontario-xlarge-4{width:33.3333333333%}.ontario-xlarge-5{width:41.6666666667%}.ontario-xlarge-6{width:50%}.ontario-xlarge-7{width:58.3333333333%}.ontario-xlarge-8{width:66.6666666667%}.ontario-xlarge-9{width:75%}.ontario-xlarge-10{width:83.3333333333%}.ontario-xlarge-11{width:91.6666666667%}.ontario-xlarge-12{width:100%}.ontario-xlarge-offset-0{margin-left:0 !important}.ontario-xlarge-offset-1{margin-left:8.3333333333% !important}.ontario-xlarge-offset-2{margin-left:16.6666666667% !important}.ontario-xlarge-offset-3{margin-left:25% !important}.ontario-xlarge-offset-4{margin-left:33.3333333333% !important}.ontario-xlarge-offset-5{margin-left:41.6666666667% !important}.ontario-xlarge-offset-6{margin-left:50% !important}.ontario-xlarge-offset-7{margin-left:58.3333333333% !important}.ontario-xlarge-offset-8{margin-left:66.6666666667% !important}.ontario-xlarge-offset-9{margin-left:75% !important}.ontario-xlarge-offset-10{margin-left:83.3333333333% !important}.ontario-xlarge-offset-11{margin-left:91.6666666667% !important}.ontario-xlarge-reset-order{float:left;left:auto;margin-left:0;margin-right:0;right:auto}.ontario-column.ontario-xlarge-centered,.ontario-columns.ontario-xlarge-centered{margin-left:auto;margin-right:auto;float:none}.ontario-column.ontario-xlarge-uncentered,.ontario-columns.ontario-xlarge-uncentered{float:left;margin-left:0;margin-right:0}.ontario-column.ontario-xlarge-centered:last-child,.ontario-columns.ontario-xlarge-centered:last-child{float:none}.ontario-column.ontario-xlarge-uncentered:last-child,.ontario-columns.ontario-xlarge-uncentered:last-child{float:left}.ontario-column.ontario-xlarge-uncentered.ontario-opposite,.ontario-columns.ontario-xlarge-uncentered.ontario-opposite{float:right}.ontario-row.ontario-xlarge-collapse>.ontario-column,.ontario-row.ontario-xlarge-collapse>.ontario-columns{padding-left:0;padding-right:0}.ontario-row.ontario-xlarge-collapse .ontario-row{margin-left:0;margin-right:0}.ontario-row.ontario-xlarge-uncollapse>.ontario-column,.ontario-row.ontario-xlarge-uncollapse>.ontario-columns{padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}}@media only screen and (min-width:120.063em){.ontario-xxlarge-push-0{position:relative;left:0;right:auto}.ontario-xxlarge-pull-0{position:relative;right:0;left:auto}.ontario-xxlarge-push-1{position:relative;left:8.3333333333%;right:auto}.ontario-xxlarge-pull-1{position:relative;right:8.3333333333%;left:auto}.ontario-xxlarge-push-2{position:relative;left:16.6666666667%;right:auto}.ontario-xxlarge-pull-2{position:relative;right:16.6666666667%;left:auto}.ontario-xxlarge-push-3{position:relative;left:25%;right:auto}.ontario-xxlarge-pull-3{position:relative;right:25%;left:auto}.ontario-xxlarge-push-4{position:relative;left:33.3333333333%;right:auto}.ontario-xxlarge-pull-4{position:relative;right:33.3333333333%;left:auto}.ontario-xxlarge-push-5{position:relative;left:41.6666666667%;right:auto}.ontario-xxlarge-pull-5{position:relative;right:41.6666666667%;left:auto}.ontario-xxlarge-push-6{position:relative;left:50%;right:auto}.ontario-xxlarge-pull-6{position:relative;right:50%;left:auto}.ontario-xxlarge-push-7{position:relative;left:58.3333333333%;right:auto}.ontario-xxlarge-pull-7{position:relative;right:58.3333333333%;left:auto}.ontario-xxlarge-push-8{position:relative;left:66.6666666667%;right:auto}.ontario-xxlarge-pull-8{position:relative;right:66.6666666667%;left:auto}.ontario-xxlarge-push-9{position:relative;left:75%;right:auto}.ontario-xxlarge-pull-9{position:relative;right:75%;left:auto}.ontario-xxlarge-push-10{position:relative;left:83.3333333333%;right:auto}.ontario-xxlarge-pull-10{position:relative;right:83.3333333333%;left:auto}.ontario-xxlarge-push-11{position:relative;left:91.6666666667%;right:auto}.ontario-xxlarge-pull-11{position:relative;right:91.6666666667%;left:auto}.ontario-column,.ontario-columns{position:relative;padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}.ontario-xxlarge-1{width:8.3333333333%}.ontario-xxlarge-2{width:16.6666666667%}.ontario-xxlarge-3{width:25%}.ontario-xxlarge-4{width:33.3333333333%}.ontario-xxlarge-5{width:41.6666666667%}.ontario-xxlarge-6{width:50%}.ontario-xxlarge-7{width:58.3333333333%}.ontario-xxlarge-8{width:66.6666666667%}.ontario-xxlarge-9{width:75%}.ontario-xxlarge-10{width:83.3333333333%}.ontario-xxlarge-11{width:91.6666666667%}.ontario-xxlarge-12{width:100%}.ontario-xxlarge-offset-0{margin-left:0 !important}.ontario-xxlarge-offset-1{margin-left:8.3333333333% !important}.ontario-xxlarge-offset-2{margin-left:16.6666666667% !important}.ontario-xxlarge-offset-3{margin-left:25% !important}.ontario-xxlarge-offset-4{margin-left:33.3333333333% !important}.ontario-xxlarge-offset-5{margin-left:41.6666666667% !important}.ontario-xxlarge-offset-6{margin-left:50% !important}.ontario-xxlarge-offset-7{margin-left:58.3333333333% !important}.ontario-xxlarge-offset-8{margin-left:66.6666666667% !important}.ontario-xxlarge-offset-9{margin-left:75% !important}.ontario-xxlarge-offset-10{margin-left:83.3333333333% !important}.ontario-xxlarge-offset-11{margin-left:91.6666666667% !important}.ontario-xxlarge-reset-order{float:left;left:auto;margin-left:0;margin-right:0;right:auto}.ontario-column.ontario-xxlarge-centered,.ontario-columns.ontario-xxlarge-centered{margin-left:auto;margin-right:auto;float:none}.ontario-column.ontario-xxlarge-uncentered,.ontario-columns.ontario-xxlarge-uncentered{float:left;margin-left:0;margin-right:0}.ontario-column.ontario-xxlarge-centered:last-child,.ontario-columns.ontario-xxlarge-centered:last-child{float:none}.ontario-column.ontario-xxlarge-uncentered:last-child,.ontario-columns.ontario-xxlarge-uncentered:last-child{float:left}.ontario-column.ontario-xxlarge-uncentered.ontario-opposite,.ontario-columns.ontario-xxlarge-uncentered.ontario-opposite{float:right}.ontario-row.ontario-xxlarge-collapse>.ontario-column,.ontario-row.ontario-xxlarge-collapse>.ontario-columns{padding-left:0;padding-right:0}.ontario-row.ontario-xxlarge-collapse .ontario-row{margin-left:0;margin-right:0}.ontario-row.ontario-xxlarge-uncollapse>.ontario-column,.ontario-row.ontario-xxlarge-uncollapse>.ontario-columns{padding-left:1rem;padding-right:1rem;box-sizing:border-box;float:left}}.ontario-hide{display:none !important}.ontario-invisible{visibility:hidden !important}@media screen and (max-width: 39.99875em){.ontario-hide-for-small-only{display:none !important}}@media screen and (max-width: 0em), screen and (min-width: 40em){.ontario-show-for-small-only{display:none !important}}@media print, screen and (min-width: 40em){.ontario-hide-for-medium{display:none !important}}@media screen and (max-width: 39.99875em){.ontario-show-for-medium{display:none !important}}@media screen and (min-width: 40em) and (max-width: 72.99875em){.ontario-hide-for-medium-only{display:none !important}}@media screen and (max-width: 39.99875em), screen and (min-width: 73em){.ontario-show-for-medium-only{display:none !important}}@media print, screen and (min-width: 73em){.ontario-hide-for-large{display:none !important}}@media screen and (max-width: 72.99875em){.ontario-show-for-large{display:none !important}}@media screen and (min-width: 73em) and (max-width: 95.99875em){.ontario-hide-for-large-only{display:none !important}}@media screen and (max-width: 72.99875em), screen and (min-width: 96em){.ontario-show-for-large-only{display:none !important}}.ontario-show-for-sr,.ontario-show-on-focus{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0, 0, 0, 0)}.ontario-show-on-focus:active,.ontario-show-on-focus:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto}.ontario-show-for-landscape,.ontario-hide-for-portrait{display:block !important}@media screen and (orientation: landscape){.ontario-show-for-landscape,.ontario-hide-for-portrait{display:block !important}}@media screen and (orientation: portrait){.ontario-show-for-landscape,.ontario-hide-for-portrait{display:none !important}}.ontario-hide-for-landscape,.ontario-show-for-portrait{display:none !important}@media screen and (orientation: landscape){.ontario-hide-for-landscape,.ontario-show-for-portrait{display:none !important}}@media screen and (orientation: portrait){.ontario-hide-for-landscape,.ontario-show-for-portrait{display:block !important}}.ontario-application-navigation{position:absolute;width:100%}@media screen and (min-width: 73em){.ontario-application-navigation{position:relative;max-width:72rem;width:auto;margin:0 auto}}.ontario-application-navigation__container{background:#FFFFFF;position:absolute;transform:translateY(-100%);width:100%;visibility:hidden;z-index:4}@media screen and (min-width: 73em){.ontario-application-navigation__container{box-shadow:0 4px 12px rgba(0, 0, 0, 0.3);border-radius:4px;display:none;position:absolute;right:1rem;top:calc(100% - 0.5rem);min-width:18.125rem;max-width:30%;z-index:4}}.ontario-application-navigation ul{list-style:none;padding:0.5rem 0;margin:0;border-bottom:1px solid #cccccc}@media screen and (min-width: 73em){.ontario-application-navigation ul{border-bottom:none}}.ontario-application-navigation li{border-top:1px solid #cccccc;padding:0;margin-bottom:0}.ontario-application-navigation li:last-of-type{border-bottom:1px solid #cccccc}.ontario-application-navigation a{color:rgb(25.5, 25.5, 25.5);display:block;font-size:1.125rem;font-weight:600;font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;text-decoration:none;padding:0.625rem 1.5rem}.ontario-application-navigation a:hover{text-decoration:underline;background-color:#e5e5e5}.ontario-application-navigation a:active{text-decoration:underline;background-color:#cccccc}.ontario-application-navigation a:focus,.ontario-application-navigation a:active{box-shadow:0 0 0 4px #009ADB inset}.ontario-application-navigation a.ontario-link--active{border-left:6px solid rgb(25.5, 25.5, 25.5);background-color:rgb(242.25, 242.25, 242.25)}.ontario-application-navigation.ontario-navigation--open .ontario-application-navigation__container{background:#FFFFFF;visibility:visible;transform:translateY(0);transition:transform 0.4s ease-in-out}@media screen and (min-width: 73em){.ontario-application-navigation.ontario-navigation--open .ontario-application-navigation__container{transition:none;display:block}}.ontario-application-navigation.ontario-navigation--open{background:#FFFFFF;z-index:4}@media screen and (max-width: 73em){.ontario-application-navigation.ontario-navigation--open{z-index:2}}';
|
|
29
|
+
|
|
30
|
+
const OntarioHeaderOverflowMenu = /*@__PURE__*/ proxyCustomElement(
|
|
31
|
+
class OntarioHeaderOverflowMenu extends H {
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
this.__registerHost();
|
|
35
|
+
this.__attachShadow();
|
|
36
|
+
/**
|
|
37
|
+
* A state variable to determine whether the menu is open or not.
|
|
38
|
+
*
|
|
39
|
+
* The boolean values map to eitherthe presence (true) or absense (false)
|
|
40
|
+
* of the `ontario-navigation--open` on the `nav` element.
|
|
41
|
+
*
|
|
42
|
+
* Triggered by either the `menuButtonToggled` event or the `click` event.
|
|
43
|
+
*/
|
|
44
|
+
this.menuIsOpen = false;
|
|
45
|
+
/**
|
|
46
|
+
* The current index of the menu item that is focused.
|
|
47
|
+
*/
|
|
48
|
+
this.currentIndex = undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Resets the `currentIndex` value.
|
|
52
|
+
*
|
|
53
|
+
* Typically resets when the menu closes.
|
|
54
|
+
*/
|
|
55
|
+
resetCurrentIndex() {
|
|
56
|
+
this.currentIndex = undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Updates the `currentIndex` value.
|
|
60
|
+
*
|
|
61
|
+
* Typically occurs when a user uses the keyboard to tab through
|
|
62
|
+
* menu items.
|
|
63
|
+
*/
|
|
64
|
+
updateCurrentIndex(index) {
|
|
65
|
+
this.currentIndex = index;
|
|
66
|
+
}
|
|
67
|
+
parseMenuItems() {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
if (!Array.isArray(this.menuItems) && typeof this.menuItems === 'string') {
|
|
70
|
+
let copyOfMenuItems = JSON.parse(this.menuItems);
|
|
71
|
+
// convert stringified boolean values for linkIsActive, to their actual boolean equivalents
|
|
72
|
+
copyOfMenuItems.forEach((menuItem) =>
|
|
73
|
+
typeof (menuItem === null || menuItem === void 0 ? void 0 : menuItem.linkIsActive) === 'string'
|
|
74
|
+
? (menuItem.linkIsActive = convertStringToBoolean(
|
|
75
|
+
menuItem === null || menuItem === void 0 ? void 0 : menuItem.linkIsActive,
|
|
76
|
+
))
|
|
77
|
+
: menuItem === null || menuItem === void 0
|
|
78
|
+
? void 0
|
|
79
|
+
: menuItem.linkIsActive,
|
|
80
|
+
);
|
|
81
|
+
this.menuItemState = copyOfMenuItems;
|
|
82
|
+
} else {
|
|
83
|
+
this.menuItemState = this.menuItems;
|
|
84
|
+
}
|
|
85
|
+
const activeLinkSet =
|
|
86
|
+
(_b =
|
|
87
|
+
(_a = this.menuItemState) === null || _a === void 0
|
|
88
|
+
? void 0
|
|
89
|
+
: _a.some((menuItem) => (menuItem === null || menuItem === void 0 ? void 0 : menuItem.linkIsActive))) !==
|
|
90
|
+
null && _b !== void 0
|
|
91
|
+
? _b
|
|
92
|
+
: [];
|
|
93
|
+
// If no active link is set, try to guess and set the active link based
|
|
94
|
+
// on if the href is included in the URL.
|
|
95
|
+
if (!activeLinkSet) {
|
|
96
|
+
const copyOfMenuItemsState = [...this.menuItemState];
|
|
97
|
+
copyOfMenuItemsState.forEach((menuItem) => {
|
|
98
|
+
const sanitizedSlug = menuItem.href.replace(/\s+/g, '-').toLowerCase();
|
|
99
|
+
menuItem.linkIsActive = window.location.pathname.includes(sanitizedSlug);
|
|
100
|
+
});
|
|
101
|
+
this.menuItemState = [...copyOfMenuItemsState];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* This listens for the `menuButtonToggled` event sent from the header menu button when it is clicked.
|
|
106
|
+
* It is used to toggle menu visibility by adding or removing the ontario-navigation--open class on the nav element.
|
|
107
|
+
*/
|
|
108
|
+
toggleMenuVisibility(event) {
|
|
109
|
+
this.menuIsOpen = event.detail;
|
|
110
|
+
this.resetCurrentIndex();
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Listens for clicks on anything outside of the menu.
|
|
114
|
+
* If a click is outside of the menu, then the menu will
|
|
115
|
+
* close.
|
|
116
|
+
*/
|
|
117
|
+
handleClick(event) {
|
|
118
|
+
// if the menu (ref) is clicked, return
|
|
119
|
+
if (event.composedPath().includes(this.menu)) {
|
|
120
|
+
this.menuIsOpen = true;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.menuIsOpen = false;
|
|
124
|
+
this.resetCurrentIndex();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Listens for keydown events and handles navigation within the menu using the ArrowUp and ArrowDown keys.
|
|
128
|
+
*/
|
|
129
|
+
handleKeyDown(event) {
|
|
130
|
+
if (this.menuIsOpen) {
|
|
131
|
+
const focusableElements = this.menu.querySelectorAll('.ontario-menu-item');
|
|
132
|
+
switch (event.key) {
|
|
133
|
+
case 'ArrowDown':
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
if (this.currentIndex === -1 || this.currentIndex === undefined) {
|
|
136
|
+
this.currentIndex = 0;
|
|
137
|
+
} else {
|
|
138
|
+
this.currentIndex = (this.currentIndex + 1) % focusableElements.length;
|
|
139
|
+
}
|
|
140
|
+
focusableElements[this.currentIndex].focus();
|
|
141
|
+
/**
|
|
142
|
+
* Tried other ways of triggering this function to condense code via a watch on currentIndex,
|
|
143
|
+
* and also tried sticking at the bottom of the switch's parent if statement.
|
|
144
|
+
*
|
|
145
|
+
* Both attempts led to inconsistent results (e.g. the aria message was out of sync with currentIndex)
|
|
146
|
+
* or just didn't appear at all. Setting this at the source seems to have the best outcome.
|
|
147
|
+
*/
|
|
148
|
+
this.updateAriaLive(this.currentIndex);
|
|
149
|
+
break;
|
|
150
|
+
case 'ArrowUp':
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
if (this.currentIndex === -1 || this.currentIndex === undefined) {
|
|
153
|
+
this.currentIndex = focusableElements.length - 1;
|
|
154
|
+
} else {
|
|
155
|
+
this.currentIndex = (this.currentIndex - 1 + focusableElements.length) % focusableElements.length;
|
|
156
|
+
}
|
|
157
|
+
focusableElements[this.currentIndex].focus();
|
|
158
|
+
this.updateAriaLive(this.currentIndex);
|
|
159
|
+
break;
|
|
160
|
+
case 'Tab':
|
|
161
|
+
focusableElements.forEach((element, index) => {
|
|
162
|
+
// within an event listener, the scope of "this" changes.
|
|
163
|
+
// To continue keeping the scope global, set a variable that captures it
|
|
164
|
+
// Without this, calls to global variables/methods/functions will not work
|
|
165
|
+
const self = this;
|
|
166
|
+
if (
|
|
167
|
+
!element.hasAttribute('data-has-focus-listener') ||
|
|
168
|
+
element.getAttribute('data-has-focus-listener') === 'false'
|
|
169
|
+
) {
|
|
170
|
+
element.addEventListener('focus', () => self.updateCurrentIndex(index));
|
|
171
|
+
element.setAttribute('data-has-focus-listener', 'true');
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Updates the aria-live region with the menu item count and selected option.
|
|
180
|
+
*
|
|
181
|
+
* @param {number} selectedIndex The index of the selected menu item
|
|
182
|
+
*/
|
|
183
|
+
updateAriaLive(selectedIndex) {
|
|
184
|
+
const menuItemCount = this.menuItemState.length;
|
|
185
|
+
// index starts at 0, but users expect the message to start at 1
|
|
186
|
+
// therefore add value of +1 to each index value to align with
|
|
187
|
+
// user expectations
|
|
188
|
+
const selectedMenuItemNumber = selectedIndex + 1;
|
|
189
|
+
const ariaLiveMessage = `Option ${selectedMenuItemNumber} of ${menuItemCount}`;
|
|
190
|
+
if (this.ariaLiveRegion) {
|
|
191
|
+
this.ariaLiveRegion.textContent = ariaLiveMessage;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
componentWillLoad() {
|
|
195
|
+
this.parseMenuItems();
|
|
196
|
+
}
|
|
197
|
+
render() {
|
|
198
|
+
var _a;
|
|
199
|
+
return h(
|
|
200
|
+
'nav',
|
|
201
|
+
{
|
|
202
|
+
key: '40a8817026e0ccbf8f66e943036af9120695779a',
|
|
203
|
+
role: 'navigation',
|
|
204
|
+
class: this.menuIsOpen
|
|
205
|
+
? 'ontario-application-navigation ontario-navigation--open'
|
|
206
|
+
: 'ontario-application-navigation',
|
|
207
|
+
id: 'ontario-application-navigation',
|
|
208
|
+
ref: (el) => (this.menu = el),
|
|
209
|
+
},
|
|
210
|
+
h(
|
|
211
|
+
'div',
|
|
212
|
+
{ key: '4a6898ad7ffab9bee53ad6929e35775eaba745b4', class: 'ontario-application-navigation__container' },
|
|
213
|
+
h(
|
|
214
|
+
'ul',
|
|
215
|
+
{ key: 'b960fd93ab7c46ce40da33b545d05e4a034c42b4' },
|
|
216
|
+
(_a = this.menuItemState) === null || _a === void 0
|
|
217
|
+
? void 0
|
|
218
|
+
: _a.map((item) => {
|
|
219
|
+
return generateMenuItem(item.href, item.title, item.linkIsActive);
|
|
220
|
+
}),
|
|
221
|
+
),
|
|
222
|
+
),
|
|
223
|
+
h('div', {
|
|
224
|
+
'key': 'eef3c22887ffe8f9d6370e101d6125fa5f226fd7',
|
|
225
|
+
'id': 'aria-live-region',
|
|
226
|
+
'class': 'ontario-show-for-sr',
|
|
227
|
+
'aria-live': 'polite',
|
|
228
|
+
'ref': (el) => (this.ariaLiveRegion = el),
|
|
229
|
+
}),
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
get el() {
|
|
233
|
+
return this;
|
|
234
|
+
}
|
|
235
|
+
static get watchers() {
|
|
236
|
+
return {
|
|
237
|
+
menuItems: ['parseMenuItems'],
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
static get style() {
|
|
241
|
+
return ontarioHeaderOverflowMenuCss;
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
[
|
|
245
|
+
257,
|
|
246
|
+
'ontario-header-overflow-menu',
|
|
247
|
+
{
|
|
248
|
+
menuItems: [1, 'menu-items'],
|
|
249
|
+
menuItemState: [32],
|
|
250
|
+
menuIsOpen: [32],
|
|
251
|
+
},
|
|
252
|
+
[
|
|
253
|
+
[8, 'menuButtonToggled', 'toggleMenuVisibility'],
|
|
254
|
+
[10, 'click', 'handleClick'],
|
|
255
|
+
[8, 'keydown', 'handleKeyDown'],
|
|
256
|
+
],
|
|
257
|
+
{
|
|
258
|
+
menuItems: ['parseMenuItems'],
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
);
|
|
262
|
+
function defineCustomElement() {
|
|
263
|
+
if (typeof customElements === 'undefined') {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const components = ['ontario-header-overflow-menu'];
|
|
267
|
+
components.forEach((tagName) => {
|
|
268
|
+
switch (tagName) {
|
|
269
|
+
case 'ontario-header-overflow-menu':
|
|
270
|
+
if (!customElements.get(tagName)) {
|
|
271
|
+
customElements.define(tagName, OntarioHeaderOverflowMenu);
|
|
272
|
+
}
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
defineCustomElement();
|
|
278
|
+
|
|
279
|
+
export { OntarioHeaderOverflowMenu as O, defineCustomElement as d, generateMenuItem as g };
|
|
280
|
+
//# sourceMappingURL=p-C0Xvjp7G.js.map
|
|
281
|
+
|
|
282
|
+
//# sourceMappingURL=p-C0Xvjp7G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-C0Xvjp7G.js","mappings":"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","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/utils/components/header/header-menu-items.tsx","src/components/ontario-header-overflow-menu/ontario-header-overflow-menu.scss?tag=ontario-header-overflow-menu&encapsulation=shadow","src/components/ontario-header-overflow-menu/ontario-header-overflow-menu.tsx"],"sourcesContent":["import { h } from '@stencil/core';\n\n/**\n * This function generates the menu items in a <li>, accordingly, to the given parameters.\n *\n * href and title are necessary, but rest are not.\n *\n * @param {string} href - the href of the menu item\n * @param {string} title - the title of the menu item\n * @param {boolean} [linkIsActive] - when set to true, this will add the classes necessary to style the link in a way that indicates to the user what the active page/link is\n * @param {string} [liClass] - if there is a class that is related to the <a> portion of the menu item, put it here\n * @param {function(PointerEvent): void} [onClickHandler] - for any custom onClick functionality a user might want to add to their menu links\n */\nexport const generateMenuItem = (\n\thref: string,\n\ttitle: string,\n\tlinkIsActive?: boolean,\n\tliClass?: string,\n\tonClickHandler?: (e: PointerEvent) => void,\n) => {\n\treturn (\n\t\t<li class={liClass}>\n\t\t\t<a class={`ontario-menu-item ${linkIsActive ? 'ontario-link--active' : ''}`} href={href} onClick={onClickHandler}>\n\t\t\t\t{title}\n\t\t\t</a>\n\t\t</li>\n\t);\n};\n","@use 'sass:math';\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/global.variables' as globalVariables;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/spacing.variables' as spacing;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/colours.variables' as colours;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/breakpoints.variables' as breakpoints;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/fonts.variables' as fonts;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/functions/global.functions' as\n\tglobalFunctions;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-weights.variables' as fontWeights;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/placeholder/focus.placeholders' as\n\tfocusPlaceholders;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/z-index.variables' as zIndex;\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/typography.variables';\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/5-layout/_grid.layout.scss';\n@use 'pkg:@ongov/ontario-design-system-global-styles/dist/styles/scss/7-overrides/_visibility.overrides.scss';\n@use '../../styles/header.scss';\n\n$navigation-link-bg--hover: #e5e5e5;\n$ontario-navigation-link-padding-vertical: globalFunctions.px-to-rem(10);\n$ontario-header-overflow-menu-link-font-size: globalFunctions.px-to-rem(18);\n$border-width-1: 1px;\n$border-width-6: 6px;\n\n.ontario-application-navigation {\n\t@extend %ontario-application-navigation;\n\n\tul {\n\t\tlist-style: none;\n\t\tpadding: spacing.$spacing-2 spacing.$spacing-0;\n\t\tmargin: spacing.$spacing-0;\n\t\tborder-bottom: $border-width-1 solid colours.$ontario-greyscale-20;\n\n\t\t@media screen and (min-width: breakpoints.$medium-breakpoint) {\n\t\t\tborder-bottom: none;\n\t\t}\n\t}\n\n\tli {\n\t\tborder-top: $border-width-1 solid colours.$ontario-greyscale-20;\n\t\tpadding: spacing.$spacing-0;\n\t\tmargin-bottom: spacing.$spacing-0;\n\n\t\t&:last-of-type {\n\t\t\tborder-bottom: $border-width-1 solid colours.$ontario-greyscale-20;\n\t\t}\n\t}\n\n\ta {\n\t\tcolor: colours.$ontario-colour-black;\n\t\tdisplay: block;\n\t\tfont-size: $ontario-header-overflow-menu-link-font-size;\n\t\tfont-weight: fontWeights.$ontario-font-weights-semi-bold;\n\t\tfont-family: fonts.$ontario-font-open-sans;\n\t\ttext-decoration: none;\n\t\tpadding: $ontario-navigation-link-padding-vertical spacing.$spacing-5;\n\n\t\t&:hover {\n\t\t\ttext-decoration: underline;\n\t\t\tbackground-color: $navigation-link-bg--hover;\n\t\t}\n\n\t\t&:active {\n\t\t\ttext-decoration: underline;\n\t\t\tbackground-color: colours.$ontario-greyscale-20;\n\t\t}\n\n\t\t&:focus,\n\t\t&:active {\n\t\t\t@extend %ontario-focus;\n\t\t\tbox-shadow: focusPlaceholders.$ontario-focus-box-shadow inset;\n\t\t}\n\n\t\t&.ontario-link--active {\n\t\t\tborder-left: $border-width-6 solid colours.$ontario-colour-black;\n\t\t\tbackground-color: colours.$ontario-greyscale-5;\n\t\t}\n\t}\n}\n\n.ontario-application-navigation__container {\n\t@extend %ontario-application-navigation__container;\n}\n\n.ontario-application-navigation.ontario-navigation--open .ontario-application-navigation__container {\n\tbackground: colours.$ontario-colour-white;\n\tvisibility: visible;\n\ttransform: translateY(0);\n\ttransition: transform 0.4s ease-in-out;\n\n\t@media screen and (min-width: breakpoints.$medium-breakpoint) {\n\t\ttransition: none;\n\t\tdisplay: block;\n\t}\n}\n\n.ontario-application-navigation.ontario-navigation--open {\n\tbackground: colours.$ontario-colour-white;\n\tz-index: zIndex.$ontario-z-index-above-high;\n\n\t@media screen and (max-width: breakpoints.$medium-breakpoint) {\n\t\tz-index: zIndex.$ontario-z-index-above-medium; // behind header for animation purposes\n\t}\n}\n","import { Component, Prop, State, Watch, h, Listen, Element } from '@stencil/core';\nimport { MenuItem } from '../../utils/common/common.interface';\nimport { generateMenuItem } from '../../utils/components/header/header-menu-items';\nimport { convertStringToBoolean } from '../../utils/helper/utils';\n\n@Component({\n\ttag: 'ontario-header-overflow-menu',\n\tstyleUrl: 'ontario-header-overflow-menu.scss',\n\tshadow: true,\n})\nexport class OntarioHeaderOverflowMenu {\n\t@Element() el: HTMLElement;\n\n\t/**\n\t * The items that will go inside the menu.\n\t *\n\t * @example\n\t * \t<ontario-header-overflow-menu\n\t *\t\t\tmenu-items='[{\n\t *\t\t\t\t\"title\": \"Link 1\",\n\t *\t\t\t\t\"href\": \"/link-1\"\n\t *\t\t\t\t\"linkIsActive\": \"false\"\n\t *\t\t\t},{\n\t *\t\t\t\t\"title\": \"Link 2\",\n\t *\t\t\t\t\"href\": \"/link-2\"\n\t *\t\t\t\t\"linkIsActive\": \"false\"\n\t *\t\t\t},{\n\t *\t\t\t\t\"title\": \"Link 3\",\n\t *\t\t\t\t\"href\": \"/link-3\"\n\t *\t\t\t\t\"linkIsActive\": \"false\"\n\t *\t\t\t},{\n\t *\t\t\t\t\"title\": \"Link 4\",\n\t *\t\t\t\t\"href\": \"/link-4\"\n\t *\t\t\t\t\"linkIsActive\": \"false\"\n\t *\t\t\t}]'>\n\t *\t</ontario-header-overflow-menu>\n\t */\n\t@Prop() menuItems: MenuItem[] | string;\n\n\t/**\n\t * The `menuItems` are reassigned to `menuItemState` for parsing by `parseMenuItems()`.\n\t */\n\t@State() private menuItemState: MenuItem[];\n\n\t/**\n\t * A state variable to determine whether the menu is open or not.\n\t *\n\t * The boolean values map to eitherthe presence (true) or absense (false)\n\t * of the `ontario-navigation--open` on the `nav` element.\n\t *\n\t * Triggered by either the `menuButtonToggled` event or the `click` event.\n\t */\n\t@State() private menuIsOpen: boolean = false;\n\n\t/**\n\t * The current index of the menu item that is focused.\n\t */\n\tprivate currentIndex: number | undefined = undefined;\n\n\t/**\n\t * Resets the `currentIndex` value.\n\t *\n\t * Typically resets when the menu closes.\n\t */\n\tprivate resetCurrentIndex() {\n\t\tthis.currentIndex = undefined;\n\t}\n\n\t/**\n\t * Updates the `currentIndex` value.\n\t *\n\t * Typically occurs when a user uses the keyboard to tab through\n\t * menu items.\n\t */\n\tprivate updateCurrentIndex(index: number) {\n\t\tthis.currentIndex = index;\n\t}\n\n\t@Watch('menuItems')\n\tparseMenuItems() {\n\t\tif (!Array.isArray(this.menuItems) && typeof this.menuItems === 'string') {\n\t\t\tlet copyOfMenuItems = JSON.parse(this.menuItems) as MenuItem[];\n\t\t\t// convert stringified boolean values for linkIsActive, to their actual boolean equivalents\n\t\t\tcopyOfMenuItems.forEach((menuItem) =>\n\t\t\t\ttypeof menuItem?.linkIsActive === 'string'\n\t\t\t\t\t? (menuItem.linkIsActive = convertStringToBoolean(menuItem?.linkIsActive))\n\t\t\t\t\t: menuItem?.linkIsActive,\n\t\t\t);\n\t\t\tthis.menuItemState = copyOfMenuItems;\n\t\t} else {\n\t\t\tthis.menuItemState = this.menuItems;\n\t\t}\n\n\t\tconst activeLinkSet = this.menuItemState?.some((menuItem) => menuItem?.linkIsActive) ?? [];\n\n\t\t// If no active link is set, try to guess and set the active link based\n\t\t// on if the href is included in the URL.\n\t\tif (!activeLinkSet) {\n\t\t\tconst copyOfMenuItemsState = [...this.menuItemState];\n\t\t\tcopyOfMenuItemsState.forEach((menuItem) => {\n\t\t\t\tconst sanitizedSlug = menuItem.href.replace(/\\s+/g, '-').toLowerCase();\n\t\t\t\tmenuItem.linkIsActive = window.location.pathname.includes(sanitizedSlug);\n\t\t\t});\n\n\t\t\tthis.menuItemState = [...copyOfMenuItemsState];\n\t\t}\n\t}\n\n\t/**\n\t * This listens for the `menuButtonToggled` event sent from the header menu button when it is clicked.\n\t * It is used to toggle menu visibility by adding or removing the ontario-navigation--open class on the nav element.\n\t */\n\t@Listen('menuButtonToggled', { target: 'window' })\n\ttoggleMenuVisibility(event: CustomEvent<boolean>) {\n\t\tthis.menuIsOpen = event.detail;\n\t\tthis.resetCurrentIndex();\n\t}\n\n\t/**\n\t * Listens for clicks on anything outside of the menu.\n\t * If a click is outside of the menu, then the menu will\n\t * close.\n\t */\n\t@Listen('click', { capture: true, target: 'window' })\n\thandleClick(event: PointerEvent) {\n\t\t// if the menu (ref) is clicked, return\n\t\tif (event.composedPath().includes(this.menu)) {\n\t\t\tthis.menuIsOpen = true;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.menuIsOpen = false;\n\t\tthis.resetCurrentIndex();\n\t}\n\n\t/**\n\t * Listens for keydown events and handles navigation within the menu using the ArrowUp and ArrowDown keys.\n\t */\n\t@Listen('keydown', { target: 'window' })\n\thandleKeyDown(event: KeyboardEvent) {\n\t\tif (this.menuIsOpen) {\n\t\t\tconst focusableElements: NodeListOf<HTMLElement> = this.menu.querySelectorAll('.ontario-menu-item');\n\n\t\t\tswitch (event.key) {\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (this.currentIndex === -1 || this.currentIndex === undefined) {\n\t\t\t\t\t\tthis.currentIndex = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.currentIndex = (this.currentIndex + 1) % focusableElements.length;\n\t\t\t\t\t}\n\t\t\t\t\tfocusableElements[this.currentIndex].focus();\n\t\t\t\t\t/**\n\t\t\t\t\t * Tried other ways of triggering this function to condense code via a watch on currentIndex,\n\t\t\t\t\t * and also tried sticking at the bottom of the switch's parent if statement.\n\t\t\t\t\t *\n\t\t\t\t\t * Both attempts led to inconsistent results (e.g. the aria message was out of sync with currentIndex)\n\t\t\t\t\t * or just didn't appear at all. Setting this at the source seems to have the best outcome.\n\t\t\t\t\t */\n\t\t\t\t\tthis.updateAriaLive(this.currentIndex);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (this.currentIndex === -1 || this.currentIndex === undefined) {\n\t\t\t\t\t\tthis.currentIndex = focusableElements.length - 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.currentIndex = (this.currentIndex - 1 + focusableElements.length) % focusableElements.length;\n\t\t\t\t\t}\n\t\t\t\t\tfocusableElements[this.currentIndex].focus();\n\t\t\t\t\tthis.updateAriaLive(this.currentIndex);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Tab':\n\t\t\t\t\tfocusableElements.forEach((element, index) => {\n\t\t\t\t\t\t// within an event listener, the scope of \"this\" changes.\n\t\t\t\t\t\t// To continue keeping the scope global, set a variable that captures it\n\t\t\t\t\t\t// Without this, calls to global variables/methods/functions will not work\n\t\t\t\t\t\tconst self = this;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!element.hasAttribute('data-has-focus-listener') ||\n\t\t\t\t\t\t\telement.getAttribute('data-has-focus-listener') === 'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\telement.addEventListener('focus', () => self.updateCurrentIndex(index));\n\t\t\t\t\t\t\telement.setAttribute('data-has-focus-listener', 'true');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Updates the aria-live region with the menu item count and selected option.\n\t *\n\t * @param {number} selectedIndex The index of the selected menu item\n\t */\n\tprivate updateAriaLive(selectedIndex: number) {\n\t\tconst menuItemCount = this.menuItemState.length;\n\t\t// index starts at 0, but users expect the message to start at 1\n\t\t// therefore add value of +1 to each index value to align with\n\t\t// user expectations\n\t\tconst selectedMenuItemNumber = selectedIndex + 1;\n\t\tconst ariaLiveMessage = `Option ${selectedMenuItemNumber} of ${menuItemCount}`;\n\n\t\tif (this.ariaLiveRegion) {\n\t\t\tthis.ariaLiveRegion.textContent = ariaLiveMessage;\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.parseMenuItems();\n\t}\n\n\t/**\n\t * Assigning values to elements to use them as ref\n\t */\n\tprivate menu!: HTMLElement;\n\n\t/**\n\t * The aria-live region that will be updated with the selected menu item.\n\t */\n\tprivate ariaLiveRegion!: HTMLElement;\n\n\trender() {\n\t\treturn (\n\t\t\t<nav\n\t\t\t\trole=\"navigation\"\n\t\t\t\tclass={\n\t\t\t\t\tthis.menuIsOpen ? 'ontario-application-navigation ontario-navigation--open' : 'ontario-application-navigation'\n\t\t\t\t}\n\t\t\t\tid=\"ontario-application-navigation\"\n\t\t\t\tref={(el) => (this.menu = el as HTMLElement)}\n\t\t\t>\n\t\t\t\t<div class=\"ontario-application-navigation__container\">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t{this.menuItemState?.map((item: MenuItem) => {\n\t\t\t\t\t\t\treturn generateMenuItem(item.href, item.title, item.linkIsActive);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tid=\"aria-live-region\"\n\t\t\t\t\tclass=\"ontario-show-for-sr\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\tref={(el) => (this.ariaLiveRegion = el as HTMLElement)}\n\t\t\t\t></div>\n\t\t\t</nav>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { h } from './index.js';
|
|
2
|
+
|
|
3
|
+
var __rest =
|
|
4
|
+
(undefined && undefined.__rest) ||
|
|
5
|
+
function (s, e) {
|
|
6
|
+
var t = {};
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
8
|
+
if (s != null && typeof Object.getOwnPropertySymbols === 'function')
|
|
9
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
10
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
const Input = (_a) => {
|
|
15
|
+
var {
|
|
16
|
+
autoComplete,
|
|
17
|
+
className,
|
|
18
|
+
id,
|
|
19
|
+
name,
|
|
20
|
+
placeholder,
|
|
21
|
+
type,
|
|
22
|
+
value,
|
|
23
|
+
checked,
|
|
24
|
+
required,
|
|
25
|
+
onKeyDown,
|
|
26
|
+
onInput,
|
|
27
|
+
onChange,
|
|
28
|
+
onBlur,
|
|
29
|
+
onFocus,
|
|
30
|
+
onClick,
|
|
31
|
+
ariaInvalid,
|
|
32
|
+
ariaDescribedBy,
|
|
33
|
+
ref,
|
|
34
|
+
inputMode,
|
|
35
|
+
} = _a,
|
|
36
|
+
props = __rest(_a, [
|
|
37
|
+
'autoComplete',
|
|
38
|
+
'className',
|
|
39
|
+
'id',
|
|
40
|
+
'name',
|
|
41
|
+
'placeholder',
|
|
42
|
+
'type',
|
|
43
|
+
'value',
|
|
44
|
+
'checked',
|
|
45
|
+
'required',
|
|
46
|
+
'onKeyDown',
|
|
47
|
+
'onInput',
|
|
48
|
+
'onChange',
|
|
49
|
+
'onBlur',
|
|
50
|
+
'onFocus',
|
|
51
|
+
'onClick',
|
|
52
|
+
'ariaInvalid',
|
|
53
|
+
'ariaDescribedBy',
|
|
54
|
+
'ref',
|
|
55
|
+
'inputMode',
|
|
56
|
+
]);
|
|
57
|
+
return h(
|
|
58
|
+
'input',
|
|
59
|
+
Object.assign(
|
|
60
|
+
{
|
|
61
|
+
'autoComplete': autoComplete,
|
|
62
|
+
'class': className,
|
|
63
|
+
'id': id,
|
|
64
|
+
'name': name,
|
|
65
|
+
'type': type,
|
|
66
|
+
'value': value,
|
|
67
|
+
'checked': checked,
|
|
68
|
+
'placeholder': placeholder,
|
|
69
|
+
'required': !!required,
|
|
70
|
+
'onKeyDown': onKeyDown,
|
|
71
|
+
'onInput': onInput,
|
|
72
|
+
'onChange': onChange,
|
|
73
|
+
'onBlur': onBlur,
|
|
74
|
+
'onFocus': onFocus,
|
|
75
|
+
'onClick': onClick,
|
|
76
|
+
'inputMode': inputMode,
|
|
77
|
+
'ref': ref,
|
|
78
|
+
'aria-invalid': ariaInvalid,
|
|
79
|
+
'aria-describedby': ariaDescribedBy,
|
|
80
|
+
},
|
|
81
|
+
props,
|
|
82
|
+
),
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { Input as I };
|
|
87
|
+
//# sourceMappingURL=p-C73HZQcq.js.map
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=p-C73HZQcq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-C73HZQcq.js","mappings":";;;;;;;;;;;;;AAwBa,MAAA,KAAK,GAAoC,CAAC,EAqBtD,KAAI;AArBkD,IAAA,IAAA,EACtD,YAAY,EACZ,SAAS,EACT,EAAE,EACF,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,eAAe,EACf,GAAG,EACH,SAAS,EAAA,GAAA,EAET,EADG,KAAK,GAAA,MAAA,CAAA,EAAA,EApB8C,4NAqBtD,CADQ;AAER,IAAA,QACC,CACC,CAAA,OAAA,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,SAAS,EAChB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,CAAC,QAAQ,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EAAA,cAAA,EACM,WAAW,EACP,kBAAA,EAAA,eAAe,IAC7B,KAAK,CAAA,CACR;AAEJ;;;;","names":[],"sources":["src/utils/common/input/input.tsx"],"sourcesContent":["import { FunctionalComponent, h } from '@stencil/core';\n\nexport type InputProps = {\n\tautoComplete?: string;\n\tclassName?: string;\n\tid: string;\n\tname?: string;\n\ttype: string;\n\tvalue?: string | number;\n\tchecked?: boolean;\n\trequired?: boolean;\n\tinputMode?: string;\n\tplaceholder?: string;\n\tariaInvalid?: boolean;\n\tariaDescribedBy?: string;\n\tonKeyDown?: ((event: Event) => void) | undefined;\n\tonInput?: ((event: Event) => void) | undefined;\n\tonChange?: ((event: Event) => void) | undefined;\n\tonBlur?: ((event: Event) => void) | undefined;\n\tonFocus?: ((event: Event) => void) | undefined;\n\tonClick?: ((event: Event) => void) | undefined;\n\tref?: (el: HTMLInputElement) => HTMLElement;\n};\n\nexport const Input: FunctionalComponent<InputProps> = ({\n\tautoComplete,\n\tclassName,\n\tid,\n\tname,\n\tplaceholder,\n\ttype,\n\tvalue,\n\tchecked,\n\trequired,\n\tonKeyDown,\n\tonInput,\n\tonChange,\n\tonBlur,\n\tonFocus,\n\tonClick,\n\tariaInvalid,\n\tariaDescribedBy,\n\tref,\n\tinputMode,\n\t...props\n}) => {\n\treturn (\n\t\t<input\n\t\t\tautoComplete={autoComplete}\n\t\t\tclass={className}\n\t\t\tid={id}\n\t\t\tname={name}\n\t\t\ttype={type}\n\t\t\tvalue={value}\n\t\t\tchecked={checked}\n\t\t\tplaceholder={placeholder}\n\t\t\trequired={!!required}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonInput={onInput}\n\t\t\tonChange={onChange}\n\t\t\tonBlur={onBlur}\n\t\t\tonFocus={onFocus}\n\t\t\tonClick={onClick}\n\t\t\tinputMode={inputMode}\n\t\t\tref={ref}\n\t\t\taria-invalid={ariaInvalid}\n\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n"],"version":3}
|