@gov-design-system-ce/components 4.6.5-b → 4.6.5
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/gov-flex_3.cjs.entry.js +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +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-dialog.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-range.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-link.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-pagination.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-wizard-item.js +1 -1
- package/dist/components/{p-isPjiQbr.js → p-BIB-JMbL.js} +2 -2
- package/dist/components/{p-BICk4EuO.js → p-BVG9PtuQ.js} +2 -2
- package/dist/components/{p-DmK9qaKH.js → p-DV0Pdd1S.js} +2 -2
- package/dist/components/p-Dj-FiQ37.js +2 -0
- package/dist/components/{p-DRXiDAHW.js.map → p-Dj-FiQ37.js.map} +1 -1
- package/dist/components/{p-DjGO_trZ.js → p-DlpZtTcv.js} +2 -2
- package/dist/components/{p-BNoNH6m-.js → p-Dw1o8KoZ.js} +2 -2
- package/dist/components/{p-BGK46VRO.js → p-NU_8kxGz.js} +2 -2
- package/dist/components/{p-ClDhNt_H.js → p-o4vVG5sG.js} +2 -2
- package/dist/core/core.css +14776 -0
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/gov-accordion-item.entry.esm.js.map +1 -0
- package/dist/core/gov-accordion.entry.esm.js.map +1 -0
- package/dist/core/gov-attachments.gov-attachments-item.gov-form-message.entry.esm.js.map +1 -0
- package/dist/core/gov-backdrop.entry.esm.js.map +1 -0
- package/dist/core/gov-banner.entry.esm.js.map +1 -0
- package/dist/core/gov-blockquote.entry.esm.js.map +1 -0
- package/dist/core/gov-breadcrumbs.entry.esm.js.map +1 -0
- package/dist/core/gov-button.entry.esm.js.map +1 -0
- package/dist/core/gov-card.entry.esm.js.map +1 -0
- package/dist/core/gov-chip.entry.esm.js.map +1 -0
- package/dist/core/gov-collapsible.entry.esm.js.map +1 -0
- package/dist/core/gov-container.entry.esm.js.map +1 -0
- package/dist/core/gov-control-group.entry.esm.js.map +1 -0
- package/dist/core/gov-cookiebar.entry.esm.js.map +1 -0
- package/dist/core/gov-dialog.entry.esm.js.map +1 -0
- package/dist/core/gov-dropdown.entry.esm.js.map +1 -0
- package/dist/core/gov-empty.entry.esm.js.map +1 -0
- package/dist/core/gov-error-code.entry.esm.js.map +1 -0
- package/dist/core/gov-flex.gov-icon.gov-theme-switch.entry.esm.js.map +1 -0
- package/dist/core/gov-form-autocomplete.entry.esm.js.map +1 -0
- package/dist/core/gov-form-checkbox-group.entry.esm.js.map +1 -0
- package/dist/core/gov-form-checkbox.entry.esm.js.map +1 -0
- package/dist/core/gov-form-control.entry.esm.js.map +1 -0
- package/dist/core/gov-form-file.entry.esm.js.map +1 -0
- package/dist/core/gov-form-group.entry.esm.js.map +1 -0
- package/dist/core/gov-form-input.gov-skeleton.entry.esm.js.map +1 -0
- package/dist/core/gov-form-label.entry.esm.js.map +1 -0
- package/dist/core/gov-form-multi-select.entry.esm.js.map +1 -0
- package/dist/core/gov-form-password-power.entry.esm.js.map +1 -0
- package/dist/core/gov-form-radio-group.entry.esm.js.map +1 -0
- package/dist/core/gov-form-radio.entry.esm.js.map +1 -0
- package/dist/core/gov-form-range.entry.esm.js.map +1 -0
- package/dist/core/gov-form-search.entry.esm.js.map +1 -0
- package/dist/core/gov-form-select.entry.esm.js.map +1 -0
- package/dist/core/gov-form-switch.entry.esm.js.map +1 -0
- package/dist/core/gov-grid-item.entry.esm.js.map +1 -0
- package/dist/core/gov-grid.entry.esm.js.map +1 -0
- package/dist/core/gov-infobar.entry.esm.js.map +1 -0
- package/dist/core/gov-layout-column.entry.esm.js.map +1 -0
- package/dist/core/gov-layout.entry.esm.js.map +1 -0
- package/dist/core/gov-lifecycle.entry.esm.js.map +1 -0
- package/dist/core/gov-link.entry.esm.js.map +1 -0
- package/dist/core/gov-loading.entry.esm.js.map +1 -0
- package/dist/core/gov-message.entry.esm.js.map +1 -0
- package/dist/core/gov-pagination.entry.esm.js.map +1 -0
- package/dist/core/gov-spacer.entry.esm.js.map +1 -0
- package/dist/core/gov-stepper-item.entry.esm.js.map +1 -0
- package/dist/core/gov-stepper.entry.esm.js.map +1 -0
- package/dist/core/gov-tabs-item.entry.esm.js.map +1 -0
- package/dist/core/gov-tabs.entry.esm.js.map +1 -0
- package/dist/core/gov-tag.entry.esm.js.map +1 -0
- package/dist/core/gov-tile.entry.esm.js.map +1 -0
- package/dist/core/gov-toast.entry.esm.js.map +1 -0
- package/dist/core/gov-tooltip.gov-tooltip-content.entry.esm.js.map +1 -0
- package/dist/core/gov-wizard-item.entry.esm.js.map +1 -0
- package/dist/core/gov-wizard.entry.esm.js.map +1 -0
- package/dist/core/loader.esm.js.map +1 -0
- package/dist/core/p-002e72bf.entry.js +2 -0
- package/dist/core/{p-41bef63a.entry.js.map → p-002e72bf.entry.js.map} +1 -1
- package/dist/core/{p-49b67f59.entry.js → p-04ec45ab.entry.js} +2 -2
- package/dist/core/{p-49b67f59.entry.js.map → p-04ec45ab.entry.js.map} +1 -1
- package/dist/core/{p-6b0625ee.entry.js → p-0af96cc0.entry.js} +2 -2
- package/dist/core/{p-6b0625ee.entry.js.map → p-0af96cc0.entry.js.map} +1 -1
- package/dist/core/{p-de5dfd70.entry.js → p-10991f00.entry.js} +2 -2
- package/dist/core/{p-de5dfd70.entry.js.map → p-10991f00.entry.js.map} +1 -1
- package/dist/core/{p-4e534d68.entry.js → p-157a1636.entry.js} +2 -2
- package/dist/core/{p-4e534d68.entry.js.map → p-157a1636.entry.js.map} +1 -1
- package/dist/core/{p-30ad7514.entry.js → p-1626cc67.entry.js} +2 -2
- package/dist/core/{p-30ad7514.entry.js.map → p-1626cc67.entry.js.map} +1 -1
- package/dist/core/{p-9321fb9d.entry.js → p-187c0eda.entry.js} +2 -2
- package/dist/core/{p-9321fb9d.entry.js.map → p-187c0eda.entry.js.map} +1 -1
- package/dist/core/{p-b77c283e.entry.js → p-19300834.entry.js} +2 -2
- package/dist/core/{p-b77c283e.entry.js.map → p-19300834.entry.js.map} +1 -1
- package/dist/core/{p-00ab0454.entry.js → p-3314505d.entry.js} +2 -2
- package/dist/core/{p-00ab0454.entry.js.map → p-3314505d.entry.js.map} +1 -1
- package/dist/core/p-33209782.entry.js +2 -0
- package/dist/core/{p-943a58b2.entry.js.map → p-33209782.entry.js.map} +1 -1
- package/dist/core/{p-e913cfc8.entry.js → p-3e07bf07.entry.js} +2 -2
- package/dist/core/{p-dc0bd1e5.entry.js.map → p-3e07bf07.entry.js.map} +1 -1
- package/dist/core/{p-dfb76a14.entry.js → p-441e67f6.entry.js} +2 -2
- package/dist/core/{p-dfb76a14.entry.js.map → p-441e67f6.entry.js.map} +1 -1
- package/dist/core/{p-68a5d225.entry.js → p-46824842.entry.js} +2 -2
- package/dist/core/{p-68a5d225.entry.js.map → p-46824842.entry.js.map} +1 -1
- package/dist/core/{p-c9b2f97c.entry.js → p-4c02094d.entry.js} +2 -2
- package/dist/core/{p-c9b2f97c.entry.js.map → p-4c02094d.entry.js.map} +1 -1
- package/dist/core/{p-2493a7f3.entry.js → p-4d36cd18.entry.js} +2 -2
- package/dist/core/{p-2493a7f3.entry.js.map → p-4d36cd18.entry.js.map} +1 -1
- package/dist/core/{p-f2d24551.entry.js → p-4d902f20.entry.js} +2 -2
- package/dist/core/{p-f2d24551.entry.js.map → p-4d902f20.entry.js.map} +1 -1
- package/dist/core/{p-4342c252.entry.js → p-4e2faea7.entry.js} +2 -2
- package/dist/core/{p-4342c252.entry.js.map → p-4e2faea7.entry.js.map} +1 -1
- package/dist/core/{p-a6f27583.entry.js → p-511eed88.entry.js} +2 -2
- package/dist/core/{p-a6f27583.entry.js.map → p-511eed88.entry.js.map} +1 -1
- package/dist/core/{p-b2648255.entry.js → p-5305e82e.entry.js} +2 -2
- package/dist/core/{p-b2648255.entry.js.map → p-5305e82e.entry.js.map} +1 -1
- package/dist/core/{p-378cf8de.entry.js → p-558e75a6.entry.js} +2 -2
- package/dist/core/{p-378cf8de.entry.js.map → p-558e75a6.entry.js.map} +1 -1
- package/dist/core/{p-48b74272.entry.js → p-5721cf9b.entry.js} +2 -2
- package/dist/core/{p-48b74272.entry.js.map → p-5721cf9b.entry.js.map} +1 -1
- package/dist/core/p-57ca8ac7.entry.js +2 -0
- package/dist/core/{p-b181f85f.entry.js.map → p-57ca8ac7.entry.js.map} +1 -1
- package/dist/core/{p-f515d912.entry.js → p-5c872d64.entry.js} +2 -2
- package/dist/core/{p-b37bd421.entry.js → p-65a09763.entry.js} +2 -2
- package/dist/core/{p-b37bd421.entry.js.map → p-65a09763.entry.js.map} +1 -1
- package/dist/core/{p-4bd3f101.entry.js → p-6b44890d.entry.js} +2 -2
- package/dist/core/{p-4bd3f101.entry.js.map → p-6b44890d.entry.js.map} +1 -1
- package/dist/core/{p-ab367b0c.entry.js → p-6d2ce4c7.entry.js} +2 -2
- package/dist/core/{p-ab367b0c.entry.js.map → p-6d2ce4c7.entry.js.map} +1 -1
- package/dist/core/{p-b0d4d6bd.entry.js → p-70b5555f.entry.js} +2 -2
- package/dist/core/{p-b0d4d6bd.entry.js.map → p-70b5555f.entry.js.map} +1 -1
- package/dist/core/p-73bd93f9.entry.js +2 -0
- package/dist/core/{p-6638d034.entry.js.map → p-73bd93f9.entry.js.map} +1 -1
- package/dist/core/{p-bb5b9ccd.entry.js → p-7f513718.entry.js} +2 -2
- package/dist/core/{p-bb5b9ccd.entry.js.map → p-7f513718.entry.js.map} +1 -1
- package/dist/core/{p-eff8ffff.entry.js → p-852310d9.entry.js} +2 -2
- package/dist/core/{p-eff8ffff.entry.js.map → p-852310d9.entry.js.map} +1 -1
- package/dist/core/{p-6ac9b0f2.entry.js → p-8d47e346.entry.js} +2 -2
- package/dist/core/{p-6ac9b0f2.entry.js.map → p-8d47e346.entry.js.map} +1 -1
- package/dist/core/p-90ab65b4.entry.js +2 -0
- package/dist/core/{p-e913cfc8.entry.js.map → p-90ab65b4.entry.js.map} +1 -1
- package/dist/core/{p-b5e40f40.entry.js → p-91cbee1b.entry.js} +2 -2
- package/dist/core/{p-b5e40f40.entry.js.map → p-91cbee1b.entry.js.map} +1 -1
- package/dist/core/{p-05bb35e1.entry.js → p-9d9e9401.entry.js} +2 -2
- package/dist/core/{p-05bb35e1.entry.js.map → p-9d9e9401.entry.js.map} +1 -1
- package/dist/core/p-B6CqPcY_.js.map +1 -1
- 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-ClISz4NF.js +3 -0
- package/dist/core/p-ClISz4NF.js.map +1 -0
- 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-ad9227b3.entry.js → p-a2c61d50.entry.js} +2 -2
- package/dist/core/{p-ad9227b3.entry.js.map → p-a2c61d50.entry.js.map} +1 -1
- package/dist/core/p-abb7780e.entry.js +2 -0
- package/dist/core/{p-a7c322a7.entry.js.map → p-abb7780e.entry.js.map} +1 -1
- package/dist/core/p-bd2df430.entry.js +2 -0
- package/dist/core/{p-2e15a654.entry.js.map → p-bd2df430.entry.js.map} +1 -1
- package/dist/core/{p-3a4799b3.entry.js → p-be9af807.entry.js} +2 -2
- package/dist/core/{p-3a4799b3.entry.js.map → p-be9af807.entry.js.map} +1 -1
- package/dist/core/{p-febff4d1.entry.js → p-bf573a56.entry.js} +2 -2
- package/dist/core/{p-febff4d1.entry.js.map → p-bf573a56.entry.js.map} +1 -1
- package/dist/core/{p-473afd7d.entry.js → p-c1b9f1ab.entry.js} +2 -2
- package/dist/core/{p-473afd7d.entry.js.map → p-c1b9f1ab.entry.js.map} +1 -1
- package/dist/core/p-c4734357.entry.js +2 -0
- package/dist/core/{p-a4fa2ffc.entry.js.map → p-c4734357.entry.js.map} +1 -1
- package/dist/core/{p-ac81cdf6.entry.js → p-c6b55c0a.entry.js} +2 -2
- package/dist/core/{p-ac81cdf6.entry.js.map → p-c6b55c0a.entry.js.map} +1 -1
- package/dist/core/{p-e17def2b.entry.js → p-cd163299.entry.js} +2 -2
- package/dist/core/{p-e17def2b.entry.js.map → p-cd163299.entry.js.map} +1 -1
- package/dist/core/{p-8ddb6dc6.entry.js → p-d43959a0.entry.js} +2 -2
- package/dist/core/{p-8ddb6dc6.entry.js.map → p-d43959a0.entry.js.map} +1 -1
- package/dist/core/{p-90cc2ddb.entry.js → p-d9c574f0.entry.js} +2 -2
- package/dist/core/{p-90cc2ddb.entry.js.map → p-d9c574f0.entry.js.map} +1 -1
- package/dist/core/{p-af2bd9d3.entry.js → p-d9d29f50.entry.js} +2 -2
- package/dist/core/{p-af2bd9d3.entry.js.map → p-d9d29f50.entry.js.map} +1 -1
- package/dist/core/{p-ea299832.entry.js → p-da997fb3.entry.js} +2 -2
- package/dist/core/{p-ea299832.entry.js.map → p-da997fb3.entry.js.map} +1 -1
- package/dist/core/{p-dd390459.entry.js → p-db860031.entry.js} +2 -2
- package/dist/core/{p-dd390459.entry.js.map → p-db860031.entry.js.map} +1 -1
- package/dist/core/{p-06497d64.entry.js → p-e30968b3.entry.js} +2 -2
- package/dist/core/{p-06497d64.entry.js.map → p-e30968b3.entry.js.map} +1 -1
- package/dist/core/{p-e1d58751.entry.js → p-e39e5dc7.entry.js} +2 -2
- package/dist/core/{p-e1d58751.entry.js.map → p-e39e5dc7.entry.js.map} +1 -1
- package/dist/core/{p-caf817d4.entry.js → p-eb3f6808.entry.js} +2 -2
- package/dist/core/{p-caf817d4.entry.js.map → p-eb3f6808.entry.js.map} +1 -1
- package/dist/core/{p-80052953.entry.js → p-eb766437.entry.js} +2 -2
- package/dist/core/{p-80052953.entry.js.map → p-eb766437.entry.js.map} +1 -1
- package/dist/core/{p-91d5df66.entry.js → p-f3887d6d.entry.js} +2 -2
- package/dist/core/{p-91d5df66.entry.js.map → p-f3887d6d.entry.js.map} +1 -1
- package/dist/core/{p-78202a44.entry.js → p-f75ad657.entry.js} +2 -2
- package/dist/core/{p-78202a44.entry.js.map → p-f75ad657.entry.js.map} +1 -1
- package/dist/core/{p-3ebbe75a.entry.js → p-f7bdb44a.entry.js} +2 -2
- package/dist/core/{p-3ebbe75a.entry.js.map → p-f7bdb44a.entry.js.map} +1 -1
- package/dist/core/p-fca7a0d6.entry.js +2 -0
- package/dist/core/{p-0675617d.entry.js.map → p-fca7a0d6.entry.js.map} +1 -1
- package/dist/core/p-vN03FcXN.js.map +1 -1
- package/dist/dist/components/gov-accordion-item.d.ts +11 -0
- package/dist/dist/components/gov-accordion.d.ts +11 -0
- package/dist/dist/components/gov-attachments-item.d.ts +11 -0
- package/dist/dist/components/gov-attachments.d.ts +11 -0
- package/dist/dist/components/gov-backdrop.d.ts +11 -0
- package/dist/dist/components/gov-banner.d.ts +11 -0
- package/dist/dist/components/gov-blockquote.d.ts +11 -0
- package/dist/dist/components/gov-breadcrumbs.d.ts +11 -0
- package/dist/dist/components/gov-button.d.ts +11 -0
- package/dist/dist/components/gov-card.d.ts +11 -0
- package/dist/dist/components/gov-chip.d.ts +11 -0
- package/dist/dist/components/gov-collapsible.d.ts +11 -0
- package/dist/dist/components/gov-container.d.ts +11 -0
- package/dist/dist/components/gov-control-group.d.ts +11 -0
- package/dist/dist/components/gov-cookiebar.d.ts +11 -0
- package/dist/dist/components/gov-dialog.d.ts +11 -0
- package/dist/dist/components/gov-dropdown.d.ts +11 -0
- package/dist/dist/components/gov-empty.d.ts +11 -0
- package/dist/dist/components/gov-error-code.d.ts +11 -0
- package/dist/dist/components/gov-flex.d.ts +11 -0
- package/dist/dist/components/gov-form-autocomplete.d.ts +11 -0
- package/dist/dist/components/gov-form-checkbox-group.d.ts +11 -0
- package/dist/dist/components/gov-form-checkbox.d.ts +11 -0
- package/dist/dist/components/gov-form-control.d.ts +11 -0
- package/dist/dist/components/gov-form-file.d.ts +11 -0
- package/dist/dist/components/gov-form-group.d.ts +11 -0
- package/dist/dist/components/gov-form-input.d.ts +11 -0
- package/dist/dist/components/gov-form-label.d.ts +11 -0
- package/dist/dist/components/gov-form-message.d.ts +11 -0
- package/dist/dist/components/gov-form-multi-select.d.ts +11 -0
- package/dist/dist/components/gov-form-password-power.d.ts +11 -0
- package/dist/dist/components/gov-form-radio-group.d.ts +11 -0
- package/dist/dist/components/gov-form-radio.d.ts +11 -0
- package/dist/dist/components/gov-form-range.d.ts +11 -0
- package/dist/dist/components/gov-form-search.d.ts +11 -0
- package/dist/dist/components/gov-form-select.d.ts +11 -0
- package/dist/dist/components/gov-form-switch.d.ts +11 -0
- package/dist/dist/components/gov-grid-item.d.ts +11 -0
- package/dist/dist/components/gov-grid.d.ts +11 -0
- package/dist/dist/components/gov-icon.d.ts +11 -0
- package/dist/dist/components/gov-infobar.d.ts +11 -0
- package/dist/dist/components/gov-layout-column.d.ts +11 -0
- package/dist/dist/components/gov-layout.d.ts +11 -0
- package/dist/dist/components/gov-lifecycle.d.ts +11 -0
- package/dist/dist/components/gov-link.d.ts +11 -0
- package/dist/dist/components/gov-loading.d.ts +11 -0
- package/dist/dist/components/gov-message.d.ts +11 -0
- package/dist/dist/components/gov-pagination.d.ts +11 -0
- package/dist/dist/components/gov-skeleton.d.ts +11 -0
- package/dist/dist/components/gov-spacer.d.ts +11 -0
- package/dist/dist/components/gov-stepper-item.d.ts +11 -0
- package/dist/dist/components/gov-stepper.d.ts +11 -0
- package/dist/dist/components/gov-tabs-item.d.ts +11 -0
- package/dist/dist/components/gov-tabs.d.ts +11 -0
- package/dist/dist/components/gov-tag.d.ts +11 -0
- package/dist/dist/components/gov-theme-switch.d.ts +11 -0
- package/dist/dist/components/gov-tile.d.ts +11 -0
- package/dist/dist/components/gov-toast.d.ts +11 -0
- package/dist/dist/components/gov-tooltip-content.d.ts +11 -0
- package/dist/dist/components/gov-tooltip.d.ts +11 -0
- package/dist/dist/components/gov-wizard-item.d.ts +11 -0
- package/dist/dist/components/gov-wizard.d.ts +11 -0
- package/dist/dist/components/index.d.ts +35 -0
- package/dist/dist/dist/components/gov-accordion-item.d.ts +11 -0
- package/dist/dist/dist/components/gov-accordion.d.ts +11 -0
- package/dist/dist/dist/components/gov-app.d.ts +11 -0
- package/dist/dist/dist/components/gov-attachments-item.d.ts +11 -0
- package/dist/dist/dist/components/gov-attachments.d.ts +11 -0
- package/dist/dist/dist/components/gov-backdrop.d.ts +11 -0
- package/dist/dist/dist/components/gov-banner.d.ts +11 -0
- package/dist/dist/dist/components/gov-blockquote.d.ts +11 -0
- package/dist/dist/dist/components/gov-breadcrumbs.d.ts +11 -0
- package/dist/dist/dist/components/gov-button.d.ts +11 -0
- package/dist/dist/dist/components/gov-card.d.ts +11 -0
- package/dist/dist/dist/components/gov-chip.d.ts +11 -0
- package/dist/dist/dist/components/gov-collapsible.d.ts +11 -0
- package/dist/dist/dist/components/gov-container.d.ts +11 -0
- package/dist/dist/dist/components/gov-control-group.d.ts +11 -0
- package/dist/dist/dist/components/gov-cookiebar.d.ts +11 -0
- package/dist/dist/dist/components/gov-dialog.d.ts +11 -0
- package/dist/dist/dist/components/gov-dropdown.d.ts +11 -0
- package/dist/dist/dist/components/gov-empty.d.ts +11 -0
- package/dist/dist/dist/components/gov-error-code.d.ts +11 -0
- package/dist/dist/dist/components/gov-flex.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-autocomplete.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-checkbox-group.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-checkbox.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-control.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-file.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-group.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-input.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-label.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-message.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-multi-select.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-password-power.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-radio-group.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-radio.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-range.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-search.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-select.d.ts +11 -0
- package/dist/dist/dist/components/gov-form-switch.d.ts +11 -0
- package/dist/dist/dist/components/gov-grid-item.d.ts +11 -0
- package/dist/dist/dist/components/gov-grid.d.ts +11 -0
- package/dist/dist/dist/components/gov-icon.d.ts +11 -0
- package/dist/dist/dist/components/gov-infobar.d.ts +11 -0
- package/dist/dist/dist/components/gov-layout-column.d.ts +11 -0
- package/dist/dist/dist/components/gov-layout.d.ts +11 -0
- package/dist/dist/dist/components/gov-lifecycle.d.ts +11 -0
- package/dist/dist/dist/components/gov-link.d.ts +11 -0
- package/dist/dist/dist/components/gov-loading.d.ts +11 -0
- package/dist/dist/dist/components/gov-message.d.ts +11 -0
- package/dist/dist/dist/components/gov-pagination.d.ts +11 -0
- package/dist/dist/dist/components/gov-skeleton.d.ts +11 -0
- package/dist/dist/dist/components/gov-spacer.d.ts +11 -0
- package/dist/dist/dist/components/gov-stepper-item.d.ts +11 -0
- package/dist/dist/dist/components/gov-stepper.d.ts +11 -0
- package/dist/dist/dist/components/gov-tabs-item.d.ts +11 -0
- package/dist/dist/dist/components/gov-tabs.d.ts +11 -0
- package/dist/dist/dist/components/gov-tag.d.ts +11 -0
- package/dist/dist/dist/components/gov-theme-switch.d.ts +11 -0
- package/dist/dist/dist/components/gov-tile.d.ts +11 -0
- package/dist/dist/dist/components/gov-toast.d.ts +11 -0
- package/dist/dist/dist/components/gov-tooltip-content.d.ts +11 -0
- package/dist/dist/dist/components/gov-tooltip.d.ts +11 -0
- package/dist/dist/dist/components/gov-wizard-item.d.ts +11 -0
- package/dist/dist/dist/components/gov-wizard.d.ts +11 -0
- package/dist/dist/dist/components/index.d.ts +35 -0
- package/dist/dist/dist/globals.d.ts +2 -0
- package/dist/dist/dist/hydrate/index.d.ts +287 -0
- package/dist/dist/dist/types/components/gov-accordion/constants.d.ts +19 -0
- package/dist/dist/dist/types/components/gov-accordion/gov-accordion-item.d.ts +43 -0
- package/dist/dist/dist/types/components/gov-accordion/gov-accordion.d.ts +26 -0
- package/dist/dist/dist/types/components/gov-accordion/gov-accordion.types.d.ts +9 -0
- package/dist/dist/dist/types/components/gov-attachments/constants.d.ts +11 -0
- package/dist/dist/dist/types/components/gov-attachments/gov-attachments-item.d.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-attachments/gov-attachments-item.d.ts +24 -0
- package/dist/dist/dist/types/components/gov-attachments/gov-attachments.d.ts +19 -0
- package/dist/dist/dist/types/components/gov-backdrop/constants.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-backdrop/gov-backdrop.d.ts +32 -0
- package/dist/dist/dist/types/components/gov-banner/constants.d.ts +26 -0
- package/dist/dist/dist/types/components/gov-banner/gov-banner.d.ts +28 -0
- package/dist/dist/dist/types/components/gov-blockquote/constants.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-blockquote/gov-blockquote.d.ts +15 -0
- package/dist/dist/dist/types/components/gov-breadcrumbs/constants.d.ts +3 -0
- package/dist/dist/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +42 -0
- package/dist/dist/dist/types/components/gov-button/button/constants.d.ts +29 -0
- package/dist/dist/dist/types/components/gov-button/button/gov-button.d.ts +133 -0
- package/dist/dist/dist/types/components/gov-button/button/gov-button.types.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-button/dropdown/constants.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-button/dropdown/gov-dropdown.d.ts +40 -0
- package/dist/dist/dist/types/components/gov-button/dropdown/gov-dropdown.types.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-card/constants.d.ts +16 -0
- package/dist/dist/dist/types/components/gov-card/gov-card.d.ts +57 -0
- package/dist/dist/dist/types/components/gov-card/interfaces.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-chip/constants.d.ts +21 -0
- package/dist/dist/dist/types/components/gov-chip/gov-chip.d.ts +82 -0
- package/dist/dist/dist/types/components/gov-collapsible/constants.d.ts +18 -0
- package/dist/dist/dist/types/components/gov-collapsible/gov-collapsible.d.ts +36 -0
- package/dist/dist/dist/types/components/gov-container/constants.d.ts +3 -0
- package/dist/dist/dist/types/components/gov-container/gov-container.d.ts +6 -0
- package/dist/dist/dist/types/components/gov-control-group/constants.d.ts +7 -0
- package/dist/dist/dist/types/components/gov-control-group/gov-control-group.d.ts +24 -0
- package/dist/dist/dist/types/components/gov-cookiebar/constants.d.ts +7 -0
- package/dist/dist/dist/types/components/gov-cookiebar/gov-cookiebar.d.ts +7 -0
- package/dist/dist/dist/types/components/gov-dialog/constants.d.ts +11 -0
- package/dist/dist/dist/types/components/gov-dialog/gov-dialog.d.ts +70 -0
- package/dist/dist/dist/types/components/gov-empty/constants.d.ts +19 -0
- package/dist/dist/dist/types/components/gov-empty/gov-empty.d.ts +21 -0
- package/dist/dist/dist/types/components/gov-error-code/constants.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-error-code/gov-error-code.d.ts +6 -0
- package/dist/dist/dist/types/components/gov-flex/constants.d.ts +7 -0
- package/dist/dist/dist/types/components/gov-flex/gov-flex.d.ts +39 -0
- package/dist/dist/dist/types/components/gov-form/autocomplete/autocomplete.utils.d.ts +2 -0
- package/dist/dist/dist/types/components/gov-form/autocomplete/constants.d.ts +11 -0
- package/dist/dist/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +158 -0
- package/dist/dist/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.types.d.ts +9 -0
- package/dist/dist/dist/types/components/gov-form/checkbox/constants.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-form/checkbox/gov-form-checkbox.d.ts +86 -0
- package/dist/dist/dist/types/components/gov-form/checkbox/gov-form-checkbox.types.d.ts +5 -0
- package/dist/dist/dist/types/components/gov-form/control/constants.d.ts +9 -0
- package/dist/dist/dist/types/components/gov-form/control/gov-form-control.d.ts +40 -0
- package/dist/dist/dist/types/components/gov-form/file/constants.d.ts +7 -0
- package/dist/dist/dist/types/components/gov-form/file/gov-form-file.d.ts +130 -0
- package/dist/dist/dist/types/components/gov-form/file/gov-form-file.types.d.ts +11 -0
- package/dist/dist/dist/types/components/gov-form/group/constants.d.ts +18 -0
- package/dist/dist/dist/types/components/gov-form/group/gov-form-checkbox-group.d.ts +32 -0
- package/dist/dist/dist/types/components/gov-form/group/gov-form-group.d.ts +18 -0
- package/dist/dist/dist/types/components/gov-form/group/gov-form-group.types.d.ts +7 -0
- package/dist/dist/dist/types/components/gov-form/group/gov-form-radio-group.d.ts +32 -0
- package/dist/dist/dist/types/components/gov-form/input/constants.d.ts +28 -0
- package/dist/dist/dist/types/components/gov-form/input/gov-form-input.d.ts +178 -0
- package/dist/dist/dist/types/components/gov-form/input/gov-form-input.types.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-form/label/constants.d.ts +8 -0
- package/dist/dist/dist/types/components/gov-form/label/gov-form-label.d.ts +26 -0
- package/dist/dist/dist/types/components/gov-form/message/constants.d.ts +11 -0
- package/dist/dist/dist/types/components/gov-form/message/gov-form-message.d.ts +23 -0
- package/dist/dist/dist/types/components/gov-form/multiselect/constants.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +127 -0
- package/dist/dist/dist/types/components/gov-form/multiselect/gov-form-multi-select.types.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-form/password-power/constants.d.ts +5 -0
- package/dist/dist/dist/types/components/gov-form/password-power/gov-form-password-power.d.ts +7 -0
- package/dist/dist/dist/types/components/gov-form/radio/constants.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-form/radio/gov-form-radio.d.ts +83 -0
- package/dist/dist/dist/types/components/gov-form/radio/gov-form-radio.types.d.ts +5 -0
- package/dist/dist/dist/types/components/gov-form/range/constants.d.ts +9 -0
- package/dist/dist/dist/types/components/gov-form/range/gov-form-range.d.ts +116 -0
- package/dist/dist/dist/types/components/gov-form/search/constants.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-form/search/gov-form-search.d.ts +13 -0
- package/dist/dist/dist/types/components/gov-form/select/constants.d.ts +8 -0
- package/dist/dist/dist/types/components/gov-form/select/gov-form-select.d.ts +89 -0
- package/dist/dist/dist/types/components/gov-form/select/gov-form-select.types.d.ts +9 -0
- package/dist/dist/dist/types/components/gov-form/switch/constants.d.ts +12 -0
- package/dist/dist/dist/types/components/gov-form/switch/gov-form-switch.d.ts +81 -0
- package/dist/dist/dist/types/components/gov-form/switch/gov-form-switch.types.d.ts +5 -0
- package/dist/dist/dist/types/components/gov-grid/constants.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-grid/gov-grid-item.d.ts +46 -0
- package/dist/dist/dist/types/components/gov-grid/gov-grid.d.ts +19 -0
- package/dist/dist/dist/types/components/gov-icon/constants.d.ts +18 -0
- package/dist/dist/dist/types/components/gov-icon/gov-icon.d.ts +34 -0
- package/dist/dist/dist/types/components/gov-icon/helpers.d.ts +6 -0
- package/dist/dist/dist/types/components/gov-icon/list.d.ts +3 -0
- package/dist/dist/dist/types/components/gov-infobar/constants.d.ts +16 -0
- package/dist/dist/dist/types/components/gov-infobar/gov-infobar.d.ts +51 -0
- package/dist/dist/dist/types/components/gov-infobar/gov-infobar.types.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-layout/constants.d.ts +20 -0
- package/dist/dist/dist/types/components/gov-layout/gov-layout-column.d.ts +6 -0
- package/dist/dist/dist/types/components/gov-layout/gov-layout.d.ts +20 -0
- package/dist/dist/dist/types/components/gov-lifecycle-tester/gov-lifecycle-tester.d.ts +14 -0
- package/dist/dist/dist/types/components/gov-link/constants.d.ts +8 -0
- package/dist/dist/dist/types/components/gov-link/gov-link.d.ts +34 -0
- package/dist/dist/dist/types/components/gov-loading/loading/constants.d.ts +9 -0
- package/dist/dist/dist/types/components/gov-loading/loading/gov-loading.d.ts +13 -0
- package/dist/dist/dist/types/components/gov-loading/skeleton/constants.d.ts +21 -0
- package/dist/dist/dist/types/components/gov-loading/skeleton/gov-skeleton.d.ts +46 -0
- package/dist/dist/dist/types/components/gov-message/constants.d.ts +13 -0
- package/dist/dist/dist/types/components/gov-message/gov-message.d.ts +16 -0
- package/dist/dist/dist/types/components/gov-pagination/constants.d.ts +22 -0
- package/dist/dist/dist/types/components/gov-pagination/gov-pagination.d.ts +97 -0
- package/dist/dist/dist/types/components/gov-pagination/gov-pagination.types.d.ts +5 -0
- package/dist/dist/dist/types/components/gov-pagination/pagination.d.ts +12 -0
- package/dist/dist/dist/types/components/gov-spacer/constants.d.ts +15 -0
- package/dist/dist/dist/types/components/gov-spacer/gov-spacer.d.ts +18 -0
- package/dist/dist/dist/types/components/gov-stepper/stepper/constants.d.ts +21 -0
- package/dist/dist/dist/types/components/gov-stepper/stepper/gov-stepper-item.d.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-stepper/stepper/gov-stepper-item.d.ts +31 -0
- package/dist/dist/dist/types/components/gov-stepper/stepper/gov-stepper.d.ts +22 -0
- package/dist/dist/dist/types/components/gov-tabs/constants.d.ts +28 -0
- package/dist/dist/dist/types/components/gov-tabs/gov-tabs-item.d.ts +54 -0
- package/dist/dist/dist/types/components/gov-tabs/gov-tabs.d.ts +70 -0
- package/dist/dist/dist/types/components/gov-tabs/gov-tabs.types.d.ts +14 -0
- package/dist/dist/dist/types/components/gov-tag/constants.d.ts +12 -0
- package/dist/dist/dist/types/components/gov-tag/gov-tag.d.ts +35 -0
- package/dist/dist/dist/types/components/gov-theme-switch/constants.d.ts +12 -0
- package/dist/dist/dist/types/components/gov-theme-switch/gov-theme-switch.d.ts +46 -0
- package/dist/dist/dist/types/components/gov-theme-switch/gov-theme-switch.types.d.ts +10 -0
- package/dist/dist/dist/types/components/gov-tile/constants.d.ts +13 -0
- package/dist/dist/dist/types/components/gov-tile/gov-tile.d.ts +34 -0
- package/dist/dist/dist/types/components/gov-toast/constants.d.ts +17 -0
- package/dist/dist/dist/types/components/gov-toast/gov-toast.d.ts +58 -0
- package/dist/dist/dist/types/components/gov-tooltip/constants.d.ts +20 -0
- package/dist/dist/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +32 -0
- package/dist/dist/dist/types/components/gov-tooltip/gov-tooltip.d.ts +61 -0
- package/dist/dist/dist/types/components/gov-wizard/constants.d.ts +19 -0
- package/dist/dist/dist/types/components/gov-wizard/gov-wizard-item.d.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-wizard/gov-wizard-item.d.ts +60 -0
- package/dist/dist/dist/types/components/gov-wizard/gov-wizard-item.types.d.ts +4 -0
- package/dist/dist/dist/types/components/gov-wizard/gov-wizard.d.ts +35 -0
- package/dist/dist/dist/types/core/constants/colors.d.ts +13 -0
- package/dist/dist/dist/types/core/constants/sizes.d.ts +13 -0
- package/dist/dist/dist/types/core/constants/tags.d.ts +12 -0
- package/dist/dist/dist/types/core/constants/tokens.d.ts +1 -0
- package/dist/dist/dist/types/helpers/Accessibility/accessibility.d.ts +1 -0
- package/dist/dist/dist/types/helpers/Accessibility/attributes.d.ts +1 -0
- package/dist/dist/dist/types/helpers/Dom/attribute.d.ts +13 -0
- package/dist/dist/dist/types/helpers/Dom/document.d.ts +4 -0
- package/dist/dist/dist/types/helpers/Dom/form.d.ts +3 -0
- package/dist/dist/dist/types/helpers/Dom/form.types.d.ts +11 -0
- package/dist/dist/dist/types/helpers/Dom/template.d.ts +10 -0
- package/dist/dist/dist/types/helpers/Dom/template.types.d.ts +14 -0
- package/dist/dist/dist/types/helpers/Dom/win.d.ts +18 -0
- package/dist/dist/dist/types/helpers/Fragment.d.ts +2 -0
- package/dist/dist/dist/types/helpers/Log/gov.log.d.ts +8 -0
- package/dist/dist/dist/types/helpers/Validate/props.d.ts +1 -0
- package/dist/dist/dist/types/helpers/Validate/wcag.d.ts +4 -0
- package/dist/dist/dist/types/index.d.ts +0 -0
- package/dist/dist/dist/types/interfaces.d.ts +1 -0
- package/dist/dist/dist/types/stencil-public-runtime.d.ts +1861 -0
- package/dist/dist/dist/types/types/event.types.d.ts +4 -0
- package/dist/dist/dist/types/types/interfaces.d.ts +2 -0
- package/dist/dist/dist/types/types/typings.d.ts +6 -0
- package/dist/dist/dist/types/utils/array.utils.d.ts +2 -0
- package/dist/dist/dist/types/utils/bool.utils.d.ts +1 -0
- package/dist/dist/dist/types/utils/dom.utils.d.ts +1 -0
- package/dist/dist/dist/types/utils/ds.utils.d.ts +1 -0
- package/dist/dist/dist/types/utils/file.utils.d.ts +3 -0
- package/dist/dist/dist/types/utils/helpers.types.d.ts +49 -0
- package/dist/dist/dist/types/utils/icon.utils.d.ts +4 -0
- package/dist/dist/dist/types/utils/number.utils.d.ts +1 -0
- package/dist/dist/dist/types/utils/object.utils.d.ts +2 -0
- package/dist/dist/dist/types/utils/stencil.utils.d.ts +1 -0
- package/dist/dist/dist/types/utils/string.utils.d.ts +4 -0
- package/dist/dist/dist/types/utils/utils.d.ts +20 -0
- package/dist/dist/globals.d.ts +2 -0
- package/dist/dist/hydrate/index.d.ts +287 -0
- package/dist/dist/types/components/gov-accordion/constants.d.ts +19 -0
- package/dist/dist/types/components/gov-accordion/gov-accordion-item.d.ts +43 -0
- package/dist/dist/types/components/gov-accordion/gov-accordion.d.ts +26 -0
- package/dist/dist/types/components/gov-accordion/gov-accordion.types.d.ts +9 -0
- package/dist/dist/types/components/gov-attachments/constants.d.ts +11 -0
- package/dist/dist/types/components/gov-attachments/gov-attachments-item.d.d.ts +4 -0
- package/dist/dist/types/components/gov-attachments/gov-attachments-item.d.ts +24 -0
- package/dist/dist/types/components/gov-attachments/gov-attachments.d.ts +19 -0
- package/dist/dist/types/components/gov-backdrop/constants.d.ts +4 -0
- package/dist/dist/types/components/gov-backdrop/gov-backdrop.d.ts +32 -0
- package/dist/dist/types/components/gov-banner/constants.d.ts +26 -0
- package/dist/dist/types/components/gov-banner/gov-banner.d.ts +28 -0
- package/dist/dist/types/components/gov-blockquote/constants.d.ts +10 -0
- package/dist/dist/types/components/gov-blockquote/gov-blockquote.d.ts +15 -0
- package/dist/dist/types/components/gov-breadcrumbs/constants.d.ts +3 -0
- package/dist/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.d.ts +4 -0
- package/dist/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +42 -0
- package/dist/dist/types/components/gov-button/button/constants.d.ts +29 -0
- package/dist/dist/types/components/gov-button/button/gov-button.d.ts +133 -0
- package/dist/dist/types/components/gov-button/button/gov-button.types.d.ts +4 -0
- package/dist/dist/types/components/gov-button/dropdown/constants.d.ts +10 -0
- package/dist/dist/types/components/gov-button/dropdown/gov-dropdown.d.ts +40 -0
- package/dist/dist/types/components/gov-button/dropdown/gov-dropdown.types.d.ts +4 -0
- package/dist/dist/types/components/gov-card/constants.d.ts +16 -0
- package/dist/dist/types/components/gov-card/gov-card.d.ts +57 -0
- package/dist/dist/types/components/gov-card/interfaces.d.ts +4 -0
- package/dist/dist/types/components/gov-chip/constants.d.ts +21 -0
- package/dist/dist/types/components/gov-chip/gov-chip.d.ts +82 -0
- package/dist/dist/types/components/gov-collapsible/constants.d.ts +18 -0
- package/dist/dist/types/components/gov-collapsible/gov-collapsible.d.ts +36 -0
- package/dist/dist/types/components/gov-container/constants.d.ts +3 -0
- package/dist/dist/types/components/gov-container/gov-container.d.ts +6 -0
- package/dist/dist/types/components/gov-control-group/constants.d.ts +7 -0
- package/dist/dist/types/components/gov-control-group/gov-control-group.d.ts +24 -0
- package/dist/dist/types/components/gov-cookiebar/constants.d.ts +7 -0
- package/dist/dist/types/components/gov-cookiebar/gov-cookiebar.d.ts +7 -0
- package/dist/dist/types/components/gov-dialog/constants.d.ts +11 -0
- package/dist/dist/types/components/gov-dialog/gov-dialog.d.ts +70 -0
- package/dist/dist/types/components/gov-empty/constants.d.ts +19 -0
- package/dist/dist/types/components/gov-empty/gov-empty.d.ts +21 -0
- package/dist/dist/types/components/gov-error-code/constants.d.ts +4 -0
- package/dist/dist/types/components/gov-error-code/gov-error-code.d.ts +6 -0
- package/dist/dist/types/components/gov-flex/constants.d.ts +7 -0
- package/dist/dist/types/components/gov-flex/gov-flex.d.ts +39 -0
- package/dist/dist/types/components/gov-form/autocomplete/autocomplete.utils.d.ts +2 -0
- package/dist/dist/types/components/gov-form/autocomplete/constants.d.ts +11 -0
- package/dist/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +158 -0
- package/dist/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.types.d.ts +9 -0
- package/dist/dist/types/components/gov-form/checkbox/constants.d.ts +10 -0
- package/dist/dist/types/components/gov-form/checkbox/gov-form-checkbox.d.ts +86 -0
- package/dist/dist/types/components/gov-form/checkbox/gov-form-checkbox.types.d.ts +5 -0
- package/dist/dist/types/components/gov-form/control/constants.d.ts +9 -0
- package/dist/dist/types/components/gov-form/control/gov-form-control.d.ts +40 -0
- package/dist/dist/types/components/gov-form/file/constants.d.ts +7 -0
- package/dist/dist/types/components/gov-form/file/gov-form-file.d.ts +130 -0
- package/dist/dist/types/components/gov-form/file/gov-form-file.types.d.ts +11 -0
- package/dist/dist/types/components/gov-form/group/constants.d.ts +18 -0
- package/dist/dist/types/components/gov-form/group/gov-form-checkbox-group.d.ts +32 -0
- package/dist/dist/types/components/gov-form/group/gov-form-group.d.ts +18 -0
- package/dist/dist/types/components/gov-form/group/gov-form-group.types.d.ts +7 -0
- package/dist/dist/types/components/gov-form/group/gov-form-radio-group.d.ts +32 -0
- package/dist/dist/types/components/gov-form/input/constants.d.ts +28 -0
- package/dist/dist/types/components/gov-form/input/gov-form-input.d.ts +178 -0
- package/dist/dist/types/components/gov-form/input/gov-form-input.types.d.ts +4 -0
- package/dist/dist/types/components/gov-form/label/constants.d.ts +8 -0
- package/dist/dist/types/components/gov-form/label/gov-form-label.d.ts +26 -0
- package/dist/dist/types/components/gov-form/message/constants.d.ts +11 -0
- package/dist/dist/types/components/gov-form/message/gov-form-message.d.ts +23 -0
- package/dist/dist/types/components/gov-form/multiselect/constants.d.ts +10 -0
- package/dist/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +127 -0
- package/dist/dist/types/components/gov-form/multiselect/gov-form-multi-select.types.d.ts +10 -0
- package/dist/dist/types/components/gov-form/password-power/constants.d.ts +5 -0
- package/dist/dist/types/components/gov-form/password-power/gov-form-password-power.d.ts +7 -0
- package/dist/dist/types/components/gov-form/radio/constants.d.ts +10 -0
- package/dist/dist/types/components/gov-form/radio/gov-form-radio.d.ts +83 -0
- package/dist/dist/types/components/gov-form/radio/gov-form-radio.types.d.ts +5 -0
- package/dist/dist/types/components/gov-form/range/constants.d.ts +9 -0
- package/dist/dist/types/components/gov-form/range/gov-form-range.d.ts +116 -0
- package/dist/dist/types/components/gov-form/search/constants.d.ts +10 -0
- package/dist/dist/types/components/gov-form/search/gov-form-search.d.ts +13 -0
- package/dist/dist/types/components/gov-form/select/constants.d.ts +8 -0
- package/dist/dist/types/components/gov-form/select/gov-form-select.d.ts +89 -0
- package/dist/dist/types/components/gov-form/select/gov-form-select.types.d.ts +9 -0
- package/dist/dist/types/components/gov-form/switch/constants.d.ts +12 -0
- package/dist/dist/types/components/gov-form/switch/gov-form-switch.d.ts +81 -0
- package/dist/dist/types/components/gov-form/switch/gov-form-switch.types.d.ts +5 -0
- package/dist/dist/types/components/gov-grid/constants.d.ts +10 -0
- package/dist/dist/types/components/gov-grid/gov-grid-item.d.ts +46 -0
- package/dist/dist/types/components/gov-grid/gov-grid.d.ts +19 -0
- package/dist/dist/types/components/gov-icon/constants.d.ts +18 -0
- package/dist/dist/types/components/gov-icon/gov-icon.d.ts +34 -0
- package/dist/dist/types/components/gov-icon/helpers.d.ts +6 -0
- package/dist/dist/types/components/gov-icon/list.d.ts +3 -0
- package/dist/dist/types/components/gov-infobar/constants.d.ts +16 -0
- package/dist/dist/types/components/gov-infobar/gov-infobar.d.ts +51 -0
- package/dist/dist/types/components/gov-infobar/gov-infobar.types.d.ts +4 -0
- package/dist/dist/types/components/gov-layout/constants.d.ts +20 -0
- package/dist/dist/types/components/gov-layout/gov-layout-column.d.ts +6 -0
- package/dist/dist/types/components/gov-layout/gov-layout.d.ts +20 -0
- package/dist/dist/types/components/gov-lifecycle-tester/gov-lifecycle-tester.d.ts +14 -0
- package/dist/dist/types/components/gov-link/constants.d.ts +8 -0
- package/dist/dist/types/components/gov-link/gov-link.d.ts +34 -0
- package/dist/dist/types/components/gov-loading/loading/constants.d.ts +9 -0
- package/dist/dist/types/components/gov-loading/loading/gov-loading.d.ts +13 -0
- package/dist/dist/types/components/gov-loading/skeleton/constants.d.ts +21 -0
- package/dist/dist/types/components/gov-loading/skeleton/gov-skeleton.d.ts +46 -0
- package/dist/dist/types/components/gov-message/constants.d.ts +13 -0
- package/dist/dist/types/components/gov-message/gov-message.d.ts +16 -0
- package/dist/dist/types/components/gov-pagination/constants.d.ts +22 -0
- package/dist/dist/types/components/gov-pagination/gov-pagination.d.ts +97 -0
- package/dist/dist/types/components/gov-pagination/gov-pagination.types.d.ts +5 -0
- package/dist/dist/types/components/gov-pagination/pagination.d.ts +12 -0
- package/dist/dist/types/components/gov-spacer/constants.d.ts +15 -0
- package/dist/dist/types/components/gov-spacer/gov-spacer.d.ts +18 -0
- package/dist/dist/types/components/gov-stepper/stepper/constants.d.ts +21 -0
- package/dist/dist/types/components/gov-stepper/stepper/gov-stepper-item.d.d.ts +4 -0
- package/dist/dist/types/components/gov-stepper/stepper/gov-stepper-item.d.ts +31 -0
- package/dist/dist/types/components/gov-stepper/stepper/gov-stepper.d.ts +22 -0
- package/dist/dist/types/components/gov-tabs/constants.d.ts +28 -0
- package/dist/dist/types/components/gov-tabs/gov-tabs-item.d.ts +54 -0
- package/dist/dist/types/components/gov-tabs/gov-tabs.d.ts +70 -0
- package/dist/dist/types/components/gov-tabs/gov-tabs.types.d.ts +14 -0
- package/dist/dist/types/components/gov-tag/constants.d.ts +12 -0
- package/dist/dist/types/components/gov-tag/gov-tag.d.ts +35 -0
- package/dist/dist/types/components/gov-theme-switch/constants.d.ts +12 -0
- package/dist/dist/types/components/gov-theme-switch/gov-theme-switch.d.ts +46 -0
- package/dist/dist/types/components/gov-theme-switch/gov-theme-switch.types.d.ts +10 -0
- package/dist/dist/types/components/gov-tile/constants.d.ts +13 -0
- package/dist/dist/types/components/gov-tile/gov-tile.d.ts +34 -0
- package/dist/dist/types/components/gov-toast/constants.d.ts +17 -0
- package/dist/dist/types/components/gov-toast/gov-toast.d.ts +58 -0
- package/dist/dist/types/components/gov-tooltip/constants.d.ts +20 -0
- package/dist/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +32 -0
- package/dist/dist/types/components/gov-tooltip/gov-tooltip.d.ts +61 -0
- package/dist/dist/types/components/gov-wizard/constants.d.ts +19 -0
- package/dist/dist/types/components/gov-wizard/gov-wizard-item.d.d.ts +4 -0
- package/dist/dist/types/components/gov-wizard/gov-wizard-item.d.ts +60 -0
- package/dist/dist/types/components/gov-wizard/gov-wizard-item.types.d.ts +4 -0
- package/dist/dist/types/components/gov-wizard/gov-wizard.d.ts +35 -0
- package/dist/dist/types/core/constants/colors.d.ts +13 -0
- package/dist/dist/types/core/constants/sizes.d.ts +13 -0
- package/dist/dist/types/core/constants/tags.d.ts +12 -0
- package/dist/dist/types/core/constants/tokens.d.ts +1 -0
- package/dist/dist/types/helpers/Accessibility/accessibility.d.ts +1 -0
- package/dist/dist/types/helpers/Accessibility/attributes.d.ts +1 -0
- package/dist/dist/types/helpers/Dom/attribute.d.ts +13 -0
- package/dist/dist/types/helpers/Dom/document.d.ts +4 -0
- package/dist/dist/types/helpers/Dom/form.d.ts +3 -0
- package/dist/dist/types/helpers/Dom/form.types.d.ts +11 -0
- package/dist/dist/types/helpers/Dom/template.d.ts +10 -0
- package/dist/dist/types/helpers/Dom/template.types.d.ts +14 -0
- package/dist/dist/types/helpers/Dom/win.d.ts +18 -0
- package/dist/dist/types/helpers/Fragment.d.ts +2 -0
- package/dist/dist/types/helpers/Log/gov.log.d.ts +8 -0
- package/dist/dist/types/helpers/Validate/props.d.ts +1 -0
- package/dist/dist/types/helpers/Validate/wcag.d.ts +4 -0
- package/dist/dist/types/index.d.ts +0 -0
- package/dist/dist/types/interfaces.d.ts +1 -0
- package/dist/dist/types/stencil-public-runtime.d.ts +1861 -0
- package/dist/dist/types/types/event.types.d.ts +4 -0
- package/dist/dist/types/types/interfaces.d.ts +2 -0
- package/dist/dist/types/types/typings.d.ts +6 -0
- package/dist/dist/types/utils/array.utils.d.ts +2 -0
- package/dist/dist/types/utils/bool.utils.d.ts +1 -0
- package/dist/dist/types/utils/dom.utils.d.ts +1 -0
- package/dist/dist/types/utils/ds.utils.d.ts +1 -0
- package/dist/dist/types/utils/file.utils.d.ts +3 -0
- package/dist/dist/types/utils/helpers.types.d.ts +49 -0
- package/dist/dist/types/utils/icon.utils.d.ts +4 -0
- package/dist/dist/types/utils/number.utils.d.ts +1 -0
- package/dist/dist/types/utils/object.utils.d.ts +2 -0
- package/dist/dist/types/utils/stencil.utils.d.ts +1 -0
- package/dist/dist/types/utils/string.utils.d.ts +4 -0
- package/dist/dist/types/utils/utils.d.ts +20 -0
- package/dist/esm/gov-flex_3.entry.js +1 -1
- package/dist/hydrate/index.js +1 -1
- package/dist/hydrate/index.mjs +1 -1
- package/dist/types/components.d.ts +119 -592
- package/dist/types/stencil-public-runtime.d.ts +11 -170
- package/package.json +28 -32
- package/dist/components/p-DRXiDAHW.js +0 -2
- package/dist/core/p-0675617d.entry.js +0 -2
- package/dist/core/p-2e15a654.entry.js +0 -2
- package/dist/core/p-41bef63a.entry.js +0 -2
- package/dist/core/p-6638d034.entry.js +0 -2
- package/dist/core/p-943a58b2.entry.js +0 -2
- package/dist/core/p-B8TR1oqt.js +0 -3
- package/dist/core/p-B8TR1oqt.js.map +0 -1
- package/dist/core/p-a4fa2ffc.entry.js +0 -2
- package/dist/core/p-a7c322a7.entry.js +0 -2
- package/dist/core/p-b181f85f.entry.js +0 -2
- package/dist/core/p-dc0bd1e5.entry.js +0 -2
- package/readme.md +0 -8
- /package/dist/components/{p-isPjiQbr.js.map → p-BIB-JMbL.js.map} +0 -0
- /package/dist/components/{p-BICk4EuO.js.map → p-BVG9PtuQ.js.map} +0 -0
- /package/dist/components/{p-DmK9qaKH.js.map → p-DV0Pdd1S.js.map} +0 -0
- /package/dist/components/{p-DjGO_trZ.js.map → p-DlpZtTcv.js.map} +0 -0
- /package/dist/components/{p-BNoNH6m-.js.map → p-Dw1o8KoZ.js.map} +0 -0
- /package/dist/components/{p-BGK46VRO.js.map → p-NU_8kxGz.js.map} +0 -0
- /package/dist/components/{p-ClDhNt_H.js.map → p-o4vVG5sG.js.map} +0 -0
- /package/dist/core/{p-f515d912.entry.js.map → p-5c872d64.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FormFileClass","root","area","input","inputFocus","attachments","formatBytes","bytes","units","l","n","parseInt","toFixed","fileAcceptValidation","file","accept","trim","length","fileName","name","toLowerCase","fileType","type","split","map","token","filter","some","startsWith","endsWith","group","slice","indexOf","fileSizeValidation","maxSize","fileSize","Math","round","size","GovFormFile","constructor","hostRef","this","eventsRegistered","expanded","required","disabled","resetAfterPick","ignoreFileDuplicationCheck","displayAttachments","multiple","maxFileSize","errorSize","errorAccept","accessibleAttachmentsLabel","files","inheritedAttributes","fileId","createID","h","govHost","host","f","govForm","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","invalid","registerListeners","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","target","validateFiles","events","inEvents","outEvents","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","filesBuffer","incoming","Array","from","isFile","find","item","isSizeValid","isAcceptValid","newFile","id","acceptValid","sizeValid","govAddFile","emit","component","syncNativeInputFiles","govFiles","reset","finally","DataTransfer","dt","items","process","env","componentDidLoad","attributeObserver","AttributeObserver","attributeName","newValue","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","passAttrToLabel","String","inheritAriaAttributes","componentDidRender","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","Host","key","class","classes","toBoolAttrIfDefined","ref","el","identifier","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","hasSlot","label","onRemoveFileHandler","slot","color","replace","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","getRef","getAreaRef","value"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tinput: 'gov-form-file__input',\n\tinputFocus: 'gov-form-file__input-focus',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\n// Validates a file against an `accept` attribute value, following the HTML spec\n// (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept):\n// - \".ext\" → matched against the file NAME suffix (case-insensitive)\n// - \"type/*\" → matched against the file MIME group\n// - \"type/sub\" → exact MIME match\n// Matching the name (not only file.type) is essential: browsers often report an\n// empty or non-standard MIME for extensions like .jsonld, which the previous\n// MIME-only RegExp check always rejected.\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept !== 'string' || accept.trim().length === 0) {\n\t\treturn true\n\t}\n\tconst fileName = file.name.toLowerCase()\n\tconst fileType = (file.type || '').toLowerCase()\n\treturn accept\n\t\t.split(',')\n\t\t.map(token => token.trim().toLowerCase())\n\t\t.filter(token => token.length > 0)\n\t\t.some(token => {\n\t\t\tif (token.startsWith('.')) {\n\t\t\t\treturn fileName.endsWith(token)\n\t\t\t}\n\t\t\tif (token === '*' || token === '*/*') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (token.endsWith('/*')) {\n\t\t\t\tconst group = token.slice(0, token.indexOf('/') + 1)\n\t\t\t\treturn fileType.startsWith(group)\n\t\t\t}\n\t\t\treturn fileType === token\n\t\t})\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","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"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AA,oBAAkB+F,KAAK,UAAUC,MAAM,SACtChG,EAAA,YAAU+F,KAAK,OAAOvI,KAAK,4BAA4BG,KAAK,eAC3DoB,KAAKU,UAAUwG,QAAQ,cAAetJ,EAAYoC,KAAKS,eAEtD,KACJQ,EAAA,QAAM+F,KAAK,QAAM,IAAGpJ,EAAY4F,EAAKpF,KAAKwB,MAAK,UAKhD,K,CAKC,mBAAAmH,CAAoB3I,GAC3B,MAAM+I,EAAQnH,KAAKa,MAAMuG,WAAU5D,GAAQA,EAAKI,KAAOxF,EAAKwF,KAC5D,GAAIuD,KAAU,EAAI,CACjB,MAAMtG,EAAQb,KAAKa,MACnB,MAAMwG,EAAarH,KAAKa,MAAMsG,GAC9BtG,EAAMyG,OAAOH,EAAO,GACpBnH,KAAKa,MAAQ,IAAIA,GACjBb,KAAKkE,uBACLlE,KAAKuH,cAAcvD,KAAK,CACvBC,UAAW3G,EAAcC,KACzBa,KAAMiJ,IAEPrH,KAAKmE,SAASH,KAAK,CAClBC,UAAW3G,EAAcC,KACzBsD,S,EAKK,cAAA6F,CAAetE,GACtBA,EAAEE,kBACFtC,KAAKwH,SAASxD,KAAK,CAClBC,UAAW3G,EAAcC,KACzBkK,cAAerF,G,CAIT,aAAAwE,CAAcxE,GACrBA,EAAEE,kBACFtC,KAAK0H,QAAQ1D,KAAK,CACjBC,UAAW3G,EAAcC,KACzBkK,cAAerF,G,CAIT,eAAAoE,CAAgBpE,GACvBA,EAAEE,iB,CAOH,YAAMqF,GACL,OAAO3H,KAAKkC,Q,CAOb,gBAAM0F,GACL,OAAO5H,KAAK6B,O,CAOb,WAAMuC,GACLpE,KAAKa,MAAQ,GACb,GAAIb,KAAKkC,SAAU,CAClBlC,KAAKkC,SAAS2F,MAAQ,GACtB7H,KAAKkE,sB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["FormFileClass","root","area","input","inputFocus","attachments","formatBytes","bytes","units","l","n","parseInt","toFixed","fileAcceptValidation","file","accept","trim","length","fileName","name","toLowerCase","fileType","type","split","map","token","filter","some","startsWith","endsWith","group","slice","indexOf","fileSizeValidation","maxSize","fileSize","Math","round","size","GovFormFile","constructor","hostRef","this","eventsRegistered","expanded","required","disabled","resetAfterPick","ignoreFileDuplicationCheck","displayAttachments","multiple","maxFileSize","errorSize","errorAccept","accessibleAttachmentsLabel","files","inheritedAttributes","fileId","createID","h","govHost","host","f","govForm","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","invalid","registerListeners","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","target","validateFiles","events","inEvents","outEvents","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","filesBuffer","incoming","Array","from","isFile","find","item","isSizeValid","isAcceptValid","newFile","id","acceptValid","sizeValid","govAddFile","emit","component","syncNativeInputFiles","govFiles","reset","finally","DataTransfer","dt","items","process","env","componentDidLoad","attributeObserver","AttributeObserver","attributeName","newValue","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","passAttrToLabel","String","inheritAriaAttributes","componentDidRender","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","Host","key","class","classes","toBoolAttrIfDefined","ref","el","identifier","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","hasSlot","label","onRemoveFileHandler","slot","color","replace","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","getRef","getAreaRef","value"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tinput: 'gov-form-file__input',\n\tinputFocus: 'gov-form-file__input-focus',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\n// Validates a file against an `accept` attribute value, following the HTML spec\n// (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept):\n// - \".ext\" → matched against the file NAME suffix (case-insensitive)\n// - \"type/*\" → matched against the file MIME group\n// - \"type/sub\" → exact MIME match\n// Matching the name (not only file.type) is essential: browsers often report an\n// empty or non-standard MIME for extensions like .jsonld, which the previous\n// MIME-only RegExp check always rejected.\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept !== 'string' || accept.trim().length === 0) {\n\t\treturn true\n\t}\n\tconst fileName = file.name.toLowerCase()\n\tconst fileType = (file.type || '').toLowerCase()\n\treturn accept\n\t\t.split(',')\n\t\t.map(token => token.trim().toLowerCase())\n\t\t.filter(token => token.length > 0)\n\t\t.some(token => {\n\t\t\tif (token.startsWith('.')) {\n\t\t\t\treturn fileName.endsWith(token)\n\t\t\t}\n\t\t\tif (token === '*' || token === '*/*') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (token.endsWith('/*')) {\n\t\t\t\tconst group = token.slice(0, token.indexOf('/') + 1)\n\t\t\t\treturn fileType.startsWith(group)\n\t\t\t}\n\t\t\treturn fileType === token\n\t\t})\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","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"],"mappings":"oZAAO,MAAMA,EAAgB,CAC5BC,KAAM,gBACNC,KAAM,sBACNC,MAAO,uBACPC,WAAY,6BACZC,YAAa,8BCLR,SAAUC,EAAYC,GAC3B,MAAMC,EAAQ,CAAC,QAAS,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OACzE,IAAIC,EAAI,EACPC,EAAIC,SAASJ,EAAO,KAAO,EAE5B,MAAOG,GAAK,QAAUD,EAAG,CACxBC,EAAIA,EAAI,I,CAGT,OAAOA,EAAEE,QAAQF,EAAI,IAAMD,EAAI,EAAI,EAAI,GAAK,IAAMD,EAAMC,EACzD,CAUgB,SAAAI,EAAqBC,EAAYC,GAChD,UAAWA,IAAW,UAAYA,EAAOC,OAAOC,SAAW,EAAG,CAC7D,OAAO,I,CAER,MAAMC,EAAWJ,EAAKK,KAAKC,cAC3B,MAAMC,GAAYP,EAAKQ,MAAQ,IAAIF,cACnC,OAAOL,EACLQ,MAAM,KACNC,KAAIC,GAASA,EAAMT,OAAOI,gBAC1BM,QAAOD,GAASA,EAAMR,OAAS,IAC/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EAAEE,kBACFtC,KAAKwH,SAASxD,KAAK,CAClBC,UAAW3G,EAAcC,KACzBkK,cAAerF,G,CAIT,aAAAwE,CAAcxE,GACrBA,EAAEE,kBACFtC,KAAK0H,QAAQ1D,KAAK,CACjBC,UAAW3G,EAAcC,KACzBkK,cAAerF,G,CAIT,eAAAoE,CAAgBpE,GACvBA,EAAEE,iB,CAOH,YAAMqF,GACL,OAAO3H,KAAKkC,Q,CAOb,gBAAM0F,GACL,OAAO5H,KAAK6B,O,CAOb,WAAMuC,GACLpE,KAAKa,MAAQ,GACb,GAAIb,KAAKkC,SAAU,CAClBlC,KAAKkC,SAAS2F,MAAQ,GACtB7H,KAAKkE,sB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as h,g as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,H as h,g as e}from"./p-ClISz4NF.js";import{c as a}from"./p-vN03FcXN.js";import{v as r}from"./p-NOJjz9dT.js";import{g as o,e as n,f as l}from"./p-B6CqPcY_.js";import{g as c,a as d,t as p}from"./p-CoD1xawt.js";import{F as m}from"./p-5itQzbON.js";import{A as u,a as v}from"./p-Bz_RzYFb.js";import{i as f}from"./p-CzXeijOj.js";import"./p-CgDnDrq5.js";import"./p-CQvUntGY.js";import"./p-BcQO4NH2.js";import"./p-EeKNA85D.js";import"./p-U40vKHrs.js";import"./p-DYcNEwSZ.js";import"./p-DBXGhafv.js";const j=class{constructor(i){t(this,i);this.govFocus=s(this,"gov-focus");this.govBlur=s(this,"gov-blur");this.govChange=s(this,"gov-change");this.hydrated=false;this.noLabel=false;this.checked=false;this.required=false;this.disabled=false;this.size="m";this.inheritedAttributes={};this.radioId=a("GovRadio");this.h=c(this.host);this.f=o(this.h)}validateSize(t){r(l,t,n.root)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",d(this.invalid));this.f.passAttrToControl("disabled",d(this.disabled));this.f.passAttrToControl("type","radio")}componentWillLoad(){this.inheritedAttributes=f(this.host)}componentDidLoad(){this.attributeObserver=new u(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(v)}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.radioId);this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs()}connectedCallback(){this.hydrated=true}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){const t=t=>{if(this.noLabel){return i("label",{class:n.label},t)}return t};return i(h,{class:n.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:p(this.invalid)},t(i(m,null,i("input",Object.assign({class:n.input,id:this.identifier||this.radioId,type:"radio",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),ref:t=>this.inputRef=t,required:this.required},this.inheritedAttributes,{"aria-checked":this.checked,"aria-required":p(this.required),"aria-invalid":p(this.invalid),"aria-disabled":p(this.disabled)})),i("span",null,i("slot",{name:"label"})))))}onClickHandler(t){t.stopPropagation()}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:t})}onChangeHandler(t){this.checked=t.target.checked;t.stopPropagation();this.govChange.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:t})}async getRef(){return this.inputRef}get host(){return e(this)}static get watchers(){return{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}};export{j as gov_form_radio};
|
|
2
|
+
//# sourceMappingURL=p-46824842.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovFormRadio","constructor","hostRef","this","hydrated","noLabel","checked","required","disabled","size","inheritedAttributes","radioId","createID","h","govHost","host","f","govForm","validateSize","newValue","validateProp","FormRadioSizes","FormRadioClass","root","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","invalid","componentWillLoad","inheritAriaAttributes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentDidRender","passAttrToLabel","identifier","String","connectedCallback","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","wrapRadio","children","class","label","Host","toBoolAttrIfDefined","Fragment","input","id","type","value","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","ref","el","inputRef","e","stopPropagation","govFocus","emit","component","originalEvent","govBlur","target","govChange","getRef"],"sources":["../../../packages/core/src/components/gov-form/radio/gov-form-radio.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormRadioClass, FormRadioSizes, FormRadioSizesType} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport {FormRadioEvent} from \"./gov-form-radio.types\"\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-radio\",\n})\nexport class GovFormRadio {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly radioId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.radioId = createID(\"GovRadio\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormRadioElement\n\t/**\n\t * Value of radio\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({attribute: \"no-label\"}) readonly noLabel: boolean = false\n\t/**\n\t * Radio button state\n\t */\n\t@Prop({reflect: true, mutable: true}) checked = 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 radio component disabled.\n\t * This prevents users from being able to interact with the radio, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Name of the radio.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Radio's size.\n\t */\n\t@Prop() readonly size?: FormRadioSizesType = \"m\"\n\t/**\n\t * Custom radio 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 * Emitted when the radio has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormRadioEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRadioSizes, newValue, FormRadioClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\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(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"radio\")\n\t}\n\n\n\tcomponentWillLoad() {\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\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\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.radioId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\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\tconst wrapRadio = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn <label class={FormRadioClass.label}>{children}</label>\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormRadioClass.root} hydrated={this.hydrated} checked={this.checked} size={this.size}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapRadio(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclass={FormRadioClass.input}\n\t\t\t\t\t\t\tid={this.identifier || this.radioId}\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\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: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\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"],"mappings":"6gBAiBaA,EAAY,MASxB,WAAAC,CAAAC,G,gHAFQC,KAAAC,SAAW,MAiBqBD,KAAAE,QAAmB,MAIrBF,KAAAG,QAAU,MAK/BH,KAAAI,SAAoB,MAKLJ,KAAAK,SAAoB,MAQnCL,KAAAM,KAA4B,IAkCpCN,KAAAO,oBAAkC,GAtE1CP,KAAKQ,QAAUC,EAAS,YAExBT,KAAKU,EAAIC,EAAQX,KAAKY,MACtBZ,KAAKa,EAAIC,EAAQd,KAAKU,EACtB,CAuDD,YAAAK,CAAaC,GACZC,EAAaC,EAAgBF,EAAUG,EAAeC,K,CAMvD,iBAAAC,GACCrB,KAAKsB,kB,CAKE,gBAAAA,GACPtB,KAAKa,EAAEU,kBAAkB,OAAQvB,KAAKM,MACtCN,KAAKa,EAAEU,kBAAkB,UAAWC,EAAWxB,KAAKyB,UACpDzB,KAAKa,EAAEU,kBAAkB,WAAYC,EAAWxB,KAAKK,WACrDL,KAAKa,EAAEU,kBAAkB,OAAQ,Q,CAIlC,iBAAAG,GACC1B,KAAKO,oBAAsBoB,EAAsB3B,KAAKY,K,CAGvD,gBAAAgB,GACC5B,KAAK6B,kBAAoB,IAAIC,EAAkB9B,KAAKY,MAAM,CAACmB,EAAef,KACzEhB,KAAKgC,sBAAsBD,EAAef,EAAS,IAGpDhB,KAAK6B,kBAAkBI,eAAeC,E,CAGvC,wBAAMC,GACLnC,KAAKa,EAAEuB,gBAAgB,aAAcpC,KAAKqC,YAAcrC,KAAKQ,SAC7DR,KAAKa,EAAEuB,gBAAgB,WAA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ACCA,EAAA,QAAMgD,KAAK,a,CAQT,cAAAE,CAAeW,GACtBA,EAAEC,iB,CAGK,cAAAP,CAAeM,GACtBA,EAAEC,kBACFxE,KAAKyE,SAASC,KAAK,CAClBC,UAAWxD,EAAeC,KAC1BqC,MAAOzD,KAAKyD,MACZtD,QAASH,KAAKG,QACdyE,cAAeL,G,CAIT,aAAAJ,CAAcI,GACrBA,EAAEC,kBACFxE,KAAK6E,QAAQH,KAAK,CACjBC,UAAWxD,EAAeC,KAC1BqC,MAAOzD,KAAKyD,MACZtD,QAASH,KAAKG,QACdyE,cAAeL,G,CAIT,eAAAR,CAAgBQ,GACvBvE,KAAKG,QAAWoE,EAAEO,OAA4B3E,QAC9CoE,EAAEC,kBACFxE,KAAK+E,UAAUL,KAAK,CACnBC,UAAWxD,EAAeC,KAC1BqC,MAAOzD,KAAKyD,MACZtD,QAASH,KAAKG,QACdyE,cAAeL,G,CAQjB,YAAMS,GACL,OAAOhF,KAAKsE,Q","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["GovFormRadio","constructor","hostRef","this","hydrated","noLabel","checked","required","disabled","size","inheritedAttributes","radioId","createID","h","govHost","host","f","govForm","validateSize","newValue","validateProp","FormRadioSizes","FormRadioClass","root","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","invalid","componentWillLoad","inheritAriaAttributes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentDidRender","passAttrToLabel","identifier","String","connectedCallback","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","wrapRadio","children","class","label","Host","toBoolAttrIfDefined","Fragment","input","id","type","value","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","ref","el","inputRef","e","stopPropagation","govFocus","emit","component","originalEvent","govBlur","target","govChange","getRef"],"sources":["../../../packages/core/src/components/gov-form/radio/gov-form-radio.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormRadioClass, FormRadioSizes, FormRadioSizesType} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport {FormRadioEvent} from \"./gov-form-radio.types\"\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-radio\",\n})\nexport class GovFormRadio {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly radioId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.radioId = createID(\"GovRadio\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormRadioElement\n\t/**\n\t * Value of radio\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({attribute: \"no-label\"}) readonly noLabel: boolean = false\n\t/**\n\t * Radio button state\n\t */\n\t@Prop({reflect: true, mutable: true}) checked = 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 radio component disabled.\n\t * This prevents users from being able to interact with the radio, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Name of the radio.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Radio's size.\n\t */\n\t@Prop() readonly size?: FormRadioSizesType = \"m\"\n\t/**\n\t * Custom radio 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 * Emitted when the radio has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormRadioEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRadioSizes, newValue, FormRadioClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\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(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"radio\")\n\t}\n\n\n\tcomponentWillLoad() {\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\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\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.radioId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\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\tconst wrapRadio = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn <label class={FormRadioClass.label}>{children}</label>\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormRadioClass.root} hydrated={this.hydrated} checked={this.checked} size={this.size}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapRadio(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclass={FormRadioClass.input}\n\t\t\t\t\t\t\tid={this.identifier || this.radioId}\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\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: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\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"],"mappings":"6gBAiBaA,EAAY,MASxB,WAAAC,CAAAC,G,gHAFQC,KAAQC,SAAG,MAiBqBD,KAAOE,QAAY,MAIrBF,KAAOG,QAAG,MAK/BH,KAAQI,SAAY,MAKLJ,KAAQK,SAAY,MAQnCL,KAAIM,KAAwB,IAkCpCN,KAAmBO,oBAAe,GAtE1CP,KAAKQ,QAAUC,EAAS,YAExBT,KAAKU,EAAIC,EAAQX,KAAKY,MACtBZ,KAAKa,EAAIC,EAAQd,KAAKU,EACtB,CAuDD,YAAAK,CAAaC,GACZC,EAAaC,EAAgBF,EAAUG,EAAe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
|
1
|
-
import{r as t,h as e,F as s,H as i,g as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e,F as s,H as i,g as o}from"./p-ClISz4NF.js";import{p as a}from"./p-CQvUntGY.js";import{S as n}from"./p-BcQO4NH2.js";import{g as c}from"./p-CoD1xawt.js";a(n,["_S","_M","_L"]);const l={root:"gov-tile",link:"gov-tile__link",content:"gov-tile__content",text:"gov-tile__text",title:"gov-tile__title",icon:"gov-tile__icon",annotation:"gov-tile__annotation"};const f=class{constructor(e){t(this,e);this.size="m";this.noBorder=false;this.h=c(this.host)}render(){return e(i,{key:"675f324a6b643d22ae4b737f2049f0f1a51e4972",class:this.h.classes(l.root),size:this.size,orientation:this.orientation,clickable:this.href?true:null},e("slot",{key:"4dc974090359d27cd89e7b7af38f56fd016608d5",name:"icon"}),e("div",{key:"9d3c42f854fe4178886d6218cc99de44c6a27335",class:l.content},e("div",{key:"97891e205f08b2b4c81110bcb7bb3c4ed48362ed",class:l.text},e("div",{key:"6446384bd51f13aff4b9ff0144a4240fe1465b8d",class:l.title},this.href?e(s,null,e("a",{href:this.href,target:this.target,class:l.link,ref:t=>this.triggerRef=t},e("slot",{name:"title"})),e("span",{class:l.icon},e("gov-icon",{name:"chevron-right",type:"components"}))):e("slot",{name:"title"})),e("div",{key:"e25fe83f7f147582005341bb951ac2221bebbfbf",class:`${l.annotation} ${this.href?`${l.annotation}--padding`:""}`},e("slot",{key:"5c87e54b826d3e4fbb8231c19e66db7961e63a60"}))),e("slot",{key:"ab53f48d63dbc279788e4f83d77beb7eaabc1425",name:"button"})))}async getTriggerRef(){return this.triggerRef}get host(){return o(this)}};export{f as gov_tile};
|
|
2
|
+
//# sourceMappingURL=p-4c02094d.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["pick","Sizes","TileClass","root","link","content","text","title","icon","annotation","GovTile","constructor","hostRef","this","size","noBorder","h","govHost","host","render","Host","key","class","classes","orientation","clickable","href","name","Fragment","target","ref","el","triggerRef","type","getTriggerRef"],"sources":["../../../packages/core/src/components/gov-tile/constants.ts","../../../packages/core/src/components/gov-tile/gov-tile.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const TileSizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type TileSizesType = `${ValueOf<typeof TileSizes>}`\n\nexport const TileClass = {\n\troot: 'gov-tile',\n\tlink: 'gov-tile__link',\n\tcontent: 'gov-tile__content',\n\ttext: 'gov-tile__text',\n\ttitle: 'gov-tile__title',\n\ticon: 'gov-tile__icon',\n\tannotation: 'gov-tile__annotation',\n}\n","import {Component, Element, Fragment, h, Host, Method, Prop} from \"@stencil/core\"\nimport {TileClass, TileSizesType} from \"./constants\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {ButtonTargetType} from \"../gov-button/button/constants\"\n\n@Component({\n\ttag: \"gov-tile\",\n})\nexport class GovTile {\n\t@Element() host: HTMLGovTileElement\n\t/**\n\t * Tile’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: TileSizesType = \"m\"\n\t/**\n\t * Style variation of the tile.\n\t */\n\t@Prop() readonly orientation: \"vertical\" | \"horizontal\"\n\t/**\n\t * Tiles border\n\t */\n\t@Prop({ attribute: 'no-border' }) readonly noBorder: boolean = false\n\t/**\n\t * Link on whole tile\n\t */\n\t@Prop({reflect: true}) readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\tprivate triggerRef?: HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TileClass.root)}\n\t\t\t\t size={this.size}\n\t\t\t\t orientation={this.orientation}\n\t\t\t\t clickable={this.href ? true : null}\n\t\t\t>\n\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t<div class={TileClass.text}>\n\t\t\t\t\t\t<div class={TileClass.title}>\n\t\t\t\t\t\t\t{this.href ? (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\thref={this.href}\n\t\t\t\t\t\t\t\t\t\ttarget={this.target}\n\t\t\t\t\t\t\t\t\t\tclass={TileClass.link}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLSpanElement)}>\n\t\t\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<span class={TileClass.icon}>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"chevron-right\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={`${TileClass.annotation} ${this.href ? `${TileClass.annotation}--padding` : ''}`}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot name=\"button\"/>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n}\n"],"mappings":"4KAIyBA,EAAKC,EAAO,CAAC,KAAM,KAAM,OAG3C,MAAMC,EAAY,CACxBC,KAAM,WACNC,KAAM,iBACNC,QAAS,oBACTC,KAAM,iBACNC,MAAO,kBACPC,KAAM,iBACNC,WAAY,wB,MCLAC,EAAO,MA0BnB,WAAAC,CAAAC,G,UArBgCC,
|
|
1
|
+
{"version":3,"names":["pick","Sizes","TileClass","root","link","content","text","title","icon","annotation","GovTile","constructor","hostRef","this","size","noBorder","h","govHost","host","render","Host","key","class","classes","orientation","clickable","href","name","Fragment","target","ref","el","triggerRef","type","getTriggerRef"],"sources":["../../../packages/core/src/components/gov-tile/constants.ts","../../../packages/core/src/components/gov-tile/gov-tile.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const TileSizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type TileSizesType = `${ValueOf<typeof TileSizes>}`\n\nexport const TileClass = {\n\troot: 'gov-tile',\n\tlink: 'gov-tile__link',\n\tcontent: 'gov-tile__content',\n\ttext: 'gov-tile__text',\n\ttitle: 'gov-tile__title',\n\ticon: 'gov-tile__icon',\n\tannotation: 'gov-tile__annotation',\n}\n","import {Component, Element, Fragment, h, Host, Method, Prop} from \"@stencil/core\"\nimport {TileClass, TileSizesType} from \"./constants\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {ButtonTargetType} from \"../gov-button/button/constants\"\n\n@Component({\n\ttag: \"gov-tile\",\n})\nexport class GovTile {\n\t@Element() host: HTMLGovTileElement\n\t/**\n\t * Tile’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: TileSizesType = \"m\"\n\t/**\n\t * Style variation of the tile.\n\t */\n\t@Prop() readonly orientation: \"vertical\" | \"horizontal\"\n\t/**\n\t * Tiles border\n\t */\n\t@Prop({ attribute: 'no-border' }) readonly noBorder: boolean = false\n\t/**\n\t * Link on whole tile\n\t */\n\t@Prop({reflect: true}) readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\tprivate triggerRef?: HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TileClass.root)}\n\t\t\t\t size={this.size}\n\t\t\t\t orientation={this.orientation}\n\t\t\t\t clickable={this.href ? true : null}\n\t\t\t>\n\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t<div class={TileClass.text}>\n\t\t\t\t\t\t<div class={TileClass.title}>\n\t\t\t\t\t\t\t{this.href ? (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\thref={this.href}\n\t\t\t\t\t\t\t\t\t\ttarget={this.target}\n\t\t\t\t\t\t\t\t\t\tclass={TileClass.link}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLSpanElement)}>\n\t\t\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<span class={TileClass.icon}>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"chevron-right\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={`${TileClass.annotation} ${this.href ? `${TileClass.annotation}--padding` : ''}`}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot name=\"button\"/>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n}\n"],"m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-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as s,h as a,H as t,g as i}from"./p-ClISz4NF.js";import{v as c}from"./p-NOJjz9dT.js";import{a as o,A as b,b as n}from"./p-Cx3bEC5v.js";import{g as d,t as r,b as f}from"./p-CoD1xawt.js";import{i as h}from"./p-CzXeijOj.js";import{t as p}from"./p-Cjg0wpDG.js";import"./p-CgDnDrq5.js";import"./p-CQvUntGY.js";import"./p-BcQO4NH2.js";import"./p-Bz_RzYFb.js";const l=class{constructor(a){e(this,a);this.govChange=s(this,"gov-change");this.inheritedAttributes={};this.disabled=false;this.open=false;this.h=d(this.host)}validateSize(e){c(n,e,b.root)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=h(this.host)}componentDidRender(){p((()=>this.getPropsFromParents()))}getPropsFromParents(){const e=this.h.getParent(o.root);if(e){this.size=e.getAttribute("size")}}render(){return a(t,{key:"1beb62527ea9274e6280ce0b64c9d52c12e4a993",class:this.h.classes([b.root,this.disabled&&b.disabled]),size:this.size,role:"listitem"},a("details",{key:"53ca7688e8f26e85cd76feb073a26d04c5505d2b",class:b.details,id:this.identifier,"aria-disabled":r(this.disabled),open:this.open},a("summary",Object.assign({key:"19fec49b0066b7a6162a6010e0ee20431c2a578b",onClick:e=>{e.stopPropagation();e.preventDefault();!this.disabled&&this.toggle().finally()},class:b.summary,tabIndex:this.disabled?-1:0,"aria-expanded":f(this.open)},this.inheritedAttributes),this.h.hasSlot("icon")&&a("span",{key:"19254947c22fa2b1a2fa4e26eacb22c0c89b40c9",class:b.icon},a("slot",{key:"262be1640f250fabf9918f4162c071bb68dc4fb3",name:"icon"})),a("span",{key:"ebb5ef762ef51921b68a8063fd09c979d7d0d32d",class:b.title},a("slot",{key:"75783345d2276f06e53c401761cb4e57d241e5e0",name:"label"}),a("slot",{key:"f2d9cdff693edbcae6293921fde7996d1b1251b6",name:"annotation"})),a("span",{key:"f7e28ea54455756c7d146c7b88be7001e80b07a8",class:b.right},a("slot",{key:"e76b31bf1c349a8a86d4b91ec1cfa650a75edf60",name:"suffix"}),a("span",{key:"87ea99c9862deb3ff9820fa383cec52956b4655a",class:b.arrow},a("slot",{key:"c8b64a90455a731f359e12550664ba5aa905abbc",name:"toggle-icon"},a("gov-icon",{key:"867406c5634d6446683529f5f647492b9b289a31",name:"chevron-down",type:"components"}))))),a("div",{key:"2adf7441dd470ae1b32a08fb374cd1d9e2d1f789",class:b.content},a("slot",{key:"8eb27d0b33689933b6e71850324c35c89d71c4c0"}))))}async toggle(){this.open=!this.open;this.govChange.emit({open:this.open,component:b.root,ref:this.host})}async currentState(){return this.open}get host(){return i(this)}static get watchers(){return{size:["validateSize"]}}};export{l as gov_accordion_item};
|
|
2
|
+
//# sourceMappingURL=p-4d36cd18.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovAccordionItem","constructor","hostRef","this","inheritedAttributes","disabled","open","h","govHost","host","validateSize","newValue","validateProp","AccordionSizes","AccordionItemClass","root","componentWillLoad","size","inheritAriaAttributes","componentDidRender","tick","getPropsFromParents","accordion","getParent","AccordionClass","getAttribute","render","Host","key","class","classes","role","details","id","identifier","toBoolAttrIfDefined","Object","assign","onClick","e","stopPropagation","preventDefault","toggle","finally","summary","tabIndex","booleanString","hasSlot","icon","name","title","right","arrow","type","content","govChange","emit","component","ref","currentState"],"sources":["../../../packages/core/src/components/gov-accordion/gov-accordion-item.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {AccordionClass, AccordionItemClass, AccordionSizes, AccordionSizeType,} from \"./constants\"\nimport {booleanString, govHost, toBoolAttrIfDefined} from \"../../helpers/Dom/template\"\nimport {AccordionItemEvent} from \"./gov-accordion.types\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\nimport {Attributes} from \"../../helpers/Dom/attribute\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-accordion-item\",\n})\nexport class GovAccordionItem {\n\tprivate h: GovHost\n\tprivate inheritedAttributes: Attributes = {};\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAccordionItemElement\n\t@State() openState: boolean\n\n\t/**\n\t * Custom accordion item identifier.\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Accordion’s size.\n\t */\n\t@Prop({ mutable: true }) size?: AccordionSizeType\n\t/**\n\t * Makes the button component disabled.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by button\n\t */\n\t@Prop({attribute: \"open\", mutable: true}) open = false\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<AccordionItemEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionItemClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tcomponentDidRender(): void {\n\t\ttick(() => this.getPropsFromParents())\n\t}\n\n\tprivate getPropsFromParents() {\n\t\tconst accordion = this.h.getParent(AccordionClass.root)\n\t\tif (accordion) {\n\t\t\tthis.size = accordion.getAttribute(\"size\") as AccordionSizeType\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([AccordionItemClass.root,\n\t\t\t\tthis.disabled && AccordionItemClass.disabled])}\n\t\t\t\t size={this.size}\n\t\t\t\t role=\"listitem\">\n\t\t\t\t<details\n\t\t\t\t\tclass={AccordionItemClass.details}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t>\n\t\t\t\t\t<summary\n\t\t\t\t\t\tonClick={(e: Event) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t!this.disabled && this.toggle().finally()\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclass={AccordionItemClass.summary}\n\t\t\t\t\t\ttabIndex={this.disabled ? -1 : 0}\n\t\t\t\t\t\taria-expanded={booleanString(this.open)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.h.hasSlot('icon') &&\n\t\t\t\t\t\t\t<span class={AccordionItemClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<span class={AccordionItemClass.title}>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t\t<slot name=\"annotation\"/>\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t<span class={AccordionItemClass.right}>\n\t\t\t\t\t\t\t<slot name=\"suffix\"/>\n\t\t\t\t\t\t\t<span class={AccordionItemClass.arrow}>\n\t\t\t\t\t\t\t\t<slot name=\"toggle-icon\">\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"chevron-down\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</summary>\n\t\t\t\t\t<div class={AccordionItemClass.content}>\n\t\t\t\t\t\t<slot/>\n\t\t\t\t\t</div>\n\t\t\t\t</details>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Accordion switch\n\t */\n\t@Method()\n\tasync toggle(): Promise<void> {\n\t\tthis.open = !this.open\n\t\tthis.govChange.emit({\n\t\t\topen: this.open,\n\t\t\tcomponent: AccordionItemClass.root,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.open\n\t}\n}\n"],"mappings":"sXAaaA,EAAgB,MAI5B,WAAAC,CAAAC,G,8CAFQC,
|
|
1
|
+
{"version":3,"names":["GovAccordionItem","constructor","hostRef","this","inheritedAttributes","disabled","open","h","govHost","host","validateSize","newValue","validateProp","AccordionSizes","AccordionItemClass","root","componentWillLoad","size","inheritAriaAttributes","componentDidRender","tick","getPropsFromParents","accordion","getParent","AccordionClass","getAttribute","render","Host","key","class","classes","role","details","id","identifier","toBoolAttrIfDefined","Object","assign","onClick","e","stopPropagation","preventDefault","toggle","finally","summary","tabIndex","booleanString","hasSlot","icon","name","title","right","arrow","type","content","govChange","emit","component","ref","currentState"],"sources":["../../../packages/core/src/components/gov-accordion/gov-accordion-item.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {AccordionClass, AccordionItemClass, AccordionSizes, AccordionSizeType,} from \"./constants\"\nimport {booleanString, govHost, toBoolAttrIfDefined} from \"../../helpers/Dom/template\"\nimport {AccordionItemEvent} from \"./gov-accordion.types\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\nimport {Attributes} from \"../../helpers/Dom/attribute\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-accordion-item\",\n})\nexport class GovAccordionItem {\n\tprivate h: GovHost\n\tprivate inheritedAttributes: Attributes = {};\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAccordionItemElement\n\t@State() openState: boolean\n\n\t/**\n\t * Custom accordion item identifier.\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Accordion’s size.\n\t */\n\t@Prop({ mutable: true }) size?: AccordionSizeType\n\t/**\n\t * Makes the button component disabled.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by button\n\t */\n\t@Prop({attribute: \"open\", mutable: true}) open = false\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<AccordionItemEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionItemClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tcomponentDidRender(): void {\n\t\ttick(() => this.getPropsFromParents())\n\t}\n\n\tprivate getPropsFromParents() {\n\t\tconst accordion = this.h.getParent(AccordionClass.root)\n\t\tif (accordion) {\n\t\t\tthis.size = accordion.getAttribute(\"size\") as AccordionSizeType\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([AccordionItemClass.root,\n\t\t\t\tthis.disabled && AccordionItemClass.disabled])}\n\t\t\t\t size={this.size}\n\t\t\t\t role=\"listitem\">\n\t\t\t\t<details\n\t\t\t\t\tclass={AccordionItemClass.details}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t>\n\t\t\t\t\t<summary\n\t\t\t\t\t\tonClick={(e: Event) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t!this.disabled && this.toggle().finally()\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclass={AccordionItemClass.summary}\n\t\t\t\t\t\ttabIndex={this.disabled ? -1 : 0}\n\t\t\t\t\t\taria-expanded={booleanString(this.open)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.h.hasSlot('icon') &&\n\t\t\t\t\t\t\t<span class={AccordionItemClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t<span class={AccordionItemClass.title}>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t\t<slot name=\"annotation\"/>\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t<span class={AccordionItemClass.right}>\n\t\t\t\t\t\t\t<slot name=\"suffix\"/>\n\t\t\t\t\t\t\t<span class={AccordionItemClass.arrow}>\n\t\t\t\t\t\t\t\t<slot name=\"toggle-icon\">\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"chevron-down\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</summary>\n\t\t\t\t\t<div class={AccordionItemClass.content}>\n\t\t\t\t\t\t<slot/>\n\t\t\t\t\t</div>\n\t\t\t\t</details>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Accordion switch\n\t */\n\t@Method()\n\tasync toggle(): Promise<void> {\n\t\tthis.open = !this.open\n\t\tthis.govChange.emit({\n\t\t\topen: this.open,\n\t\t\tcomponent: AccordionItemClass.root,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.open\n\t}\n}\n"],"mappings":"sXAaaA,EAAgB,MAI5B,WAAAC,CAAAC,G,8CAFQC,KAAmBC,oBAAe,GAoBzBD,KAAQE,SAAY,MAIKF,KAAIG,KAAG,MArBhDH,KAAKI,EAAIC,EAAQL,KAAKM,KACtB,CA2BD,YAAAC,CAAaC,GACZC,EAAaC,EAAgBF,EAAUG,EAAmBC,K,CAG3D,iBAAAC,GACCb,KAAKO,aAAaP,KAAKc,MACvBd,KAAKC,oBAAsBc,EAAsBf,KAAKM,K,CAGvD,kBAAAU,GACCC,GAAK,IAAMjB,KAAKkB,u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AKC,MAAOf,EAAmBwC,SAC9B/C,EAAA,QAAAqB,IAAA,+C,CAWL,YAAMc,GACLvC,KAAKG,MAAQH,KAAKG,KAClBH,KAAKoD,UAAUC,KAAK,CACnBlD,KAAMH,KAAKG,KACXmD,UAAW3C,EAAmBC,KAC9B2C,IAAKvD,KAAKM,M,CAQZ,kBAAMkD,GACL,OAAOxD,KAAKG,I","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as t,H as o,g as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,H as o,g as s}from"./p-ClISz4NF.js";import{g as c}from"./p-CoD1xawt.js";var a;(function(e){e["PRIMARY"]="primary";e["SUBTLE"]="subtle";e["NEUTRAL"]="neutral"})(a||(a={}));const d={root:"gov-blockquote"};const r=class{constructor(t){e(this,t);this.type=a.SUBTLE;this.h=c(this.host)}render(){return t(o,{key:"c12f0f01c2db5025112edd1ebc834a18ff754546",class:this.h.classes(d.root),type:this.type},t("gov-icon",{key:"f043fdebbbd95c4eb3909985243f5ef253eb0335",type:"components",name:"quote",size:"3xl"}),t("blockquote",{key:"57cdec66772ad7732a79dd9a55cad1d9e5058ed7",cite:this.cite},t("slot",{key:"71a0e5ca7f377e22f4c12c44c517f142d45e47a9"})),t("slot",{key:"b0c7f4796b12e1baec71c03d20cb2ff99ae51311",name:"image"}),t("slot",{key:"55e5588b7e9793743a6b8ef403d363ddde8300d8",name:"author"}))}get host(){return s(this)}};export{r as gov_blockquote};
|
|
2
|
+
//# sourceMappingURL=p-4d902f20.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlockquoteType","BlockquoteClass","root","GovBlockquote","constructor","hostRef","this","type","SUBTLE","h","govHost","host","render","Host","key","class","classes","name","size","cite"],"sources":["../../../packages/core/src/components/gov-blockquote/constants.ts","../../../packages/core/src/components/gov-blockquote/gov-blockquote.tsx"],"sourcesContent":["import {ValueOf} from \"../../types/interfaces\";\n\nexport enum BlockquoteType {\n\tPRIMARY = 'primary',\n\tSUBTLE = 'subtle',\n\tNEUTRAL = 'neutral',\n}\nexport type BlockquoteTypesType = `${ValueOf<typeof BlockquoteType>}`\n\nexport const BlockquoteClass = {\n\troot: 'gov-blockquote',\n}\n","import {Component, Element, Host, h, Prop} from '@stencil/core'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport {BlockquoteClass, BlockquoteType, BlockquoteTypesType} from \"./constants\";\n\n\n@Component({\n\ttag: 'gov-blockquote',\n})\nexport class GovBlockquote {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovBlockquoteElement\n\t/**\n\t * Blockquote’s type\n\t */\n\t@Prop({reflect: true}) readonly type: BlockquoteTypesType = BlockquoteType.SUBTLE\n\t/**\n\t * Blockquote’s cite url\n\t */\n\t@Prop({attribute: 'cite'}) readonly cite: string\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BlockquoteClass.root)} type={this.type}>\n\t\t\t\t<gov-icon type=\"components\" name=\"quote\" size=\"3xl\"></gov-icon>\n\t\t\t\t<blockquote cite={this.cite}>\n\t\t\t\t\t<slot />\n\t\t\t\t</blockquote>\n\t\t\t\t<slot name=\"image\" />\n\t\t\t\t<slot name=\"author\" />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"6FAEA,IAAYA,GAAZ,SAAYA,GACXA,EAAA,qBACAA,EAAA,mBACAA,EAAA,oBACA,EAJD,CAAYA,
|
|
1
|
+
{"version":3,"names":["BlockquoteType","BlockquoteClass","root","GovBlockquote","constructor","hostRef","this","type","SUBTLE","h","govHost","host","render","Host","key","class","classes","name","size","cite"],"sources":["../../../packages/core/src/components/gov-blockquote/constants.ts","../../../packages/core/src/components/gov-blockquote/gov-blockquote.tsx"],"sourcesContent":["import {ValueOf} from \"../../types/interfaces\";\n\nexport enum BlockquoteType {\n\tPRIMARY = 'primary',\n\tSUBTLE = 'subtle',\n\tNEUTRAL = 'neutral',\n}\nexport type BlockquoteTypesType = `${ValueOf<typeof BlockquoteType>}`\n\nexport const BlockquoteClass = {\n\troot: 'gov-blockquote',\n}\n","import {Component, Element, Host, h, Prop} from '@stencil/core'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport {BlockquoteClass, BlockquoteType, BlockquoteTypesType} from \"./constants\";\n\n\n@Component({\n\ttag: 'gov-blockquote',\n})\nexport class GovBlockquote {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovBlockquoteElement\n\t/**\n\t * Blockquote’s type\n\t */\n\t@Prop({reflect: true}) readonly type: BlockquoteTypesType = BlockquoteType.SUBTLE\n\t/**\n\t * Blockquote’s cite url\n\t */\n\t@Prop({attribute: 'cite'}) readonly cite: string\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BlockquoteClass.root)} type={this.type}>\n\t\t\t\t<gov-icon type=\"components\" name=\"quote\" size=\"3xl\"></gov-icon>\n\t\t\t\t<blockquote cite={this.cite}>\n\t\t\t\t\t<slot />\n\t\t\t\t</blockquote>\n\t\t\t\t<slot name=\"image\" />\n\t\t\t\t<slot name=\"author\" />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"6FAEA,IAAYA,GAAZ,SAAYA,GACXA,EAAA,qBACAA,EAAA,mBACAA,EAAA,oBACA,EAJD,CAAYA,MAIX,KAGM,MAAMC,EAAkB,CAC9BC,KAAM,kB,MCDMC,EAAa,MAGzB,WAAAC,CAAAC,G,UAQgCC,KAAAC,KAA4BP,EAAeQ,OAP1EF,KAAKG,EAAIC,EAAQJ,KAAKK,KACtB,CAYD,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOT,KAAKG,EAAEO,QAAQf,EAAgBC,MAAOK,KAAMD,KAAKC,MAC7DE,EAAU,YAAAK,IAAA,2CAAAP,KAAK,aAAaU,KAAK,QAAQC,KAAK,QAC9CT,EAAA,cAAAK,IAAA,2CAAYK,KAAMb,KAAKa,MACtBV,EAAA,QAAAK,IAAA,8CAEDL,EAAM,QAAAK,IAAA,2CAAAG,KAAK,UACXR,EAAA,QAAAK,IAAA,2CAAMG,KAAK,W","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as s,H as i,g as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as s,H as i,g as e}from"./p-ClISz4NF.js";import{v as o}from"./p-NOJjz9dT.js";import{C as h}from"./p-U40vKHrs.js";import{S as n}from"./p-BcQO4NH2.js";import{p as r}from"./p-CQvUntGY.js";import{c as a}from"./p-vN03FcXN.js";import{g as l,a as c}from"./p-CoD1xawt.js";import{d as f}from"./p-CgDnDrq5.js";import{t as d}from"./p-Cjg0wpDG.js";const p=r(h,["PRIMARY","NEUTRAL"]);const u=r(n,["_S","_M","_L"]);var v;(function(t){t["TOP"]="top";t["RIGHT"]="right";t["BOTTOM"]="bottom";t["LEFT"]="left"})(v||(v={}));const m={root:"gov-tooltip"};const g={root:"gov-tooltip-content"};const b=class{constructor(s){t(this,s);this.tooltipContentId=undefined;this.tooltipId=undefined;this.color=p.PRIMARY;this.size=u._M;this.position="right";this.message=undefined;this.icon=undefined;this.persist=false;this.repositionListenersAttached=false;this.reposition=()=>{if(this.tooltipContent){this.verifyPositionSpace()}};this.h=l(this.host);this.tooltipId=a("GovTooltip");this.tooltipContentId=a("GovContentTooltip")}validateColor(t){o(p,t,m.root)}validateSize(t){o(u,t,m.root)}validatePosition(t){o(v,t,m.root)}rerenderMessage(){this.createContentWrapper()}connectedCallback(){this.createContentWrapper();this.registerListeners()}componentWillLoad(){this.validateColor(this.color);this.validateSize(this.size);this.validatePosition(this.position)}componentDidUpdate(){this.createContentWrapper()}disconnectedCallback(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();this.resizeObserver=undefined;window.removeEventListener("resize",this.reposition);this.repositionListenersAttached=false;this.removeContent()}createContentWrapper(){var t;if(this.tooltipContent){if(this.message!=null){this.tooltipContent.setAttribute("message",this.message)}return}let s;if(this.insideContent){s=this.insideContent}else{s=f().createElement(g.root);if(this.message!=null){s.setAttribute("message",this.message)}}s.setAttribute("id",(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId);s.setAttribute("parent-id",this.tooltipId);s.setAttribute("color",this.color);s.setAttribute("size",this.size);f().body.appendChild(s)}get tooltipContent(){var t;return f().body.querySelector(`#${(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId}`)}get insideContent(){return this.host.querySelector(g.root)}registerListeners(){this.host.addEventListener("click",(t=>{t.preventDefault();this.persist=true;if(this.tooltipContent){this.tooltipContent.setAttribute("persist","true")}this.showTooltip()}));this.host.addEventListener("mouseenter",(t=>{t.preventDefault();this.showTooltip()}));this.host.addEventListener("mouseleave",(t=>{t.preventDefault();if(this.persist===false){this.hideTooltip()}}))}verifyPositionSpace(){const t=12;const s=window.innerWidth-(window.innerWidth-document.documentElement.clientWidth);const i=this.host.getBoundingClientRect();const e=this.host.offsetWidth;const o=this.host.offsetHeight;const h=this.tooltipContent.offsetWidth;const n=this.tooltipContent.offsetHeight;const r={left:i.left+document.documentElement.scrollLeft,top:i.top+document.documentElement.scrollTop};const a=r.left+t+i.width+h<=s;const l=r.left>h;if(this.position===v.LEFT||this.position===v.RIGHT){this.tooltipContent.style.top=r.top-(n-o)/2+"px";if(a===false&&l===false){this.position=v.TOP;this.tooltipContent.setAttribute("position",v.TOP)}if(l&&a===false&&this.position===v.RIGHT){this.position=v.LEFT}if(a&&l===false&&this.position===v.LEFT){this.position=v.RIGHT}}if(this.position===v.RIGHT){this.tooltipContent.setAttribute("position",v.RIGHT);this.tooltipContent.style.left=r.left+t+i.width+"px"}if(this.position===v.LEFT){this.tooltipContent.setAttribute("position",v.LEFT);this.tooltipContent.style.left=r.left-(h+t)+"px"}if(this.position===v.TOP||this.position===v.BOTTOM){if(h>e){let i=r.left-(h-e)/2;const o=i<0;const n=i+h>s;if(o&&n){this.tooltipContent.style.width="auto";this.tooltipContent.style.left=t+"px";this.tooltipContent.style.right=t+"px"}else{if(o){i=t}if(n){i=i-(s-(i+h+t))*-1}this.tooltipContent.style.left=i+"px"}}else{const t=r.left+(e-h)/2;this.tooltipContent.style.left=t+"px"}}if(this.position===v.TOP){this.tooltipContent.setAttribute("position",v.TOP);this.tooltipContent.style.top=r.top-(n+t)+"px"}if(this.position===v.BOTTOM){this.tooltipContent.setAttribute("position",v.BOTTOM);this.tooltipContent.style.top=r.top+(o+t)+"px"}this.tooltipContent.style.opacity="1"}showTooltip(){if(this.tooltipContent){this.tooltipContent.style.opacity="0";this.tooltipContent.hidden=false;this.tooltipContent.setAttribute("is-visible","true");d((()=>{this.verifyPositionSpace()}));if(!this.repositionListenersAttached){this.repositionListenersAttached=true;if(typeof ResizeObserver!=="undefined"){this.resizeObserver=new ResizeObserver(this.reposition);this.resizeObserver.observe(this.tooltipContent)}window.addEventListener("resize",this.reposition)}}}hideTooltip(){var t;if(this.tooltipContent){this.tooltipContent.setAttribute("is-visible","false");this.tooltipContent.setAttribute("persist","false");this.tooltipContent.removeAttribute("style")}(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();this.resizeObserver=undefined;window.removeEventListener("resize",this.reposition);this.repositionListenersAttached=false}removeContent(){const t=document.getElementById(this.tooltipContentId);if(t){t.remove()}}render(){var t;return s(i,{key:"20ebe5eea59967e8681fd0e35fc7aff53b5915dd",id:this.tooltipId,class:this.h.classes(m.root),position:this.position},s("span",{key:"847b78886907d683425013227eb78bbf9261b709",role:"button",tabindex:0,onKeyPress:()=>this.showTooltip(),onBlur:()=>{if(this.persist===false){this.hideTooltip()}},"aria-describedby":(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId},s("slot",{key:"84c4c02ee11e05166fca208b82ef54298dcaa6ee"})))}async show(){this.showTooltip()}async hide(){this.persist=false;this.hideTooltip()}get host(){return e(this)}static get watchers(){return{color:["validateColor"],size:["validateSize"],position:["validatePosition"],message:["rerenderMessage"]}}};const C=class{constructor(s){t(this,s);this.color=p.PRIMARY;this.size=u._M;this.persist=false;this.isVisible=false;this.parentId=null}visibleContent(t){clearTimeout(this.timeout);if(t===false){this.timeout=setTimeout((()=>{this.host.style.visibility="hidden"}),250)}else{this.host.style.visibility="visible"}}hideContent(){this.isVisible=false;this.persist=false;const t=document.getElementById(this.parentId);if(t){t.hide().catch()}}render(){return s(i,{key:"121b5cd3878956618a7a917511e6d8d76edf6672",class:g.root,role:"tooltip",hidden:!this.isVisible,"aria-hidden":!c(this.isVisible),"is-visible":this.isVisible},this.message?s("span",{class:"gov-tooltip-content__message",innerHTML:this.message}):s("slot",null),this.persist?s("gov-button",{"on-gov-click":this.hideContent.bind(this),color:this.color,size:this.size,type:"base"},s("gov-icon",{slot:"icon-start",name:"x-lg",type:"components"})):null)}get host(){return e(this)}static get watchers(){return{isVisible:["visibleContent"]}}};export{b as gov_tooltip,C as gov_tooltip_content};
|
|
2
|
+
//# sourceMappingURL=p-4e2faea7.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TooltipColors","pick","Colors","TooltipSize","Sizes","TooltipPosition","TooltipClass","root","TooltipContentClass","GovTooltip","constructor","hostRef","this","tooltipContentId","undefined","tooltipId","color","PRIMARY","size","_M","position","message","icon","persist","repositionListenersAttached","reposition","tooltipContent","verifyPositionSpace","h","govHost","host","createID","validateColor","newValue","validateProp","validateSize","validatePosition","rerenderMessage","createContentWrapper","connectedCallback","registerListeners","componentWillLoad","componentDidUpdate","disconnectedCallback","_a","resizeObserver","disconnect","window","removeEventListener","removeContent","setAttribute","content","insideContent","documentNode","createElement","identifier","body","appendChild","querySelector","addEventListener","e","preventDefault","showTooltip","hideTooltip","offset","windowWidth","innerWidth","document","documentElement","clientWidth","trigger","getBoundingClientRect","trgWidth","offsetWidth","trgHeight","offsetHeight","contentWidth","contentHeight","triggerPos","left","scrollLeft","top","scrollTop","isRightSpace","width","isLeftSpace","LEFT","RIGHT","style","TOP","BOTTOM","leftPosition","isNotLeftSpace","isNotRightSpace","right","opacity","hidden","tick","ResizeObserver","observe","removeAttribute","contentEl","getElementById","remove","render","Host","key","id","class","classes","role","tabindex","onKeyPress","onBlur","show","hide","GovTooltipContent","isVisible","parentId","visibleContent","clearTimeout","timeout","setTimeout","visibility","hideContent","parentEl","catch","toBoolAttr","innerHTML","bind","type","slot","name"],"sources":["../../../packages/core/src/components/gov-tooltip/constants.tsx","../../../packages/core/src/components/gov-tooltip/gov-tooltip.tsx","../../../packages/core/src/components/gov-tooltip/gov-tooltip-content.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { Sizes } from '../../core/constants/sizes'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const TooltipColors = pick(Colors, ['PRIMARY', 'NEUTRAL'])\nexport type TooltipColorType = `${ValueOf<typeof TooltipColors>}`\n\nexport const TooltipSize = pick(Sizes, ['_S', '_M', '_L'])\nexport type TooltipSizeType = `${ValueOf<typeof TooltipSize>}`\n\nexport enum TooltipPosition {\n\tTOP = 'top',\n\tRIGHT = 'right',\n\tBOTTOM = 'bottom',\n\tLEFT = 'left',\n}\nexport type TooltipPositionType = `${ValueOf<typeof TooltipPosition>}`\n\nexport const TooltipClass = {\n\troot: 'gov-tooltip',\n}\n\nexport const TooltipContentClass = {\n\troot: 'gov-tooltip-content',\n}\n","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","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"],"mappings":"gWAKO,MAAMA,EAAgBC,EAAKC,EAAQ,CAAC,UAAW,YAG/C,MAAMC,EAAcF,EAAKG,EAAO,CAAC,KAAM,KAAM,OAGpD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,aACAA,EAAA,iBACAA,EAAA,mBACAA,EAAA,cACA,EALD,CAAYA,MAAe,KAQpB,MAAMC,EAAe,CAC3BC,KAAM,eAGA,MAAMC,EAAsB,CAClCD,KAAM,uB,MCFME,EAAU,MAKtB,WAAAC,CAAAC,G,UAHiBC,KAAAC,iBAAmBC,UACnBF,KAAAG,UAAYD,UAYZF,KAAAI,MAA2BhB,EAAciB,QAIzCL,K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EAAW1D,SAASmC,eAAe1F,KAAK0G,UAC9C,GAAIO,EAAU,CACbA,EAASV,OAAOW,O,EAIlB,MAAAtB,GACC,OACC5E,EAAC6E,EAAI,CAAAC,IAAA,2CACJE,MAAOpG,EAAoBD,KAC3BuG,KAAM,UACNd,QAASpF,KAAKyG,UAAS,eACTU,EAAWnH,KAAKyG,WAAU,aAC5BzG,KAAKyG,WAChBzG,KAAKS,QACHO,EAAA,QAAMgF,MAAM,+BAA+BoB,UAAWpH,KAAKS,UAC3DO,EAAA,aACFhB,KAAKW,QACLK,EAAA,6BACehB,KAAKgH,YAAYK,KAAKrH,MACpCI,MAAOJ,KAAKI,MACZE,KAAMN,KAAKM,KACXgH,KAAM,QACNtG,EAAA,YAAUuG,KAAM,aAAcC,KAAM,OAAQF,KAAM,gBAEhD,K","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["TooltipColors","pick","Colors","TooltipSize","Sizes","TooltipPosition","TooltipClass","root","TooltipContentClass","GovTooltip","constructor","hostRef","this","tooltipContentId","undefined","tooltipId","color","PRIMARY","size","_M","position","message","icon","persist","repositionListenersAttached","reposition","tooltipContent","verifyPositionSpace","h","govHost","host","createID","validateColor","newValue","validateProp","validateSize","validatePosition","rerenderMessage","createContentWrapper","connectedCallback","registerListeners","componentWillLoad","componentDidUpdate","disconnectedCallback","_a","resizeObserver","disconnect","window","removeEventListener","removeContent","setAttribute","content","insideContent","documentNode","createElement","identifier","body","appendChild","querySelector","addEventListener","e","preventDefault","showTooltip","hideTooltip","offset","windowWidth","innerWidth","document","documentElement","clientWidth","trigger","getBoundingClientRect","trgWidth","offsetWidth","trgHeight","offsetHeight","contentWidth","contentHeight","triggerPos","left","scrollLeft","top","scrollTop","isRightSpace","width","isLeftSpace","LEFT","RIGHT","style","TOP","BOTTOM","leftPosition","isNotLeftSpace","isNotRightSpace","right","opacity","hidden","tick","ResizeObserver","observe","removeAttribute","contentEl","getElementById","remove","render","Host","key","id","class","classes","role","tabindex","onKeyPress","onBlur","show","hide","GovTooltipContent","isVisible","parentId","visibleContent","clearTimeout","timeout","setTimeout","visibility","hideContent","parentEl","catch","toBoolAttr","innerHTML","bind","type","slot","name"],"sources":["../../../packages/core/src/components/gov-tooltip/constants.tsx","../../../packages/core/src/components/gov-tooltip/gov-tooltip.tsx","../../../packages/core/src/components/gov-tooltip/gov-tooltip-content.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { Sizes } from '../../core/constants/sizes'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const TooltipColors = pick(Colors, ['PRIMARY', 'NEUTRAL'])\nexport type TooltipColorType = `${ValueOf<typeof TooltipColors>}`\n\nexport const TooltipSize = pick(Sizes, ['_S', '_M', '_L'])\nexport type TooltipSizeType = `${ValueOf<typeof TooltipSize>}`\n\nexport enum TooltipPosition {\n\tTOP = 'top',\n\tRIGHT = 'right',\n\tBOTTOM = 'bottom',\n\tLEFT = 'left',\n}\nexport type TooltipPositionType = `${ValueOf<typeof TooltipPosition>}`\n\nexport const TooltipClass = {\n\troot: 'gov-tooltip',\n}\n\nexport const TooltipContentClass = {\n\troot: 'gov-tooltip-content',\n}\n","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","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"],"mappings":"gWAKO,MAAMA,EAAgBC,EAAKC,EAAQ,CAAC,UAAW,YAG/C,MAAMC,EAAcF,EAAKG,EAAO,CAAC,KAAM,KAAM,OAGpD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,aACAA,EAAA,iBACAA,EAAA,mBACAA,EAAA,cACA,EALD,CAAYA,MAKX,KAGM,MAAMC,EAAe,CAC3BC,KAAM,eAGA,MAAMC,EAAsB,CAClCD,KAAM,uB,MCFME,EAAU,MAKtB,WAAAC,CAAAC,G,UAHiBC,KAAgBC,iBAAGC,UACnBF,KAASG,UAAGD,UAYZF,KAAAI,MAA2BhB,EAAciB,QAIzCL,KAAAM,KAAyBf,EAAYgB,GAI/BP,KAAQQ,SAAwB,QAItCR,KAAOS,QAAWP,UAQHF,KAAIU,KAAYR,UAEvCF,KAAOW,QAAG,MAiLXX,KAA2BY,4BAAG,MACrBZ,KAAUa,WAAG,KAC7B,GAAIb,KAAKc,eAAgB,CACxBd,KAAKe,qB,GAnNNf,KAAKgB,EAAIC,EAAQjB,KAAKkB,MACtB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AAKS,QACHO,EAAM,QAAAgF,MAAM,+BAA+BoB,UAAWpH,KAAKS,UAC3DO,EAAa,aACfhB,KAAKW,QACLK,EACe,6BAAAhB,KAAKgH,YAAYK,KAAKrH,MACpCI,MAAOJ,KAAKI,MACZE,KAAMN,KAAKM,KACXgH,KAAM,QACNtG,EAAU,YAAAuG,KAAM,aAAcC,KAAM,OAAQF,KAAM,gBAEhD,K","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,c as t,h as i,H as a,g as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as s,c as t,h as i,H as a,g as o}from"./p-ClISz4NF.js";import{v as r}from"./p-CDIRBJsi.js";import{c as e}from"./p-CgDnDrq5.js";import{g as c}from"./p-CoD1xawt.js";import{t as p}from"./p-Cjg0wpDG.js";import"./p-vN03FcXN.js";import"./p-DNztiAH0.js";import"./p-CQvUntGY.js";const h={root:"gov-backdrop",bg:"gov-backdrop__background"};const d=class{constructor(i){s(this,i);this.govClick=t(this,"gov-click");this.inverse=false;this.disabled=false;this.h=c(this.host)}async componentDidRender(){if(e()){p((()=>this.validateAccessibility()))}}render(){return i(a,{key:"364e63a9a8a66920d463a8763773dd2f36ffc814",class:this.h.classes(h.root),inverse:this.inverse},i("div",{key:"81d25e5aa67f0291f8c9d8e806ab17f7cd9a400e",role:"button","aria-disabled":this.disabled,"aria-label":this.accessibleLabel,"aria-labelledby":this.accessibleLabelledBy,onClick:s=>{if(!this.disabled){this.govClick.emit(s)}},class:h.bg}))}async validateAccessibility(){r(this.accessibleLabel,this.accessibleLabelledBy,h.root,this.host)}get host(){return o(this)}};export{d as gov_backdrop};
|
|
2
|
+
//# sourceMappingURL=p-511eed88.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BackdropClass","root","bg","GovBackdrop","constructor","hostRef","this","inverse","disabled","h","govHost","host","componentDidRender","canValidateWcagOnRender","tick","validateAccessibility","render","Host","key","class","classes","role","accessibleLabel","accessibleLabelledBy","onClick","e","govClick","emit","validateAccessibleLabel"],"sources":["../../../packages/core/src/components/gov-backdrop/constants.ts","../../../packages/core/src/components/gov-backdrop/gov-backdrop.tsx"],"sourcesContent":["export const BackdropClass = {\n\troot: 'gov-backdrop',\n\tbg: 'gov-backdrop__background',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop} from '@stencil/core'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {BackdropClass} from './constants'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-backdrop',\n})\nexport class GovBackdrop {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovBackdropElement\n\t/**\n\t * Determine if component should have inverse colors to be used on dark background.\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Makes the backdrop component disabled.\n\t */\n\t@Prop({reflect: true, mutable: true}) readonly disabled: boolean = false\n\t/**\n\t * Adds accessible label for the backdrop that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-label'}) readonly accessibleLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({attribute: 'accessible-labelledby'}) readonly accessibleLabelledBy: string\n\t/**\n\t * Emitted when button clicks.\n\t */\n\t@Event({eventName: 'gov-click'}) govClick: EventEmitter<MouseEvent>\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BackdropClass.root)} inverse={this.inverse}>\n\t\t\t\t<div\n\t\t\t\t\trole={'button'}\n\t\t\t\t\taria-disabled={this.disabled}\n\t\t\t\t\taria-label={this.accessibleLabel}\n\t\t\t\t\taria-labelledby={this.accessibleLabelledBy}\n\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\tif (!this.disabled) {\n\t\t\t\t\t\t\tthis.govClick.emit(e)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tclass={BackdropClass.bg}\n\t\t\t\t></div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the accessibility attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleLabel, this.accessibleLabelledBy, BackdropClass.root, this.host)\n\t}\n}\n"],"mappings":"wRAAO,MAAMA,EAAgB,CAC5BC,KAAM,eACNC,GAAI,4B,MCSQC,EAAW,MAGvB,WAAAC,CAAAC,G,4CAQiBC,
|
|
1
|
+
{"version":3,"names":["BackdropClass","root","bg","GovBackdrop","constructor","hostRef","this","inverse","disabled","h","govHost","host","componentDidRender","canValidateWcagOnRender","tick","validateAccessibility","render","Host","key","class","classes","role","accessibleLabel","accessibleLabelledBy","onClick","e","govClick","emit","validateAccessibleLabel"],"sources":["../../../packages/core/src/components/gov-backdrop/constants.ts","../../../packages/core/src/components/gov-backdrop/gov-backdrop.tsx"],"sourcesContent":["export const BackdropClass = {\n\troot: 'gov-backdrop',\n\tbg: 'gov-backdrop__background',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop} from '@stencil/core'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {BackdropClass} from './constants'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-backdrop',\n})\nexport class GovBackdrop {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovBackdropElement\n\t/**\n\t * Determine if component should have inverse colors to be used on dark background.\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Makes the backdrop component disabled.\n\t */\n\t@Prop({reflect: true, mutable: true}) readonly disabled: boolean = false\n\t/**\n\t * Adds accessible label for the backdrop that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-label'}) readonly accessibleLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({attribute: 'accessible-labelledby'}) readonly accessibleLabelledBy: string\n\t/**\n\t * Emitted when button clicks.\n\t */\n\t@Event({eventName: 'gov-click'}) govClick: EventEmitter<MouseEvent>\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BackdropClass.root)} inverse={this.inverse}>\n\t\t\t\t<div\n\t\t\t\t\trole={'button'}\n\t\t\t\t\taria-disabled={this.disabled}\n\t\t\t\t\taria-label={this.accessibleLabel}\n\t\t\t\t\taria-labelledby={this.accessibleLabelledBy}\n\t\t\t\t\tonClick={e => {\n\t\t\t\t\t\tif (!this.disabled) {\n\t\t\t\t\t\t\tthis.govClick.emit(e)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tclass={BackdropClass.bg}\n\t\t\t\t></div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the accessibility attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleLabel, this.accessibleLabelledBy, BackdropClass.root, this.host)\n\t}\n}\n"],"mappings":"wRAAO,MAAMA,EAAgB,CAC5BC,KAAM,eACNC,GAAI,4B,MCSQC,EAAW,MAGvB,WAAAC,CAAAC,G,4CAQiBC,KAAOC,QAAY,MAIWD,KAAQE,SAAY,MAXlEF,KAAKG,EAAIC,EAAQJ,KAAKK,KACtB,CAwBD,wBAAMC,GACL,GAAIC,IAA2B,CAC9BC,GAAK,IAAMR,KAAKS,yB,EAIlB,MAAAC,GACC,OACCP,EAACQ,EAAI,CAAAC,IAAA,2CAACC,MAAOb,KAAKG,EAAEW,QAAQpB,EAAcC,MAAOM,QAASD,KAAKC,SAC9DE,EACC,OAAAS,IAAA,2CAAAG,KAAM,SAAQ,gBACCf,KAAKE,SAAQ,aAChBF,KAAKgB,gBACA,kBAAAhB,KAAKiB,qBACtBC,QAASC,IACR,IAAKnB,KAAKE,SAAU,CACnBF,KAAKoB,SAASC,KAAKF,E,GAGrBN,MAAOnB,EAAcE,K,CAUzB,2BAAMa,GACLa,EAAwBtB,KAAKgB,gBAAiBhB,KAAKiB,qBAAsBvB,EAAcC,KAAMK,KAAKK,K","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as o,g as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,H as o,g as e}from"./p-ClISz4NF.js";import{g as a,a as n}from"./p-CoD1xawt.js";import{F as c}from"./p-5itQzbON.js";import{v as r}from"./p-NOJjz9dT.js";import{C as h}from"./p-U40vKHrs.js";import{p as l}from"./p-CQvUntGY.js";import{A as d,a as b}from"./p-Bz_RzYFb.js";import{i as f}from"./p-CzXeijOj.js";import"./p-CgDnDrq5.js";const p=l(h,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var v;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(v||(v={}));const m={root:"gov-infobar",section:"gov-infobar__section",content:"gov-infobar__content",headline:"gov-infobar__headline",close:"gov-infobar__close"};const g=class{constructor(i){t(this,i);this.govClose=s(this,"gov-close");this.hydrated=false;this.color="primary";this.type="bold";this.role=undefined;this.accessibleCloseLabel="Zavřít informační lištu";this.accessibleToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.inheritedAttributes={};this.h=a(this.host)}validateColor(t){r(p,t,m.root)}componentDidLoad(){this.attributeObserver=new d(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateColor(this.color);this.inheritedAttributes=f(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}connectedCallback(){this.hydrated=true}render(){const t=i("gov-button",{key:"c52201d2fd9a489e8eb152e8f7b3080cc9d347f0",size:"s","aria-label":this.accessibleCloseLabel,type:"base",color:this.isBold?this.color:"neutral","on-gov-click":this.onCloseHandler.bind(this),class:m.close},i("gov-icon",{key:"c5d79b9980d755afae94643836d58ab2dd5b4e4f",name:"x-lg",type:"components"}));return i(o,{key:"f7c79cc67ee83527ff3c56d8e96f325b5366154f",class:this.h.classes(m.root),color:this.color,type:this.type,hydrated:this.hydrated},i("section",Object.assign({key:"dceb21332d31d55cb2f63d078efc5284439978ae",class:m.section},this.inheritedAttributes,{role:this.role}),this.h.hasSlot("icon")&&i("span",{key:"5dcf6a77672669228e8b94b7c39141624706254b"},i("slot",{key:"b158350430cf7249f9f7ea59fbf675879a195c39",name:"icon"})),i("div",{key:"17894bba1c6538d205a64e055aa6ee82825176a0",class:m.content},this.h.hasSlot("headline")?i(c,null,i("div",{class:m.headline},i("slot",{name:"headline"}),i("gov-button",{size:"s",type:"base",color:this.isBold?this.color:"neutral","aria-label":this.accessibleToggleLabel,"on-gov-click":()=>this.toggleContent=!this.toggleContent},i("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down",type:"components"}))),i("div",{hidden:!this.toggleContent,"aria-hidden":n(this.toggleContent)},i("slot",null))):i("slot",null)),this.closable&&t))}onCloseHandler(t){this.govClose.emit({component:m.root,ref:this.host,originalEvent:t})}get isBold(){return this.type==="bold"}get host(){return e(this)}static get watchers(){return{color:["validateColor"]}}};export{g as gov_infobar};
|
|
2
|
+
//# sourceMappingURL=p-5305e82e.entry.js.map
|