@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":["DialogClass","root","dialog","inner","header","title","content","close","footer","bodyFix","getFocusableElements","container","Array","from","querySelectorAll","GovDialog","constructor","hostRef","this","hydrated","open","blockClose","blockBackdropClose","role","labelTag","accessibleCloseLabel","h","govHost","host","labelId","createID","contentId","watchOpen","newValue","setFocus","finally","_a","lastActiveElementRef","focus","focusTrap","showDialog","document","body","classList","add","hideDialog","remove","componentDidRender","canValidateWcagOnRender","tick","validateAccessibility","dialogRef","activeElement","focusableEls","length","handleKeyDown","e","key","firstEl","lastEl","shiftKey","preventDefault","govClose","emit","addEventListener","connectedCallback","disconnectedCallback","render","Host","class","classes","ref","el","hidden","tabindex","boolToFocusValue","toBoolAttr","accessibleLabelledBy","accessibleDescribedBy","hasSlot","name","id","closeCtaRef","disabled","color","accessibleCloseLabelledBy","type","size","onCloseHandler","bind","slot","stopPropagation","catch","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-dialog/constants.ts","../../../packages/core/src/utils/dom.utils.ts","../../../packages/core/src/components/gov-dialog/gov-dialog.tsx"],"sourcesContent":["export const DialogClass = {\n\troot: 'gov-dialog',\n\tdialog: 'gov-dialog__dialog',\n\tinner: 'gov-dialog__inner',\n\theader: 'gov-dialog__header',\n\ttitle: 'gov-dialog__title',\n\tcontent: 'gov-dialog__content',\n\tclose: 'gov-dialog__close',\n\tfooter: 'gov-dialog__footer',\n\tbodyFix: 'body-fixed',\n}\n","export function getFocusableElements(container: HTMLElement) {\n\tif (!container) return [];\n\treturn Array.from(\n\t\tcontainer.querySelectorAll(\n\t\t\t'a[href], button:not([disabled]), textarea, input:not([type=\"hidden\"]), select, [tabindex]:not([tabindex=\"-1\"])'\n\t\t)\n\t);\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {boolToFocusValue, govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {DialogClass} from './constants'\nimport {tick} from \"../../utils/stencil.utils\";\nimport {getFocusableElements} from \"../../utils/dom.utils\";\n\n@Component({\n\ttag: 'gov-dialog',\n})\nexport class GovDialog {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate hydrated = false;\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\tprivate dialogRef?: HTMLDialogElement;\n\tprivate lastActiveElementRef?: HTMLElement;\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovDialogLabel')\n\t\tthis.contentId = createID('GovDialogContent')\n\t}\n\n\t@Element() host: HTMLGovDialogElement\n\n\t/**\n\t * Attribute for dialog window display\n\t */\n\t@Prop({mutable: true, reflect: true}) open = false\n\t/**\n\t * Attribute allowing blocking the dialog closing\n\t */\n\t@Prop({attribute: 'block-close'}) blockClose = false\n\t/**\n\t * Attribute allowing blocking the backdrop dialog closing\n\t */\n\t@Prop({attribute: 'block-backdrop-close'}) blockBackdropClose = false\n\t/**\n\t * Role of dialog\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the dialog label for correct semantic structure\n\t */\n\t@Prop({attribute: 'label-tag'}) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicates alternative labels elements\n\t */\n\t@Prop({attribute: 'accessible-labelled-by'}) accessibleLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the dialog.\n\t */\n\t@Prop({attribute: 'accessible-described-by'}) accessibleDescribedBy: string\n\t/**\n\t * Adds accessible label for the dialog close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the dialog window\n\t */\n\t@Prop({attribute: 'accessible-close-labelled-by'}) accessibleCloseLabelledBy: string\n\t/**\n\t * Emitted when a dialog window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tthis.setFocus().finally()\n\n\t\tif (!newValue) {\n\t\t\tthis.lastActiveElementRef?.focus();\n\t\t} else {\n\t\t\tthis.focusTrap();\n\t\t}\n\t}\n\n\tprivate showDialog() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(DialogClass.bodyFix)\n\t}\n\n\tprivate hideDialog() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(DialogClass.bodyFix)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\n\t\tif (this.open) {\n\t\t\tthis.showDialog()\n\t\t} else {\n\t\t\tthis.hideDialog()\n\t\t}\n\t}\n\n\tprivate focusTrap() {\n\t\tif (open && this.dialogRef) {\n\t\t\tthis.lastActiveElementRef = document.activeElement as HTMLElement;\n\t\t\tconst focusableEls = getFocusableElements(this.dialogRef) as HTMLElement[];\n\t\t\tif (focusableEls.length) {\n\t\t\t\tfocusableEls[0].focus();\n\t\t\t}\n\n\t\t\tconst handleKeyDown = (e: KeyboardEvent) => {\n\t\t\t\tif (e.key === \"Tab\" && this.dialogRef) {\n\t\t\t\t\tconst focusableEls = getFocusableElements(this.dialogRef);\n\t\t\t\t\tconst firstEl = focusableEls[0] as HTMLElement;\n\t\t\t\t\tconst lastEl = focusableEls[focusableEls.length - 1] as HTMLElement;\n\n\t\t\t\t\tif (!e.shiftKey && document.activeElement === lastEl) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tfirstEl.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif (e.shiftKey && document.activeElement === firstEl) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tlastEl.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (e.key === \"Escape\") {\n\t\t\t\t\tif (this.blockClose === false) {\n\t\t\t\t\t\tthis.hideDialog();\n\t\t\t\t\t\tthis.govClose.emit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t} else {\n\t\t\tthis.lastActiveElementRef?.focus();\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tdocument.body.classList.remove(DialogClass.bodyFix)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(DialogClass.root)} open={this.open} hydrated={this.hydrated}>\n\t\t\t\t<dialog\n\t\t\t\t\tref={el => (this.dialogRef = el)}\n\t\t\t\t\tclass={DialogClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex={boolToFocusValue(this.open)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.accessibleLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.accessibleDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={DialogClass.inner}>\n\t\t\t\t\t\t<div class={DialogClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.h.hasSlot('title') && (\n\t\t\t\t\t\t\t\t<span class={DialogClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tref={el => (this.closeCtaRef = el)}\n\t\t\t\t\t\t\t\tdisabled={this.blockClose}\n\t\t\t\t\t\t\t\tclass={DialogClass.close}\n\t\t\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\t\t\taria-labelledby={this.accessibleCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\tsize=\"m\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon slot=\"icon-start\" name=\"x-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={DialogClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{this.h.hasSlot('footer') && (\n\t\t\t\t\t\t\t<div class={DialogClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\"/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop\n\t\t\t\t\t\tdisabled={this.blockBackdropClose}\n\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\taria-labelled-by={this.accessibleCloseLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tif (this.blockClose === false) {\n\t\t\tthis.hideDialog()\n\t\t\tthis.govClose.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Sets the close button to focus\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tif (this.open && this.closeCtaRef) {\n\t\t\tthis.closeCtaRef.setFocus().catch()\n\t\t}\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateWcagRef(this.accessibleLabelledBy, 'accessible-labelled-by', DialogClass.root)\n\t\tvalidateWcagRef(this.accessibleDescribedBy, 'accessible-described-by', DialogClass.root)\n\t}\n}\n"],"mappings":"kTAAO,MAAMA,EAAc,CAC1BC,KAAM,aACNC,OAAQ,qBACRC,MAAO,oBACPC,OAAQ,qBACRC,MAAO,oBACPC,QAAS,sBACTC,MAAO,oBACPC,OAAQ,qBACRC,QAAS,cCTJ,SAAUC,EAAqBC,GACpC,IAAKA,EAAW,MAAO,GACvB,OAAOC,MAAMC,KACZF,EAAUG,iBACT,kHAGH,C,MCOaC,EAAS,MASrB,WAAAC,CAAAC,G,4CALQC,KAAAC,SAAW,MAgBmBD,KAAAE,KAAO,MAIXF,KAAAG,WAAa,MAIJH,KAAAI,mBAAqB,MAIrCJ,KAAAK,KAAyB,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BACtBC,KAAK,OACLC,KAAK,IAAG,eACMrE,KAAKsE,eAAeC,KAAKvE,OAEvCQ,EAAA,YAAA+B,IAAA,2CAAUiC,KAAK,aAAaV,KAAK,OAAOM,KAAK,iBAG/C5D,EAAA,OAAA+B,IAAA,2CAAKY,MAAOrE,EAAYM,QAAS2E,GAAI/D,KAAKa,WACzCL,EAAA,QAAA+B,IAAA,8CAEAvC,KAAKQ,EAAEqD,QAAQ,WACfrD,EAAA,OAAA+B,IAAA,2CAAKY,MAAOrE,EAAYQ,QACvBkB,EAAA,QAAA+B,IAAA,2CAAMuB,KAAK,cAMd9D,KAAKE,KACLM,EAAA,gBACCyD,SAAUjE,KAAKI,mBAAkB,aACrBJ,KAAKO,qBAAoB,mBACnBP,KAAKmE,0BAAyB,eAClCnE,KAAKsE,eAAeC,KAAKvE,QAErC,K,CAKC,cAAAsE,CAAehC,GACtBA,EAAEmC,kBACFnC,EAAEK,iBACF,GAAI3C,KAAKG,aAAe,MAAO,CAC9BH,KAAK2B,aACL3B,KAAK4C,SAASC,KAAKP,E,EAQrB,cAAMtB,GACL,GAAIhB,KAAKE,MAAQF,KAAKgE,YAAa,CAClChE,KAAKgE,YAAYhD,WAAW0D,O,EAS9B,2BAAM1C,GACL2C,EAAgB3E,KAAK2D,qBAAsB,yBAA0B7E,EAAYC,MACjF4F,EAAgB3E,KAAK4D,sBAAuB,0BAA2B9E,EAAYC,K","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["DialogClass","root","dialog","inner","header","title","content","close","footer","bodyFix","getFocusableElements","container","Array","from","querySelectorAll","GovDialog","constructor","hostRef","this","hydrated","open","blockClose","blockBackdropClose","role","labelTag","accessibleCloseLabel","h","govHost","host","labelId","createID","contentId","watchOpen","newValue","setFocus","finally","_a","lastActiveElementRef","focus","focusTrap","showDialog","document","body","classList","add","hideDialog","remove","componentDidRender","canValidateWcagOnRender","tick","validateAccessibility","dialogRef","activeElement","focusableEls","length","handleKeyDown","e","key","firstEl","lastEl","shiftKey","preventDefault","govClose","emit","addEventListener","connectedCallback","disconnectedCallback","render","Host","class","classes","ref","el","hidden","tabindex","boolToFocusValue","toBoolAttr","accessibleLabelledBy","accessibleDescribedBy","hasSlot","name","id","closeCtaRef","disabled","color","accessibleCloseLabelledBy","type","size","onCloseHandler","bind","slot","stopPropagation","catch","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-dialog/constants.ts","../../../packages/core/src/utils/dom.utils.ts","../../../packages/core/src/components/gov-dialog/gov-dialog.tsx"],"sourcesContent":["export const DialogClass = {\n\troot: 'gov-dialog',\n\tdialog: 'gov-dialog__dialog',\n\tinner: 'gov-dialog__inner',\n\theader: 'gov-dialog__header',\n\ttitle: 'gov-dialog__title',\n\tcontent: 'gov-dialog__content',\n\tclose: 'gov-dialog__close',\n\tfooter: 'gov-dialog__footer',\n\tbodyFix: 'body-fixed',\n}\n","export function getFocusableElements(container: HTMLElement) {\n\tif (!container) return [];\n\treturn Array.from(\n\t\tcontainer.querySelectorAll(\n\t\t\t'a[href], button:not([disabled]), textarea, input:not([type=\"hidden\"]), select, [tabindex]:not([tabindex=\"-1\"])'\n\t\t)\n\t);\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {boolToFocusValue, govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {DialogClass} from './constants'\nimport {tick} from \"../../utils/stencil.utils\";\nimport {getFocusableElements} from \"../../utils/dom.utils\";\n\n@Component({\n\ttag: 'gov-dialog',\n})\nexport class GovDialog {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate hydrated = false;\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\tprivate dialogRef?: HTMLDialogElement;\n\tprivate lastActiveElementRef?: HTMLElement;\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovDialogLabel')\n\t\tthis.contentId = createID('GovDialogContent')\n\t}\n\n\t@Element() host: HTMLGovDialogElement\n\n\t/**\n\t * Attribute for dialog window display\n\t */\n\t@Prop({mutable: true, reflect: true}) open = false\n\t/**\n\t * Attribute allowing blocking the dialog closing\n\t */\n\t@Prop({attribute: 'block-close'}) blockClose = false\n\t/**\n\t * Attribute allowing blocking the backdrop dialog closing\n\t */\n\t@Prop({attribute: 'block-backdrop-close'}) blockBackdropClose = false\n\t/**\n\t * Role of dialog\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the dialog label for correct semantic structure\n\t */\n\t@Prop({attribute: 'label-tag'}) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicates alternative labels elements\n\t */\n\t@Prop({attribute: 'accessible-labelled-by'}) accessibleLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the dialog.\n\t */\n\t@Prop({attribute: 'accessible-described-by'}) accessibleDescribedBy: string\n\t/**\n\t * Adds accessible label for the dialog close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the dialog window\n\t */\n\t@Prop({attribute: 'accessible-close-labelled-by'}) accessibleCloseLabelledBy: string\n\t/**\n\t * Emitted when a dialog window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tthis.setFocus().finally()\n\n\t\tif (!newValue) {\n\t\t\tthis.lastActiveElementRef?.focus();\n\t\t} else {\n\t\t\tthis.focusTrap();\n\t\t}\n\t}\n\n\tprivate showDialog() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(DialogClass.bodyFix)\n\t}\n\n\tprivate hideDialog() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(DialogClass.bodyFix)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\n\t\tif (this.open) {\n\t\t\tthis.showDialog()\n\t\t} else {\n\t\t\tthis.hideDialog()\n\t\t}\n\t}\n\n\tprivate focusTrap() {\n\t\tif (open && this.dialogRef) {\n\t\t\tthis.lastActiveElementRef = document.activeElement as HTMLElement;\n\t\t\tconst focusableEls = getFocusableElements(this.dialogRef) as HTMLElement[];\n\t\t\tif (focusableEls.length) {\n\t\t\t\tfocusableEls[0].focus();\n\t\t\t}\n\n\t\t\tconst handleKeyDown = (e: KeyboardEvent) => {\n\t\t\t\tif (e.key === \"Tab\" && this.dialogRef) {\n\t\t\t\t\tconst focusableEls = getFocusableElements(this.dialogRef);\n\t\t\t\t\tconst firstEl = focusableEls[0] as HTMLElement;\n\t\t\t\t\tconst lastEl = focusableEls[focusableEls.length - 1] as HTMLElement;\n\n\t\t\t\t\tif (!e.shiftKey && document.activeElement === lastEl) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tfirstEl.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif (e.shiftKey && document.activeElement === firstEl) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tlastEl.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (e.key === \"Escape\") {\n\t\t\t\t\tif (this.blockClose === false) {\n\t\t\t\t\t\tthis.hideDialog();\n\t\t\t\t\t\tthis.govClose.emit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\t} else {\n\t\t\tthis.lastActiveElementRef?.focus();\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tdocument.body.classList.remove(DialogClass.bodyFix)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(DialogClass.root)} open={this.open} hydrated={this.hydrated}>\n\t\t\t\t<dialog\n\t\t\t\t\tref={el => (this.dialogRef = el)}\n\t\t\t\t\tclass={DialogClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex={boolToFocusValue(this.open)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.accessibleLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.accessibleDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={DialogClass.inner}>\n\t\t\t\t\t\t<div class={DialogClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.h.hasSlot('title') && (\n\t\t\t\t\t\t\t\t<span class={DialogClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tref={el => (this.closeCtaRef = el)}\n\t\t\t\t\t\t\t\tdisabled={this.blockClose}\n\t\t\t\t\t\t\t\tclass={DialogClass.close}\n\t\t\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\t\t\taria-labelledby={this.accessibleCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\tsize=\"m\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon slot=\"icon-start\" name=\"x-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={DialogClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{this.h.hasSlot('footer') && (\n\t\t\t\t\t\t\t<div class={DialogClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\"/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop\n\t\t\t\t\t\tdisabled={this.blockBackdropClose}\n\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\taria-labelled-by={this.accessibleCloseLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tif (this.blockClose === false) {\n\t\t\tthis.hideDialog()\n\t\t\tthis.govClose.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Sets the close button to focus\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tif (this.open && this.closeCtaRef) {\n\t\t\tthis.closeCtaRef.setFocus().catch()\n\t\t}\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateWcagRef(this.accessibleLabelledBy, 'accessible-labelled-by', DialogClass.root)\n\t\tvalidateWcagRef(this.accessibleDescribedBy, 'accessible-described-by', DialogClass.root)\n\t}\n}\n"],"mappings":"kTAAO,MAAMA,EAAc,CAC1BC,KAAM,aACNC,OAAQ,qBAC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 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as a}from"./p-ClISz4NF.js";import{g as o,j as h,k as c}from"./p-B6CqPcY_.js";import{g as n,a as r,t as d}from"./p-CoD1xawt.js";import{v as l}from"./p-NOJjz9dT.js";import{c as p}from"./p-vN03FcXN.js";import{p as m}from"./p-Ccwpa1ck.js";import{A as f,a as v}from"./p-Bz_RzYFb.js";import{i as u}from"./p-CzXeijOj.js";import"./p-BcQO4NH2.js";import"./p-CQvUntGY.js";import"./p-EeKNA85D.js";import"./p-U40vKHrs.js";import"./p-DYcNEwSZ.js";import"./p-DBXGhafv.js";import"./p-CgDnDrq5.js";import"./p-DNztiAH0.js";const g=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.size="m";this.required=false;this.disabled=false;this.optionsState=[];this.inheritedAttributes={};this.h=n(this.host);this.f=o(this.h);this.selectId=p("GovSelect")}validateSize(t){l(c,t,h.root)}watchOptions(t){this.optionsState=m(t)}watchControlAttrs(){this.passControlAttrs()}watchValue(){this.syncSelectValue()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",r(this.invalid));this.f.passAttrToControl("success",r(this.success));this.f.passAttrToControl("disabled",r(this.disabled));this.f.passAttrToControl("type","select")}componentDidLoad(){this.attributeObserver=new f(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(v);this.syncSelectValue()}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}componentWillLoad(){this.validateSize(this.size);this.optionsState=m(this.options);this.inheritedAttributes=u(this.host)}async componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required))}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}syncSelectValue(){if(this.selectRef&&this.value!==undefined&&this.selectRef.value!==this.value){this.selectRef.value=this.value}}render(){return i(e,{key:"d29638f5868731a2324971d197dcd636364a4f6c",class:h.root,size:this.size},this.h.hasSlot("prefix")&&i("slot",{key:"41cc14ee33022a4cf6d10c3d86c8915551221e94",name:"prefix"}),i("span",{key:"f9c167589fa81f0a060a13d9a31d16ab642d5ad2",class:"element"},i("select",Object.assign({key:"2dd5c948ccc7b65674e7d7f730cb2c9567287668",id:this.identifier||this.selectId,onFocus:this.onFocusHandler.bind(this),onChange:this.onChangeHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,name:this.name,disabled:this.disabled,ref:t=>this.selectRef=t},this.inheritedAttributes,{"aria-disabled":d(this.disabled),"aria-required":d(this.required),"aria-invalid":d(this.invalid)}),i("slot",{key:"f6f0b21c9e43e1216446bce09c57a757a40d7b7b"}),Array.isArray(this.optionsState)&&this.optionsState.map((t=>{var s;return i("option",{value:t.value,selected:t.value===this.value,disabled:t===null||t===void 0?void 0:t.disabled},(s=t.label)!==null&&s!==void 0?s:t.value)}))),this.success&&i("gov-icon",{key:"d94a0191bc7d02d55450dfad627457101226ad22",class:"validation-icon",name:"check-lg",type:"components"}),this.invalid&&i("gov-icon",{key:"84ecf7197313c8a145efa54730d22068679df3f5",class:"validation-icon",name:"exclamation-lg",type:"components"}),i("gov-icon",{key:"1a219d4d230466ac15e316eee16d4a55db1889fe",class:"arrow-icon",name:"chevron-down",type:"components"})),this.h.hasSlot("sufix")&&i("slot",{key:"c7f4816548e3494de94f7ff0dd33f6c904acc14b",name:"sufix"}))}onFocusHandler(t){this.focused=true;this.govFocus.emit({component:h.root,originalEvent:t,value:this.value})}onBlurHandler(t){this.focused=false;this.govBlur.emit({component:h.root,originalEvent:t,value:this.value})}onChangeHandler(t){this.value=t.target.value;t.stopPropagation();this.govChange.emit({component:h.root,originalEvent:t,value:this.value})}async setFocus(t){return this.selectRef.focus(t)}async getRef(){return this.selectRef}get host(){return a(this)}static get watchers(){return{size:["validateSize","watchControlAttrs"],options:["watchOptions"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"],value:["watchValue"]}}};export{g as gov_form_select};
|
|
2
|
+
//# sourceMappingURL=p-d9d29f50.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovFormSelect","constructor","hostRef","this","size","required","disabled","optionsState","inheritedAttributes","h","govHost","host","f","govForm","selectId","createID","validateSize","newValue","validateProp","FormSelectSizes","FormSelectClass","root","watchOptions","propsValueToArray","watchControlAttrs","passControlAttrs","watchValue","syncSelectValue","passAttrToControl","toBoolAttr","invalid","success","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","disconnectedCallback","_a","stopObserving","componentWillLoad","options","inheritAriaAttributes","componentDidRender","passAttrToLabel","String","removeAttribute","Object","assign","selectRef","value","undefined","render","Host","key","class","hasSlot","name","id","identifier","onFocus","onFocusHandler","bind","onChange","onChangeHandler","onBlur","onBlurHandler","ref","el","toBoolAttrIfDefined","Array","isArray","map","option","selected","label","type","e","focused","govFocus","emit","component","originalEvent","govBlur","target","stopPropagation","govChange","setFocus","focus","getRef"],"sources":["../../../packages/core/src/components/gov-form/select/gov-form-select.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {createID} from '../../../utils/string.utils'\nimport {FormSelectClass, FormSelectSizes, FormSelectSizesType,} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-form-select',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Options of select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | FormSelectOption[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop({reflect: true}) readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() optionsState: FormSelectOption[] = []\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | FormSelectOption[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.syncSelectValue()\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('type', 'select')\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\n\t\tthis.syncSelectValue()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate syncSelectValue() {\n\t\tif (this.selectRef && this.value !== undefined && this.selectRef.value !== this.value) {\n\t\t\tthis.selectRef.value = this.value\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</select>\n\t\t\t\t\t{this.success && <gov-icon class=\"validation-icon\" name=\"check-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon class=\"validation-icon\" name=\"exclamation-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t<gov-icon class=\"arrow-icon\" name=\"chevron-down\" type=\"components\"></gov-icon>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n}\n"],"mappings":"qiBAiBaA,EAAa,MAQzB,WAAAC,CAAAC,G,gHAsBiBC,KAAAC,KAA6B,IAS7BD,KAAAE,SAAoB,MASLF,KAAAG,SAAoB,MAkB3CH,KAAAI,aAAmC,GAyBnCJ,KAAAK,oBAAkC,GAlF1CL,KAAKM,EAAIC,EAAQP,KAAKQ,MACtBR,KAAKS,EAAIC,EAAQV,KAAKM,GACtBN,KAAKW,SAAWC,EAAS,YACzB,CAyDD,YAAAC,CAAaC,GACZC,EAAaC,EAAiBF,EAAUG,EAAgBC,K,CAIzD,YAAAC,CAAaL,GACZd,KAAKI,aAAegB,EAAkBN,E,CAOvC,iBAAAO,GACCrB,KAAKsB,kB,CAIN,UAAAC,GACCvB,KAAKwB,iB,CAKE,gBAAAF,GAC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3B,MAAOjD,KAAKiD,O,CAIN,aAAAgB,CAAcW,GACrB5E,KAAK6E,QAAU,MACf7E,KAAKkF,QAAQH,KAAK,CACjBC,UAAW/D,EAAgBC,KAC3B+D,cAAeL,EACf3B,MAAOjD,KAAKiD,O,CAIN,eAAAc,CAAgBa,GACvB5E,KAAKiD,MAAS2B,EAAEO,OAA6BlC,MAC7C2B,EAAEQ,kBACFpF,KAAKqF,UAAUN,KAAK,CACnBC,UAAW/D,EAAgBC,KAC3B+D,cAAeL,EACf3B,MAAOjD,KAAKiD,O,CAQd,cAAMqC,CAAS9C,GACd,OAAOxC,KAAKgD,UAAUuC,MAAM/C,E,CAO7B,YAAMgD,GACL,OAAOxF,KAAKgD,S","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["GovFormSelect","constructor","hostRef","this","size","required","disabled","optionsState","inheritedAttributes","h","govHost","host","f","govForm","selectId","createID","validateSize","newValue","validateProp","FormSelectSizes","FormSelectClass","root","watchOptions","propsValueToArray","watchControlAttrs","passControlAttrs","watchValue","syncSelectValue","passAttrToControl","toBoolAttr","invalid","success","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","disconnectedCallback","_a","stopObserving","componentWillLoad","options","inheritAriaAttributes","componentDidRender","passAttrToLabel","String","removeAttribute","Object","assign","selectRef","value","undefined","render","Host","key","class","hasSlot","name","id","identifier","onFocus","onFocusHandler","bind","onChange","onChangeHandler","onBlur","onBlurHandler","ref","el","toBoolAttrIfDefined","Array","isArray","map","option","selected","label","type","e","focused","govFocus","emit","component","originalEvent","govBlur","target","stopPropagation","govChange","setFocus","focus","getRef"],"sources":["../../../packages/core/src/components/gov-form/select/gov-form-select.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {createID} from '../../../utils/string.utils'\nimport {FormSelectClass, FormSelectSizes, FormSelectSizesType,} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-form-select',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Options of select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | FormSelectOption[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop({reflect: true}) readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() optionsState: FormSelectOption[] = []\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | FormSelectOption[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.syncSelectValue()\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('type', 'select')\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\n\t\tthis.syncSelectValue()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate syncSelectValue() {\n\t\tif (this.selectRef && this.value !== undefined && this.selectRef.value !== this.value) {\n\t\t\tthis.selectRef.value = this.value\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</select>\n\t\t\t\t\t{this.success && <gov-icon class=\"validation-icon\" name=\"check-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon class=\"validation-icon\" name=\"exclamation-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t<gov-icon class=\"arrow-icon\" name=\"chevron-down\" type=\"components\"></gov-icon>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n}\n"],"mappings":"qiBAiBaA,EAAa,MAQzB,WAAAC,CAAAC,G,gHAsBiBC,KAAIC,KAAyB,IAS7BD,KAAQE,SAAY,MASLF,KAAQG,SAAY,MAkB3CH,KAAYI,aAAuB,GAyBnCJ,KAAmBK,oBAAe,GAlF1CL,KAAKM,EAAIC,EAAQP,KAAKQ,MACtBR,KAAKS,EAAIC,EAAQ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,IAAA,2CAAUC,MAAM,aAAaE,KAAK,eAAemB,KAAK,gBAEtD3E,KAAKM,EAAEiD,QAAQ,UAAYjD,EAAA,QAAA+C,IAAA,2CAAMG,KAAK,U,CAKlC,cAAAI,CAAegB,GACtB5E,KAAK6E,QAAU,KACf7E,KAAK8E,SAASC,KAAK,CAClBC,UAAW/D,EAAgBC,KAC3B+D,cAAeL,EACf3B,MAAOjD,KAAKiD,O,CAIN,aAAAgB,CAAcW,GACrB5E,KAAK6E,QAAU,MACf7E,KAAKkF,QAAQH,KAAK,CACjBC,UAAW/D,EAAgBC,KAC3B+D,cAAeL,EACf3B,MAAOjD,KAAKiD,O,CAIN,eAAAc,CAAgBa,GACvB5E,KAAKiD,MAAS2B,EAAEO,OAA6BlC,MAC7C2B,EAAEQ,kBACFpF,KAAKqF,UAAUN,KAAK,CACnBC,UAAW/D,EAAgBC,KAC3B+D,cAAeL,EACf3B,MAAOjD,KAAKiD,O,CAQd,cAAMqC,CAAS9C,GACd,OAAOxC,KAAKgD,UAAUuC,MAAM/C,E,CAO7B,YAAMgD,GACL,OAAOxF,KAAKgD,S","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as o}from"./p-ClISz4NF.js";import{v as a}from"./p-NOJjz9dT.js";import{T as h,a as r,b as n,c,d as l}from"./p-D4TGB274.js";import{g as d,a as f,b as p}from"./p-CoD1xawt.js";import{h as b}from"./p-DNztiAH0.js";import{p as m}from"./p-GYov8gU1.js";import{A as u,a as v}from"./p-Bz_RzYFb.js";import{i as g}from"./p-CzXeijOj.js";import"./p-CgDnDrq5.js";import"./p-CQvUntGY.js";import"./p-BcQO4NH2.js";import"./p-U40vKHrs.js";const y=class{constructor(i){t(this,i);this.govChange=s(this,"gov-change");this.triggerRefs={};this.type="text";this.size="m";this.color="primary";this.orientation="horizontal";this.direction="row";this.controllers=[];this.focusIndex=0;this.inheritedAttributes={};this.h=d(this.host)}validateType(t){a(n,t,r.root)}validateColor(t){a(c,t,r.root)}validateSize(t){a(l,t,r.root)}componentDidLoad(){this.attributeObserver=new u(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(v)}componentWillLoad(){this.prepareControllers();this.validateSize(this.size);this.inheritedAttributes=g(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})}prepareControllers(t=false){this.controllers=[];const s=[];this.host.querySelectorAll(":scope > "+h.root).forEach((t=>{const i=Promise.all([t.getIdentifier(),t.getTriggerIdentifier(),t.getDisableState()]).then((([s,i,e])=>{const o=typeof t.getAttribute("default")==="string";const a=m(t.getAttribute("icon-start"));const h=m(t.getAttribute("icon-end"));return{label:t.getAttribute("label"),direction:t.getAttribute("direction"),contentIdentifier:s,disabled:e,triggerIdentifier:i,element:t,active:false,default:o,iconStart:a,iconEnd:h}}));s.push(i)}));Promise.all(s).then((s=>{if(t===false){let t=s.findIndex((t=>t.default));if(t===-1)t=0;this.focusIndex=t;s[t].active=true}else if(this.focusIndex>-1&&b(s,this.focusIndex)){s[this.focusIndex].active=true}const i=s.findIndex((t=>t.active&&t.disabled));if(i>-1){s[i].active=false;const t=s.findIndex((t=>!t.disabled));if(t>-1){s[t].active=true;this.focusIndex=t}}this.controllers=[...s];this.reRender()}))}setActiveByIdentifier(t){const s=[];this.controllers.map((i=>{i.active=t===i.triggerIdentifier||t===i.contentIdentifier;s.push(i)}));this.controllers=[...s]}reRender(){this.controllers.map((t=>{t.element.setActiveStatus(t.active).catch()}))}render(){return i(e,{key:"5dfd9d6ca4a17c425a96a1f766d599de80db6028",class:this.h.classes(r.root),size:this.size,color:this.color,type:this.type,direction:this.direction,onKeyDown:this.onKeydownHandler.bind(this)},i("div",Object.assign({key:"a195131ab673e7b9906777757f5c7e8c8421ddad",class:r.tabs,role:"tablist"},this.inheritedAttributes),i("ul",{key:"3dd46399f5054881f71242b2f184ebfb11fac51e",class:r.list},this.controllers.map((t=>i("li",{class:r.item},this.type=="text"?i("button",{class:r.btn,id:t.triggerIdentifier,role:"tab",type:"button",onClick:()=>this.onSelectHandler(t),disabled:t.disabled,"aria-disabled":f(t.disabled),"aria-selected":f(t.active),"aria-controls":t.contentIdentifier,tabindex:t.active&&!t.disabled?0:-1,ref:s=>this.triggerRefs[t.triggerIdentifier]=s},t.iconStart?i("gov-icon",{name:t.iconStart.name,type:t.iconStart.type}):null,t.label,t.iconEnd?i("gov-icon",{name:t.iconEnd.name,type:t.iconEnd.type}):null):i("gov-chip",{role:"tab",tag:"button",identifier:t.triggerIdentifier,"aria-selected":p(t.active),"aria-controls":t.contentIdentifier,focusable:t.active,disabled:t.disabled,color:this.color,size:this.size==="xs"?"xs":this.size==="s"?"s":"m",type:t.active?"solid":"outlined",ref:s=>this.triggerRefs[t.triggerIdentifier]=s,"on-gov-click":()=>this.onSelectHandler(t)},t.iconStart?i("gov-icon",{name:t.iconStart.name,type:t.iconStart.type,slot:"icon-start"}):null,t.label,t.iconEnd?i("gov-icon",{name:t.iconEnd.name,type:t.iconEnd.type,slot:"icon-end"}):null)))))),i("slot",{key:"5fc402a27b6236ca10c8f3370f946b7ceadb5342"}))}getCurrentTab(){return this.controllers.find((t=>t.active))||null}onSelectHandler(t){const s=this.controllers.findIndex((s=>s.triggerIdentifier===t.triggerIdentifier));this.focusIndex=s;this.setActiveByIdentifier(t.triggerIdentifier);this.reRender();this.govChange.emit(this.getCurrentTab().element)}onKeydownHandler(t){const s=t.keyCode;t.stopPropagation();this.goToPrevNext(s)}goToPrevNext(t){if([37,38,39,40].includes(t)){if(false===(this.focusIndex>=0&&this.focusIndex<=this.controllers.length-1)){return}this.controllers[this.focusIndex].active=false;if(t===39||t===40){this.focusIndex++;if(this.focusIndex>=this.controllers.length){this.focusIndex=0}if(this.controllers[this.focusIndex].disabled){this.goToPrevNext(40)}}else if(t===37||t===38){this.focusIndex--;if(this.focusIndex<0){this.focusIndex=this.controllers.length-1}if(this.controllers[this.focusIndex].disabled){this.goToPrevNext(38)}}if(this.focusIndex>=0&&this.focusIndex<=this.controllers.length-1){const t=this.controllers[this.focusIndex];t.active=true;const s=this.triggerRefs[t.triggerIdentifier];if(s.nodeName.toLowerCase()==="gov-chip"){this.triggerRefs[t.triggerIdentifier].setFocus()}else{this.triggerRefs[t.triggerIdentifier].focus()}this.controllers=[...this.controllers];this.reRender();this.govChange.emit(this.getCurrentTab().element)}}}async refresh(){this.prepareControllers()}async currentTab(){return this.getCurrentTab().element||null}async setActiveTab(t){this.setActiveByIdentifier(t);this.reRender()}async rerender(){this.prepareControllers(true)}get host(){return o(this)}static get watchers(){return{type:["validateType"],color:["validateColor"],size:["validateSize"]}}};export{y as gov_tabs};
|
|
2
|
+
//# sourceMappingURL=p-da997fb3.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovTabs","constructor","hostRef","this","triggerRefs","type","size","color","orientation","direction","controllers","focusIndex","inheritedAttributes","h","govHost","host","validateType","newValue","validateProp","TabTypes","TabsClass","root","validateColor","TabColors","validateSize","TabSizes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","prepareControllers","inheritAriaAttributes","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","skipDefault","promises","querySelectorAll","TabsItemClass","forEach","tab","controlItem","Promise","all","getIdentifier","getTriggerIdentifier","getDisableState","then","identifier","triggerIdentifier","disabled","isDefault","getAttribute","iconStart","prepareIconFormat","iconEnd","label","contentIdentifier","element","active","default","push","defaultTabIndex","findIndex","controller","hasOwnProperty","isWrongCombination","firstGoodTab","reRender","setActiveByIdentifier","temp","map","item","control","setActiveStatus","catch","render","Host","key","class","classes","onKeyDown","onKeydownHandler","bind","tabs","role","list","btn","id","onClick","onSelectHandler","toBoolAttr","tabindex","ref","el","name","tag","booleanString","focusable","slot","getCurrentTab","find","index","t","govChange","emit","e","keyCode","stopPropagation","goToPrevNext","includes","length","current","trigger","nodeName","toLowerCase","setFocus","focus","refresh","currentTab","setActiveTab","rerender"],"sources":["../../../packages/core/src/components/gov-tabs/gov-tabs.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tColorType,\n\tTabColors,\n\tTabOrientationType,\n\tTabsClass,\n\tTabsItemClass,\n\tTabSizes,\n\tTabSizeType,\n\tTabType,\n\tTabTypes\n} from \"./constants\"\nimport {GovTabControllerItem} from \"./gov-tabs.types\"\nimport {booleanString, govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {Nullable} from \"../../types/interfaces\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {hasOwnProperty} from \"../../utils/helpers.types\";\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n\n@Component({\n\ttag: \"gov-tabs\",\n})\nexport class GovTabs {\n\tprivate h: GovHost\n\tprivate triggerRefs: Record<string, HTMLButtonElement | HTMLGovChipElement> = {}\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTabsElement\n\t/**\n\t * Tabs type\n\t */\n\t@Prop() readonly type: TabType = \"text\"\n\t/**\n\t * Tabs size.\n\t */\n\t@Prop() readonly size?: TabSizeType = 'm'\n\t/**\n\t * Style variation of the tab chips.\n\t */\n\t@Prop() readonly color?: ColorType = \"primary\"\n\t/**\n\t * Tabs orientation\n\t */\n\t@Prop() readonly orientation: TabOrientationType = \"horizontal\"\n\t/**\n\t * Icon and description display direction\n\t */\n\t@Prop({reflect: true}) readonly direction: 'row' | 'column' = 'row'\n\t/**\n\t * Emitted when the tab is changed.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<HTMLGovTabsItemElement>\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(TabTypes, newValue, TabsClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TabColors, newValue, TabsClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TabSizes, newValue, TabsClass.root)\n\t}\n\n\t@State() controllers: GovTabControllerItem[] = []\n\t@State() focusIndex = 0\n\t@State() inheritedAttributes: Attributes = {}\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.prepareControllers()\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\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\tprivate prepareControllers(skipDefault = false): void {\n\t\tthis.controllers = []\n\t\tconst promises: Promise<GovTabControllerItem>[] = []\n\t\tthis.host.querySelectorAll(':scope > ' + TabsItemClass.root).forEach((tab: HTMLGovTabsItemElement) => {\n\t\t\tconst controlItem = Promise.all([\n\t\t\t\ttab.getIdentifier(),\n\t\t\t\ttab.getTriggerIdentifier(),\n\t\t\t\ttab.getDisableState()\n\t\t\t]).then(([identifier, triggerIdentifier, disabled]) => {\n\t\t\t\tconst isDefault = typeof tab.getAttribute(\"default\") === \"string\"\n\t\t\t\tconst iconStart = prepareIconFormat(tab.getAttribute('icon-start'))\n\t\t\t\tconst iconEnd = prepareIconFormat(tab.getAttribute('icon-end'))\n\t\t\t\treturn {\n\t\t\t\t\tlabel: tab.getAttribute(\"label\"),\n\t\t\t\t\tdirection: tab.getAttribute(\"direction\"),\n\t\t\t\t\tcontentIdentifier: identifier,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\ttriggerIdentifier: triggerIdentifier,\n\t\t\t\t\telement: tab,\n\t\t\t\t\tactive: false,\n\t\t\t\t\tdefault: isDefault,\n\t\t\t\t\ticonStart,\n\t\t\t\t\ticonEnd\n\t\t\t\t}\n\t\t\t})\n\t\t\tpromises.push(controlItem)\n\t\t});\n\t\tPromise.all(promises).then(controllers => {\n\t\t\tif (skipDefault === false) {\n\t\t\t\tlet defaultTabIndex = controllers.findIndex(controller => controller.default)\n\t\t\t\tif (defaultTabIndex === -1) defaultTabIndex = 0\n\t\t\t\tthis.focusIndex = defaultTabIndex\n\t\t\t\tcontrollers[defaultTabIndex].active = true\n\t\t\t} else if (this.focusIndex > -1 && hasOwnProperty(controllers, this.focusIndex)) {\n\t\t\t\tcontrollers[this.focusIndex].active = true\n\t\t\t}\n\t\t\tconst isWrongCombination = controllers.findIndex((controller) => controller.active && controller.disabled)\n\t\t\tif (isWrongCombination > -1) {\n\t\t\t\tcontrollers[isWrongCombination].active = false;\n\t\t\t\tconst firstGoodTab = controllers.findIndex((controller) => !controller.disabled)\n\t\t\t\tif (firstGoodTab > -1) {\n\t\t\t\t\tcontrollers[firstGoodTab].active = true\n\t\t\t\t\tthis.focusIndex = firstGoodTab;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.controllers = [...controllers]\n\t\t\tthis.reRender()\n\t\t})\n\t}\n\n\tprivate setActiveByIdentifier(identifier: string) {\n\t\tconst temp = []\n\t\tthis.controllers.map(item => {\n\t\t\titem.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier\n\t\t\ttemp.push(item)\n\t\t})\n\t\tthis.controllers = [...temp]\n\t}\n\n\tprivate reRender() {\n\t\tthis.controllers.map(control => {\n\t\t\tcontrol.element.setActiveStatus(control.active).catch()\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TabsClass.root)}\n\t\t\t\tsize={this.size}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tdirection={this.direction}\n\t\t\t\tonKeyDown={this.onKeydownHandler.bind(this)}\n\t\t\t>\n\t\t\t\t<div class={TabsClass.tabs}\n\t\t\t\t\t role=\"tablist\"\n\t\t\t\t\t {...this.inheritedAttributes}>\n\t\t\t\t\t<ul class={TabsClass.list}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<li class={TabsClass.item}>\n\t\t\t\t\t\t\t\t{this.type == \"text\" ? (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tclass={TabsClass.btn}\n\t\t\t\t\t\t\t\t\t\tid={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\taria-disabled={toBoolAttr(control.disabled)}\n\t\t\t\t\t\t\t\t\t\taria-selected={toBoolAttr(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\ttabindex={control.active && !control.disabled ? 0 : -1}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLButtonElement)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<gov-chip\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttag={'button'}\n\t\t\t\t\t\t\t\t\t\tidentifier={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\taria-selected={booleanString(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\tfocusable={control.active}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\tsize={this.size === \"xs\" ? \"xs\" : (this.size === \"s\" ? \"s\" : \"m\")}\n\t\t\t\t\t\t\t\t\t\ttype={control.active ? \"solid\" : \"outlined\"}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLGovChipElement)}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-start\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-end\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</gov-chip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate getCurrentTab(): GovTabControllerItem | null {\n\t\treturn this.controllers.find(control => control.active) || null\n\t}\n\n\tprivate onSelectHandler(control: GovTabControllerItem) {\n\t\tconst index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);\n\t\tthis.focusIndex = index\n\t\tthis.setActiveByIdentifier(control.triggerIdentifier)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onKeydownHandler(e: KeyboardEvent) {\n\t\tconst keyCode = e.keyCode\n\n\t\te.stopPropagation()\n\t\tthis.goToPrevNext(keyCode)\n\t}\n\n\tprivate goToPrevNext(keyCode: number) {\n\t\tif ([37, 38, 39, 40].includes(keyCode)) {\n\t\t\tif (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.controllers[this.focusIndex].active = false\n\n\t\t\tif (keyCode === 39 || keyCode === 40) {\n\t\t\t\tthis.focusIndex++\n\t\t\t\tif (this.focusIndex >= this.controllers.length) {\n\t\t\t\t\tthis.focusIndex = 0\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(40)\n\t\t\t\t}\n\t\t\t} else if (keyCode === 37 || keyCode === 38) {\n\t\t\t\tthis.focusIndex--\n\t\t\t\tif (this.focusIndex < 0) {\n\t\t\t\t\tthis.focusIndex = this.controllers.length - 1\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(38)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {\n\t\t\t\tconst current = this.controllers[this.focusIndex]\n\t\t\t\tcurrent.active = true\n\t\t\t\tconst trigger = this.triggerRefs[current.triggerIdentifier]\n\t\t\t\tif (trigger.nodeName.toLowerCase() === 'gov-chip') {\n\t\t\t\t\t(this.triggerRefs[current.triggerIdentifier] as HTMLGovChipElement).setFocus()\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerRefs[current.triggerIdentifier].focus()\n\t\t\t\t}\n\n\t\t\t\tthis.controllers = [...this.controllers]\n\t\t\t\tthis.reRender()\n\t\t\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync refresh(): Promise<void> {\n\t\tthis.prepareControllers()\n\t}\n\n\t/**\n\t * Returns the currently selected tabs-item\n\t */\n\t@Method()\n\tasync currentTab(): Promise<Nullable<HTMLGovTabsItemElement>> {\n\t\treturn this.getCurrentTab().element || null\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync setActiveTab(identifier: string): Promise<void> {\n\t\tthis.setActiveByIdentifier(identifier)\n\t\tthis.reRender()\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync rerender(): Promise<void> {\n\t\tthis.prepareControllers(true);\n\t}\n}\n"],"mappings":"8cA2BaA,EAAO,MAKnB,WAAAC,CAAAC,G,8CAHQC,KAAAC,YAAsE,GAW7DD,KAAAE,KAAgB,OAIhBF,KAAAG,KAAqB,IAIrBH,KAAAI,MAAoB,UAIpBJ,KAAAK,YAAkC,aAInBL,KAAAM,UAA8B,MAqBrDN,KAAAO,YAAsC,GACtCP,KAAAQ,WAAa,EACbR,K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,aACL,GAAIR,KAAKQ,WAAa,EAAG,CACxBR,KAAKQ,WAAaR,KAAKO,YAAY4G,OAAS,C,CAE7C,GAAInH,KAAKO,YAAYP,KAAKQ,YAAY8C,SAAU,CAC/CtD,KAAKiH,aAAa,G,EAIpB,GAAIjH,KAAKQ,YAAc,GAAKR,KAAKQ,YAAcR,KAAKO,YAAY4G,OAAS,EAAG,CAC3E,MAAMC,EAAUpH,KAAKO,YAAYP,KAAKQ,YACtC4G,EAAQrD,OAAS,KACjB,MAAMsD,EAAUrH,KAAKC,YAAYmH,EAAQ/D,mBACzC,GAAIgE,EAAQC,SAASC,gBAAkB,WAAY,CACjDvH,KAAKC,YAAYmH,EAAQ/D,mBAA0CmE,U,KAC9D,CACNxH,KAAKC,YAAYmH,EAAQ/D,mBAAmBoE,O,CAG7CzH,KAAKO,YAAc,IAAIP,KAAKO,aAC5BP,KAAKwE,WACLxE,KAAK4G,UAAUC,KAAK7G,KAAKwG,gBAAgB1C,Q,GAS5C,aAAM4D,GACL1H,KAAK+B,oB,CAON,gBAAM4F,GACL,OAAO3H,KAAKwG,gBAAgB1C,SAAW,I,CAOxC,kBAAM8D,CAAaxE,GAClBpD,KAAKyE,sBAAsBrB,GAC3BpD,KAAKwE,U,CAON,cAAMqD,GACL7H,KAAK+B,mBAAmB,K","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["GovTabs","constructor","hostRef","this","triggerRefs","type","size","color","orientation","direction","controllers","focusIndex","inheritedAttributes","h","govHost","host","validateType","newValue","validateProp","TabTypes","TabsClass","root","validateColor","TabColors","validateSize","TabSizes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","prepareControllers","inheritAriaAttributes","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","skipDefault","promises","querySelectorAll","TabsItemClass","forEach","tab","controlItem","Promise","all","getIdentifier","getTriggerIdentifier","getDisableState","then","identifier","triggerIdentifier","disabled","isDefault","getAttribute","iconStart","prepareIconFormat","iconEnd","label","contentIdentifier","element","active","default","push","defaultTabIndex","findIndex","controller","hasOwnProperty","isWrongCombination","firstGoodTab","reRender","setActiveByIdentifier","temp","map","item","control","setActiveStatus","catch","render","Host","key","class","classes","onKeyDown","onKeydownHandler","bind","tabs","role","list","btn","id","onClick","onSelectHandler","toBoolAttr","tabindex","ref","el","name","tag","booleanString","focusable","slot","getCurrentTab","find","index","t","govChange","emit","e","keyCode","stopPropagation","goToPrevNext","includes","length","current","trigger","nodeName","toLowerCase","setFocus","focus","refresh","currentTab","setActiveTab","rerender"],"sources":["../../../packages/core/src/components/gov-tabs/gov-tabs.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tColorType,\n\tTabColors,\n\tTabOrientationType,\n\tTabsClass,\n\tTabsItemClass,\n\tTabSizes,\n\tTabSizeType,\n\tTabType,\n\tTabTypes\n} from \"./constants\"\nimport {GovTabControllerItem} from \"./gov-tabs.types\"\nimport {booleanString, govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {Nullable} from \"../../types/interfaces\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {hasOwnProperty} from \"../../utils/helpers.types\";\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n\n@Component({\n\ttag: \"gov-tabs\",\n})\nexport class GovTabs {\n\tprivate h: GovHost\n\tprivate triggerRefs: Record<string, HTMLButtonElement | HTMLGovChipElement> = {}\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTabsElement\n\t/**\n\t * Tabs type\n\t */\n\t@Prop() readonly type: TabType = \"text\"\n\t/**\n\t * Tabs size.\n\t */\n\t@Prop() readonly size?: TabSizeType = 'm'\n\t/**\n\t * Style variation of the tab chips.\n\t */\n\t@Prop() readonly color?: ColorType = \"primary\"\n\t/**\n\t * Tabs orientation\n\t */\n\t@Prop() readonly orientation: TabOrientationType = \"horizontal\"\n\t/**\n\t * Icon and description display direction\n\t */\n\t@Prop({reflect: true}) readonly direction: 'row' | 'column' = 'row'\n\t/**\n\t * Emitted when the tab is changed.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<HTMLGovTabsItemElement>\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(TabTypes, newValue, TabsClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TabColors, newValue, TabsClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TabSizes, newValue, TabsClass.root)\n\t}\n\n\t@State() controllers: GovTabControllerItem[] = []\n\t@State() focusIndex = 0\n\t@State() inheritedAttributes: Attributes = {}\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.prepareControllers()\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\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\tprivate prepareControllers(skipDefault = false): void {\n\t\tthis.controllers = []\n\t\tconst promises: Promise<GovTabControllerItem>[] = []\n\t\tthis.host.querySelectorAll(':scope > ' + TabsItemClass.root).forEach((tab: HTMLGovTabsItemElement) => {\n\t\t\tconst controlItem = Promise.all([\n\t\t\t\ttab.getIdentifier(),\n\t\t\t\ttab.getTriggerIdentifier(),\n\t\t\t\ttab.getDisableState()\n\t\t\t]).then(([identifier, triggerIdentifier, disabled]) => {\n\t\t\t\tconst isDefault = typeof tab.getAttribute(\"default\") === \"string\"\n\t\t\t\tconst iconStart = prepareIconFormat(tab.getAttribute('icon-start'))\n\t\t\t\tconst iconEnd = prepareIconFormat(tab.getAttribute('icon-end'))\n\t\t\t\treturn {\n\t\t\t\t\tlabel: tab.getAttribute(\"label\"),\n\t\t\t\t\tdirection: tab.getAttribute(\"direction\"),\n\t\t\t\t\tcontentIdentifier: identifier,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\ttriggerIdentifier: triggerIdentifier,\n\t\t\t\t\telement: tab,\n\t\t\t\t\tactive: false,\n\t\t\t\t\tdefault: isDefault,\n\t\t\t\t\ticonStart,\n\t\t\t\t\ticonEnd\n\t\t\t\t}\n\t\t\t})\n\t\t\tpromises.push(controlItem)\n\t\t});\n\t\tPromise.all(promises).then(controllers => {\n\t\t\tif (skipDefault === false) {\n\t\t\t\tlet defaultTabIndex = controllers.findIndex(controller => controller.default)\n\t\t\t\tif (defaultTabIndex === -1) defaultTabIndex = 0\n\t\t\t\tthis.focusIndex = defaultTabIndex\n\t\t\t\tcontrollers[defaultTabIndex].active = true\n\t\t\t} else if (this.focusIndex > -1 && hasOwnProperty(controllers, this.focusIndex)) {\n\t\t\t\tcontrollers[this.focusIndex].active = true\n\t\t\t}\n\t\t\tconst isWrongCombination = controllers.findIndex((controller) => controller.active && controller.disabled)\n\t\t\tif (isWrongCombination > -1) {\n\t\t\t\tcontrollers[isWrongCombination].active = false;\n\t\t\t\tconst firstGoodTab = controllers.findIndex((controller) => !controller.disabled)\n\t\t\t\tif (firstGoodTab > -1) {\n\t\t\t\t\tcontrollers[firstGoodTab].active = true\n\t\t\t\t\tthis.focusIndex = firstGoodTab;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.controllers = [...controllers]\n\t\t\tthis.reRender()\n\t\t})\n\t}\n\n\tprivate setActiveByIdentifier(identifier: string) {\n\t\tconst temp = []\n\t\tthis.controllers.map(item => {\n\t\t\titem.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier\n\t\t\ttemp.push(item)\n\t\t})\n\t\tthis.controllers = [...temp]\n\t}\n\n\tprivate reRender() {\n\t\tthis.controllers.map(control => {\n\t\t\tcontrol.element.setActiveStatus(control.active).catch()\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TabsClass.root)}\n\t\t\t\tsize={this.size}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tdirection={this.direction}\n\t\t\t\tonKeyDown={this.onKeydownHandler.bind(this)}\n\t\t\t>\n\t\t\t\t<div class={TabsClass.tabs}\n\t\t\t\t\t role=\"tablist\"\n\t\t\t\t\t {...this.inheritedAttributes}>\n\t\t\t\t\t<ul class={TabsClass.list}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<li class={TabsClass.item}>\n\t\t\t\t\t\t\t\t{this.type == \"text\" ? (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tclass={TabsClass.btn}\n\t\t\t\t\t\t\t\t\t\tid={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\taria-disabled={toBoolAttr(control.disabled)}\n\t\t\t\t\t\t\t\t\t\taria-selected={toBoolAttr(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\ttabindex={control.active && !control.disabled ? 0 : -1}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLButtonElement)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<gov-chip\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttag={'button'}\n\t\t\t\t\t\t\t\t\t\tidentifier={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\taria-selected={booleanString(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\tfocusable={control.active}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\tsize={this.size === \"xs\" ? \"xs\" : (this.size === \"s\" ? \"s\" : \"m\")}\n\t\t\t\t\t\t\t\t\t\ttype={control.active ? \"solid\" : \"outlined\"}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLGovChipElement)}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-start\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-end\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</gov-chip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate getCurrentTab(): GovTabControllerItem | null {\n\t\treturn this.controllers.find(control => control.active) || null\n\t}\n\n\tprivate onSelectHandler(control: GovTabControllerItem) {\n\t\tconst index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);\n\t\tthis.focusIndex = index\n\t\tthis.setActiveByIdentifier(control.triggerIdentifier)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onKeydownHandler(e: KeyboardEvent) {\n\t\tconst keyCode = e.keyCode\n\n\t\te.stopPropagation()\n\t\tthis.goToPrevNext(keyCode)\n\t}\n\n\tprivate goToPrevNext(keyCode: number) {\n\t\tif ([37, 38, 39, 40].includes(keyCode)) {\n\t\t\tif (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.controllers[this.focusIndex].active = false\n\n\t\t\tif (keyCode === 39 || keyCode === 40) {\n\t\t\t\tthis.focusIndex++\n\t\t\t\tif (this.focusIndex >= this.controllers.length) {\n\t\t\t\t\tthis.focusIndex = 0\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(40)\n\t\t\t\t}\n\t\t\t} else if (keyCode === 37 || keyCode === 38) {\n\t\t\t\tthis.focusIndex--\n\t\t\t\tif (this.focusIndex < 0) {\n\t\t\t\t\tthis.focusIndex = this.controllers.length - 1\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(38)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {\n\t\t\t\tconst current = this.controllers[this.focusIndex]\n\t\t\t\tcurrent.active = true\n\t\t\t\tconst trigger = this.triggerRefs[current.triggerIdentifier]\n\t\t\t\tif (trigger.nodeName.toLowerCase() === 'gov-chip') {\n\t\t\t\t\t(this.triggerRefs[current.triggerIdentifier] as HTMLGovChipElement).setFocus()\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerRefs[current.triggerIdentifier].focus()\n\t\t\t\t}\n\n\t\t\t\tthis.controllers = [...this.controllers]\n\t\t\t\tthis.reRender()\n\t\t\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync refresh(): Promise<void> {\n\t\tthis.prepareControllers()\n\t}\n\n\t/**\n\t * Returns the currently selected tabs-item\n\t */\n\t@Method()\n\tasync currentTab(): Promise<Nullable<HTMLGovTabsItemElement>> {\n\t\treturn this.getCurrentTab().element || null\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync setActiveTab(identifier: string): Promise<void> {\n\t\tthis.setActiveByIdentifier(identifier)\n\t\tthis.reRender()\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync rerender(): Promise<void> {\n\t\tthis.prepareControllers(true);\n\t}\n}\n"],"mappings":"8cA2BaA,EAAO,MAKnB,WAAAC,CAAAC,G,8CAHQC,KAAWC,YA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,CAC/CnH,KAAKQ,WAAa,C,CAEnB,GAAIR,KAAKO,YAAYP,KAAKQ,YAAY8C,SAAU,CAC/CtD,KAAKiH,aAAa,G,OAEb,GAAIF,IAAY,IAAMA,IAAY,GAAI,CAC5C/G,KAAKQ,aACL,GAAIR,KAAKQ,WAAa,EAAG,CACxBR,KAAKQ,WAAaR,KAAKO,YAAY4G,OAAS,C,CAE7C,GAAInH,KAAKO,YAAYP,KAAKQ,YAAY8C,SAAU,CAC/CtD,KAAKiH,aAAa,G,EAIpB,GAAIjH,KAAKQ,YAAc,GAAKR,KAAKQ,YAAcR,KAAKO,YAAY4G,OAAS,EAAG,CAC3E,MAAMC,EAAUpH,KAAKO,YAAYP,KAAKQ,YACtC4G,EAAQrD,OAAS,KACjB,MAAMsD,EAAUrH,KAAKC,YAAYmH,EAAQ/D,mBACzC,GAAIgE,EAAQC,SAASC,gBAAkB,WAAY,CACjDvH,KAAKC,YAAYmH,EAAQ/D,mBAA0CmE,U,KAC9D,CACNxH,KAAKC,YAAYmH,EAAQ/D,mBAAmBoE,O,CAG7CzH,KAAKO,YAAc,IAAIP,KAAKO,aAC5BP,KAAKwE,WACLxE,KAAK4G,UAAUC,KAAK7G,KAAKwG,gBAAgB1C,Q,GAS5C,aAAM4D,GACL1H,KAAK+B,oB,CAON,gBAAM4F,GACL,OAAO3H,KAAKwG,gBAAgB1C,SAAW,I,CAOxC,kBAAM8D,CAAaxE,GAClBpD,KAAKyE,sBAAsBrB,GAC3BpD,KAAKwE,U,CAON,cAAMqD,GACL7H,KAAK+B,mBAAmB,K","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as o}from"./p-ClISz4NF.js";import{g as r,a as n}from"./p-CoD1xawt.js";import{c as a}from"./p-vN03FcXN.js";import{b as c}from"./p-Bo1ROm5Q.js";import"./p-BcQO4NH2.js";import"./p-U40vKHrs.js";import"./p-CQvUntGY.js";const h={triggerEvents:"click",exclude:""};function l(t,i,s,e=h){const o=p(e);f(e).forEach((e=>{window.addEventListener(e,(e=>{d(e,t,i,s,o)}),false)}))}function d(t,i,s,e,o){const r=t.target;if(!s.contains(r)&&!u(r,o)){e.call(i)}}function f(t){if(t.triggerEvents){return t.triggerEvents.split(",").map((t=>t.trim()))}return["click"]}function p(t){if(t.exclude){try{return Array.from(document.querySelectorAll(t.exclude))}catch(i){console.warn(`@ClickOutside: Exclude: '${t.exclude}' will not be evaluated. Check your exclude selector syntax.`,i)}}return}function u(t,i){if(t&&i){for(let s of i){if(s.contains(t)){return true}}}return false}var g;(function(t){t["LEFT"]="left";t["RIGHT"]="right"})(g||(g={}));const v={root:"gov-dropdown",list:"gov-dropdown__list"};const m=class{constructor(s){t(this,s);this.govChange=i(this,"gov-change");this.open=false;this.position=g.LEFT;this.h=r(this.host);this.listId=a("GovDropdownList");this.controlId=a("GovDropdownControl")}watchOpen(){var t;(t=this.trigger)===null||t===void 0?void 0:t.setAttribute("aria-expanded",n(this.open))}get trigger(){return this.host.querySelector(`* > ${c.root}`)}get list(){return this.h.getSlot("list")}componentWillLoad(){var t;if(!this.trigger)return;this.trigger.setAttribute("aria-controls",this.listId);this.trigger.setAttribute("aria-haspopup",n(!!this.list));this.trigger.setAttribute("aria-expanded",n(this.open));this.trigger.setAttribute("identifier",(t=this.identifier)!==null&&t!==void 0?t:this.controlId);this.trigger.addEventListener("gov-click",(t=>{t.preventDefault();t.stopPropagation();this.open=!this.open;this.govChange.emit({component:v.root,originalEvent:t,open:this.open})}))}render(){return s(e,{key:"402f6c2f97151f2abe832422e1eef4f3da15acee",class:this.h.classes([v.root]),open:this.open,position:this.position},s("slot",{key:"0cf6f85829b69b0d0c14eee595557eda4687ce6d"}),s("div",{key:"6658b9882d31fb919a12e97c0abc72a3e641fd6c",ref:t=>l(this,t,(()=>this.open=false)),class:v.list,id:this.listId,"aria-labelledby":this.controlId,"aria-hidden":n(!this.open),hidden:!this.open},s("slot",{key:"b4f4b0b240731a2c03dda84989ba1a1d85c4e27a",name:"list"})))}async getState(){return this.open}async toggle(){this.open=!this.open}get host(){return o(this)}static get watchers(){return{open:["watchOpen"]}}};export{m as gov_dropdown};
|
|
2
|
+
//# sourceMappingURL=p-db860031.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ClickOutsideOptionsDefaults","triggerEvents","exclude","registerClickOutside","component","element","callback","opt","excludedNodes","getExcludedNodes","getTriggerEvents","forEach","triggerEvent","window","addEventListener","e","initClickOutside","event","target","contains","isExcluded","call","split","map","trim","Array","from","document","querySelectorAll","err","console","warn","excudedNodes","excludedNode","Position","DropdownClass","root","list","GovDropdown","constructor","hostRef","this","open","position","LEFT","h","govHost","host","listId","createID","controlId","watchOpen","_a","trigger","setAttribute","toBoolAttr","querySelector","ButtonClass","getSlot","componentWillLoad","identifier","preventDefault","stopPropagation","govChange","emit","originalEvent","render","Host","key","class","classes","ref","el","id","hidden","name","getState","toggle"],"sources":["../../../node_modules/stencil-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from \"@stencil/core\"\nimport {registerClickOutside} from \"stencil-click-outside\"\nimport {govHost, toBoolAttr} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {Nullable} from \"../../../types/interfaces\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {ButtonClass} from \"../button/constants\"\nimport {DropdownClass, Position, PositionType} from \"./constants\"\nimport {DropdownEvent} from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Custom trigger identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Dropdown state\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<DropdownEvent>\n\n\t@Watch('open')\n\twatchOpen() {\n\t\tthis.trigger?.setAttribute(\"aria-expanded\", toBoolAttr(this.open))\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\tcomponentWillLoad() {\n\t\tif (!this.trigger) return;\n\n\t\tthis.trigger.setAttribute(\"aria-controls\", this.listId)\n\t\tthis.trigger.setAttribute(\"aria-haspopup\", toBoolAttr(!!this.list))\n\t\tthis.trigger.setAttribute(\"aria-expanded\", toBoolAttr(this.open))\n\t\tthis.trigger.setAttribute(\"identifier\", this.identifier ?? this.controlId)\n\n\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\t\t\tthis.open = !this.open\n\n\t\t\tthis.govChange.emit({\n\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\topen: this.open,\n\t\t\t})\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Toggle state of dropdown\n\t */\n\t@Method()\n\tasync toggle() {\n\t\tthis.open = !this.open\n\t}\n}\n"],"mappings":"2PACA,MAAMA,EAA8B,CAChCC,cAAe,QACfC,QAAS,IA2CN,SAASC,EAAqBC,EAAWC,EAASC,EAAUC,EAAMP,GACrE,MAAMQ,EAAgBC,EAAiBF,GACvCG,EAAiBH,GAAKI,SAAQC,IAC1BC,OAAOC,iBAAiBF,GAAeG,IACnCC,EAAiBD,EAAGX,EAAWC,EAASC,EAAUE,EAAc,GACjE,MAAM,GAEjB,CAWA,SAASQ,EAAiBC,EAAOb,EAAWC,EAASC,EAAUE,GAC3D,MAAMU,EAASD,EAAMC,OACrB,IAAKb,EAAQc,SAASD,KAAYE,EAAWF,EAAQV,GAAgB,CACjEF,EAASe,KAAKjB,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,KAAKC,OAC3DD,KAAKY,QAAQC,aAAa,cAAcF,EAAAX,KAAKmB,cAAU,MAAAR,SAAA,EAAAA,EAAIX,KAAKS,WAEhET,KAAKY,QAAQvC,iBAAiB,aAAcC,IAC3CA,EAAE8C,iBACF9C,EAAE+C,kBACFrB,KAAKC,MAAQD,KAAKC,KAElBD,KAAKsB,UAAUC,KAAK,CACnB5D,UAAW+B,EAAcC,KACzB6B,cAAelD,EACf2B,KAAMD,KAAKC,MACV,G,CAIJ,MAAAwB,GACC,OACCrB,EAACsB,EAAI,CAAAC,IAAA,2CAACC,MAAO5B,KAAKI,EAAEyB,QAAQ,CAACnC,EAAcC,OAAQM,KAAMD,KAAKC,KAAMC,SAAUF,KAAKE,UAClFE,EAAA,QAAAuB,IAAA,6CACAvB,EAAA,OAAAuB,IAAA,2CACCG,IAAKC,GAAMrE,EAAqBsC,KAAM+B,GAAI,IAAM/B,KAAKC,KAAO,QAC5D2B,MAAOlC,EAAcE,KACrBoC,GAAIhC,KAAKO,OAAM,kBACEP,KAAKS,UAAS,cAClBK,GAAYd,KAAKC,MAC9BgC,QAASjC,KAAKC,MACdG,EAAA,QAAAuB,IAAA,2CAAMO,KAAK,U,CAUf,cAAMC,GACL,OAAOnC,KAAKC,I,CAOb,YAAMmC,GACLpC,KAAKC,MAAQD,KAAKC,I","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ClickOutsideOptionsDefaults","triggerEvents","exclude","registerClickOutside","component","element","callback","opt","excludedNodes","getExcludedNodes","getTriggerEvents","forEach","triggerEvent","window","addEventListener","e","initClickOutside","event","target","contains","isExcluded","call","split","map","trim","Array","from","document","querySelectorAll","err","console","warn","excudedNodes","excludedNode","Position","DropdownClass","root","list","GovDropdown","constructor","hostRef","this","open","position","LEFT","h","govHost","host","listId","createID","controlId","watchOpen","_a","trigger","setAttribute","toBoolAttr","querySelector","ButtonClass","getSlot","componentWillLoad","identifier","preventDefault","stopPropagation","govChange","emit","originalEvent","render","Host","key","class","classes","ref","el","id","hidden","name","getState","toggle"],"sources":["../../../node_modules/stencil-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from \"@stencil/core\"\nimport {registerClickOutside} from \"stencil-click-outside\"\nimport {govHost, toBoolAttr} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {Nullable} from \"../../../types/interfaces\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {ButtonClass} from \"../button/constants\"\nimport {DropdownClass, Position, PositionType} from \"./constants\"\nimport {DropdownEvent} from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Custom trigger identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Dropdown state\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<DropdownEvent>\n\n\t@Watch('open')\n\twatchOpen() {\n\t\tthis.trigger?.setAttribute(\"aria-expanded\", toBoolAttr(this.open))\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\tcomponentWillLoad() {\n\t\tif (!this.trigger) return;\n\n\t\tthis.trigger.setAttribute(\"aria-controls\", this.listId)\n\t\tthis.trigger.setAttribute(\"aria-haspopup\", toBoolAttr(!!this.list))\n\t\tthis.trigger.setAttribute(\"aria-expanded\", toBoolAttr(this.open))\n\t\tthis.trigger.setAttribute(\"identifier\", this.identifier ?? this.controlId)\n\n\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\t\t\tthis.open = !this.open\n\n\t\t\tthis.govChange.emit({\n\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\topen: this.open,\n\t\t\t})\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Toggle state of dropdown\n\t */\n\t@Method()\n\tasync toggle() {\n\t\tthis.open = !this.open\n\t}\n}\n"],"mappings":"2PACA,MAAMA,EAA8B,CAChCC,cAAe,QACfC,QAAS,IA2CN,SAASC,EAAqBC,EAAWC,EAASC,EAAUC,EAAMP,GACrE,MAAMQ,EAAgBC,EAAiBF,GACvCG,EAAiBH,GAAKI,SAAQC,IAC1BC,OAAOC,iBAAiBF,GAAeG,IACnCC,EAAiBD,EAAGX,EAAWC,EAASC,EAAUE,EAAc,GACjE,MAAM,GAEjB,CAWA,SAASQ,EAAiBC,EAAOb,EAAWC,EAASC,EAAUE,GAC3D,MAAMU,EAASD,EAAMC,OACrB,IAAKb,EAAQc,SAASD,KAAYE,EAAWF,EAAQV,GAAgB,CACjEF,EAASe,KAAKjB,EACtB,CACA,CACA,SAASM,EAAiBH,GACtB,GAAIA,EAAIN,cAAe,CACnB,OAAOM,EAAIN,cAAcqB,MAAM,KAAKC,KAAIR,GAAKA,EAAES,QACvD,CACI,MAAO,CAAC,QACZ,CACA,SAASf,EAAiBF,GACtB,GAAIA,EAAIL,QAAS,CACb,IACI,OAAOuB,MAAMC,KAAKC,SAASC,iBAAiBrB,EAAIL,SAC5D,CACQ,MAAO2B,GACHC,QAAQC,KAAK,4BAA4BxB,EAAIL,sEAAuE2B,EAChI,CACA,CACI,MACJ,CACA,SAAST,EAAWF,EAAQc,GACxB,GAAId,GAAUc,EAAc,CACxB,IAAK,IAAIC,KAAgBD,EAAc,CACnC,GAAIC,EAAad,SAASD,GAAS,CAC/B,OAAO,IACvB,CACA,CACA,CACI,OAAO,KACX,CC9FA,IAAYgB,GAAZ,SAAYA,GACXA,EAAA,eACAA,EAAA,gBACA,EAHD,CAAYA,MAGX,KAIM,MAAMC,EAAgB,CAC5BC,KAAM,eACNC,KAAM,sB,MCEMC,EAA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KS,UACT,cAAAK,GAAYd,KAAKC,MAC9BgC,QAASjC,KAAKC,MACdG,EAAA,QAAAuB,IAAA,2CAAMO,KAAK,U,CAUf,cAAMC,GACL,OAAOnC,KAAKC,I,CAOb,YAAMmC,GACLpC,KAAKC,MAAQD,KAAKC,I","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,c as t,h as e,H as o}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as s,c as t,h as e,H as o}from"./p-ClISz4NF.js";import{F as r}from"./p-DBXGhafv.js";import"./p-CQvUntGY.js";import"./p-BcQO4NH2.js";const a=class{constructor(e){s(this,e);this.govClick=t(this,"gov-click");this.size="m";this.required=false;this.legend=false}render(){const s=this.legend?"legend":"label";return e(o,{key:"0933cb68a8e9812dbea819894e62dd2a9d643b9e",class:r.root,size:this.size},e(s,{key:"5447106b24419c1d36f0f9ce8b7934992ebf5d52",class:r.label,htmlFor:this.identifier,onClick:()=>this.govClick.emit()},e("slot",{key:"683c06ef747127e04ed2dc5914e666945fb0d764"}),this.required?e("span",{class:"gov-color--text-status-error"}," *"):null))}};export{a as gov_form_label};
|
|
2
|
+
//# sourceMappingURL=p-e30968b3.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovFormLabel","constructor","hostRef","this","size","required","legend","render","Tag","h","Host","key","class","FormLabelClass","root","label","htmlFor","identifier","onClick","govClick","emit"],"sources":["../../../packages/core/src/components/gov-form/label/gov-form-label.tsx"],"sourcesContent":["import { Component, Event, EventEmitter, h, Prop, Host } from '@stencil/core'\nimport { FormLabelClass, FormLabelSizesTypes } from './constants'\n\n@Component({\n\ttag: 'gov-form-label',\n})\nexport class GovFormLabel {\n\t/**\n\t * Identifier for label.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Label's size.\n\t */\n\t@Prop() readonly size?: FormLabelSizesTypes = 'm'\n\t/**\n\t * Set whether the input is required or not.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Use label as a legend for better accessibility.\n\t * Note: Don't forget to set the fieldset attribute of the gov-form-control component\n\t */\n\t@Prop() readonly legend: boolean = false\n\t/**\n\t * Emitted when the label click.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<PointerEvent>\n\n\trender() {\n\t\tconst Tag = this.legend ? 'legend' : 'label'\n\t\treturn (\n\t\t\t<Host class={FormLabelClass.root} size={this.size}>\n\t\t\t\t<Tag class={FormLabelClass.label} htmlFor={this.identifier} onClick={() => this.govClick.emit()}>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.required ? <span class=\"gov-color--text-status-error\"> *</span> : null}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"mJAMaA,EAAY,MAHzB,WAAAC,CAAAC,G,4CAWkBC,
|
|
1
|
+
{"version":3,"names":["GovFormLabel","constructor","hostRef","this","size","required","legend","render","Tag","h","Host","key","class","FormLabelClass","root","label","htmlFor","identifier","onClick","govClick","emit"],"sources":["../../../packages/core/src/components/gov-form/label/gov-form-label.tsx"],"sourcesContent":["import { Component, Event, EventEmitter, h, Prop, Host } from '@stencil/core'\nimport { FormLabelClass, FormLabelSizesTypes } from './constants'\n\n@Component({\n\ttag: 'gov-form-label',\n})\nexport class GovFormLabel {\n\t/**\n\t * Identifier for label.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Label's size.\n\t */\n\t@Prop() readonly size?: FormLabelSizesTypes = 'm'\n\t/**\n\t * Set whether the input is required or not.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Use label as a legend for better accessibility.\n\t * Note: Don't forget to set the fieldset attribute of the gov-form-control component\n\t */\n\t@Prop() readonly legend: boolean = false\n\t/**\n\t * Emitted when the label click.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<PointerEvent>\n\n\trender() {\n\t\tconst Tag = this.legend ? 'legend' : 'label'\n\t\treturn (\n\t\t\t<Host class={FormLabelClass.root} size={this.size}>\n\t\t\t\t<Tag class={FormLabelClass.label} htmlFor={this.identifier} onClick={() => this.govClick.emit()}>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.required ? <span class=\"gov-color--text-status-error\"> *</span> : null}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"mJAMaA,EAAY,MAHzB,WAAAC,CAAAC,G,4CAWkBC,KAAIC,KAAyB,IAI7BD,KAAQE,SAAY,MAKpBF,KAAMG,OAAY,KAiBnC,CAXA,MAAAC,GACC,MAAMC,EAAML,KAAKG,OAAS,SAAW,QACrC,OACCG,EAACC,EAAI,CAAAC,IAAA,2CAACC,MAAOC,EAAeC,KAAMV,KAAMD,KAAKC,MAC5CK,EAACD,EAAI,CAAAG,IAAA,2CAAAC,MAAOC,EAAeE,MAAOC,QAASb,KAAKc,WAAYC,QAAS,IAAMf,KAAKgB,SAASC,QACxFX,EAAa,QAAAE,IAAA,6CACZR,KAAKE,SAAWI,EAAA,QAAMG,MAAM,gCAA8B,MAAkB,M","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as a}from"./p-ClISz4NF.js";import{v as o}from"./p-NOJjz9dT.js";import{g as h}from"./p-CoD1xawt.js";import{p as c}from"./p-CQvUntGY.js";import{S as r}from"./p-BcQO4NH2.js";import{B as n,a as f}from"./p-Bo1ROm5Q.js";import{c as d}from"./p-vN03FcXN.js";import{p as l}from"./p-GYov8gU1.js";import{i as p}from"./p-CzXeijOj.js";import{A as b,a as m}from"./p-Bz_RzYFb.js";import"./p-CgDnDrq5.js";import"./p-U40vKHrs.js";const v=c(r,["_XS","_S","_M"]);var g;(function(t){t["SOLID"]="solid";t["OUTLINED"]="outlined"})(g||(g={}));var j;(function(t){t["A"]="a";t["SPAN"]="span";t["BUTTON"]="button"})(j||(j={}));const u={root:"gov-chip",hasRight:"gov-chip--has-right",hasLeft:"gov-chip--has-left"};const y=class{constructor(i){t(this,i);this.govClick=s(this,"gov-click");this.hydrated=false;this.disabled=false;this.size=v._M;this.tag="span";this.color=n.PRIMARY;this.focusable=true;this.inheritedAttributes={};this.h=h(this.host);this.chipId=d("GovChip")}validateColor(t){o(n,t,u.root)}validateSize(t){o(f,t,u.root)}componentWillLoad(){this.validateColor(this.color);this.validateSize(this.size);this.inheritedAttributes=p(this.host)}componentDidLoad(){this.attributeObserver=new b(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(m)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}connectedCallback(){this.hydrated=true}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){const t=this.href?j.A:this.tag;const s=t==j.BUTTON?j.BUTTON:undefined;const a=l(this.iconStart);const o=l(this.iconEnd);return i(e,{key:"bbe58de10514cfa5049188d6cbea7402e4abef1a",class:this.h.classes([u.root,this.h.hasSlot("right")?u.hasRight:undefined,this.h.hasSlot("left")?u.hasLeft:undefined]),disabled:this.disabled,href:this.href,color:this.color,type:this.type,size:this.size,focusable:this.focusable,hydrated:this.hydrated},i(t,Object.assign({key:"593f0ccd8f024d3b0539d029eb1ce15744b99dcc",class:"element",href:this.href,target:this.target,ref:t=>this.triggerRef=t,onClick:this.onClickHandler.bind(this),tabindex:this.h.hasSlot("left")||this.h.hasSlot("right")||this.disabled||!this.focusable?"-1":"0",id:this.identifier||this.chipId,type:s},this.inheritedAttributes,{"aria-disabled":this.disabled}),i("slot",{key:"d67eb38a50b78d336c6f26b94d771862f22d27e4",name:"left"}),i("slot",{key:"2642c53b31ace283aca7b21566b39e56caf7a0e2",name:"icon-start"},a&&i("gov-icon",{key:"8320fe3e6540b008684af9306b09b2464809948b",type:a.type,name:a.name})),i("slot",{key:"5c3c63c5cfef7d7c8ff1420ef6121e90fc735d80"}),i("slot",{key:"4e1e6f8751b8708a92b73d499c1f406c0fcb2fcc",name:"icon-end"},o&&i("gov-icon",{key:"a660967c54adc0b623b5f94b04e8e689425b7f28",type:o.type,name:o.name})),i("slot",{key:"af67d89fc3d70312d65078ad6f38b4ec4056542f",name:"right"})))}onClickHandler(t){t.stopPropagation();if(this.disabled===false&&this.tag===j.BUTTON){this.govClick.emit(t)}}async geRef(){return this.triggerRef}async setFocus(){this.triggerRef.focus()}get host(){return a(this)}static get watchers(){return{color:["validateColor"],size:["validateSize"]}}};export{y as gov_chip};
|
|
2
|
+
//# sourceMappingURL=p-e39e5dc7.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ChipSizes","pick","Sizes","ChipType","NativeType","ChipClass","root","hasRight","hasLeft","GovChip","constructor","hostRef","this","hydrated","disabled","size","_M","tag","color","ButtonColors","PRIMARY","focusable","inheritedAttributes","h","govHost","host","chipId","createID","validateColor","newValue","validateProp","validateSize","ButtonSizes","componentWillLoad","inheritAriaAttributes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","disconnectedCallback","_a","stopObserving","connectedCallback","removeAttribute","Object","assign","render","Tag","href","A","nativeType","BUTTON","undefined","iconStart","prepareIconFormat","iconEnd","Host","key","class","classes","hasSlot","type","target","ref","el","triggerRef","onClick","onClickHandler","bind","tabindex","id","identifier","name","e","stopPropagation","govClick","emit","geRef","setFocus","focus"],"sources":["../../../packages/core/src/components/gov-chip/constants.ts","../../../packages/core/src/components/gov-chip/gov-chip.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\nimport {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const ChipSizes = pick(Sizes, ['_XS', '_S', '_M'])\nexport type ChipSizesType = `${ValueOf<typeof ChipSizes>}`\n\nexport enum ChipType {\n\tSOLID = 'solid',\n\tOUTLINED = 'outlined',\n}\nexport type ChipTypesType = `${ValueOf<typeof ChipType>}`\n\nexport enum NativeType {\n\tA = 'a',\n\tSPAN = 'span',\n\tBUTTON = 'button',\n}\nexport type NativeTypesType = `${ValueOf<typeof NativeType>}`\n\nexport const ChipClass = {\n\troot: 'gov-chip',\n\tinner: 'gov-chip__inner',\n\thasRight: 'gov-chip--has-right',\n\thasLeft: 'gov-chip--has-left',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {ChipClass, ChipSizes, ChipSizesType, ChipTypesType, NativeType, NativeTypesType} from \"./constants\"\nimport {ButtonColors, ButtonColorType, ButtonSizes} from \"../gov-button/button/constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\n\n@Component({\n\ttag: \"gov-chip\",\n})\nexport class GovChip {\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\tprivate readonly chipId: string\n\tprivate hydrated = false\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.chipId = createID('GovChip')\n\t}\n\n\t@Element() host: HTMLGovChipElement\n\n\t/**\n\t * Makes the chip component disabled.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() 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: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-start\"}) readonly iconStart?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-end\"}) readonly iconEnd?: string\n\t/**\n\t * Chip’s size.\n\t */\n\t@Prop() readonly size: ChipSizesType = ChipSizes._M\n\t/**\n\t * Used to change the HTML tag in the chip\n\t */\n\t@Prop() readonly tag: NativeTypesType = \"span\"\n\t/**\n\t * Style variation of the chip.\n\t */\n\t@Prop() readonly color: ButtonColorType = ButtonColors.PRIMARY\n\t/**\n\t * Chip’s type\n\t */\n\t@Prop({reflect: true}) readonly type: ChipTypesType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom chip identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Emitted when the button click.\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<PointerEvent>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, ChipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, ChipClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\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\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\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 Tag = this.href ? NativeType.A : this.tag\n\t\tconst nativeType = Tag == NativeType.BUTTON ? NativeType.BUTTON : undefined\n\n\t\tconst iconStart = prepareIconFormat(this.iconStart)\n\t\tconst iconEnd = prepareIconFormat(this.iconEnd)\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([\n\t\t\t\t\tChipClass.root,\n\t\t\t\t\tthis.h.hasSlot(\"right\") ? ChipClass.hasRight : undefined,\n\t\t\t\t\tthis.h.hasSlot(\"left\") ? ChipClass.hasLeft : undefined,\n\t\t\t\t])}\n\t\t\t\tdisabled={this.disabled}\n\t\t\t\thref={this.href}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tsize={this.size}\n\t\t\t\tfocusable={this.focusable}\n\t\t\t\thydrated={this.hydrated}\n\t\t\t>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLButtonElement | HTMLSpanElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\ttabindex={(this.h.hasSlot(\"left\") || this.h.hasSlot(\"right\") || this.disabled || !this.focusable) ? \"-1\" : \"0\"}\n\t\t\t\t\tid={this.identifier || this.chipId}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-disabled={this.disabled}>\n\t\t\t\t\t<slot name=\"left\"></slot>\n\t\t\t\t\t<slot name=\"icon-start\">\n\t\t\t\t\t\t{iconStart && <gov-icon type={iconStart.type} name={iconStart.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<slot name=\"icon-end\">\n\t\t\t\t\t\t{iconEnd && <gov-icon type={iconEnd.type} name={iconEnd.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t\t<slot name=\"right\"></slot>\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false && this.tag === NativeType.BUTTON) {\n\t\t\tthis.govClick.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync geRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n}\n"],"mappings":"kcAIO,MAAMA,EAAYC,EAAKC,EAAO,CAAC,MAAO,KAAM,OAGnD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,iBACAA,EAAA,sBACA,EAHD,CAAYA,MAAQ,KAMpB,IAAYC,GAAZ,SAAYA,GACXA,EAAA,SACAA,EAAA,eACAA,EAAA,kBACA,EAJD,CAAYA,MAAU,KAOf,MAAMC,EAAY,CACxBC,KAAM,WAENC,SAAU,sBACVC,QAAS,sB,MCTGC,EAAO,MAOnB,WAAAC,CAAAC,G,4CAHQC,KAAAC,SAAW,MAaaD,KAAAE,SAAoB,MAsBnCF,KAAAG,KAAsBf,EAAUgB,GAIhCJ,KAAAK,IAAuB,OAIvBL,KAAAM,MAAyBC,EAAaC,QAStCR,KAAAS,UAAqB,KAoB7BT,KAAAU,oBAAkC,GApE1CV,KAAKW,EAAIC,EAAQZ,KAAKa,MACtBb,KAAKc,OAASC,EAAS,UACvB,CAyDD,aAAAC,CAAcC,GACbC,EAAaX,EAAcU,EA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AAC2B,EAAGH,OAAAC,OAAA,CAAAY,IAAA,2CACHC,MAAM,UACNV,KAAMvC,KAAKuC,KACXc,OAAQrD,KAAKqD,OACbC,IAAKC,GAAOvD,KAAKwD,WAAaD,EAC9BE,QAASzD,KAAK0D,eAAeC,KAAK3D,MAClC4D,SAAW5D,KAAKW,EAAEwC,QAAQ,SAAWnD,KAAKW,EAAEwC,QAAQ,UAAYnD,KAAKE,WAAaF,KAAKS,UAAa,KAAO,IAC3GoD,GAAI7D,KAAK8D,YAAc9D,KAAKc,OAC5BsC,KAAMX,GACFzC,KAAKU,oBAAmB,iBACbV,KAAKE,WACpBS,EAAA,QAAAqC,IAAA,2CAAMe,KAAK,SACXpD,EAAA,QAAAqC,IAAA,2CAAMe,KAAK,cACTnB,GAAajC,EAAA,YAAAqC,IAAA,2CAAUI,KAAMR,EAAUQ,KAAMW,KAAMnB,EAAUmB,QAE/DpD,EAAA,QAAAqC,IAAA,6CACArC,EAAA,QAAAqC,IAAA,2CAAMe,KAAK,YACTjB,GAAWnC,EAAA,YAAAqC,IAAA,2CAAUI,KAAMN,EAAQM,KAAMW,KAAMjB,EAAQiB,QAEzDpD,EAAA,QAAAqC,IAAA,2CAAMe,KAAK,W,CAMP,cAAAL,CAAeM,GACtBA,EAAEC,kBACF,GAAIjE,KAAKE,WAAa,OAASF,KAAKK,MAAQb,EAAWkD,OAAQ,CAC9D1C,KAAKkE,SAASC,KAAKH,E,EAQrB,WAAMI,GACL,OAAOpE,KAAKwD,U,CAOb,cAAMa,GACLrE,KAAKwD,WAAWc,O","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ChipSizes","pick","Sizes","ChipType","NativeType","ChipClass","root","hasRight","hasLeft","GovChip","constructor","hostRef","this","hydrated","disabled","size","_M","tag","color","ButtonColors","PRIMARY","focusable","inheritedAttributes","h","govHost","host","chipId","createID","validateColor","newValue","validateProp","validateSize","ButtonSizes","componentWillLoad","inheritAriaAttributes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","disconnectedCallback","_a","stopObserving","connectedCallback","removeAttribute","Object","assign","render","Tag","href","A","nativeType","BUTTON","undefined","iconStart","prepareIconFormat","iconEnd","Host","key","class","classes","hasSlot","type","target","ref","el","triggerRef","onClick","onClickHandler","bind","tabindex","id","identifier","name","e","stopPropagation","govClick","emit","geRef","setFocus","focus"],"sources":["../../../packages/core/src/components/gov-chip/constants.ts","../../../packages/core/src/components/gov-chip/gov-chip.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\nimport {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const ChipSizes = pick(Sizes, ['_XS', '_S', '_M'])\nexport type ChipSizesType = `${ValueOf<typeof ChipSizes>}`\n\nexport enum ChipType {\n\tSOLID = 'solid',\n\tOUTLINED = 'outlined',\n}\nexport type ChipTypesType = `${ValueOf<typeof ChipType>}`\n\nexport enum NativeType {\n\tA = 'a',\n\tSPAN = 'span',\n\tBUTTON = 'button',\n}\nexport type NativeTypesType = `${ValueOf<typeof NativeType>}`\n\nexport const ChipClass = {\n\troot: 'gov-chip',\n\tinner: 'gov-chip__inner',\n\thasRight: 'gov-chip--has-right',\n\thasLeft: 'gov-chip--has-left',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {ChipClass, ChipSizes, ChipSizesType, ChipTypesType, NativeType, NativeTypesType} from \"./constants\"\nimport {ButtonColors, ButtonColorType, ButtonSizes} from \"../gov-button/button/constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\n\n@Component({\n\ttag: \"gov-chip\",\n})\nexport class GovChip {\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\tprivate readonly chipId: string\n\tprivate hydrated = false\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.chipId = createID('GovChip')\n\t}\n\n\t@Element() host: HTMLGovChipElement\n\n\t/**\n\t * Makes the chip component disabled.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() 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: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-start\"}) readonly iconStart?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-end\"}) readonly iconEnd?: string\n\t/**\n\t * Chip’s size.\n\t */\n\t@Prop() readonly size: ChipSizesType = ChipSizes._M\n\t/**\n\t * Used to change the HTML tag in the chip\n\t */\n\t@Prop() readonly tag: NativeTypesType = \"span\"\n\t/**\n\t * Style variation of the chip.\n\t */\n\t@Prop() readonly color: ButtonColorType = ButtonColors.PRIMARY\n\t/**\n\t * Chip’s type\n\t */\n\t@Prop({reflect: true}) readonly type: ChipTypesType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom chip identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Emitted when the button click.\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<PointerEvent>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, ChipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, ChipClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\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\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\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 Tag = this.href ? NativeType.A : this.tag\n\t\tconst nativeType = Tag == NativeType.BUTTON ? NativeType.BUTTON : undefined\n\n\t\tconst iconStart = prepareIconFormat(this.iconStart)\n\t\tconst iconEnd = prepareIconFormat(this.iconEnd)\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([\n\t\t\t\t\tChipClass.root,\n\t\t\t\t\tthis.h.hasSlot(\"right\") ? ChipClass.hasRight : undefined,\n\t\t\t\t\tthis.h.hasSlot(\"left\") ? ChipClass.hasLeft : undefined,\n\t\t\t\t])}\n\t\t\t\tdisabled={this.disabled}\n\t\t\t\thref={this.href}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tsize={this.size}\n\t\t\t\tfocusable={this.focusable}\n\t\t\t\thydrated={this.hydrated}\n\t\t\t>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLButtonElement | HTMLSpanElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\ttabindex={(this.h.hasSlot(\"left\") || this.h.hasSlot(\"right\") || this.disabled || !this.focusable) ? \"-1\" : \"0\"}\n\t\t\t\t\tid={this.identifier || this.chipId}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-disabled={this.disabled}>\n\t\t\t\t\t<slot name=\"left\"></slot>\n\t\t\t\t\t<slot name=\"icon-start\">\n\t\t\t\t\t\t{iconStart && <gov-icon type={iconStart.type} name={iconStart.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<slot name=\"icon-end\">\n\t\t\t\t\t\t{iconEnd && <gov-icon type={iconEnd.type} name={iconEnd.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t\t<slot name=\"right\"></slot>\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false && this.tag === NativeType.BUTTON) {\n\t\t\tthis.govClick.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync geRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n}\n"],"mappings":"kcAIO,MAAMA,EAAYC,EAAKC,EAAO,CAAC,MAAO,KAAM,OAGnD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,iBACAA,EAAA,sBACA,EAHD,CAAYA,MAGX,KAGD,IAAYC,GAAZ,S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M,GACtBA,EAAEC,kBACF,GAAIjE,KAAKE,WAAa,OAASF,KAAKK,MAAQb,EAAWkD,OAAQ,CAC9D1C,KAAKkE,SAASC,KAAKH,E,EAQrB,WAAMI,GACL,OAAOpE,KAAKwD,U,CAOb,cAAMa,GACLrE,KAAKwD,WAAWc,O","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as s,H as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as s,H as e,g as o}from"./p-ClISz4NF.js";import{g as a}from"./p-CoD1xawt.js";import{v as i}from"./p-NOJjz9dT.js";import{B as r,a as c}from"./p-Bo1ROm5Q.js";import{p as d}from"./p-CQvUntGY.js";import{S as n}from"./p-BcQO4NH2.js";import{p}from"./p-GYov8gU1.js";import"./p-CgDnDrq5.js";import"./p-U40vKHrs.js";const f=d(n,["_XS","_S","_M"]);var m;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(m||(m={}));const l={root:"gov-tag"};const h=class{constructor(s){t(this,s);this.size=f._S;this.color=r.PRIMARY;this.expanded=false;this.h=a(this.host)}validateColor(t){i(r,t,l.root)}validateSize(t){i(c,t,l.root)}componentWillLoad(){this.validateColor(this.color);this.validateSize(this.size)}render(){const t=p(this.iconStart);const o=p(this.iconEnd);return s(e,{key:"9ed31c6f9d34001618223db4d842ee55611f8896",class:this.h.classes(l.root),color:this.color,size:this.size,type:this.type},s("span",{key:"617d6cf19dc34385815916b6656f48c14428bff6",class:"element"},s("slot",{key:"d95d40e8a9de633865f174821050ab57174b435f",name:"icon-start"},t&&s("gov-icon",{key:"95a813406d45b8a69f4d4804f4063a7fa88d1038",type:t.type,name:t.name})),s("slot",{key:"4e4ad28e073bc933e3a193283e46d50f413bcf62"}),s("slot",{key:"0642ab987098007d4335d8aed281f4cd431bfe10",name:"icon-end"},o&&s("gov-icon",{key:"00ea783ae37eb0a4461cb97e15cdc9efc332bb27",type:o.type,name:o.name}))))}get host(){return o(this)}static get watchers(){return{color:["validateColor"],size:["validateSize"]}}};export{h as gov_tag};
|
|
2
|
+
//# sourceMappingURL=p-eb3f6808.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TagSizes","pick","Sizes","TagType","TagClass","root","GovTag","constructor","hostRef","this","size","_S","color","ButtonColors","PRIMARY","expanded","h","govHost","host","validateColor","newValue","validateProp","validateSize","ButtonSizes","componentWillLoad","render","iconStart","prepareIconFormat","iconEnd","Host","key","class","classes","type","name"],"sources":["../../../packages/core/src/components/gov-tag/constants.ts","../../../packages/core/src/components/gov-tag/gov-tag.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const TagSizes = pick(Sizes, ['_XS', '_S', '_M'])\nexport type TagSizesType = `${ValueOf<typeof TagSizes>}`\n\nexport enum TagType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type TagTypesType = `${ValueOf<typeof TagType>}`\n\nexport const TagClass = {\n\troot: 'gov-tag',\n}\n","import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonSizes, ButtonColors, ButtonColorType} from '../gov-button/button/constants'\nimport {TagClass, TagSizes, TagSizesType, TagTypesType} from './constants'\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\n\n@Component({\n\ttag: 'gov-tag',\n})\nexport class GovTag {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTagElement\n\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-start\"}) readonly iconStart?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-end\"}) readonly iconEnd?: string\n\t/**\n\t * Tag’s size.\n\t */\n\t@Prop({reflect: true}) readonly size: TagSizesType = TagSizes._S\n\t/**\n\t * Style variation of the tag.\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType = ButtonColors.PRIMARY\n\t/**\n\t * Tag’s type\n\t */\n\t@Prop({reflect: true}) readonly type: TagTypesType\n\t/**\n\t * Expands the tag to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, TagClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, TagClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\tconst iconStart = prepareIconFormat(this.iconStart)\n\t\tconst iconEnd = prepareIconFormat(this.iconEnd)\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TagClass.root)}\n\t\t\t\tcolor={this.color}\n\t\t\t\tsize={this.size}\n\t\t\t\ttype={this.type}\n\t\t\t>\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<slot name=\"icon-start\">\n\t\t\t\t\t\t{iconStart && <gov-icon type={iconStart.type} name={iconStart.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<slot name=\"icon-end\">\n\t\t\t\t\t\t{iconEnd && <gov-icon type={iconEnd.type} name={iconEnd.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"mUAIO,MAAMA,EAAWC,EAAKC,EAAO,CAAC,MAAO,KAAM,OAGlD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,eACAA,EAAA,kBACA,EAHD,CAAYA,
|
|
1
|
+
{"version":3,"names":["TagSizes","pick","Sizes","TagType","TagClass","root","GovTag","constructor","hostRef","this","size","_S","color","ButtonColors","PRIMARY","expanded","h","govHost","host","validateColor","newValue","validateProp","validateSize","ButtonSizes","componentWillLoad","render","iconStart","prepareIconFormat","iconEnd","Host","key","class","classes","type","name"],"sources":["../../../packages/core/src/components/gov-tag/constants.ts","../../../packages/core/src/components/gov-tag/gov-tag.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const TagSizes = pick(Sizes, ['_XS', '_S', '_M'])\nexport type TagSizesType = `${ValueOf<typeof TagSizes>}`\n\nexport enum TagType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type TagTypesType = `${ValueOf<typeof TagType>}`\n\nexport const TagClass = {\n\troot: 'gov-tag',\n}\n","import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonSizes, ButtonColors, ButtonColorType} from '../gov-button/button/constants'\nimport {TagClass, TagSizes, TagSizesType, TagTypesType} from './constants'\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\n\n@Component({\n\ttag: 'gov-tag',\n})\nexport class GovTag {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTagElement\n\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-start\"}) readonly iconStart?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-end\"}) readonly iconEnd?: string\n\t/**\n\t * Tag’s size.\n\t */\n\t@Prop({reflect: true}) readonly size: TagSizesType = TagSizes._S\n\t/**\n\t * Style variation of the tag.\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType = ButtonColors.PRIMARY\n\t/**\n\t * Tag’s type\n\t */\n\t@Prop({reflect: true}) readonly type: TagTypesType\n\t/**\n\t * Expands the tag to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, TagClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, TagClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\tconst iconStart = prepareIconFormat(this.iconStart)\n\t\tconst iconEnd = prepareIconFormat(this.iconEnd)\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TagClass.root)}\n\t\t\t\tcolor={this.color}\n\t\t\t\tsize={this.size}\n\t\t\t\ttype={this.type}\n\t\t\t>\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<slot name=\"icon-start\">\n\t\t\t\t\t\t{iconStart && <gov-icon type={iconStart.type} name={iconStart.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<slot name=\"icon-end\">\n\t\t\t\t\t\t{iconEnd && <gov-icon type={iconEnd.type} name={iconEnd.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"mUAIO,MAAMA,EAAWC,EAAKC,EAAO,CAAC,MAAO,KAAM,OAGlD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,eACAA,EAAA,kBACA,EAHD,CAAYA,MAGX,KAGM,MAAMC,EAAW,CACvBC,KAAM,W,MCHMC,EAAM,MAGlB,WAAAC,CAAAC,G,UAiBgCC,KAAAC,KAAqBV,EAASW,GAI9BF,KAAAG,MAAyBC,EAAaC,QAQtCL,KAAQM,SAAY,MA5BnDN,KAAKO,EAAIC,EAAQR,KAAKS,KACtB,CA8BD,aAAAC,CAAcC,GACbC,EAAaR,EAAcO,EAAUhB,EAASC,K,CAI/C,YAAAiB,CAAaF,GACZC,EAAaE,EAAaH,EAAUhB,EAASC,K,CAG9C,iBAAAmB,GACCf,KAAKU,cAAcV,KAAKG,OACxBH,KAAKa,aAAab,KAAKC,K,CAGxB,MAAAe,GACC,MAAMC,EAAYC,EAAkBlB,KAAKiB,WACzC,MAAME,EAAUD,EAAkBlB,KAAKmB,SACvC,OACCZ,EAACa,EAAI,CAAAC,IAAA,2CAACC,MAAOtB,KAAKO,EAAEgB,QAAQ5B,EAASC,MACpCO,MAAOH,KAAKG,MACZF,KAAMD,KAAKC,KACXuB,KAAMxB,KAAKwB,MAEXjB,EAAM,QAAAc,IAAA,2CAAAC,MAAM,WACXf,EAAA,QAAAc,IAAA,2CAAMI,KAAK,cACTR,GAAaV,EAAA,YAAAc,IAAA,2CAAUG,KAAMP,EAAUO,KAAMC,KAAMR,EAAUQ,QAE/DlB,EAAO,QAAAc,IAAA,6CACPd,EAAM,QAAAc,IAAA,2CAAAI,KAAK,YACTN,GAAWZ,EAAA,YAAAc,IAAA,2CAAUG,KAAML,EAAQK,KAAMC,KAAMN,EAAQM,S","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as s,H as e,g as a}from"./p-ClISz4NF.js";import{v as o}from"./p-NOJjz9dT.js";import{b as n,B as h,c as r,N as c}from"./p-Bo1ROm5Q.js";import{g as l,t as d}from"./p-CoD1xawt.js";import{S as f}from"./p-BcQO4NH2.js";import{v as p}from"./p-CDIRBJsi.js";import{c as b}from"./p-CgDnDrq5.js";import{d as m}from"./p-CQvUntGY.js";import{i as v}from"./p-CzXeijOj.js";import{A as u,a as y}from"./p-Bz_RzYFb.js";import"./p-U40vKHrs.js";import"./p-vN03FcXN.js";import"./p-DNztiAH0.js";function g(t){if(typeof t==="string"){return["true","True","TRUE","1"].indexOf(t)!==-1}else if(typeof t==="number"){return t>0}else if(typeof t==="boolean"){return t}else{return t?true:false}}var j;(function(t){t["A"]="a";t["BUTTON"]="button"})(j||(j={}));const C=class{constructor(s){t(this,s);this.govClick=i(this,"gov-click");this.govFocus=i(this,"gov-focus");this.govBlur=i(this,"gov-blur");this.hydrated=false;this.size="m";this.expanded=false;this.expandedMobile=false;this.disabled=false;this.nativeType="button";this.tab=0;this.focusable=true;this.inheritedAttributes={};this.h=l(this.host)}validateColor(t){o(h,t,n.root)}validateType(t){o(r,t,n.root)}validateSize(t){o(f,t,n.root)}validateNativeType(t){o(c,t,n.root)}componentDidLoad(){this.attributeObserver=new u(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(y)}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}componentWillLoad(){this.validateColor(this.color);this.validateType(this.type);this.validateSize(this.size);this.validateNativeType(this.nativeType);this.inheritedAttributes=v(this.host)}async componentDidRender(){if(b()){await m(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const t=this.href?j.A:j.BUTTON;const i=t===j.A?undefined:this.nativeType;return s(e,{key:"be41c5da0a82fa7c16239527bc720510de8ecbd5",size:this.size,hydrated:this.hydrated,color:this.color,class:this.h.classes(n.root),type:this.type},s(t,Object.assign({key:"c46f9288bccd35208999be6e0b3fbdc53097e9eb",class:"element",ref:t=>this.triggerRef=t,onClick:this.onClickHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),disabled:this.disabled,id:this.identifier,href:this.href,target:this.target,download:this.download,hreflang:this.hreflang,rel:this.rel,name:this.name,type:i,tabindex:this.disabled?"-1":this.tab},this.inheritedAttributes,{"aria-disabled":d(this.disabled)}),g(this.loading)&&!this.h.hasSlot("icon-end")&&s("gov-icon",{key:"051f379ac0f6095662027cb21aa97167d641aeb9",name:"loader",class:"gov-spin-animation",type:"components"}),this.h.hasSlot("icon-start")&&s("slot",{key:"f727f494903fa51f278cf7bbd4045dff83bf735d",name:"icon-start"}),s("slot",{key:"dfb09a744c1ef48ef8fd5af7e833b28cf4138d89"}),this.h.hasSlot("icon-end")&&s("slot",{key:"1d81872f18bf2c66af51eb327b45cd102dec9ec9",name:"icon-end"}),g(this.loading)&&this.h.hasSlot("icon-end")&&s("gov-icon",{key:"288d436dbc423b0a02701a0c7764b46f2957d7f4",name:"loader",class:"gov-spin-animation",type:"components"})))}onClickHandler(t){t.stopPropagation();if(this.disabled===false){this.govClick.emit({component:n.root,originalEvent:t,ref:this.host})}}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:n.root,originalEvent:t,ref:this.host})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:n.root,originalEvent:t,ref:this.host})}async setFocus(){this.triggerRef.focus()}async getRef(){return this.triggerRef}async validateAccessibility(){if(this.focusable){p(this.triggerRef.getAttribute("aria-label"),this.triggerRef.getAttribute("aria-labelledby"),n.root,this.host)}}get host(){return a(this)}static get watchers(){return{color:["validateColor"],type:["validateType"],size:["validateSize"],nativeType:["validateNativeType"]}}};export{C as gov_button};
|
|
2
|
+
//# sourceMappingURL=p-eb766437.entry.js.map
|