@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":["AttachmentsClass","root","label","list","AttachmentsItemClass","name","file","messages","GovAttachments","constructor","hostRef","this","h","govHost","host","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Host","key","class","classes","role","wcagLabel","validateWcagProp","govAttachmentsItemCss","GovAttachmentsItem","accessibleRemoveLabel","validateAccessibility","position","icon","getSlotContent","color","type","size","isString","replace","trim","accessibleRemoveLabelledBy","govRemove","emit","slot","hasSlot","validateAccessibleLabel","GovFormMessage","messageId","createID","validateColor","newValue","validateProp","FormMessageColors","FormMessageClass","componentWillLoad","id","content","identifier"],"sources":["../../../packages/core/src/components/gov-attachments/constants.ts","../../../packages/core/src/components/gov-attachments/gov-attachments.tsx","../../../packages/core/src/components/gov-attachments/gov-attachments-item.scss?tag=gov-attachments-item","../../../packages/core/src/components/gov-attachments/gov-attachments-item.tsx","../../../packages/core/src/components/gov-form/message/gov-form-message.tsx"],"sourcesContent":["export const AttachmentsClass = {\n\troot: 'gov-attachments',\n\tlabel: 'gov-attachments__label',\n\tlist: 'gov-attachments__list',\n}\n\nexport const AttachmentsItemClass = {\n\troot: 'gov-attachments-item',\n\tname: 'gov-attachments-item__name',\n\tfile: 'gov-attachments-item__file',\n\tmessages: 'gov-attachments-item__messages',\n}\n","import { Component, Element, h, Host, Method, Prop } from '@stencil/core'\nimport { AttachmentsClass } from './constants'\nimport { validateWcagProp } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments',\n})\nexport class GovAttachments {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsElement\n\t/**\n\t * Label of attachments section\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Adds accessible label for the attachment section that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsClass.root)}>\n\t\t\t\t{this.label ? <p class={AttachmentsClass.label}>{this.label}</p> : null}\n\t\t\t\t<div class={AttachmentsClass.list} role=\"list\" aria-label={this.wcagLabel}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagLabel, 'wcag-label', AttachmentsClass.root)\n\t}\n}\n","/* Attachments - Item */\n\n@use \"../../sass/mixins\" as mixin;\n@use \"../../sass/variables/general\" as general;\n@use \"gov-attachments-variables\" as variable;\n\n\ngov-attachments-item, .gov-attachments-item {\n\tdisplay: flex;\n\tflex-direction: column;\n\t&__messages {\n\t\t@include mixin.reset-last-margin();\n\t\t> * {\n\t\t\tposition: relative;\n\t\t\ttop: calc(-1 * var(--spacing-xs));\n\t\t}\n\t}\n\t&__file {\n\t\tdisplay: flex;\n\t\tgap: var(--spacing-s);\n\t\tmax-width: 100%;\n\t}\n\t&__name {\n\t\tdisplay: flex;\n\t\tcolumn-gap: var(--spacing-s);\n\t\talign-items: center;\n\t\tmax-width: calc(100% - var(--spacing-s) - var(--icon-size-s) - ((var(--spacing-s-nudge) + #{general.$border-width}) * 2));\n\t\tmargin: 0;\n\t\t> gov-tooltip, .gov-tooltip {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tmax-width: 100%;\n\t\t\tcolor: variable.$name-color;\n\t\t}\n\t\tspan[slot=\"info\"] {\n\t\t\t@include mixin.typography(\"body-xs\");\n\t\t\tcolor: variable.$decor-color;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop} from '@stencil/core'\nimport {AttachmentsItemClass} from './constants'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {delay} from '../../utils/utils'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {isString} from \"../../utils/helpers.types\";\n\n@Component({\n\ttag: 'gov-attachments-item',\n\tstyleUrl: 'gov-attachments-item.scss',\n})\nexport class GovAttachmentsItem {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsItemElement\n\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-remove-label'}) readonly accessibleRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Indicates the id of a component that labels the remove button.\n\t */\n\t@Prop({attribute: 'accessible-remove-labelledby'}) readonly accessibleRemoveLabelledBy: string\n\t/**\n\t * Emitted when the file is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<PointerEvent>\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsItemClass.root)} role=\"listitem\">\n\t\t\t\t<div class={AttachmentsItemClass.file}>\n\t\t\t\t\t<div class={AttachmentsItemClass.name}>\n\t\t\t\t\t\t<gov-tooltip position=\"top\" icon>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t\t<gov-tooltip-content>\n\t\t\t\t\t\t\t\t{this.h.getSlotContent(`name`)}\n\t\t\t\t\t\t\t</gov-tooltip-content>\n\t\t\t\t\t\t</gov-tooltip>\n\t\t\t\t\t\t<slot name=\"info\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\taria-label={isString(this.accessibleRemoveLabel) ? this.accessibleRemoveLabel.replace('{FILE_NAME}', this.h.getSlotContent(`name`) || '').trim() : null}\n\t\t\t\t\t\taria-labelledby={this.accessibleRemoveLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.govRemove.emit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon slot=\"icon-start\" name=\"x-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot('message') && (\n\t\t\t\t\t<div class={AttachmentsItemClass.messages}>\n\t\t\t\t\t\t<slot name=\"message\"/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the accessible attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleRemoveLabel, this.accessibleRemoveLabelledBy, AttachmentsItemClass.root, this.host)\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop, Watch } from '@stencil/core'\nimport {FormMessageClass, FormMessageSizesTypes, FormMessageColors, FormMessageColorType} from './constants'\nimport { govHost } from '../../../helpers/Dom/template'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { createID } from '../../../utils/string.utils'\n\n@Component({\n\ttag: 'gov-form-message',\n})\nexport class GovFormMessage {\n\th: GovHost\n\tprivate readonly messageId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.messageId = createID('GovFormMessage')\n\t}\n\n\t@Element() host: HTMLGovFormMessageElement\n\t/**\n\t * Style variation of the message.\n\t */\n\t@Prop({ attribute: 'color' }) readonly color?: FormMessageColorType = 'neutral'\n\t/**\n\t * Message's size.\n\t */\n\t@Prop() readonly size?: FormMessageSizesTypes = 'm'\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(FormMessageColors, newValue, FormMessageClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FormMessageClass.root)} color={this.color} size={this.size}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t)}\n\t\t\t\t<span id={this.messageId} class={FormMessageClass.content}>\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\t/**\n\t * Returns unique identifier of message\n\t */\n\t@Method()\n\tasync identifier(): Promise<string> {\n\t\treturn this.messageId\n\t}\n}\n"],"mappings":"8ZAAO,MAAMA,EAAmB,CAC/BC,KAAM,kBACNC,MAAO,yBACPC,KAAM,yBAGA,MAAMC,EAAuB,CACnCH,KA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,KAAKkB,uBAAyBlB,KAAKkB,sBAAsBS,QAAQ,cAAe3B,KAAKC,EAAEqB,eAAe,SAAW,IAAIM,OAAS,KAAI,kBACtI5B,KAAK6B,2BAA0B,eAClC7B,KAAK8B,UAAUC,MAE7B9B,EAAA,YAAAS,IAAA,2CAAUsB,KAAK,aAAatC,KAAK,OAAO8B,KAAK,iBAI9CxB,KAAKC,EAAEgC,QAAQ,YACfhC,EAAA,OAAAS,IAAA,2CAAKC,MAAOlB,EAAqBG,UAChCK,EAAA,QAAAS,IAAA,2CAAMhB,KAAK,a,CAWhB,2BAAMyB,GACLe,EAAwBlC,KAAKkB,sBAAuBlB,KAAK6B,2BAA4BpC,EAAqBH,KAAMU,KAAKG,K,+CCvE1GgC,EAAc,MAI1B,WAAArC,CAAAC,G,UASuCC,KAAAuB,MAA+B,UAIrDvB,KAAAyB,KAA+B,IAZ/CzB,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKoC,UAAYC,EAAS,iBAC1B,CAaD,aAAAC,CAAcC,GACbC,EAAaC,EAAmBF,EAAUG,EAAiBpD,K,CAG5D,iBAAAqD,GACC3C,KAAKsC,cAActC,KAAKuB,M,CAGzB,MAAAf,GACC,OACCP,EAACQ,EAAI,CAAAC,IAAA,2CAACC,MAAOX,KAAKC,EAAEW,QAAQ8B,EAAiBpD,MAAOiC,MAAOvB,KAAKuB,MAAOE,KAAMzB,KAAKyB,MAChFzB,KAAKC,EAAEgC,QAAQ,SACfhC,EAAA,QAAAS,IAAA,2CAAMhB,KAAK,SAEZO,EAAA,QAAAS,IAAA,2CAAMkC,GAAI5C,KAAKoC,UAAWzB,MAAO+B,EAAiBG,SACjD5C,EAAA,QAAAS,IAAA,8C,CAUJ,gBAAMoC,GACL,OAAO9C,KAAKoC,S","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["AttachmentsClass","root","label","list","AttachmentsItemClass","name","file","messages","GovAttachments","constructor","hostRef","this","h","govHost","host","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Host","key","class","classes","role","wcagLabel","validateWcagProp","govAttachmentsItemCss","GovAttachmentsItem","accessibleRemoveLabel","validateAccessibility","position","icon","getSlotContent","color","type","size","isString","replace","trim","accessibleRemoveLabelledBy","govRemove","emit","slot","hasSlot","validateAccessibleLabel","GovFormMessage","messageId","createID","validateColor","newValue","validateProp","FormMessageColors","FormMessageClass","componentWillLoad","id","content","identifier"],"sources":["../../../packages/core/src/components/gov-attachments/constants.ts","../../../packages/core/src/components/gov-attachments/gov-attachments.tsx","../../../packages/core/src/components/gov-attachments/gov-attachments-item.scss?tag=gov-attachments-item","../../../packages/core/src/components/gov-attachments/gov-attachments-item.tsx","../../../packages/core/src/components/gov-form/message/gov-form-message.tsx"],"sourcesContent":["export const AttachmentsClass = {\n\troot: 'gov-attachments',\n\tlabel: 'gov-attachments__label',\n\tlist: 'gov-attachments__list',\n}\n\nexport const AttachmentsItemClass = {\n\troot: 'gov-attachments-item',\n\tname: 'gov-attachments-item__name',\n\tfile: 'gov-attachments-item__file',\n\tmessages: 'gov-attachments-item__messages',\n}\n","import { Component, Element, h, Host, Method, Prop } from '@stencil/core'\nimport { AttachmentsClass } from './constants'\nimport { validateWcagProp } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments',\n})\nexport class GovAttachments {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsElement\n\t/**\n\t * Label of attachments section\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Adds accessible label for the attachment section that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsClass.root)}>\n\t\t\t\t{this.label ? <p class={AttachmentsClass.label}>{this.label}</p> : null}\n\t\t\t\t<div class={AttachmentsClass.list} role=\"list\" aria-label={this.wcagLabel}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagLabel, 'wcag-label', AttachmentsClass.root)\n\t}\n}\n","/* Attachments - Item */\n\n@use \"../../sass/mixins\" as mixin;\n@use \"../../sass/variables/general\" as general;\n@use \"gov-attachments-variables\" as variable;\n\n\ngov-attachments-item, .gov-attachments-item {\n\tdisplay: flex;\n\tflex-direction: column;\n\t&__messages {\n\t\t@include mixin.reset-last-margin();\n\t\t> * {\n\t\t\tposition: relative;\n\t\t\ttop: calc(-1 * var(--spacing-xs));\n\t\t}\n\t}\n\t&__file {\n\t\tdisplay: flex;\n\t\tgap: var(--spacing-s);\n\t\tmax-width: 100%;\n\t}\n\t&__name {\n\t\tdisplay: flex;\n\t\tcolumn-gap: var(--spacing-s);\n\t\talign-items: center;\n\t\tmax-width: calc(100% - var(--spacing-s) - var(--icon-size-s) - ((var(--spacing-s-nudge) + #{general.$border-width}) * 2));\n\t\tmargin: 0;\n\t\t> gov-tooltip, .gov-tooltip {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tmax-width: 100%;\n\t\t\tcolor: variable.$name-color;\n\t\t}\n\t\tspan[slot=\"info\"] {\n\t\t\t@include mixin.typography(\"body-xs\");\n\t\t\tcolor: variable.$decor-color;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop} from '@stencil/core'\nimport {AttachmentsItemClass} from './constants'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {delay} from '../../utils/utils'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {isString} from \"../../utils/helpers.types\";\n\n@Component({\n\ttag: 'gov-attachments-item',\n\tstyleUrl: 'gov-attachments-item.scss',\n})\nexport class GovAttachmentsItem {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsItemElement\n\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-remove-label'}) readonly accessibleRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Indicates the id of a component that labels the remove button.\n\t */\n\t@Prop({attribute: 'accessible-remove-labelledby'}) readonly accessibleRemoveLabelledBy: string\n\t/**\n\t * Emitted when the file is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<PointerEvent>\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsItemClass.root)} role=\"listitem\">\n\t\t\t\t<div class={AttachmentsItemClass.file}>\n\t\t\t\t\t<div class={AttachmentsItemClass.name}>\n\t\t\t\t\t\t<gov-tooltip position=\"top\" icon>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t\t<gov-tooltip-content>\n\t\t\t\t\t\t\t\t{this.h.getSlotContent(`name`)}\n\t\t\t\t\t\t\t</gov-tooltip-content>\n\t\t\t\t\t\t</gov-tooltip>\n\t\t\t\t\t\t<slot name=\"info\"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\taria-label={isString(this.accessibleRemoveLabel) ? this.accessibleRemoveLabel.replace('{FILE_NAME}', this.h.getSlotContent(`name`) || '').trim() : null}\n\t\t\t\t\t\taria-labelledby={this.accessibleRemoveLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.govRemove.emit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon slot=\"icon-start\" name=\"x-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot('message') && (\n\t\t\t\t\t<div class={AttachmentsItemClass.messages}>\n\t\t\t\t\t\t<slot name=\"message\"/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the accessible attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleRemoveLabel, this.accessibleRemoveLabelledBy, AttachmentsItemClass.root, this.host)\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop, Watch } from '@stencil/core'\nimport {FormMessageClass, FormMessageSizesTypes, FormMessageColors, FormMessageColorType} from './constants'\nimport { govHost } from '../../../helpers/Dom/template'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { createID } from '../../../utils/string.utils'\n\n@Component({\n\ttag: 'gov-form-message',\n})\nexport class GovFormMessage {\n\th: GovHost\n\tprivate readonly messageId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.messageId = createID('GovFormMessage')\n\t}\n\n\t@Element() host: HTMLGovFormMessageElement\n\t/**\n\t * Style variation of the message.\n\t */\n\t@Prop({ attribute: 'color' }) readonly color?: FormMessageColorType = 'neutral'\n\t/**\n\t * Message's size.\n\t */\n\t@Prop() readonly size?: FormMessageSizesTypes = 'm'\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(FormMessageColors, newValue, FormMessageClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FormMessageClass.root)} color={this.color} size={this.size}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t)}\n\t\t\t\t<span id={this.messageId} class={FormMessageClass.content}>\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\t/**\n\t * Returns unique identifier of message\n\t */\n\t@Method()\n\tasync identifier(): Promise<string> {\n\t\treturn this.messageId\n\t}\n}\n"],"mappings":"8ZAAO,MAAMA,EAAmB,CAC/BC,KAAM,kBACNC,MAAO,yBACPC,KAAM,yBAGA,MAAMC,EAAuB,CACnCH,KAAM,uBACNI,KAAM,6BACNC,KAAM,6BACNC,SAAU,kC,MCCEC,EAAc,MAG1B,WAAAC,CAAAC,G,UACCC,KAAKC,EAAIC,EAAQF,KAAKG,KACtB,CAYD,wBAAMC,GACL,GAAIC,IAA2B,OACxBC,EAAM,WACNN,KAAKO,c,EAIb,MAAAC,GACC,OACCP,EAACQ,EAAI,CAAAC,IAAA,2CAACC,MAAOX,KAAKC,EAAEW,QAAQvB,EAAiBC,OAC3CU,KAAKT,MAAQU,EAAA,KAAGU,MAAOtB,EAAiBE,OAAQS,KAAKT,OAAa,KACnEU,EAAA,OAAAS,IAAA,2CAAKC,MAAOtB,EAAiBG,KAAMqB,KAAK,OAAM,aAAab,KAAKc,WAC/Db,EAAQ,QAAAS,IAAA,8C,CAUZ,kBAAMH,GACLQ,EAAiBf,KAAKc,UAAW,aAAczB,EAAiBC,K,6BCnDlE,MAAM0B,EAAwB,sqC,MCajBC,EAAkB,MAG9B,WAAAnB,CAAAC,G,8CASuDC,KAAqBkB,sBAAW,6BARtFlB,KAAKC,EAAIC,EAAQF,KAAKG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,K,CAG5D,iBAAAqD,GACC3C,KAAKsC,cAActC,KAAKuB,M,CAGzB,MAAAf,GACC,OACCP,EAACQ,EAAK,CAAAC,IAAA,2CAAAC,MAAOX,KAAKC,EAAEW,QAAQ8B,EAAiBpD,MAAOiC,MAAOvB,KAAKuB,MAAOE,KAAMzB,KAAKyB,MAChFzB,KAAKC,EAAEgC,QAAQ,SACfhC,EAAM,QAAAS,IAAA,2CAAAhB,KAAK,SAEZO,EAAM,QAAAS,IAAA,2CAAAkC,GAAI5C,KAAKoC,UAAWzB,MAAO+B,EAAiBG,SACjD5C,EAAQ,QAAAS,IAAA,8C,CAUZ,gBAAMoC,GACL,OAAO9C,KAAKoC,S","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as e,H as o,g as a}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as e,H as o,g as a}from"./p-ClISz4NF.js";import{g as s}from"./p-CoD1xawt.js";import{p as i}from"./p-CQvUntGY.js";import{S as r}from"./p-BcQO4NH2.js";import{v as c}from"./p-NOJjz9dT.js";import"./p-CgDnDrq5.js";const n=i(r,["_S","_M","_L","_XL"]);var d;(function(t){t["SIMPLE"]="simple";t["WAVES"]="waves";t["STRIPES"]="stripes";t["LINES"]="lines"})(d||(d={}));var l;(function(t){t["IMAGE"]="image";t["LOGO"]="logo";t["ICON"]="icon"})(l||(l={}));var b;(function(t){t["LIGHT"]="light";t["DARK"]="dark"})(b||(b={}));const f={root:"gov-banner",content:"gov-banner__content"};const h=class{constructor(e){t(this,e);this.size=n._M;this.background=d.SIMPLE;this.foreground=l.IMAGE;this.textColor=b.LIGHT;this.h=s(this.host)}validateSize(t){c(n,t,f.root)}validateBackground(t){c(d,t,f.root)}validateForeground(t){c(l,t,f.root)}validateTextColor(t){c(b,t,f.root)}componentWillLoad(){this.validateSize(this.size);this.validateBackground(this.background);this.validateForeground(this.foreground);this.validateTextColor(this.textColor)}render(){return e(o,Object.assign({key:"142c906194083f6c186d1f1d9033c4f2c9be9bff",class:this.h.classes(f.root),role:"region",size:this.size},this.size!=="xl"?{background:this.background,foreground:this.foreground}:{"text-color":this.textColor}),e("div",{key:"0b52a8859b6cdcd92d0f5e97b460a3e0a899bd44"},e("div",{key:"a36ed5ad57c878d70770ccfeccd172749a555b22",class:f.content},e("slot",{key:"57f52bfb0189450e77c00f4d9904712e555a3125",name:"headline"}),e("slot",{key:"91629f1bf0605ae28d694d044d19bbef9ebb69da"})),this.h.hasSlot("button")&&e("slot",{key:"458a59c73e9bdf02d6cdb1e8c5caea0dcfec526a",name:"button"})),e("slot",{key:"f1d60077313455ed78c78b56c7741b4b593cf7cc",name:"image"}))}get host(){return a(this)}static get watchers(){return{size:["validateSize"],background:["validateBackground"],foreground:["validateForeground"],"text-color":["validateTextColor"]}}};export{h as gov_banner};
|
|
2
|
+
//# sourceMappingURL=p-7f513718.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BannerSizes","pick","Sizes","BannerBackground","BannerForeground","BannerTextColor","BannerClass","root","content","GovBanner","constructor","hostRef","this","size","_M","background","SIMPLE","foreground","IMAGE","textColor","LIGHT","h","govHost","host","validateSize","newValue","validateProp","validateBackground","validateForeground","validateTextColor","componentWillLoad","render","Host","Object","assign","key","class","classes","role","name","hasSlot"],"sources":["../../../packages/core/src/components/gov-banner/constants.ts","../../../packages/core/src/components/gov-banner/gov-banner.tsx"],"sourcesContent":["import {ValueOf} from \"../../types/interfaces\";\nimport {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const BannerSizes = pick(Sizes, ['_S', '_M', '_L', '_XL'])\nexport type BannerSizesType = `${ValueOf<typeof BannerSizes>}`\n\nexport enum BannerBackground {\n\tSIMPLE = 'simple',\n\tWAVES = 'waves',\n\tSTRIPES = 'stripes',\n\tLINES = 'lines',\n}\nexport type BannerBackgroundsType = `${ValueOf<typeof BannerBackground>}`\n\nexport enum BannerForeground {\n\tIMAGE = 'image',\n\tLOGO = 'logo',\n\tICON = 'icon',\n}\nexport type BannerForegroundsType = `${ValueOf<typeof BannerForeground>}`\n\nexport enum BannerTextColor {\n\tLIGHT = 'light',\n\tDARK = 'dark',\n}\nexport type BannerTextColorsType = `${ValueOf<typeof BannerTextColor>}`\n\nexport const BannerClass = {\n\troot: 'gov-banner',\n\tcontent: 'gov-banner__content',\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 {\n BannerBackground,\n BannerBackgroundsType,\n BannerClass,\n BannerForeground,\n BannerForegroundsType,\n BannerSizes,\n BannerSizesType,\n BannerTextColor,\n BannerTextColorsType\n} from \"./constants\";\nimport {validateProp} from \"../../helpers/Validate/props\";\n\n@Component({\n tag: 'gov-banner',\n})\nexport class GovBanner {\n private h: GovHost\n\n constructor() {\n this.h = govHost(this.host)\n }\n\n @Element() host: HTMLGovBannerElement\n /**\n * Banner’s size.\n */\n @Prop({reflect: true}) readonly size: BannerSizesType = BannerSizes._M\n /**\n * Banner’s background\n */\n @Prop() readonly background: BannerBackgroundsType = BannerBackground.SIMPLE\n /**\n * Banner’s foreground\n */\n @Prop() readonly foreground: BannerForegroundsType = BannerForeground.IMAGE\n /**\n * XL Banner’s text color\n */\n @Prop({attribute: 'text-color'}) readonly textColor: BannerTextColorsType = BannerTextColor.LIGHT\n\n @Watch('size')\n validateSize(newValue: string): void {\n validateProp(BannerSizes, newValue, BannerClass.root)\n }\n\n @Watch('background')\n validateBackground(newValue: string): void {\n validateProp(BannerBackground, newValue, BannerClass.root)\n }\n\n @Watch('foreground')\n validateForeground(newValue: string): void {\n validateProp(BannerForeground, newValue, BannerClass.root)\n }\n\n @Watch('text-color')\n validateTextColor(newValue: string): void {\n validateProp(BannerTextColor, newValue, BannerClass.root)\n }\n\n componentWillLoad(): void {\n this.validateSize(this.size)\n this.validateBackground(this.background)\n this.validateForeground(this.foreground)\n this.validateTextColor(this.textColor)\n }\n\n render() {\n return (\n <Host class={this.h.classes(BannerClass.root)}\n role=\"region\"\n size={this.size}\n {...(this.size !== \"xl\" ? {\n background: this.background,\n foreground: this.foreground\n } : {'text-color': this.textColor})}>\n <div>\n <div class={BannerClass.content}>\n <slot name=\"headline\"/>\n <slot/>\n </div>\n {this.h.hasSlot('button') && (\n <slot name=\"button\"/>\n )}\n </div>\n <slot name=\"image\"/>\n </Host>\n )\n }\n}\n"],"mappings":"iOAIO,MAAMA,EAAcC,EAAKC,EAAO,CAAC,KAAM,KAAM,KAAM,QAG1D,IAAYC,GAAZ,SAAYA,GACXA,EAAA,mBACAA,EAAA,iBACAA,EAAA,qBACAA,EAAA,gBACA,EALD,CAAYA,
|
|
1
|
+
{"version":3,"names":["BannerSizes","pick","Sizes","BannerBackground","BannerForeground","BannerTextColor","BannerClass","root","content","GovBanner","constructor","hostRef","this","size","_M","background","SIMPLE","foreground","IMAGE","textColor","LIGHT","h","govHost","host","validateSize","newValue","validateProp","validateBackground","validateForeground","validateTextColor","componentWillLoad","render","Host","Object","assign","key","class","classes","role","name","hasSlot"],"sources":["../../../packages/core/src/components/gov-banner/constants.ts","../../../packages/core/src/components/gov-banner/gov-banner.tsx"],"sourcesContent":["import {ValueOf} from \"../../types/interfaces\";\nimport {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const BannerSizes = pick(Sizes, ['_S', '_M', '_L', '_XL'])\nexport type BannerSizesType = `${ValueOf<typeof BannerSizes>}`\n\nexport enum BannerBackground {\n\tSIMPLE = 'simple',\n\tWAVES = 'waves',\n\tSTRIPES = 'stripes',\n\tLINES = 'lines',\n}\nexport type BannerBackgroundsType = `${ValueOf<typeof BannerBackground>}`\n\nexport enum BannerForeground {\n\tIMAGE = 'image',\n\tLOGO = 'logo',\n\tICON = 'icon',\n}\nexport type BannerForegroundsType = `${ValueOf<typeof BannerForeground>}`\n\nexport enum BannerTextColor {\n\tLIGHT = 'light',\n\tDARK = 'dark',\n}\nexport type BannerTextColorsType = `${ValueOf<typeof BannerTextColor>}`\n\nexport const BannerClass = {\n\troot: 'gov-banner',\n\tcontent: 'gov-banner__content',\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 {\n BannerBackground,\n BannerBackgroundsType,\n BannerClass,\n BannerForeground,\n BannerForegroundsType,\n BannerSizes,\n BannerSizesType,\n BannerTextColor,\n BannerTextColorsType\n} from \"./constants\";\nimport {validateProp} from \"../../helpers/Validate/props\";\n\n@Component({\n tag: 'gov-banner',\n})\nexport class GovBanner {\n private h: GovHost\n\n constructor() {\n this.h = govHost(this.host)\n }\n\n @Element() host: HTMLGovBannerElement\n /**\n * Banner’s size.\n */\n @Prop({reflect: true}) readonly size: BannerSizesType = BannerSizes._M\n /**\n * Banner’s background\n */\n @Prop() readonly background: BannerBackgroundsType = BannerBackground.SIMPLE\n /**\n * Banner’s foreground\n */\n @Prop() readonly foreground: BannerForegroundsType = BannerForeground.IMAGE\n /**\n * XL Banner’s text color\n */\n @Prop({attribute: 'text-color'}) readonly textColor: BannerTextColorsType = BannerTextColor.LIGHT\n\n @Watch('size')\n validateSize(newValue: string): void {\n validateProp(BannerSizes, newValue, BannerClass.root)\n }\n\n @Watch('background')\n validateBackground(newValue: string): void {\n validateProp(BannerBackground, newValue, BannerClass.root)\n }\n\n @Watch('foreground')\n validateForeground(newValue: string): void {\n validateProp(BannerForeground, newValue, BannerClass.root)\n }\n\n @Watch('text-color')\n validateTextColor(newValue: string): void {\n validateProp(BannerTextColor, newValue, BannerClass.root)\n }\n\n componentWillLoad(): void {\n this.validateSize(this.size)\n this.validateBackground(this.background)\n this.validateForeground(this.foreground)\n this.validateTextColor(this.textColor)\n }\n\n render() {\n return (\n <Host class={this.h.classes(BannerClass.root)}\n role=\"region\"\n size={this.size}\n {...(this.size !== \"xl\" ? {\n background: this.background,\n foreground: this.foreground\n } : {'text-color': this.textColor})}>\n <div>\n <div class={BannerClass.content}>\n <slot name=\"headline\"/>\n <slot/>\n </div>\n {this.h.hasSlot('button') && (\n <slot name=\"button\"/>\n )}\n </div>\n <slot name=\"image\"/>\n </Host>\n )\n }\n}\n"],"mappings":"iOAIO,MAAMA,EAAcC,EAAKC,EAAO,CAAC,KAAM,KAAM,KAAM,QAG1D,IAAYC,GAAZ,SAAYA,GACXA,EAAA,mBACAA,EAAA,iBACAA,EAAA,qBACAA,EAAA,gBACA,EALD,CAAYA,MAKX,KAGD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,iBACAA,EAAA,eACAA,EAAA,cACA,EAJD,CAAYA,MAIX,KAGD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,iBACAA,EAAA,cACA,EAHD,CAAYA,MAGX,KAGM,MAAMC,EAAc,CAC1BC,KAAM,aACNC,QAAS,uB,MCXGC,EAAS,MAGlB,WAAAC,CAAAC,G,UAQgCC,KAAAC,KAAwBb,EAAYc,GAInDF,KAAAG,WAAoCZ,EAAiBa,OAIrDJ,KAAAK,WAAoCb,EAAiBc,MAI5BN,KAAAO,UAAkCd,EAAgBe,MAnBxFR,KAAKS,EAAIC,EAAQV,KAAKW,KACzB,CAqBD,YAAAC,CAAaC,GACTC,EAAa1B,EAAayB,EAAUnB,EAAYC,K,CAIpD,kBAAAoB,CAAmBF,GACfC,EAAavB,EAAkBsB,EAAUnB,EAAYC,K,CAIzD,kBAAAqB,CAAmBH,GACfC,EAAatB,EAAkBqB,EAAUnB,EAAYC,K,CAIzD,iBAAAsB,CAAkBJ,GACdC,EAAarB,EAAiBoB,EAAUnB,EAAYC,K,CAGxD,iBAAAuB,GACIlB,KAAKY,aAAaZ,KAAKC,MACvBD,KAAKe,mBAAmBf,KAAKG,YAC7BH,KAAKgB,mBAAmBhB,KAAKK,YAC7BL,KAAKiB,kBAAkBjB,KAAKO,U,CAGhC,MAAAY,GACI,OACIV,EAACW,EAAIC,OAAAC,OAAA,CAAAC,IAAA,2CAACC,MAAOxB,KAAKS,EAAEgB,QAAQ/B,EAAYC,MAClC+B,KAAK,SACLzB,KAAMD,KAAKC,MACND,KAAKC,OAAS,KAAO,CACtBE,WAAYH,KAAKG,WACjBE,WAAYL,KAAKK,YACjB,CAAC,aAAcL,KAAKO,YAC1BE,EAAA,OAAAc,IAAA,4CACId,EAAA,OAAAc,IAAA,2CAAKC,MAAO9B,EAAYE,SACpBa,EAAM,QAAAc,IAAA,2CAAAI,KAAK,aACXlB,EAAA,QAAAc,IAAA,8CAEHvB,KAAKS,EAAEmB,QAAQ,WACZnB,EAAA,QAAAc,IAAA,2CAAMI,KAAK,YAGnBlB,EAAA,QAAAc,IAAA,2CAAMI,KAAK,U","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,h as t,H as r,g as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as s,h as t,H as r,g as e}from"./p-ClISz4NF.js";import{G as o}from"./p-C6JN9gdb.js";import{g as c}from"./p-CoD1xawt.js";import"./p-BcQO4NH2.js";const a=class{constructor(t){s(this,t);this.h=c(this.host)}render(){return t(r,{key:"709f373fe63ba089e6c37ed7c61359e7b07a67e2",class:this.h.classes(o.root),role:"list"},t("slot",{key:"acb0cc5b4279d57c375c7cee80ebf305809dfd4d"}))}get host(){return e(this)}};export{a as gov_grid};
|
|
2
|
+
//# sourceMappingURL=p-852310d9.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovGrid","constructor","hostRef","this","h","govHost","host","render","Host","key","class","classes","GridClass","root","role"],"sources":["../../../packages/core/src/components/gov-grid/gov-grid.tsx"],"sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core'\nimport { GridClass, GridSizesType } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-grid',\n})\nexport class GovGrid {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovGridElement\n\n\t/**\n\t * Horizontal align of cells\n\t */\n\t@Prop({ attribute: 'align-items', reflect: true }) alignItems?: 'start' | 'center' | 'end' | 'stretch';\n\n\t/**\n\t * Vertical align of cells\n\t */\n\t@Prop({ attribute: 'justify-items', reflect: true }) justifyItems?: 'start' | 'center' | 'end' | 'stretch';\n\n\t/**\n\t * The gap property creates consistent spacing between flex items in the container.\n\t */\n\t@Prop({ attribute: 'gap', reflect: true }) gap?: GridSizesType;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(GridClass.root)} role=\"list\">\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"+JAQaA,EAAO,MAGnB,WAAAC,CAAAC,G,UACCC,KAAKC,EAAIC,EAAQF,KAAKG,KACtB,CAmBD,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOP,KAAKC,EAAEO,QAAQC,EAAUC,MAAOC,KAAK,QACjDV,
|
|
1
|
+
{"version":3,"names":["GovGrid","constructor","hostRef","this","h","govHost","host","render","Host","key","class","classes","GridClass","root","role"],"sources":["../../../packages/core/src/components/gov-grid/gov-grid.tsx"],"sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core'\nimport { GridClass, GridSizesType } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-grid',\n})\nexport class GovGrid {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovGridElement\n\n\t/**\n\t * Horizontal align of cells\n\t */\n\t@Prop({ attribute: 'align-items', reflect: true }) alignItems?: 'start' | 'center' | 'end' | 'stretch';\n\n\t/**\n\t * Vertical align of cells\n\t */\n\t@Prop({ attribute: 'justify-items', reflect: true }) justifyItems?: 'start' | 'center' | 'end' | 'stretch';\n\n\t/**\n\t * The gap property creates consistent spacing between flex items in the container.\n\t */\n\t@Prop({ attribute: 'gap', reflect: true }) gap?: GridSizesType;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(GridClass.root)} role=\"list\">\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"+JAQaA,EAAO,MAGnB,WAAAC,CAAAC,G,UACCC,KAAKC,EAAIC,EAAQF,KAAKG,KACtB,CAmBD,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOP,KAAKC,EAAEO,QAAQC,EAAUC,MAAOC,KAAK,QACjDV,EAAa,QAAAK,IAAA,6C","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as h,g as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,H as h,g as e}from"./p-ClISz4NF.js";import{a as o,b as a}from"./p-CoD1xawt.js";import{v as n}from"./p-NOJjz9dT.js";import{r,c as l}from"./p-vN03FcXN.js";import{d as c,t as f,h as p}from"./p-CQvUntGY.js";import{F as u,a as d}from"./p-DYcNEwSZ.js";import{p as m}from"./p-Ccwpa1ck.js";import{A as b,a as v}from"./p-Bz_RzYFb.js";import{i as g}from"./p-CzXeijOj.js";import"./p-CgDnDrq5.js";import"./p-BcQO4NH2.js";import"./p-DNztiAH0.js";const y=t=>typeof t==="string"?r(t).toLowerCase():"";const w=(t,s,i,h)=>{const e=Array.isArray(t)?t:[];const o=y(s);const a=o.length===0?e:e.filter((t=>{const s=t===null||t===void 0?void 0:t[i];return typeof s==="string"&&y(s).includes(o)}));return Number.isInteger(h)&&h>0?a.slice(0,h):a};const j=class{constructor(i){t(this,i);this.govFocus=s(this,"gov-focus");this.govBlur=s(this,"gov-blur");this.govInput=s(this,"gov-input");this.govSelect=s(this,"gov-select");this.fullOptions=[];this.templateResolver=t=>t[this.nameKey];this.value="";this.size="m";this.nameKey="name";this.required=false;this.disabled=false;this.minlength=3;this.maxOptions=10;this.throttleTime=200;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.processing=false;this.arrowCounter=-1;this.list=[];this.inheritedAttributes={};this.emitAndSearch=t=>{this.govInput.emit({originalEvent:t,component:u.root,value:this.value,selected:null});this.doSearch()};this.onInputHandler=t=>{t.stopPropagation();this.value=t.detail.value;this.debouncedSearch(t)};this.listBoxId=l("GovListBox")}validateSize(t){n(d,t,u.root)}watchOptions(t){this.fullOptions=m(t);if(this.searchCallback){this.setOptions(this.fullOptions).catch()}else{this.list=w(this.fullOptions,this.value,this.nameKey,this.maxOptions)}}onArrowUp(){if(this.arrowCounter>0){this.arrowCounter=this.arrowCounter-1;this.moveToView().finally()}}onArrowDown(){if(this.arrowCounter<this.list.length-1){this.arrowCounter=this.arrowCounter+1;this.moveToView().finally()}}async moveToView(){await c(200);const t=this.listRef.offsetHeight;const s=this.listRef.querySelector('li[aria-selected="true"]');if(s&&t){const t=s.offsetTop;this.listRef.scrollTo({top:t,behavior:"smooth"})}}doSearch(){if(this.searchCallback){if(Number.isInteger(this.minlength)&&this.isValueAccepted===false&&this.minlength){this.list=[];this.arrowCounter=-1;this.processing=false;return}this.processing=true;this.searchCallback(this.value).then((t=>this.list=t)).catch((()=>this.list=[])).finally((()=>{this.arrowCounter=-1;this.processing=false}));return}this.list=w(this.fullOptions,this.value,this.nameKey,this.maxOptions);this.arrowCounter=-1}clearList(){if(this.fullOptions.length===0){this.list=[]}}get isValueAccepted(){if(typeof this.value==="string"){return this.value.length>=this.minlength}else{return false}}componentDidLoad(){this.attributeObserver=new b(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(v)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=g(this.host);this.debouncedSearch=f(this.emitAndSearch,this.throttleTime);this.fullOptions=m(this.options);if(!this.searchCallback){this.list=w(this.fullOptions,this.value,this.nameKey,this.maxOptions)}}watchThrottleTime(){this.debouncedSearch=f(this.emitAndSearch,this.throttleTime)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){return i(h,{key:"0cdbf770359115b24432e9d533b4e17ab2c65e18",class:u.root,size:this.size},i("gov-form-input",Object.assign({key:"5724ed153e3f2384725badbafdb0c19e67b69538",placeholder:this.placeholder,name:this.name,disabled:this.disabled,readonly:this.readonly,autocomplete:false,size:this.size,required:this.required,invalid:this.invalid,success:this.success,role:"searchbox",value:this.value,minlength:this.minlength,maxlength:this.maxlength,"on-gov-input":this.onInputHandler,"on-gov-keyup":this.onKeyUpHandler.bind(this),"on-gov-keydown":this.onKeyDownHandler.bind(this),"on-gov-focus":this.onFocusHandler.bind(this),"on-gov-blur":this.onBlurHandler.bind(this)},this.inheritedAttributes,{"aria-autocomplete":"list","aria-owns":[this.listBoxId,this.inheritedAttributes["aria-owns"]].join(" "),"aria-expanded":a(this.list.length&&this.focused?true:false),ref:t=>this.inputRef=t}),i("slot",{key:"ab6f37982f3d13adc2473a744b5697ac8bc651f5",name:"validation-icon"}),i("slot",{key:"1961a029eceee169b5be12fa4ba8c2e9072bb9de",name:"icon-end"})),i("ul",{key:"61b9b6929be4816e93e1b5fb778c3861b4f8631b",class:u.list,role:"listbox","aria-hidden":o(!this.focused),hidden:!this.focused,id:this.listBoxId,ref:t=>this.listRef=t},this.focused&&this.list.length===0&&this.processing===false&&(this.isValueAccepted||!this.searchCallback&&this.fullOptions.length>0)&&this.messageEmpty?i("li",{class:u.empty},this.messageEmpty):null,this.focused&&this.processing===true&&this.isValueAccepted?i("li",{class:u.loading},i("gov-skeleton",{size:"m"})):null,this.focused?this.list.map(((t,s)=>{const h=this.arrowCounter===s;return i("li",{class:u.item,innerHTML:this.templateResolver(t,h),role:"option","aria-posinset":s,tabindex:h?0:-1,"aria-setsize":this.list.length,onTouchStart:t=>this.onSelectHandler(t,s),onMouseDown:t=>this.onSelectHandler(t,s),"aria-selected":o(h)},i("slot",{name:"list-item-left"}),i("slot",{name:"list-item-right"}))})):null))}onFocusHandler(t){this.focused=true;this.arrowCounter=-1;if(this.searchCallback){if(this.isValueAccepted){this.doSearch()}}else{this.doSearch()}t.stopPropagation();this.govFocus.emit({originalEvent:t,component:u.root,value:this.value,selected:null})}onBlurHandler(t){this.focused=false;this.clearList();this.arrowCounter=-1;t.stopPropagation();this.govBlur.emit({originalEvent:t,component:u.root,value:this.value,selected:null})}onSelectHandler(t,s=-1){let i=null;if(s>-1){i=this.list[s]}else if(p(this.arrowCounter,this.list)){i=this.list[this.arrowCounter]}if(i){this.govSelect.emit({component:u.root,value:this.value,selected:i,originalEvent:t});this.clearList();if(p(this.nameKey,i)&&typeof i[this.nameKey]==="string"){this.value=i[this.nameKey]}}}onKeyUpHandler(t){const s=t.detail.originalEvent;t.stopPropagation();s.stopPropagation();if(s.keyCode===38)this.onArrowUp();else if(s.keyCode===40)this.onArrowDown();else if(s.keyCode===13){t.preventDefault();s.preventDefault();this.onSelectHandler(t)}}onKeyDownHandler(t){const s=t.detail.originalEvent;t.stopPropagation();s.stopPropagation();if(s.keyCode===13){t.preventDefault();s.preventDefault()}}async setFocus(t){return this.inputRef.focus(t)}async setBlur(){return this.inputRef.blur()}async setOptions(t){this.list=Array.isArray(t)?t:[];this.arrowCounter=-1}async clearValue(){this.value="";this.inputRef.value="";await this.inputRef.clearValue()}async setProcessing(t){this.processing=t}async setSearchCallback(t){this.searchCallback=t}async setTemplateResolver(t){this.templateResolver=t}get host(){return e(this)}static get watchers(){return{size:["validateSize"],options:["watchOptions"],throttleTime:["watchThrottleTime"]}}};export{j as gov_form_autocomplete};
|
|
2
|
+
//# sourceMappingURL=p-8d47e346.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["normalize","value","removeDiacritics","toLowerCase","filterAutocompleteOptions","options","query","nameKey","maxOptions","source","Array","isArray","normalizedQuery","matches","length","filter","item","text","includes","Number","isInteger","slice","GovFormAutocomplete","constructor","hostRef","this","fullOptions","templateResolver","size","required","disabled","minlength","throttleTime","messageEmpty","processing","arrowCounter","list","inheritedAttributes","emitAndSearch","e","govInput","emit","originalEvent","component","FormAutocompleteClass","root","selected","doSearch","onInputHandler","stopPropagation","detail","debouncedSearch","listBoxId","createID","validateSize","newValue","validateProp","FormAutocompleteSizes","watchOptions","propsValueToArray","searchCallback","setOptions","catch","onArrowUp","moveToView","finally","onArrowDown","delay","heightOfList","listRef","offsetHeight","querySelector","offsetTop","scrollTo","top","behavior","isValueAccepted","then","response","clearList","componentDidLoad","attributeObserver","AttributeObserver","host","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","inheritAriaAttributes","throttle","watchThrottleTime","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","h","Host","key","class","placeholder","name","readonly","autocomplete","invalid","success","role","maxlength","onKeyUpHandler","bind","onKeyDownHandler","onFocusHandler","onBlurHandler","join","booleanString","focused","ref","el","inputRef","toBoolAttr","hidden","id","empty","loading","map","index","isSelected","innerHTML","tabindex","onTouchStart","onSelectHandler","onMouseDown","govFocus","govBlur","has","govSelect","event","keyCode","preventDefault","setFocus","focus","setBlur","blur","clearValue","setProcessing","status","setSearchCallback","callback","setTemplateResolver"],"sources":["../../../packages/core/src/components/gov-form/autocomplete/autocomplete.utils.ts","../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"sourcesContent":["import { removeDiacritics } from '../../../utils/string.utils'\nimport { GovFormAutocompleteItem } from './gov-form-autocomplete.types'\n\nconst normalize = (value: unknown): string =>\n\ttypeof value === 'string' ? removeDiacritics(value).toLowerCase() : ''\n\nexport const filterAutocompleteOptions = (\n\toptions: GovFormAutocompleteItem[],\n\tquery: string,\n\tnameKey: string,\n\tmaxOptions: number,\n): GovFormAutocompleteItem[] => {\n\tconst source = Array.isArray(options) ? options : []\n\tconst normalizedQuery = normalize(query)\n\tconst matches =\n\t\tnormalizedQuery.length === 0\n\t\t\t? source\n\t\t\t: source.filter(item => {\n\t\t\t\t\tconst text = item?.[nameKey]\n\t\t\t\t\treturn typeof text === 'string' && normalize(text).includes(normalizedQuery)\n\t\t\t\t})\n\treturn Number.isInteger(maxOptions) && maxOptions > 0 ? matches.slice(0, maxOptions) : matches\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {booleanString, toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {FormAutocompleteClass, FormAutocompleteSizes, SizesType,} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport { filterAutocompleteOptions } from './autocomplete.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-autocomplete',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate fullOptions: GovFormAutocompleteItem[] = []\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\tprivate attributeObserver: AttributeObserver\n\tprivate debouncedSearch: (e: CustomEvent<FormInputEvent>) => void\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\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() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop({attribute: 'name-key'}) readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\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 * Makes the input 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 * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Maximum number of items shown from a static `options` list (0 = unlimited).\n\t * Applies only when no async search callback is set.\n\t */\n\t@Prop({attribute: 'max-options'}) readonly maxOptions: number = 10\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.fullOptions = propsValueToArray<GovFormAutocompleteItem[]>(newValue)\n\t\tif (this.searchCallback) {\n\t\t\tthis.setOptions(this.fullOptions).catch()\n\t\t} else {\n\t\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\t}\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (this.searchCallback) {\n\t\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\t\tthis.list = []\n\t\t\t\tthis.arrowCounter = -1\n\t\t\t\tthis.processing = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t\treturn\n\t\t}\n\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\tthis.arrowCounter = -1\n\t}\n\n\tprivate clearList() {\n\t\tif (this.fullOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t\tthis.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime)\n\t\tthis.fullOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (!this.searchCallback) {\n\t\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\t}\n\t}\n\n\t@Watch('throttleTime')\n\twatchThrottleTime() {\n\t\tthis.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime)\n\t}\n\n\tprivate emitAndSearch = (e: CustomEvent<FormInputEvent>) => {\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={this.onInputHandler}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-autocomplete={'list'}\n\t\t\t\t\taria-owns={[this.listBoxId, this.inheritedAttributes['aria-owns']].join(' ')}\n\t\t\t\t\taria-expanded={booleanString(this.list.length && this.focused ? true : false)}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"validation-icon\" />\n\t\t\t\t\t<slot name=\"icon-end\" />\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list}\n\t\t\t\t\trole={'listbox'}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.focused)}\n\t\t\t\t\thidden={!this.focused}\n\t\t\t\t\tid={this.listBoxId}\n\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && (this.isValueAccepted || (!this.searchCallback && this.fullOptions.length > 0)) && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-skeleton size=\"m\"></gov-skeleton>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused ? this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-left\"/>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-right\"/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}) : null}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.searchCallback) {\n\t\t\tif (this.isValueAccepted) {\n\t\t\t\tthis.doSearch()\n\t\t\t}\n\t\t} else {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.clearList();\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler = (e: CustomEvent<FormInputEvent>) => {\n\t\te.stopPropagation()\n\t\tthis.value = e.detail.value\n\t\tthis.debouncedSearch(e)\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.clearList();\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Focus main input element\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Blur main input element\n\t */\n\t@Method()\n\tasync setBlur(): Promise<void> {\n\t\treturn this.inputRef.blur()\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setT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5C,MAAOwB,KAAKxB,MACZ6C,SAAUA,EACVJ,cAAeH,IAEhBd,KAAKsD,YACL,GAAI0D,EAAIhH,KAAKlB,QAASuC,WAAoBA,EAASrB,KAAKlB,WAAa,SAAU,CAC9EkB,KAAKxB,MAAQ6C,EAASrB,KAAKlB,Q,GAKtB,cAAAwG,CAAexE,GACtB,MAAMoG,EAASpG,EAAEW,OAA0BR,cAC3CH,EAAEU,kBACF0F,EAAM1F,kBACN,GAAI0F,EAAMC,UAAY,GAAInH,KAAKsC,iBAC1B,GAAI4E,EAAMC,UAAY,GAAInH,KAAKyC,mBAC/B,GAAIyE,EAAMC,UAAY,GAAI,CAC9BrG,EAAEsG,iBACFF,EAAME,iBACNpH,KAAK4G,gBAAgB9F,E,EAIf,gBAAA0E,CAAiB1E,GACxB,MAAMoG,EAASpG,EAAEW,OAA0BR,cAC3CH,EAAEU,kBACF0F,EAAM1F,kBACN,GAAI0F,EAAMC,UAAY,GAAI,CACzBrG,EAAEsG,iBACFF,EAAME,gB,EAQR,cAAMC,CAASzI,GACd,OAAOoB,KAAKgG,SAASsB,MAAM1I,E,CAO5B,aAAM2I,GACL,OAAOvH,KAAKgG,SAASwB,M,CAOtB,gBAAMpF,CAAWxD,GAChBoB,KAAKW,KAAO1B,MAAMC,QAAQN,GAAWA,EAAU,GAC/CoB,KAAKU,cAAe,C,CAOrB,gBAAM+G,GACLzH,KAAKxB,MAAQ,GACbwB,KAAKgG,SAASxH,MAAQ,SAEhBwB,KAAKgG,SAASyB,Y,CAOrB,mBAAMC,CAAcC,GACnB3H,KAAKS,WAAakH,C,CAOnB,uBAAMC,CAAkBC,GACvB7H,KAAKmC,eAAiB0F,C,CAQvB,yBAAMC,CAAoBD,GACzB7H,KAAKE,iBAAmB2H,C","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["normalize","value","removeDiacritics","toLowerCase","filterAutocompleteOptions","options","query","nameKey","maxOptions","source","Array","isArray","normalizedQuery","matches","length","filter","item","text","includes","Number","isInteger","slice","GovFormAutocomplete","constructor","hostRef","this","fullOptions","templateResolver","size","required","disabled","minlength","throttleTime","messageEmpty","processing","arrowCounter","list","inheritedAttributes","emitAndSearch","e","govInput","emit","originalEvent","component","FormAutocompleteClass","root","selected","doSearch","onInputHandler","stopPropagation","detail","debouncedSearch","listBoxId","createID","validateSize","newValue","validateProp","FormAutocompleteSizes","watchOptions","propsValueToArray","searchCallback","setOptions","catch","onArrowUp","moveToView","finally","onArrowDown","delay","heightOfList","listRef","offsetHeight","querySelector","offsetTop","scrollTo","top","behavior","isValueAccepted","then","response","clearList","componentDidLoad","attributeObserver","AttributeObserver","host","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","inheritAriaAttributes","throttle","watchThrottleTime","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","h","Host","key","class","placeholder","name","readonly","autocomplete","invalid","success","role","maxlength","onKeyUpHandler","bind","onKeyDownHandler","onFocusHandler","onBlurHandler","join","booleanString","focused","ref","el","inputRef","toBoolAttr","hidden","id","empty","loading","map","index","isSelected","innerHTML","tabindex","onTouchStart","onSelectHandler","onMouseDown","govFocus","govBlur","has","govSelect","event","keyCode","preventDefault","setFocus","focus","setBlur","blur","clearValue","setProcessing","status","setSearchCallback","callback","setTemplateResolver"],"sources":["../../../packages/core/src/components/gov-form/autocomplete/autocomplete.utils.ts","../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"sourcesContent":["import { removeDiacritics } from '../../../utils/string.utils'\nimport { GovFormAutocompleteItem } from './gov-form-autocomplete.types'\n\nconst normalize = (value: unknown): string =>\n\ttypeof value === 'string' ? removeDiacritics(value).toLowerCase() : ''\n\nexport const filterAutocompleteOptions = (\n\toptions: GovFormAutocompleteItem[],\n\tquery: string,\n\tnameKey: string,\n\tmaxOptions: number,\n): GovFormAutocompleteItem[] => {\n\tconst source = Array.isArray(options) ? options : []\n\tconst normalizedQuery = normalize(query)\n\tconst matches =\n\t\tnormalizedQuery.length === 0\n\t\t\t? source\n\t\t\t: source.filter(item => {\n\t\t\t\t\tconst text = item?.[nameKey]\n\t\t\t\t\treturn typeof text === 'string' && normalize(text).includes(normalizedQuery)\n\t\t\t\t})\n\treturn Number.isInteger(maxOptions) && maxOptions > 0 ? matches.slice(0, maxOptions) : matches\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {booleanString, toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {FormAutocompleteClass, FormAutocompleteSizes, SizesType,} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport { filterAutocompleteOptions } from './autocomplete.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-autocomplete',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate fullOptions: GovFormAutocompleteItem[] = []\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\tprivate attributeObserver: AttributeObserver\n\tprivate debouncedSearch: (e: CustomEvent<FormInputEvent>) => void\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\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() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop({attribute: 'name-key'}) readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\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 * Makes the input 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 * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Maximum number of items shown from a static `options` list (0 = unlimited).\n\t * Applies only when no async search callback is set.\n\t */\n\t@Prop({attribute: 'max-options'}) readonly maxOptions: number = 10\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.fullOptions = propsValueToArray<GovFormAutocompleteItem[]>(newValue)\n\t\tif (this.searchCallback) {\n\t\t\tthis.setOptions(this.fullOptions).catch()\n\t\t} else {\n\t\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\t}\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (this.searchCallback) {\n\t\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\t\tthis.list = []\n\t\t\t\tthis.arrowCounter = -1\n\t\t\t\tthis.processing = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t\treturn\n\t\t}\n\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\tthis.arrowCounter = -1\n\t}\n\n\tprivate clearList() {\n\t\tif (this.fullOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t\tthis.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime)\n\t\tthis.fullOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (!this.searchCallback) {\n\t\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\t}\n\t}\n\n\t@Watch('throttleTime')\n\twatchThrottleTime() {\n\t\tthis.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime)\n\t}\n\n\tprivate emitAndSearch = (e: CustomEvent<FormInputEvent>) => {\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={this.onInputHandler}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-autocomplete={'list'}\n\t\t\t\t\taria-owns={[this.listBoxId, this.inheritedAttributes['aria-owns']].join(' ')}\n\t\t\t\t\taria-expanded={booleanString(this.list.length && this.focused ? true : false)}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"validation-icon\" />\n\t\t\t\t\t<slot name=\"icon-end\" />\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list}\n\t\t\t\t\trole={'listbox'}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.focused)}\n\t\t\t\t\thidden={!this.focused}\n\t\t\t\t\tid={this.listBoxId}\n\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && (this.isValueAccepted || (!this.searchCallback && this.fullOptions.length > 0)) && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-skeleton size=\"m\"></gov-skeleton>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused ? this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-left\"/>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-right\"/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}) : null}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.searchCallback) {\n\t\t\tif (this.isValueAccepted) {\n\t\t\t\tthis.doSearch()\n\t\t\t}\n\t\t} else {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.clearList();\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler = (e: CustomEvent<FormInputEvent>) => {\n\t\te.stopPropagation()\n\t\tthis.value = e.detail.value\n\t\tthis.debouncedSearch(e)\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.clearList();\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Focus main input element\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Blur main input element\n\t */\n\t@Method()\n\tasync setBlur(): Promise<void> {\n\t\treturn this.inputRef.blur()\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"],"mappings":"6cAGA,MAAMA,EAAaC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A,EAASrB,KAAKlB,WAAa,SAAU,CAC9EkB,KAAKxB,MAAQ6C,EAASrB,KAAKlB,Q,GAKtB,cAAAwG,CAAexE,GACtB,MAAMoG,EAASpG,EAAEW,OAA0BR,cAC3CH,EAAEU,kBACF0F,EAAM1F,kBACN,GAAI0F,EAAMC,UAAY,GAAInH,KAAKsC,iBAC1B,GAAI4E,EAAMC,UAAY,GAAInH,KAAKyC,mBAC/B,GAAIyE,EAAMC,UAAY,GAAI,CAC9BrG,EAAEsG,iBACFF,EAAME,iBACNpH,KAAK4G,gBAAgB9F,E,EAIf,gBAAA0E,CAAiB1E,GACxB,MAAMoG,EAASpG,EAAEW,OAA0BR,cAC3CH,EAAEU,kBACF0F,EAAM1F,kBACN,GAAI0F,EAAMC,UAAY,GAAI,CACzBrG,EAAEsG,iBACFF,EAAME,gB,EAQR,cAAMC,CAASzI,GACd,OAAOoB,KAAKgG,SAASsB,MAAM1I,E,CAO5B,aAAM2I,GACL,OAAOvH,KAAKgG,SAASwB,M,CAOtB,gBAAMpF,CAAWxD,GAChBoB,KAAKW,KAAO1B,MAAMC,QAAQN,GAAWA,EAAU,GAC/CoB,KAAKU,cAAe,C,CAOrB,gBAAM+G,GACLzH,KAAKxB,MAAQ,GACbwB,KAAKgG,SAASxH,MAAQ,SAEhBwB,KAAKgG,SAASyB,Y,CAOrB,mBAAMC,CAAcC,GACnB3H,KAAKS,WAAakH,C,CAOnB,uBAAMC,CAAkBC,GACvB7H,KAAKmC,eAAiB0F,C,CAQvB,yBAAMC,CAAoBD,GACzB7H,KAAKE,iBAAmB2H,C","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,c as r,h as g,H as a,g as p}from"./p-ClISz4NF.js";import{c as i,F as t,a as e,b as m}from"./p-BUmDydor.js";import{g as l}from"./p-CoD1xawt.js";import{v}from"./p-NOJjz9dT.js";import{t as f}from"./p-Cjg0wpDG.js";import{p as s}from"./p-Ccwpa1ck.js";import"./p-CQvUntGY.js";import"./p-BcQO4NH2.js";import"./p-CgDnDrq5.js";import"./p-DNztiAH0.js";const n="gov-form-group,.gov-form-group,gov-form-radio-group,.gov-form-radio-group,gov-form-checkbox-group,.gov-form-checkbox-group{margin-top:0;margin-bottom:0;position:relative;display:flex;width:100%;flex-direction:column;align-items:flex-start}gov-form-group .gov-form-label__label,.gov-form-group .gov-form-label__label,gov-form-radio-group .gov-form-label__label,.gov-form-radio-group .gov-form-label__label,gov-form-checkbox-group .gov-form-label__label,.gov-form-checkbox-group .gov-form-label__label{margin:0}gov-form-group[orientation=horizontal],.gov-form-group[orientation=horizontal],gov-form-radio-group[orientation=horizontal],.gov-form-radio-group[orientation=horizontal],gov-form-checkbox-group[orientation=horizontal],.gov-form-checkbox-group[orientation=horizontal]{flex-direction:row;flex-wrap:wrap}gov-form-group[orientation=horizontal] .gov-form-label__label,.gov-form-group[orientation=horizontal] .gov-form-label__label,gov-form-radio-group[orientation=horizontal] .gov-form-label__label,.gov-form-radio-group[orientation=horizontal] .gov-form-label__label,gov-form-checkbox-group[orientation=horizontal] .gov-form-label__label,.gov-form-checkbox-group[orientation=horizontal] .gov-form-label__label{white-space:nowrap}gov-form-group[gap=xs],.gov-form-group[gap=xs],gov-form-radio-group[gap=xs],.gov-form-radio-group[gap=xs],gov-form-checkbox-group[gap=xs],.gov-form-checkbox-group[gap=xs]{gap:var(--gap, var(--spacing-xs-nudge))}gov-form-group[gap=s],.gov-form-group[gap=s],gov-form-radio-group[gap=s],.gov-form-radio-group[gap=s],gov-form-checkbox-group[gap=s],.gov-form-checkbox-group[gap=s]{gap:var(--gap, var(--spacing-s))}gov-form-group[gap=m],.gov-form-group[gap=m],gov-form-radio-group[gap=m],.gov-form-radio-group[gap=m],gov-form-checkbox-group[gap=m],.gov-form-checkbox-group[gap=m]{gap:var(--gap, var(--spacing-m))}gov-form-group[gap=l],.gov-form-group[gap=l],gov-form-radio-group[gap=l],.gov-form-radio-group[gap=l],gov-form-checkbox-group[gap=l],.gov-form-checkbox-group[gap=l]{gap:var(--gap, var(--spacing-l))}gov-form-group[gap=xl],.gov-form-group[gap=xl],gov-form-radio-group[gap=xl],.gov-form-radio-group[gap=xl],gov-form-checkbox-group[gap=xl],.gov-form-checkbox-group[gap=xl]{gap:var(--gap, var(--spacing-xl))}";const c=class{constructor(g){o(this,g);this.govChange=r(this,"gov-change");this.gap=undefined;this.orientation="vertical";this.value=undefined;this.handleChange=o=>{var r;o.stopPropagation();const g=s(this.value);if(!Array.isArray(g))return;if(o.detail.checked){this.value=[...g,o.detail.value]}else{this.value=(r=g.filter((r=>r!==o.detail.value)))!==null&&r!==void 0?r:[]}this.govChange.emit({value:this.value,component:i.root})};this.h=l(this.host)}validateGap(o){if(o){v(e,o,t.root)}}validateOrientation(o){if(o){v(m,o,t.root)}}componentWillLoad(){this.validateGap(this.gap);this.validateOrientation(this.orientation);this.value=s(this.value)}componentDidRender(){f((()=>this.rerenderComponent()))}rerenderComponent(){this.host.querySelectorAll("gov-form-checkbox").forEach((o=>{if(!o.hasAttribute("listener-attached")){o.addEventListener("gov-change",this.handleChange)}o.setAttribute("listener-attached","true");o.checked=this.value.includes(o.value)}))}render(){return g(a,{key:"05922c255d84c7e5d454096842080afb3baf7e35",gap:this.gap,class:this.h.classes(t.root),value:this.value},g("slot",{key:"b770a32c6c932f71c041bb2996c675b84ee594f0"}))}get host(){return p(this)}static get watchers(){return{gap:["validateGap"],orientation:["validateOrientation"]}}};c.style=n;export{c as gov_form_checkbox_group};
|
|
2
|
+
//# sourceMappingURL=p-90ab65b4.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["govFormGroupCss","GovFormCheckboxGroup","constructor","hostRef","this","gap","undefined","orientation","value","handleChange","event","stopPropagation","propsValueToArray","Array","isArray","detail","checked","_a","filter","val","govChange","emit","component","FormCheckboxGroupClass","root","h","govHost","host","validateGap","newValue","validateProp","FormGroupSizes","FormGroupClass","validateOrientation","FormGroupOrientation","componentWillLoad","componentDidRender","tick","rerenderComponent","querySelectorAll","forEach","element","hasAttribute","addEventListener","setAttribute","includes","render","Host","key","class","classes"],"sources":["../../../packages/core/src/components/gov-form/group/gov-form-group.scss?tag=gov-form-checkbox-group","../../../packages/core/src/components/gov-form/group/gov-form-checkbox-group.tsx"],"sourcesContent":["/* Form Group */\n\n@use \"sass:map\";\n@use \"../../../sass/mixins\" as mixin;\n@use \"./gov-form-group-variables\" as variable;\n\n\ngov-form-group, .gov-form-group,\ngov-form-radio-group, .gov-form-radio-group,\ngov-form-checkbox-group, .gov-form-checkbox-group {\n\t@include mixin.reset-margin();\n\t@include mixin.base(flex);\n\tflex-direction: column;\n\talign-items: flex-start;\n\t.gov-form-label__label {\n\t\tmargin: 0;\n\t}\n\n\t&[orientation=\"horizontal\"] {\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\t.gov-form-label__label {\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t// SIZES\n\t@each $size, $definitions in variable.$gaps {\n\t\t&[gap=\"#{$size}\"] {\n\t\t\tgap: map.get($definitions, \"gap\");\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, Watch} from \"@stencil/core\"\nimport {\n\tFormCheckboxGroupClass,\n\tFormGroupClass,\n\tFormGroupOrientation,\n\tFormGroupOrientationType,\n\tFormGroupSizes,\n\tFormGroupSizesType\n} from \"./constants\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govHost} from \"../../../helpers/Dom/template\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormCheckboxEvent} from \"../checkbox/gov-form-checkbox.types\"\nimport {FormCheckboxGroupEvent} from \"./gov-form-group.types\"\nimport {tick} from \"../../../utils/stencil.utils\"\nimport {propsValueToArray} from \"../../../utils/array.utils\"\n\n@Component({\n\ttag: \"gov-form-checkbox-group\",\n\tstyleUrl: \"gov-form-group.scss\",\n})\nexport class GovFormCheckboxGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovFormGroupElement\n\t/**\n\t * Gap's size.\n\t */\n\t@Prop() readonly gap?: FormGroupSizesType = undefined\n\t/**\n\t * Elements orientation\n\t */\n\t@Prop() readonly orientation?: FormGroupOrientationType = 'vertical'\n\t/**\n\t * Group's value\n\t */\n\t@Prop({attribute: \"value\", mutable: true}) value?: string | string[] = undefined\n\t/**\n /* Emitted when the checkbox change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormCheckboxGroupEvent>\n\n\t@Watch(\"gap\")\n\tvalidateGap(newValue: string): void {\n\t\tif (newValue) {\n\t\t\tvalidateProp(FormGroupSizes, newValue, FormGroupClass.root)\n\t\t}\n\t}\n\n\t@Watch(\"orientation\")\n\tvalidateOrientation(newValue: string): void {\n\t\tif (newValue) {\n\t\t\tvalidateProp(FormGroupOrientation, newValue, FormGroupClass.root)\n\t\t}\n\t}\n\n\thandleChange = (event: CustomEvent<FormCheckboxEvent>) => {\n\t\tevent.stopPropagation()\n\t\tconst value = propsValueToArray<string[]>(this.value);\n\t\tif (!Array.isArray(value)) return;\n\t\tif (event.detail.checked) {\n\t\t\tthis.value = [...value, event.detail.value]\n\t\t} else {\n\t\t\tthis.value = value.filter((val) => val !== event.detail.value) ?? []\n\t\t}\n\t\tthis.govChange.emit({\n\t\t\tvalue: this.value,\n\t\t\tcomponent: FormCheckboxGroupClass.root,\n\t\t})\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateGap(this.gap)\n\t\tthis.validateOrientation(this.orientation)\n\t\tthis.value = propsValueToArray(this.value)\n\t}\n\n\tcomponentDidRender(): void {\n\t\ttick(() => this.rerenderComponent())\n\t}\n\n\trerenderComponent(): void {\n\t\tthis.host.querySelectorAll('gov-form-checkbox').forEach((element) => {\n\t\t\tif (!element.hasAttribute('listener-attached')) {\n\t\t\t\telement.addEventListener('gov-change', this.handleChange)\n\t\t\t}\n\t\t\telement.setAttribute('listener-attached', 'true')\n\t\t\telement.checked = this.value.includes(element.value);\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host gap={this.gap} class={this.h.classes(FormGroupClass.root)} value={this.value}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"oWAAA,MAAMA,EAAkB,
|
|
1
|
+
{"version":3,"names":["govFormGroupCss","GovFormCheckboxGroup","constructor","hostRef","this","gap","undefined","orientation","value","handleChange","event","stopPropagation","propsValueToArray","Array","isArray","detail","checked","_a","filter","val","govChange","emit","component","FormCheckboxGroupClass","root","h","govHost","host","validateGap","newValue","validateProp","FormGroupSizes","FormGroupClass","validateOrientation","FormGroupOrientation","componentWillLoad","componentDidRender","tick","rerenderComponent","querySelectorAll","forEach","element","hasAttribute","addEventListener","setAttribute","includes","render","Host","key","class","classes"],"sources":["../../../packages/core/src/components/gov-form/group/gov-form-group.scss?tag=gov-form-checkbox-group","../../../packages/core/src/components/gov-form/group/gov-form-checkbox-group.tsx"],"sourcesContent":["/* Form Group */\n\n@use \"sass:map\";\n@use \"../../../sass/mixins\" as mixin;\n@use \"./gov-form-group-variables\" as variable;\n\n\ngov-form-group, .gov-form-group,\ngov-form-radio-group, .gov-form-radio-group,\ngov-form-checkbox-group, .gov-form-checkbox-group {\n\t@include mixin.reset-margin();\n\t@include mixin.base(flex);\n\tflex-direction: column;\n\talign-items: flex-start;\n\t.gov-form-label__label {\n\t\tmargin: 0;\n\t}\n\n\t&[orientation=\"horizontal\"] {\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\t.gov-form-label__label {\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t// SIZES\n\t@each $size, $definitions in variable.$gaps {\n\t\t&[gap=\"#{$size}\"] {\n\t\t\tgap: map.get($definitions, \"gap\");\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, Watch} from \"@stencil/core\"\nimport {\n\tFormCheckboxGroupClass,\n\tFormGroupClass,\n\tFormGroupOrientation,\n\tFormGroupOrientationType,\n\tFormGroupSizes,\n\tFormGroupSizesType\n} from \"./constants\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govHost} from \"../../../helpers/Dom/template\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormCheckboxEvent} from \"../checkbox/gov-form-checkbox.types\"\nimport {FormCheckboxGroupEvent} from \"./gov-form-group.types\"\nimport {tick} from \"../../../utils/stencil.utils\"\nimport {propsValueToArray} from \"../../../utils/array.utils\"\n\n@Component({\n\ttag: \"gov-form-checkbox-group\",\n\tstyleUrl: \"gov-form-group.scss\",\n})\nexport class GovFormCheckboxGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovFormGroupElement\n\t/**\n\t * Gap's size.\n\t */\n\t@Prop() readonly gap?: FormGroupSizesType = undefined\n\t/**\n\t * Elements orientation\n\t */\n\t@Prop() readonly orientation?: FormGroupOrientationType = 'vertical'\n\t/**\n\t * Group's value\n\t */\n\t@Prop({attribute: \"value\", mutable: true}) value?: string | string[] = undefined\n\t/**\n /* Emitted when the checkbox change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormCheckboxGroupEvent>\n\n\t@Watch(\"gap\")\n\tvalidateGap(newValue: string): void {\n\t\tif (newValue) {\n\t\t\tvalidateProp(FormGroupSizes, newValue, FormGroupClass.root)\n\t\t}\n\t}\n\n\t@Watch(\"orientation\")\n\tvalidateOrientation(newValue: string): void {\n\t\tif (newValue) {\n\t\t\tvalidateProp(FormGroupOrientation, newValue, FormGroupClass.root)\n\t\t}\n\t}\n\n\thandleChange = (event: CustomEvent<FormCheckboxEvent>) => {\n\t\tevent.stopPropagation()\n\t\tconst value = propsValueToArray<string[]>(this.value);\n\t\tif (!Array.isArray(value)) return;\n\t\tif (event.detail.checked) {\n\t\t\tthis.value = [...value, event.detail.value]\n\t\t} else {\n\t\t\tthis.value = value.filter((val) => val !== event.detail.value) ?? []\n\t\t}\n\t\tthis.govChange.emit({\n\t\t\tvalue: this.value,\n\t\t\tcomponent: FormCheckboxGroupClass.root,\n\t\t})\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateGap(this.gap)\n\t\tthis.validateOrientation(this.orientation)\n\t\tthis.value = propsValueToArray(this.value)\n\t}\n\n\tcomponentDidRender(): void {\n\t\ttick(() => this.rerenderComponent())\n\t}\n\n\trerenderComponent(): void {\n\t\tthis.host.querySelectorAll('gov-form-checkbox').forEach((element) => {\n\t\t\tif (!element.hasAttribute('listener-attached')) {\n\t\t\t\telement.addEventListener('gov-change', this.handleChange)\n\t\t\t}\n\t\t\telement.setAttribute('listener-attached', 'true')\n\t\t\telement.checked = this.value.includes(element.value);\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host gap={this.gap} class={this.h.classes(FormGroupClass.root)} value={this.value}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"oWAAA,MAAMA,EAAkB,usE,MCqBXC,EAAoB,MAGhC,WAAAC,CAAAC,G,8CAQiBC,KAAGC,IAAwBC,UAI3BF,KAAWG,YAA8B,WAIfH,KAAKI,MAAuBF,UAoBvEF,KAAAK,aAAgBC,I,MACfA,EAAMC,kBACN,MAAMH,EAAQI,EAA4BR,KAAKI,OAC/C,IAAKK,MAAMC,QAAQN,GAAQ,OAC3B,GAAIE,EAAMK,OAAOC,QAAS,CACzBZ,KAAKI,MAAQ,IAAIA,EAAOE,EAAMK,OAAOP,M,KAC/B,CACNJ,KAAKI,OAAQS,EAAAT,EAAMU,QAAQC,GAAQA,IAAQT,EAAMK,OAAOP,WAAU,MAAAS,SAAA,EAAAA,EAAA,E,CAEnEb,KAAKgB,UAAUC,KAAK,CACnBb,MAAOJ,KAAKI,MACZc,UAAWC,EAAuBC,MACjC,EA/CFpB,KAAKqB,EAAIC,EAAQtB,KAAKuB,KACtB,CAqBD,WAAAC,CAAYC,GACX,GAAIA,EAAU,CACbC,EAAaC,EAAgBF,EAAUG,EAAeR,K,EAKxD,mBAAAS,CAAoBJ,GACnB,GAAIA,EAAU,CACbC,EAAaI,EAAsBL,EAAUG,EAAeR,K,EAmB9D,iBAAAW,GACC/B,KAAKwB,YAAYxB,KAAKC,KACtBD,KAAK6B,oBAAoB7B,KAAKG,aAC9BH,KAAKI,MAAQI,EAAkBR,KAAKI,M,CAGrC,kBAAA4B,GACCC,GAAK,IAAMjC,KAAKkC,qB,CAGjB,iBAAAA,GACClC,KAAKuB,KAAKY,iBAAiB,qBAAqBC,SAASC,IACxD,IAAKA,EAAQC,aAAa,qBAAsB,CAC/CD,EAAQE,iBAAiB,aAAcvC,KAAKK,a,CAE7CgC,EAAQG,aAAa,oBAAqB,QAC1CH,EAAQzB,QAAUZ,KAAKI,MAAMqC,SAASJ,EAAQjC,MAAM,G,CAItD,MAAAsC,GACC,OACCrB,EAACsB,EAAK,CAAAC,IAAA,2CAAA3C,IAAKD,KAAKC,IAAK4C,MAAO7C,KAAKqB,EAAEyB,QAAQlB,EAAeR,MAAOhB,MAAOJ,KAAKI,OAC5EiB,EAAa,QAAAuB,IAAA,6C","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as h}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,H as e,g as h}from"./p-ClISz4NF.js";import{p as a}from"./p-CQvUntGY.js";import{S as o}from"./p-BcQO4NH2.js";import{g as n,a as r,t as c}from"./p-CoD1xawt.js";import{v as l}from"./p-NOJjz9dT.js";import{A as p,a as u}from"./p-Bz_RzYFb.js";import{g as d}from"./p-B6CqPcY_.js";import{t as f}from"./p-Cjg0wpDG.js";import{a as m}from"./p-DNztiAH0.js";import{c as v}from"./p-vN03FcXN.js";import{i as b}from"./p-CzXeijOj.js";import"./p-CgDnDrq5.js";import"./p-EeKNA85D.js";import"./p-U40vKHrs.js";import"./p-DYcNEwSZ.js";import"./p-DBXGhafv.js";const g=a(o,["_S","_M","_L"]);const j={root:"gov-form-range",fill:"gov-form-range--fill",input:"gov-form-range--input"};const C=class{constructor(i){t(this,i);this.govFocus=s(this,"gov-focus");this.govBlur=s(this,"gov-blur");this.govInput=s(this,"gov-input");this.size="m";this.tooltip=false;this.input=false;this.required=false;this.disabled=false;this.inheritedAttributes={};this.h=n(this.host);this.f=d(this.h);this.inputId=v("GovInput")}validateSize(t){l(g,t,j.root)}watchValue(){this.controlOutputPosition()}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("success",r(this.success));this.f.passAttrToControl("disabled",r(this.disabled));this.f.passAttrToControl("invalid",r(this.invalid))}get getThumbWidth(){const t=window.getComputedStyle(this.inputRef);return parseFloat(t.getPropertyValue("--thumb-size"))||1}controlOutputPosition(){const t=+this.value;const s=+this.inputRef.min;const i=+this.inputRef.max;const e=this.getThumbWidth*16;const h=this.inputRef.offsetWidth;const a=(t-s)/(i-s)*100;let o=a/100*(h-e)+e/2;if(this.outputRef){this.outputRef.textContent=this.value;const t=this.outputRef.offsetWidth/2;this.outputRef.style.left=`${o-t}px`}if(this.fillRef){this.fillRef.style.width=`${o}px`}}componentDidLoad(){this.attributeObserver=new p(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(u)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=b(this.host)}componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));f(this.controlOutputPosition.bind(this))}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}render(){return i(e,{key:"28444cac3f85772d0efb301cb43219c184f8f2fe",class:j.root,size:this.size},this.h.hasSlot("prefix")&&i("slot",{key:"3ec11551a934f90dd8ee821b11e626a07b865ed0",name:"prefix"}),i("span",{key:"63ac5b2b977124208fe55f237d378cbb7d20e72f",class:"element"},i("input",Object.assign({key:"802a3145c61e9074733e80ae5a66094ae0b9657d",type:"range",ref:t=>this.inputRef=t,onInput:this.onInputHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),id:this.identifier||this.inputId,name:this.name,min:this.min,max:this.max,step:this.step,list:this.listIdentifier,value:this.value,required:this.required,disabled:this.disabled},this.inheritedAttributes,{"aria-required":c(this.required),"aria-invalid":c(this.invalid),"aria-disabled":c(this.disabled)})),i("div",{key:"3aa0f6ab956c1d3f58d256b137dc4bde129d2eba",class:j.fill,ref:t=>this.fillRef=t}),this.tooltip?i("output",{htmlFor:this.name,ref:t=>this.outputRef=t},this.value):null,i("slot",{key:"b71ca566187911623048a030870330d0b42ae1fd",name:"datalist"})),this.h.hasSlot("sufix")&&i("slot",{key:"18e53573e7b90cba853deead846b30325727e3d1",name:"sufix"}),this.input?i("gov-form-input",Object.assign({"on-gov-input":this.onCustomInputHandler.bind(this),class:j.input,size:this.size,value:this.value,disabled:this.disabled},this.inheritedAttributes)):null)}onCustomInputHandler(t){const s=t.target.value;if(this.step&&m(+this.step)){const i=+s;const e=+this.min;const h=+this.max;const a=+this.step;if(isNaN(i)){return false}if(i<e||i>h){return false}const o=i-e;if(o%a!==0){return false}this.value=s;this.govInput.emit({component:j.root,value:this.value,originalEvent:t})}}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({component:j.root,value:this.value,originalEvent:t})}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:j.root,value:this.value,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:j.root,value:this.value,originalEvent:t})}async setFocus(t){return this.inputRef.focus(t)}async setValue(t){this.value=t}async clearValue(){this.value="";this.inputRef.value=""}async getRef(){return this.inputRef}get host(){return h(this)}static get watchers(){return{size:["validateSize","watchControlAttrs"],value:["watchValue"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}}};export{C as gov_form_range};
|
|
2
|
+
//# sourceMappingURL=p-91cbee1b.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FormRangeSizes","pick","Sizes","FormRangeClass","root","fill","input","GovFormRange","constructor","hostRef","this","size","tooltip","required","disabled","inheritedAttributes","h","govHost","host","f","govForm","inputId","createID","validateSize","newValue","validateProp","watchValue","controlOutputPosition","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","success","invalid","getThumbWidth","styles","window","getComputedStyle","inputRef","parseFloat","getPropertyValue","valueInt","value","min","max","thumbWidth","rangeWidth","offsetWidth","percentage","tooltipOffset","outputRef","textContent","outputWidth","style","left","fillRef","width","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","inheritAriaAttributes","componentDidRender","passAttrToLabel","String","tick","bind","removeAttribute","Object","assign","disconnectedCallback","_a","stopObserving","render","Host","key","class","hasSlot","name","type","ref","el","onInput","onInputHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","id","identifier","step","list","listIdentifier","toBoolAttrIfDefined","htmlFor","onCustomInputHandler","e","target","isNumber","numValue","numMin","numMax","numStep","isNaN","diff","govInput","emit","component","originalEvent","stopPropagation","govFocus","govBlur","setFocus","options","focus","setValue","clearValue","getRef"],"sources":["../../../packages/core/src/components/gov-form/range/constants.ts","../../../packages/core/src/components/gov-form/range/gov-form-range.tsx"],"sourcesContent":["import {pick} from \"../../../utils/utils\";\nimport {Sizes} from \"../../../core/constants/sizes\";\nimport {ValueOf} from \"../../../types/interfaces\";\n\nexport const FormRangeSizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type FormRangeSizesType = `${ValueOf<typeof FormRangeSizes>}`\n\nexport const FormRangeClass = {\n\troot: 'gov-form-range',\n\tfill: 'gov-form-range--fill',\n\tinput: 'gov-form-range--input',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {FormRangeClass, FormRangeSizes, FormRangeSizesType} from './constants'\nimport {GovHost} from \"../../../helpers/Dom/template.types\";\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\";\nimport {validateProp} from \"../../../helpers/Validate/props\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {GovForm} from \"../../../helpers/Dom/form.types\";\nimport {govForm} from \"../../../helpers/Dom/form\";\nimport {tick} from \"../../../utils/stencil.utils\";\nimport {isNumber} from \"../../../utils/helpers.types\";\nimport {createID} from \"../../../utils/string.utils\";\nimport {FormInputEvent} from \"../input/gov-form-input.types\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n\n@Component({\n\ttag: 'gov-form-range',\n})\nexport class GovFormRange {\n\tprivate inputRef?: HTMLInputElement\n\tprivate outputRef?: HTMLOutputElement\n\tprivate fillRef?: HTMLDivElement\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate readonly inputId: string\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.inputId = createID(\"GovInput\")\n\t}\n\n\t@Element() host: HTMLGovFormRangeElement\n\t/**\n\t * Range’s size\n\t */\n\t@Prop() readonly size?: FormRangeSizesType = \"m\"\n\t/**\n\t * Value of range\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Custom range identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Name of the range\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Minimum value that is acceptable\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable\n\t */\n\t@Prop() readonly max?: string | number\n\t/**\n\t * Defines size of each step\n\t */\n\t@Prop() readonly step?: string | number\n\t/**\n\t * Show tooltip with current value\n\t */\n\t@Prop() readonly tooltip?: boolean = false\n\t/**\n\t * Show input with current value\n\t */\n\t@Prop() readonly input?: boolean = false\n\t/**\n\t * Links a <datalist/> element to a <input type=\"range\">, providing value markers as guidance for the user\n\t */\n\t@Prop() readonly listIdentifier?: string\n\t/**\n\t * Set whether the range is required or not\n\t */\n\t@Prop({reflect: true}) 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 * Indicates the entered value does not conform to the format expected by the application\n\t */\n\t@Prop({reflect: true}) readonly invalid: boolean\n\t/**\n\t * Makes the range component disabled\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: \"gov-input\"}) govInput: EventEmitter<FormInputEvent>\n\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRangeSizes, newValue, FormRangeClass.root)\n\t}\n\n\t@Watch(\"value\")\n\twatchValue(): void {\n\t\tthis.controlOutputPosition();\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@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"success\", toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t}\n\n\tprivate get getThumbWidth() {\n\t\tconst styles = window.getComputedStyle(this.inputRef);\n\t\treturn parseFloat(styles.getPropertyValue('--thumb-size')) || 1;\n\t}\n\n\tprivate controlOutputPosition() {\n\t\tconst valueInt = +this.value;\n\t\tconst min = +this.inputRef.min;\n\t\tconst max = +this.inputRef.max;\n\n\t\tconst thumbWidth = (this.getThumbWidth * 16);\n\t\tconst rangeWidth = this.inputRef.offsetWidth;\n\t\tconst percentage = ((valueInt - min) / (max - min)) * 100;\n\n\t\tlet tooltipOffset = ((percentage / 100) * (rangeWidth - thumbWidth)) + (thumbWidth / 2);\n\n\t\tif (this.outputRef) {\n\t\t\tthis.outputRef.textContent = this.value;\n\t\t\tconst outputWidth = this.outputRef.offsetWidth / 2;\n\t\t\tthis.outputRef.style.left = `${tooltipOffset - outputWidth}px`;\n\t\t}\n\t\tif (this.fillRef) {\n\t\t\tthis.fillRef.style.width = `${tooltipOffset}px`\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tcomponentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\ttick(this.controlOutputPosition.bind(this))\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\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormRangeClass.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<input type=\"range\"\n\t\t\t\t\t\t ref={el => (this.inputRef = el)}\n\t\t\t\t\t\t onInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\t onFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t onBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t id={this.identifier || this.inputId}\n\t\t\t\t\t\t name={this.name}\n\t\t\t\t\t\t min={this.min}\n\t\t\t\t\t\t max={this.max}\n\t\t\t\t\t\t step={this.step}\n\t\t\t\t\t\t list={this.listIdentifier}\n\t\t\t\t\t\t value={this.value}\n\t\t\t\t\t\t required={this.required}\n\t\t\t\t\t\t disabled={this.disabled}\n\t\t\t\t\t\t {...this.inheritedAttributes}\n\t\t\t\t\t\t aria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t aria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t aria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div class={FormRangeClass.fill} ref={el => (this.fillRef = el)}></div>\n\t\t\t\t\t{this.tooltip ?\n\t\t\t\t\t\t<output htmlFor={this.name} ref={el => (this.outputRef = el)}>\n\t\t\t\t\t\t\t{this.value}\n\t\t\t\t\t\t</output>\n\t\t\t\t\t\t: null}\n\t\t\t\t\t<slot name=\"datalist\"></slot>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot(\"sufix\") && <slot name=\"sufix\"></slot>}\n\t\t\t\t{this.input ?\n\t\t\t\t\t<gov-form-input\n\t\t\t\t\t\ton-gov-input={this.onCustomInputHandler.bind(this)}\n\t\t\t\t\t\tclass={FormRangeClass.input}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}>\n\t\t\t\t\t</gov-form-input>\n\t\t\t\t\t: null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tonCustomInputHandler(e: InputEvent) {\n\t\tconst value = (e.target as HTMLInputElement).value;\n\t\tif (this.step && isNumber(+this.step)) {\n\t\t\tconst numValue = +value;\n\t\t\tconst numMin = +this.min;\n\t\t\tconst numMax = +this.max;\n\t\t\tconst numStep = +this.step;\n\n\t\t\tif (isNaN(numValue)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (numValue < numMin || numValue > numMax) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst diff = numValue - numMin;\n\t\t\tif (diff % numStep !== 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t\tthis.govInput.emit({\n\t\t\t\tcomponent: FormRangeClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value;\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\tcomponent: FormRangeClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormRangeClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormRangeClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\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.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = \"\"\n\t\tthis.inputRef.value = \"\"\n\t}\n\n\t/**\n\t * Returns an instance of the native html input element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n}\n"],"mappings":"qjBAIO,MAAMA,EAAiBC,EAAKC,EAAO,CAAC,KAAM,KAAM,OAGhD,MAAMC,EAAiB,CAC7BC,KAAM,iBACNC,KAAM,uBACNC,MAAO,yB,MCSKC,EAAY,MASxB,WAAAC,CAAAC,G,8GAUiBC,KAAAC,KAA4B,IA4B5BD,KAAAE,QAAoB,MAIpBF,KAAAJ,MAAkB,MAQHI,KAAAG,SAAoB,MAYpBH,KAAAI,SAAoB,MAiC3CJ,KAAAK,oBAAkC,GA9F1CL,KAAKM,EAAIC,EAAQP,KAAKQ,MACtBR,KAAKS,EAAIC,EAAQV,KAAKM,GACtBN,KAAKW,QAAUC,EAAS,WACxB,CA0ED,YAAAC,CAAaC,GACZC,EAAazB,EAAgBwB,EAAUrB,EAAeC,K,CAIvD,UAAAsB,GACChB,KAAKiB,uB,CAON,iBAAAC,GACClB,KAAKmB,kB,CAKE,gBAAAA,GACPnB,KAAKS,EAAEW,kBAAkB,OAAQpB,KAAKC,MACtCD,KAAKS,EAAEW,kBAAkB,UAAWC,EAAWrB,KAAKsB,UACpDtB,KAAKS,EAAEW,kBAAkB,WAAYC,EAAWrB,KAAKI,WACrDJ,KAAKS,EAAEW,kBAAkB,UAAWC,EAAWrB,KAAKuB,S,CAGrD,iBAAYC,GACX,MAAMC,EAASC,OAAOC,iBAAiB3B,KAAK4B,UAC5C,OAAOC,WAAWJ,EAAOK,iBAAiB,kBAAoB,C,CAGvD,qBAAAb,GACP,MAAMc,GAAY/B,KAAKgC,MACvB,MAAMC,GAAOjC,KAAK4B,SAASK,IAC3B,MAAMC,GAAOlC,KA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7C,GAAIhC,KAAKoF,MAAQQ,GAAU5F,KAAKoF,MAAO,CACtC,MAAMS,GAAY7D,EAClB,MAAM8D,GAAU9F,KAAKiC,IACrB,MAAM8D,GAAU/F,KAAKkC,IACrB,MAAM8D,GAAWhG,KAAKoF,KAEtB,GAAIa,MAAMJ,GAAW,CACpB,OAAO,K,CAGR,GAAIA,EAAWC,GAAUD,EAAWE,EAAQ,CAC3C,OAAO,K,CAER,MAAMG,EAAOL,EAAWC,EACxB,GAAII,EAAOF,IAAY,EAAG,CACzB,OAAO,K,CAGRhG,KAAKgC,MAAQA,EACbhC,KAAKmG,SAASC,KAAK,CAClBC,UAAW5G,EAAeC,KAC1BsC,MAAOhC,KAAKgC,MACZsE,cAAeZ,G,EAKV,cAAAb,CAAea,GACtB1F,KAAKgC,MAAS0D,EAAEC,OAA4B3D,MAC5C0D,EAAEa,kBACFvG,KAAKmG,SAASC,KAAK,CAClBC,UAAW5G,EAAeC,KAC1BsC,MAAOhC,KAAKgC,MACZsE,cAAeZ,G,CAIT,cAAAX,CAAeW,GACtBA,EAAEa,kBACFvG,KAAKwG,SAASJ,KAAK,CAClBC,UAAW5G,EAAeC,KAC1BsC,MAAOhC,KAAKgC,MACZsE,cAAeZ,G,CAIT,aAAAT,CAAcS,GACrBA,EAAEa,kBACFvG,KAAKyG,QAAQL,KAAK,CACjBC,UAAW5G,EAAeC,KAC1BsC,MAAOhC,KAAKgC,MACZsE,cAAeZ,G,CAQjB,cAAMgB,CAASC,GACd,OAAO3G,KAAK4B,SAASgF,MAAMD,E,CAO5B,cAAME,CAAS7E,GACdhC,KAAKgC,MAAQA,C,CAOd,gBAAM8E,GACL9G,KAAKgC,MAAQ,GACbhC,KAAK4B,SAASI,MAAQ,E,CAOvB,YAAM+E,GACL,OAAO/G,KAAK4B,Q","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["FormRangeSizes","pick","Sizes","FormRangeClass","root","fill","input","GovFormRange","constructor","hostRef","this","size","tooltip","required","disabled","inheritedAttributes","h","govHost","host","f","govForm","inputId","createID","validateSize","newValue","validateProp","watchValue","controlOutputPosition","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","success","invalid","getThumbWidth","styles","window","getComputedStyle","inputRef","parseFloat","getPropertyValue","valueInt","value","min","max","thumbWidth","rangeWidth","offsetWidth","percentage","tooltipOffset","outputRef","textContent","outputWidth","style","left","fillRef","width","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","inheritAriaAttributes","componentDidRender","passAttrToLabel","String","tick","bind","removeAttribute","Object","assign","disconnectedCallback","_a","stopObserving","render","Host","key","class","hasSlot","name","type","ref","el","onInput","onInputHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","id","identifier","step","list","listIdentifier","toBoolAttrIfDefined","htmlFor","onCustomInputHandler","e","target","isNumber","numValue","numMin","numMax","numStep","isNaN","diff","govInput","emit","component","originalEvent","stopPropagation","govFocus","govBlur","setFocus","options","focus","setValue","clearValue","getRef"],"sources":["../../../packages/core/src/components/gov-form/range/constants.ts","../../../packages/core/src/components/gov-form/range/gov-form-range.tsx"],"sourcesContent":["import {pick} from \"../../../utils/utils\";\nimport {Sizes} from \"../../../core/constants/sizes\";\nimport {ValueOf} from \"../../../types/interfaces\";\n\nexport const FormRangeSizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type FormRangeSizesType = `${ValueOf<typeof FormRangeSizes>}`\n\nexport const FormRangeClass = {\n\troot: 'gov-form-range',\n\tfill: 'gov-form-range--fill',\n\tinput: 'gov-form-range--input',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {FormRangeClass, FormRangeSizes, FormRangeSizesType} from './constants'\nimport {GovHost} from \"../../../helpers/Dom/template.types\";\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\";\nimport {validateProp} from \"../../../helpers/Validate/props\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {GovForm} from \"../../../helpers/Dom/form.types\";\nimport {govForm} from \"../../../helpers/Dom/form\";\nimport {tick} from \"../../../utils/stencil.utils\";\nimport {isNumber} from \"../../../utils/helpers.types\";\nimport {createID} from \"../../../utils/string.utils\";\nimport {FormInputEvent} from \"../input/gov-form-input.types\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n\n@Component({\n\ttag: 'gov-form-range',\n})\nexport class GovFormRange {\n\tprivate inputRef?: HTMLInputElement\n\tprivate outputRef?: HTMLOutputElement\n\tprivate fillRef?: HTMLDivElement\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate readonly inputId: string\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.inputId = createID(\"GovInput\")\n\t}\n\n\t@Element() host: HTMLGovFormRangeElement\n\t/**\n\t * Range’s size\n\t */\n\t@Prop() readonly size?: FormRangeSizesType = \"m\"\n\t/**\n\t * Value of range\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Custom range identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Name of the range\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Minimum value that is acceptable\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable\n\t */\n\t@Prop() readonly max?: string | number\n\t/**\n\t * Defines size of each step\n\t */\n\t@Prop() readonly step?: string | number\n\t/**\n\t * Show tooltip with current value\n\t */\n\t@Prop() readonly tooltip?: boolean = false\n\t/**\n\t * Show input with current value\n\t */\n\t@Prop() readonly input?: boolean = false\n\t/**\n\t * Links a <datalist/> element to a <input type=\"range\">, providing value markers as guidance for the user\n\t */\n\t@Prop() readonly listIdentifier?: string\n\t/**\n\t * Set whether the range is required or not\n\t */\n\t@Prop({reflect: true}) 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 * Indicates the entered value does not conform to the format expected by the application\n\t */\n\t@Prop({reflect: true}) readonly invalid: boolean\n\t/**\n\t * Makes the range component disabled\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: \"gov-input\"}) govInput: EventEmitter<FormInputEvent>\n\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRangeSizes, newValue, FormRangeClass.root)\n\t}\n\n\t@Watch(\"value\")\n\twatchValue(): void {\n\t\tthis.controlOutputPosition();\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@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"success\", toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t}\n\n\tprivate get getThumbWidth() {\n\t\tconst styles = window.getComputedStyle(this.inputRef);\n\t\treturn parseFloat(styles.getPropertyValue('--thumb-size')) || 1;\n\t}\n\n\tprivate controlOutputPosition() {\n\t\tconst valueInt = +this.value;\n\t\tconst min = +this.inputRef.min;\n\t\tconst max = +this.inputRef.max;\n\n\t\tconst thumbWidth = (this.getThumbWidth * 16);\n\t\tconst rangeWidth = this.inputRef.offsetWidth;\n\t\tconst percentage = ((valueInt - min) / (max - min)) * 100;\n\n\t\tlet tooltipOffset = ((percentage / 100) * (rangeWidth - thumbWidth)) + (thumbWidth / 2);\n\n\t\tif (this.outputRef) {\n\t\t\tthis.outputRef.textContent = this.value;\n\t\t\tconst outputWidth = this.outputRef.offsetWidth / 2;\n\t\t\tthis.outputRef.style.left = `${tooltipOffset - outputWidth}px`;\n\t\t}\n\t\tif (this.fillRef) {\n\t\t\tthis.fillRef.style.width = `${tooltipOffset}px`\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tcomponentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\ttick(this.controlOutputPosition.bind(this))\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\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormRangeClass.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<input type=\"range\"\n\t\t\t\t\t\t ref={el => (this.inputRef = el)}\n\t\t\t\t\t\t onInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\t onFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t onBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t id={this.identifier || this.inputId}\n\t\t\t\t\t\t name={this.name}\n\t\t\t\t\t\t min={this.min}\n\t\t\t\t\t\t max={this.max}\n\t\t\t\t\t\t step={this.step}\n\t\t\t\t\t\t list={this.listIdentifier}\n\t\t\t\t\t\t value={this.value}\n\t\t\t\t\t\t required={this.required}\n\t\t\t\t\t\t disabled={this.disabled}\n\t\t\t\t\t\t {...this.inheritedAttributes}\n\t\t\t\t\t\t aria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t aria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t aria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div class={FormRangeClass.fill} ref={el => (this.fillRef = el)}></div>\n\t\t\t\t\t{this.tooltip ?\n\t\t\t\t\t\t<output htmlFor={this.name} ref={el => (this.outputRef = el)}>\n\t\t\t\t\t\t\t{this.value}\n\t\t\t\t\t\t</output>\n\t\t\t\t\t\t: null}\n\t\t\t\t\t<slot name=\"datalist\"></slot>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot(\"sufix\") && <slot name=\"sufix\"></slot>}\n\t\t\t\t{this.input ?\n\t\t\t\t\t<gov-form-input\n\t\t\t\t\t\ton-gov-input={this.onCustomInputHandler.bind(this)}\n\t\t\t\t\t\tclass={FormRangeClass.input}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}>\n\t\t\t\t\t</gov-form-input>\n\t\t\t\t\t: null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tonCustomInputHandler(e: InputEvent) {\n\t\tconst value = (e.target as HTMLInputElement).value;\n\t\tif (this.step && isNumber(+this.step)) {\n\t\t\tconst numValue = +value;\n\t\t\tconst numMin = +this.min;\n\t\t\tconst numMax = +this.max;\n\t\t\tconst numStep = +this.step;\n\n\t\t\tif (isNaN(numValue)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (numValue < numMin || numValue > numMax) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst diff = numValue - numMin;\n\t\t\tif (diff % numStep !== 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t\tthis.govInput.emit({\n\t\t\t\tcomponent: FormRangeClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value;\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\tcomponent: FormRangeClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormRangeClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormRangeClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\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.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = \"\"\n\t\tthis.inputRef.value = \"\"\n\t}\n\n\t/**\n\t * Returns an instance of the native html input element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n}\n"],"mappings":"qjBAIO,MAAMA,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,MAAMG,EAAOL,EAAWC,EACxB,GAAII,EAAOF,IAAY,EAAG,CACzB,OAAO,K,CAGRhG,KAAKgC,MAAQA,EACbhC,KAAKmG,SAASC,KAAK,CAClBC,UAAW5G,EAAeC,KAC1BsC,MAAOhC,KAAKgC,MACZsE,cAAeZ,G,EAKV,cAAAb,CAAea,GACtB1F,KAAKgC,MAAS0D,EAAEC,OAA4B3D,MAC5C0D,EAAEa,kBACFvG,KAAKmG,SAASC,KAAK,CAClBC,UAAW5G,EAAeC,KAC1BsC,MAAOhC,KAAKgC,MACZsE,cAAeZ,G,CAIT,cAAAX,CAAeW,GACtBA,EAAEa,kBACFvG,KAAKwG,SAASJ,KAAK,CAClBC,UAAW5G,EAAeC,KAC1BsC,MAAOhC,KAAKgC,MACZsE,cAAeZ,G,CAIT,aAAAT,CAAcS,GACrBA,EAAEa,kBACFvG,KAAKyG,QAAQL,KAAK,CACjBC,UAAW5G,EAAeC,KAC1BsC,MAAOhC,KAAKgC,MACZsE,cAAeZ,G,CAQjB,cAAMgB,CAASC,GACd,OAAO3G,KAAK4B,SAASgF,MAAMD,E,CAO5B,cAAME,CAAS7E,GACdhC,KAAKgC,MAAQA,C,CAOd,gBAAM8E,GACL9G,KAAKgC,MAAQ,GACbhC,KAAK4B,SAASI,MAAQ,E,CAOvB,YAAM+E,GACL,OAAO/G,KAAK4B,Q","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,h as t,H as o,g as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as s,h as t,H as o,g as r}from"./p-ClISz4NF.js";import{a}from"./p-Q99QrOoi.js";import{g as c}from"./p-CoD1xawt.js";const e=class{constructor(t){s(this,t);this.h=c(this.host)}render(){return t(o,{key:"9e86314a6f4fb229ce1b0b3ac63cfbb2c88d2e28",class:this.h.classes(a.root)},t("slot",{key:"8d2a31c1bd14511f80536b82b62c5c8a72ddf2ce"}))}get host(){return r(this)}};export{e as gov_layout_column};
|
|
2
|
+
//# sourceMappingURL=p-9d9e9401.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovLayoutColumn","constructor","hostRef","this","h","govHost","host","render","Host","key","class","classes","LayoutColumnClass","root"],"sources":["../../../packages/core/src/components/gov-layout/gov-layout-column.tsx"],"sourcesContent":["import { Component, Element, h, Host } from '@stencil/core'\nimport { LayoutColumnClass } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-layout-column',\n})\nexport class GovLayoutColumn {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovLayoutColumnElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(LayoutColumnClass.root)}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"kIAQaA,EAAe,MAG3B,WAAAC,CAAAC,G,UACCC,KAAKC,EAAIC,EAAQF,KAAKG,KACtB,CAID,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOP,KAAKC,EAAEO,QAAQC,EAAkBC,OAC7CT,
|
|
1
|
+
{"version":3,"names":["GovLayoutColumn","constructor","hostRef","this","h","govHost","host","render","Host","key","class","classes","LayoutColumnClass","root"],"sources":["../../../packages/core/src/components/gov-layout/gov-layout-column.tsx"],"sourcesContent":["import { Component, Element, h, Host } from '@stencil/core'\nimport { LayoutColumnClass } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-layout-column',\n})\nexport class GovLayoutColumn {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovLayoutColumnElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(LayoutColumnClass.root)}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"kIAQaA,EAAe,MAG3B,WAAAC,CAAAC,G,UACCC,KAAKC,EAAIC,EAAQF,KAAKG,KACtB,CAID,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOP,KAAKC,EAAEO,QAAQC,EAAkBC,OAC7CT,EAAQ,QAAAK,IAAA,6C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-B6CqPcY_.js","sources":["../../../packages/core/src/components/gov-form/checkbox/constants.ts","../../../packages/core/src/components/gov-form/control/constants.ts","../../../packages/core/src/components/gov-form/input/constants.ts","../../../packages/core/src/components/gov-form/select/constants.ts","../../../packages/core/src/components/gov-form/multiselect/constants.ts","../../../packages/core/src/components/gov-form/switch/constants.ts","../../../packages/core/src/components/gov-form/radio/constants.ts","../../../packages/core/src/helpers/Dom/form.ts"],"sourcesContent":["import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormCheckboxSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormCheckboxSizesType = `${ValueOf<typeof FormCheckboxSizes>}`\n\nexport const FormCheckboxClass = {\n\troot: 'gov-form-checkbox',\n\tcheck: 'gov-form-checkbox__check',\n\tindeterminate: 'gov-form-checkbox__indeterminate',\n\tlabel: 'gov-form-checkbox__label',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormControlSizes = pick(Sizes, ['_M', '_L', '_XL'])\nexport type FormControlSizesType = `${ValueOf<typeof FormControlSizes>}`\n\nexport const FormControlClass = {\n\troot: 'gov-form-control',\n\tholder: 'gov-form-control__holder',\n\tbottom: 'gov-form-control__bottom',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\n\nexport const FormInputSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormInputSizesType = `${ValueOf<typeof FormInputSizes>}`\n\nexport enum InputTypes {\n\tCOLOR = 'color',\n\tDATE = 'date',\n\tDATETIME_LOCAL = 'datetime-local',\n\tEMAIL = 'email',\n\tMONTH = 'month',\n\tNUMBER = 'number',\n\tPASSWORD = 'password',\n\tSEARCH = 'search',\n\tTEL = 'tel',\n\tTEXT = 'text',\n\tTIME = 'time',\n\tURL = 'url',\n\tWEEK = 'week',\n}\nexport type InputType = `${ValueOf<typeof InputTypes>}`\n\nexport enum Type {\n\tRESET = 'reset',\n}\nexport type TypesType = `${ValueOf<typeof Type>}`\n\nexport const FormInputClass = {\n\troot: 'gov-form-input',\n\ticons: 'gov-form-input__icons',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormSelectSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormSelectSizesType = `${ValueOf<typeof FormSelectSizes>}`\n\nexport const FormSelectClass = {\n\troot: 'gov-form-select',\n\ticon: 'gov-form-select__icon',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormMultiselectSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormMultiselectSizesType = `${ValueOf<typeof FormMultiselectSizes>}`\n\nexport const FormMultiSelectClass = {\n\troot: 'gov-form-multi-select',\n\twrap: 'gov-form-multi-select__wrap',\n\tlist: 'gov-form-multi-select__list',\n\titem: 'gov-form-multi-select__item',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\n\nexport const FormSwitchSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormSwitchSizesType = `${ValueOf<typeof FormSwitchSizes>}`\n\nexport const FormSwitchClass = {\n\troot: 'gov-form-switch',\n\tholder: 'gov-form-switch__holder',\n\tinput: 'gov-form-switch__input',\n\tindicator: 'gov-form-switch__indicator',\n\tlabel: 'gov-form-switch__label',\n\tnoLabel: 'gov-form-switch__no-label',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormRadioSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormRadioSizesType = `${ValueOf<typeof FormRadioSizes>}`\n\nexport const FormRadioClass = {\n\troot: 'gov-form-radio',\n\tinput: 'gov-form-radio__input',\n\tindicator: 'gov-form-radio__indicator',\n\tlabel: 'gov-form-radio__label',\n}\n","import { GovHost } from './template.types'\nimport { GovForm } from './form.types'\nimport { FormControlClass } from '../../components/gov-form/control/constants'\nimport { FormInputClass } from '../../components/gov-form/input/constants'\nimport { FormSelectClass } from '../../components/gov-form/select/constants'\nimport { FormMultiSelectClass } from '../../components/gov-form/multiselect/constants'\nimport { FormSwitchClass } from '../../components/gov-form/switch/constants'\nimport { FormCheckboxClass } from '../../components/gov-form/checkbox/constants'\nimport { FormRadioClass } from '../../components/gov-form/radio/constants'\nimport { FormMessageClass } from '../../components/gov-form/message/constants'\nimport { FormAutocompleteClass } from '../../components/gov-form/autocomplete/constants'\nimport { Nullable } from '../../types/interfaces'\nimport { FormLabelClass } from \"../../components/gov-form/label/constants\"\n\nexport const govForm = (govHost: GovHost): GovForm => {\n\treturn {\n\t\tget govHost(): GovHost {\n\t\t\treturn govHost\n\t\t},\n\t\tpassAttrToControl(name: string, value: string): void {\n\t\t\tif (this.control) {\n\t\t\t\tthis.control.setAttribute(name, value)\n\t\t\t}\n\t\t},\n\t\tpassAttrToLabel(name: string, value: string): void {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.setAttribute(name, value)\n\t\t\t}\n\t\t},\n\t\tget hasGroupChildren(): boolean {\n\t\t\tif (this.control) {\n\t\t\t\treturn this.control.querySelectorAll('gov-form-group > *, gov-form-radio-group > *, gov-form-checkbox-group > *').length > 1\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tget control(): Nullable<HTMLGovFormControlElement> {\n\t\t\tif (this.govHost.name === FormControlClass.root) {\n\t\t\t\treturn this.govHost.hostElement\n\t\t\t}\n\t\t\treturn this.govHost.getParent(FormControlClass.root)\n\t\t},\n\t\tget label(): Nullable<HTMLGovFormLabelElement> {\n\t\t\tconst innerLabel = this.govHost.hostElement.querySelector(`.${FormLabelClass.root}`)\n\t\t\tif(innerLabel) {\n\t\t\t\treturn innerLabel\n\t\t\t}\n\t\t\tif (this.control) {\n\t\t\t\treturn this.control.querySelector(`.${FormLabelClass.root}`)\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\t\tget mainElementsInControl(): Element[] {\n\t\t\tconst formElements = [\n\t\t\t\tFormSelectClass.root,\n\t\t\t\tFormInputClass.root,\n\t\t\t\tFormSwitchClass.root,\n\t\t\t\tFormCheckboxClass.root,\n\t\t\t\tFormRadioClass.root,\n\t\t\t\tFormMultiSelectClass.root,\n\t\t\t\tFormAutocompleteClass.root,\n\t\t\t]\n\t\t\tif (this.control) {\n\t\t\t\tconst elements = formElements.map(el => `${el}:first-of-type`).join(', ')\n\t\t\t\treturn Array.from(this.control.querySelectorAll(elements))\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t\tget messageElements(): HTMLGovFormMessageElement[] {\n\t\t\tif (this.control) {\n\t\t\t\treturn Array.from(this.control.querySelectorAll(FormMessageClass.root))\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t}\n}\n"],"names":[],"mappings":";;;;;;MAIa,iBAAiB,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;AAGtE,MAAM,iBAAiB,GAAG;AAChC,IAAA,IAAI,E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gBAAA,eAAe,CAAC,IAAI;AACpB,gBAAA,cAAc,CAAC,IAAI;AACnB,gBAAA,eAAe,CAAC,IAAI;AACpB,gBAAA,iBAAiB,CAAC,IAAI;AACtB,gBAAA,cAAc,CAAC,IAAI;AACnB,gBAAA,oBAAoB,CAAC,IAAI;AACzB,gBAAA,qBAAqB,CAAC,IAAI;aAC1B;AACD,YAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AACjB,gBAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,IAAI,CAAA,EAAG,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;AACzE,gBAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;;AAE3D,YAAA,OAAO,EAAE;SACT;AACD,QAAA,IAAI,eAAe,GAAA;AAClB,YAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AACjB,gBAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;;AAExE,YAAA,OAAO,EAAE;SACT;KACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"p-B6CqPcY_.js","sources":["../../../packages/core/src/components/gov-form/checkbox/constants.ts","../../../packages/core/src/components/gov-form/control/constants.ts","../../../packages/core/src/components/gov-form/input/constants.ts","../../../packages/core/src/components/gov-form/select/constants.ts","../../../packages/core/src/components/gov-form/multiselect/constants.ts","../../../packages/core/src/components/gov-form/switch/constants.ts","../../../packages/core/src/components/gov-form/radio/constants.ts","../../../packages/core/src/helpers/Dom/form.ts"],"sourcesContent":["import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormCheckboxSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormCheckboxSizesType = `${ValueOf<typeof FormCheckboxSizes>}`\n\nexport const FormCheckboxClass = {\n\troot: 'gov-form-checkbox',\n\tcheck: 'gov-form-checkbox__check',\n\tindeterminate: 'gov-form-checkbox__indeterminate',\n\tlabel: 'gov-form-checkbox__label',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormControlSizes = pick(Sizes, ['_M', '_L', '_XL'])\nexport type FormControlSizesType = `${ValueOf<typeof FormControlSizes>}`\n\nexport const FormControlClass = {\n\troot: 'gov-form-control',\n\tholder: 'gov-form-control__holder',\n\tbottom: 'gov-form-control__bottom',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\n\nexport const FormInputSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormInputSizesType = `${ValueOf<typeof FormInputSizes>}`\n\nexport enum InputTypes {\n\tCOLOR = 'color',\n\tDATE = 'date',\n\tDATETIME_LOCAL = 'datetime-local',\n\tEMAIL = 'email',\n\tMONTH = 'month',\n\tNUMBER = 'number',\n\tPASSWORD = 'password',\n\tSEARCH = 'search',\n\tTEL = 'tel',\n\tTEXT = 'text',\n\tTIME = 'time',\n\tURL = 'url',\n\tWEEK = 'week',\n}\nexport type InputType = `${ValueOf<typeof InputTypes>}`\n\nexport enum Type {\n\tRESET = 'reset',\n}\nexport type TypesType = `${ValueOf<typeof Type>}`\n\nexport const FormInputClass = {\n\troot: 'gov-form-input',\n\ticons: 'gov-form-input__icons',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormSelectSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormSelectSizesType = `${ValueOf<typeof FormSelectSizes>}`\n\nexport const FormSelectClass = {\n\troot: 'gov-form-select',\n\ticon: 'gov-form-select__icon',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormMultiselectSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormMultiselectSizesType = `${ValueOf<typeof FormMultiselectSizes>}`\n\nexport const FormMultiSelectClass = {\n\troot: 'gov-form-multi-select',\n\twrap: 'gov-form-multi-select__wrap',\n\tlist: 'gov-form-multi-select__list',\n\titem: 'gov-form-multi-select__item',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\n\nexport const FormSwitchSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormSwitchSizesType = `${ValueOf<typeof FormSwitchSizes>}`\n\nexport const FormSwitchClass = {\n\troot: 'gov-form-switch',\n\tholder: 'gov-form-switch__holder',\n\tinput: 'gov-form-switch__input',\n\tindicator: 'gov-form-switch__indicator',\n\tlabel: 'gov-form-switch__label',\n\tnoLabel: 'gov-form-switch__no-label',\n}\n","import { Sizes } from '../../../core/constants/sizes'\nimport { pick } from '../../../utils/utils'\nimport { ValueOf } from '../../../types/interfaces'\n\nexport const FormRadioSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type FormRadioSizesType = `${ValueOf<typeof FormRadioSizes>}`\n\nexport const FormRadioClass = {\n\troot: 'gov-form-radio',\n\tinput: 'gov-form-radio__input',\n\tindicator: 'gov-form-radio__indicator',\n\tlabel: 'gov-form-radio__label',\n}\n","import { GovHost } from './template.types'\nimport { GovForm } from './form.types'\nimport { FormControlClass } from '../../components/gov-form/control/constants'\nimport { FormInputClass } from '../../components/gov-form/input/constants'\nimport { FormSelectClass } from '../../components/gov-form/select/constants'\nimport { FormMultiSelectClass } from '../../components/gov-form/multiselect/constants'\nimport { FormSwitchClass } from '../../components/gov-form/switch/constants'\nimport { FormCheckboxClass } from '../../components/gov-form/checkbox/constants'\nimport { FormRadioClass } from '../../components/gov-form/radio/constants'\nimport { FormMessageClass } from '../../components/gov-form/message/constants'\nimport { FormAutocompleteClass } from '../../components/gov-form/autocomplete/constants'\nimport { Nullable } from '../../types/interfaces'\nimport { FormLabelClass } from \"../../components/gov-form/label/constants\"\n\nexport const govForm = (govHost: GovHost): GovForm => {\n\treturn {\n\t\tget govHost(): GovHost {\n\t\t\treturn govHost\n\t\t},\n\t\tpassAttrToControl(name: string, value: string): void {\n\t\t\tif (this.control) {\n\t\t\t\tthis.control.setAttribute(name, value)\n\t\t\t}\n\t\t},\n\t\tpassAttrToLabel(name: string, value: string): void {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.setAttribute(name, value)\n\t\t\t}\n\t\t},\n\t\tget hasGroupChildren(): boolean {\n\t\t\tif (this.control) {\n\t\t\t\treturn this.control.querySelectorAll('gov-form-group > *, gov-form-radio-group > *, gov-form-checkbox-group > *').length > 1\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tget control(): Nullable<HTMLGovFormControlElement> {\n\t\t\tif (this.govHost.name === FormControlClass.root) {\n\t\t\t\treturn this.govHost.hostElement\n\t\t\t}\n\t\t\treturn this.govHost.getParent(FormControlClass.root)\n\t\t},\n\t\tget label(): Nullable<HTMLGovFormLabelElement> {\n\t\t\tconst innerLabel = this.govHost.hostElement.querySelector(`.${FormLabelClass.root}`)\n\t\t\tif(innerLabel) {\n\t\t\t\treturn innerLabel\n\t\t\t}\n\t\t\tif (this.control) {\n\t\t\t\treturn this.control.querySelector(`.${FormLabelClass.root}`)\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\t\tget mainElementsInControl(): Element[] {\n\t\t\tconst formElements = [\n\t\t\t\tFormSelectClass.root,\n\t\t\t\tFormInputClass.root,\n\t\t\t\tFormSwitchClass.root,\n\t\t\t\tFormCheckboxClass.root,\n\t\t\t\tFormRadioClass.root,\n\t\t\t\tFormMultiSelectClass.root,\n\t\t\t\tFormAutocompleteClass.root,\n\t\t\t]\n\t\t\tif (this.control) {\n\t\t\t\tconst elements = formElements.map(el => `${el}:first-of-type`).join(', ')\n\t\t\t\treturn Array.from(this.control.querySelectorAll(elements))\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t\tget messageElements(): HTMLGovFormMessageElement[] {\n\t\t\tif (this.control) {\n\t\t\t\treturn Array.from(this.control.querySelectorAll(FormMessageClass.root))\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t}\n}\n"],"names":[],"mappings":";;;;;;MAIa,iBAAiB,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;AAGhE,MAAA,iBAAiB,GAAG;AAChC,IAAA,IAAI,EAAE,mBAAmB;AACzB,IAAA,KAAK,EAAE,0BAA0B;AACjC,IAAA,aAAa,EAAE,kCAAkC;AACjD,IAAA,KAAK,EAAE,0BAA0B;;;ACPF,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;AAGlD,MAAA,gBAAgB,GAAG;AAC/B,IAAA,IAAI,EAAE,kBAAkB;AACxB,IAAA,MAAM,EAAE,0BAA0B;AAClC,IAAA,MAAM,EAAE,0BAA0B;;;MCNtB,cAAc,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;AAG1E,IAAY,UAcX;AAdD,CAAA,UAAY,UAAU,EAAA;AACrB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,UAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,UAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,UA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1 @@
|
|
|
1
|
-
{"version":3,"file":"p-BUmDydor.js","sources":["../../../packages/core/src/components/gov-form/group/constants.ts"],"sourcesContent":["import { pick } from \"../../../utils/utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { ValueOf } from \"../../../types/interfaces\"\n\nexport const FormGroupSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_2XL'])\nexport type FormGroupSizesType = `${ValueOf<typeof FormGroupSizes>}`\n\nexport enum FormGroupOrientation {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical',\n}\nexport type FormGroupOrientationType = `${ValueOf<typeof FormGroupOrientation>}`\n\nexport const FormGroupClass = {\n\troot: 'gov-form-group',\n}\n\nexport const FormRadioGroupClass = {\n\troot: 'gov-form-radio-group',\n}\n\nexport const FormCheckboxGroupClass = {\n\troot: 'gov-form-checkbox-group',\n}\n"],"names":[],"mappings":";;;MAIa,cAAc,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"p-BUmDydor.js","sources":["../../../packages/core/src/components/gov-form/group/constants.ts"],"sourcesContent":["import { pick } from \"../../../utils/utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { ValueOf } from \"../../../types/interfaces\"\n\nexport const FormGroupSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_2XL'])\nexport type FormGroupSizesType = `${ValueOf<typeof FormGroupSizes>}`\n\nexport enum FormGroupOrientation {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical',\n}\nexport type FormGroupOrientationType = `${ValueOf<typeof FormGroupOrientation>}`\n\nexport const FormGroupClass = {\n\troot: 'gov-form-group',\n}\n\nexport const FormRadioGroupClass = {\n\troot: 'gov-form-radio-group',\n}\n\nexport const FormCheckboxGroupClass = {\n\troot: 'gov-form-checkbox-group',\n}\n"],"names":[],"mappings":";;;MAIa,cAAc,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC;IAG/D;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC/B,IAAA,oBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,oBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACtB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,GAG/B,EAAA,CAAA,CAAA;AAGY,MAAA,cAAc,GAAG;AAC7B,IAAA,IAAI,EAAE,gBAAgB;;AAGV,MAAA,mBAAmB,GAAG;AAClC,IAAA,IAAI,EAAE,sBAAsB;;AAGhB,MAAA,sBAAsB,GAAG;AACrC,IAAA,IAAI,EAAE,yBAAyB;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-BcQO4NH2.js","sources":["../../../packages/core/src/core/constants/sizes.ts"],"sourcesContent":["export enum Sizes {\n\t_2XS = '2xs',\n\t_XS = 'xs',\n\t_S = 's',\n\t_M = 'm',\n\t_L = 'l',\n\t_XL = 'xl',\n\t_2XL = '2xl',\n\t_3XL = '3xl',\n\t_4XL = '4xl',\n\t_5XL = '5xl',\n\t_6XL = '6xl',\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"p-BcQO4NH2.js","sources":["../../../packages/core/src/core/constants/sizes.ts"],"sourcesContent":["export enum Sizes {\n\t_2XS = '2xs',\n\t_XS = 'xs',\n\t_S = 's',\n\t_M = 'm',\n\t_L = 'l',\n\t_XL = 'xl',\n\t_2XL = '2xl',\n\t_3XL = '3xl',\n\t_4XL = '4xl',\n\t_5XL = '5xl',\n\t_6XL = '6xl',\n}\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,KAAK,EAAA;AAChB,IAAA,KAAA,CAAA,MAAA,CAAA,GAAA,KAAY;AACZ,IAAA,KAAA,CAAA,KAAA,CAAA,GAAA,IAAU;AACV,IAAA,KAAA,CAAA,IAAA,CAAA,GAAA,GAAQ;AACR,IAAA,KAAA,CAAA,IAAA,CAAA,GAAA,GAAQ;AACR,IAAA,KAAA,CAAA,IAAA,CAAA,GAAA,GAAQ;AACR,IAAA,KAAA,CAAA,KAAA,CAAA,GAAA,IAAU;AACV,IAAA,KAAA,CAAA,MAAA,CAAA,GAAA,KAAY;AACZ,IAAA,KAAA,CAAA,MAAA,CAAA,GAAA,KAAY;AACZ,IAAA,KAAA,CAAA,MAAA,CAAA,GAAA,KAAY;AACZ,IAAA,KAAA,CAAA,MAAA,CAAA,GAAA,KAAY;AACZ,IAAA,KAAA,CAAA,MAAA,CAAA,GAAA,KAAY;AACb,CAAC,EAZW,KAAK,KAAL,KAAK,GAYhB,EAAA,CAAA,CAAA;;;;"}
|