@gov-design-system-ce/components 4.1.0-rc02 → 4.1.0-rc04
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 +2 -2
- package/dist/cjs/gov-accordion-item.cjs.entry.js +8 -5
- package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
- package/dist/cjs/gov-attachments_3.cjs.entry.js +6 -6
- package/dist/cjs/gov-attachments_3.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-backdrop.cjs.entry.js +4 -4
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +4 -4
- package/dist/cjs/gov-button.cjs.entry.js +6 -6
- package/dist/cjs/gov-card.cjs.entry.js +4 -4
- package/dist/cjs/gov-chip.cjs.entry.js +4 -4
- package/dist/cjs/gov-container.cjs.entry.js +2 -2
- package/dist/cjs/gov-control-group.cjs.entry.js +2 -2
- package/dist/cjs/gov-cookiebar.cjs.entry.js +2 -2
- package/dist/cjs/gov-dialog.cjs.entry.js +4 -4
- package/dist/cjs/gov-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/gov-empty.cjs.entry.js +2 -2
- package/dist/cjs/gov-error-code.cjs.entry.js +2 -2
- package/dist/cjs/gov-flex.cjs.entry.js +31 -0
- package/dist/cjs/gov-flex.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +3 -3
- package/dist/cjs/gov-form-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-control.cjs.entry.js +3 -3
- package/dist/cjs/gov-form-file.cjs.entry.js +8 -3
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-group.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-input_2.cjs.entry.js +6 -6
- package/dist/cjs/gov-form-label.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +7 -22
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-password-power.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-radio.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-search.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-select.cjs.entry.js +4 -4
- package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
- package/dist/cjs/gov-grid-item.cjs.entry.js +2 -2
- package/dist/cjs/gov-grid.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-layout-column.cjs.entry.js +2 -2
- package/dist/cjs/gov-layout.cjs.entry.js +2 -2
- package/dist/cjs/gov-lifecycle.cjs.entry.js +47 -0
- package/dist/cjs/gov-lifecycle.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-loading.cjs.entry.js +2 -2
- package/dist/cjs/gov-message.cjs.entry.js +2 -2
- package/dist/cjs/gov-pagination.cjs.entry.js +3 -3
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-spacer.cjs.entry.js +2 -2
- package/dist/cjs/gov-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/gov-stepper.cjs.entry.js +2 -2
- package/dist/cjs/gov-tabs-item.cjs.entry.js +3 -3
- package/dist/cjs/gov-tabs.cjs.entry.js +2 -2
- package/dist/cjs/gov-tag.cjs.entry.js +2 -2
- package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-theme-switch.cjs.entry.js +73 -0
- package/dist/cjs/gov-theme-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-tile.cjs.entry.js +2 -2
- package/dist/cjs/gov-tiles.cjs.entry.js +2 -2
- package/dist/cjs/gov-toast.cjs.entry.js +5 -6
- package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
- package/dist/cjs/gov-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/gov-wizard-item.cjs.entry.js +4 -4
- package/dist/cjs/gov-wizard.cjs.entry.js +4 -4
- package/dist/cjs/{index-1af4880c.js → index-7ff4447c.js} +20 -4
- package/dist/cjs/index-7ff4447c.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{string.utils-2335838f.js → string.utils-b84c81cf.js} +2 -1
- package/dist/cjs/string.utils-b84c81cf.js.map +1 -0
- package/dist/cjs/{wcag-31089f70.js → wcag-b8d80c7d.js} +2 -2
- package/dist/cjs/{wcag-31089f70.js.map → wcag-b8d80c7d.js.map} +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.js +8 -5
- package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.js +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments.js +1 -1
- package/dist/collection/components/gov-backdrop/gov-backdrop.js +1 -1
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
- package/dist/collection/components/gov-button/button/gov-button.js +3 -3
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.js +1 -1
- package/dist/collection/components/gov-card/gov-card.js +1 -1
- package/dist/collection/components/gov-chip/gov-chip.js +2 -2
- package/dist/collection/components/gov-container/gov-container.js +1 -1
- package/dist/collection/components/gov-control-group/gov-control-group.js +1 -1
- package/dist/collection/components/gov-cookiebar/gov-cookiebar.js +1 -1
- package/dist/collection/components/gov-dialog/gov-dialog.js +1 -1
- package/dist/collection/components/gov-dialog/gov-dialog.js.map +1 -1
- package/dist/collection/components/gov-empty/gov-empty.js +1 -1
- package/dist/collection/components/gov-error-code/gov-error-code.js +1 -1
- package/dist/collection/components/gov-flex/constants.js +4 -0
- package/dist/collection/components/gov-flex/constants.js.map +1 -0
- package/dist/collection/components/gov-flex/gov-flex.js +127 -0
- package/dist/collection/components/gov-flex/gov-flex.js.map +1 -0
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +1 -1
- package/dist/collection/components/gov-form/control/gov-form-control.js +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +6 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/group/gov-form-checkbox-group.js +1 -1
- package/dist/collection/components/gov-form/group/gov-form-group.js +1 -1
- package/dist/collection/components/gov-form/group/gov-form-radio-group.js +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.js +3 -3
- package/dist/collection/components/gov-form/label/gov-form-label.js +1 -1
- package/dist/collection/components/gov-form/message/gov-form-message.js +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +4 -28
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.js +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.js +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.js +2 -2
- package/dist/collection/components/gov-grid/gov-grid-item.js +1 -1
- package/dist/collection/components/gov-grid/gov-grid.js +1 -1
- package/dist/collection/components/gov-infobar/gov-infobar.js +2 -2
- package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
- package/dist/collection/components/gov-layout/gov-layout-column.js +1 -1
- package/dist/collection/components/gov-layout/gov-layout.js +1 -1
- package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js +39 -0
- package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js.map +1 -0
- package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -1
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +1 -1
- package/dist/collection/components/gov-message/gov-message.js +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
- package/dist/collection/components/gov-spacer/gov-spacer.js +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper-item.js +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper.js +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs-item.js +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
- package/dist/collection/components/gov-tag/gov-tag.js +1 -1
- package/dist/collection/components/gov-tag/gov-tag.js.map +1 -1
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js +1 -1
- package/dist/collection/components/gov-tile/container/gov-tiles.js +1 -1
- package/dist/collection/components/gov-tile/gov-tile.js +1 -1
- package/dist/collection/components/gov-toast/gov-toast.js +3 -4
- package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +2 -2
- package/dist/collection/components/gov-wizard/gov-wizard-item.js +2 -2
- package/dist/collection/components/gov-wizard/gov-wizard.js +1 -1
- package/dist/collection/pages/Forms.js +159 -159
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Grid.js +1 -1
- package/dist/collection/pages/Grid.js.map +1 -1
- package/dist/collection/pages/Spacer.js +1 -1
- package/dist/collection/pages/Spacer.js.map +1 -1
- package/dist/collection/pages/Tag.js +135 -160
- package/dist/collection/pages/Tag.js.map +1 -1
- package/dist/collection/pages/Wizard.js +1 -1
- package/dist/collection/pages/Wizard.js.map +1 -1
- package/dist/collection/utils/string.utils.js +1 -1
- package/dist/collection/utils/string.utils.js.map +1 -1
- 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-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-breadcrumbs.js.map +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-container.js +1 -1
- package/dist/components/gov-control-group.js +1 -1
- package/dist/components/gov-cookiebar.js +1 -1
- package/dist/components/gov-dialog.js +1 -1
- package/dist/components/gov-dialog.js.map +1 -1
- package/dist/components/gov-dropdown.js +1 -1
- package/dist/components/gov-dropdown.js.map +1 -1
- package/dist/components/gov-empty.js +1 -1
- package/dist/components/gov-error-code.js +1 -1
- package/dist/components/{gov-app.d.ts → gov-flex.d.ts} +4 -4
- package/dist/components/gov-flex.js +2 -0
- package/dist/components/gov-flex.js.map +1 -0
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox-group.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-control.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-group.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-label.js +1 -1
- package/dist/components/gov-form-message.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-password-power.js +1 -1
- package/dist/components/gov-form-password-power.js.map +1 -1
- package/dist/components/gov-form-radio-group.js +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-radio.js.map +1 -1
- package/dist/components/gov-form-search.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-grid-item.js +1 -1
- package/dist/components/gov-grid.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-infobar.js.map +1 -1
- package/dist/components/gov-layout-column.js +1 -1
- package/dist/components/gov-layout.js +1 -1
- package/dist/components/gov-lifecycle.d.ts +11 -0
- package/dist/components/gov-lifecycle.js +2 -0
- package/dist/components/gov-lifecycle.js.map +1 -0
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-loading.js.map +1 -1
- package/dist/components/gov-message.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-skeleton.js +1 -1
- package/dist/components/gov-spacer.js +1 -1
- package/dist/components/gov-stepper-item.js +1 -1
- package/dist/components/gov-stepper.js +1 -1
- package/dist/components/gov-tabs-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-tag.js.map +1 -1
- package/dist/components/gov-theme-switch.js +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-tiles.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-toast.js.map +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-tooltip-content.js.map +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-02da2aee.js +2 -0
- package/dist/components/{p-e9b35956.js.map → p-02da2aee.js.map} +1 -1
- package/dist/components/p-1d3019f3.js +2 -0
- package/dist/components/{p-e183a7c7.js → p-1f3bb41d.js} +2 -2
- package/dist/components/{p-6e19816b.js → p-23b7e680.js} +2 -2
- package/dist/components/{p-5caf1fe1.js → p-387052e1.js} +2 -2
- package/dist/components/{p-c9a15c52.js → p-3b807239.js} +2 -2
- package/dist/components/{p-ae3dada7.js → p-42200001.js} +3 -3
- package/dist/components/p-42200001.js.map +1 -0
- package/dist/components/{p-ff0cf148.js → p-5cc316bc.js} +2 -2
- package/dist/components/{p-e20bb5dc.js → p-6ea84137.js} +2 -2
- package/dist/components/p-820b66c0.js +2 -0
- package/dist/components/{p-fe1842da.js.map → p-820b66c0.js.map} +1 -1
- package/dist/components/p-880743a5.js.map +1 -1
- package/dist/components/{p-736e4917.js → p-bd22e21d.js} +2 -2
- package/dist/components/{p-2da35aa8.js → p-c211c3e1.js} +2 -2
- package/dist/components/{p-95d41a3b.js → p-cd6c2938.js} +2 -2
- package/dist/components/p-cd6c2938.js.map +1 -0
- package/dist/components/{p-9a93146e.js → p-dcee21ca.js} +2 -2
- package/dist/core/core.css +158 -29
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-0a24806a.entry.js +2 -0
- package/dist/core/{p-9d0f20ec.entry.js.map → p-0a24806a.entry.js.map} +1 -1
- package/dist/core/{p-9ff8f059.entry.js → p-0d2c4d31.entry.js} +2 -2
- package/dist/core/p-10f9bf55.entry.js +2 -0
- package/dist/core/{p-17015e36.entry.js.map → p-10f9bf55.entry.js.map} +1 -1
- package/dist/core/{p-0a952b3c.entry.js → p-12680890.entry.js} +2 -2
- package/dist/core/p-1600c1fb.entry.js +2 -0
- package/dist/core/p-18025823.entry.js +2 -0
- package/dist/core/p-18025823.entry.js.map +1 -0
- package/dist/core/p-18dbe177.entry.js +2 -0
- package/dist/core/p-18dbe177.entry.js.map +1 -0
- package/dist/core/{p-74e9ad9d.entry.js → p-1a550eee.entry.js} +2 -2
- package/dist/core/{p-9b41ac88.entry.js → p-1f1895c0.entry.js} +2 -2
- package/dist/core/p-1fdc2457.entry.js +2 -0
- package/dist/core/p-212759be.entry.js +2 -0
- package/dist/core/{p-db940455.entry.js.map → p-212759be.entry.js.map} +1 -1
- package/dist/core/p-215504c1.entry.js +2 -0
- package/dist/core/p-2c3ddc57.entry.js +2 -0
- package/dist/core/{p-83039b10.entry.js.map → p-2c3ddc57.entry.js.map} +1 -1
- package/dist/core/p-31e7d262.entry.js +2 -0
- package/dist/core/p-31e7d262.entry.js.map +1 -0
- package/dist/core/{p-b3acb156.entry.js → p-32bba4e7.entry.js} +2 -2
- package/dist/core/{p-fa7caad6.entry.js → p-378e0723.entry.js} +2 -2
- package/dist/core/{p-0ebc8365.entry.js → p-3844a27d.entry.js} +2 -2
- package/dist/core/p-4cb4de7b.entry.js +2 -0
- package/dist/core/{p-aa8adc45.entry.js.map → p-4cb4de7b.entry.js.map} +1 -1
- package/dist/core/p-56f9e026.entry.js +2 -0
- package/dist/core/p-57b0e670.entry.js +2 -0
- package/dist/core/{p-b55fc943.entry.js.map → p-57b0e670.entry.js.map} +1 -1
- package/dist/core/p-58dc3ec3.entry.js +2 -0
- package/dist/core/p-58dc3ec3.entry.js.map +1 -0
- package/dist/core/p-5ad3097c.entry.js +2 -0
- package/dist/core/{p-a5489b0e.entry.js.map → p-5ad3097c.entry.js.map} +1 -1
- package/dist/core/p-668ca722.entry.js +2 -0
- package/dist/core/{p-f1be099b.entry.js → p-67200095.entry.js} +2 -2
- package/dist/core/p-731fe7d8.entry.js +2 -0
- package/dist/core/{p-5c88f415.entry.js.map → p-731fe7d8.entry.js.map} +1 -1
- package/dist/core/p-7591976a.entry.js +2 -0
- package/dist/core/p-75ea368b.entry.js +2 -0
- package/dist/core/{p-ab9ae7ba.entry.js → p-7b48b1b8.entry.js} +2 -2
- package/dist/core/p-7de47344.entry.js +2 -0
- package/dist/core/p-7de47344.entry.js.map +1 -0
- package/dist/core/p-83aa4327.entry.js +2 -0
- package/dist/core/{p-28a7d3f7.js → p-842cb87f.js} +2 -2
- package/dist/core/{p-a1e95a5f.js → p-8506b611.js} +3 -3
- package/dist/core/p-8506b611.js.map +1 -0
- package/dist/core/p-880743a5.js.map +1 -1
- package/dist/core/p-89b69743.entry.js +2 -0
- package/dist/core/p-8a796fbe.entry.js +2 -0
- package/dist/core/p-8f10919c.entry.js +2 -0
- package/dist/core/{p-f456bd71.entry.js.map → p-8f10919c.entry.js.map} +1 -1
- package/dist/core/p-8fe36a5b.entry.js +2 -0
- package/dist/core/p-915e53ac.entry.js +2 -0
- package/dist/core/{p-47e364bb.entry.js.map → p-915e53ac.entry.js.map} +1 -1
- package/dist/core/p-92e13f9d.entry.js +2 -0
- package/dist/core/p-a274cdaa.entry.js +2 -0
- package/dist/core/p-a274cdaa.entry.js.map +1 -0
- package/dist/core/p-a9a095c2.entry.js +2 -0
- package/dist/core/p-a9a095c2.entry.js.map +1 -0
- package/dist/core/{p-81b0848c.entry.js → p-ab68c0b7.entry.js} +2 -2
- package/dist/core/p-b50ffab3.entry.js +2 -0
- package/dist/core/p-b70cc248.entry.js +2 -0
- package/dist/core/p-b822b9ff.entry.js +2 -0
- package/dist/core/p-c0a5a3f7.entry.js +2 -0
- package/dist/core/p-c5b5fd69.entry.js +2 -0
- package/dist/core/{p-6d772ff9.entry.js.map → p-c5b5fd69.entry.js.map} +1 -1
- package/dist/core/{p-95d41a3b.js → p-cd6c2938.js} +2 -2
- package/dist/core/p-cd6c2938.js.map +1 -0
- package/dist/core/{p-3f2b803c.entry.js → p-d1c4eb91.entry.js} +2 -2
- package/dist/core/{p-d2351924.entry.js → p-d3963396.entry.js} +2 -2
- package/dist/core/p-d4fbc249.entry.js +2 -0
- package/dist/core/{p-5dc0af54.entry.js.map → p-d4fbc249.entry.js.map} +1 -1
- package/dist/core/{p-fc90bf06.entry.js → p-d949aac7.entry.js} +2 -2
- package/dist/core/p-e6af4c58.entry.js +2 -0
- package/dist/core/p-ede7af0a.entry.js +2 -0
- package/dist/core/p-ede7af0a.entry.js.map +1 -0
- package/dist/core/p-eebc9e71.entry.js +2 -0
- package/dist/core/{p-2ed3afef.entry.js → p-eebf7ad8.entry.js} +2 -2
- package/dist/core/{p-dc3fab19.entry.js → p-f1c8a96b.entry.js} +2 -2
- package/dist/core/{p-dc3fab19.entry.js.map → p-f1c8a96b.entry.js.map} +1 -1
- package/dist/core/{p-35e66bef.entry.js → p-f963bb2f.entry.js} +2 -2
- package/dist/core/p-fb0df3a5.entry.js +2 -0
- package/dist/core/{p-7cf554e6.entry.js.map → p-fb0df3a5.entry.js.map} +1 -1
- package/dist/esm/core.js +3 -3
- package/dist/esm/gov-accordion-item.entry.js +8 -5
- package/dist/esm/gov-accordion-item.entry.js.map +1 -1
- package/dist/esm/gov-accordion.entry.js +1 -1
- package/dist/esm/gov-attachments_3.entry.js +6 -6
- package/dist/esm/gov-attachments_3.entry.js.map +1 -1
- package/dist/esm/gov-backdrop.entry.js +4 -4
- package/dist/esm/gov-breadcrumbs.entry.js +4 -4
- package/dist/esm/gov-button.entry.js +6 -6
- package/dist/esm/gov-card.entry.js +4 -4
- package/dist/esm/gov-chip.entry.js +4 -4
- package/dist/esm/gov-container.entry.js +2 -2
- package/dist/esm/gov-control-group.entry.js +2 -2
- package/dist/esm/gov-cookiebar.entry.js +2 -2
- package/dist/esm/gov-dialog.entry.js +4 -4
- package/dist/esm/gov-dialog.entry.js.map +1 -1
- package/dist/esm/gov-dropdown.entry.js +3 -3
- package/dist/esm/gov-empty.entry.js +2 -2
- package/dist/esm/gov-error-code.entry.js +2 -2
- package/dist/esm/gov-flex.entry.js +27 -0
- package/dist/esm/gov-flex.entry.js.map +1 -0
- package/dist/esm/gov-form-autocomplete.entry.js +3 -3
- package/dist/esm/gov-form-checkbox-group.entry.js +2 -2
- package/dist/esm/gov-form-checkbox.entry.js +2 -2
- package/dist/esm/gov-form-control.entry.js +3 -3
- package/dist/esm/gov-form-file.entry.js +8 -3
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-group.entry.js +2 -2
- package/dist/esm/gov-form-input_2.entry.js +6 -6
- package/dist/esm/gov-form-label.entry.js +2 -2
- package/dist/esm/gov-form-multi-select.entry.js +7 -22
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-password-power.entry.js +2 -2
- package/dist/esm/gov-form-radio-group.entry.js +2 -2
- package/dist/esm/gov-form-radio.entry.js +2 -2
- package/dist/esm/gov-form-search.entry.js +2 -2
- package/dist/esm/gov-form-select.entry.js +4 -4
- package/dist/esm/gov-form-switch.entry.js +2 -2
- package/dist/esm/gov-grid-item.entry.js +2 -2
- package/dist/esm/gov-grid.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-layout-column.entry.js +2 -2
- package/dist/esm/gov-layout.entry.js +2 -2
- package/dist/esm/gov-lifecycle.entry.js +43 -0
- package/dist/esm/gov-lifecycle.entry.js.map +1 -0
- package/dist/esm/gov-loading.entry.js +2 -2
- package/dist/esm/gov-message.entry.js +2 -2
- package/dist/esm/gov-pagination.entry.js +3 -3
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-spacer.entry.js +2 -2
- package/dist/esm/gov-stepper-item.entry.js +3 -3
- package/dist/esm/gov-stepper.entry.js +2 -2
- package/dist/esm/gov-tabs-item.entry.js +3 -3
- package/dist/esm/gov-tabs.entry.js +2 -2
- package/dist/esm/gov-tag.entry.js +2 -2
- package/dist/esm/gov-tag.entry.js.map +1 -1
- package/dist/esm/gov-theme-switch.entry.js +69 -0
- package/dist/esm/gov-theme-switch.entry.js.map +1 -0
- package/dist/esm/gov-tile.entry.js +2 -2
- package/dist/esm/gov-tiles.entry.js +2 -2
- package/dist/esm/gov-toast.entry.js +5 -6
- package/dist/esm/gov-toast.entry.js.map +1 -1
- package/dist/esm/gov-tooltip-content.entry.js +2 -2
- package/dist/esm/gov-tooltip.entry.js +4 -4
- package/dist/esm/gov-wizard-item.entry.js +4 -4
- package/dist/esm/gov-wizard.entry.js +4 -4
- package/dist/esm/{index-d8b4eb6c.js → index-c263e031.js} +20 -4
- package/dist/esm/index-c263e031.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{string.utils-5ce3f551.js → string.utils-1da8f8fb.js} +2 -2
- package/dist/esm/string.utils-1da8f8fb.js.map +1 -0
- package/dist/esm/{wcag-fa5ce56c.js → wcag-d7c6c252.js} +2 -2
- package/dist/esm/{wcag-fa5ce56c.js.map → wcag-d7c6c252.js.map} +1 -1
- package/dist/hydrate/index.js +277 -10021
- package/dist/hydrate/index.mjs +277 -10021
- package/dist/types/components/gov-accordion/gov-accordion-item.d.ts +1 -0
- package/dist/types/components/gov-flex/constants.d.ts +3 -0
- package/dist/types/components/gov-flex/gov-flex.d.ts +33 -0
- package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -0
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +0 -2
- package/dist/types/components/gov-lifecycle-tester/gov-lifecycle-tester.d.ts +14 -0
- package/dist/types/components.d.ts +74 -13
- package/dist/types/utils/string.utils.d.ts +1 -0
- package/package.json +2 -2
- package/dist/cjs/gov-app_2.cjs.entry.js +0 -9891
- package/dist/cjs/gov-app_2.cjs.entry.js.map +0 -1
- package/dist/cjs/index-1af4880c.js.map +0 -1
- package/dist/cjs/string.utils-2335838f.js.map +0 -1
- package/dist/collection/components/gov-app/gov-app.css +0 -68
- package/dist/collection/components/gov-app/gov-app.js +0 -93
- package/dist/collection/components/gov-app/gov-app.js.map +0 -1
- package/dist/components/gov-app.js +0 -2
- package/dist/components/gov-app.js.map +0 -1
- package/dist/components/p-95d41a3b.js.map +0 -1
- package/dist/components/p-ae3dada7.js.map +0 -1
- package/dist/components/p-ae7e6127.js +0 -2
- package/dist/components/p-e9b35956.js +0 -2
- package/dist/components/p-fe1842da.js +0 -2
- package/dist/core/p-006e52f1.entry.js +0 -2
- package/dist/core/p-023787b3.entry.js +0 -2
- package/dist/core/p-023787b3.entry.js.map +0 -1
- package/dist/core/p-17015e36.entry.js +0 -2
- package/dist/core/p-182189d2.entry.js +0 -2
- package/dist/core/p-2effdd60.entry.js +0 -2
- package/dist/core/p-2effdd60.entry.js.map +0 -1
- package/dist/core/p-477a5027.entry.js +0 -2
- package/dist/core/p-477a5027.entry.js.map +0 -1
- package/dist/core/p-47e364bb.entry.js +0 -2
- package/dist/core/p-5c88f415.entry.js +0 -2
- package/dist/core/p-5dc0af54.entry.js +0 -2
- package/dist/core/p-5dcbfca3.entry.js +0 -2
- package/dist/core/p-663d3db2.entry.js +0 -2
- package/dist/core/p-6b42a387.entry.js +0 -2
- package/dist/core/p-6d772ff9.entry.js +0 -2
- package/dist/core/p-6ed147a6.entry.js +0 -2
- package/dist/core/p-6ed147a6.entry.js.map +0 -1
- package/dist/core/p-7cf554e6.entry.js +0 -2
- package/dist/core/p-83039b10.entry.js +0 -2
- package/dist/core/p-904de5e6.entry.js +0 -2
- package/dist/core/p-91a9cd24.entry.js +0 -2
- package/dist/core/p-95d41a3b.js.map +0 -1
- package/dist/core/p-963f9fcd.entry.js +0 -2
- package/dist/core/p-9d0f20ec.entry.js +0 -2
- package/dist/core/p-9dde00d8.entry.js +0 -2
- package/dist/core/p-a1e95a5f.js.map +0 -1
- package/dist/core/p-a1ebb4da.entry.js +0 -2
- package/dist/core/p-a53a277a.entry.js +0 -2
- package/dist/core/p-a5489b0e.entry.js +0 -2
- package/dist/core/p-a54f1db9.entry.js +0 -2
- package/dist/core/p-aa8adc45.entry.js +0 -2
- package/dist/core/p-b55fc943.entry.js +0 -2
- package/dist/core/p-b838bb27.entry.js +0 -2
- package/dist/core/p-c214c202.entry.js +0 -2
- package/dist/core/p-c214c202.entry.js.map +0 -1
- package/dist/core/p-c4c7cb24.entry.js +0 -2
- package/dist/core/p-db940455.entry.js +0 -2
- package/dist/core/p-e134b123.entry.js +0 -2
- package/dist/core/p-e4978aab.entry.js +0 -2
- package/dist/core/p-edc05eff.entry.js +0 -2
- package/dist/core/p-edc05eff.entry.js.map +0 -1
- package/dist/core/p-eeb9cb73.entry.js +0 -2
- package/dist/core/p-f141ad5e.entry.js +0 -2
- package/dist/core/p-f456bd71.entry.js +0 -2
- package/dist/esm/gov-app_2.entry.js +0 -9886
- package/dist/esm/gov-app_2.entry.js.map +0 -1
- package/dist/esm/index-d8b4eb6c.js.map +0 -1
- package/dist/esm/string.utils-5ce3f551.js.map +0 -1
- package/dist/types/components/gov-app/gov-app.d.ts +0 -37
- /package/dist/components/{p-ae7e6127.js.map → p-1d3019f3.js.map} +0 -0
- /package/dist/components/{p-e183a7c7.js.map → p-1f3bb41d.js.map} +0 -0
- /package/dist/components/{p-6e19816b.js.map → p-23b7e680.js.map} +0 -0
- /package/dist/components/{p-5caf1fe1.js.map → p-387052e1.js.map} +0 -0
- /package/dist/components/{p-c9a15c52.js.map → p-3b807239.js.map} +0 -0
- /package/dist/components/{p-ff0cf148.js.map → p-5cc316bc.js.map} +0 -0
- /package/dist/components/{p-e20bb5dc.js.map → p-6ea84137.js.map} +0 -0
- /package/dist/components/{p-736e4917.js.map → p-bd22e21d.js.map} +0 -0
- /package/dist/components/{p-2da35aa8.js.map → p-c211c3e1.js.map} +0 -0
- /package/dist/components/{p-9a93146e.js.map → p-dcee21ca.js.map} +0 -0
- /package/dist/core/{p-9ff8f059.entry.js.map → p-0d2c4d31.entry.js.map} +0 -0
- /package/dist/core/{p-0a952b3c.entry.js.map → p-12680890.entry.js.map} +0 -0
- /package/dist/core/{p-e4978aab.entry.js.map → p-1600c1fb.entry.js.map} +0 -0
- /package/dist/core/{p-74e9ad9d.entry.js.map → p-1a550eee.entry.js.map} +0 -0
- /package/dist/core/{p-9b41ac88.entry.js.map → p-1f1895c0.entry.js.map} +0 -0
- /package/dist/core/{p-5dcbfca3.entry.js.map → p-1fdc2457.entry.js.map} +0 -0
- /package/dist/core/{p-f141ad5e.entry.js.map → p-215504c1.entry.js.map} +0 -0
- /package/dist/core/{p-b3acb156.entry.js.map → p-32bba4e7.entry.js.map} +0 -0
- /package/dist/core/{p-fa7caad6.entry.js.map → p-378e0723.entry.js.map} +0 -0
- /package/dist/core/{p-0ebc8365.entry.js.map → p-3844a27d.entry.js.map} +0 -0
- /package/dist/core/{p-182189d2.entry.js.map → p-56f9e026.entry.js.map} +0 -0
- /package/dist/core/{p-b838bb27.entry.js.map → p-668ca722.entry.js.map} +0 -0
- /package/dist/core/{p-f1be099b.entry.js.map → p-67200095.entry.js.map} +0 -0
- /package/dist/core/{p-6b42a387.entry.js.map → p-7591976a.entry.js.map} +0 -0
- /package/dist/core/{p-963f9fcd.entry.js.map → p-75ea368b.entry.js.map} +0 -0
- /package/dist/core/{p-ab9ae7ba.entry.js.map → p-7b48b1b8.entry.js.map} +0 -0
- /package/dist/core/{p-eeb9cb73.entry.js.map → p-83aa4327.entry.js.map} +0 -0
- /package/dist/core/{p-28a7d3f7.js.map → p-842cb87f.js.map} +0 -0
- /package/dist/core/{p-904de5e6.entry.js.map → p-89b69743.entry.js.map} +0 -0
- /package/dist/core/{p-e134b123.entry.js.map → p-8a796fbe.entry.js.map} +0 -0
- /package/dist/core/{p-663d3db2.entry.js.map → p-8fe36a5b.entry.js.map} +0 -0
- /package/dist/core/{p-a53a277a.entry.js.map → p-92e13f9d.entry.js.map} +0 -0
- /package/dist/core/{p-81b0848c.entry.js.map → p-ab68c0b7.entry.js.map} +0 -0
- /package/dist/core/{p-a54f1db9.entry.js.map → p-b50ffab3.entry.js.map} +0 -0
- /package/dist/core/{p-c4c7cb24.entry.js.map → p-b70cc248.entry.js.map} +0 -0
- /package/dist/core/{p-91a9cd24.entry.js.map → p-b822b9ff.entry.js.map} +0 -0
- /package/dist/core/{p-a1ebb4da.entry.js.map → p-c0a5a3f7.entry.js.map} +0 -0
- /package/dist/core/{p-3f2b803c.entry.js.map → p-d1c4eb91.entry.js.map} +0 -0
- /package/dist/core/{p-d2351924.entry.js.map → p-d3963396.entry.js.map} +0 -0
- /package/dist/core/{p-fc90bf06.entry.js.map → p-d949aac7.entry.js.map} +0 -0
- /package/dist/core/{p-006e52f1.entry.js.map → p-e6af4c58.entry.js.map} +0 -0
- /package/dist/core/{p-9dde00d8.entry.js.map → p-eebc9e71.entry.js.map} +0 -0
- /package/dist/core/{p-2ed3afef.entry.js.map → p-eebf7ad8.entry.js.map} +0 -0
- /package/dist/core/{p-35e66bef.entry.js.map → p-f963bb2f.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-820b66c0.js";const t=o;const c=s;export{t as GovAttachmentsItem,c as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-attachments-item.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-bd22e21d.js";const t=o;const d=s;export{t as GovAttachments,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-attachments.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-1f3bb41d.js";const t=o;const p=s;export{t as GovBackdrop,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-backdrop.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as e,H as s,c as t,h as i,d as a}from"./p-42200001.js";import{a as o}from"./p-dcee21ca.js";import{d as c}from"./p-7501abe8.js";import{g as l}from"./p-0075138f.js";import{t as n}from"./p-26618322.js";import{d as r}from"./p-6ea84137.js";import{d}from"./p-387052e1.js";const h={root:"gov-breadcrumbs"};const b=e(class e extends s{constructor(){super();this.__registerHost();this.govChange=t(this,"gov-change",7);this.inited=false;this.collapsible=false;this.isExpanded=false;this.accessibleLabel=undefined;this.accessibleLabelledBy=undefined;this.accessibleToggleLabel="Zobrazit či skrýt navigaci";this.expanded=false;this.toggleOption=false;this.h=l(this.host)}async componentDidRender(){this.scheduleContentVerification();if(c()){n((()=>this.validateAccessibility()))}}scheduleContentVerification(){if(this.inited)return;this.inited=true;n((()=>{this.calculateWidthOfItems();this.inited=false}))}calculateWidthOfItems(){const e=this.host.getBoundingClientRect().width;let s=0;this.host.querySelectorAll("li").forEach((e=>{s+=e.getBoundingClientRect().width}));this.toggleOption=s>e}render(){return i(a,{key:"81d7a8e273e1ce4740ee35ebe4a570ee8c5e73a4",class:this.h.classes(h.root),expanded:this.expanded},i("nav",{key:"dc37fa314f5d84c6c517f64229ef601b256f3ad5","aria-label":this.accessibleLabel,"aria-labelledby":this.accessibleLabelledBy},i("slot",{key:"4ead548352e642c0994360d74a98123782790a04"})),this.toggleOption?i("gov-button",{size:"xs",color:"primary",type:"base","aria-label":this.accessibleToggleLabel,"aria-pressed":this.expanded,"aria-expanded":this.expanded,"on-gov-click":()=>this.expanded=!this.expanded},i("gov-icon",{name:this.expanded?"chevron-up":"chevron-down"})):null)}async validateAccessibility(){o(this.accessibleLabel,this.accessibleLabelledBy,h.root,this.host);o(this.accessibleToggleLabel,undefined,h.root,this.host)}get host(){return this}},[4,"gov-breadcrumbs",{collapsible:[4],isExpanded:[4,"is-expanded"],accessibleLabel:[1,"accessible-label"],accessibleLabelledBy:[1,"accessible-labelledby"],accessibleToggleLabel:[1,"accessible-toggle-label"],expanded:[32],toggleOption:[32],validateAccessibility:[64]}]);function f(){if(typeof customElements==="undefined"){return}const e=["gov-breadcrumbs","gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-breadcrumbs":if(!customElements.get(e)){customElements.define(e,b)}break;case"gov-button":if(!customElements.get(e)){r()}break;case"gov-icon":if(!customElements.get(e)){d()}break}}))}f();const m=b;const p=f;export{m as GovBreadcrumbs,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-breadcrumbs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BreadcrumbsClass","root","GovBreadcrumbs","proxyCustomElement","H","constructor","this","inited","h","govHost","host","componentDidRender","scheduleContentVerification","canValidateWcagOnRender","tick","validateAccessibility","calculateWidthOfItems","hostWidth","getBoundingClientRect","width","sumOfWidths","querySelectorAll","forEach","li","toggleOption","render","Host","key","class","classes","expanded","accessibleLabel","accessibleLabelledBy","size","color","type","accessibleToggleLabel","name","validateAccessibleLabel","undefined"],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State} from '@stencil/core'\nimport {BreadcrumbsClass} from './constants'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {GovBreadcrumbsChangeEvent} from './gov-breadcrumbs.d'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n})\nexport class GovBreadcrumbs {\n\tprivate inited = false;\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines whether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by button\n\t */\n\t@Prop({attribute: 'is-expanded'}) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-label'}) readonly accessibleLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({attribute: 'accessible-labelledby'}) readonly accessibleLabelledBy: string\n\t/**\n\t * Adds an accessible label to display the full breadcrumb navigation that only screen readers can see.\n\t */\n\t@Prop({attribute: 'accessible-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit či skrýt navigaci'\n\t/**\n\t * Called when the Breadcrumbs state changes\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\n\n\t@State() expanded = false;\n\t@State() toggleOption = false;\n\n\tasync componentDidRender() {\n\t\tthis.scheduleContentVerification()\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\t}\n\n\tprivate scheduleContentVerification() {\n\t\tif (this.inited) return;\n\t\tthis.inited = true;\n\t\ttick(() => {\n\t\t\tthis.calculateWidthOfItems();\n\t\t\tthis.inited = false;\n\t\t});\n\t}\n\n\tprivate calculateWidthOfItems() {\n\t\tconst hostWidth = this.host.getBoundingClientRect().width;\n\t\tlet sumOfWidths = 0;\n\t\tthis.host.querySelectorAll('li').forEach((li) => {\n\t\t\tsumOfWidths += li.getBoundingClientRect().width\n\t\t})\n\t\tthis.toggleOption = sumOfWidths > hostWidth;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)} expanded={this.expanded}>\n\t\t\t\t<nav aria-label={this.accessibleLabel} aria-labelledby={this.accessibleLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t\t{this.toggleOption ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tsize={'xs'}\n\t\t\t\t\t\tcolor={'primary'}\n\t\t\t\t\t\ttype={'base'}\n\t\t\t\t\t\taria-label={this.accessibleToggleLabel}\n\t\t\t\t\t\taria-pressed={this.expanded}\n\t\t\t\t\t\taria-expanded={this.expanded}\n\t\t\t\t\t\ton-gov-click={() => this.expanded = !this.expanded}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon name={this.expanded ? 'chevron-up' : 'chevron-down'}></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleLabel, this.accessibleLabelledBy, BreadcrumbsClass.root, this.host)\n\t\tvalidateAccessibleLabel(this.accessibleToggleLabel, undefined, BreadcrumbsClass.root, this.host)\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["BreadcrumbsClass","root","GovBreadcrumbs","proxyCustomElement","H","constructor","this","inited","h","govHost","host","componentDidRender","scheduleContentVerification","canValidateWcagOnRender","tick","validateAccessibility","calculateWidthOfItems","hostWidth","getBoundingClientRect","width","sumOfWidths","querySelectorAll","forEach","li","toggleOption","render","Host","key","class","classes","expanded","accessibleLabel","accessibleLabelledBy","size","color","type","accessibleToggleLabel","name","validateAccessibleLabel","undefined"],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State} from '@stencil/core'\nimport {BreadcrumbsClass} from './constants'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {GovBreadcrumbsChangeEvent} from './gov-breadcrumbs.d'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n})\nexport class GovBreadcrumbs {\n\tprivate inited = false;\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines whether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by button\n\t */\n\t@Prop({attribute: 'is-expanded'}) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-label'}) readonly accessibleLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({attribute: 'accessible-labelledby'}) readonly accessibleLabelledBy: string\n\t/**\n\t * Adds an accessible label to display the full breadcrumb navigation that only screen readers can see.\n\t */\n\t@Prop({attribute: 'accessible-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit či skrýt navigaci'\n\t/**\n\t * Called when the Breadcrumbs state changes\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\n\n\t@State() expanded = false;\n\t@State() toggleOption = false;\n\n\tasync componentDidRender() {\n\t\tthis.scheduleContentVerification()\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\t}\n\n\tprivate scheduleContentVerification() {\n\t\tif (this.inited) return;\n\t\tthis.inited = true;\n\t\ttick(() => {\n\t\t\tthis.calculateWidthOfItems();\n\t\t\tthis.inited = false;\n\t\t});\n\t}\n\n\tprivate calculateWidthOfItems() {\n\t\tconst hostWidth = this.host.getBoundingClientRect().width;\n\t\tlet sumOfWidths = 0;\n\t\tthis.host.querySelectorAll('li').forEach((li) => {\n\t\t\tsumOfWidths += li.getBoundingClientRect().width\n\t\t})\n\t\tthis.toggleOption = sumOfWidths > hostWidth;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)} expanded={this.expanded}>\n\t\t\t\t<nav aria-label={this.accessibleLabel} aria-labelledby={this.accessibleLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t\t{this.toggleOption ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tsize={'xs'}\n\t\t\t\t\t\tcolor={'primary'}\n\t\t\t\t\t\ttype={'base'}\n\t\t\t\t\t\taria-label={this.accessibleToggleLabel}\n\t\t\t\t\t\taria-pressed={this.expanded}\n\t\t\t\t\t\taria-expanded={this.expanded}\n\t\t\t\t\t\ton-gov-click={() => this.expanded = !this.expanded}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon name={this.expanded ? 'chevron-up' : 'chevron-down'}></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleLabel, this.accessibleLabelledBy, BreadcrumbsClass.root, this.host)\n\t\tvalidateAccessibleLabel(this.accessibleToggleLabel, undefined, BreadcrumbsClass.root, this.host)\n\t}\n}\n"],"mappings":"mRAAO,MAAMA,EAAmB,CAC/BC,KAAM,mB,MCWMC,EAAcC,EAAA,MAAAD,UAAAE,EAI1B,WAAAC,G,oEAHQC,KAAAC,OAAS,M,iBAWuB,M,gBAIyB,M,8FAYsB,6B,cAMnE,M,kBACI,MA9BvBD,KAAKE,EAAIC,EAAQH,KAAKI,K,CAgCvB,wBAAMC,GACLL,KAAKM,8BACL,GAAIC,IAA2B,CAC9BC,GAAK,IAAMR,KAAKS,yB,EAIV,2BAAAH,GACP,GAAIN,KAAKC,OAAQ,OACjBD,KAAKC,OAAS,KACdO,GAAK,KACJR,KAAKU,wBACLV,KAAKC,OAAS,KAAK,G,CAIb,qBAAAS,GACP,MAAMC,EAAYX,KAAKI,KAAKQ,wBAAwBC,MACpD,IAAIC,EAAc,EAClBd,KAAKI,KAAKW,iBAAiB,MAAMC,SAASC,IACzCH,GAAeG,EAAGL,wBAAwBC,KAAK,IAEhDb,KAAKkB,aAAeJ,EAAcH,C,CAGnC,MAAAQ,GACC,OACCjB,EAACkB,EAAI,CAAAC,IAAA,2CAACC,MAAOtB,KAAKE,EAAEqB,QAAQ7B,EAAiBC,MAAO6B,SAAUxB,KAAKwB,UAClEtB,EAAA,OAAAmB,IAAA,wDAAiBrB,KAAKyB,gBAAe,kBAAmBzB,KAAK0B,sBAC5DxB,EAAA,QAAAmB,IAAA,8CAEArB,KAAKkB,aACLhB,EAAA,cACCyB,KAAM,KACNC,MAAO,UACPC,KAAM,OAAM,aACA7B,KAAK8B,sBAAqB,eACxB9B,KAAKwB,SAAQ,gBACZxB,KAAKwB,SAAQ,eACd,IAAMxB,KAAKwB,UAAYxB,KAAKwB,UAE1CtB,EAAA,YAAU6B,KAAM/B,KAAKwB,SAAW,aAAe,kBAE7C,K,CAUP,2BAAMf,GACLuB,EAAwBhC,KAAKyB,gBAAiBzB,KAAK0B,qBAAsBhC,EAAiBC,KAAMK,KAAKI,MACrG4B,EAAwBhC,KAAK8B,sBAAuBG,UAAWvC,EAAiBC,KAAMK,KAAKI,K","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-6ea84137.js";const t=o;const a=s;export{t as GovButton,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as
|
|
1
|
+
import{p as e,H as s,c as i,h as t,d as a}from"./p-42200001.js";import{g as c,b as d}from"./p-0075138f.js";import{c as o}from"./p-cd6c2938.js";import{a as n}from"./p-dcee21ca.js";import{d as r}from"./p-7501abe8.js";import{d as l}from"./p-e0e2e9c1.js";import{d as h}from"./p-387052e1.js";const f={root:"gov-card",header:"gov-card__header",title:"gov-card__title",inner:"gov-card__inner",img:"gov-card__img",main:"gov-card__main",icon:"gov-card__icon",btns:"gov-card__btns",footer:"gov-card__footer",arrow:"gov-card__arrow"};const b=e(class e extends s{constructor(){super();this.__registerHost();this.govToggle=i(this,"gov-toggle",7);this.hydrated=false;this.promotion=false;this.collapsible=false;this.open=true;this.accessibleTriggerLabel=undefined;this.accessibleTriggerLabelledBy=undefined;this.h=c(this.host);this.headlineId=o("GovCardHeadline");this.contentId=o("GovCardContent")}async componentDidRender(){if(r()){await l(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){return t(a,{key:"c7dd00e1eee01b7005b98b39ddfccf784dc2808e",class:this.h.classes(f.root),open:this.open,collapsible:d(this.collapsible),promotion:this.promotion,hydrated:this.hydrated},this.collapsible?t("button",{id:this.headlineId,class:f.header,"aria-label":this.accessibleTriggerLabel,"aria-labelledby":this.accessibleTriggerLabelledBy,"aria-expanded":d(this.open),"aria-controls":this.contentId,onClick:this.onClickHandler.bind(this)},t("slot",{name:"headline"}),t("gov-icon",{class:f.arrow,name:"chevron-down"})):this.h.hasSlot("headline")?t("div",{class:f.header},t("slot",{name:"headline"})):null,t("div",{key:"dae87fe02926ed1772c4164c19e7e6f540510bec",class:f.inner,id:this.contentId,"aria-hidden":this.collapsible?d(!this.open):undefined,hidden:this.collapsible?!this.open:undefined,"aria-labelledby":this.collapsible?this.headlineId:undefined},this.h.hasSlot("img")&&t("p",{key:"7ef4bcc939fa3d84fb1a6dedc0e62c0d2612f8ec",class:f.img},t("slot",{key:"4f05366b5bc0c2e6117ed8cfcb17cf107fec6499",name:"img"})),t("div",{key:"4a25ad0d3002079fa4a35b5f7af10a05e3f5b45f",class:f.main},this.h.hasSlot("icon")&&this.promotion&&t("div",{key:"6b16961ed892fed347a69d18d5482bccf0247f12",class:f.icon},t("slot",{key:"5720427d2bbea01f6d24911d4d208e743ec453ce",name:"icon"})),t("slot",{key:"6f2efa36533f9d06365ad828766cb7956daf7e90"}),this.h.hasSlot("btn")&&this.promotion&&t("div",{key:"5b79f8832d6cc39f709fb0d656eec383261971ce",class:f.btns},t("slot",{key:"93486120fcc840a0812325c881538d4174bedd84",name:"btn"}))),this.h.hasSlot("footer")&&t("div",{key:"efaa342aa2d43418b33492296c8b6c2928004af9",class:f.footer},t("slot",{key:"502c7c7609d28290e601ef6c71eb050f12380f8b",name:"footer"}))))}onClickHandler(e){e.stopPropagation();if(this.collapsible){this.open=!this.open;this.govToggle.emit({open:this.open,element:this.host})}}async validateAccessibility(){if(this.collapsible){n(this.accessibleTriggerLabel,this.accessibleTriggerLabelledBy,f.root,this.host)}}get host(){return this}},[4,"gov-card",{promotion:[4],collapsible:[4],open:[1540],accessibleTriggerLabel:[1,"accessible-label"],accessibleTriggerLabelledBy:[1,"accessible-labelledby"],validateAccessibility:[64]}]);function m(){if(typeof customElements==="undefined"){return}const e=["gov-card","gov-icon"];e.forEach((e=>{switch(e){case"gov-card":if(!customElements.get(e)){customElements.define(e,b)}break;case"gov-icon":if(!customElements.get(e)){h()}break}}))}m();const g=b;const p=m;export{g as GovCard,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-card.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as
|
|
1
|
+
import{G as c,d as o}from"./p-5cc316bc.js";const s=c;const t=o;export{s as GovChip,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-chip.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,h as s,d as o}from"./p-
|
|
1
|
+
import{p as t,H as e,h as s,d as o}from"./p-42200001.js";import{g as n,s as r}from"./p-0075138f.js";const c={root:"gov-container"};const i=t(class t extends e{constructor(){super();this.__registerHost();this.h=n(this.host)}render(){return s(o,{key:"0c61adb532c5810dedd0b43f21b5843bfc3d9c53",class:this.h.classes(c.root)},s("slot",{key:"df9ee5f718d72be4a2e1bbc4dd8ae6e9883c922f"}))}async slottedChildren(){return Promise.resolve(r(this.host))}get host(){return this}},[4,"gov-container",{slottedChildren:[64]}]);function d(){if(typeof customElements==="undefined"){return}const t=["gov-container"];t.forEach((t=>{switch(t){case"gov-container":if(!customElements.get(t)){customElements.define(t,i)}break}}))}d();const a=i;const f=d;export{a as GovContainer,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-container.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as t,h as e,d as r}from"./p-
|
|
1
|
+
import{p as o,H as t,h as e,d as r}from"./p-42200001.js";import{C as s}from"./p-e3aeaca0.js";import{g as c}from"./p-0075138f.js";import{v as n}from"./p-19c681a3.js";import{p as a}from"./p-e0e2e9c1.js";a(s,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);const i={root:"gov-control-group"};const l=o(class o extends t{constructor(){super();this.__registerHost();this.color=s.PRIMARY;this.noBorder=false;this.fitContent=false;this.h=c(this.host)}validateColor(o){n(s,o,i.root)}render(){return e(r,{key:"e2a56a633370dd4172c9d0895b51b7138d0a19a0",class:this.h.classes(i.root),color:this.color},e("slot",{key:"76d02cd85f4207a4e2f5a198e36d6ff53ee77e28"}))}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-control-group",{color:[1],noBorder:[4,"no-border"],fitContent:[4,"fit-content"]},undefined,{color:["validateColor"]}]);function f(){if(typeof customElements==="undefined"){return}const o=["gov-control-group"];o.forEach((o=>{switch(o){case"gov-control-group":if(!customElements.get(o)){customElements.define(o,l)}break}}))}f();const d=l;const p=f;export{d as GovControlGroup,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-control-group.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as e,H as c,h as o,d as a}from"./p-42200001.js";import{g as s}from"./p-0075138f.js";const t={root:"gov-cookiebar",content:"gov-cookiebar__content",actions:"gov-cookiebar__actions",actionsPrimary:"gov-cookiebar__actions--primary",actionsSecondary:"gov-cookiebar__actions--secondary"};const i=e(class e extends c{constructor(){super();this.__registerHost();this.h=s(this.host)}render(){return o(a,{key:"1955ae868b0e5255aea8ebc8e26146c4d973a75b",class:this.h.classes(t.root)},o("div",{key:"cec7976304269a18f2fd71ffb0e398c60e17c4d5",class:t.content},o("slot",{key:"f311694262ff0297c86ae435874f2108621bb7dc",name:"headline"}),o("slot",{key:"7ea9f4b7e848bf3afa2039f5ec4ab14ce2573243"})),(this.h.hasSlot("actions-primary")||this.h.hasSlot("actions-secondary"))&&o("div",{key:"9230c752f5fa798d7784406dc6d114c159c8aa6e",class:t.actions},this.h.hasSlot("actions-primary")&&o("div",{key:"324e807bcc4e867f6561723edbe4028bb484297f",class:t.actionsPrimary},o("slot",{key:"bf945e0d01c7497cd8575b01fd9be172968179cd",name:"actions-primary"})),this.h.hasSlot("actions-secondary")&&o("div",{key:"8d836b11f057ec6840aa7ba62900dde267e9bdad",class:t.actionsSecondary},o("slot",{key:"8b9144381a5e6b54017bd6fb6ffc9c56437b62d0",name:"actions-secondary"}))))}get host(){return this}},[4,"gov-cookiebar"]);function n(){if(typeof customElements==="undefined"){return}const e=["gov-cookiebar"];e.forEach((e=>{switch(e){case"gov-cookiebar":if(!customElements.get(e)){customElements.define(e,i)}break}}))}n();const r=i;const d=n;export{r as GovCookiebar,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-cookiebar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as
|
|
1
|
+
import{p as e,H as s,c as i,h as a,d as t}from"./p-42200001.js";import{g as o,a as c,c as l}from"./p-0075138f.js";import{d}from"./p-7501abe8.js";import{b}from"./p-dcee21ca.js";import{c as n}from"./p-cd6c2938.js";import{t as h}from"./p-26618322.js";import{d as r}from"./p-1f3bb41d.js";import{d as f}from"./p-6ea84137.js";import{d as g}from"./p-387052e1.js";const m={root:"gov-dialog",dialog:"gov-dialog__dialog",inner:"gov-dialog__inner",header:"gov-dialog__header",title:"gov-dialog__title",content:"gov-dialog__content",close:"gov-dialog__close",footer:"gov-dialog__footer",bodyFix:"body-fixed"};const p=e(class e extends s{constructor(){super();this.__registerHost();this.govClose=i(this,"gov-close",7);this.hydrated=false;this.open=false;this.blockClose=false;this.blockBackdropClose=false;this.role="dialog";this.labelTag="h2";this.accessibleLabelledBy=undefined;this.accessibleDescribedBy=undefined;this.accessibleCloseLabel="Zavřít okno";this.accessibleCloseLabelledBy=undefined;this.h=o(this.host);this.labelId=n("GovDialogLabel");this.contentId=n("GovDialogContent")}watchOpen(e){this.open=e;this.setFocus().finally()}showDialog(){this.open=true;document.body.classList.add(m.bodyFix)}hideDialog(){this.open=false;document.body.classList.remove(m.bodyFix)}async componentDidRender(){if(d()){h((()=>this.validateAccessibility()))}if(this.open){this.showDialog()}else{this.hideDialog()}}connectedCallback(){this.hydrated=true}disconnectedCallback(){document.body.classList.remove(m.bodyFix)}render(){return a(t,{key:"fe34cd83c969ab539a47c4f851231085f34b21f6",class:this.h.classes(m.root),open:this.open,hydrated:this.hydrated},a("dialog",{key:"d013f87f499635ed0d0f1cc016cc1e84410154b4",class:m.dialog,hidden:!this.open,tabindex:c(this.open),open:this.open,"aria-modal":"true","aria-hidden":l(!this.open),"aria-labelledby":this.accessibleLabelledBy||this.labelId,"aria-describedby":this.accessibleDescribedBy||this.contentId,role:this.role},a("div",{key:"6018f61d5a335583dc05a0f8cdef6c4562977558",class:m.inner},a("div",{key:"9ab56eb94d92f67291b783ec8310fec2c3da9d33",class:m.header},a("slot",{key:"b2248113ca181acbd9e0c960c4e7b13c3e114ae3",name:"icon"}),this.h.hasSlot("title")&&a("span",{key:"fce7d93f476553e3cc53c8dc987d65cb64538552",class:m.title,id:this.labelId},a("slot",{key:"b151367fda2f5f87d6de3cabbf46cacc9d427f0f",name:"title"})),a("gov-button",{key:"e3622dc8601452c2d52a5d17a611d27cd0d17e97",ref:e=>this.closeCtaRef=e,disabled:this.blockClose,class:m.close,color:"primary","aria-label":this.accessibleCloseLabel,"aria-labelledby":this.accessibleCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},a("gov-icon",{key:"0e69007580b5780ccd5a85984149a21218845ef1",slot:"left-icon",name:"x-lg"}))),a("div",{key:"7183e62b1d751e8aa8101c8665470ae4677d16f9",class:m.content,id:this.contentId},a("slot",{key:"9adebaeb5be26f67d1d8078636a5bfc7d29ba4db"})),this.h.hasSlot("footer")&&a("div",{key:"37332d00f9951e5f14dad617e49167d5429d9572",class:m.footer},a("slot",{key:"d56ee64f624b01e30345c44f0bbe932fb59624f6",name:"footer"})))),this.open?a("gov-backdrop",{disabled:this.blockBackdropClose,"aria-label":this.accessibleCloseLabel,"aria-labelled-by":this.accessibleCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(e){e.stopPropagation();e.preventDefault();if(this.blockClose===false){this.hideDialog();this.govClose.emit(e)}}async setFocus(){if(this.open&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}async validateAccessibility(){b(this.accessibleLabelledBy,"accessible-labelled-by",m.root);b(this.accessibleDescribedBy,"accessible-described-by",m.root)}get host(){return this}static get watchers(){return{open:["watchOpen"]}}},[4,"gov-dialog",{open:[1540],blockClose:[4,"block-close"],blockBackdropClose:[4,"block-backdrop-close"],role:[1],labelTag:[1,"label-tag"],accessibleLabelledBy:[1,"accessible-labelled-by"],accessibleDescribedBy:[1,"accessible-described-by"],accessibleCloseLabel:[1,"accessible-close-label"],accessibleCloseLabelledBy:[1,"accessible-close-labelled-by"],setFocus:[64],validateAccessibility:[64]},undefined,{open:["watchOpen"]}]);function y(){if(typeof customElements==="undefined"){return}const e=["gov-dialog","gov-backdrop","gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-dialog":if(!customElements.get(e)){customElements.define(e,p)}break;case"gov-backdrop":if(!customElements.get(e)){r()}break;case"gov-button":if(!customElements.get(e)){f()}break;case"gov-icon":if(!customElements.get(e)){g()}break}}))}y();const v=p;const k=y;export{v as GovDialog,k as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DialogClass","root","dialog","inner","header","title","content","close","footer","bodyFix","GovDialog","proxyCustomElement","H","constructor","this","hydrated","h","govHost","host","labelId","createID","contentId","watchOpen","newValue","open","setFocus","finally","showDialog","document","body","classList","add","hideDialog","remove","componentDidRender","canValidateWcagOnRender","tick","validateAccessibility","connectedCallback","disconnectedCallback","render","Host","key","class","classes","hidden","tabindex","boolToFocusValue","toBoolAttr","accessibleLabelledBy","accessibleDescribedBy","role","name","hasSlot","id","ref","el","closeCtaRef","disabled","blockClose","color","accessibleCloseLabel","accessibleCloseLabelledBy","type","onCloseHandler","bind","slot","blockBackdropClose","e","stopPropagation","preventDefault","govClose","emit","catch","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-dialog/constants.ts","../../../packages/core/src/components/gov-dialog/gov-dialog.tsx"],"sourcesContent":["export const DialogClass = {\n\troot: 'gov-dialog',\n\tdialog: 'gov-dialog__dialog',\n\tinner: 'gov-dialog__inner',\n\theader: 'gov-dialog__header',\n\ttitle: 'gov-dialog__title',\n\tcontent: 'gov-dialog__content',\n\tclose: 'gov-dialog__close',\n\tfooter: 'gov-dialog__footer',\n\tbodyFix: 'body-fixed',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {boolToFocusValue, govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {DialogClass} from './constants'\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-dialog',\n})\nexport class GovDialog {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate hydrated = false;\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovDialogLabel')\n\t\tthis.contentId = createID('GovDialogContent')\n\t}\n\n\t@Element() host: HTMLGovDialogElement\n\n\t/**\n\t * Attribute for dialog window display\n\t */\n\t@Prop({mutable: true, reflect: true}) open = false\n\t/**\n\t * Attribute allowing blocking the dialog closing\n\t */\n\t@Prop({attribute: 'block-close'}) blockClose = false\n\t/**\n\t * Attribute allowing blocking the backdrop dialog closing\n\t */\n\t@Prop({attribute: 'block-backdrop-close'}) blockBackdropClose = false\n\t/**\n\t * Role of dialog\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the dialog label for correct semantic structure\n\t */\n\t@Prop({attribute: 'label-tag'}) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({attribute: 'accessible-labelled-by'}) accessibleLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the dialog.\n\t */\n\t@Prop({attribute: 'accessible-described-by'}) accessibleDescribedBy: string\n\t/**\n\t * Adds accessible label for the dialog close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the dialog window\n\t */\n\t@Prop({attribute: 'accessible-close-labelled-by'}) accessibleCloseLabelledBy: string\n\t/**\n\t * Emitted when dialog window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tthis.setFocus().finally()\n\t}\n\n\tprivate showDialog() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(DialogClass.bodyFix)\n\t}\n\n\tprivate hideDialog() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(DialogClass.bodyFix)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\n\t\tif (this.open) {\n\t\t\tthis.showDialog()\n\t\t} else {\n\t\t\tthis.hideDialog()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tdocument.body.classList.remove(DialogClass.bodyFix)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(DialogClass.root)} open={this.open} hydrated={this.hydrated}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={DialogClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex={boolToFocusValue(this.open)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.accessibleLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.accessibleDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={DialogClass.inner}>\n\t\t\t\t\t\t<div class={DialogClass.header}>\n\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t{this.h.hasSlot('title') && (\n\t\t\t\t\t\t\t\t<span class={DialogClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tref={el => (this.closeCtaRef = el)}\n\t\t\t\t\t\t\t\tdisabled={this.blockClose}\n\t\t\t\t\t\t\t\tclass={DialogClass.close}\n\t\t\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["DialogClass","root","dialog","inner","header","title","content","close","footer","bodyFix","GovDialog","proxyCustomElement","H","constructor","this","hydrated","h","govHost","host","labelId","createID","contentId","watchOpen","newValue","open","setFocus","finally","showDialog","document","body","classList","add","hideDialog","remove","componentDidRender","canValidateWcagOnRender","tick","validateAccessibility","connectedCallback","disconnectedCallback","render","Host","key","class","classes","hidden","tabindex","boolToFocusValue","toBoolAttr","accessibleLabelledBy","accessibleDescribedBy","role","name","hasSlot","id","ref","el","closeCtaRef","disabled","blockClose","color","accessibleCloseLabel","accessibleCloseLabelledBy","type","onCloseHandler","bind","slot","blockBackdropClose","e","stopPropagation","preventDefault","govClose","emit","catch","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-dialog/constants.ts","../../../packages/core/src/components/gov-dialog/gov-dialog.tsx"],"sourcesContent":["export const DialogClass = {\n\troot: 'gov-dialog',\n\tdialog: 'gov-dialog__dialog',\n\tinner: 'gov-dialog__inner',\n\theader: 'gov-dialog__header',\n\ttitle: 'gov-dialog__title',\n\tcontent: 'gov-dialog__content',\n\tclose: 'gov-dialog__close',\n\tfooter: 'gov-dialog__footer',\n\tbodyFix: 'body-fixed',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {boolToFocusValue, govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {DialogClass} from './constants'\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-dialog',\n})\nexport class GovDialog {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate hydrated = false;\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovDialogLabel')\n\t\tthis.contentId = createID('GovDialogContent')\n\t}\n\n\t@Element() host: HTMLGovDialogElement\n\n\t/**\n\t * Attribute for dialog window display\n\t */\n\t@Prop({mutable: true, reflect: true}) open = false\n\t/**\n\t * Attribute allowing blocking the dialog closing\n\t */\n\t@Prop({attribute: 'block-close'}) blockClose = false\n\t/**\n\t * Attribute allowing blocking the backdrop dialog closing\n\t */\n\t@Prop({attribute: 'block-backdrop-close'}) blockBackdropClose = false\n\t/**\n\t * Role of dialog\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the dialog label for correct semantic structure\n\t */\n\t@Prop({attribute: 'label-tag'}) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({attribute: 'accessible-labelled-by'}) accessibleLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the dialog.\n\t */\n\t@Prop({attribute: 'accessible-described-by'}) accessibleDescribedBy: string\n\t/**\n\t * Adds accessible label for the dialog close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the dialog window\n\t */\n\t@Prop({attribute: 'accessible-close-labelled-by'}) accessibleCloseLabelledBy: string\n\t/**\n\t * Emitted when dialog window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tthis.setFocus().finally()\n\t}\n\n\tprivate showDialog() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(DialogClass.bodyFix)\n\t}\n\n\tprivate hideDialog() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(DialogClass.bodyFix)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\n\t\tif (this.open) {\n\t\t\tthis.showDialog()\n\t\t} else {\n\t\t\tthis.hideDialog()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tdocument.body.classList.remove(DialogClass.bodyFix)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(DialogClass.root)} open={this.open} hydrated={this.hydrated}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={DialogClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex={boolToFocusValue(this.open)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.accessibleLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.accessibleDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={DialogClass.inner}>\n\t\t\t\t\t\t<div class={DialogClass.header}>\n\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t{this.h.hasSlot('title') && (\n\t\t\t\t\t\t\t\t<span class={DialogClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tref={el => (this.closeCtaRef = el)}\n\t\t\t\t\t\t\t\tdisabled={this.blockClose}\n\t\t\t\t\t\t\t\tclass={DialogClass.close}\n\t\t\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\t\t\taria-labelledby={this.accessibleCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon slot=\"left-icon\" name=\"x-lg\"/>\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={DialogClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{this.h.hasSlot('footer') && (\n\t\t\t\t\t\t\t<div class={DialogClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\"/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop\n\t\t\t\t\t\tdisabled={this.blockBackdropClose}\n\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\taria-labelled-by={this.accessibleCloseLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tif (this.blockClose === false) {\n\t\t\tthis.hideDialog()\n\t\t\tthis.govClose.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Sets the close button to focus\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tif (this.open && this.closeCtaRef) {\n\t\t\tthis.closeCtaRef.setFocus().catch()\n\t\t}\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateWcagRef(this.accessibleLabelledBy, 'accessible-labelled-by', DialogClass.root)\n\t\tvalidateWcagRef(this.accessibleDescribedBy, 'accessible-described-by', DialogClass.root)\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as i,h as s,d as o}from"./p-
|
|
1
|
+
import{p as t,H as e,c as i,h as s,d as o}from"./p-42200001.js";import"./p-bfce6f99.js";import{g as n,c as r}from"./p-0075138f.js";import{c}from"./p-cd6c2938.js";import{B as a}from"./p-08621bdf.js";const h={triggerEvents:"click",exclude:""};function d(t,e,i,s=h){const o=u(s);l(s).forEach((s=>{window.addEventListener(s,(s=>{f(s,t,e,i,o)}),false)}))}function f(t,e,i,s,o){const n=t.target;if(!i.contains(n)&&!p(n,o)){s.call(e)}}function l(t){if(t.triggerEvents){return t.triggerEvents.split(",").map((t=>t.trim()))}return["click"]}function u(t){if(t.exclude){try{return Array.from(document.querySelectorAll(t.exclude))}catch(e){console.warn(`@ClickOutside: Exclude: '${t.exclude}' will not be evaluated. Check your exclude selector syntax.`,e)}}return}function p(t,e){if(t&&e){for(let i of e){if(i.contains(t)){return true}}}return false}var g;(function(t){t["LEFT"]="left";t["RIGHT"]="right"})(g||(g={}));const m={root:"gov-dropdown",list:"gov-dropdown__list"};const v=t(class t extends e{constructor(){super();this.__registerHost();this.govChange=i(this,"gov-change",7);this.identifier=undefined;this.open=false;this.position=g.LEFT;this.h=n(this.host);this.listId=c("GovDropdownList");this.controlId=c("GovDropdownControl")}watchOpen(){var t;(t=this.trigger)===null||t===void 0?void 0:t.setAttribute("aria-expanded",r(this.open))}get trigger(){return this.host.querySelector(`* > ${a.root}`)}get list(){return this.h.getSlot("list")}componentWillLoad(){var t;if(!this.trigger)return;this.trigger.setAttribute("aria-controls",this.listId);this.trigger.setAttribute("aria-haspopup",r(!!this.list));this.trigger.setAttribute("aria-expanded",r(this.open));this.trigger.setAttribute("identifier",(t=this.identifier)!==null&&t!==void 0?t:this.controlId);this.trigger.addEventListener("gov-click",(t=>{t.preventDefault();t.stopPropagation();this.open=!this.open;this.govChange.emit({component:m.root,originalEvent:t,open:this.open})}))}render(){return s(o,{key:"43c2a03dcb27ebe54f8dd00ca1120b848cac957c",class:this.h.classes([m.root]),open:this.open,position:this.position},s("slot",{key:"732c956fe37283578a95c843cf94ad590cd16402"}),s("div",{key:"c3934a0f7c8303950a5c7898574fcea2e14e1890",ref:t=>d(this,t,(()=>this.open=false)),class:m.list,id:this.listId,"aria-labelledby":this.controlId,"aria-hidden":r(!this.open),hidden:!this.open},s("slot",{key:"cb685039c57f9d32ae7c238fcb7457fe72b4c9c4",name:"list"})))}async getState(){return this.open}async toggle(){this.open=!this.open}get host(){return this}static get watchers(){return{open:["watchOpen"]}}},[4,"gov-dropdown",{identifier:[1],open:[1028],position:[1],getState:[64],toggle:[64]},undefined,{open:["watchOpen"]}]);function w(){if(typeof customElements==="undefined"){return}const t=["gov-dropdown"];t.forEach((t=>{switch(t){case"gov-dropdown":if(!customElements.get(t)){customElements.define(t,v)}break}}))}w();const b=v;const y=w;export{b as GovDropdown,y as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ClickOutsideOptionsDefaults","triggerEvents","exclude","registerClickOutside","component","element","callback","opt","excludedNodes","getExcludedNodes","getTriggerEvents","forEach","triggerEvent","window","addEventListener","e","initClickOutside","event","target","contains","isExcluded","call","split","map","trim","Array","from","document","querySelectorAll","err","console","warn","excudedNodes","excludedNode","Position","DropdownClass","root","list","GovDropdown","proxyCustomElement","H","constructor","LEFT","this","h","govHost","host","listId","createID","controlId","watchOpen","_a","trigger","setAttribute","toBoolAttr","open","querySelector","ButtonClass","getSlot","componentWillLoad","identifier","preventDefault","stopPropagation","govChange","emit","originalEvent","render","Host","key","class","classes","position","ref","el","id","hidden","name","getState","toggle"],"sources":["../../../node_modules/stencil-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from \"@stencil/core\"\nimport {registerClickOutside} from \"stencil-click-outside\"\nimport {govHost, toBoolAttr} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {Nullable} from \"../../../types/interfaces\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {ButtonClass} from \"../button/constants\"\nimport {DropdownClass, Position, PositionType} from \"./constants\"\nimport {DropdownEvent} from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Custom trigger identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Dropdown state\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<DropdownEvent>\n\n\t@Watch('open')\n\twatchOpen() {\n\t\tthis.trigger?.setAttribute(\"aria-expanded\", toBoolAttr(this.open))\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\tcomponentWillLoad() {\n\t\tif (!this.trigger) return;\n\n\t\tthis.trigger.setAttribute(\"aria-controls\", this.listId)\n\t\tthis.trigger.setAttribute(\"aria-haspopup\", toBoolAttr(!!this.list))\n\t\tthis.trigger.setAttribute(\"aria-expanded\", toBoolAttr(this.open))\n\t\tthis.trigger.setAttribute(\"identifier\", this.identifier ?? this.controlId)\n\n\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\t\t\tthis.open = !this.open\n\n\t\t\tthis.govChange.emit({\n\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\topen: this.open,\n\t\t\t})\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Toggle state of dropdown\n\t */\n\t@Method()\n\tasync toggle() {\n\t\tthis.open = !this.open\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ClickOutsideOptionsDefaults","triggerEvents","exclude","registerClickOutside","component","element","callback","opt","excludedNodes","getExcludedNodes","getTriggerEvents","forEach","triggerEvent","window","addEventListener","e","initClickOutside","event","target","contains","isExcluded","call","split","map","trim","Array","from","document","querySelectorAll","err","console","warn","excudedNodes","excludedNode","Position","DropdownClass","root","list","GovDropdown","proxyCustomElement","H","constructor","LEFT","this","h","govHost","host","listId","createID","controlId","watchOpen","_a","trigger","setAttribute","toBoolAttr","open","querySelector","ButtonClass","getSlot","componentWillLoad","identifier","preventDefault","stopPropagation","govChange","emit","originalEvent","render","Host","key","class","classes","position","ref","el","id","hidden","name","getState","toggle"],"sources":["../../../node_modules/stencil-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from \"@stencil/core\"\nimport {registerClickOutside} from \"stencil-click-outside\"\nimport {govHost, toBoolAttr} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {Nullable} from \"../../../types/interfaces\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {ButtonClass} from \"../button/constants\"\nimport {DropdownClass, Position, PositionType} from \"./constants\"\nimport {DropdownEvent} from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Custom trigger identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Dropdown state\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<DropdownEvent>\n\n\t@Watch('open')\n\twatchOpen() {\n\t\tthis.trigger?.setAttribute(\"aria-expanded\", toBoolAttr(this.open))\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\tcomponentWillLoad() {\n\t\tif (!this.trigger) return;\n\n\t\tthis.trigger.setAttribute(\"aria-controls\", this.listId)\n\t\tthis.trigger.setAttribute(\"aria-haspopup\", toBoolAttr(!!this.list))\n\t\tthis.trigger.setAttribute(\"aria-expanded\", toBoolAttr(this.open))\n\t\tthis.trigger.setAttribute(\"identifier\", this.identifier ?? this.controlId)\n\n\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\te.preventDefault()\n\t\t\te.stopPropagation()\n\t\t\tthis.open = !this.open\n\n\t\t\tthis.govChange.emit({\n\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\topen: this.open,\n\t\t\t})\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Toggle state of dropdown\n\t */\n\t@Method()\n\tasync toggle() {\n\t\tthis.open = !this.open\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,h as s,d as
|
|
1
|
+
import{p as e,H as t,h as s,d as a}from"./p-42200001.js";import{p as o}from"./p-e0e2e9c1.js";import{S as c}from"./p-92f420cb.js";import{g as i}from"./p-0075138f.js";import{v as n}from"./p-19c681a3.js";import{A as f,a as r}from"./p-d4509899.js";o(c,["_S","_M","_L"]);const m={root:"gov-empty",content:"gov-empty__content"};const d=e(class e extends t{constructor(){super();this.__registerHost();this.size="m";this.h=i(this.host)}validateSize(e){n(r,e,f.root)}componentWillLoad(){this.validateSize(this.size)}render(){return s(a,{key:"25d3813acc796b96c6e51aec4a55fc2efa725aa6",class:this.h.classes(m.root),size:this.size},this.h.hasSlot("icon")&&s("slot",{key:"7fccad0fe25b57219f06cfbcf18a2f2bff19c905",name:"icon"}),s("div",{key:"a4cffd5e7175ba9273a5ea74ba622e2a577ba0fe",class:m.content},s("slot",{key:"53fd435d43baa4841ecb5e3d5817efcb57433eab",name:"headline"}),s("slot",{key:"314e7a0fd7a381dbc4a85da4df2082ce4946b7b5"})))}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-empty",{size:[1]},undefined,{size:["validateSize"]}]);function p(){if(typeof customElements==="undefined"){return}const e=["gov-empty"];e.forEach((e=>{switch(e){case"gov-empty":if(!customElements.get(e)){customElements.define(e,d)}break}}))}p();const b=d;const l=p;export{b as GovEmpty,l as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-empty.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as o,h as
|
|
1
|
+
import{p as e,H as o,h as t,d as c}from"./p-42200001.js";import{g as s}from"./p-0075138f.js";const r={root:"gov-error-code",content:"gov-error-code__content"};const n=e(class e extends o{constructor(){super();this.__registerHost();this.h=s(this.host)}render(){return t(c,{key:"90ebeeb8f2e7ed539e7069a876aa1fe3027873fc",class:this.h.classes(r.root),align:"center"},this.h.hasSlot("icon")&&t("slot",{key:"a31a15dd5276be32288c691d5bb7b8cf9d6615ab",name:"icon"}),t("div",{key:"0dfc7905d1e515a7ecc1eba1dd3912cd32774ca3",class:r.content},t("slot",{key:"238e3ab94cf05880567e2ac2c54c9f9c572ff014",name:"headline"}),t("slot",{key:"56519d70f3ab7b162e9e9a78bf7bfabef89a9b2d"})))}get host(){return this}},[4,"gov-error-code"]);function a(){if(typeof customElements==="undefined"){return}const e=["gov-error-code"];e.forEach((e=>{switch(e){case"gov-error-code":if(!customElements.get(e)){customElements.define(e,n)}break}}))}a();const d=n;const f=a;export{d as GovErrorCode,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-error-code.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface GovFlex extends Components.GovFlex, HTMLElement {}
|
|
4
|
+
export const GovFlex: {
|
|
5
|
+
prototype: GovFlex;
|
|
6
|
+
new (): GovFlex;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as t,h as n,d as s}from"./p-42200001.js";import{g as i}from"./p-0075138f.js";const o={root:"gov-flex"};const f=e(class e extends t{constructor(){super();this.__registerHost();this.direction="row";this.justifyContent=undefined;this.alignItems=undefined;this.wrap=undefined;this.alignContent=undefined;this.alignSelf=undefined;this.h=i(this.host)}render(){return n(s,{key:"77d5eb1db594698f6fde4bf497209912de71173f",class:this.h.classes(o.root)},n("slot",{key:"6c01ff6ec88c53dbf9e83d492f660c96e9e7fc2a"}))}get host(){return this}},[4,"gov-flex",{direction:[1],justifyContent:[513,"justify-content"],alignItems:[513,"align-items"],wrap:[513],alignContent:[513,"align-content"],alignSelf:[513,"align-self"]}]);function c(){if(typeof customElements==="undefined"){return}const e=["gov-flex"];e.forEach((e=>{switch(e){case"gov-flex":if(!customElements.get(e)){customElements.define(e,f)}break}}))}c();const d=f;const r=c;export{d as GovFlex,r as defineCustomElement};
|
|
2
|
+
//# sourceMappingURL=gov-flex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FlexClass","root","GovFlex","proxyCustomElement","H","constructor","this","h","govHost","host","render","Host","key","class","classes"],"sources":["../../../packages/core/src/components/gov-flex/constants.ts","../../../packages/core/src/components/gov-flex/gov-flex.tsx"],"sourcesContent":["export const FlexClass = {\n\troot: 'gov-flex',\n}\n\n","import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FlexClass} from './constants'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-flex',\n})\nexport class GovFlex {\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 * Controls the flex direction of the container. Can be 'row', 'row-reverse', 'column', or 'column-reverse'.\n\t */\n\t@Prop() direction: 'row' | 'row-reverse' | 'column' | 'column-reverse' = 'row';\n\n\t/**\n\t * Defines how the browser distributes space between and around content items along the main axis.\n\t * Allowed values: 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'.\n\t */\n\t@Prop({\n\t\tattribute: 'justify-content',\n\t\treflect: true\n\t}) justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';\n\n\t/**\n\t * Aligns flex items along the cross axis. Can be 'stretch', 'flex-start', 'flex-end', 'center', or 'baseline'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-items', reflect: true\n\t}) alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';\n\n\t/**\n\t * Controls whether the flex container is a single-line or multi-line flex container. Can be 'nowrap', 'wrap', or 'wrap-reverse'.\n\t */\n\t@Prop({reflect: true}) wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n\n\t/**\n\t * Aligns the flex container's lines within when there is extra space in the cross-axis.\n\t * Allowed values: 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'stretch'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-content',\n\t\treflect: true\n\t}) alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';\n\n\t/**\n\t * Sets the alignment of the flex container’s children along the flex container’s cross axis, overriding the `align-items` property for individual flex items.\n\t * Allowed values: 'auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-self',\n\t\treflect: true\n\t}) alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FlexClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"6FAAO,MAAMA,EAAY,CACxBC,KAAM,Y,MCOMC,EAAOC,EAAA,MAAAD,UAAAE,EAGnB,WAAAC,G,6CASyE,M,iIARxEC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAiDvB,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOP,KAAKC,EAAEO,QAAQd,EAAUC,OACrCM,EAAA,QAAAK,IAAA,6C","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as
|
|
1
|
+
import{G as o,d as s}from"./p-c211c3e1.js";const c=o;const t=s;export{c as GovFormAutocomplete,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-autocomplete.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as r,c as a,h as g,d as e}from"./p-
|
|
1
|
+
import{p as o,H as r,c as a,h as g,d as e}from"./p-42200001.js";import{F as i,a as t,b as p,c as n}from"./p-e44a0fee.js";import{g as s}from"./p-0075138f.js";import{v as m}from"./p-19c681a3.js";import{t as l}from"./p-26618322.js";import{p as f}from"./p-ded281e6.js";const c=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}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-s-nudge))}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-m))}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-m-nudge))}";const v=c;const u=o(class o extends r{constructor(){super();this.__registerHost();this.govChange=a(this,"gov-change",7);this.handleChange=o=>{var r;o.stopPropagation();const a=f(this.value);if(!Array.isArray(a))return;if(o.detail.checked){this.value=[...a,o.detail.value]}else{this.value=(r=a.filter((r=>r!==o.detail.value)))!==null&&r!==void 0?r:[]}this.govChange.emit({value:this.value,component:i.root})};this.gap=undefined;this.orientation="vertical";this.value=undefined;this.h=s(this.host)}validateGap(o){if(o){m(p,o,t.root)}}validateOrientation(o){if(o){m(n,o,t.root)}}componentWillLoad(){this.validateGap(this.gap);this.validateOrientation(this.orientation);this.value=f(this.value)}componentDidRender(){l((()=>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(e,{key:"4db534d7f8775aaac6fecb7550037d0830763543",gap:this.gap,class:this.h.classes(t.root),value:this.value},g("slot",{key:"836498262409058cdbb62066e482897ba0f0ec1c"}))}get host(){return this}static get watchers(){return{gap:["validateGap"],orientation:["validateOrientation"]}}static get style(){return v}},[4,"gov-form-checkbox-group",{gap:[1],orientation:[1],value:[1025]},undefined,{gap:["validateGap"],orientation:["validateOrientation"]}]);function h(){if(typeof customElements==="undefined"){return}const o=["gov-form-checkbox-group"];o.forEach((o=>{switch(o){case"gov-form-checkbox-group":if(!customElements.get(o)){customElements.define(o,u)}break}}))}h();const d=u;const b=h;export{d as GovFormCheckboxGroup,b as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-checkbox-group.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as i,c as s,h as e,d as h}from"./p-
|
|
1
|
+
import{p as t,H as i,c as s,h as e,d as h}from"./p-42200001.js";import{c as n}from"./p-cd6c2938.js";import{v as a}from"./p-19c681a3.js";import{g as o,d as r,e as c}from"./p-255d0471.js";import{g as d,c as l,t as m}from"./p-0075138f.js";import{F as u}from"./p-1c1d0bbe.js";import{i as f,A as p,a as v}from"./p-33d5d1ed.js";import{d as b}from"./p-387052e1.js";const g=t(class t extends i{constructor(){super();this.__registerHost();this.govFocus=s(this,"gov-focus",7);this.govBlur=s(this,"gov-blur",7);this.govChange=s(this,"gov-change",7);this.hydrated=false;this.value=undefined;this.checked=false;this.required=false;this.disabled=false;this.indeterminate=false;this.name=undefined;this.size="m";this.identifier=undefined;this.noLabel=false;this.invalid=undefined;this.inheritedAttributes={};this.checkboxId=n("GovCheckbox");this.h=d(this.host);this.f=o(this.h)}validateSize(t){a(c,t,r.root)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",l(this.disabled));this.f.passAttrToControl("invalid",l(this.invalid));this.f.passAttrToControl("type","checkbox")}componentWillLoad(){this.passControlAttrs();this.inheritedAttributes=f(this.host)}componentDidLoad(){this.attributeObserver=new p(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(v)}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs()}connectedCallback(){this.hydrated=true}disconnectedCallback(){this.attributeObserver.stopObserving()}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}render(){const t=t=>{if(this.noLabel){return e("label",{class:r.label},t)}return t};return e(h,{class:r.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},t(e(u,null,e("input",Object.assign({id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,indeterminate:this.indeterminate,ref:t=>this.inputRef=t},this.inheritedAttributes,{"aria-checked":l(this.checked),"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-disabled":m(this.disabled)})),e("span",null,e("slot",{name:"label"}),e("gov-icon",{class:r.check,name:"check-lg"}),e("gov-icon",{class:r.indeterminate,name:"dash-lg"})))))}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}onClickHandler(t){t.stopPropagation()}onChangeHandler(t){this.checked=t.target.checked;t.stopPropagation();this.govChange.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}},[4,"gov-form-checkbox",{value:[1],checked:[1540],required:[4],disabled:[4],indeterminate:[516],name:[1],size:[1],identifier:[1],noLabel:[4,"no-label"],invalid:[4],inheritedAttributes:[32],getRef:[64]},undefined,{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-form-checkbox","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-checkbox":if(!customElements.get(t)){customElements.define(t,g)}break;case"gov-icon":if(!customElements.get(t)){b()}break}}))}k();const C=g;const A=k;export{C as GovFormCheckbox,A as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as s,H as e,h as t,d as i}from"./p-
|
|
1
|
+
import{p as s,H as e,h as t,d as i}from"./p-42200001.js";import{g as o,f as c}from"./p-255d0471.js";import{g as a}from"./p-0075138f.js";import{s as r}from"./p-cd6c2938.js";const n=s(class s extends e{constructor(){super();this.__registerHost();this.identifier=undefined;this.invalid=false;this.disabled=false;this.success=false;this.fieldset=false;this.size="m";this.h=a(this.host);this.f=o(this.h)}componentDidRender(){this.syncControlMessages();this.formElementDescriptionControl()}disconnectedCallback(){var s;(s=this.observer)===null||s===void 0?void 0:s.disconnect()}formElementDescriptionControl(){const s=this.host.querySelector("."+c.bottom);if(!s)return;this.observer=new MutationObserver(function(){this.syncControlMessages()}.bind(this));this.observer.observe(s,{childList:true})}syncControlMessages(){Promise.all(this.f.messageElements.map((s=>s.identifier()))).then((s=>{this.f.mainElementsInControl.forEach((e=>{const t=r(e.getAttribute("aria-describedby"));e.removeAttribute("aria-describedby");if(Array.isArray(t)){t.forEach((e=>e.indexOf("GovFormMessage")===-1?s.push(e):null))}if(s.length){e.setAttribute("aria-describedby",s.join(" "))}}))}))}render(){const s=this.fieldset?"fieldset":"div";return t(i,{key:"81635a0efe09a262be2b2359355dac108e542726",size:this.size,class:this.h.classes(c.root)},t(s,{key:"5251c4b5fba8f699c9a017e310932b85c8fb3abf",class:c.holder},this.h.hasSlot("top")&&t("slot",{key:"8f6695209e018ad74a8b7e32945cc51ead47dc2d",name:"top"}),t("slot",{key:"380304f4a8c70e9db2f1f062761ece479a0b6ca8"}),this.h.hasSlot("bottom")&&t("div",{key:"3f37cb4c4165cdf80e8e3fc081d8503c1f975230",class:c.bottom},t("slot",{key:"b6be21c67739f3f50d15bf3ca69aa1e71ca96e4c",name:"bottom"}))))}get host(){return this}},[4,"gov-form-control",{identifier:[1],invalid:[516],disabled:[516],success:[516],fieldset:[4],size:[1]}]);function f(){if(typeof customElements==="undefined"){return}const s=["gov-form-control"];s.forEach((s=>{switch(s){case"gov-form-control":if(!customElements.get(s)){customElements.define(s,n)}break}}))}f();const d=n;const l=f;export{d as GovFormControl,l as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-control.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as i,d as a}from"./p-
|
|
1
|
+
import{p as t,H as e,c as s,h as i,d as a}from"./p-42200001.js";import{c as o}from"./p-cd6c2938.js";import{g as n,c as h,t as r}from"./p-0075138f.js";import{g as l}from"./p-255d0471.js";import{A as c,a as f,i as m}from"./p-33d5d1ed.js";import{d}from"./p-bd22e21d.js";import{d as u}from"./p-820b66c0.js";import{d as g}from"./p-6ea84137.js";import{d as p}from"./p-1d3019f3.js";import{d as v}from"./p-387052e1.js";const b={root:"gov-form-file",area:"gov-form-file__area",input:"gov-form-file__input",attachments:"gov-form-file__attachments"};function y(t){const e=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let s=0,i=parseInt(t,10)||0;while(i>=1024&&++s){i=i/1024}return i.toFixed(i<10&&s>0?1:0)+" "+e[s]}function E(t,e){if(typeof e==="string"&&e.length){return e.replace(/\s/g,"").split(",").filter((e=>new RegExp(e.replace("*",".*")).test(t.type))).length>0}else{return true}}function A(t,e){const s=Math.round(t.size);return s<=e}const k=t(class t extends e{constructor(){super();this.__registerHost();this.govFocus=s(this,"gov-focus",7);this.govBlur=s(this,"gov-blur",7);this.govFiles=s(this,"gov-files",7);this.govAddFile=s(this,"gov-add-file",7);this.govRemoveFile=s(this,"gov-remove-file",7);this.eventsRegistered=false;this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=false;this.ignoreFileDuplicationCheck=false;this.displayAttachments=true;this.name=undefined;this.accept=undefined;this.multiple=false;this.maxFileSize=-1;this.identifier=undefined;this.invalid=undefined;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.attachmentsLabel="Přílohy";this.accessibleRemoveLabel="Odebrat soubor {FILE_NAME}";this.accessibleAttachmentsLabel="Přílohy";this.files=[];this.inheritedAttributes={};this.fileId=o("GovInputFile");this.h=n(this.host);this.f=l(this.h)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",h(this.invalid));this.f.passAttrToControl("disabled",h(this.disabled));this.f.passAttrToControl("type","File")}registerListeners(){if(this.eventsRegistered){return}this.eventsRegistered=true;function t(){this.areaRef.classList.add("highlight")}function e(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(t=>{t.preventDefault();t.stopPropagation();const e=t.target.files;if(this.resetAfterPick){if(e.length){this.validateFiles(e)}}else{this.validateFiles(e)}}),false);if(this.expanded){const s=["dragover","dragleave"];const i=["dragenter","dragover","mouseenter"];const a=["dragleave","drop","mouseleave"];s.map((t=>this.inputRef.addEventListener(t,this.preventDefaults.bind(this),false)));i.map((e=>this.inputRef.addEventListener(e,t.bind(this),false)));a.forEach((t=>this.inputRef.addEventListener(t,e.bind(this),false)));this.areaRef.addEventListener("drop",this.handleDrop.bind(this),false)}}preventDefaults(t){t.preventDefault();t.stopPropagation()}handleDrop(t){const e=t.dataTransfer;this.validateFiles(e.files)}validateFiles(t){let e=[];Array.from(t).map((t=>{const s=this.files.find((e=>e.file.name===t.name&&e.file.size===t.size))||null;if(s===null||this.ignoreFileDuplicationCheck){const s=typeof this.maxFileSize==="number"&&this.maxFileSize>0?A(t,this.maxFileSize):true;const i=E(t,this.accept);const a={id:o("GovFormFile"),file:t,acceptValid:i,sizeValid:s};if(this.displayAttachments){this.files=[...this.files,a]}else{e=[...e,a]}this.govAddFile.emit({component:b.root,file:a})}}));this.govFiles.emit({component:b.root,files:e.length?e:this.files});if(this.resetAfterPick){this.reset().finally()}}componentDidLoad(){this.attributeObserver=new c(this.host,((t,e)=>{this.onAriaAttributeChange(t,e)}));this.attributeObserver.startObserving(f)}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs();this.inheritedAttributes=m(this.host)}async componentDidRender(){this.registerListeners()}disconnectedCallback(){this.attributeObserver.stopObserving()}onAriaAttributeChange(t,e){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:e})}render(){return i(a,{key:"1f69ad55f386a3e0429a0616020c04dbaadc8025",class:this.h.classes([b.root]),invalid:r(this.invalid),expanded:r(this.expanded)},i("div",{key:"0927e067de4a7fa12fe73b9eb3ac48af1a930092",class:b.area,ref:t=>this.areaRef=t},i("slot",{key:"810a669af48af7306884a3a32b81aaf3a8498c41"}),i("input",Object.assign({key:"c7c5e6f71ee55c154348503693d83f022f73c346",class:b.input,ref:t=>this.inputRef=t,id:this.identifier||this.fileId,type:"file",name:this.name,accept:this.accept,multiple:this.multiple,onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled},this.inheritedAttributes,{"aria-required":r(this.required),"aria-invalid":r(this.invalid),"aria-disabled":r(this.disabled)}))),this.h.hasSlot("attachments")?i("div",{class:b.attachments},i("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?i("div",{class:b.attachments},i("gov-attachments",{label:this.accessibleAttachmentsLabel,"accessible-label":this.accessibleAttachmentsLabel},this.files.map((t=>i("gov-attachments-item",{"accessible-remove-labelledby":t.id,"on-gov-remove":()=>this.onRemoveFileHandler(t)},i("span",{class:"sr-only",id:t.id},this.accessibleRemoveLabel.replace("{FILE_NAME}",t.file.name)),t.file.name,t.acceptValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),t.acceptValid===false?this.errorAccept:null):null,t.sizeValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),this.errorSize.replace("{FILE_SIZE}",y(this.maxFileSize))):null,i("span",{slot:"info"},"(",y(t.file.size),")")))))):null)}onRemoveFileHandler(t){const e=this.files.findIndex((e=>e.id===t.id));if(e!==-1){const t=this.files;const s=this.files[e];t.splice(e,1);this.files=[...t];this.govRemoveFile.emit({component:b.root,file:s});this.govFiles.emit({component:b.root,files:t})}}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:b.root,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:b.root,originalEvent:t})}onChangeHandler(t){t.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];this.inputRef.value=""}get host(){return this}static get watchers(){return{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}},[4,"gov-form-file",{expanded:[4],required:[4],disabled:[4],resetAfterPick:[4,"reset-after-pick"],ignoreFileDuplicationCheck:[4,"ignore-file-duplication-check"],displayAttachments:[4,"display-attachments"],name:[1],accept:[1],multiple:[4],maxFileSize:[2,"max-file-size"],identifier:[1],invalid:[4],errorSize:[1,"error-size"],errorAccept:[1,"error-accept"],attachmentsLabel:[1,"attachments-label"],accessibleRemoveLabel:[1,"accessible-remove-label"],accessibleAttachmentsLabel:[1,"accessible-attachments-label"],files:[32],inheritedAttributes:[32],getRef:[64],getAreaRef:[64],reset:[64]},undefined,{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}]);function j(){if(typeof customElements==="undefined"){return}const t=["gov-form-file","gov-attachments","gov-attachments-item","gov-button","gov-form-message","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-file":if(!customElements.get(t)){customElements.define(t,k)}break;case"gov-attachments":if(!customElements.get(t)){d()}break;case"gov-attachments-item":if(!customElements.get(t)){u()}break;case"gov-button":if(!customElements.get(t)){g()}break;case"gov-form-message":if(!customElements.get(t)){p()}break;case"gov-icon":if(!customElements.get(t)){v()}break}}))}j();const F=k;const C=j;export{F as GovFormFile,C as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-file.js.map
|