@gov-design-system-ce/components 4.6.3 → 4.6.5-b
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/app-globals-V2Kpy_OQ.js.map +1 -1
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-banner.cjs.entry.js +3 -3
- package/dist/cjs/gov-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-banner.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-flex_3.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +67 -23
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-autocomplete.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +65 -12
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-search.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +8 -15
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-tooltip.gov-tooltip-content.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-tooltip_2.cjs.entry.js +34 -9
- package/dist/cjs/gov-tooltip_2.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard-item.cjs.entry.js +2 -2
- package/dist/cjs/gov-wizard.cjs.entry.js +1 -1
- package/dist/cjs/index-BEF5cZxd.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-banner/gov-banner.js +4 -4
- package/dist/collection/components/gov-banner/gov-banner.js.map +1 -1
- package/dist/collection/components/gov-form/autocomplete/autocomplete.utils.js +14 -0
- package/dist/collection/components/gov-form/autocomplete/autocomplete.utils.js.map +1 -0
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +76 -22
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +39 -3
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.js +2 -2
- package/dist/collection/components/gov-form/search/gov-form-search.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.js +8 -15
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +22 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +31 -8
- package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard-item.js +2 -2
- package/dist/collection/components/gov-wizard/gov-wizard.js +1 -1
- package/dist/collection/utils/file.utils.js +28 -9
- package/dist/collection/utils/file.utils.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-accordion.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-attachments.js +1 -1
- package/dist/components/gov-backdrop.js +1 -1
- package/dist/components/gov-banner.js +1 -1
- package/dist/components/gov-banner.js.map +1 -1
- package/dist/components/gov-blockquote.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-collapsible.js +1 -1
- package/dist/components/gov-collapsible.js.map +1 -1
- package/dist/components/gov-container.js +1 -1
- package/dist/components/gov-control-group.js +1 -1
- package/dist/components/gov-cookiebar.js +1 -1
- package/dist/components/gov-dialog.js +1 -1
- package/dist/components/gov-dropdown.js +1 -1
- package/dist/components/gov-empty.js +1 -1
- package/dist/components/gov-error-code.js +1 -1
- package/dist/components/gov-flex.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox-group.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-control.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-group.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-message.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-radio-group.js +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-range.js +1 -1
- package/dist/components/gov-form-range.js.map +1 -1
- package/dist/components/gov-form-search.js +1 -1
- package/dist/components/gov-form-search.js.map +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-grid-item.js +1 -1
- package/dist/components/gov-grid.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-layout-column.js +1 -1
- package/dist/components/gov-layout.js +1 -1
- package/dist/components/gov-link.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-message.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-skeleton.js +1 -1
- package/dist/components/gov-spacer.js +1 -1
- package/dist/components/gov-stepper-item.js +1 -1
- package/dist/components/gov-stepper.js +1 -1
- package/dist/components/gov-tabs-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-theme-switch.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.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/{p-BZTY3MxF.js → p-BGK46VRO.js} +2 -2
- package/dist/components/{p-DKo9A5gq.js → p-BHRF-5cf.js} +2 -2
- package/dist/components/{p-DesycS6d.js → p-BICk4EuO.js} +2 -2
- package/dist/components/{p-Bv5L0j6n.js → p-BNoNH6m-.js} +2 -2
- package/dist/components/{p-9imLQpxb.js → p-BSr8e18S.js} +2 -2
- package/dist/components/{p-BNnuBQvo.js → p-BxS4InzB.js} +2 -2
- package/dist/components/{p-CfaJM4SA.js → p-CMmyR4-k.js} +2 -2
- package/dist/components/{p-B0KFtEn3.js → p-CU0plGZP.js} +2 -2
- package/dist/components/{p-djqfSbq-.js → p-ClDhNt_H.js} +2 -2
- package/dist/components/{p-yqJEurSE.js → p-CnKqUwf9.js} +2 -2
- package/dist/components/p-DRXiDAHW.js +2 -0
- package/dist/components/{p-BrdXh0mI.js.map → p-DRXiDAHW.js.map} +1 -1
- package/dist/components/p-DjGO_trZ.js +2 -0
- package/dist/components/p-DjGO_trZ.js.map +1 -0
- package/dist/components/p-DmK9qaKH.js +2 -0
- package/dist/components/p-DmK9qaKH.js.map +1 -0
- package/dist/components/p-isPjiQbr.js +2 -0
- package/dist/components/p-isPjiQbr.js.map +1 -0
- package/dist/components/p-keC6luw7.js +2 -0
- package/dist/components/p-keC6luw7.js.map +1 -0
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-3314505d.entry.js → p-00ab0454.entry.js} +2 -2
- package/dist/core/{p-3314505d.entry.js.map → p-00ab0454.entry.js.map} +1 -1
- package/dist/core/{p-9d9e9401.entry.js → p-05bb35e1.entry.js} +2 -2
- package/dist/core/{p-9d9e9401.entry.js.map → p-05bb35e1.entry.js.map} +1 -1
- package/dist/core/{p-e30968b3.entry.js → p-06497d64.entry.js} +2 -2
- package/dist/core/{p-e30968b3.entry.js.map → p-06497d64.entry.js.map} +1 -1
- package/dist/core/p-0675617d.entry.js +2 -0
- package/dist/core/{p-fca7a0d6.entry.js.map → p-0675617d.entry.js.map} +1 -1
- package/dist/core/{p-4d36cd18.entry.js → p-2493a7f3.entry.js} +2 -2
- package/dist/core/{p-4d36cd18.entry.js.map → p-2493a7f3.entry.js.map} +1 -1
- package/dist/core/p-2e15a654.entry.js +2 -0
- package/dist/core/{p-bd2df430.entry.js.map → p-2e15a654.entry.js.map} +1 -1
- package/dist/core/{p-1626cc67.entry.js → p-30ad7514.entry.js} +2 -2
- package/dist/core/{p-1626cc67.entry.js.map → p-30ad7514.entry.js.map} +1 -1
- package/dist/core/{p-558e75a6.entry.js → p-378cf8de.entry.js} +2 -2
- package/dist/core/{p-558e75a6.entry.js.map → p-378cf8de.entry.js.map} +1 -1
- package/dist/core/{p-be9af807.entry.js → p-3a4799b3.entry.js} +2 -2
- package/dist/core/{p-be9af807.entry.js.map → p-3a4799b3.entry.js.map} +1 -1
- package/dist/core/{p-f7bdb44a.entry.js → p-3ebbe75a.entry.js} +2 -2
- package/dist/core/{p-f7bdb44a.entry.js.map → p-3ebbe75a.entry.js.map} +1 -1
- package/dist/core/p-41bef63a.entry.js +2 -0
- package/dist/core/{p-469f14db.entry.js.map → p-41bef63a.entry.js.map} +1 -1
- package/dist/core/p-4342c252.entry.js +2 -0
- package/dist/core/p-4342c252.entry.js.map +1 -0
- package/dist/core/{p-c1b9f1ab.entry.js → p-473afd7d.entry.js} +2 -2
- package/dist/core/{p-c1b9f1ab.entry.js.map → p-473afd7d.entry.js.map} +1 -1
- package/dist/core/{p-5721cf9b.entry.js → p-48b74272.entry.js} +2 -2
- package/dist/core/{p-5721cf9b.entry.js.map → p-48b74272.entry.js.map} +1 -1
- package/dist/core/{p-04ec45ab.entry.js → p-49b67f59.entry.js} +2 -2
- package/dist/core/{p-04ec45ab.entry.js.map → p-49b67f59.entry.js.map} +1 -1
- package/dist/core/{p-6b44890d.entry.js → p-4bd3f101.entry.js} +2 -2
- package/dist/core/{p-6b44890d.entry.js.map → p-4bd3f101.entry.js.map} +1 -1
- package/dist/core/{p-157a1636.entry.js → p-4e534d68.entry.js} +2 -2
- package/dist/core/{p-157a1636.entry.js.map → p-4e534d68.entry.js.map} +1 -1
- package/dist/core/p-6638d034.entry.js +2 -0
- package/dist/core/{p-73bd93f9.entry.js.map → p-6638d034.entry.js.map} +1 -1
- package/dist/core/{p-46824842.entry.js → p-68a5d225.entry.js} +2 -2
- package/dist/core/{p-46824842.entry.js.map → p-68a5d225.entry.js.map} +1 -1
- package/dist/core/p-6ac9b0f2.entry.js +2 -0
- package/dist/core/p-6ac9b0f2.entry.js.map +1 -0
- package/dist/core/{p-0af96cc0.entry.js → p-6b0625ee.entry.js} +2 -2
- package/dist/core/{p-0af96cc0.entry.js.map → p-6b0625ee.entry.js.map} +1 -1
- package/dist/core/{p-4d365881.entry.js → p-78202a44.entry.js} +2 -2
- package/dist/core/{p-4d365881.entry.js.map → p-78202a44.entry.js.map} +1 -1
- package/dist/core/{p-eb766437.entry.js → p-80052953.entry.js} +2 -2
- package/dist/core/{p-eb766437.entry.js.map → p-80052953.entry.js.map} +1 -1
- package/dist/core/{p-d43959a0.entry.js → p-8ddb6dc6.entry.js} +2 -2
- package/dist/core/{p-d43959a0.entry.js.map → p-8ddb6dc6.entry.js.map} +1 -1
- package/dist/core/{p-d9c574f0.entry.js → p-90cc2ddb.entry.js} +2 -2
- package/dist/core/{p-d9c574f0.entry.js.map → p-90cc2ddb.entry.js.map} +1 -1
- package/dist/core/{p-f3887d6d.entry.js → p-91d5df66.entry.js} +2 -2
- package/dist/core/{p-f3887d6d.entry.js.map → p-91d5df66.entry.js.map} +1 -1
- package/dist/core/{p-187c0eda.entry.js → p-9321fb9d.entry.js} +2 -2
- package/dist/core/{p-187c0eda.entry.js.map → p-9321fb9d.entry.js.map} +1 -1
- package/dist/core/p-943a58b2.entry.js +2 -0
- package/dist/core/{p-33209782.entry.js.map → p-943a58b2.entry.js.map} +1 -1
- package/dist/core/p-B6CqPcY_.js.map +1 -1
- package/dist/core/p-B8TR1oqt.js +3 -0
- package/dist/core/p-B8TR1oqt.js.map +1 -0
- package/dist/core/p-BUmDydor.js.map +1 -1
- package/dist/core/p-BcQO4NH2.js.map +1 -1
- package/dist/core/p-BjcqOprh.js.map +1 -1
- package/dist/core/p-Bo1ROm5Q.js.map +1 -1
- package/dist/core/p-Bz_RzYFb.js.map +1 -1
- package/dist/core/p-C3R1T_pg.js.map +1 -1
- package/dist/core/p-C6JN9gdb.js.map +1 -1
- package/dist/core/p-CDIRBJsi.js.map +1 -1
- package/dist/core/p-CQvUntGY.js.map +1 -1
- package/dist/core/p-Ccwpa1ck.js.map +1 -1
- package/dist/core/p-CgDnDrq5.js.map +1 -1
- package/dist/core/p-Cjg0wpDG.js.map +1 -1
- package/dist/core/p-CoD1xawt.js.map +1 -1
- package/dist/core/p-Cx3bEC5v.js.map +1 -1
- package/dist/core/p-D4TGB274.js.map +1 -1
- package/dist/core/p-DBXGhafv.js.map +1 -1
- package/dist/core/p-DNztiAH0.js.map +1 -1
- package/dist/core/p-DQuL1Twl.js.map +1 -1
- package/dist/core/p-DYcNEwSZ.js.map +1 -1
- package/dist/core/p-EeKNA85D.js.map +1 -1
- package/dist/core/p-GYov8gU1.js.map +1 -1
- package/dist/core/p-NOJjz9dT.js.map +1 -1
- package/dist/core/p-Q99QrOoi.js.map +1 -1
- package/dist/core/p-U40vKHrs.js.map +1 -1
- package/dist/core/p-a4fa2ffc.entry.js +2 -0
- package/dist/core/{p-c4734357.entry.js.map → p-a4fa2ffc.entry.js.map} +1 -1
- package/dist/core/{p-511eed88.entry.js → p-a6f27583.entry.js} +2 -2
- package/dist/core/{p-511eed88.entry.js.map → p-a6f27583.entry.js.map} +1 -1
- package/dist/core/p-a7c322a7.entry.js +2 -0
- package/dist/core/{p-abb7780e.entry.js.map → p-a7c322a7.entry.js.map} +1 -1
- package/dist/core/{p-6d2ce4c7.entry.js → p-ab367b0c.entry.js} +2 -2
- package/dist/core/{p-6d2ce4c7.entry.js.map → p-ab367b0c.entry.js.map} +1 -1
- package/dist/core/{p-c6b55c0a.entry.js → p-ac81cdf6.entry.js} +2 -2
- package/dist/core/{p-c6b55c0a.entry.js.map → p-ac81cdf6.entry.js.map} +1 -1
- package/dist/core/{p-a2c61d50.entry.js → p-ad9227b3.entry.js} +2 -2
- package/dist/core/{p-a2c61d50.entry.js.map → p-ad9227b3.entry.js.map} +1 -1
- package/dist/core/p-af2bd9d3.entry.js +2 -0
- package/dist/core/p-af2bd9d3.entry.js.map +1 -0
- package/dist/core/{p-70b5555f.entry.js → p-b0d4d6bd.entry.js} +2 -2
- package/dist/core/{p-70b5555f.entry.js.map → p-b0d4d6bd.entry.js.map} +1 -1
- package/dist/core/p-b181f85f.entry.js +2 -0
- package/dist/core/{p-57ca8ac7.entry.js.map → p-b181f85f.entry.js.map} +1 -1
- package/dist/core/{p-5305e82e.entry.js → p-b2648255.entry.js} +2 -2
- package/dist/core/{p-5305e82e.entry.js.map → p-b2648255.entry.js.map} +1 -1
- package/dist/core/{p-65a09763.entry.js → p-b37bd421.entry.js} +2 -2
- package/dist/core/{p-65a09763.entry.js.map → p-b37bd421.entry.js.map} +1 -1
- package/dist/core/{p-91cbee1b.entry.js → p-b5e40f40.entry.js} +2 -2
- package/dist/core/{p-91cbee1b.entry.js.map → p-b5e40f40.entry.js.map} +1 -1
- package/dist/core/p-b77c283e.entry.js +2 -0
- package/dist/core/{p-bd389bfd.entry.js.map → p-b77c283e.entry.js.map} +1 -1
- package/dist/core/p-bb5b9ccd.entry.js +2 -0
- package/dist/core/p-bb5b9ccd.entry.js.map +1 -0
- package/dist/core/{p-4c02094d.entry.js → p-c9b2f97c.entry.js} +2 -2
- package/dist/core/{p-4c02094d.entry.js.map → p-c9b2f97c.entry.js.map} +1 -1
- package/dist/core/{p-eb3f6808.entry.js → p-caf817d4.entry.js} +2 -2
- package/dist/core/{p-eb3f6808.entry.js.map → p-caf817d4.entry.js.map} +1 -1
- package/dist/core/p-dc0bd1e5.entry.js +2 -0
- package/dist/core/{p-3e07bf07.entry.js.map → p-dc0bd1e5.entry.js.map} +1 -1
- package/dist/core/{p-db860031.entry.js → p-dd390459.entry.js} +2 -2
- package/dist/core/{p-db860031.entry.js.map → p-dd390459.entry.js.map} +1 -1
- package/dist/core/p-de5dfd70.entry.js +2 -0
- package/dist/core/{p-4da8ac1d.entry.js.map → p-de5dfd70.entry.js.map} +1 -1
- package/dist/core/p-dfb76a14.entry.js +2 -0
- package/dist/core/p-dfb76a14.entry.js.map +1 -0
- package/dist/core/{p-cd163299.entry.js → p-e17def2b.entry.js} +2 -2
- package/dist/core/{p-cd163299.entry.js.map → p-e17def2b.entry.js.map} +1 -1
- package/dist/core/{p-e39e5dc7.entry.js → p-e1d58751.entry.js} +2 -2
- package/dist/core/{p-e39e5dc7.entry.js.map → p-e1d58751.entry.js.map} +1 -1
- package/dist/core/{p-3e07bf07.entry.js → p-e913cfc8.entry.js} +2 -2
- package/dist/core/{p-90ab65b4.entry.js.map → p-e913cfc8.entry.js.map} +1 -1
- package/dist/core/{p-da997fb3.entry.js → p-ea299832.entry.js} +2 -2
- package/dist/core/{p-da997fb3.entry.js.map → p-ea299832.entry.js.map} +1 -1
- package/dist/core/{p-852310d9.entry.js → p-eff8ffff.entry.js} +2 -2
- package/dist/core/{p-852310d9.entry.js.map → p-eff8ffff.entry.js.map} +1 -1
- package/dist/core/{p-4d902f20.entry.js → p-f2d24551.entry.js} +2 -2
- package/dist/core/{p-4d902f20.entry.js.map → p-f2d24551.entry.js.map} +1 -1
- package/dist/core/{p-5c872d64.entry.js → p-f515d912.entry.js} +2 -2
- package/dist/core/{p-bf573a56.entry.js → p-febff4d1.entry.js} +2 -2
- package/dist/core/{p-bf573a56.entry.js.map → p-febff4d1.entry.js.map} +1 -1
- package/dist/core/p-vN03FcXN.js.map +1 -1
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-banner.entry.js +3 -3
- package/dist/esm/gov-banner.entry.js.map +1 -1
- package/dist/esm/gov-flex_3.entry.js +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +68 -24
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +65 -12
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-search.entry.js +1 -1
- package/dist/esm/gov-form-search.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +8 -15
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.gov-tooltip-content.entry.js.map +1 -1
- package/dist/esm/gov-tooltip_2.entry.js +34 -9
- package/dist/esm/gov-tooltip_2.entry.js.map +1 -1
- package/dist/esm/gov-wizard-item.entry.js +2 -2
- package/dist/esm/gov-wizard.entry.js +1 -1
- package/dist/esm/index-ClISz4NF.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +187 -69
- package/dist/hydrate/index.mjs +187 -69
- package/dist/types/Users/jf/dev/designSystem/gov-design-system/packages/core/.stencil/packages/core/stencil.config.d.ts +2 -0
- package/dist/types/components/gov-form/autocomplete/autocomplete.utils.d.ts +2 -0
- package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +9 -0
- package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -0
- package/dist/types/components/gov-form/select/gov-form-select.d.ts +1 -1
- package/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +4 -0
- package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +612 -121
- package/dist/types/stencil-public-runtime.d.ts +170 -11
- package/package.json +32 -28
- package/readme.md +8 -0
- package/dist/components/p-BrdXh0mI.js +0 -2
- package/dist/components/p-DFu5UVoP.js +0 -2
- package/dist/components/p-DFu5UVoP.js.map +0 -1
- package/dist/components/p-DMVQRz4f.js +0 -2
- package/dist/components/p-DMVQRz4f.js.map +0 -1
- package/dist/components/p-UDT3DloZ.js +0 -2
- package/dist/components/p-UDT3DloZ.js.map +0 -1
- package/dist/components/p-x3w8Mun_.js +0 -2
- package/dist/components/p-x3w8Mun_.js.map +0 -1
- package/dist/core/core.css +0 -14776
- package/dist/core/gov-accordion-item.entry.esm.js.map +0 -1
- package/dist/core/gov-accordion.entry.esm.js.map +0 -1
- package/dist/core/gov-attachments.gov-attachments-item.gov-form-message.entry.esm.js.map +0 -1
- package/dist/core/gov-backdrop.entry.esm.js.map +0 -1
- package/dist/core/gov-banner.entry.esm.js.map +0 -1
- package/dist/core/gov-blockquote.entry.esm.js.map +0 -1
- package/dist/core/gov-breadcrumbs.entry.esm.js.map +0 -1
- package/dist/core/gov-button.entry.esm.js.map +0 -1
- package/dist/core/gov-card.entry.esm.js.map +0 -1
- package/dist/core/gov-chip.entry.esm.js.map +0 -1
- package/dist/core/gov-collapsible.entry.esm.js.map +0 -1
- package/dist/core/gov-container.entry.esm.js.map +0 -1
- package/dist/core/gov-control-group.entry.esm.js.map +0 -1
- package/dist/core/gov-cookiebar.entry.esm.js.map +0 -1
- package/dist/core/gov-dialog.entry.esm.js.map +0 -1
- package/dist/core/gov-dropdown.entry.esm.js.map +0 -1
- package/dist/core/gov-empty.entry.esm.js.map +0 -1
- package/dist/core/gov-error-code.entry.esm.js.map +0 -1
- package/dist/core/gov-flex.gov-icon.gov-theme-switch.entry.esm.js.map +0 -1
- package/dist/core/gov-form-autocomplete.entry.esm.js.map +0 -1
- package/dist/core/gov-form-checkbox-group.entry.esm.js.map +0 -1
- package/dist/core/gov-form-checkbox.entry.esm.js.map +0 -1
- package/dist/core/gov-form-control.entry.esm.js.map +0 -1
- package/dist/core/gov-form-file.entry.esm.js.map +0 -1
- package/dist/core/gov-form-group.entry.esm.js.map +0 -1
- package/dist/core/gov-form-input.gov-skeleton.entry.esm.js.map +0 -1
- package/dist/core/gov-form-label.entry.esm.js.map +0 -1
- package/dist/core/gov-form-multi-select.entry.esm.js.map +0 -1
- package/dist/core/gov-form-password-power.entry.esm.js.map +0 -1
- package/dist/core/gov-form-radio-group.entry.esm.js.map +0 -1
- package/dist/core/gov-form-radio.entry.esm.js.map +0 -1
- package/dist/core/gov-form-range.entry.esm.js.map +0 -1
- package/dist/core/gov-form-search.entry.esm.js.map +0 -1
- package/dist/core/gov-form-select.entry.esm.js.map +0 -1
- package/dist/core/gov-form-switch.entry.esm.js.map +0 -1
- package/dist/core/gov-grid-item.entry.esm.js.map +0 -1
- package/dist/core/gov-grid.entry.esm.js.map +0 -1
- package/dist/core/gov-infobar.entry.esm.js.map +0 -1
- package/dist/core/gov-layout-column.entry.esm.js.map +0 -1
- package/dist/core/gov-layout.entry.esm.js.map +0 -1
- package/dist/core/gov-lifecycle.entry.esm.js.map +0 -1
- package/dist/core/gov-link.entry.esm.js.map +0 -1
- package/dist/core/gov-loading.entry.esm.js.map +0 -1
- package/dist/core/gov-message.entry.esm.js.map +0 -1
- package/dist/core/gov-pagination.entry.esm.js.map +0 -1
- package/dist/core/gov-spacer.entry.esm.js.map +0 -1
- package/dist/core/gov-stepper-item.entry.esm.js.map +0 -1
- package/dist/core/gov-stepper.entry.esm.js.map +0 -1
- package/dist/core/gov-tabs-item.entry.esm.js.map +0 -1
- package/dist/core/gov-tabs.entry.esm.js.map +0 -1
- package/dist/core/gov-tag.entry.esm.js.map +0 -1
- package/dist/core/gov-tile.entry.esm.js.map +0 -1
- package/dist/core/gov-toast.entry.esm.js.map +0 -1
- package/dist/core/gov-tooltip.gov-tooltip-content.entry.esm.js.map +0 -1
- package/dist/core/gov-wizard-item.entry.esm.js.map +0 -1
- package/dist/core/gov-wizard.entry.esm.js.map +0 -1
- package/dist/core/loader.esm.js.map +0 -1
- package/dist/core/p-11fc3899.entry.js +0 -2
- package/dist/core/p-11fc3899.entry.js.map +0 -1
- package/dist/core/p-33209782.entry.js +0 -2
- package/dist/core/p-33b462c9.entry.js +0 -2
- package/dist/core/p-33b462c9.entry.js.map +0 -1
- package/dist/core/p-3e5ae012.entry.js +0 -2
- package/dist/core/p-3e5ae012.entry.js.map +0 -1
- package/dist/core/p-469f14db.entry.js +0 -2
- package/dist/core/p-4da8ac1d.entry.js +0 -2
- package/dist/core/p-57ca8ac7.entry.js +0 -2
- package/dist/core/p-73bd93f9.entry.js +0 -2
- package/dist/core/p-90ab65b4.entry.js +0 -2
- package/dist/core/p-ClISz4NF.js +0 -3
- package/dist/core/p-ClISz4NF.js.map +0 -1
- package/dist/core/p-abb7780e.entry.js +0 -2
- package/dist/core/p-bd2df430.entry.js +0 -2
- package/dist/core/p-bd389bfd.entry.js +0 -2
- package/dist/core/p-c21bc8f9.entry.js +0 -2
- package/dist/core/p-c21bc8f9.entry.js.map +0 -1
- package/dist/core/p-c4734357.entry.js +0 -2
- package/dist/core/p-def34832.entry.js +0 -2
- package/dist/core/p-def34832.entry.js.map +0 -1
- package/dist/core/p-fca7a0d6.entry.js +0 -2
- package/dist/types/work/packages/core/.stencil/packages/core/stencil.config.d.ts +0 -2
- /package/dist/components/{p-BZTY3MxF.js.map → p-BGK46VRO.js.map} +0 -0
- /package/dist/components/{p-DKo9A5gq.js.map → p-BHRF-5cf.js.map} +0 -0
- /package/dist/components/{p-DesycS6d.js.map → p-BICk4EuO.js.map} +0 -0
- /package/dist/components/{p-Bv5L0j6n.js.map → p-BNoNH6m-.js.map} +0 -0
- /package/dist/components/{p-9imLQpxb.js.map → p-BSr8e18S.js.map} +0 -0
- /package/dist/components/{p-BNnuBQvo.js.map → p-BxS4InzB.js.map} +0 -0
- /package/dist/components/{p-CfaJM4SA.js.map → p-CMmyR4-k.js.map} +0 -0
- /package/dist/components/{p-B0KFtEn3.js.map → p-CU0plGZP.js.map} +0 -0
- /package/dist/components/{p-djqfSbq-.js.map → p-ClDhNt_H.js.map} +0 -0
- /package/dist/components/{p-yqJEurSE.js.map → p-CnKqUwf9.js.map} +0 -0
- /package/dist/core/{p-5c872d64.entry.js.map → p-f515d912.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-file.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/file/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AAa;QAClC,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAE,aAAa,CAAC,IAAI;YAC7B,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;IACH,CAAC;IAEO,eAAe,CAAC,CAAQ;QAC/B,CAAC,CAAC,eAAe,EAAE,CAAA;IACpB,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAA;IACrB,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAA;IACpB,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;IAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div class={FormFileClass.inputFocus}/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t<span slot=\"name\">{item.file.name}</span>\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tthis.inputRef.value = '';\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-form-file.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/file/gov-form-file.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC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;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\t// Without `multiple`, only a single file is allowed. An incoming batch\n\t\t// (drag-drop, framework wrapper, programmatic assignment) can still carry\n\t\t// several files, so cap it to the last one — consistent with the\n\t\t// \"second pick replaces the first\" semantics. (Bug #30570313)\n\t\tconst incoming = this.multiple ? Array.from(files) : Array.from(files).slice(-1)\n\t\tif (!this.multiple && this.displayAttachments) {\n\t\t\tthis.files = []\n\t\t}\n\t\tincoming.forEach(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tif (this.displayAttachments) {\n\t\t\tthis.syncNativeInputFiles()\n\t\t}\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\t// Keep native <input type=\"file\"> in sync with the visible attachments list so\n\t// that a native form submit / FormData carries exactly the files shown in the UI.\n\t// Invalid items (wrong type or oversize) are intentionally excluded.\n\tprivate syncNativeInputFiles() {\n\t\tif (!this.inputRef || typeof DataTransfer === \"undefined\") {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tconst dt = new DataTransfer()\n\t\t\tthis.files\n\t\t\t\t.filter(item => item.acceptValid === true && item.sizeValid === true)\n\t\t\t\t.forEach(item => dt.items.add(item.file))\n\t\t\tthis.inputRef.files = dt.files\n\t\t} catch (e) {\n\t\t\t// Safari < 14.1 / older browsers may reject assigning to .files; nothing safe to fall back to.\n\t\t\tif (typeof process !== \"undefined\" && process.env && process.env.NODE_ENV !== \"production\") {\n\t\t\t\tconsole.warn(\"[gov-form-file] Could not sync native input.files:\", e)\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div class={FormFileClass.inputFocus}/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t<span slot=\"name\">{item.file.name}</span>\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.syncNativeInputFiles()\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tif (this.inputRef) {\n\t\t\tthis.inputRef.value = ''\n\t\t\tthis.syncNativeInputFiles()\n\t\t}\n\t}\n}\n"]}
|
|
@@ -12,7 +12,7 @@ export class GovFormSearch {
|
|
|
12
12
|
this.color = 'neutral';
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
|
-
return (h(Host, { key: '
|
|
15
|
+
return (h(Host, { key: 'c901368f70213c3be37b44b472002ce0872209d0', class: FormSearchClass.root, color: this.color, size: this.size }, h("slot", { key: '4ca581f75ccd75f785f94c1f93500c914b129cc8', name: "input" }), h("slot", { key: '10a34b30a9496b0d9a82b0baaf10b66ac5a2679f', name: "button-erase" }), h("slot", { key: '2888491da6babe4e7586abdda1863850ed67f8a9', name: "button" })));
|
|
16
16
|
}
|
|
17
17
|
static get is() { return "gov-form-search"; }
|
|
18
18
|
static get properties() {
|
|
@@ -40,7 +40,7 @@ export class GovFormSearch {
|
|
|
40
40
|
},
|
|
41
41
|
"getter": false,
|
|
42
42
|
"setter": false,
|
|
43
|
-
"reflect":
|
|
43
|
+
"reflect": true,
|
|
44
44
|
"defaultValue": "\"m\""
|
|
45
45
|
},
|
|
46
46
|
"color": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-search.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/search/gov-form-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAC,eAAe,EAA2C,MAAM,aAAa,CAAA;AAKrF,MAAM,OAAO,aAAa;IAH1B;QAKC;;WAEG;
|
|
1
|
+
{"version":3,"file":"gov-form-search.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/search/gov-form-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAC,eAAe,EAA2C,MAAM,aAAa,CAAA;AAKrF,MAAM,OAAO,aAAa;IAH1B;QAKC;;WAEG;QAC6B,SAAI,GAAyB,GAAG,CAAA;QAChE;;WAEG;QAC6B,UAAK,GAAwB,SAAS,CAAA;KAWtE;IATA,MAAM;QACL,OAAO,CACN,EAAC,IAAI,qDAAC,KAAK,EAAE,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI;YACpE,6DAAM,IAAI,EAAC,OAAO,GAAE;YACpB,6DAAM,IAAI,EAAC,cAAc,GAAE;YAC3B,6DAAM,IAAI,EAAC,QAAQ,GAAE,CACf,CACP,CAAA;IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FormSearchClass, FormSearchSizesType, FormSearchColorType} from './constants'\n\n@Component({\n\ttag: 'gov-form-search',\n})\nexport class GovFormSearch {\n\t@Element() host: HTMLGovFormSearchElement\n\t/**\n\t * Search’s size.\n\t */\n\t@Prop({reflect: true}) readonly size?: FormSearchSizesType = \"m\"\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop({reflect: true}) readonly color: FormSearchColorType = 'neutral'\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSearchClass.root} color={this.color} size={this.size}>\n\t\t\t\t<slot name=\"input\"/>\n\t\t\t\t<slot name=\"button-erase\"/>\n\t\t\t\t<slot name=\"button\"/>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
|
|
@@ -5,7 +5,6 @@ import { validateProp } from "../../../helpers/Validate/props";
|
|
|
5
5
|
import { createID } from "../../../utils/string.utils";
|
|
6
6
|
import { FormSelectClass, FormSelectSizes, } from "./constants";
|
|
7
7
|
import { propsValueToArray } from "../../../utils/array.utils";
|
|
8
|
-
import { tick } from "../../../utils/stencil.utils";
|
|
9
8
|
import { AttributeObserver } from "../../../helpers/Dom/attribute";
|
|
10
9
|
import { ariaAttributes } from "../../../helpers/Accessibility/attributes";
|
|
11
10
|
import { inheritAriaAttributes } from "../../../helpers/Accessibility/accessibility";
|
|
@@ -41,7 +40,7 @@ export class GovFormSelect {
|
|
|
41
40
|
this.passControlAttrs();
|
|
42
41
|
}
|
|
43
42
|
watchValue() {
|
|
44
|
-
this.
|
|
43
|
+
this.syncSelectValue();
|
|
45
44
|
}
|
|
46
45
|
passControlAttrs() {
|
|
47
46
|
this.f.passAttrToControl('size', this.size);
|
|
@@ -55,6 +54,7 @@ export class GovFormSelect {
|
|
|
55
54
|
this.onAriaAttributeChange(attributeName, newValue);
|
|
56
55
|
});
|
|
57
56
|
this.attributeObserver.startObserving(ariaAttributes);
|
|
57
|
+
this.syncSelectValue();
|
|
58
58
|
}
|
|
59
59
|
disconnectedCallback() {
|
|
60
60
|
var _a;
|
|
@@ -62,34 +62,27 @@ export class GovFormSelect {
|
|
|
62
62
|
}
|
|
63
63
|
componentWillLoad() {
|
|
64
64
|
this.validateSize(this.size);
|
|
65
|
-
this.markSelectedValue();
|
|
66
65
|
this.optionsState = propsValueToArray(this.options);
|
|
67
66
|
this.inheritedAttributes = inheritAriaAttributes(this.host);
|
|
68
67
|
}
|
|
69
68
|
async componentDidRender() {
|
|
70
69
|
this.passControlAttrs();
|
|
71
70
|
this.f.passAttrToLabel('required', String(this.required));
|
|
72
|
-
tick(() => this.markSelectedValue());
|
|
73
71
|
}
|
|
74
72
|
onAriaAttributeChange(attributeName, newValue) {
|
|
75
73
|
this.host.removeAttribute(attributeName);
|
|
76
74
|
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
|
|
77
75
|
}
|
|
78
|
-
|
|
79
|
-
this.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
option.removeAttribute('selected');
|
|
85
|
-
}
|
|
86
|
-
});
|
|
76
|
+
syncSelectValue() {
|
|
77
|
+
if (this.selectRef && this.value !== undefined && this.selectRef.value !== this.value) {
|
|
78
|
+
this.selectRef.value = this.value;
|
|
79
|
+
}
|
|
87
80
|
}
|
|
88
81
|
render() {
|
|
89
|
-
return (h(Host, { key: '
|
|
82
|
+
return (h(Host, { key: 'd29638f5868731a2324971d197dcd636364a4f6c', class: FormSelectClass.root, size: this.size }, this.h.hasSlot('prefix') && h("slot", { key: '41cc14ee33022a4cf6d10c3d86c8915551221e94', name: "prefix" }), h("span", { key: 'f9c167589fa81f0a060a13d9a31d16ab642d5ad2', class: "element" }, h("select", Object.assign({ key: '2dd5c948ccc7b65674e7d7f730cb2c9567287668', id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el) }, this.inheritedAttributes, { "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid) }), h("slot", { key: 'f6f0b21c9e43e1216446bce09c57a757a40d7b7b' }), Array.isArray(this.optionsState) && this.optionsState.map((option) => {
|
|
90
83
|
var _a;
|
|
91
84
|
return (h("option", { value: option.value, selected: option.value === this.value, disabled: option === null || option === void 0 ? void 0 : option.disabled }, (_a = option.label) !== null && _a !== void 0 ? _a : option.value));
|
|
92
|
-
})), this.success && h("gov-icon", { key: '
|
|
85
|
+
})), this.success && h("gov-icon", { key: 'd94a0191bc7d02d55450dfad627457101226ad22', class: "validation-icon", name: "check-lg", type: "components" }), this.invalid && h("gov-icon", { key: '84ecf7197313c8a145efa54730d22068679df3f5', class: "validation-icon", name: "exclamation-lg", type: "components" }), h("gov-icon", { key: '1a219d4d230466ac15e316eee16d4a55db1889fe', class: "arrow-icon", name: "chevron-down", type: "components" })), this.h.hasSlot('sufix') && h("slot", { key: 'c7f4816548e3494de94f7ff0dd33f6c904acc14b', name: "sufix" })));
|
|
93
86
|
}
|
|
94
87
|
onFocusHandler(e) {
|
|
95
88
|
this.focused = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/select/gov-form-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAC,OAAO,EAAE,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {createID} from '../../../utils/string.utils'\nimport {FormSelectClass, FormSelectSizes, FormSelectSizesType,} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-form-select',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Options of select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | FormSelectOption[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop({reflect: true}) readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() optionsState: FormSelectOption[] = []\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | FormSelectOption[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.markSelectedValue()\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('type', 'select')\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\n\t\tthis.markSelectedValue()\n\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\ttick(() => this.markSelectedValue())\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate markSelectedValue() {\n\t\tthis.host.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t} else {\n\t\t\t\toption.removeAttribute('selected')\n\t\t\t}\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</select>\n\t\t\t\t\t{this.success && <gov-icon class=\"validation-icon\" name=\"check-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon class=\"validation-icon\" name=\"exclamation-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t<gov-icon class=\"arrow-icon\" name=\"chevron-down\" type=\"components\"></gov-icon>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-form-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/select/gov-form-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAA;AAEtF,OAAO,EAAC,YAAY,EAAC,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAC,eAAe,EAAE,eAAe,GAAuB,MAAM,aAAa,CAAA;AAElF,OAAO,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAC,iBAAiB,EAAa,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAC,cAAc,EAAC,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAC,qBAAqB,EAAC,MAAM,8CAA8C,CAAC;AAKnF,MAAM,OAAO,aAAa;IAQzB;QAmBA;;WAEG;QACc,SAAI,GAAyB,GAAG,CAAA;QAKjD;;;WAGG;QACc,aAAQ,GAAY,KAAK,CAAA;QAK1C;;;WAGG;QAC6B,aAAQ,GAAY,KAAK,CAAA;QAkBhD,iBAAY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AAC,QAAQ,CAAC,OAAsB;QACpC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACrC,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,MAAM;QACX,OAAO,IAAI,CAAC,SAAS,CAAA;IACtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {createID} from '../../../utils/string.utils'\nimport {FormSelectClass, FormSelectSizes, FormSelectSizesType,} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-form-select',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Options of select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | FormSelectOption[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop({reflect: true}) readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() optionsState: FormSelectOption[] = []\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | FormSelectOption[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.syncSelectValue()\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('type', 'select')\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\n\t\tthis.syncSelectValue()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate syncSelectValue() {\n\t\tif (this.selectRef && this.value !== undefined && this.selectRef.value !== this.value) {\n\t\t\tthis.selectRef.value = this.value\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</select>\n\t\t\t\t\t{this.success && <gov-icon class=\"validation-icon\" name=\"check-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon class=\"validation-icon\" name=\"exclamation-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t<gov-icon class=\"arrow-icon\" name=\"chevron-down\" type=\"components\"></gov-icon>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n}\n"]}
|
|
@@ -44,7 +44,9 @@ export class GovTooltipContent {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: '121b5cd3878956618a7a917511e6d8d76edf6672', class: TooltipContentClass.root, role: "tooltip", hidden: !this.isVisible, "aria-hidden": !toBoolAttr(this.isVisible), "is-visible": this.isVisible }, this.message
|
|
48
|
+
? h("span", { class: "gov-tooltip-content__message", innerHTML: this.message })
|
|
49
|
+
: h("slot", null), this.persist ? (h("gov-button", { "on-gov-click": this.hideContent.bind(this), color: this.color, size: this.size, type: "base" }, h("gov-icon", { slot: "icon-start", name: "x-lg", type: "components" }))) : null));
|
|
48
50
|
}
|
|
49
51
|
static get is() { return "gov-tooltip-content"; }
|
|
50
52
|
static get properties() {
|
|
@@ -160,6 +162,25 @@ export class GovTooltipContent {
|
|
|
160
162
|
"setter": false,
|
|
161
163
|
"reflect": false,
|
|
162
164
|
"defaultValue": "null"
|
|
165
|
+
},
|
|
166
|
+
"message": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"attribute": "message",
|
|
169
|
+
"mutable": true,
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "string",
|
|
172
|
+
"resolved": "string",
|
|
173
|
+
"references": {}
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"optional": true,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Tooltip text. When set, renders the HTML message; otherwise the default `<slot/>` is used."
|
|
180
|
+
},
|
|
181
|
+
"getter": false,
|
|
182
|
+
"setter": false,
|
|
183
|
+
"reflect": false
|
|
163
184
|
}
|
|
164
185
|
};
|
|
165
186
|
}
|
|
@@ -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,WAAW,EAAmB,aAAa,EAAoB,MAAM,aAAa,CAAA;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAKvD,MAAM,OAAO,iBAAiB;IAH9B;QAOC;;WAEG;QACc,UAAK,GAAsB,aAAa,CAAC,OAAO,CAAA;QACjE;;WAEG;QACc,SAAI,GAAqB,WAAW,CAAC,EAAE,CAAA;QACxD;;WAEG;QACK,YAAO,GAAa,KAAK,CAAA;QACjC;;WAEG;QAC+C,cAAS,GAAG,KAAK,CAAA;QACnE;;WAEG;QAC+B,aAAQ,GAAW,IAAI,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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ACV,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,gBAC5B,IAAI,CAAC,SAAS;YACzB,IAAI,CAAC,OAAO;gBACZ,CAAC,CAAC,YAAM,KAAK,EAAC,8BAA8B,EAAC,SAAS,EAAE,IAAI,CAAC,OAAO,GAAS;gBAC7E,CAAC,CAAC,eAAa;YACf,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CACf,kCACe,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EACzC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,MAAM;gBACZ,gBAAU,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAa,CAC/D,CACb,CAAC,CAAC,CAAC,IAAI,CACF,CACP,CAAA;IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { TooltipContentClass, TooltipSize, TooltipSizeType, TooltipColors, TooltipColorType } from \"./constants\"\nimport { toBoolAttr } from \"../../helpers/Dom/template\"\n\n@Component({\n\ttag: \"gov-tooltip-content\",\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 color?: TooltipColorType = TooltipColors.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\t/**\n\t * Tooltip text. When set, renders the HTML message; otherwise the default `<slot/>` is used.\n\t */\n\t@Prop({ attribute: \"message\", mutable: true }) message?: string\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{this.message\n\t\t\t\t\t? <span class=\"gov-tooltip-content__message\" innerHTML={this.message}></span>\n\t\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\tcolor={this.color}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\ttype={\"base\"}>\n\t\t\t\t\t\t<gov-icon slot={\"icon-start\"} name={\"x-lg\"} type={\"components\"}></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"]}
|
|
@@ -30,6 +30,12 @@ export class GovTooltip {
|
|
|
30
30
|
*/
|
|
31
31
|
this.icon = undefined;
|
|
32
32
|
this.persist = false;
|
|
33
|
+
this.repositionListenersAttached = false;
|
|
34
|
+
this.reposition = () => {
|
|
35
|
+
if (this.tooltipContent) {
|
|
36
|
+
this.verifyPositionSpace();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
33
39
|
this.h = govHost(this.host);
|
|
34
40
|
this.tooltipId = createID("GovTooltip");
|
|
35
41
|
this.tooltipContentId = createID("GovContentTooltip");
|
|
@@ -59,16 +65,18 @@ export class GovTooltip {
|
|
|
59
65
|
this.createContentWrapper();
|
|
60
66
|
}
|
|
61
67
|
disconnectedCallback() {
|
|
68
|
+
var _a;
|
|
69
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
70
|
+
this.resizeObserver = undefined;
|
|
71
|
+
window.removeEventListener("resize", this.reposition);
|
|
72
|
+
this.repositionListenersAttached = false;
|
|
62
73
|
this.removeContent();
|
|
63
74
|
}
|
|
64
75
|
createContentWrapper() {
|
|
65
76
|
var _a;
|
|
66
77
|
if (this.tooltipContent) {
|
|
67
|
-
if (this.message) {
|
|
68
|
-
this.tooltipContent.
|
|
69
|
-
}
|
|
70
|
-
else if (this.insideContent) {
|
|
71
|
-
this.tooltipContent.innerHTML = this.insideContent.innerHTML;
|
|
78
|
+
if (this.message != null) {
|
|
79
|
+
this.tooltipContent.setAttribute("message", this.message);
|
|
72
80
|
}
|
|
73
81
|
return;
|
|
74
82
|
}
|
|
@@ -78,7 +86,9 @@ export class GovTooltip {
|
|
|
78
86
|
}
|
|
79
87
|
else {
|
|
80
88
|
content = documentNode().createElement(TooltipContentClass.root);
|
|
81
|
-
|
|
89
|
+
if (this.message != null) {
|
|
90
|
+
content.setAttribute("message", this.message);
|
|
91
|
+
}
|
|
82
92
|
}
|
|
83
93
|
content.setAttribute("id", (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId);
|
|
84
94
|
content.setAttribute("parent-id", this.tooltipId);
|
|
@@ -193,14 +203,27 @@ export class GovTooltip {
|
|
|
193
203
|
tick(() => {
|
|
194
204
|
this.verifyPositionSpace();
|
|
195
205
|
});
|
|
206
|
+
if (!this.repositionListenersAttached) {
|
|
207
|
+
this.repositionListenersAttached = true;
|
|
208
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
209
|
+
this.resizeObserver = new ResizeObserver(this.reposition);
|
|
210
|
+
this.resizeObserver.observe(this.tooltipContent);
|
|
211
|
+
}
|
|
212
|
+
window.addEventListener("resize", this.reposition);
|
|
213
|
+
}
|
|
196
214
|
}
|
|
197
215
|
}
|
|
198
216
|
hideTooltip() {
|
|
217
|
+
var _a;
|
|
199
218
|
if (this.tooltipContent) {
|
|
200
219
|
this.tooltipContent.setAttribute("is-visible", "false");
|
|
201
220
|
this.tooltipContent.setAttribute("persist", "false");
|
|
202
221
|
this.tooltipContent.removeAttribute('style');
|
|
203
222
|
}
|
|
223
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
224
|
+
this.resizeObserver = undefined;
|
|
225
|
+
window.removeEventListener("resize", this.reposition);
|
|
226
|
+
this.repositionListenersAttached = false;
|
|
204
227
|
}
|
|
205
228
|
removeContent() {
|
|
206
229
|
const contentEl = document.getElementById(this.tooltipContentId);
|
|
@@ -210,11 +233,11 @@ export class GovTooltip {
|
|
|
210
233
|
}
|
|
211
234
|
render() {
|
|
212
235
|
var _a;
|
|
213
|
-
return (h(Host, { key: '
|
|
236
|
+
return (h(Host, { key: '20ebe5eea59967e8681fd0e35fc7aff53b5915dd', id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position }, h("span", { key: '847b78886907d683425013227eb78bbf9261b709', role: 'button', tabindex: 0, onKeyPress: () => this.showTooltip(), onBlur: () => {
|
|
214
237
|
if (this.persist === false) {
|
|
215
238
|
this.hideTooltip();
|
|
216
239
|
}
|
|
217
|
-
}, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, h("slot", { key: '
|
|
240
|
+
}, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, h("slot", { key: '84c4c02ee11e05166fca208b82ef54298dcaa6ee' }))));
|
|
218
241
|
}
|
|
219
242
|
/**
|
|
220
243
|
* Showing the modal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-tooltip.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AACrF,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AACzD,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,eAAe,EAEf,WAAW,EAEX,aAAa,GAEb,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAA;AAElD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAC,IAAI,EAAC,MAAM,2BAA2B,CAAC;AAK/C,MAAM,OAAO,UAAU;IAKtB;QAHiB,qBAAgB,GAAG,SAAS,CAAA;QAC5B,cAAS,GAAG,SAAS,CAAA;QAStC;;WAEG;QACc,UAAK,GAAsB,aAAa,CAAC,OAAO,CAAA;QACjE;;WAEG;QACc,SAAI,GAAqB,WAAW,CAAC,EAAE,CAAA;QACxD;;WAEG;QACoB,aAAQ,GAAwB,OAAO,CAAA;QAC9D;;WAEG;QACc,YAAO,GAAW,SAAS,CAAA;QAK5C;;WAEG;QAC6B,SAAI,GAAY,SAAS,CAAA;QAEhD,YAAO,GAAG,KAAK,CAAA;QA/BvB,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,Y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AAC,UAAU,mCAAI,IAAI,CAAC,gBAAgB;gBAAE,8DAAO,CAAO,CACvE,CACP,CAAA;IACF,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,IAAI;QACT,IAAI,CAAC,WAAW,EAAE,CAAA;IACnB,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,IAAI;QACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,WAAW,EAAE,CAAA;IACnB,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\tTooltipColors,\n\tTooltipColorType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {documentNode} from \"../../helpers/Dom/win\";\nimport {Nullable} from \"../../utils/helpers.types\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-tooltip\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\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 color?: TooltipColorType = TooltipColors.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({mutable: true}) 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({reflect: true}) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TooltipColors, 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\t@Watch(\"message\")\n\trerenderMessage(): void {\n\t\tthis.createContentWrapper();\n\t}\n\n\tconnectedCallback() {\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.createContentWrapper()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tif (this.tooltipContent) {\n\t\t\tif (this.message) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.message\n\t\t\t} else if (this.insideContent) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.insideContent.innerHTML\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet content: HTMLGovTooltipContentElement;\n\t\tif (this.insideContent) {\n\t\t\tcontent = this.insideContent\n\t\t} else {\n\t\t\tcontent = documentNode().createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tcontent.innerHTML = this.message\n\t\t}\n\n\t\tcontent.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tcontent.setAttribute(\"parent-id\", this.tooltipId)\n\t\tcontent.setAttribute(\"color\", this.color)\n\t\tcontent.setAttribute(\"size\", this.size)\n\t\tdocumentNode().body.appendChild(content)\n\t}\n\n\tprivate get tooltipContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn documentNode().body.querySelector(`#${this.identifier ?? this.tooltipContentId}`);\n\t}\n\n\tprivate get insideContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn this.host.querySelector(TooltipContentClass.root)\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\tif (this.tooltipContent) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t\tthis.showTooltip()\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 windowWidth = window.innerWidth - (window.innerWidth - document.documentElement.clientWidth);\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.tooltipContent.offsetWidth\n\t\tconst contentHeight = this.tooltipContent.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\n\t\tconst isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n\t\tconst isLeftSpace = triggerPos.left > contentWidth;\n\n\t\t// LEFT/RIGHT\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n\t\t\tif (isRightSpace === false && isLeftSpace === false) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\t}\n\t\t\tif (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n\t\t\t\tthis.position = TooltipPosition.LEFT\n\t\t\t}\n\t\t\tif (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n\t\t\t\tthis.position = TooltipPosition.RIGHT\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\n\t\t// LEFT/RIGHT FOR TOP/BOTTOM\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tlet leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n\t\t\t\tconst isNotLeftSpace = leftPosition < 0;\n\t\t\t\tconst isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n\t\t\t\tif (isNotLeftSpace && isNotRightSpace) {\n\t\t\t\t\tthis.tooltipContent.style.width = \"auto\";\n\t\t\t\t\tthis.tooltipContent.style.left = offset + \"px\";\n\t\t\t\t\tthis.tooltipContent.style.right = offset + \"px\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isNotLeftSpace) {\n\t\t\t\t\t\tleftPosition = offset\n\t\t\t\t\t}\n\t\t\t\t\tif (isNotRightSpace) {\n\t\t\t\t\t\tleftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n\t\t\t\t\t}\n\t\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\n\t\tthis.tooltipContent.style.opacity = '1'\n\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.style.opacity = '0'\n\t\t\tthis.tooltipContent.hidden = false\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"true\")\n\t\t\ttick(() => {\n\t\t\t\tthis.verifyPositionSpace()\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"false\")\n\t\t\tthis.tooltipContent.removeAttribute('style')\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\t<span role={'button'}\n\t\t\t\t\t\t\ttabindex={0}\n\t\t\t\t\t\t\tonKeyPress={() => this.showTooltip()}\n\t\t\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\t\t\tif (this.persist === false) {\n\t\t\t\t\t\t\t\t\tthis.hideTooltip()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}><slot/></span>\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"]}
|
|
1
|
+
{"version":3,"file":"gov-tooltip.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AACrF,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AACzD,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,eAAe,EAEf,WAAW,EAEX,aAAa,GAEb,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAA;AAElD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAC,IAAI,EAAC,MAAM,2BA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I,EAAE,QAAQ,EACjB,QAAQ,EAAE,CAAC,EACX,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,EACpC,MAAM,EAAE,GAAG,EAAE;oBACZ,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;wBAC5B,IAAI,CAAC,WAAW,EAAE,CAAA;oBACnB,CAAC;gBACF,CAAC,sBACiB,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,gBAAgB;gBAAE,8DAAO,CAAO,CACvE,CACP,CAAA;IACF,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,IAAI;QACT,IAAI,CAAC,WAAW,EAAE,CAAA;IACnB,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,IAAI;QACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,WAAW,EAAE,CAAA;IACnB,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\tTooltipColors,\n\tTooltipColorType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {documentNode} from \"../../helpers/Dom/win\";\nimport {Nullable} from \"../../utils/helpers.types\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-tooltip\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\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 color?: TooltipColorType = TooltipColors.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({mutable: true}) 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({reflect: true}) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TooltipColors, 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\t@Watch(\"message\")\n\trerenderMessage(): void {\n\t\tthis.createContentWrapper();\n\t}\n\n\tconnectedCallback() {\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.createContentWrapper()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.resizeObserver?.disconnect()\n\t\tthis.resizeObserver = undefined\n\t\twindow.removeEventListener(\"resize\", this.reposition)\n\t\tthis.repositionListenersAttached = false\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tif (this.tooltipContent) {\n\t\t\tif (this.message != null) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"message\", this.message)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet content: HTMLGovTooltipContentElement;\n\t\tif (this.insideContent) {\n\t\t\tcontent = this.insideContent\n\t\t} else {\n\t\t\tcontent = documentNode().createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tif (this.message != null) {\n\t\t\t\tcontent.setAttribute(\"message\", this.message)\n\t\t\t}\n\t\t}\n\n\t\tcontent.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tcontent.setAttribute(\"parent-id\", this.tooltipId)\n\t\tcontent.setAttribute(\"color\", this.color)\n\t\tcontent.setAttribute(\"size\", this.size)\n\t\tdocumentNode().body.appendChild(content)\n\t}\n\n\tprivate get tooltipContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn documentNode().body.querySelector(`#${this.identifier ?? this.tooltipContentId}`);\n\t}\n\n\tprivate get insideContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn this.host.querySelector(TooltipContentClass.root)\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\tif (this.tooltipContent) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t\tthis.showTooltip()\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 windowWidth = window.innerWidth - (window.innerWidth - document.documentElement.clientWidth);\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.tooltipContent.offsetWidth\n\t\tconst contentHeight = this.tooltipContent.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\n\t\tconst isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n\t\tconst isLeftSpace = triggerPos.left > contentWidth;\n\n\t\t// LEFT/RIGHT\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n\t\t\tif (isRightSpace === false && isLeftSpace === false) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\t}\n\t\t\tif (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n\t\t\t\tthis.position = TooltipPosition.LEFT\n\t\t\t}\n\t\t\tif (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n\t\t\t\tthis.position = TooltipPosition.RIGHT\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\n\t\t// LEFT/RIGHT FOR TOP/BOTTOM\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tlet leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n\t\t\t\tconst isNotLeftSpace = leftPosition < 0;\n\t\t\t\tconst isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n\t\t\t\tif (isNotLeftSpace && isNotRightSpace) {\n\t\t\t\t\tthis.tooltipContent.style.width = \"auto\";\n\t\t\t\t\tthis.tooltipContent.style.left = offset + \"px\";\n\t\t\t\t\tthis.tooltipContent.style.right = offset + \"px\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isNotLeftSpace) {\n\t\t\t\t\t\tleftPosition = offset\n\t\t\t\t\t}\n\t\t\t\t\tif (isNotRightSpace) {\n\t\t\t\t\t\tleftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n\t\t\t\t\t}\n\t\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\n\t\tthis.tooltipContent.style.opacity = '1'\n\n\t}\n\n\tprivate resizeObserver?: ResizeObserver\n\tprivate repositionListenersAttached = false\n\tprivate readonly reposition = () => {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.verifyPositionSpace()\n\t\t}\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.style.opacity = '0'\n\t\t\tthis.tooltipContent.hidden = false\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"true\")\n\t\t\ttick(() => {\n\t\t\t\tthis.verifyPositionSpace()\n\t\t\t})\n\t\t\tif (!this.repositionListenersAttached) {\n\t\t\t\tthis.repositionListenersAttached = true\n\t\t\t\tif (typeof ResizeObserver !== \"undefined\") {\n\t\t\t\t\tthis.resizeObserver = new ResizeObserver(this.reposition)\n\t\t\t\t\tthis.resizeObserver.observe(this.tooltipContent)\n\t\t\t\t}\n\t\t\t\twindow.addEventListener(\"resize\", this.reposition)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"false\")\n\t\t\tthis.tooltipContent.removeAttribute('style')\n\t\t}\n\t\tthis.resizeObserver?.disconnect()\n\t\tthis.resizeObserver = undefined\n\t\twindow.removeEventListener(\"resize\", this.reposition)\n\t\tthis.repositionListenersAttached = false\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\t<span role={'button'}\n\t\t\t\t\t\t\ttabindex={0}\n\t\t\t\t\t\t\tonKeyPress={() => this.showTooltip()}\n\t\t\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\t\t\tif (this.persist === false) {\n\t\t\t\t\t\t\t\t\tthis.hideTooltip()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}><slot/></span>\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"]}
|
|
@@ -50,8 +50,8 @@ export class GovWizardItem {
|
|
|
50
50
|
render() {
|
|
51
51
|
const triggerId = this.identifier || this.triggerId;
|
|
52
52
|
const Tag = this.collapsible ? Tags.BUTTON : Tags.DIV;
|
|
53
|
-
const prefixSlot = this.h.hasSlot("prefix") && (h("span", { key: '
|
|
54
|
-
return (h(Host, { key: '
|
|
53
|
+
const prefixSlot = this.h.hasSlot("prefix") && (h("span", { key: '3f00516020337fc142713c6edb468d0007eba3c5', class: WizardItemClass.prefix }, h("slot", { key: '05aa42bc8241f53bb3664dc3d06798cb0344f92f', name: "prefix" })));
|
|
54
|
+
return (h(Host, { key: '863700f5087e86d1f8d4e22b40108dfbc0cb96f5', class: this.h.classes(WizardItemClass.root), "is-expanded": this.isExpanded, color: this.color, size: this.size, role: "listitem", collapsible: this.collapsible, hydrated: this.hydrated }, h("div", { key: '6d93a5bb12dbe2fc2e308059ffd5d63ed915f16d', class: WizardItemClass.header }, prefixSlot, this.collapsible ? (h(Tag, { id: triggerId, class: this.h.classes(WizardItemClass.label), "aria-expanded": booleanString(this.isExpanded), "aria-controls": this.contentId, disabled: this.disabled, "aria-disabled": toBoolAttrIfDefined(this.disabled), onClick: (e) => {
|
|
55
55
|
e.preventDefault();
|
|
56
56
|
e.stopPropagation();
|
|
57
57
|
this.toggle();
|
|
@@ -41,7 +41,7 @@ export class GovWizard {
|
|
|
41
41
|
this.hydrated = true;
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: 'd1957fc0c0058c107769e3cc5390ef986fc9b921', class: this.h.classes(WizardClass.root), role: "list", size: this.size, hydrated: this.hydrated }, h("slot", { key: 'a34323c408d790c5945ca0d80db62de2433db438' })));
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Validate the WCAG attributes of the component
|