@gov-design-system-ce/components 0.0.58 → 0.0.59
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/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-app.cjs.entry.js +96 -37
- package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-badge.cjs.entry.js +1 -1
- package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +1 -1
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-infobar.cjs.entry.js +90 -0
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-toast.cjs.entry.js +1 -1
- package/dist/cjs/gov-tooltip-content.cjs.entry.js +16 -4
- package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js +73 -46
- package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/index-83edd4fe.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.css +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion.css +1 -1
- package/dist/collection/components/gov-app/gov-app.css +1 -1
- package/dist/collection/components/gov-app/gov-app.js +2 -2
- package/dist/collection/components/gov-app/gov-app.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.css +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments.css +1 -1
- package/dist/collection/components/gov-backdrop/gov-backdrop.css +1 -1
- package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
- package/dist/collection/components/gov-badge/gov-badge.css +41 -11
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +1 -1
- package/dist/collection/components/gov-button/default/gov-button.css +10 -1
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.css +1 -1
- package/dist/collection/components/gov-card/gov-card.css +1 -1
- package/dist/collection/components/gov-container/gov-container.css +1 -1
- package/dist/collection/components/gov-control-group/gov-control-group.css +1 -1
- package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +1 -1
- package/dist/collection/components/gov-empty/gov-empty.css +1 -1
- package/dist/collection/components/gov-error-code/gov-error-code.css +1 -1
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +1 -1
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +1 -1
- package/dist/collection/components/gov-form/control/gov-form-control.css +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.css +1 -1
- package/dist/collection/components/gov-form/group/gov-form-group.css +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.css +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.css +5 -1
- package/dist/collection/components/gov-form/message/gov-form-message.css +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +1 -1
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +1 -1
- package/dist/collection/components/gov-form/radio/gov-form-radio.css +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.css +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.css +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.css +1 -1
- package/dist/collection/components/gov-grid/gov-grid-item.css +1 -1
- package/dist/collection/components/gov-grid/gov-grid.css +1 -1
- package/dist/collection/components/gov-icon/gov-icon.css +1 -1
- package/dist/collection/components/gov-infobar/default/constants.js +12 -0
- package/dist/collection/components/gov-infobar/default/constants.js.map +1 -0
- package/dist/collection/components/gov-infobar/default/gov-infobar.css +384 -0
- package/dist/collection/components/{gov-alert/gov-alert.js → gov-infobar/default/gov-infobar.js} +27 -27
- package/dist/collection/components/gov-infobar/default/gov-infobar.js.map +1 -0
- package/dist/collection/components/gov-infobar/default/gov-infobar.types.js +2 -0
- package/dist/collection/components/gov-infobar/default/gov-infobar.types.js.map +1 -0
- package/dist/collection/components/gov-layout/gov-layout-column.css +1 -1
- package/dist/collection/components/gov-layout/gov-layout.css +1 -1
- package/dist/collection/components/gov-loading/loading/gov-loading.css +1 -1
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.css +1 -1
- package/dist/collection/components/gov-message/gov-message.css +1 -1
- package/dist/collection/components/gov-modal/gov-modal.css +1 -1
- package/dist/collection/components/gov-nav/gov-nav-item.css +1 -1
- package/dist/collection/components/gov-nav/gov-nav.css +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.css +1 -1
- package/dist/collection/components/gov-promp/gov-prompt.css +1 -1
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +1 -1
- package/dist/collection/components/gov-side-nav/gov-side-nav.css +1 -1
- package/dist/collection/components/gov-spacer/gov-spacer.css +1 -1
- package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +1 -1
- package/dist/collection/components/gov-statsbar/gov-statsbar.css +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper-item.css +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper.css +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs-item.css +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs.css +1 -1
- package/dist/collection/components/gov-tile/container/gov-tiles.css +1 -1
- package/dist/collection/components/gov-tile/gov-tile.css +1 -1
- package/dist/collection/components/gov-toast/gov-toast.css +2 -2
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +32 -27
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +101 -5
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.css +1 -17
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +83 -51
- package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard-item.css +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard.css +1 -1
- package/dist/collection/pages/Card.js +11 -9
- package/dist/collection/pages/Card.js.map +1 -1
- package/dist/collection/pages/Home.js +43 -1
- package/dist/collection/pages/Home.js.map +1 -1
- package/dist/collection/pages/{Alert.js → Infobar.js} +42 -27
- package/dist/collection/pages/Infobar.js.map +1 -0
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-app.js +1 -1
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-badge.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-label.js +1 -1
- package/dist/components/gov-form-label.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/{gov-alert.d.ts → gov-infobar.d.ts} +4 -4
- package/dist/components/gov-infobar.js +2 -0
- package/dist/components/gov-infobar.js.map +1 -0
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-tooltip-content.js.map +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-tooltip.js.map +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-da3b225f.js → p-30af8d08.js} +2 -2
- package/dist/components/p-3e8a9e92.js.map +1 -1
- package/dist/components/{p-a6915747.js → p-5d8154f9.js} +2 -2
- package/dist/components/{p-0378da4d.js → p-8d44ca3c.js} +2 -2
- package/dist/components/p-8d44ca3c.js.map +1 -0
- package/dist/components/{p-404f469e.js → p-9a4c910d.js} +2 -2
- package/dist/components/{p-70d9d879.js → p-ae179d8a.js} +2 -2
- package/dist/components/p-ae179d8a.js.map +1 -0
- package/dist/components/{p-35f6490a.js → p-afb7fc88.js} +2 -2
- package/dist/components/{p-ee60cdd1.js → p-b430ee05.js} +2 -2
- package/dist/components/{p-9cba3cd3.js → p-e24896b9.js} +2 -2
- package/dist/core/core.css +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-3d0ab343.entry.js → p-0c57e410.entry.js} +2 -2
- package/dist/core/{p-42c1935f.entry.js → p-243a61bf.entry.js} +2 -2
- package/dist/core/{p-18ef9623.entry.js → p-2bf0c1c5.entry.js} +2 -2
- package/dist/core/p-2c0ac7ab.entry.js +2 -0
- package/dist/core/{p-85258200.entry.js.map → p-2c0ac7ab.entry.js.map} +1 -1
- package/dist/core/p-307d4c56.entry.js +2 -0
- package/dist/core/p-307d4c56.entry.js.map +1 -0
- package/dist/core/{p-6a65af35.entry.js → p-32a4b7e3.entry.js} +2 -2
- package/dist/core/p-32a4b7e3.entry.js.map +1 -0
- package/dist/core/{p-bd1cb5bd.entry.js → p-4452c278.entry.js} +2 -2
- package/dist/core/{p-a85f4a62.entry.js → p-49729bd4.entry.js} +2 -2
- package/dist/core/{p-ae894a40.js → p-570ef4e5.js} +2 -2
- package/dist/core/p-5cc3e768.entry.js +2 -0
- package/dist/core/p-5cc3e768.entry.js.map +1 -0
- package/dist/core/{p-33bf5974.entry.js → p-7372b066.entry.js} +2 -2
- package/dist/core/{p-69f944d1.entry.js → p-73fb7ac7.entry.js} +2 -2
- package/dist/core/{p-87aca157.entry.js → p-7702c8c2.entry.js} +2 -2
- package/dist/core/{p-9d72d80b.entry.js → p-7e8d2066.entry.js} +2 -2
- package/dist/core/{p-a5d00433.entry.js → p-7fa1290e.entry.js} +2 -2
- package/dist/core/{p-fb99f144.entry.js → p-8033916b.entry.js} +2 -2
- package/dist/core/p-82b4b522.entry.js +2 -0
- package/dist/core/p-82b4b522.entry.js.map +1 -0
- package/dist/core/{p-8fce08d1.entry.js → p-8667d5df.entry.js} +2 -2
- package/dist/core/{p-41e88980.entry.js → p-93897e60.entry.js} +2 -2
- package/dist/core/{p-41e88980.entry.js.map → p-93897e60.entry.js.map} +1 -1
- package/dist/core/{p-cacd0fed.entry.js → p-998c3336.entry.js} +2 -2
- package/dist/core/{p-404f469e.js → p-9a4c910d.js} +2 -2
- package/dist/core/{p-667dc3de.entry.js → p-afa12399.entry.js} +2 -2
- package/dist/core/{p-70140f70.entry.js → p-b0c97376.entry.js} +2 -2
- package/dist/core/p-bcf71ab5.entry.js +2 -0
- package/dist/core/p-bcf71ab5.entry.js.map +1 -0
- package/dist/core/{p-0c1697ce.entry.js → p-c4c9ff83.entry.js} +2 -2
- package/dist/core/{p-af646ce2.entry.js → p-c61444f7.entry.js} +2 -2
- package/dist/core/p-c61444f7.entry.js.map +1 -0
- package/dist/core/{p-d4cfa93a.entry.js → p-cb37644f.entry.js} +2 -2
- package/dist/core/{p-9bfab069.entry.js → p-ce262a72.entry.js} +2 -2
- package/dist/core/p-f9dfaff1.entry.js +2 -0
- package/dist/core/p-f9dfaff1.entry.js.map +1 -0
- package/dist/core/{p-13624a77.entry.js → p-fea58abc.entry.js} +2 -2
- package/dist/core/{p-dd39ede4.entry.js → p-ff97a688.entry.js} +2 -2
- package/dist/esm/{constants-f7b618c2.js → constants-887c5391.js} +2 -2
- package/dist/esm/{constants-f7b618c2.js.map → constants-887c5391.js.map} +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-accordion.entry.js +1 -1
- package/dist/esm/gov-app.entry.js +96 -37
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-attachments_3.entry.js +1 -1
- package/dist/esm/gov-backdrop.entry.js +1 -1
- package/dist/esm/gov-backdrop.entry.js.map +1 -1
- package/dist/esm/gov-badge.entry.js +1 -1
- package/dist/esm/gov-badge.entry.js.map +1 -1
- package/dist/esm/gov-breadcrumbs.entry.js +1 -1
- package/dist/esm/gov-button.entry.js +2 -2
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-card.entry.js +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +1 -1
- package/dist/esm/gov-form-file.entry.js +1 -1
- package/dist/esm/gov-form-input.entry.js +1 -1
- package/dist/esm/gov-form-label.entry.js +1 -1
- package/dist/esm/gov-form-label.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +1 -1
- package/dist/esm/gov-form-radio.entry.js +1 -1
- package/dist/esm/gov-form-select.entry.js +1 -1
- package/dist/esm/gov-form-switch.entry.js +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-infobar.entry.js +86 -0
- package/dist/esm/gov-infobar.entry.js.map +1 -0
- package/dist/esm/gov-modal.entry.js +1 -1
- package/dist/esm/gov-nav.entry.js +1 -1
- package/dist/esm/gov-pagination.entry.js +1 -1
- package/dist/esm/gov-prompt.entry.js +1 -1
- package/dist/esm/gov-side-nav.entry.js +1 -1
- package/dist/esm/gov-skeleton.entry.js +1 -1
- package/dist/esm/gov-tabs.entry.js +1 -1
- package/dist/esm/gov-toast.entry.js +1 -1
- package/dist/esm/gov-tooltip-content.entry.js +17 -5
- package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.entry.js +74 -47
- package/dist/esm/gov-tooltip.entry.js.map +1 -1
- package/dist/esm/gov-wizard.entry.js +1 -1
- package/dist/esm/index-ae3c50f1.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{wcag-062e7ca9.js → wcag-06bd4d01.js} +2 -2
- package/dist/esm/{wcag-062e7ca9.js.map → wcag-06bd4d01.js.map} +1 -1
- package/dist/globals.d.ts +2 -0
- package/dist/hydrate/index.js +287 -184
- package/dist/types/components/gov-app/gov-app.d.ts +1 -1
- package/dist/types/components/gov-backdrop/gov-backdrop.d.ts +1 -1
- package/dist/types/components/gov-infobar/default/constants.d.ts +12 -0
- package/dist/types/components/{gov-alert/gov-alert.d.ts → gov-infobar/default/gov-infobar.d.ts} +9 -9
- package/dist/types/components/gov-infobar/default/gov-infobar.types.d.ts +4 -0
- package/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +19 -1
- package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +7 -3
- package/dist/types/components.d.ts +116 -84
- package/dist/types/pages/Infobar.d.ts +3 -0
- package/dist/types/types/typings.d.ts +6 -0
- package/package.json +2 -2
- package/dist/cjs/gov-alert.cjs.entry.js +0 -90
- package/dist/cjs/gov-alert.cjs.entry.js.map +0 -1
- package/dist/collection/components/gov-alert/constants.js +0 -12
- package/dist/collection/components/gov-alert/constants.js.map +0 -1
- package/dist/collection/components/gov-alert/gov-alert.css +0 -398
- package/dist/collection/components/gov-alert/gov-alert.js.map +0 -1
- package/dist/collection/components/gov-alert/gov-alert.types.js +0 -2
- package/dist/collection/components/gov-alert/gov-alert.types.js.map +0 -1
- package/dist/collection/pages/Alert.js.map +0 -1
- package/dist/components/gov-alert.js +0 -2
- package/dist/components/gov-alert.js.map +0 -1
- package/dist/components/p-0378da4d.js.map +0 -1
- package/dist/components/p-70d9d879.js.map +0 -1
- package/dist/core/p-3b9df792.entry.js +0 -2
- package/dist/core/p-3b9df792.entry.js.map +0 -1
- package/dist/core/p-3e5432d7.entry.js +0 -2
- package/dist/core/p-3e5432d7.entry.js.map +0 -1
- package/dist/core/p-4c79a97a.entry.js +0 -2
- package/dist/core/p-4c79a97a.entry.js.map +0 -1
- package/dist/core/p-6a65af35.entry.js.map +0 -1
- package/dist/core/p-85258200.entry.js +0 -2
- package/dist/core/p-af646ce2.entry.js.map +0 -1
- package/dist/core/p-bbcbe1cc.entry.js +0 -2
- package/dist/core/p-bbcbe1cc.entry.js.map +0 -1
- package/dist/core/p-dfc080f2.entry.js +0 -2
- package/dist/core/p-dfc080f2.entry.js.map +0 -1
- package/dist/esm/gov-alert.entry.js +0 -86
- package/dist/esm/gov-alert.entry.js.map +0 -1
- package/dist/types/components/gov-alert/constants.d.ts +0 -12
- package/dist/types/components/gov-alert/gov-alert.types.d.ts +0 -4
- package/dist/types/pages/Alert.d.ts +0 -3
- /package/dist/components/{p-da3b225f.js.map → p-30af8d08.js.map} +0 -0
- /package/dist/components/{p-a6915747.js.map → p-5d8154f9.js.map} +0 -0
- /package/dist/components/{p-404f469e.js.map → p-9a4c910d.js.map} +0 -0
- /package/dist/components/{p-35f6490a.js.map → p-afb7fc88.js.map} +0 -0
- /package/dist/components/{p-ee60cdd1.js.map → p-b430ee05.js.map} +0 -0
- /package/dist/components/{p-9cba3cd3.js.map → p-e24896b9.js.map} +0 -0
- /package/dist/core/{p-3d0ab343.entry.js.map → p-0c57e410.entry.js.map} +0 -0
- /package/dist/core/{p-42c1935f.entry.js.map → p-243a61bf.entry.js.map} +0 -0
- /package/dist/core/{p-18ef9623.entry.js.map → p-2bf0c1c5.entry.js.map} +0 -0
- /package/dist/core/{p-bd1cb5bd.entry.js.map → p-4452c278.entry.js.map} +0 -0
- /package/dist/core/{p-a85f4a62.entry.js.map → p-49729bd4.entry.js.map} +0 -0
- /package/dist/core/{p-ae894a40.js.map → p-570ef4e5.js.map} +0 -0
- /package/dist/core/{p-33bf5974.entry.js.map → p-7372b066.entry.js.map} +0 -0
- /package/dist/core/{p-69f944d1.entry.js.map → p-73fb7ac7.entry.js.map} +0 -0
- /package/dist/core/{p-87aca157.entry.js.map → p-7702c8c2.entry.js.map} +0 -0
- /package/dist/core/{p-9d72d80b.entry.js.map → p-7e8d2066.entry.js.map} +0 -0
- /package/dist/core/{p-a5d00433.entry.js.map → p-7fa1290e.entry.js.map} +0 -0
- /package/dist/core/{p-fb99f144.entry.js.map → p-8033916b.entry.js.map} +0 -0
- /package/dist/core/{p-8fce08d1.entry.js.map → p-8667d5df.entry.js.map} +0 -0
- /package/dist/core/{p-cacd0fed.entry.js.map → p-998c3336.entry.js.map} +0 -0
- /package/dist/core/{p-404f469e.js.map → p-9a4c910d.js.map} +0 -0
- /package/dist/core/{p-667dc3de.entry.js.map → p-afa12399.entry.js.map} +0 -0
- /package/dist/core/{p-70140f70.entry.js.map → p-b0c97376.entry.js.map} +0 -0
- /package/dist/core/{p-0c1697ce.entry.js.map → p-c4c9ff83.entry.js.map} +0 -0
- /package/dist/core/{p-d4cfa93a.entry.js.map → p-cb37644f.entry.js.map} +0 -0
- /package/dist/core/{p-9bfab069.entry.js.map → p-ce262a72.entry.js.map} +0 -0
- /package/dist/core/{p-13624a77.entry.js.map → p-fea58abc.entry.js.map} +0 -0
- /package/dist/core/{p-dd39ede4.entry.js.map → p-ff97a688.entry.js.map} +0 -0
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { validateProp } from "../../helpers/Validate/props";
|
|
3
|
-
import {
|
|
3
|
+
import { TooltipClass, TooltipContentClass, TooltipPosition, TooltipSize, TooltipVariant, } from "./constants";
|
|
4
4
|
import { createID } from "../../utils/string.utils";
|
|
5
5
|
import { govHost } from "../../helpers/Dom/template";
|
|
6
6
|
export class GovTooltip {
|
|
7
7
|
constructor() {
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
8
|
+
this.tooltipContentId = undefined;
|
|
9
|
+
this.tooltipId = undefined;
|
|
10
|
+
this.variant = TooltipVariant.PRIMARY;
|
|
11
|
+
this.size = TooltipSize._M;
|
|
12
|
+
this.position = "right";
|
|
11
13
|
this.message = undefined;
|
|
12
14
|
this.identifier = undefined;
|
|
13
15
|
this.icon = undefined;
|
|
16
|
+
this.persist = false;
|
|
14
17
|
this.h = govHost(this.host);
|
|
15
|
-
this.tooltipId = createID(
|
|
18
|
+
this.tooltipId = createID("GovTooltip");
|
|
19
|
+
this.tooltipContentId = createID("GovContentTooltip");
|
|
16
20
|
}
|
|
17
21
|
validateVariant(newValue) {
|
|
18
22
|
validateProp(TooltipVariant, newValue, TooltipClass.root);
|
|
@@ -30,6 +34,9 @@ export class GovTooltip {
|
|
|
30
34
|
this.createContentWrapper();
|
|
31
35
|
this.registerListeners();
|
|
32
36
|
}
|
|
37
|
+
disconnectedCallback() {
|
|
38
|
+
this.removeContent();
|
|
39
|
+
}
|
|
33
40
|
createContentWrapper() {
|
|
34
41
|
var _a;
|
|
35
42
|
const hasContentInside = this.host.querySelector(TooltipContentClass.root);
|
|
@@ -41,84 +48,103 @@ export class GovTooltip {
|
|
|
41
48
|
this.content.innerHTML = this.message;
|
|
42
49
|
this.host.appendChild(this.content);
|
|
43
50
|
}
|
|
44
|
-
this.content.setAttribute(
|
|
51
|
+
this.content.setAttribute("id", (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId);
|
|
52
|
+
this.content.setAttribute("parent-id", this.tooltipId);
|
|
53
|
+
this.content.setAttribute("variant", this.variant);
|
|
54
|
+
this.content.setAttribute("size", this.size);
|
|
55
|
+
document.body.appendChild(this.content);
|
|
45
56
|
}
|
|
46
57
|
registerListeners() {
|
|
47
|
-
this.host.addEventListener(
|
|
58
|
+
this.host.addEventListener("click", e => {
|
|
48
59
|
e.preventDefault();
|
|
60
|
+
this.persist = true;
|
|
49
61
|
this.showTooltip();
|
|
50
62
|
});
|
|
51
|
-
this.host.addEventListener(
|
|
63
|
+
this.host.addEventListener("focus", e => {
|
|
52
64
|
e.preventDefault();
|
|
53
|
-
this.
|
|
65
|
+
this.showTooltip();
|
|
66
|
+
});
|
|
67
|
+
this.host.addEventListener("blur", e => {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
if (this.persist === false) {
|
|
70
|
+
this.hideTooltip();
|
|
71
|
+
}
|
|
54
72
|
});
|
|
55
|
-
this.host.addEventListener(
|
|
73
|
+
this.host.addEventListener("mouseenter", e => {
|
|
56
74
|
e.preventDefault();
|
|
57
75
|
this.showTooltip();
|
|
58
76
|
});
|
|
59
|
-
this.host.addEventListener(
|
|
77
|
+
this.host.addEventListener("mouseleave", e => {
|
|
60
78
|
e.preventDefault();
|
|
61
|
-
this.
|
|
79
|
+
if (this.persist === false) {
|
|
80
|
+
this.hideTooltip();
|
|
81
|
+
}
|
|
62
82
|
});
|
|
63
83
|
}
|
|
64
84
|
verifyPositionSpace() {
|
|
65
|
-
// @TODO Improve positioning of broken lines
|
|
66
85
|
const offset = 12;
|
|
67
|
-
const windowWidth = window.innerWidth;
|
|
68
86
|
const trigger = this.host.getBoundingClientRect();
|
|
69
87
|
const trgWidth = this.host.offsetWidth;
|
|
88
|
+
const trgHeight = this.host.offsetHeight;
|
|
89
|
+
const contentWidth = this.content.offsetWidth;
|
|
90
|
+
const contentHeight = this.content.offsetHeight;
|
|
70
91
|
const triggerPos = {
|
|
71
92
|
left: trigger.left + document.documentElement.scrollLeft,
|
|
72
93
|
top: trigger.top + document.documentElement.scrollTop,
|
|
73
94
|
};
|
|
74
|
-
|
|
75
|
-
if (this.position === TooltipPosition.LEFT) {
|
|
76
|
-
|
|
77
|
-
this.position = TooltipPosition.TOP;
|
|
78
|
-
this.content.style.left = '0px';
|
|
79
|
-
this.content.style.width = window.innerWidth - triggerPos.left - offset + 'px';
|
|
80
|
-
this.content.style.transform = 'none';
|
|
81
|
-
}
|
|
95
|
+
// @TODO check space for displaying tooltip
|
|
96
|
+
if (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {
|
|
97
|
+
this.content.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + "px";
|
|
82
98
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.content.style.right = '0px';
|
|
87
|
-
this.content.style.left = 'auto';
|
|
88
|
-
this.content.style.width = trgWidth + triggerPos.left + offset + 'px';
|
|
89
|
-
this.content.style.transform = 'none';
|
|
90
|
-
}
|
|
99
|
+
if (this.position === TooltipPosition.RIGHT) {
|
|
100
|
+
this.content.setAttribute("position", TooltipPosition.RIGHT);
|
|
101
|
+
this.content.style.left = (triggerPos.left + offset + trigger.width) + "px";
|
|
91
102
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
103
|
+
if (this.position === TooltipPosition.LEFT) {
|
|
104
|
+
this.content.setAttribute("position", TooltipPosition.LEFT);
|
|
105
|
+
this.content.style.left = (triggerPos.left - (contentWidth + offset)) + "px";
|
|
106
|
+
}
|
|
107
|
+
if (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {
|
|
108
|
+
if (contentWidth > trgWidth) {
|
|
109
|
+
this.content.style.left = (triggerPos.left - ((contentWidth - trgWidth) / 2)) + "px";
|
|
98
110
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this.content.style.right = '0px';
|
|
102
|
-
this.content.style.left = 'auto';
|
|
103
|
-
this.content.style.width = trgWidth + triggerPos.left + offset + 'px';
|
|
104
|
-
this.content.style.transform = 'none';
|
|
111
|
+
else {
|
|
112
|
+
this.content.style.left = (triggerPos.left + ((trgWidth - contentWidth) / 2)) + "px";
|
|
105
113
|
}
|
|
106
114
|
}
|
|
115
|
+
if (this.position === TooltipPosition.TOP) {
|
|
116
|
+
this.content.setAttribute("position", TooltipPosition.TOP);
|
|
117
|
+
this.content.style.top = (triggerPos.top - (contentHeight + offset)) + "px";
|
|
118
|
+
}
|
|
119
|
+
if (this.position === TooltipPosition.BOTTOM) {
|
|
120
|
+
this.content.setAttribute("position", TooltipPosition.BOTTOM);
|
|
121
|
+
this.content.style.top = (triggerPos.top + (trgHeight + offset)) + "px";
|
|
122
|
+
}
|
|
107
123
|
}
|
|
108
124
|
showTooltip() {
|
|
109
125
|
if (this.content) {
|
|
110
126
|
this.verifyPositionSpace();
|
|
111
|
-
this.content.setAttribute(
|
|
127
|
+
this.content.setAttribute("is-visible", "true");
|
|
128
|
+
if (this.persist) {
|
|
129
|
+
this.content.setAttribute("persist", "true");
|
|
130
|
+
}
|
|
112
131
|
}
|
|
113
132
|
}
|
|
114
133
|
hideTooltip() {
|
|
115
134
|
if (this.content) {
|
|
116
|
-
this.content.setAttribute(
|
|
135
|
+
this.content.setAttribute("is-visible", "false");
|
|
136
|
+
this.content.setAttribute("persist", "false");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
removeContent() {
|
|
140
|
+
const contentEl = document.getElementById(this.tooltipContentId);
|
|
141
|
+
if (contentEl) {
|
|
142
|
+
contentEl.remove();
|
|
117
143
|
}
|
|
118
144
|
}
|
|
119
145
|
render() {
|
|
120
146
|
var _a;
|
|
121
|
-
return (h(Host, { class: this.h.classes(TooltipClass.root), position: this.position,
|
|
147
|
+
return (h(Host, { id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position, tabindex: 0, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, h("slot", null)));
|
|
122
148
|
}
|
|
123
149
|
/**
|
|
124
150
|
* Showing the modal
|
|
@@ -127,9 +153,10 @@ export class GovTooltip {
|
|
|
127
153
|
this.showTooltip();
|
|
128
154
|
}
|
|
129
155
|
/**
|
|
130
|
-
*
|
|
156
|
+
* Hiding the modal
|
|
131
157
|
*/
|
|
132
158
|
async hide() {
|
|
159
|
+
this.persist = false;
|
|
133
160
|
this.hideTooltip();
|
|
134
161
|
}
|
|
135
162
|
static get is() { return "gov-tooltip"; }
|
|
@@ -167,7 +194,7 @@ export class GovTooltip {
|
|
|
167
194
|
},
|
|
168
195
|
"attribute": "variant",
|
|
169
196
|
"reflect": false,
|
|
170
|
-
"defaultValue": "
|
|
197
|
+
"defaultValue": "TooltipVariant.PRIMARY"
|
|
171
198
|
},
|
|
172
199
|
"size": {
|
|
173
200
|
"type": "string",
|
|
@@ -191,7 +218,7 @@ export class GovTooltip {
|
|
|
191
218
|
},
|
|
192
219
|
"attribute": "size",
|
|
193
220
|
"reflect": false,
|
|
194
|
-
"defaultValue": "
|
|
221
|
+
"defaultValue": "TooltipSize._M"
|
|
195
222
|
},
|
|
196
223
|
"position": {
|
|
197
224
|
"type": "string",
|
|
@@ -215,7 +242,7 @@ export class GovTooltip {
|
|
|
215
242
|
},
|
|
216
243
|
"attribute": "position",
|
|
217
244
|
"reflect": false,
|
|
218
|
-
"defaultValue": "
|
|
245
|
+
"defaultValue": "\"right\""
|
|
219
246
|
},
|
|
220
247
|
"message": {
|
|
221
248
|
"type": "string",
|
|
@@ -229,7 +256,7 @@ export class GovTooltip {
|
|
|
229
256
|
"optional": false,
|
|
230
257
|
"docs": {
|
|
231
258
|
"tags": [],
|
|
232
|
-
"text": "Information contained in the
|
|
259
|
+
"text": "Information contained in the tooltip"
|
|
233
260
|
},
|
|
234
261
|
"attribute": "message",
|
|
235
262
|
"reflect": false,
|
|
@@ -272,6 +299,11 @@ export class GovTooltip {
|
|
|
272
299
|
}
|
|
273
300
|
};
|
|
274
301
|
}
|
|
302
|
+
static get states() {
|
|
303
|
+
return {
|
|
304
|
+
"persist": {}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
275
307
|
static get methods() {
|
|
276
308
|
return {
|
|
277
309
|
"show": {
|
|
@@ -304,7 +336,7 @@ export class GovTooltip {
|
|
|
304
336
|
"return": "Promise<void>"
|
|
305
337
|
},
|
|
306
338
|
"docs": {
|
|
307
|
-
"text": "
|
|
339
|
+
"text": "Hiding the modal",
|
|
308
340
|
"tags": []
|
|
309
341
|
}
|
|
310
342
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-tooltip.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,MA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;EACF,CAAC;EAED,MAAM;;IACL,OAAO,CACN,EAAC,IAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,CAAC,sBACO,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,SAAS,EACnD,OAAO,EAAE,IAAI,CAAC,OAAO;MAErB,eAAQ,CACF,CACP,CAAA;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop, Watch } from '@stencil/core'\nimport { validateProp } from '../../helpers/Validate/props'\nimport {\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipVariant,\n\tTooltipVariantType,\n} from './constants'\nimport { createID } from '../../utils/string.utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-tooltip',\n\tstyleUrl: 'gov-tooltip.scss',\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate content: HTMLGovTooltipContentElement\n\tprivate readonly tooltipId\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID('GovTooltip')\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly variant?: TooltipVariantType = 'primary'\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = 'm'\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop() position: TooltipPositionType = 'right'\n\t/**\n\t * Information contained in the tolltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({ attribute: 'icon' }) readonly icon: boolean = undefined\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TooltipVariant, newValue, TooltipClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch('position')\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tconst hasContentInside = this.host.querySelector(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\tif (hasContentInside) {\n\t\t\tthis.content = hasContentInside\n\t\t} else {\n\t\t\tthis.content = document.createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tthis.content.innerHTML = this.message\n\t\t\tthis.host.appendChild(this.content)\n\t\t}\n\n\t\tthis.content.setAttribute('id', this.identifier ?? this.tooltipId)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener('focus', e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener('blur', e => {\n\t\t\te.preventDefault()\n\t\t\tthis.hideTooltip()\n\t\t})\n\t\tthis.host.addEventListener('mouseenter', e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener('mouseleave', e => {\n\t\t\te.preventDefault()\n\t\t\tthis.hideTooltip()\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\t// @TODO Improve positioning of broken lines\n\t\tconst offset = 12\n\t\tconst windowWidth = window.innerWidth\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\t\tconst tltWidth = this.content.offsetWidth\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tif (offset + triggerPos.left < tltWidth) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.content.style.left = '0px'\n\t\t\t\tthis.content.style.width = window.innerWidth - triggerPos.left - offset + 'px'\n\t\t\t\tthis.content.style.transform = 'none'\n\t\t\t}\n\t\t} else if (this.position === TooltipPosition.RIGHT) {\n\t\t\tif (windowWidth - (triggerPos.left + trgWidth) < tltWidth) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.content.style.right = '0px'\n\t\t\t\tthis.content.style.left = 'auto'\n\t\t\t\tthis.content.style.width = trgWidth + triggerPos.left + offset + 'px'\n\t\t\t\tthis.content.style.transform = 'none'\n\t\t\t}\n\t\t} else {\n\t\t\t// doesn't fit from the left\n\t\t\tif (tltWidth / 2 > triggerPos.left) {\n\t\t\t\tthis.content.style.left = '0px'\n\t\t\t\tthis.content.style.width = window.innerWidth - triggerPos.left - offset + 'px'\n\t\t\t\tthis.content.style.transform = 'none'\n\t\t\t}\n\t\t\t// doesn't fit from the right\n\t\t\telse if (tltWidth / 2 > windowWidth - (triggerPos.left + tltWidth)) {\n\t\t\t\tthis.content.style.right = '0px'\n\t\t\t\tthis.content.style.left = 'auto'\n\t\t\t\tthis.content.style.width = trgWidth + triggerPos.left + offset + 'px'\n\t\t\t\tthis.content.style.transform = 'none'\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.verifyPositionSpace()\n\t\t\tthis.content.setAttribute('is-visible', 'true')\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.content.setAttribute('is-visible', 'false')\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}\n\t\t\t\tsize={this.size}\n\t\t\t\ttabindex={0}\n\t\t\t\taria-describedby={this.identifier ?? this.tooltipId}\n\t\t\t\tvariant={this.variant}\n\t\t\t>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hidding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideTooltip()\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-tooltip.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,eAAe,EAEf,WAAW,EAEX,cAAc,GAEd,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD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C,gBAAgB,CAAC,CAAA;IAChE,IAAI,SAAS,EAAE;MACd,SAAS,CAAC,MAAM,EAAE,CAAA;KAClB;EACF,CAAC;EAED,MAAM;;IACL,OAAO,CACN,EAAC,IAAI,IACJ,EAAE,EAAE,IAAI,CAAC,SAAS,EAClB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,CAAC,sBACO,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,gBAAgB;MAC1D,eAAQ,CACF,CACP,CAAA;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACpB,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipVariant,\n\tTooltipVariantType,\n} from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\n\n@Component({\n\ttag: \"gov-tooltip\",\n\tstyleUrl: \"gov-tooltip.scss\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate content: HTMLGovTooltipContentElement\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly variant?: TooltipVariantType = TooltipVariant.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop() position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({ attribute: \"icon\" }) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TooltipVariant, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tconst hasContentInside = this.host.querySelector(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\tif (hasContentInside) {\n\t\t\tthis.content = hasContentInside\n\t\t} else {\n\t\t\tthis.content = document.createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tthis.content.innerHTML = this.message\n\t\t\tthis.host.appendChild(this.content)\n\t\t}\n\n\t\tthis.content.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tthis.content.setAttribute(\"parent-id\", this.tooltipId)\n\t\tthis.content.setAttribute(\"variant\", this.variant)\n\t\tthis.content.setAttribute(\"size\", this.size)\n\t\tdocument.body.appendChild(this.content)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"focus\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"blur\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.content.offsetWidth\n\t\tconst contentHeight = this.content.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\t\t// @TODO check space for displaying tooltip\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.content.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.content.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.content.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tthis.content.style.left = (triggerPos.left - ((contentWidth - trgWidth) / 2)) + \"px\"\n\t\t\t} else {\n\t\t\t\tthis.content.style.left = (triggerPos.left + ((trgWidth - contentWidth) / 2)) + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.content.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.content.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.verifyPositionSpace()\n\t\t\tthis.content.setAttribute(\"is-visible\", \"true\")\n\t\t\tif (this.persist) {\n\t\t\t\tthis.content.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.content.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.content.setAttribute(\"persist\", \"false\")\n\t\t}\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}\n\t\t\t\ttabindex={0}\n\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.persist = false\n\t\tthis.hideTooltip()\n\t}\n}\n"]}
|
|
@@ -15,15 +15,17 @@ class CardPage extends HTMLElement {
|
|
|
15
15
|
|
|
16
16
|
<div style="height: 400px">
|
|
17
17
|
<gov-card label="Fusce tellus odio, dapibus id fermentum quis" expanded collapsible>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
<div class="gov-content">
|
|
19
|
+
<p class="gov-color--secondary-700">
|
|
20
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ipsum vitae etiam dui eget lectus vulputate ornare.
|
|
21
|
+
</p>
|
|
22
|
+
<gov-button variant="primary" size="s" href="http://localhost:3333/button">
|
|
23
|
+
Button
|
|
24
|
+
</gov-button>
|
|
25
|
+
<p slot="footer" class="gov-color--primary-700">
|
|
26
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ipsum vitae etiam dui eget lectus vulputate ornare.
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
27
29
|
</gov-card>
|
|
28
30
|
</div>
|
|
29
31
|
<br>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../../src/pages/Card.ts"],"names":[],"mappings":"AAAA,MAAM,QAAS,SAAQ,WAAW;EACjC,iBAAiB;IAChB,IAAI,CAAC,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../../src/pages/Card.ts"],"names":[],"mappings":"AAAA,MAAM,QAAS,SAAQ,WAAW;EACjC,iBAAiB;IAChB,IAAI,CAAC,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FhB,CAAA;EACF,CAAC;CACD;AAED,IAAI,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,SAAS,EAAE;EAClD,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;CAC5C","sourcesContent":["class CardPage extends HTMLElement {\n\tconnectedCallback() {\n\t\tthis.innerHTML = `\n\n\t\t<div style=\"max-width: 650px\">\n\t\t\t<h2>Card</h2>\n\n\t\t\t<gov-card label=\"Fusce tellus odio, dapibus id fermentum quis\" expanded collapsible class=\"gov-bg--success-100\">\n\t\t\t\t<p class=\"gov-color--secondary-700\">\n\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Ipsum vitae etiam dui eget lectus vulputate ornare.\n\t\t\t\t</p>\n\t\t\t</gov-card>\n\n\t\t\t<br>\n\n\t\t\t<div style=\"height: 400px\">\n\t\t\t\t<gov-card label=\"Fusce tellus odio, dapibus id fermentum quis\" expanded collapsible>\n\t\t\t\t\t<div class=\"gov-content\">\n\t\t\t\t\t\t<p class=\"gov-color--secondary-700\">\n\t\t\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Ipsum vitae etiam dui eget lectus vulputate ornare.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<gov-button variant=\"primary\" size=\"s\" href=\"http://localhost:3333/button\">\n\t\t\t\t\t\t\tButton\n\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t<p slot=\"footer\" class=\"gov-color--primary-700\">\n\t\t\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Ipsum vitae etiam dui eget lectus vulputate ornare.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</gov-card>\n\t\t\t</div>\n\t\t\t<br>\n\t\t\t<gov-card label=\"Fusce tellus odio, dapibus id fermentum quis\">\n\t\t\t\t<p class=\"gov-color--secondary-700\">\n\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Ipsum vitae etiam dui eget lectus vulputate ornare.\n\t\t\t\t</p>\n\t\t\t\t<gov-button variant=\"primary\" size=\"s\" href=\"http://localhost:3333/button\">\n\t\t\t\t\tButton\n\t\t\t\t</gov-button>\n\t\t\t\t<p slot=\"footer\" color=\"gov-color--primary-700\">\n\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Ipsum vitae etiam dui eget lectus vulputate ornare.\n\t\t\t\t</p>\n\t\t\t</gov-card>\n\t\t\t<h3>Image slot</h3>\n\t\t\t<gov-card expanded>\n\t\t\t\t<img slot=\"img\" src=\"https://picsum.photos/536/354\" src=\"\" alt=\"Obárzek\" width=\"536\" height=\"354\">\n\t\t\t\t<p class=\"gov-text--l gov-color--secondary-800\">\n\t\t\t\t\t<b>\n\t\t\t\t\t\tCommodo consequat.\n\t\t\t\t\t</b>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"gov-color--secondary-700\">\n\t\t\t\t\tCommodo consequat. Nullam rhoncus aliquam metus.\n\t\t\t\t</p>\n\t\t\t\t<p class=\"gov-color--secondary-700\">\n\t\t\t\t\t<a href=\"#\">Chci vědět více</a>\n\t\t\t\t</p>\n\t\t\t</gov-card>\n\t\t\t<h3>Shadow variant</h3>\n\t\t\t<gov-card expanded class=\"gov-box-shadow--m\">\n\t\t\t\t<img slot=\"img\" src=\"https://picsum.photos/536/354\" src=\"\" alt=\"Obárzek\" width=\"536\" height=\"354\">\n\t\t\t\t<p class=\"gov-text--l gov-color--secondary-800\">\n\t\t\t\t\t<b>\n\t\t\t\t\t\tCommodo consequat.\n\t\t\t\t\t</b>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"gov-color--secondary-700\">\n\t\t\t\t\tCommodo consequat. Nullam rhoncus aliquam metus.\n\t\t\t\t</p>\n\t\t\t\t<gov-button variant=\"primary\" size=\"s\" href=\"http://localhost:3333/button\">\n\t\t\t\t\tJak založit\n\t\t\t\t</gov-button>\n\t\t\t\t<gov-button variant=\"primary\" type=\"outlined\" size=\"s\" href=\"http://localhost:3333/button\">\n\t\t\t\t\tZjistit více\n\t\t\t\t</gov-button>\n\t\t\t</gov-card>\n\t\t\t<h3>With icon</h3>\n\t\t\t<gov-card>\n\t\t\t\t<gov-icon name=\"car\" type=\"complex\"></gov-icon>\n\t\t\t\t<p class=\"gov-color--secondary-700\">\n\t\t\t\t\tLorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras elementum. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Fusce tellus.\n\t\t\t\t</p>\n\t\t\t\t<gov-button variant=\"primary\" type=\"outlined\" size=\"s\" href=\"http://localhost:3333/button\">\n\t\t\t\t\tLearn more\n\t\t\t\t</gov-button>\n\t\t\t</gov-card>\n\t\t\t<h3>Horizontal orientation</h3>\n\t\t\t<gov-card promotion>\n\t\t\t\t<gov-icon slot=\"icon\" name=\"car\" type=\"complex\"></gov-icon>\n\t\t\t\t<p class=\"gov-color--secondary-700\">\n\t\t\t\t\tLorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras elementum. Fusce tellus odio, dapibus id fermentum quis, suscipit id erat. Fusce tellus.\n\t\t\t\t</p>\n\t\t\t\t<gov-button slot=\"btn\" variant=\"primary\" type=\"outlined\" size=\"s\" href=\"http://localhost:3333/button\">\n\t\t\t\t\tLearn more\n\t\t\t\t</gov-button>\n\t\t\t</gov-card>\n\t\t</div>\n\n\t\t`\n\t}\n}\n\nif (customElements.get('card-page') === undefined) {\n\tcustomElements.define('card-page', CardPage)\n}\n"]}
|
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
class HomePage extends HTMLElement {
|
|
2
2
|
connectedCallback() {
|
|
3
|
-
this.innerHTML =
|
|
3
|
+
this.innerHTML = `
|
|
4
|
+
<form style="padding: 20px;">
|
|
5
|
+
<gov-form-label legend>
|
|
6
|
+
Form Label legend
|
|
7
|
+
</gov-form-label>
|
|
8
|
+
<gov-form-control type="input">
|
|
9
|
+
<gov-form-label size="s" slot="top">Label of input</gov-form-label>
|
|
10
|
+
<gov-form-group>
|
|
11
|
+
<gov-form-input type="number" name="test-me" placeholder="Placeholder" variant="primary" size="s"></gov-form-input>
|
|
12
|
+
</gov-form-group>
|
|
13
|
+
</gov-form-control>
|
|
14
|
+
<br><br>
|
|
15
|
+
<legend>Legend</legend>
|
|
16
|
+
<gov-form-control type="input">
|
|
17
|
+
<gov-form-label size="s" slot="top">Label of input</gov-form-label>
|
|
18
|
+
<gov-form-group>
|
|
19
|
+
<gov-form-input type="number" name="test-me" placeholder="Placeholder" variant="primary" size="s"></gov-form-input>
|
|
20
|
+
</gov-form-group>
|
|
21
|
+
</gov-form-control>
|
|
22
|
+
<br><br>
|
|
23
|
+
<gov-form-control type="input" fieldset>
|
|
24
|
+
<gov-form-label size="s" slot="top">Form control fieldset</gov-form-label>
|
|
25
|
+
<gov-form-group>
|
|
26
|
+
<gov-form-input type="number" name="test-me" placeholder="Placeholder" variant="primary" size="s"></gov-form-input>
|
|
27
|
+
</gov-form-group>
|
|
28
|
+
</gov-form-control>
|
|
29
|
+
<br><br>
|
|
30
|
+
<fieldset>
|
|
31
|
+
<gov-form-label size="s" slot="top">Fieldset</gov-form-label>
|
|
32
|
+
<gov-form-group>
|
|
33
|
+
<gov-form-input type="number" name="test-me" placeholder="Placeholder" variant="primary" size="s"></gov-form-input>
|
|
34
|
+
</gov-form-group>
|
|
35
|
+
</fieldset>
|
|
36
|
+
<br><br>
|
|
37
|
+
<fieldset>
|
|
38
|
+
<legend>Fieldset & Legend</legend>
|
|
39
|
+
<gov-form-label size="s" slot="top">Label of input</gov-form-label>
|
|
40
|
+
<gov-form-group>
|
|
41
|
+
<gov-form-input type="number" name="test-me" placeholder="Placeholder" variant="primary" size="s"></gov-form-input>
|
|
42
|
+
</gov-form-group>
|
|
43
|
+
</fieldset>
|
|
44
|
+
</form>
|
|
45
|
+
`;
|
|
4
46
|
}
|
|
5
47
|
}
|
|
6
48
|
if (customElements.get('home-page') === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Home.js","sourceRoot":"","sources":["../../../../../src/pages/Home.ts"],"names":[],"mappings":"AAAA,MAAM,QAAS,SAAQ,WAAW;EACjC,iBAAiB;IAChB,IAAI,CAAC,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"Home.js","sourceRoot":"","sources":["../../../../../src/pages/Home.ts"],"names":[],"mappings":"AAAA,MAAM,QAAS,SAAQ,WAAW;EACjC,iBAAiB;IAChB,IAAI,CAAC,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0ChB,CAAA;EACF,CAAC;CACD;AAED,IAAI,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,SAAS,EAAE;EAClD,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;CAC5C","sourcesContent":["class HomePage extends HTMLElement {\n\tconnectedCallback() {\n\t\tthis.innerHTML = `\n\t\t<form style=\"padding: 20px;\">\n\t\t\t<gov-form-label legend>\n\t\t\t\tForm Label legend\n\t\t\t</gov-form-label>\n\t\t\t<gov-form-control type=\"input\">\n\t\t\t\t<gov-form-label size=\"s\" slot=\"top\">Label of input</gov-form-label>\n\t\t\t\t<gov-form-group>\n\t\t\t\t\t<gov-form-input type=\"number\" name=\"test-me\" placeholder=\"Placeholder\" variant=\"primary\" size=\"s\"></gov-form-input>\n\t\t\t\t</gov-form-group>\n\t\t\t</gov-form-control>\n\t\t\t<br><br>\n\t\t\t<legend>Legend</legend>\n\t\t\t<gov-form-control type=\"input\">\n\t\t\t\t<gov-form-label size=\"s\" slot=\"top\">Label of input</gov-form-label>\n\t\t\t\t<gov-form-group>\n\t\t\t\t\t<gov-form-input type=\"number\" name=\"test-me\" placeholder=\"Placeholder\" variant=\"primary\" size=\"s\"></gov-form-input>\n\t\t\t\t</gov-form-group>\n\t\t\t</gov-form-control>\n\t\t\t<br><br>\n\t\t\t<gov-form-control type=\"input\" fieldset>\n\t\t\t\t<gov-form-label size=\"s\" slot=\"top\">Form control fieldset</gov-form-label>\n\t\t\t\t<gov-form-group>\n\t\t\t\t\t<gov-form-input type=\"number\" name=\"test-me\" placeholder=\"Placeholder\" variant=\"primary\" size=\"s\"></gov-form-input>\n\t\t\t\t</gov-form-group>\n\t\t\t</gov-form-control>\n\t\t\t<br><br>\n\t\t\t<fieldset>\n\t\t\t\t<gov-form-label size=\"s\" slot=\"top\">Fieldset</gov-form-label>\n\t\t\t\t<gov-form-group>\n\t\t\t\t\t<gov-form-input type=\"number\" name=\"test-me\" placeholder=\"Placeholder\" variant=\"primary\" size=\"s\"></gov-form-input>\n\t\t\t\t</gov-form-group>\n\t\t\t</fieldset>\n\t\t\t<br><br>\n\t\t\t<fieldset>\n\t\t\t\t<legend>Fieldset & Legend</legend>\n\t\t\t\t<gov-form-label size=\"s\" slot=\"top\">Label of input</gov-form-label>\n\t\t\t\t<gov-form-group>\n\t\t\t\t\t<gov-form-input type=\"number\" name=\"test-me\" placeholder=\"Placeholder\" variant=\"primary\" size=\"s\"></gov-form-input>\n\t\t\t\t</gov-form-group>\n\t\t\t</fieldset>\n\t\t</form>\n\t\t`\n\t}\n}\n\nif (customElements.get('home-page') === undefined) {\n\tcustomElements.define('home-page', HomePage)\n}\n"]}
|
|
@@ -1,90 +1,105 @@
|
|
|
1
|
-
class
|
|
1
|
+
class InfobarPage extends HTMLElement {
|
|
2
2
|
connectedCallback() {
|
|
3
3
|
this.innerHTML = `
|
|
4
|
-
<h2>
|
|
4
|
+
<h2>Infobar</h2>
|
|
5
|
+
|
|
6
|
+
<div class="gov-bg--secondary-800">
|
|
7
|
+
<gov-container>
|
|
8
|
+
<gov-infobar variant="secondary" headline="Tohle bude super nadpis pro všechno" closable>
|
|
9
|
+
<gov-icon name="info" slot="icon"></gov-icon>
|
|
10
|
+
<p>
|
|
11
|
+
Secondary - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
12
|
+
</p>
|
|
13
|
+
</gov-infobar>
|
|
14
|
+
</gov-container>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<br/>
|
|
5
18
|
|
|
6
|
-
<gov-
|
|
19
|
+
<gov-infobar variant="secondary" headline="Tohle bude super nadpis pro všechno" closable>
|
|
7
20
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
8
21
|
<p>
|
|
9
22
|
Secondary - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
10
23
|
</p>
|
|
11
|
-
</gov-
|
|
24
|
+
</gov-infobar>
|
|
25
|
+
|
|
26
|
+
|
|
12
27
|
<br>
|
|
13
|
-
<gov-
|
|
28
|
+
<gov-infobar variant="secondary" closable>
|
|
14
29
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
15
30
|
<p>
|
|
16
31
|
Secondary - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
17
32
|
</p>
|
|
18
|
-
</gov-
|
|
33
|
+
</gov-infobar>
|
|
19
34
|
<br>
|
|
20
|
-
<gov-
|
|
35
|
+
<gov-infobar variant="warning" closable>
|
|
21
36
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
22
37
|
<p>
|
|
23
38
|
Warning - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
24
39
|
</p>
|
|
25
|
-
</gov-
|
|
40
|
+
</gov-infobar>
|
|
26
41
|
<br>
|
|
27
|
-
<gov-
|
|
42
|
+
<gov-infobar variant="error" closable>
|
|
28
43
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
29
44
|
<p>
|
|
30
45
|
Error - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
31
46
|
</p>
|
|
32
|
-
</gov-
|
|
47
|
+
</gov-infobar>
|
|
33
48
|
<br>
|
|
34
|
-
<gov-
|
|
49
|
+
<gov-infobar variant="success" closable>
|
|
35
50
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
36
51
|
<p>
|
|
37
52
|
Error - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
38
53
|
</p>
|
|
39
|
-
</gov-
|
|
54
|
+
</gov-infobar>
|
|
40
55
|
<br>
|
|
41
|
-
<gov-
|
|
56
|
+
<gov-infobar variant="primary" closable>
|
|
42
57
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
43
58
|
<p>
|
|
44
59
|
Error - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
45
60
|
</p>
|
|
46
|
-
</gov-
|
|
61
|
+
</gov-infobar>
|
|
47
62
|
|
|
48
63
|
<h3>Inverse</h3>
|
|
49
64
|
<br>
|
|
50
|
-
<gov-
|
|
65
|
+
<gov-infobar inverse="TRUE" variant="secondary" closable>
|
|
51
66
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
52
67
|
<p>
|
|
53
68
|
Secondary - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
54
69
|
</p>
|
|
55
|
-
</gov-
|
|
70
|
+
</gov-infobar>
|
|
56
71
|
<br>
|
|
57
|
-
<gov-
|
|
72
|
+
<gov-infobar inverse="True" variant="warning" closable>
|
|
58
73
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
59
74
|
<p>
|
|
60
75
|
Warning - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
61
76
|
</p>
|
|
62
|
-
</gov-
|
|
77
|
+
</gov-infobar>
|
|
63
78
|
<br>
|
|
64
|
-
<gov-
|
|
79
|
+
<gov-infobar inverse="1" variant="error" closable>
|
|
65
80
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
66
81
|
<p>
|
|
67
82
|
Error - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
68
83
|
</p>
|
|
69
|
-
</gov-
|
|
84
|
+
</gov-infobar>
|
|
70
85
|
<br>
|
|
71
|
-
<gov-
|
|
86
|
+
<gov-infobar inverse="true" variant="success" closable>
|
|
72
87
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
73
88
|
<p>
|
|
74
89
|
Error - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
75
90
|
</p>
|
|
76
|
-
</gov-
|
|
91
|
+
</gov-infobar>
|
|
77
92
|
<br>
|
|
78
|
-
<gov-
|
|
93
|
+
<gov-infobar inverse="true" variant="primary" closable>
|
|
79
94
|
<gov-icon name="info" slot="icon"></gov-icon>
|
|
80
95
|
<p>
|
|
81
96
|
Error - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href="#">zde</a>.
|
|
82
97
|
</p>
|
|
83
|
-
</gov-
|
|
98
|
+
</gov-infobar>
|
|
84
99
|
`;
|
|
85
100
|
}
|
|
86
101
|
}
|
|
87
|
-
if (customElements.get('
|
|
88
|
-
customElements.define('
|
|
102
|
+
if (customElements.get('infobar-page') === undefined) {
|
|
103
|
+
customElements.define('infobar-page', InfobarPage);
|
|
89
104
|
}
|
|
90
|
-
//# sourceMappingURL=
|
|
105
|
+
//# sourceMappingURL=Infobar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Infobar.js","sourceRoot":"","sources":["../../../../../src/pages/Infobar.ts"],"names":[],"mappings":"AAAA,MAAM,WAAY,SAAQ,WAAW;EACpC,iBAAiB;IAChB,IAAI,CAAC,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGhB,CAAA;EACF,CAAC;CACD;AAED,IAAI,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,SAAS,EAAE;EACrD,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA;CAClD","sourcesContent":["class InfobarPage extends HTMLElement {\n\tconnectedCallback() {\n\t\tthis.innerHTML = `\n\t\t<h2>Infobar</h2>\n\t\t\n\t\t<div class=\"gov-bg--secondary-800\">\n\t\t\t<gov-container>\n\t\t\t\t<gov-infobar variant=\"secondary\" headline=\"Tohle bude super nadpis pro všechno\" closable>\n\t\t\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tSecondary - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t\t\t</p>\n\t\t\t\t</gov-infobar>\n\t\t\t</gov-container>\n\t\t</div>\n\t\t\n\t\t<br/>\n\n\t\t<gov-infobar variant=\"secondary\" headline=\"Tohle bude super nadpis pro všechno\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tSecondary - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\n\t\t\n\t\t<br>\n\t\t<gov-infobar variant=\"secondary\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tSecondary - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t<br>\n\t\t<gov-infobar variant=\"warning\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tWarning - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t<br>\n\t\t<gov-infobar variant=\"error\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t<br>\n\t\t<gov-infobar variant=\"success\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t<br>\n\t\t<gov-infobar variant=\"primary\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\n\t\t<h3>Inverse</h3>\n\t\t<br>\n\t\t<gov-infobar inverse=\"TRUE\" variant=\"secondary\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tSecondary - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t<br>\n\t\t<gov-infobar inverse=\"True\" variant=\"warning\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tWarning - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t<br>\n\t\t<gov-infobar inverse=\"1\" variant=\"error\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t<br>\n\t\t<gov-infobar inverse=\"true\" variant=\"success\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t<br>\n\t\t<gov-infobar inverse=\"true\" variant=\"primary\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20. 12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V uvedeném termínu bude nedostupné přihlášení k Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-infobar>\n\t\t`\n\t}\n}\n\nif (customElements.get('infobar-page') === undefined) {\n\tcustomElements.define('infobar-page', InfobarPage)\n}\n"]}
|