@gov-design-system-ce/components 0.0.57 → 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-loading.cjs.entry.js +2 -3
- package/dist/cjs/gov-loading.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-toast.cjs.entry.js +10 -16
- package/dist/cjs/gov-toast.cjs.entry.js.map +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 +5 -4
- package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -24
- package/dist/collection/components/gov-loading/loading/gov-loading.js.map +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-toast/gov-toast.js +15 -21
- package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
- 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-loading.js.map +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-toast.js.map +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-8d9c2f0a.js → p-30af8d08.js} +2 -2
- package/dist/components/p-3e8a9e92.js.map +1 -1
- package/dist/components/{p-1a0f8d13.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-8449a4cf.js → p-ae179d8a.js} +2 -2
- package/dist/components/p-ae179d8a.js.map +1 -0
- package/dist/components/{p-80f0ed50.js → p-afb7fc88.js} +2 -2
- package/dist/components/{p-839e8965.js → p-b430ee05.js} +2 -2
- package/dist/components/{p-d4f30d9b.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-2bb9f781.entry.js +2 -0
- package/dist/core/p-2bb9f781.entry.js.map +1 -0
- 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-62e9bbf3.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-3858e2c8.entry.js → p-ff97a688.entry.js} +2 -2
- package/dist/core/p-ff97a688.entry.js.map +1 -0
- 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-loading.entry.js +2 -3
- package/dist/esm/gov-loading.entry.js.map +1 -1
- 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 +10 -16
- package/dist/esm/gov-toast.entry.js.map +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/hydrate/index.js +299 -205
- 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-loading/loading/gov-loading.d.ts +0 -4
- package/dist/types/components/gov-toast/gov-toast.d.ts +4 -6
- 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 +120 -96
- package/dist/types/pages/Infobar.d.ts +3 -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-8449a4cf.js.map +0 -1
- package/dist/core/p-3858e2c8.entry.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-aa4e716e.entry.js +0 -2
- package/dist/core/p-aa4e716e.entry.js.map +0 -1
- 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-8d9c2f0a.js.map → p-30af8d08.js.map} +0 -0
- /package/dist/components/{p-1a0f8d13.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-80f0ed50.js.map → p-afb7fc88.js.map} +0 -0
- /package/dist/components/{p-839e8965.js.map → p-b430ee05.js.map} +0 -0
- /package/dist/components/{p-d4f30d9b.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-62e9bbf3.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
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { TooltipContentClass } from "./constants";
|
|
2
|
+
import { TooltipContentClass, TooltipSize, TooltipVariant } from "./constants";
|
|
3
3
|
import { toBoolAttr } from "../../helpers/Dom/template";
|
|
4
4
|
export class GovTooltipContent {
|
|
5
5
|
constructor() {
|
|
6
|
+
this.variant = TooltipVariant.PRIMARY;
|
|
7
|
+
this.size = TooltipSize._M;
|
|
8
|
+
this.persist = false;
|
|
6
9
|
this.isVisible = false;
|
|
10
|
+
this.parentId = null;
|
|
7
11
|
}
|
|
8
12
|
visibleContent(newValue) {
|
|
9
13
|
clearTimeout(this.timeout);
|
|
10
14
|
if (newValue === false) {
|
|
11
15
|
this.timeout = setTimeout(() => {
|
|
12
|
-
this.host.style.visibility =
|
|
16
|
+
this.host.style.visibility = "hidden";
|
|
13
17
|
}, 250);
|
|
14
18
|
}
|
|
15
19
|
else {
|
|
16
|
-
this.host.style.visibility =
|
|
20
|
+
this.host.style.visibility = "visible";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
hideContent() {
|
|
24
|
+
this.isVisible = false;
|
|
25
|
+
this.persist = false;
|
|
26
|
+
const parentEl = document.getElementById(this.parentId);
|
|
27
|
+
if (parentEl) {
|
|
28
|
+
parentEl.hide().catch();
|
|
17
29
|
}
|
|
18
30
|
}
|
|
19
31
|
render() {
|
|
20
|
-
return (h(Host, { class: TooltipContentClass.root, role:
|
|
32
|
+
return (h(Host, { class: TooltipContentClass.root, role: "tooltip", hidden: !this.isVisible, "aria-hidden": !toBoolAttr(this.isVisible), "is-visible": this.isVisible }, h("slot", null), this.persist ? (h("gov-button", { "on-gov-click": this.hideContent.bind(this), variant: this.variant, size: this.size, type: "base", inverse: this.variant === TooltipVariant.SECONDARY }, h("gov-icon", { slot: "left-icon", name: "x-lg", type: "basic" }))) : null));
|
|
21
33
|
}
|
|
22
34
|
static get is() { return "gov-tooltip-content"; }
|
|
23
35
|
static get originalStyleUrls() {
|
|
@@ -32,7 +44,55 @@ export class GovTooltipContent {
|
|
|
32
44
|
}
|
|
33
45
|
static get properties() {
|
|
34
46
|
return {
|
|
35
|
-
"
|
|
47
|
+
"variant": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "TooltipVariantType",
|
|
52
|
+
"resolved": "\"primary\" | \"secondary\"",
|
|
53
|
+
"references": {
|
|
54
|
+
"TooltipVariantType": {
|
|
55
|
+
"location": "import",
|
|
56
|
+
"path": "./constants",
|
|
57
|
+
"id": "../../../packages/core/src/components/gov-tooltip/constants.tsx::TooltipVariantType"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": true,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": "Style variation of the tooltip"
|
|
66
|
+
},
|
|
67
|
+
"attribute": "variant",
|
|
68
|
+
"reflect": false,
|
|
69
|
+
"defaultValue": "TooltipVariant.PRIMARY"
|
|
70
|
+
},
|
|
71
|
+
"size": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "TooltipSizeType",
|
|
76
|
+
"resolved": "\"l\" | \"m\" | \"s\"",
|
|
77
|
+
"references": {
|
|
78
|
+
"TooltipSizeType": {
|
|
79
|
+
"location": "import",
|
|
80
|
+
"path": "./constants",
|
|
81
|
+
"id": "../../../packages/core/src/components/gov-tooltip/constants.tsx::TooltipSizeType"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"required": false,
|
|
86
|
+
"optional": true,
|
|
87
|
+
"docs": {
|
|
88
|
+
"tags": [],
|
|
89
|
+
"text": "Tooltip\u2019s size."
|
|
90
|
+
},
|
|
91
|
+
"attribute": "size",
|
|
92
|
+
"reflect": false,
|
|
93
|
+
"defaultValue": "TooltipSize._M"
|
|
94
|
+
},
|
|
95
|
+
"persist": {
|
|
36
96
|
"type": "boolean",
|
|
37
97
|
"mutable": false,
|
|
38
98
|
"complexType": {
|
|
@@ -41,6 +101,24 @@ export class GovTooltipContent {
|
|
|
41
101
|
"references": {}
|
|
42
102
|
},
|
|
43
103
|
"required": false,
|
|
104
|
+
"optional": true,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": "Tooltip is still visible."
|
|
108
|
+
},
|
|
109
|
+
"attribute": "persist",
|
|
110
|
+
"reflect": false,
|
|
111
|
+
"defaultValue": "false"
|
|
112
|
+
},
|
|
113
|
+
"isVisible": {
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"mutable": true,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "boolean",
|
|
118
|
+
"resolved": "boolean",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
44
122
|
"optional": false,
|
|
45
123
|
"docs": {
|
|
46
124
|
"tags": [],
|
|
@@ -49,6 +127,24 @@ export class GovTooltipContent {
|
|
|
49
127
|
"attribute": "is-visible",
|
|
50
128
|
"reflect": false,
|
|
51
129
|
"defaultValue": "false"
|
|
130
|
+
},
|
|
131
|
+
"parentId": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "Indicates display of tooltip content"
|
|
144
|
+
},
|
|
145
|
+
"attribute": "parent-id",
|
|
146
|
+
"reflect": false,
|
|
147
|
+
"defaultValue": "null"
|
|
52
148
|
}
|
|
53
149
|
};
|
|
54
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-tooltip-content.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"gov-tooltip-content.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAmB,cAAc,EAAsB,MAAM,aAAa,CAAA;AACnH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAMvD,MAAM,OAAO,iBAAiB;;mBAOmB,cAAc,CAAC,OAAO;gBAI5B,WAAW,CAAC,EAAE;mBAI5B,KAAK;qBAI6B,KAAK;oBAId,IAAI;;EAGzD,cAAc,CAAC,QAAiB;IAC/B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC1B,IAAI,QAAQ,KAAK,KAAK,EAAE;MACvB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;QAC9B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAA;MACtC,CAAC,EAAE,GAAG,CAAC,CAAA;KACP;SAAM;MACN,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,SAAS,CAAA;KACtC;EACF,CAAC;EAED,WAAW;IACV,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACpB,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAA0B,CAAA;IAChF,IAAI,QAAQ,EAAE;MACb,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAA;KACvB;EACF,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IACJ,KAAK,EAAE,mBAAmB,CAAC,IAAI,EAC/B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,iBACV,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,gBAC5B,IAAI,CAAC,SAAS;MAC1B,eAAa;MACZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CACf,kCACe,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EACzC,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,IAAI,CAAC,OAAO,KAAK,cAAc,CAAC,SAAS;QAClD,gBAAU,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAa,CACzD,CACb,CAAC,CAAC,CAAC,IAAI,CACF,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { TooltipContentClass, TooltipSize, TooltipSizeType, TooltipVariant, TooltipVariantType } from \"./constants\"\nimport { toBoolAttr } from \"../../helpers/Dom/template\"\n\n@Component({\n\ttag: \"gov-tooltip-content\",\n\tstyleUrl: \"gov-tooltip-content.scss\",\n})\nexport class GovTooltipContent {\n\tprivate timeout\n\n\t@Element() host: HTMLGovTooltipContentElement\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 is still visible.\n\t */\n\t@Prop() persist?: boolean = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"is-visible\", mutable: true }) isVisible = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"parent-id\" }) parentId: string = null\n\n\t@Watch(\"isVisible\")\n\tvisibleContent(newValue: boolean): void {\n\t\tclearTimeout(this.timeout)\n\t\tif (newValue === false) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.style.visibility = \"hidden\"\n\t\t\t}, 250)\n\t\t} else {\n\t\t\tthis.host.style.visibility = \"visible\"\n\t\t}\n\t}\n\n\thideContent() {\n\t\tthis.isVisible = false\n\t\tthis.persist = false\n\t\tconst parentEl = document.getElementById(this.parentId) as HTMLGovTooltipElement\n\t\tif (parentEl) {\n\t\t\tparentEl.hide().catch()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={TooltipContentClass.root}\n\t\t\t\trole={\"tooltip\"}\n\t\t\t\thidden={!this.isVisible}\n\t\t\t\taria-hidden={!toBoolAttr(this.isVisible)}\n\t\t\t\tis-visible={this.isVisible}>\n\t\t\t\t<slot></slot>\n\t\t\t\t{this.persist ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\ton-gov-click={this.hideContent.bind(this)}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\ttype={\"base\"}\n\t\t\t\t\t\tinverse={this.variant === TooltipVariant.SECONDARY}>\n\t\t\t\t\t\t<gov-icon slot={\"left-icon\"} name={\"x-lg\"} type={\"basic\"}></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
- Variables - Attachments
|
|
65
65
|
*/
|
|
66
66
|
/*
|
|
67
|
-
- Variables -
|
|
67
|
+
- Variables - Infobar
|
|
68
68
|
*/
|
|
69
69
|
/*
|
|
70
70
|
- Variables - Backdrop
|
|
@@ -237,20 +237,4 @@
|
|
|
237
237
|
.gov-tooltip[icon=""], .gov-tooltip[icon=true i], .gov-tooltip[icon="1"] {
|
|
238
238
|
display: inline-flex;
|
|
239
239
|
border-bottom: 0;
|
|
240
|
-
}
|
|
241
|
-
.gov-tooltip[variant=secondary] {
|
|
242
|
-
--gov-tooltip-content-bg-color: var(--gov-tooltip-secondary-bg-color, var(--gov-color-secondary));
|
|
243
|
-
--gov-tooltip-content-text-color: var(--gov-tooltip-secondary-text-color, var(--gov-color-neutral-white));
|
|
244
|
-
}
|
|
245
|
-
.gov-tooltip[variant=secondary][inverse=""], .gov-tooltip[variant=secondary][inverse=true i], .gov-tooltip[variant=secondary][inverse="1"] {
|
|
246
|
-
--gov-tooltip-content-bg-color: var(--gov-color-neutral-white);
|
|
247
|
-
--gov-tooltip-content-text-color: var(--gov-tooltip-secondary-text-color-inverse, var(--gov-color-secondary));
|
|
248
|
-
}
|
|
249
|
-
.gov-tooltip[variant=primary] {
|
|
250
|
-
--gov-tooltip-content-bg-color: var(--gov-tooltip-primary-bg-color, var(--gov-color-primary-300));
|
|
251
|
-
--gov-tooltip-content-text-color: var(--gov-tooltip-primary-text-color, var(--gov-color-secondary));
|
|
252
|
-
}
|
|
253
|
-
.gov-tooltip[variant=primary][inverse=""], .gov-tooltip[variant=primary][inverse=true i], .gov-tooltip[variant=primary][inverse="1"] {
|
|
254
|
-
--gov-tooltip-content-bg-color: var(--gov-color-neutral-white);
|
|
255
|
-
--gov-tooltip-content-text-color: var(--gov-tooltip-primary-text-color-inverse, var(--gov-color-primary));
|
|
256
240
|
}
|
|
@@ -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,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EACN,eAAe,EAEf,WAAW,EAEX,YAAY,EACZ,mBAAmB,EACnB,cAAc,GAEd,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAOpD,MAAM,OAAO,UAAU;EAKtB;mBASgD,SAAS;gBAIf,GAAG;oBAIL,OAAO;mBAIZ,SAAS;;gBAQU,SAAS;IA5B9D,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAA;GACvC;EA6BD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;EAC1D,CAAC;EAGD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;EACvD,CAAC;EAGD,gBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAOpD,MAAM,OAAO,UAAU;EAMtB;IAHiB,qBAAgB,GAAG,SAAS,CAAA;IAC5B,cAAS,GAAG,SAAS,CAAA;mBAYU,cAAc,CAAC,OAAO;gBAI5B,WAAW,CAAC,EAAE;oBAIhB,OAAO;mBAIZ,SAAS;;gBAQU,SAAS;mBAE5C,KAAK;IA/BvB,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAA;IACvC,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAA;GACrD;EA+BD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;EAC1D,CAAC;EAGD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;EACvD,CAAC;EAGD,gBAAg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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"]}
|