@gov-design-system-ce/components 0.0.66 → 0.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +2 -2
- package/dist/cjs/gov-app.cjs.entry.js +159 -0
- package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-attachments_3.cjs.entry.js +2 -2
- package/dist/cjs/gov-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/gov-button.cjs.entry.js +8 -3
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-card.cjs.entry.js +2 -2
- package/dist/cjs/gov-chip.cjs.entry.js +6 -1
- package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-control-group.cjs.entry.js +2 -2
- package/dist/cjs/gov-control-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
- package/dist/cjs/gov-error-code.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-input.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +74 -11
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-select.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
- package/dist/cjs/gov-icon.cjs.entry.js +2 -2
- package/dist/cjs/gov-infobar.cjs.entry.js +3 -3
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-modal.cjs.entry.js +11 -11
- package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-nav.cjs.entry.js +2 -2
- package/dist/cjs/gov-pagination.cjs.entry.js +2 -2
- package/dist/cjs/gov-prompt.cjs.entry.js +14 -14
- package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-side-nav.cjs.entry.js +2 -2
- package/dist/cjs/gov-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tabs.cjs.entry.js +2 -2
- package/dist/cjs/gov-tag.cjs.entry.js +6 -1
- package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard.cjs.entry.js +2 -2
- package/dist/cjs/helpers-2c870ff5.js +19 -0
- package/dist/cjs/helpers-2c870ff5.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{wcag-d7912060.js → wcag-ebd590c0.js} +2 -2
- package/dist/cjs/{wcag-d7912060.js.map → wcag-ebd590c0.js.map} +1 -1
- package/dist/cjs/{win-0427c131.js → win-9d1a8a53.js} +2 -2
- package/dist/cjs/win-9d1a8a53.js.map +1 -0
- package/dist/collection/components/gov-accordion/gov-accordion-item.css +1 -0
- package/dist/collection/components/gov-button/button/gov-button.js +44 -5
- package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
- package/dist/collection/components/gov-chip/gov-chip.js +40 -1
- package/dist/collection/components/gov-chip/gov-chip.js.map +1 -1
- package/dist/collection/components/gov-control-group/constants.js +1 -1
- package/dist/collection/components/gov-control-group/constants.js.map +1 -1
- package/dist/collection/components/gov-control-group/gov-control-group.css +18 -0
- package/dist/collection/components/gov-control-group/gov-control-group.js +1 -1
- package/dist/collection/components/gov-error-code/gov-error-code.css +4 -4
- package/dist/collection/components/gov-form/control/gov-form-control.css +13 -13
- package/dist/collection/components/gov-form/label/gov-form-label.css +5 -0
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +251 -12
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.types.js.map +1 -1
- package/dist/collection/components/gov-icon/helpers.js +14 -0
- package/dist/collection/components/gov-icon/helpers.js.map +1 -0
- package/dist/collection/components/gov-infobar/gov-infobar.css +3 -5
- package/dist/collection/components/gov-modal/gov-modal.js +13 -12
- package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
- package/dist/collection/components/gov-promp/gov-prompt.js +18 -17
- package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
- package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +2 -2
- package/dist/collection/components/gov-tag/gov-tag.js +40 -1
- package/dist/collection/components/gov-tag/gov-tag.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.css +0 -2
- package/dist/collection/helpers/Dom/win.js +1 -1
- package/dist/collection/helpers/Dom/win.js.map +1 -1
- package/dist/collection/pages/Button.js +4 -0
- package/dist/collection/pages/Button.js.map +1 -1
- package/dist/collection/pages/ControlGroup.js +95 -0
- package/dist/collection/pages/ControlGroup.js.map +1 -1
- package/dist/collection/pages/Forms.js +16 -0
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Infobar.js +44 -0
- package/dist/collection/pages/Infobar.js.map +1 -1
- package/dist/collection/utils/helpers.types.js +54 -0
- package/dist/collection/utils/helpers.types.js.map +1 -0
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-accordion-item.js.map +1 -1
- package/dist/components/gov-accordion.js +1 -1
- package/dist/components/gov-app.js +1 -1
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-attachments.js +1 -1
- package/dist/components/gov-backdrop.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-control-group.js +1 -1
- package/dist/components/gov-control-group.js.map +1 -1
- package/dist/components/gov-error-code.js +1 -1
- package/dist/components/gov-error-code.js.map +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-control.js +1 -1
- package/dist/components/gov-form-control.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-label.js +1 -1
- package/dist/components/gov-form-label.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-radio.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-infobar.js.map +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-modal.js.map +1 -1
- package/dist/components/gov-nav.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-prompt.js.map +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-side-nav.js +1 -1
- package/dist/components/gov-skeleton.js +1 -1
- package/dist/components/gov-statsbar-item.js +1 -1
- package/dist/components/gov-statsbar-item.js.map +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-tag.js.map +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-tooltip.js.map +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/p-00b7c4f5.js +2 -0
- package/dist/components/{p-01973e7c.js → p-09c9405e.js} +2 -2
- package/dist/components/{p-517eadc5.js → p-0ef237e1.js} +2 -2
- package/dist/components/p-12aebffb.js +2 -0
- package/dist/components/p-12aebffb.js.map +1 -0
- package/dist/{core/p-4bd25e13.entry.js → components/p-12ffcecf.js} +2 -2
- package/dist/components/p-12ffcecf.js.map +1 -0
- package/dist/components/{p-4d3ad11d.js → p-1e6a2ff1.js} +2 -2
- package/dist/components/{p-d60bcfde.js → p-26dfbba1.js} +2 -2
- package/dist/components/p-2bf5b814.js +2 -0
- package/dist/components/p-2bf5b814.js.map +1 -0
- package/dist/components/{p-977c00bf.js → p-3186d4f6.js} +2 -2
- package/dist/components/{p-f2efd9b5.js → p-530fbb0a.js} +2 -2
- package/dist/components/{p-3718261d.js → p-7bfd6fca.js} +2 -2
- package/dist/components/p-d23e6972.js +2 -0
- package/dist/components/p-d23e6972.js.map +1 -0
- package/dist/core/core.css +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-c0be9590.entry.js → p-093160bb.entry.js} +2 -2
- package/dist/core/{p-9af6210d.entry.js → p-0950ca8d.entry.js} +2 -2
- package/dist/core/{p-466f885b.entry.js → p-13942637.entry.js} +2 -2
- package/dist/core/p-13942637.entry.js.map +1 -0
- package/dist/core/p-1fd3d109.entry.js +2 -0
- package/dist/core/{p-2bcabdd5.entry.js.map → p-1fd3d109.entry.js.map} +1 -1
- package/dist/core/{p-965f24fb.entry.js → p-26921fac.entry.js} +2 -2
- package/dist/core/{p-c3e4700b.entry.js → p-28c83bdf.entry.js} +2 -2
- package/dist/core/p-2bf5b814.js +2 -0
- package/dist/core/p-2bf5b814.js.map +1 -0
- package/dist/core/p-31b93317.entry.js +2 -0
- package/dist/core/p-31b93317.entry.js.map +1 -0
- package/dist/core/{p-e9c0fac1.entry.js → p-3aa4cf18.entry.js} +2 -2
- package/dist/core/p-5d8776c1.entry.js +2 -0
- package/dist/core/p-5d8776c1.entry.js.map +1 -0
- package/dist/core/{p-029beaf4.entry.js → p-6b1c11ba.entry.js} +2 -2
- package/dist/core/p-6b1c11ba.entry.js.map +1 -0
- package/dist/core/p-74882c70.entry.js +2 -0
- package/dist/core/p-74882c70.entry.js.map +1 -0
- package/dist/core/{p-b3840f50.entry.js → p-79ca1b62.entry.js} +2 -2
- package/dist/core/{p-a54c1e85.entry.js → p-7cd73b1e.entry.js} +2 -2
- package/dist/core/p-878741b6.entry.js +2 -0
- package/dist/core/{p-9d4a6e9b.entry.js.map → p-878741b6.entry.js.map} +1 -1
- package/dist/core/{p-2016172f.entry.js → p-89b3e4d4.entry.js} +2 -2
- package/dist/core/{p-2016172f.entry.js.map → p-89b3e4d4.entry.js.map} +1 -1
- package/dist/core/p-9aeb4282.entry.js +2 -0
- package/dist/core/p-9aeb4282.entry.js.map +1 -0
- package/dist/core/{p-a3b6c5c7.entry.js → p-9d10131d.entry.js} +2 -2
- package/dist/core/{p-83afcd5b.entry.js → p-9f9e2bd8.entry.js} +2 -2
- package/dist/core/p-a7d895cb.entry.js +2 -0
- package/dist/core/{p-7b7f8cc2.entry.js.map → p-a7d895cb.entry.js.map} +1 -1
- package/dist/core/{p-a133cdda.entry.js → p-acb40ea2.entry.js} +2 -2
- package/dist/core/{p-b49ac370.entry.js → p-af1433f7.entry.js} +2 -2
- package/dist/core/{p-eb0c9716.entry.js → p-ba7cbd7f.entry.js} +2 -2
- package/dist/core/p-bb7f0a66.entry.js +2 -0
- package/dist/core/p-bb7f0a66.entry.js.map +1 -0
- package/dist/core/p-bd763705.entry.js +2 -0
- package/dist/core/p-bd763705.entry.js.map +1 -0
- package/dist/core/p-bf39d442.entry.js +2 -0
- package/dist/core/p-bf39d442.entry.js.map +1 -0
- package/dist/core/p-c44d44df.entry.js +2 -0
- package/dist/core/p-c44d44df.entry.js.map +1 -0
- package/dist/core/{p-87b5668e.entry.js → p-cef10fe5.entry.js} +2 -2
- package/dist/core/p-d1a3e571.entry.js +2 -0
- package/dist/core/p-d1a3e571.entry.js.map +1 -0
- package/dist/core/p-d23e6972.js +2 -0
- package/dist/core/p-d23e6972.js.map +1 -0
- package/dist/core/{p-4accef73.entry.js → p-d4d59523.entry.js} +2 -2
- package/dist/core/p-ecc8cc47.entry.js +2 -0
- package/dist/core/p-ecc8cc47.entry.js.map +1 -0
- package/dist/core/p-ee35ca3f.entry.js +2 -0
- package/dist/core/p-ee35ca3f.entry.js.map +1 -0
- package/dist/core/{p-6833aeaf.entry.js → p-f4a6a339.entry.js} +2 -2
- package/dist/core/p-faabd332.js +2 -0
- package/dist/core/p-fc81b896.entry.js +2 -0
- package/dist/core/p-fc81b896.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js.map +1 -1
- package/dist/esm/gov-accordion.entry.js +2 -2
- package/dist/esm/gov-app.entry.js +159 -0
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-attachments_3.entry.js +2 -2
- package/dist/esm/gov-backdrop.entry.js +2 -2
- package/dist/esm/gov-breadcrumbs.entry.js +2 -2
- package/dist/esm/gov-button.entry.js +8 -3
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-card.entry.js +2 -2
- package/dist/esm/gov-chip.entry.js +6 -1
- package/dist/esm/gov-chip.entry.js.map +1 -1
- package/dist/esm/gov-control-group.entry.js +2 -2
- package/dist/esm/gov-control-group.entry.js.map +1 -1
- package/dist/esm/gov-error-code.entry.js +1 -1
- package/dist/esm/gov-error-code.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +2 -2
- package/dist/esm/gov-form-control.entry.js +1 -1
- package/dist/esm/gov-form-control.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +2 -2
- package/dist/esm/gov-form-input.entry.js +2 -2
- package/dist/esm/gov-form-label.entry.js +1 -1
- package/dist/esm/gov-form-label.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +74 -11
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +2 -2
- package/dist/esm/gov-form-select.entry.js +2 -2
- package/dist/esm/gov-form-switch.entry.js +2 -2
- package/dist/esm/gov-icon.entry.js +2 -2
- package/dist/esm/gov-infobar.entry.js +3 -3
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/gov-modal.entry.js +11 -11
- package/dist/esm/gov-modal.entry.js.map +1 -1
- package/dist/esm/gov-nav.entry.js +2 -2
- package/dist/esm/gov-pagination.entry.js +2 -2
- package/dist/esm/gov-prompt.entry.js +14 -14
- package/dist/esm/gov-prompt.entry.js.map +1 -1
- package/dist/esm/gov-side-nav.entry.js +2 -2
- package/dist/esm/gov-skeleton.entry.js +2 -2
- package/dist/esm/gov-statsbar-item.entry.js +1 -1
- package/dist/esm/gov-statsbar-item.entry.js.map +1 -1
- package/dist/esm/gov-tabs.entry.js +2 -2
- package/dist/esm/gov-tag.entry.js +6 -1
- package/dist/esm/gov-tag.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.entry.js +1 -1
- package/dist/esm/gov-tooltip.entry.js.map +1 -1
- package/dist/esm/gov-wizard.entry.js +2 -2
- package/dist/esm/helpers-bc0fd116.js +17 -0
- package/dist/esm/helpers-bc0fd116.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{wcag-06bd4d01.js → wcag-b7b67e25.js} +2 -2
- package/dist/esm/{wcag-06bd4d01.js.map → wcag-b7b67e25.js.map} +1 -1
- package/dist/esm/{win-0a50f66e.js → win-0d231cca.js} +2 -2
- package/dist/esm/win-0d231cca.js.map +1 -0
- package/dist/hydrate/index.js +306 -45
- package/dist/types/components/gov-button/button/gov-button.d.ts +9 -1
- package/dist/types/components/gov-chip/gov-chip.d.ts +8 -0
- package/dist/types/components/gov-control-group/constants.d.ts +1 -1
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +33 -1
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.types.d.ts +1 -0
- package/dist/types/components/gov-icon/helpers.d.ts +5 -0
- package/dist/types/components/gov-modal/gov-modal.d.ts +3 -3
- package/dist/types/components/gov-promp/gov-prompt.d.ts +3 -3
- package/dist/types/components/gov-tag/gov-tag.d.ts +8 -0
- package/dist/types/components.d.ts +86 -2
- package/dist/types/utils/helpers.types.d.ts +49 -0
- package/package.json +2 -2
- package/dist/cjs/win-0427c131.js.map +0 -1
- package/dist/collection/helpers/StorybookDocsTemplate.js +0 -9
- package/dist/collection/helpers/StorybookDocsTemplate.js.map +0 -1
- package/dist/components/p-7fe7f6cd.js +0 -2
- package/dist/components/p-7fe7f6cd.js.map +0 -1
- package/dist/components/p-ae894a40.js +0 -2
- package/dist/components/p-cac3881f.js +0 -2
- package/dist/components/p-cac3881f.js.map +0 -1
- package/dist/components/p-d71d23ef.js +0 -2
- package/dist/components/p-d71d23ef.js.map +0 -1
- package/dist/core/p-029beaf4.entry.js.map +0 -1
- package/dist/core/p-14ca0233.entry.js +0 -2
- package/dist/core/p-14ca0233.entry.js.map +0 -1
- package/dist/core/p-2a95f9fb.entry.js +0 -2
- package/dist/core/p-2a95f9fb.entry.js.map +0 -1
- package/dist/core/p-2bcabdd5.entry.js +0 -2
- package/dist/core/p-356adceb.entry.js +0 -2
- package/dist/core/p-356adceb.entry.js.map +0 -1
- package/dist/core/p-3bd226fc.entry.js +0 -2
- package/dist/core/p-3bd226fc.entry.js.map +0 -1
- package/dist/core/p-466f885b.entry.js.map +0 -1
- package/dist/core/p-4bd25e13.entry.js.map +0 -1
- package/dist/core/p-53549fe4.entry.js +0 -2
- package/dist/core/p-53549fe4.entry.js.map +0 -1
- package/dist/core/p-570ef4e5.js +0 -2
- package/dist/core/p-603a9d99.entry.js +0 -2
- package/dist/core/p-603a9d99.entry.js.map +0 -1
- package/dist/core/p-7b7f8cc2.entry.js +0 -2
- package/dist/core/p-7d85bc32.entry.js +0 -2
- package/dist/core/p-7d85bc32.entry.js.map +0 -1
- package/dist/core/p-8811fe68.entry.js +0 -2
- package/dist/core/p-8811fe68.entry.js.map +0 -1
- package/dist/core/p-9d4a6e9b.entry.js +0 -2
- package/dist/core/p-a9493d11.entry.js +0 -2
- package/dist/core/p-a9493d11.entry.js.map +0 -1
- package/dist/core/p-c5e9da95.entry.js +0 -2
- package/dist/core/p-c5e9da95.entry.js.map +0 -1
- package/dist/core/p-cac3881f.js +0 -2
- package/dist/core/p-cac3881f.js.map +0 -1
- package/dist/core/p-d4c468b9.entry.js +0 -2
- package/dist/core/p-d4c468b9.entry.js.map +0 -1
- package/dist/esm/win-0a50f66e.js.map +0 -1
- package/dist/types/helpers/StorybookDocsTemplate.d.ts +0 -3
- /package/dist/components/{p-ae894a40.js.map → p-00b7c4f5.js.map} +0 -0
- /package/dist/components/{p-01973e7c.js.map → p-09c9405e.js.map} +0 -0
- /package/dist/components/{p-517eadc5.js.map → p-0ef237e1.js.map} +0 -0
- /package/dist/components/{p-4d3ad11d.js.map → p-1e6a2ff1.js.map} +0 -0
- /package/dist/components/{p-d60bcfde.js.map → p-26dfbba1.js.map} +0 -0
- /package/dist/components/{p-977c00bf.js.map → p-3186d4f6.js.map} +0 -0
- /package/dist/components/{p-f2efd9b5.js.map → p-530fbb0a.js.map} +0 -0
- /package/dist/components/{p-3718261d.js.map → p-7bfd6fca.js.map} +0 -0
- /package/dist/core/{p-c0be9590.entry.js.map → p-093160bb.entry.js.map} +0 -0
- /package/dist/core/{p-9af6210d.entry.js.map → p-0950ca8d.entry.js.map} +0 -0
- /package/dist/core/{p-965f24fb.entry.js.map → p-26921fac.entry.js.map} +0 -0
- /package/dist/core/{p-c3e4700b.entry.js.map → p-28c83bdf.entry.js.map} +0 -0
- /package/dist/core/{p-e9c0fac1.entry.js.map → p-3aa4cf18.entry.js.map} +0 -0
- /package/dist/core/{p-b3840f50.entry.js.map → p-79ca1b62.entry.js.map} +0 -0
- /package/dist/core/{p-a54c1e85.entry.js.map → p-7cd73b1e.entry.js.map} +0 -0
- /package/dist/core/{p-a3b6c5c7.entry.js.map → p-9d10131d.entry.js.map} +0 -0
- /package/dist/core/{p-83afcd5b.entry.js.map → p-9f9e2bd8.entry.js.map} +0 -0
- /package/dist/core/{p-a133cdda.entry.js.map → p-acb40ea2.entry.js.map} +0 -0
- /package/dist/core/{p-b49ac370.entry.js.map → p-af1433f7.entry.js.map} +0 -0
- /package/dist/core/{p-eb0c9716.entry.js.map → p-ba7cbd7f.entry.js.map} +0 -0
- /package/dist/core/{p-87b5668e.entry.js.map → p-cef10fe5.entry.js.map} +0 -0
- /package/dist/core/{p-4accef73.entry.js.map → p-d4d59523.entry.js.map} +0 -0
- /package/dist/core/{p-6833aeaf.entry.js.map → p-f4a6a339.entry.js.map} +0 -0
- /package/dist/core/{p-570ef4e5.js.map → p-faabd332.js.map} +0 -0
|
@@ -7,6 +7,7 @@ import { validateWcagLabelFor, validateWcagRef } from "../../../helpers/Validate
|
|
|
7
7
|
import { createID, removeDiacritics } from "../../../utils/string.utils";
|
|
8
8
|
import { delay } from "../../../utils/utils";
|
|
9
9
|
import { FormMultiSelectClass, FormMultiselectSizes, FormMultiselectVariants } from "./constants";
|
|
10
|
+
import { hasOwnProperty } from "../../../utils/helpers.types";
|
|
10
11
|
export class GovFormMultiSelect {
|
|
11
12
|
constructor() {
|
|
12
13
|
this.identifier = undefined;
|
|
@@ -14,6 +15,7 @@ export class GovFormMultiSelect {
|
|
|
14
15
|
this.variant = undefined;
|
|
15
16
|
this.size = 'm';
|
|
16
17
|
this.name = undefined;
|
|
18
|
+
this.hideSelectedList = false;
|
|
17
19
|
this.required = false;
|
|
18
20
|
this.disabled = false;
|
|
19
21
|
this.invalid = undefined;
|
|
@@ -26,6 +28,7 @@ export class GovFormMultiSelect {
|
|
|
26
28
|
this.focused = undefined;
|
|
27
29
|
this.value = undefined;
|
|
28
30
|
this.selectedOptions = [];
|
|
31
|
+
this.options = [];
|
|
29
32
|
this.selectId = createID('GovSelect');
|
|
30
33
|
this.listId = createID('GovMultiList');
|
|
31
34
|
this.h = govHost(this.host);
|
|
@@ -37,12 +40,6 @@ export class GovFormMultiSelect {
|
|
|
37
40
|
validateSize(newValue) {
|
|
38
41
|
validateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root);
|
|
39
42
|
}
|
|
40
|
-
emitChange(newValue) {
|
|
41
|
-
this.govChange.emit({
|
|
42
|
-
component: FormMultiSelectClass.root,
|
|
43
|
-
value: newValue,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
43
|
watchDisabled() {
|
|
47
44
|
this.passControlAttrs();
|
|
48
45
|
}
|
|
@@ -58,6 +55,12 @@ export class GovFormMultiSelect {
|
|
|
58
55
|
this.watchDisabled();
|
|
59
56
|
}
|
|
60
57
|
getAvailableOptions() {
|
|
58
|
+
if (Array.isArray(this.options) && this.options.length) {
|
|
59
|
+
return this.options.filter((option) => {
|
|
60
|
+
const isSelected = this.selectedOptions.findIndex((selected) => selected.value === option.value);
|
|
61
|
+
return (isSelected !== -1 || (option === null || option === void 0 ? void 0 : option.disabled)) ? false : true;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
61
64
|
return Array.from(this.selectRef.querySelectorAll('option'))
|
|
62
65
|
.filter((option) => !(option.disabled || option.selected))
|
|
63
66
|
.map((option) => ({ name: option.textContent, value: option.value }));
|
|
@@ -93,6 +96,14 @@ export class GovFormMultiSelect {
|
|
|
93
96
|
const index = this.getOptionIndex(newOption);
|
|
94
97
|
if (index === -1) {
|
|
95
98
|
this.selectedOptions = [...this.selectedOptions, newOption];
|
|
99
|
+
this.govChange.emit({
|
|
100
|
+
component: FormMultiSelectClass.root,
|
|
101
|
+
value: this.selectedOptions,
|
|
102
|
+
});
|
|
103
|
+
this.govSelect.emit({
|
|
104
|
+
component: FormMultiSelectClass.root,
|
|
105
|
+
value: this.selectedOptions,
|
|
106
|
+
});
|
|
96
107
|
const option = this.getOptionElement(newOption);
|
|
97
108
|
if (option) {
|
|
98
109
|
option.selected = true;
|
|
@@ -104,6 +115,14 @@ export class GovFormMultiSelect {
|
|
|
104
115
|
if (index !== -1) {
|
|
105
116
|
this.selectedOptions.splice(index, 1);
|
|
106
117
|
this.selectedOptions = [...this.selectedOptions];
|
|
118
|
+
this.govChange.emit({
|
|
119
|
+
component: FormMultiSelectClass.root,
|
|
120
|
+
value: this.selectedOptions,
|
|
121
|
+
});
|
|
122
|
+
this.govRemove.emit({
|
|
123
|
+
component: FormMultiSelectClass.root,
|
|
124
|
+
value: this.selectedOptions,
|
|
125
|
+
});
|
|
107
126
|
const option = this.getOptionElement(removeOption);
|
|
108
127
|
if (option) {
|
|
109
128
|
option.selected = false;
|
|
@@ -127,9 +146,11 @@ export class GovFormMultiSelect {
|
|
|
127
146
|
}
|
|
128
147
|
}
|
|
129
148
|
render() {
|
|
130
|
-
return (h(Host, { class: FormMultiSelectClass.root, size: this.size, variant: this.variant }, h("div", { class: FormMultiSelectClass.wrap }, h("div", { class: "element" }, h("gov-form-autocomplete", { value: this.value, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, placeholder: this.placeholder, "message-empty": this.messageEmpty, "message-loading": this.messageLoading, ref: el => (this.autocompleteRef = el), minlength: 0, wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), h("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "chevron-down" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && h("slot", { name: "right-icon" }), this.success && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), h("select", { hidden: true, "aria-hidden": true, multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null)
|
|
149
|
+
return (h(Host, { class: FormMultiSelectClass.root, size: this.size, variant: this.variant }, h("div", { class: FormMultiSelectClass.wrap }, h("div", { class: "element" }, h("gov-form-autocomplete", { value: this.value, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, placeholder: this.placeholder, "message-empty": this.messageEmpty, "message-loading": this.messageLoading, ref: el => (this.autocompleteRef = el), minlength: 0, wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), h("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "chevron-down" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && h("slot", { name: "right-icon" }), this.success && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), h("select", { hidden: true, "aria-hidden": toBoolAttr(true), multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null), this.options.map((option) => {
|
|
150
|
+
return (h("option", { value: option.value, selected: option.value === this.value, disabled: option === null || option === void 0 ? void 0 : option.disabled }, option.name));
|
|
151
|
+
})))), this.hideSelectedList === false ? (h("ul", { role: "listbox", id: this.listId, class: FormMultiSelectClass.list }, this.selectedOptions.map(option => {
|
|
131
152
|
return (h("li", { class: FormMultiSelectClass.item, role: "option" }, option.name, h("gov-button", { wcagLabel: 'Odebrat vybranou položku ' + option.name, variant: "primary", type: "base", size: "s", "on-gov-click": () => this.onTagRemove(option) }, h("gov-icon", { name: "x-lg" }))));
|
|
132
|
-
}))));
|
|
153
|
+
}))) : null));
|
|
133
154
|
}
|
|
134
155
|
onFocusHandler(e) {
|
|
135
156
|
e.stopPropagation();
|
|
@@ -183,6 +204,44 @@ export class GovFormMultiSelect {
|
|
|
183
204
|
async getRef() {
|
|
184
205
|
return this.selectRef;
|
|
185
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Returns a list of selected items
|
|
209
|
+
*/
|
|
210
|
+
async getSelectedOptions() {
|
|
211
|
+
return this.selectedOptions;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Setting a list of options to choose from
|
|
215
|
+
*/
|
|
216
|
+
async setOptions(options) {
|
|
217
|
+
if (Array.isArray(options)) {
|
|
218
|
+
this.options = options;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Setting the list of selected options
|
|
223
|
+
*/
|
|
224
|
+
async setSelectedOptions(options) {
|
|
225
|
+
if (Array.isArray(options)) {
|
|
226
|
+
this.selectedOptions = options;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* To remove an option from the selected list
|
|
231
|
+
*/
|
|
232
|
+
async removeSelectedOption(option) {
|
|
233
|
+
if (typeof option === 'object' && hasOwnProperty(option, 'name') && hasOwnProperty(option, 'value')) {
|
|
234
|
+
this.removeOption(option);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Returns an instance of the native html select element
|
|
239
|
+
*/
|
|
240
|
+
async setSelectedOption(option) {
|
|
241
|
+
if (typeof option === 'object' && hasOwnProperty(option, 'name') && hasOwnProperty(option, 'value')) {
|
|
242
|
+
this.selectOption(option);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
186
245
|
/**
|
|
187
246
|
* Validate the WCAG attributes of the component
|
|
188
247
|
*/
|
|
@@ -303,6 +362,24 @@ export class GovFormMultiSelect {
|
|
|
303
362
|
"attribute": "name",
|
|
304
363
|
"reflect": false
|
|
305
364
|
},
|
|
365
|
+
"hideSelectedList": {
|
|
366
|
+
"type": "boolean",
|
|
367
|
+
"mutable": false,
|
|
368
|
+
"complexType": {
|
|
369
|
+
"original": "boolean",
|
|
370
|
+
"resolved": "boolean",
|
|
371
|
+
"references": {}
|
|
372
|
+
},
|
|
373
|
+
"required": false,
|
|
374
|
+
"optional": false,
|
|
375
|
+
"docs": {
|
|
376
|
+
"tags": [],
|
|
377
|
+
"text": "Option to hide the list of selected items"
|
|
378
|
+
},
|
|
379
|
+
"attribute": "hide-selected-list",
|
|
380
|
+
"reflect": false,
|
|
381
|
+
"defaultValue": "false"
|
|
382
|
+
},
|
|
306
383
|
"required": {
|
|
307
384
|
"type": "boolean",
|
|
308
385
|
"mutable": false,
|
|
@@ -466,7 +543,8 @@ export class GovFormMultiSelect {
|
|
|
466
543
|
return {
|
|
467
544
|
"focused": {},
|
|
468
545
|
"value": {},
|
|
469
|
-
"selectedOptions": {}
|
|
546
|
+
"selectedOptions": {},
|
|
547
|
+
"options": {}
|
|
470
548
|
};
|
|
471
549
|
}
|
|
472
550
|
static get events() {
|
|
@@ -533,6 +611,48 @@ export class GovFormMultiSelect {
|
|
|
533
611
|
}
|
|
534
612
|
}
|
|
535
613
|
}
|
|
614
|
+
}, {
|
|
615
|
+
"method": "govSelect",
|
|
616
|
+
"name": "gov-select",
|
|
617
|
+
"bubbles": true,
|
|
618
|
+
"cancelable": true,
|
|
619
|
+
"composed": true,
|
|
620
|
+
"docs": {
|
|
621
|
+
"tags": [],
|
|
622
|
+
"text": "Emitted when an item is selected"
|
|
623
|
+
},
|
|
624
|
+
"complexType": {
|
|
625
|
+
"original": "FormMultiselectEvent",
|
|
626
|
+
"resolved": "FormMultiselectEvent",
|
|
627
|
+
"references": {
|
|
628
|
+
"FormMultiselectEvent": {
|
|
629
|
+
"location": "import",
|
|
630
|
+
"path": "./gov-form-multi-select.types",
|
|
631
|
+
"id": "../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.types.ts::FormMultiselectEvent"
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}, {
|
|
636
|
+
"method": "govRemove",
|
|
637
|
+
"name": "gov-remove",
|
|
638
|
+
"bubbles": true,
|
|
639
|
+
"cancelable": true,
|
|
640
|
+
"composed": true,
|
|
641
|
+
"docs": {
|
|
642
|
+
"tags": [],
|
|
643
|
+
"text": "Emitted when an item is removed"
|
|
644
|
+
},
|
|
645
|
+
"complexType": {
|
|
646
|
+
"original": "FormMultiselectEvent",
|
|
647
|
+
"resolved": "FormMultiselectEvent",
|
|
648
|
+
"references": {
|
|
649
|
+
"FormMultiselectEvent": {
|
|
650
|
+
"location": "import",
|
|
651
|
+
"path": "./gov-form-multi-select.types",
|
|
652
|
+
"id": "../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.types.ts::FormMultiselectEvent"
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
536
656
|
}];
|
|
537
657
|
}
|
|
538
658
|
static get methods() {
|
|
@@ -602,6 +722,128 @@ export class GovFormMultiSelect {
|
|
|
602
722
|
"tags": []
|
|
603
723
|
}
|
|
604
724
|
},
|
|
725
|
+
"getSelectedOptions": {
|
|
726
|
+
"complexType": {
|
|
727
|
+
"signature": "() => Promise<GovFormMultiSelectItem[]>",
|
|
728
|
+
"parameters": [],
|
|
729
|
+
"references": {
|
|
730
|
+
"Promise": {
|
|
731
|
+
"location": "global",
|
|
732
|
+
"id": "global::Promise"
|
|
733
|
+
},
|
|
734
|
+
"GovFormMultiSelectItem": {
|
|
735
|
+
"location": "import",
|
|
736
|
+
"path": "./gov-form-multi-select.types",
|
|
737
|
+
"id": "../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.types.ts::GovFormMultiSelectItem"
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
"return": "Promise<GovFormMultiSelectItem[]>"
|
|
741
|
+
},
|
|
742
|
+
"docs": {
|
|
743
|
+
"text": "Returns a list of selected items",
|
|
744
|
+
"tags": []
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
"setOptions": {
|
|
748
|
+
"complexType": {
|
|
749
|
+
"signature": "(options: GovFormMultiSelectItem[]) => Promise<void>",
|
|
750
|
+
"parameters": [{
|
|
751
|
+
"tags": [],
|
|
752
|
+
"text": ""
|
|
753
|
+
}],
|
|
754
|
+
"references": {
|
|
755
|
+
"Promise": {
|
|
756
|
+
"location": "global",
|
|
757
|
+
"id": "global::Promise"
|
|
758
|
+
},
|
|
759
|
+
"GovFormMultiSelectItem": {
|
|
760
|
+
"location": "import",
|
|
761
|
+
"path": "./gov-form-multi-select.types",
|
|
762
|
+
"id": "../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.types.ts::GovFormMultiSelectItem"
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
"return": "Promise<void>"
|
|
766
|
+
},
|
|
767
|
+
"docs": {
|
|
768
|
+
"text": "Setting a list of options to choose from",
|
|
769
|
+
"tags": []
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
"setSelectedOptions": {
|
|
773
|
+
"complexType": {
|
|
774
|
+
"signature": "(options: GovFormMultiSelectItem[]) => Promise<void>",
|
|
775
|
+
"parameters": [{
|
|
776
|
+
"tags": [],
|
|
777
|
+
"text": ""
|
|
778
|
+
}],
|
|
779
|
+
"references": {
|
|
780
|
+
"Promise": {
|
|
781
|
+
"location": "global",
|
|
782
|
+
"id": "global::Promise"
|
|
783
|
+
},
|
|
784
|
+
"GovFormMultiSelectItem": {
|
|
785
|
+
"location": "import",
|
|
786
|
+
"path": "./gov-form-multi-select.types",
|
|
787
|
+
"id": "../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.types.ts::GovFormMultiSelectItem"
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
"return": "Promise<void>"
|
|
791
|
+
},
|
|
792
|
+
"docs": {
|
|
793
|
+
"text": "Setting the list of selected options",
|
|
794
|
+
"tags": []
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
"removeSelectedOption": {
|
|
798
|
+
"complexType": {
|
|
799
|
+
"signature": "(option: GovFormMultiSelectItem) => Promise<void>",
|
|
800
|
+
"parameters": [{
|
|
801
|
+
"tags": [],
|
|
802
|
+
"text": ""
|
|
803
|
+
}],
|
|
804
|
+
"references": {
|
|
805
|
+
"Promise": {
|
|
806
|
+
"location": "global",
|
|
807
|
+
"id": "global::Promise"
|
|
808
|
+
},
|
|
809
|
+
"GovFormMultiSelectItem": {
|
|
810
|
+
"location": "import",
|
|
811
|
+
"path": "./gov-form-multi-select.types",
|
|
812
|
+
"id": "../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.types.ts::GovFormMultiSelectItem"
|
|
813
|
+
}
|
|
814
|
+
},
|
|
815
|
+
"return": "Promise<void>"
|
|
816
|
+
},
|
|
817
|
+
"docs": {
|
|
818
|
+
"text": "To remove an option from the selected list",
|
|
819
|
+
"tags": []
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
"setSelectedOption": {
|
|
823
|
+
"complexType": {
|
|
824
|
+
"signature": "(option: GovFormMultiSelectItem) => Promise<void>",
|
|
825
|
+
"parameters": [{
|
|
826
|
+
"tags": [],
|
|
827
|
+
"text": ""
|
|
828
|
+
}],
|
|
829
|
+
"references": {
|
|
830
|
+
"Promise": {
|
|
831
|
+
"location": "global",
|
|
832
|
+
"id": "global::Promise"
|
|
833
|
+
},
|
|
834
|
+
"GovFormMultiSelectItem": {
|
|
835
|
+
"location": "import",
|
|
836
|
+
"path": "./gov-form-multi-select.types",
|
|
837
|
+
"id": "../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.types.ts::GovFormMultiSelectItem"
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
"return": "Promise<void>"
|
|
841
|
+
},
|
|
842
|
+
"docs": {
|
|
843
|
+
"text": "Returns an instance of the native html select element",
|
|
844
|
+
"tags": []
|
|
845
|
+
}
|
|
846
|
+
},
|
|
605
847
|
"validateWcag": {
|
|
606
848
|
"complexType": {
|
|
607
849
|
"signature": "() => Promise<void>",
|
|
@@ -629,9 +871,6 @@ export class GovFormMultiSelect {
|
|
|
629
871
|
}, {
|
|
630
872
|
"propName": "size",
|
|
631
873
|
"methodName": "validateSize"
|
|
632
|
-
}, {
|
|
633
|
-
"propName": "selectedOptions",
|
|
634
|
-
"methodName": "emitChange"
|
|
635
874
|
}, {
|
|
636
875
|
"propName": "disabled",
|
|
637
876
|
"methodName": "watchDisabled"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-multi-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAExF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEtF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,OAAO,EAAE,oBAAoB,EAA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C,IAAI,CAAC,CAAA;IACrF,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACnF,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACtE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;EACvG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core'\nimport { govForm } from '../../../helpers/Dom/form'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from '../../../helpers/Dom/template'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { Nullable } from '../../../types/interfaces'\nimport { createID, removeDiacritics } from '../../../utils/string.utils'\nimport { delay } from '../../../utils/utils'\nimport { FormAutocompleteEvent } from '../autocomplete/gov-form-autocomplete.types'\nimport { FormMultiSelectClass, FormMultiselectSizes, FormMultiselectSizesType, FormMultiselectVariants, FormMultiselectVariantType } from './constants'\nimport { FormMultiselectEvent, GovFormMultiSelectItem } from './gov-form-multi-select.types'\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({ attribute: 'placeholder' }) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * 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 * 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 * Custom message for when data is loaded\n\t */\n\t@Prop({ attribute: 'message-loading' }) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-owns' }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<FormMultiselectEvent>\n\n\t@State() focused: boolean\n\t@State() value: string\n\t@State() selectedOptions: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('selectedOptions')\n\temitChange(newValue: GovFormMultiSelectItem[]) {\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\tvalue: newValue,\n\t\t})\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.watchDisabled()\n\t}\n\n\tprivate getAvailableOptions(): GovFormMultiSelectItem[] {\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => !(option.disabled || option.selected))\n\t\t\t.map((option: HTMLOptionElement) => ({ name: option.textContent, value: option.value }))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t.setSearchCallback(value => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(value).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({ name }) => {\n\t\t\t\t\t\t\tif (!name) return false\n\t\t\t\t\t\t\treturn removeDiacritics(name).toLowerCase().indexOf(removeDiacritics(value).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.then()\n\t}\n\n\tprivate getOptionIndex(value: GovFormMultiSelectItem): number {\n\t\treturn this.selectedOptions.findIndex(option => option.value === value.value && option.name === value.name)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value.value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptions = [...this.selectedOptions, newOption]\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptions.splice(index, 1)\n\t\t\tthis.selectedOptions = [...this.selectedOptions]\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.initAutocomplete()\n\t\tawait delay(0)\n\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectOption({\n\t\t\t\t\tname: option.textContent,\n\t\t\t\t\tvalue: option.value,\n\t\t\t\t})\n\t\t\t}\n\t\t})\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={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tmessage-empty={this.messageEmpty}\n\t\t\t\t\t\t\tmessage-loading={this.messageLoading}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\t\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\taria-hidden={true}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t{this.selectedOptions.map(option => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.name}\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(option)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptions,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptions,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\tthis.value = e.detail.value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.selected\n\t\tthis.selectOption(value as GovFormMultiSelectItem)\n\t\tthis.value = ''\n\t\tthis.autocompleteRef.clearValue()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * 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 * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-form-multi-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAA;AAEtF,OAAO,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iCAAiC,CAAA;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Ae,EAAE,mBAAmB,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACrF,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACnF,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACtE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;EACvG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../../helpers/Dom/win'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {validateWcagLabelFor, validateWcagRef} from '../../../helpers/Validate/wcag'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID, removeDiacritics} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {FormAutocompleteEvent} from '../autocomplete/gov-form-autocomplete.types'\nimport {\n\tFormMultiSelectClass,\n\tFormMultiselectSizes,\n\tFormMultiselectSizesType,\n\tFormMultiselectVariants,\n\tFormMultiselectVariantType\n} from './constants'\nimport {FormMultiselectEvent, GovFormMultiSelectItem} from './gov-form-multi-select.types'\nimport {hasOwnProperty} from \"../../../utils/helpers.types\";\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({attribute: 'placeholder'}) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Option to hide the list of selected items\n\t */\n\t@Prop({attribute: 'hide-selected-list'}) readonly hideSelectedList: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * 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 * 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 * Custom message for when data is loaded\n\t */\n\t@Prop({attribute: 'message-loading'}) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is selected\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<FormMultiselectEvent>\n\n\t@State() focused: boolean\n\t@State() value: string\n\t@State() selectedOptions: GovFormMultiSelectItem[] = []\n\t@State() options: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.watchDisabled()\n\t}\n\n\tprivate getAvailableOptions(): GovFormMultiSelectItem[] {\n\t\tif (Array.isArray(this.options) && this.options.length) {\n\t\t\treturn this.options.filter((option) => {\n\t\t\t\tconst isSelected = this.selectedOptions.findIndex((selected) => selected.value === option.value)\n\t\t\t\treturn (isSelected !== -1 || option?.disabled) ? false : true\n\t\t\t})\n\t\t}\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => !(option.disabled || option.selected))\n\t\t\t.map((option: HTMLOptionElement) => ({name: option.textContent, value: option.value}))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t.setSearchCallback(value => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(value).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({name}) => {\n\t\t\t\t\t\t\tif (!name) return false\n\t\t\t\t\t\t\treturn removeDiacritics(name).toLowerCase().indexOf(removeDiacritics(value).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.then()\n\t}\n\n\tprivate getOptionIndex(value: GovFormMultiSelectItem): number {\n\t\treturn this.selectedOptions.findIndex(option => option.value === value.value && option.name === value.name)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value.value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptions = [...this.selectedOptions, newOption]\n\t\t\tthis.govChange.emit({\n\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\tvalue: this.selectedOptions,\n\t\t\t})\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\tvalue: this.selectedOptions,\n\t\t\t})\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptions.splice(index, 1)\n\t\t\tthis.selectedOptions = [...this.selectedOptions]\n\t\t\tthis.govChange.emit({\n\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\tvalue: this.selectedOptions,\n\t\t\t})\n\t\t\tthis.govRemove.emit({\n\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\tvalue: this.selectedOptions,\n\t\t\t})\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.initAutocomplete()\n\t\tawait delay(0)\n\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectOption({\n\t\t\t\t\tname: option.textContent,\n\t\t\t\t\tvalue: option.value,\n\t\t\t\t})\n\t\t\t}\n\t\t})\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={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tmessage-empty={this.messageEmpty}\n\t\t\t\t\t\t\tmessage-loading={this.messageLoading}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\t\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\taria-hidden={toBoolAttr(true)}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t{this.options.map((option) => {\n\t\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.name}</option>)\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{this.hideSelectedList === false ? (\n\t\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t\t{this.selectedOptions.map(option => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.name}\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(option)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ul>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptions,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptions,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\tthis.value = e.detail.value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.selected\n\t\tthis.selectOption(value as GovFormMultiSelectItem)\n\t\tthis.value = ''\n\t\tthis.autocompleteRef.clearValue()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * 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 * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Returns a list of selected items\n\t */\n\t@Method()\n\tasync getSelectedOptions(): Promise<GovFormMultiSelectItem[]> {\n\t\treturn this.selectedOptions\n\t}\n\n\t/**\n\t * Setting a list of options to choose from\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormMultiSelectItem[]): Promise<void> {\n\t\tif (Array.isArray(options)) {\n\t\t\tthis.options = options\n\t\t}\n\t}\n\n\t/**\n\t * Setting the list of selected options\n\t */\n\t@Method()\n\tasync setSelectedOptions(options: GovFormMultiSelectItem[]): Promise<void> {\n\t\tif (Array.isArray(options)) {\n\t\t\tthis.selectedOptions = options\n\t\t}\n\t}\n\n\t/**\n\t * To remove an option from the selected list\n\t */\n\t@Method()\n\tasync removeSelectedOption(option: GovFormMultiSelectItem): Promise<void> {\n\t\tif (typeof option === 'object' && hasOwnProperty(option, 'name') && hasOwnProperty(option, 'value')) {\n\t\t\tthis.removeOption(option)\n\t\t}\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync setSelectedOption(option: GovFormMultiSelectItem): Promise<void> {\n\t\tif (typeof option === 'object' && hasOwnProperty(option, 'name') && hasOwnProperty(option, 'value')) {\n\t\t\tthis.selectOption(option)\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\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-multi-select.types.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/multiselect/gov-form-multi-select.types.ts"],"names":[],"mappings":"","sourcesContent":["import { GovBaseEvent } from \"../../../types/event.types\"\n\nexport interface GovFormMultiSelectItem {\n\tname: string\n\tvalue: string\n}\n\nexport interface FormMultiselectEvent extends GovBaseEvent {\n\tvalue: GovFormMultiSelectItem[]\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-form-multi-select.types.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/multiselect/gov-form-multi-select.types.ts"],"names":[],"mappings":"","sourcesContent":["import { GovBaseEvent } from \"../../../types/event.types\"\n\nexport interface GovFormMultiSelectItem {\n\tname: string\n\tvalue: string\n\tdisabled?: boolean\n}\n\nexport interface FormMultiselectEvent extends GovBaseEvent {\n\tvalue: GovFormMultiSelectItem[]\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const prepareIconFormat = (value) => {
|
|
2
|
+
if (typeof value === 'string' && value.length) {
|
|
3
|
+
const regexPattern = /^[a-z-]+\/[a-z-]+$/;
|
|
4
|
+
if (regexPattern.test(value)) {
|
|
5
|
+
const icon = value.split("/");
|
|
6
|
+
return {
|
|
7
|
+
type: icon[0],
|
|
8
|
+
name: icon[1],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../src/components/gov-icon/helpers.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAA4C,EAAE;EAC5F,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,EAAE;IAC9C,MAAM,YAAY,GAAG,oBAAoB,CAAC;IAC1C,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;MAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;MAC9B,OAAO;QACN,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACb,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;OACb,CAAA;KACD;GACD;EACD,OAAO,IAAI,CAAA;AACZ,CAAC,CAAA","sourcesContent":["import {Nullable} from \"../../types/interfaces\";\n\nexport const prepareIconFormat = (value: string): Nullable<{ type: string, name: string }> => {\n\tif (typeof value === 'string' && value.length) {\n\t\tconst regexPattern = /^[a-z-]+\\/[a-z-]+$/;\n\t\tif (regexPattern.test(value)) {\n\t\t\tconst icon = value.split(\"/\");\n\t\t\treturn {\n\t\t\t\ttype: icon[0],\n\t\t\t\tname: icon[1],\n\t\t\t}\n\t\t}\n\t}\n\treturn null\n}\n"]}
|
|
@@ -283,6 +283,9 @@
|
|
|
283
283
|
color: inherit;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
+
.gov-infobar__content a .gov-icon {
|
|
287
|
+
color: inherit;
|
|
288
|
+
}
|
|
286
289
|
.gov-infobar__close {
|
|
287
290
|
position: absolute;
|
|
288
291
|
top: 0.875rem;
|
|
@@ -382,9 +385,4 @@
|
|
|
382
385
|
}
|
|
383
386
|
.gov-infobar[variant=primary][inverse=""] .gov-infobar__content, .gov-infobar[variant=primary][inverse=true i] .gov-infobar__content, .gov-infobar[variant=primary][inverse="1"] .gov-infobar__content {
|
|
384
387
|
color: var(--gov-infobar-inverse-color, var(--gov-color-secondary-800));
|
|
385
|
-
}
|
|
386
|
-
@media (min-width: 75em) {
|
|
387
|
-
.gov-infobar__content {
|
|
388
|
-
padding-right: 2rem;
|
|
389
|
-
}
|
|
390
388
|
}
|
|
@@ -11,18 +11,18 @@ export class GovModal {
|
|
|
11
11
|
this.open = false;
|
|
12
12
|
this.blockClose = false;
|
|
13
13
|
this.label = undefined;
|
|
14
|
-
this.role =
|
|
15
|
-
this.labelTag =
|
|
14
|
+
this.role = 'dialog';
|
|
15
|
+
this.labelTag = 'h2';
|
|
16
16
|
this.wcagLabelledBy = undefined;
|
|
17
17
|
this.wcagDescribedBy = undefined;
|
|
18
|
-
this.wcagCloseLabel =
|
|
18
|
+
this.wcagCloseLabel = 'Zavřít okno';
|
|
19
19
|
this.wcagCloseLabelledBy = undefined;
|
|
20
20
|
this.h = govHost(this.host);
|
|
21
|
-
this.labelId = createID(
|
|
22
|
-
this.contentId = createID(
|
|
21
|
+
this.labelId = createID('GovModalLabel');
|
|
22
|
+
this.contentId = createID('GovModalContent');
|
|
23
23
|
}
|
|
24
24
|
validateLabelTag(newValue) {
|
|
25
|
-
const validTags = [
|
|
25
|
+
const validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
26
26
|
if (newValue) {
|
|
27
27
|
if (!validTags.includes(newValue)) {
|
|
28
28
|
govErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`);
|
|
@@ -56,7 +56,7 @@ export class GovModal {
|
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
58
|
const LabelTag = this.labelTag;
|
|
59
|
-
return (h(Host, { class: this.h.classes(ModalClass.root), open: this.open }, h("dialog", { class: ModalClass.dialog, hidden: !this.open, tabindex: "-1", open: this.open, "aria-modal": "true", "aria-hidden": toBoolAttr(!this.open), "aria-labelledby": this.wcagLabelledBy || this.labelId, "aria-describedby": this.wcagDescribedBy || this.contentId, role: this.role }, h("div", { class: ModalClass.inner }, h("div", { class: ModalClass.header }, this.h.hasSlot(
|
|
59
|
+
return (h(Host, { class: this.h.classes(ModalClass.root), open: this.open }, h("dialog", { class: ModalClass.dialog, hidden: !this.open, tabindex: "-1", open: this.open, "aria-modal": "true", "aria-hidden": toBoolAttr(!this.open), "aria-labelledby": this.wcagLabelledBy || this.labelId, "aria-describedby": this.wcagDescribedBy || this.contentId, role: this.role }, h("div", { class: ModalClass.inner }, h("div", { class: ModalClass.header }, this.h.hasSlot('icon') && (h("div", { class: ModalClass.icon }, h("slot", { name: "icon" }))), this.label && (h(LabelTag, { class: ModalClass.title, id: this.labelId }, this.label)), h("gov-button", { disabled: this.blockClose, class: ModalClass.close, variant: "primary", wcagLabel: this.wcagCloseLabel, wcagLabelledBy: this.wcagCloseLabelledBy, type: "base", "on-gov-click": this.onCloseHandler.bind(this) }, h("gov-icon", { name: "x-lg" }))), h("div", { class: ModalClass.content, id: this.contentId }, h("slot", null)), this.h.hasSlot('footer') && (h("div", { class: ModalClass.footer }, h("slot", { name: "footer" }))))), this.open ? (h("gov-backdrop", { "wcag-label": this.wcagCloseLabel, "wcag-labelled-by": this.wcagCloseLabelledBy, "on-gov-click": this.onCloseHandler.bind(this) })) : null));
|
|
60
60
|
}
|
|
61
61
|
onCloseHandler(e) {
|
|
62
62
|
e.stopPropagation();
|
|
@@ -81,8 +81,8 @@ export class GovModal {
|
|
|
81
81
|
* Validate the WCAG attributes of the component
|
|
82
82
|
*/
|
|
83
83
|
async validateWcag() {
|
|
84
|
-
validateWcagRef(this.wcagLabelledBy,
|
|
85
|
-
validateWcagRef(this.wcagDescribedBy,
|
|
84
|
+
validateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', ModalClass.root);
|
|
85
|
+
validateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root);
|
|
86
86
|
}
|
|
87
87
|
static get is() { return "gov-modal"; }
|
|
88
88
|
static get originalStyleUrls() {
|
|
@@ -172,7 +172,7 @@ export class GovModal {
|
|
|
172
172
|
},
|
|
173
173
|
"attribute": "role",
|
|
174
174
|
"reflect": false,
|
|
175
|
-
"defaultValue": "
|
|
175
|
+
"defaultValue": "'dialog'"
|
|
176
176
|
},
|
|
177
177
|
"labelTag": {
|
|
178
178
|
"type": "string",
|
|
@@ -190,7 +190,7 @@ export class GovModal {
|
|
|
190
190
|
},
|
|
191
191
|
"attribute": "label-tag",
|
|
192
192
|
"reflect": false,
|
|
193
|
-
"defaultValue": "
|
|
193
|
+
"defaultValue": "'h2'"
|
|
194
194
|
},
|
|
195
195
|
"wcagLabelledBy": {
|
|
196
196
|
"type": "string",
|
|
@@ -241,7 +241,8 @@ export class GovModal {
|
|
|
241
241
|
"text": "Adds accessible label for the modal close button that is only shown for screen readers."
|
|
242
242
|
},
|
|
243
243
|
"attribute": "wcag-close-label",
|
|
244
|
-
"reflect": false
|
|
244
|
+
"reflect": false,
|
|
245
|
+
"defaultValue": "'Zav\u0159\u00EDt okno'"
|
|
245
246
|
},
|
|
246
247
|
"wcagCloseLabelledBy": {
|
|
247
248
|
"type": "string",
|