@gov-design-system-ce/components 4.0.6 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
- package/dist/cjs/gov-attachments_3.cjs.entry.js +1 -1
- package/dist/cjs/gov-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +26 -3
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +7 -4
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-card.cjs.entry.js +1 -1
- package/dist/cjs/gov-chip.cjs.entry.js +2 -2
- package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-container.cjs.entry.js +1 -1
- package/dist/cjs/gov-control-group.cjs.entry.js +1 -1
- package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
- package/dist/cjs/gov-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/gov-empty.cjs.entry.js +1 -1
- package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +16 -4
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-group.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +5 -1
- package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +1 -1
- package/dist/cjs/gov-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-grid.cjs.entry.js +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +2 -2
- package/dist/cjs/gov-infobar.cjs.entry.js +3 -2
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-layout-column.cjs.entry.js +1 -1
- package/dist/cjs/gov-layout.cjs.entry.js +1 -1
- package/dist/cjs/gov-loading.cjs.entry.js +1 -1
- package/dist/cjs/gov-message.cjs.entry.js +1 -1
- package/dist/cjs/gov-modal.cjs.entry.js +5 -2
- package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +8 -4
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-prompt.cjs.entry.js +5 -2
- package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-side-nav-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-side-nav.cjs.entry.js +1 -1
- package/dist/cjs/gov-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar.cjs.entry.js +1 -1
- package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-stepper.cjs.entry.js +1 -1
- package/dist/cjs/gov-tabs-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-tabs.cjs.entry.js +1 -1
- 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-tile.cjs.entry.js +3 -3
- package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tiles.cjs.entry.js +1 -1
- package/dist/cjs/gov-toast.cjs.entry.js +1 -1
- package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
- package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js +8 -9
- package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-wizard.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{template-4b951d1d.js → template-9534c584.js} +5 -1
- package/dist/cjs/template-9534c584.js.map +1 -0
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +58 -16
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +48 -1
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
- package/dist/collection/components/gov-button/button/gov-button.css +1 -1
- package/dist/collection/components/gov-button/button/gov-button.js +13 -16
- package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
- package/dist/collection/components/gov-chip/gov-chip.css +2 -6
- package/dist/collection/components/gov-form/file/gov-form-file.js +51 -3
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.js +18 -0
- package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.css +1 -1
- package/dist/collection/components/gov-infobar/gov-infobar.js +25 -1
- package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
- package/dist/collection/components/gov-modal/gov-modal.js +6 -3
- package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js +80 -5
- package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
- package/dist/collection/components/gov-promp/gov-prompt.js +4 -1
- package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
- package/dist/collection/components/gov-tag/gov-tag.css +5 -100
- package/dist/collection/components/gov-tile/gov-tile.css +3 -5
- package/dist/collection/components/gov-tile/gov-tile.js +1 -1
- package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +2 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +7 -8
- package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
- package/dist/collection/helpers/Dom/template.js +3 -0
- package/dist/collection/helpers/Dom/template.js.map +1 -1
- package/dist/collection/pages/Breadcrumbs.js +3 -2
- package/dist/collection/pages/Breadcrumbs.js.map +1 -1
- package/dist/collection/pages/Button.js +101 -101
- package/dist/collection/pages/Button.js.map +1 -1
- package/dist/collection/pages/Chip.js +50 -50
- package/dist/collection/pages/Chip.js.map +1 -1
- package/dist/collection/pages/Forms.js +19 -10
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Tag.js +27 -27
- package/dist/collection/pages/Tag.js.map +1 -1
- package/dist/collection/pages/Tooltip.js +13 -16
- package/dist/collection/pages/Tooltip.js.map +1 -1
- package/dist/components/gov-accordion-item.js +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-dropdown.js +1 -1
- package/dist/components/gov-empty.js +1 -1
- package/dist/components/gov-error-code.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-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-message.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-search.js +1 -1
- package/dist/components/gov-form-search.js.map +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-loading.js +1 -1
- package/dist/components/gov-message.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-modal.js.map +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-prompt.js.map +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-side-nav.js +1 -1
- package/dist/components/gov-side-nav.js.map +1 -1
- package/dist/components/gov-skeleton.js +1 -1
- package/dist/components/gov-skeleton.js.map +1 -1
- package/dist/components/gov-spacer.js +1 -1
- package/dist/components/gov-statsbar-item.js +1 -1
- package/dist/components/gov-statsbar.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-tag.js +1 -1
- package/dist/components/gov-tag.js.map +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-tile.js.map +1 -1
- package/dist/components/gov-tiles.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-tooltip-content.js.map +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-tooltip.js.map +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/{p-b526e440.js → p-033f8bda.js} +2 -2
- package/dist/components/{p-43554d2d.js → p-2d5d24af.js} +2 -2
- package/dist/components/{p-ec6c2272.js → p-44762d17.js} +2 -2
- package/dist/components/{p-62074db5.js → p-5dbe0178.js} +2 -2
- package/dist/components/{p-d29431c0.js → p-76b229e3.js} +2 -2
- package/dist/components/p-76b229e3.js.map +1 -0
- package/dist/components/{p-6f391c4a.js → p-8b7b916a.js} +2 -2
- package/dist/components/{p-990d2990.js → p-976404a5.js} +2 -2
- package/dist/components/p-976404a5.js.map +1 -0
- package/dist/components/p-99860f34.js +2 -0
- package/dist/components/p-99860f34.js.map +1 -0
- package/dist/components/{p-9795ad94.js → p-b9ee51d6.js} +2 -2
- package/dist/{core/p-28e59384.js → components/p-c353678b.js} +2 -2
- package/dist/components/p-c353678b.js.map +1 -0
- package/dist/components/{p-570803ab.js → p-f8b7ea69.js} +2 -2
- package/dist/core/core.css +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-96d141a3.entry.js → p-0028fadc.entry.js} +2 -2
- package/dist/core/{p-2969eb69.entry.js → p-0ab12526.entry.js} +2 -2
- package/dist/core/{p-22abe742.entry.js → p-0c5c6dee.entry.js} +2 -2
- package/dist/core/{p-1116fec6.entry.js → p-127af1b4.entry.js} +2 -2
- package/dist/core/{p-fd4b0f54.entry.js → p-148501cc.entry.js} +2 -2
- package/dist/core/{p-fb51d693.entry.js → p-151f1b89.entry.js} +2 -2
- package/dist/core/{p-bb7f0a66.entry.js → p-1bc2f62c.entry.js} +2 -2
- package/dist/core/p-1cbd2c7c.entry.js +2 -0
- package/dist/core/p-1cbd2c7c.entry.js.map +1 -0
- package/dist/core/{p-6dc942b8.entry.js → p-2d1f3d62.entry.js} +2 -2
- package/dist/core/p-2d1f3d62.entry.js.map +1 -0
- package/dist/core/p-30673e46.entry.js +2 -0
- package/dist/core/p-30673e46.entry.js.map +1 -0
- package/dist/core/{p-de3429ab.entry.js → p-3975851f.entry.js} +2 -2
- package/dist/core/{p-141d9af4.entry.js → p-4988c0bb.entry.js} +2 -2
- package/dist/core/{p-83e998d8.entry.js → p-529ce9a4.entry.js} +2 -2
- package/dist/core/{p-2712444e.entry.js → p-531c350f.entry.js} +2 -2
- package/dist/core/p-531c350f.entry.js.map +1 -0
- package/dist/core/{p-fc2a1e14.entry.js → p-53e0ad52.entry.js} +2 -2
- package/dist/core/{p-81593c86.entry.js → p-54fa7af5.entry.js} +2 -2
- package/dist/core/{p-41c18f64.entry.js → p-555eaa93.entry.js} +2 -2
- package/dist/core/{p-e24236b0.entry.js → p-55cb727e.entry.js} +2 -2
- package/dist/{components/p-28e59384.js → core/p-5de606f8.js} +2 -2
- package/dist/core/p-5de606f8.js.map +1 -0
- package/dist/core/{p-3c12c766.entry.js → p-60d681a6.entry.js} +2 -2
- package/dist/core/{p-b4a59c79.entry.js → p-64c5748e.entry.js} +2 -2
- package/dist/core/p-64c5748e.entry.js.map +1 -0
- package/dist/core/p-67096d72.entry.js +2 -0
- package/dist/core/p-67096d72.entry.js.map +1 -0
- package/dist/core/{p-b49293dc.entry.js → p-6bf8e7bf.entry.js} +2 -2
- package/dist/core/{p-89b3e4d4.entry.js → p-72c5997f.entry.js} +2 -2
- package/dist/core/p-7f158b6f.entry.js +2 -0
- package/dist/core/p-7f158b6f.entry.js.map +1 -0
- package/dist/core/{p-9c6699d6.entry.js → p-835f1187.entry.js} +2 -2
- package/dist/core/p-835f1187.entry.js.map +1 -0
- package/dist/core/{p-01d928c5.entry.js → p-90c068ff.entry.js} +2 -2
- package/dist/core/{p-cf86a858.entry.js → p-927880d6.entry.js} +2 -2
- package/dist/core/{p-fc8a29e9.entry.js → p-9402e4cc.entry.js} +2 -2
- package/dist/core/{p-b4ab0d15.entry.js → p-9469ecc2.entry.js} +2 -2
- package/dist/core/{p-f29b0193.entry.js → p-984b36f7.entry.js} +2 -2
- package/dist/core/p-9c04470d.entry.js +2 -0
- package/dist/core/p-9c04470d.entry.js.map +1 -0
- package/dist/core/{p-ccf73a1a.entry.js → p-a35484ed.entry.js} +2 -2
- package/dist/core/p-a49391e5.entry.js +2 -0
- package/dist/core/p-a49391e5.entry.js.map +1 -0
- package/dist/core/{p-b127c8a8.entry.js → p-aaf2510a.entry.js} +2 -2
- package/dist/core/p-aaf2510a.entry.js.map +1 -0
- package/dist/core/{p-b7d23697.entry.js → p-ac856de6.entry.js} +2 -2
- package/dist/core/p-ac856de6.entry.js.map +1 -0
- package/dist/core/{p-b580666b.entry.js → p-adf276b0.entry.js} +2 -2
- package/dist/core/{p-e5c2f601.entry.js → p-b7e0b030.entry.js} +2 -2
- package/dist/core/{p-78942f76.entry.js → p-be8eec3f.entry.js} +2 -2
- package/dist/core/{p-f1227928.entry.js → p-c6a4ca41.entry.js} +2 -2
- package/dist/core/{p-67138ae9.entry.js → p-ce1486b8.entry.js} +2 -2
- package/dist/core/{p-ee4c58e3.entry.js → p-d2c370d6.entry.js} +2 -2
- package/dist/core/p-d513468a.entry.js +2 -0
- package/dist/core/p-d513468a.entry.js.map +1 -0
- package/dist/core/{p-ac5e5b2c.entry.js → p-dd4445ee.entry.js} +2 -2
- package/dist/core/{p-f76f0a67.entry.js → p-e3b14974.entry.js} +2 -2
- package/dist/core/{p-92af05f2.entry.js → p-e4f11ddf.entry.js} +2 -2
- package/dist/core/{p-6675a0f0.entry.js → p-eaedc9e3.entry.js} +2 -2
- package/dist/core/{p-b5e1ee46.entry.js → p-ed580ac7.entry.js} +2 -2
- package/dist/core/{p-3b42950e.entry.js → p-f1031bac.entry.js} +2 -2
- package/dist/core/{p-f636a1ca.entry.js → p-f2206bbb.entry.js} +2 -2
- package/dist/core/{p-497c90ea.entry.js → p-f4f969d0.entry.js} +2 -2
- package/dist/core/p-f4f969d0.entry.js.map +1 -0
- package/dist/core/{p-4a235ef5.entry.js → p-f59b858f.entry.js} +2 -2
- package/dist/core/{p-d69599bc.entry.js → p-f7065042.entry.js} +2 -2
- package/dist/core/{p-b1184db4.entry.js → p-f9dcaafb.entry.js} +2 -2
- package/dist/core/{p-7757e4a1.entry.js → p-fc710edb.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js +1 -1
- package/dist/esm/gov-accordion.entry.js +1 -1
- package/dist/esm/gov-attachments_3.entry.js +1 -1
- package/dist/esm/gov-backdrop.entry.js +1 -1
- package/dist/esm/gov-breadcrumbs.entry.js +26 -3
- package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
- package/dist/esm/gov-button.entry.js +7 -4
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-card.entry.js +1 -1
- package/dist/esm/gov-chip.entry.js +2 -2
- package/dist/esm/gov-chip.entry.js.map +1 -1
- package/dist/esm/gov-container.entry.js +1 -1
- package/dist/esm/gov-control-group.entry.js +1 -1
- package/dist/esm/gov-cookiebar.entry.js +1 -1
- package/dist/esm/gov-dropdown.entry.js +1 -1
- package/dist/esm/gov-empty.entry.js +1 -1
- package/dist/esm/gov-error-code.entry.js +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +1 -1
- package/dist/esm/gov-form-control.entry.js +1 -1
- package/dist/esm/gov-form-file.entry.js +16 -4
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-group.entry.js +1 -1
- package/dist/esm/gov-form-input.entry.js +5 -1
- package/dist/esm/gov-form-input.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +1 -1
- package/dist/esm/gov-form-radio.entry.js +1 -1
- package/dist/esm/gov-form-search.entry.js +1 -1
- package/dist/esm/gov-form-search.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +1 -1
- package/dist/esm/gov-form-switch.entry.js +1 -1
- package/dist/esm/gov-grid-item.entry.js +1 -1
- package/dist/esm/gov-grid.entry.js +1 -1
- package/dist/esm/gov-icon.entry.js +2 -2
- package/dist/esm/gov-infobar.entry.js +3 -2
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/gov-layout-column.entry.js +1 -1
- package/dist/esm/gov-layout.entry.js +1 -1
- package/dist/esm/gov-loading.entry.js +1 -1
- package/dist/esm/gov-message.entry.js +1 -1
- package/dist/esm/gov-modal.entry.js +5 -2
- package/dist/esm/gov-modal.entry.js.map +1 -1
- package/dist/esm/gov-pagination.entry.js +8 -4
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-prompt.entry.js +5 -2
- package/dist/esm/gov-prompt.entry.js.map +1 -1
- package/dist/esm/gov-side-nav-item.entry.js +1 -1
- package/dist/esm/gov-side-nav.entry.js +1 -1
- package/dist/esm/gov-skeleton.entry.js +1 -1
- package/dist/esm/gov-spacer.entry.js +1 -1
- package/dist/esm/gov-statsbar-item.entry.js +1 -1
- package/dist/esm/gov-statsbar.entry.js +1 -1
- package/dist/esm/gov-stepper-item.entry.js +1 -1
- package/dist/esm/gov-stepper.entry.js +1 -1
- package/dist/esm/gov-tabs-item.entry.js +1 -1
- package/dist/esm/gov-tabs.entry.js +1 -1
- package/dist/esm/gov-tag.entry.js +2 -2
- package/dist/esm/gov-tag.entry.js.map +1 -1
- package/dist/esm/gov-tile.entry.js +3 -3
- package/dist/esm/gov-tile.entry.js.map +1 -1
- package/dist/esm/gov-tiles.entry.js +1 -1
- package/dist/esm/gov-toast.entry.js +1 -1
- package/dist/esm/gov-tooltip-content.entry.js +2 -2
- package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.entry.js +8 -9
- package/dist/esm/gov-tooltip.entry.js.map +1 -1
- package/dist/esm/gov-wizard-item.entry.js +1 -1
- package/dist/esm/gov-wizard.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{template-df429738.js → template-a0067bb6.js} +5 -2
- package/dist/esm/template-a0067bb6.js.map +1 -0
- package/dist/hydrate/index.js +94 -30
- package/dist/stencil.config.js +23 -1
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/Users/iwory/iWork/asseco/mv/gov-design-system-ce/packages/core/.stencil/packages/core/stencil.config.d.ts +2 -0
- package/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +9 -0
- package/dist/types/components/gov-button/button/gov-button.d.ts +5 -4
- package/dist/types/components/gov-form/file/gov-form-file.d.ts +9 -0
- package/dist/types/components/gov-form/input/gov-form-input.d.ts +5 -0
- package/dist/types/components/gov-infobar/gov-infobar.d.ts +4 -0
- package/dist/types/components/gov-modal/gov-modal.d.ts +1 -0
- package/dist/types/components/gov-pagination/gov-pagination.d.ts +17 -1
- package/dist/types/components/gov-promp/gov-prompt.d.ts +1 -0
- package/dist/types/components/gov-tile/gov-tile.d.ts +3 -3
- package/dist/types/components.d.ts +72 -4
- package/dist/types/helpers/Dom/template.d.ts +1 -0
- package/package.json +2 -2
- package/dist/cjs/template-4b951d1d.js.map +0 -1
- package/dist/components/p-28e59384.js.map +0 -1
- package/dist/components/p-990d2990.js.map +0 -1
- package/dist/components/p-a3d5a7e3.js +0 -2
- package/dist/components/p-a3d5a7e3.js.map +0 -1
- package/dist/components/p-d29431c0.js.map +0 -1
- package/dist/core/p-044f4c35.entry.js +0 -2
- package/dist/core/p-044f4c35.entry.js.map +0 -1
- package/dist/core/p-09966eaa.entry.js +0 -2
- package/dist/core/p-09966eaa.entry.js.map +0 -1
- package/dist/core/p-2712444e.entry.js.map +0 -1
- package/dist/core/p-28e59384.js.map +0 -1
- package/dist/core/p-2f858bf5.entry.js +0 -2
- package/dist/core/p-2f858bf5.entry.js.map +0 -1
- package/dist/core/p-497c90ea.entry.js.map +0 -1
- package/dist/core/p-6dc942b8.entry.js.map +0 -1
- package/dist/core/p-73b7585b.entry.js +0 -2
- package/dist/core/p-73b7585b.entry.js.map +0 -1
- package/dist/core/p-9c6699d6.entry.js.map +0 -1
- package/dist/core/p-a63bb91e.entry.js +0 -2
- package/dist/core/p-a63bb91e.entry.js.map +0 -1
- package/dist/core/p-a6b6dc73.entry.js +0 -2
- package/dist/core/p-a6b6dc73.entry.js.map +0 -1
- package/dist/core/p-b127c8a8.entry.js.map +0 -1
- package/dist/core/p-b4a59c79.entry.js.map +0 -1
- package/dist/core/p-b7d23697.entry.js.map +0 -1
- package/dist/core/p-c574ecc8.entry.js +0 -2
- package/dist/core/p-c574ecc8.entry.js.map +0 -1
- package/dist/esm/template-df429738.js.map +0 -1
- package/dist/types/Users/leo/Projects/repos/asseco/design-system/gov-design-system-ce/packages/core/.stencil/packages/core/stencil.config.d.ts +0 -2
- /package/dist/components/{p-b526e440.js.map → p-033f8bda.js.map} +0 -0
- /package/dist/components/{p-43554d2d.js.map → p-2d5d24af.js.map} +0 -0
- /package/dist/components/{p-ec6c2272.js.map → p-44762d17.js.map} +0 -0
- /package/dist/components/{p-62074db5.js.map → p-5dbe0178.js.map} +0 -0
- /package/dist/components/{p-6f391c4a.js.map → p-8b7b916a.js.map} +0 -0
- /package/dist/components/{p-9795ad94.js.map → p-b9ee51d6.js.map} +0 -0
- /package/dist/components/{p-570803ab.js.map → p-f8b7ea69.js.map} +0 -0
- /package/dist/core/{p-96d141a3.entry.js.map → p-0028fadc.entry.js.map} +0 -0
- /package/dist/core/{p-2969eb69.entry.js.map → p-0ab12526.entry.js.map} +0 -0
- /package/dist/core/{p-22abe742.entry.js.map → p-0c5c6dee.entry.js.map} +0 -0
- /package/dist/core/{p-1116fec6.entry.js.map → p-127af1b4.entry.js.map} +0 -0
- /package/dist/core/{p-fd4b0f54.entry.js.map → p-148501cc.entry.js.map} +0 -0
- /package/dist/core/{p-fb51d693.entry.js.map → p-151f1b89.entry.js.map} +0 -0
- /package/dist/core/{p-bb7f0a66.entry.js.map → p-1bc2f62c.entry.js.map} +0 -0
- /package/dist/core/{p-de3429ab.entry.js.map → p-3975851f.entry.js.map} +0 -0
- /package/dist/core/{p-141d9af4.entry.js.map → p-4988c0bb.entry.js.map} +0 -0
- /package/dist/core/{p-83e998d8.entry.js.map → p-529ce9a4.entry.js.map} +0 -0
- /package/dist/core/{p-fc2a1e14.entry.js.map → p-53e0ad52.entry.js.map} +0 -0
- /package/dist/core/{p-81593c86.entry.js.map → p-54fa7af5.entry.js.map} +0 -0
- /package/dist/core/{p-41c18f64.entry.js.map → p-555eaa93.entry.js.map} +0 -0
- /package/dist/core/{p-e24236b0.entry.js.map → p-55cb727e.entry.js.map} +0 -0
- /package/dist/core/{p-3c12c766.entry.js.map → p-60d681a6.entry.js.map} +0 -0
- /package/dist/core/{p-b49293dc.entry.js.map → p-6bf8e7bf.entry.js.map} +0 -0
- /package/dist/core/{p-89b3e4d4.entry.js.map → p-72c5997f.entry.js.map} +0 -0
- /package/dist/core/{p-01d928c5.entry.js.map → p-90c068ff.entry.js.map} +0 -0
- /package/dist/core/{p-cf86a858.entry.js.map → p-927880d6.entry.js.map} +0 -0
- /package/dist/core/{p-fc8a29e9.entry.js.map → p-9402e4cc.entry.js.map} +0 -0
- /package/dist/core/{p-b4ab0d15.entry.js.map → p-9469ecc2.entry.js.map} +0 -0
- /package/dist/core/{p-f29b0193.entry.js.map → p-984b36f7.entry.js.map} +0 -0
- /package/dist/core/{p-ccf73a1a.entry.js.map → p-a35484ed.entry.js.map} +0 -0
- /package/dist/core/{p-b580666b.entry.js.map → p-adf276b0.entry.js.map} +0 -0
- /package/dist/core/{p-e5c2f601.entry.js.map → p-b7e0b030.entry.js.map} +0 -0
- /package/dist/core/{p-78942f76.entry.js.map → p-be8eec3f.entry.js.map} +0 -0
- /package/dist/core/{p-f1227928.entry.js.map → p-c6a4ca41.entry.js.map} +0 -0
- /package/dist/core/{p-67138ae9.entry.js.map → p-ce1486b8.entry.js.map} +0 -0
- /package/dist/core/{p-ee4c58e3.entry.js.map → p-d2c370d6.entry.js.map} +0 -0
- /package/dist/core/{p-ac5e5b2c.entry.js.map → p-dd4445ee.entry.js.map} +0 -0
- /package/dist/core/{p-f76f0a67.entry.js.map → p-e3b14974.entry.js.map} +0 -0
- /package/dist/core/{p-92af05f2.entry.js.map → p-e4f11ddf.entry.js.map} +0 -0
- /package/dist/core/{p-6675a0f0.entry.js.map → p-eaedc9e3.entry.js.map} +0 -0
- /package/dist/core/{p-b5e1ee46.entry.js.map → p-ed580ac7.entry.js.map} +0 -0
- /package/dist/core/{p-3b42950e.entry.js.map → p-f1031bac.entry.js.map} +0 -0
- /package/dist/core/{p-f636a1ca.entry.js.map → p-f2206bbb.entry.js.map} +0 -0
- /package/dist/core/{p-4a235ef5.entry.js.map → p-f59b858f.entry.js.map} +0 -0
- /package/dist/core/{p-d69599bc.entry.js.map → p-f7065042.entry.js.map} +0 -0
- /package/dist/core/{p-b1184db4.entry.js.map → p-f9dcaafb.entry.js.map} +0 -0
- /package/dist/core/{p-7757e4a1.entry.js.map → p-fc710edb.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PaginationSizes","pick","Sizes","PaginationVariants","Variants","PaginationTypes","PaginationClass","root","list","item","itemArrow","itemMore","itemSelect","inner","arrow","paginate","totalItems","currentPage","pageSize","maxPages","totalPages","Math","ceil","startPage","endPage","maxPagesBeforeCurrentPage","floor","maxPagesAfterCurrentPage","startIndex","endIndex","min","pages","Array","from","keys","map","i","createArrayRange","to","Number","isInteger","slice","govPaginationCss","GovPagination","constructor","hostRef","this","h","govHost","host","pageSelectId","createID","validateType","newValue","validateProp","validateSize","validateVariant","recalculate","recalculatePagination","current","componentWillLoad","size","variant","componentDidRender","canValidateWcagOnRender","delay","validateWcag","pagination","total","isActivePageClass","originalClass","page","prepareLinkUrl","link","String","replace","undefined","resetSelectValue","spreadSelectRef","getRef","then","el","value","render","pageResolver","content","description","isDisabled","ariaCurrent","toBoolAttrIfDefined","href","type","disabled","e","onClickHandler","wcagPageLabel","class","Host","classes","wcagLabel","wcagLabelledBy","prepareClasses","name","labelStart","labelPrev","id","hidden","wcagSelectLabel","onSelectHandler","bind","selected","Fragment","ref","labelNext","labelEnd","stopPropagation","govPage","emit","component","detail","parseInt","isNaN","window","location","validateWcagProp","validateWcagLabel"],"sources":["../../../packages/core/src/components/gov-pagination/constants.ts","../../../packages/core/src/components/gov-pagination/pagination.ts","../../../packages/core/src/utils/array.utils.ts","../../../packages/core/src/components/gov-pagination/gov-pagination.scss?tag=gov-pagination","../../../packages/core/src/components/gov-pagination/gov-pagination.tsx"],"sourcesContent":["import { Sizes } from '../../core/constants/sizes'\nimport { Variants } from '../../core/constants/variants'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const PaginationSizes = pick(Sizes, ['_S', '_M'])\nexport type PaginationSizeType = `${ValueOf<typeof PaginationSizes>}`\n\nexport const PaginationVariants = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type PaginationVariantType = `${ValueOf<typeof PaginationVariants>}`\n\nexport enum PaginationTypes {\n\tBUTTON = 'button',\n\tSELECT = 'select',\n}\nexport type PaginationType = `${ValueOf<typeof PaginationTypes>}`\n\nexport const PaginationClass = {\n\troot: 'gov-pagination',\n\tlist: 'gov-pagination__list',\n\titem: 'gov-pagination__item',\n\titemArrow: 'gov-pagination__item--arrow',\n\titemMore: 'gov-pagination__item--more',\n\titemSelect: 'gov-pagination__item--select',\n\tinner: 'gov-pagination__inner',\n\tarrow: 'gov-pagination__arrow',\n}\n","export interface Pagination {\n\ttotalItems: number\n\tcurrentPage: number\n\tpageSize: number\n\ttotalPages: number\n\tstartPage: number\n\tendPage: number\n\tstartIndex: number\n\tendIndex: number\n\tpages: number[]\n}\n\nexport function paginate(totalItems: number, currentPage = 1, pageSize = 10, maxPages = 10): Pagination {\n\t// calculate total pages\n\tconst totalPages = Math.ceil(totalItems / pageSize)\n\n\t// ensure current page isn't out of range\n\tif (currentPage < 1) {\n\t\tcurrentPage = 1\n\t} else if (currentPage > totalPages) {\n\t\tcurrentPage = totalPages\n\t}\n\n\tlet startPage: number, endPage: number\n\tif (totalPages <= maxPages) {\n\t\t// total pages less than max so show all pages\n\t\tstartPage = 1\n\t\tendPage = totalPages\n\t} else {\n\t\t// total pages more than max so calculate start and end pages\n\t\tconst maxPagesBeforeCurrentPage = Math.floor(maxPages / 2)\n\t\tconst maxPagesAfterCurrentPage = Math.ceil(maxPages / 2) - 1\n\t\tif (currentPage <= maxPagesBeforeCurrentPage) {\n\t\t\t// current page near the start\n\t\t\tstartPage = 1\n\t\t\tendPage = maxPages\n\t\t} else if (currentPage + maxPagesAfterCurrentPage >= totalPages) {\n\t\t\t// current page near the end\n\t\t\tstartPage = totalPages - maxPages + 1\n\t\t\tendPage = totalPages\n\t\t} else {\n\t\t\t// current page somewhere in the middle\n\t\t\tstartPage = currentPage - maxPagesBeforeCurrentPage\n\t\t\tendPage = currentPage + maxPagesAfterCurrentPage\n\t\t}\n\t}\n\n\t// calculate start and end item indexes\n\tconst startIndex = (currentPage - 1) * pageSize\n\tconst endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1)\n\n\t// create an array of pages to ng-repeat in the pager control\n\tconst pages = Array.from(Array(endPage + 1 - startPage).keys()).map(i => startPage + i)\n\n\t// return object with all pager properties required by the view\n\treturn {\n\t\ttotalItems: totalItems,\n\t\tcurrentPage: currentPage,\n\t\tpageSize: pageSize,\n\t\ttotalPages: totalPages,\n\t\tstartPage: startPage,\n\t\tendPage: endPage,\n\t\tstartIndex: startIndex,\n\t\tendIndex: endIndex,\n\t\tpages: pages,\n\t}\n}\n","export const createArrayRange = (from: number, to: number): number[] => {\n\tif (Number.isInteger(from) && Number.isInteger(to)) {\n\t\treturn [...Array(to + 1).keys()].slice(from)\n\t}\n\treturn []\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-pagination\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@extend %reset-ul;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tfont-weight: bold;\n\t\ttext-align: center;\n\t}\n\t&__list &__item {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tmargin: 0;\n\t\tpadding: rem-calc(2);\n\t\tborder-radius: $border-radius;\n\t\toverflow: hidden;\n\t\t&--arrow {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t&--select {\n\t\t\tz-index: 1;\n\t\t\tdisplay: flex;\n\t\t\toverflow: visible;\n\t\t\tpadding: rem-calc(0 16);\n\t\t}\n\t}\n\t&__arrow {\n\t\tmargin: 0;\n\t}\n\t&__item--more {\n\t\t.gov-form-select {\n\t\t\tselect {\n\t\t\t\tborder: none !important;\n\t\t\t\tpadding-right: rem-calc(12) !important;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t}\n\t&__inner {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\talign-self: stretch;\n\t\twidth: 100%;\n\t\ttext-decoration: none;\n\t\t// Use hover styles from gov-button to active page button\n\t\t&[wcag-current=\"true\"] {\n\t\t\t@each $variant, $types in $button-variants {\n\t\t\t\t@each $type, $definitions in $types {\n\t\t\t\t\t&[type=\"#{$type}\"][variant=\"#{$variant}\"] {\n\t\t\t\t\t\t.element {\n\t\t\t\t\t\t\tbackground-color: deep-map-get($button-variants, $variant, $type, \"hover-bg\");\n\t\t\t\t\t\t\tcolor: deep-map-get($button-variants, $variant, $type, \"hover-color\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $pagination-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__inner {\n\t\t\t\t\t@include typography(get(\"font\", $definitions));\n\t\t\t\t\tfont-weight: inherit;\n\t\t\t\t\t.element {\n\t\t\t\t\t\tmin-width: get(\"button-size\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import Fragment from \"../../helpers/Fragment\"\nimport {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tPaginationClass,\n\tPaginationSizes,\n\tPaginationSizeType,\n\tPaginationType,\n\tPaginationTypes,\n\tPaginationVariants,\n\tPaginationVariantType,\n} from \"./constants\"\nimport {govHost, prepareClasses, toBoolAttrIfDefined} from \"../../helpers/Dom/template\"\nimport {paginate, Pagination} from \"./pagination\"\nimport {validateWcagLabel, validateWcagProp} from \"../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../helpers/Dom/win\"\nimport {delay} from \"../../utils/utils\"\nimport {createID} from \"../../utils/string.utils\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {createArrayRange} from \"../../utils/array.utils\"\nimport {FormSelectEvent} from \"../gov-form/select/gov-form-select.types\"\nimport {PaginationEvent} from \"./gov-pagination.types\"\n\n@Component({\n\ttag: \"gov-pagination\",\n\tstyleUrl: \"gov-pagination.scss\",\n})\nexport class GovPagination {\n\tprivate h: GovHost\n\tprivate readonly pageSelectId: string\n\n\tprivate spreadSelectRef?: HTMLGovFormSelectElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.pageSelectId = createID(\"GovPageSelect\")\n\t}\n\n\t@Element() readonly host: HTMLGovPaginationElement\n\t/**\n\t * Pagination type\n\t */\n\t@Prop() readonly type: PaginationType = \"button\"\n\t/**\n\t * Currently displayed page\n\t */\n\t@Prop() readonly current: number = 1\n\t/**\n\t * Total count of entries\n\t */\n\t@Prop() readonly total: number = 0\n\t/**\n\t * Set on active page\n\t */\n\t@Prop() readonly inverse: boolean\n\t/**\n\t * Pagination's size\n\t */\n\t@Prop() readonly size?: PaginationSizeType = \"m\"\n\t/**\n\t * Style variation of the pagination.\n\t */\n\t@Prop() readonly variant?: PaginationVariantType = \"primary\"\n\t/**\n\t * Maximum number of entries per page\n\t */\n\t@Prop({attribute: \"page-size\"}) readonly pageSize: number = 10\n\t/**\n\t * Maximum pages displayed for selection\n\t */\n\t@Prop({attribute: \"max-pages\"}) readonly maxPages: number = 5\n\t/**\n\t * Setting a link to redirect to a given page.\n\t * The {PAGE} wildcard can be used in the link to replace the page number.\n\t * Note that in the case of paging through a link, it is always necessary to send to the component the current page where the user is.\n\t */\n\t@Prop() readonly link: string\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"wcag-label\"}) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the page select\n\t */\n\t@Prop({attribute: \"wcag-select-label\"}) readonly wcagSelectLabel: string = \"Vybrat stranu\"\n\t/**\n\t * Adds accessible label for the page item\n\t */\n\t@Prop({attribute: \"wcag-page-label\"}) readonly wcagPageLabel: string = \"Strana\"\n\t/**\n\t * Description of the possibility to go back one page\n\t */\n\t@Prop({attribute: \"label-prev\"}) readonly labelPrev = 'Přejít o stranu zpět'\n\t/**\n\t * Description of the option to go to the top of paging\n\t */\n\t@Prop({attribute: \"label-start\"}) readonly labelStart = 'Přejít na začátek'\n\t/**\n\t * Description of the option to go to the end of paging\n\t */\n\t@Prop({attribute: \"label-next\"}) readonly labelNext = 'Přejít na další stranu'\n\t/**\n\t * Description of the option to move one page forward\n\t */\n\t@Prop({attribute: \"label-end\"}) readonly labelEnd = 'Přejít na konec'\n\t/**\n\t * Event called when changing the page with the current setting of the whole paging\n\t */\n\t@Event({eventName: \"gov-page\"}) govPage: EventEmitter<PaginationEvent>\n\n\t@State() pagination: Pagination\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(PaginationTypes, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(PaginationSizes, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(PaginationVariants, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"current\")\n\t@Watch(\"total\")\n\t@Watch(\"pageSize\")\n\t@Watch(\"maxPages\")\n\trecalculate(): void {\n\t\tthis.recalculatePagination(this.current)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.recalculatePagination(this.current)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateVariant(this.variant)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate recalculatePagination(currentPage: number) {\n\t\tthis.pagination = paginate(this.total, currentPage, this.pageSize, this.maxPages)\n\t}\n\n\tprivate isActivePageClass(originalClass: string, page: number) {\n\t\tif (this.pagination.currentPage === page) {\n\t\t\treturn originalClass + \" is-active\"\n\t\t} else {\n\t\t\treturn originalClass\n\t\t}\n\t}\n\n\tprivate prepareLinkUrl(page: number) {\n\t\tif (this.link) {\n\t\t\treturn String(this.link).replace(\"{PAGE}\", String(page))\n\t\t}\n\t\treturn undefined\n\t}\n\n\tprivate resetSelectValue() {\n\t\tif (this.spreadSelectRef) {\n\t\t\tthis.spreadSelectRef.getRef()\n\t\t\t\t.then((el: HTMLSelectElement) => {\n\t\t\t\t\tel.value = '...'\n\t\t\t\t})\n\t\t}\n\t}\n\n\trender() {\n\t\tconst pageResolver = (page: number, content: any, description: string) => {\n\t\t\tconst isDisabled = page === -1\n\t\t\tconst ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined)\n\t\t\treturn (\n\t\t\t\t<gov-button\n\t\t\t\t\thref={this.prepareLinkUrl(page)}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ton-gov-click={(e) => this.onClickHandler(e, page)}\n\t\t\t\t\twcag-label={description ? description : page > -1 ? this.wcagPageLabel + \" \" + page : undefined}\n\t\t\t\t\twcag-current={ariaCurrent}\n\t\t\t\t\tclass={PaginationClass.inner}>\n\t\t\t\t\t{content}\n\t\t\t\t</gov-button>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(PaginationClass.root)} type={this.type} variant={this.variant} size={this.size}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<ul class={PaginationClass.list}>\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.currentPage > 1 ? 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-left\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelStart\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-left\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelPrev\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t{this.type == \"select\" ? (\n\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemSelect])}>\n\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t{this.wcagSelectLabel}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\tsize=\"m\"\n\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\twcag-labelled-by={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={this.pagination.currentPage === page}>\n\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{this.pagination.pages.map(page => (\n\t\t\t\t\t\t\t\t\t<li class={this.isActivePageClass(PaginationClass.item, page)}>{pageResolver(page, page, '')}</li>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{this.pagination.totalPages ? (\n\t\t\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemMore])}>\n\t\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t\t{this.wcagSelectLabel}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\t\tsize=\"m\"\n\t\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\t\twcag-labelled-by={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\t\tref={el => (this.spreadSelectRef = el as HTMLGovFormSelectElement)}\n\t\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t\t<option selected hidden>...</option>\n\t\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={false}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-right\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelNext\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-right\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelEnd\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: CustomEvent, page: number): void {\n\t\te.stopPropagation()\n\t\tthis.recalculatePagination(page)\n\t\tthis.govPage.emit({\n\t\t\tcomponent: PaginationClass.root,\n\t\t\tpagination: this.pagination\n\t\t})\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormSelectEvent>): void {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.value\n\t\tconst page = parseInt(value)\n\t\tthis.resetSelectValue()\n\t\tif (isNaN(page) === false) {\n\t\t\tthis.recalculatePagination(page)\n\t\t\tif (this.link) {\n\t\t\t\twindow.location.href = this.prepareLinkUrl(page)\n\t\t\t} else {\n\t\t\t\tthis.govPage.emit({\n\t\t\t\t\tcomponent: PaginationClass.root,\n\t\t\t\t\tpagination: this.pagination\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagPageLabel, \"wcag-page-label\", PaginationClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root)\n\t}\n}\n"],"mappings":"wbAKO,MAAMA,EAAkBC,EAAKC,EAAO,CAAC,KAAM,OAG3C,MAAMC,EAAqBF,EAAKG,EAAU,CAAC,UAAW,cAG7D,IAAYC,GAAZ,SAAYA,GACXA,EAAA,mBACAA,EAAA,kBACA,EAHD,CAAYA,MAAe,KAMpB,MAAMC,EAAkB,CAC9BC,KAAM,iBACNC,KAAM,uBACNC,KAAM,uBACNC,UAAW,8BACXC,SAAU,6BACVC,WAAY,+BACZC,MAAO,wBACPC,MAAO,yB,SCbQC,EAASC,EAAoBC,EAAc,EAAGC,EAAW,GAAIC,EAAW,IAEvF,MAAMC,EAAaC,KAAKC,KAAKN,EAAaE,GAG1C,GAAID,EAAc,EAAG,CACpBA,EAAc,C,MACR,GAAIA,EAAcG,EAAY,CACpCH,EAAcG,C,CAGf,IAAIG,EAAmBC,EACvB,GAAIJ,GAAcD,EAAU,CAE3BI,EAAY,EACZC,EAAUJ,C,KACJ,CAEN,MAAMK,EAA4BJ,KAAKK,MAAMP,EAAW,GACxD,MAAMQ,EAA2BN,KAAKC,KAAKH,EAAW,GA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AIzB,KAAK2B,KAAM,CACdiD,OAAOC,SAASjC,KAAO5C,KAAK0B,eAAeD,E,KACrC,CACNzB,KAAKsE,QAAQC,KAAK,CACjBC,UAAWhH,EAAgBC,KAC3B4D,WAAYrB,KAAKqB,Y,GAUrB,kBAAMD,GACL0D,EAAiB9E,KAAKiD,cAAe,kBAAmBzF,EAAgBC,MACxEsH,EAAkB/E,KAAKqD,UAAWrD,KAAKsD,eAAgB9F,EAAgBC,K"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as s,a as i,g as a}from"./p-5bc604a3.js";import{c as e}from"./p-24636c53.js";import{g as o,t as r}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as s,a as i,g as a}from"./p-5bc604a3.js";import{c as e}from"./p-24636c53.js";import{g as o,t as r}from"./p-5de606f8.js";import{T as n}from"./p-fa1e4aea.js";import"./p-ff7365ae.js";import"./p-03990da5.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-tabs-item{color:var(--gov-tabs-text-color, var(--gov-color-secondary-700))}.gov-tabs-item__inner>*:last-child{margin-bottom:0}";const h=class{constructor(s){t(this,s);this.identifier=undefined;this.triggerIdentifier=undefined;this.label=undefined;this.default=false;this.isActive=false;this.h=o(this.host);this.contentId=e("GovTabContent");this.triggerId=e("GovTabTrigger")}render(){return s(i,{class:this.h.classes(n.root),default:this.default},s("div",{class:n.inner,role:"tabpanel",id:this.identifier||this.contentId,hidden:!this.isActive,"aria-labelledby":this.triggerIdentifier||this.triggerId,"aria-hidden":r(!this.isActive)},s("slot",null)))}async getIdentifier(){return this.identifier||this.contentId}async getTriggerIdentifier(){return this.triggerIdentifier||this.triggerId}async setActiveStatus(t){this.isActive=t}get host(){return a(this)}};h.style=c;export{h as gov_tabs_item};
|
|
2
|
+
//# sourceMappingURL=p-53e0ad52.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,c as t,h as i,a as s,g as r}from"./p-5bc604a3.js";import{g as n,a as e}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as o,c as t,h as i,a as s,g as r}from"./p-5bc604a3.js";import{g as n,a as e}from"./p-5de606f8.js";import{c as a}from"./p-24636c53.js";import{B as d}from"./p-4c55142b.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-03990da5.js";const c={triggerEvents:"click",exclude:""};function p(o,t,i,s=c){const r=g(s);h(s).forEach((s=>{window.addEventListener(s,(s=>{l(s,o,t,i,r)}),false)}))}function l(o,t,i,s,r){const n=o.target;if(!i.contains(n)&&!f(n,r)){s.call(t)}}function h(o){if(o.triggerEvents){return o.triggerEvents.split(",").map((o=>o.trim()))}return["click"]}function g(o){if(o.exclude){try{return Array.from(document.querySelectorAll(o.exclude))}catch(t){console.warn(`@ClickOutside: Exclude: '${o.exclude}' will not be evaluated. Check your exclude selector syntax.`,t)}}return}function f(o,t){if(o&&t){for(let i of t){if(i.contains(o)){return true}}}return false}var u;(function(o){o["LEFT"]="left";o["RIGHT"]="right"})(u||(u={}));const v={root:"gov-dropdown",list:"gov-dropdown__list"};const m=".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-dropdown{position:relative}.gov-dropdown__list{position:absolute;left:0;z-index:100}.gov-dropdown ul{padding:0.25rem;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-dropdown-bg-color, var(--gov-color-neutral-white));box-shadow:var(--gov-dropdown-box-shadow, 0 0.25rem 1.25rem rgba(0, 0, 0, 0.1))}.gov-dropdown li{margin:0;white-space:nowrap}.gov-dropdown li::before{content:none}.gov-dropdown li>*{width:100%}.gov-dropdown li>* .element{justify-content:space-between;width:100%}.gov-dropdown[position=right] .gov-dropdown__list{right:0;left:initial}";const w=class{constructor(i){o(this,i);this.govChange=t(this,"gov-change",7);this.open=false;this.position=u.LEFT;this.h=n(this.host);this.listId=a("GovDropdownList");this.controlId=a("GovDropdownControl")}componentWillLoad(){if(this.trigger){this.trigger.setAttribute("wcag-controls",this.listId);this.trigger.setAttribute("wcag-has-popup",e(!!this.list));this.trigger.setAttribute("identifier",this.controlId);this.trigger.addEventListener("gov-click",(o=>{o.preventDefault();o.stopPropagation();this.open=!this.open;this.govChange.emit({component:v.root,originalEvent:o,open:this.open})}))}}get trigger(){return this.host.querySelector(`* > ${d.root}`)}get list(){return this.h.getSlot("list")}render(){return i(s,{class:this.h.classes([v.root]),open:this.open,position:this.position},i("slot",null),i("div",{ref:o=>p(this,o,(()=>this.open=false)),class:v.list,id:this.listId,"aria-labelledby":this.controlId,"aria-hidden":e(!this.open),hidden:!this.open},i("slot",{name:"list"})))}async getState(){return this.open}async setOpen(o){this.open=o}get host(){return r(this)}};w.style=m;export{w as gov_dropdown};
|
|
2
|
+
//# sourceMappingURL=p-54fa7af5.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,h as i,a as e,g as o}from"./p-5bc604a3.js";import{g as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,h as i,a as e,g as o}from"./p-5bc604a3.js";import{g as s}from"./p-5de606f8.js";import{v as a}from"./p-dcb5fb35.js";import{a as n,c as r}from"./p-17ebfe85.js";import"./p-7f2c9830.js";import"./p-003e6cca.js";import"./p-03990da5.js";import"./p-ff7365ae.js";const m=".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-statsbar-item{position:relative;display:block;padding:1.25rem}.gov-statsbar-item__icon,.gov-statsbar-item__number{margin-bottom:1rem}.gov-statsbar-item__icon,.gov-statsbar-item__icon .gov-icon{display:block;width:2rem;height:2rem}.gov-statsbar-item__number{font-weight:var(--gov-text-5xl-font-weight);font-size:var(--gov-text-5xl-font-size);line-height:var(--gov-text-5xl-line-height);letter-spacing:var(--gov-text-5xl-letter-spacing)}.gov-statsbar-item__text{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);letter-spacing:0.0125em}.gov-statsbar-item__text>*:last-child{margin-bottom:0}.gov-statsbar-item[icon-position=left]{padding-left:3rem}.gov-statsbar-item[icon-position=left] .gov-statsbar-item__icon{position:absolute;top:1.5rem;left:0}@media (min-width: 30em){.gov-statsbar-item{flex:1 0 50%;max-width:50%}}@media (min-width: 48em){.gov-statsbar-item{padding:2.5rem}.gov-statsbar-item__icon,.gov-statsbar-item__icon .gov-icon{width:3rem;height:3rem}.gov-statsbar-item[icon-position=left]{padding-left:4rem}.gov-statsbar-item[icon-position=left] .gov-statsbar-item__icon{top:2.75rem}}@media (min-width: 64em){.gov-statsbar-item{flex-basis:auto;max-width:25%}}";const g=class{constructor(i){t(this,i);this.iconPosition=undefined;this.h=s(this.host)}validateIconPosition(t){a(r,t,n.root)}componentWillLoad(){this.validateIconPosition(this.iconPosition)}render(){return i(e,{class:this.h.classes(n.root)},i("article",null,this.h.hasSlot("icon")&&i("span",{class:n.icon},i("slot",{name:"icon"})),i("p",{class:n.number},i("slot",null)),this.h.hasSlot("text")&&i("div",{class:n.text},i("slot",{name:"text"}))))}get host(){return o(this)}static get watchers(){return{iconPosition:["validateIconPosition"]}}};g.style=m;export{g as gov_statsbar_item};
|
|
2
|
+
//# sourceMappingURL=p-555eaa93.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,c as t,h as r,a,g as s}from"./p-5bc604a3.js";import{v as i}from"./p-dcb5fb35.js";import{V as e,T as n}from"./p-ff7365ae.js";import{p as v}from"./p-03990da5.js";import{g as c}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as o,c as t,h as r,a,g as s}from"./p-5bc604a3.js";import{v as i}from"./p-dcb5fb35.js";import{V as e,T as n}from"./p-ff7365ae.js";import{p as v}from"./p-03990da5.js";import{g as c}from"./p-5de606f8.js";import{c as g}from"./p-24636c53.js";import"./p-7f2c9830.js";import"./p-003e6cca.js";const l=v(e,["SUCCESS","WARNING","ERROR","SECONDARY","PRIMARY"]);v(n,["CLASSIC","SOLID"]);const d={root:"gov-toast",hidden:"gov-toast--hidden",icon:"gov-toast__icon",content:"gov-toast__content",close:"gov-toast__close",timer:"gov-toast__timer"};const m=".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-toast{position:relative;display:flex;gap:1rem;flex-direction:column;padding:0.75rem 1rem;border-left:0.25rem solid transparent;background:var(--gov-toast-message-bg, var(--gov-color-neutral-white));z-index:301;position:relative;position:fixed;max-width:23.4375rem;padding-right:3.125rem;opacity:1;transition:opacity 300ms ease-in-out}.gov-toast__icon{flex:0 0 1.25rem;width:1.25rem;height:1.25rem}.gov-toast__content{flex:1 1 auto}.gov-toast__content>*:last-child{margin-bottom:0}.gov-toast__content p{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}@media (min-width: 30em){.gov-toast{flex-direction:row}}.gov-toast__content{padding-right:0}.gov-toast__close{position:absolute;top:0.5rem;right:0.75rem}.gov-toast__timer{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}.gov-toast--hidden{opacity:0}.gov-toast[gravity=top i]{top:1rem}.gov-toast[gravity=bottom i]{bottom:1rem}.gov-toast[position=left i]{left:1rem}.gov-toast[position=center i]{left:50%;transform:translateX(-50%)}.gov-toast[position=right i]{right:1rem}.gov-toast[type=solid i]{border:none;border-radius:0.25rem;overflow:hidden;box-shadow:none}.gov-toast[type=solid i].is-initialized .gov-toast__timer{transform-origin:right;animation:countdown linear forwards var(--toast-duration, 0)}.gov-toast[variant=warning]{border-left-color:var(--gov-toast-warning-codecor-lor, var(--gov-color-warning))}.gov-toast[variant=warning] .gov-toast__icon{color:var(--gov-toast-warning-codecor-lor, var(--gov-color-warning))}.gov-toast[variant=warning][type=solid i]{background-color:var(--gov-toast-warning-background, var(--gov-color-warning));color:var(--gov-toast-warning-color, var(--gov-color-secondary))}.gov-toast[variant=warning][type=solid i] .gov-toast__icon{color:var(--gov-toast-warning-color, var(--gov-color-secondary))}.gov-toast[variant=warning][type=solid i] .gov-toast__timer{background-color:var(--gov-toast-warning-timer-background, rgba(var(--gov-color-warning-500-rgb), 0.3))}.gov-toast[variant=error]{border-left-color:var(--gov-toast-error-colodecor-r, var(--gov-color-error))}.gov-toast[variant=error] .gov-toast__icon{color:var(--gov-toast-error-colodecor-r, var(--gov-color-error))}.gov-toast[variant=error][type=solid i]{background-color:var(--gov-toast-error-background, var(--gov-color-error));color:var(--gov-toast-error-color, var(--gov-color-neutral-white))}.gov-toast[variant=error][type=solid i] .gov-toast__icon{color:var(--gov-toast-error-color, var(--gov-color-neutral-white))}.gov-toast[variant=error][type=solid i] .gov-toast__timer{background-color:var(--gov-toast-error-timer-background, rgba(var(--gov-color-error-500-rgb), 0.5))}.gov-toast[variant=success]{border-left-color:var(--gov-toast-success-codecor-lor, var(--gov-color-success))}.gov-toast[variant=success] .gov-toast__icon{color:var(--gov-toast-success-codecor-lor, var(--gov-color-success))}.gov-toast[variant=success][type=solid i]{background-color:var(--gov-toast-success-background, var(--gov-color-success-500));color:var(--gov-toast-success-color, var(--gov-color-neutral-white))}.gov-toast[variant=success][type=solid i] .gov-toast__icon{color:var(--gov-toast-success-color, var(--gov-color-neutral-white))}.gov-toast[variant=success][type=solid i] .gov-toast__timer{background-color:var(--gov-toast-success-timer-background, rgba(var(--gov-color-success-600-rgb), 0.5))}.gov-toast[variant=primary]{border-left-color:var(--gov-toast-primary-codecor-lor, var(--gov-color-primary))}.gov-toast[variant=primary] .gov-toast__icon{color:var(--gov-toast-primary-codecor-lor, var(--gov-color-primary))}.gov-toast[variant=primary][type=solid i]{background-color:var(--gov-toast-primary-background, var(--gov-color-primary));color:var(--gov-toast-primary-color, var(--gov-color-neutral-white))}.gov-toast[variant=primary][type=solid i] .gov-toast__icon{color:var(--gov-toast-primary-color, var(--gov-color-neutral-white))}.gov-toast[variant=primary][type=solid i] .gov-toast__timer{background-color:var(--gov-toast-primary-timer-background, rgba(var(--gov-color-primary-700-rgb), 0.5))}.gov-toast[variant=secondary]{border-left-color:var(--gov-toast-secondary-decor-color, var(--gov-color-secondary))}.gov-toast[variant=secondary] .gov-toast__icon{color:var(--gov-toast-secondary-decor-color, var(--gov-color-secondary))}.gov-toast[variant=secondary][type=solid i]{background-color:var(--gov-toast-secondary-background, var(--gov-color-secondary));color:var(--gov-toast-secondary-color, var(--gov-color-neutral-white))}.gov-toast[variant=secondary][type=solid i] .gov-toast__icon{color:var(--gov-toast-secondary-color, var(--gov-color-neutral-white))}.gov-toast[variant=secondary][type=solid i] .gov-toast__timer{background-color:var(--gov-toast-secondary-timer-background, rgba(var(--gov-color-secondary-900-rgb), 0.5))}@media (min-width: 30em){.gov-toast__content{padding-right:2rem}}";const p=class{constructor(r){o(this,r);this.govClose=t(this,"gov-close",7);this.variant="primary";this.gravity="top";this.position="right";this.type="classic";this.time=0;this.closeLabel=undefined;this.wcagCloseLabel=undefined;this.h=c(this.host);this.toastId=g("GovToast")}validateVariant(o){i(l,o,d.root)}componentWillLoad(){this.validateVariant(this.variant);this.runTimer()}disconnectedCallback(){clearTimeout(this.timeout)}runTimer(){if(this.isSolid){this.host.classList.add("is-initialized")}if(this.isTimer){this.timeout=setTimeout((()=>{this.host.classList.add(d.hidden);setTimeout((()=>{this.destroy().catch();this.govClose.emit(this.toastId)}),600)}),this.time)}}render(){return r(a,{class:this.h.classes([d.root,"gov-box-shadow--m"]),"data-toast-id":this.toastId,gravity:this.gravity,position:this.position,variant:this.variant,type:this.type,style:{"--toast-duration":this.time+"ms"}},this.h.hasSlot("icon")&&r("span",{class:d.icon},r("slot",{name:"icon"})),r("div",{class:d.content,"aria-live":"polite",role:"status"},r("slot",null)),r("div",{class:d.close},r("gov-button",{size:"s","wcag-label":this.wcagCloseLabel,variant:this.isSolid?this.variant:"secondary",inverse:this.isSolid,type:"base","on-gov-click":this.onCloseHandler.bind(this)},this.closeLabel?this.closeLabel:r("gov-icon",{name:"x-lg"}))),r("div",{class:d.timer}))}onCloseHandler(){this.destroy().then((()=>this.govClose.emit(this.toastId))).catch()}get isSolid(){return this.type==="solid"}get isTimer(){return Number.isInteger(this.time)&&this.time>0}async destroy(){clearTimeout(this.timeout);const o=document.querySelector(`[data-toast-id="${this.toastId}"]`);if(o){o.classList.add(d.hidden);if(typeof o.remove==="function"){o.remove()}}}get host(){return s(this)}static get watchers(){return{variant:["validateVariant"]}}};p.style=m;export{p as gov_toast};
|
|
2
|
+
//# sourceMappingURL=p-55cb727e.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=e=>{if(Array.isArray(e)===false)return;return e.filter((e=>!!e)).join(" ").trim()};const t=e=>{const t=e.querySelector("slot");if(t){return t.assignedNodes().filter((e=>e.nodeName!=="#text"))}return[]};const r=e=>e?"true":"false";const s=e=>({get hostElement(){return e},get name(){return this.hostElement.nodeName.toLowerCase()},hasSlot(e){return!!this.getSlot(e)},isSlotEmpty(e){const t=this.getSlot(e);if(t){return t.childNodes.length===0}return false},getSlot(e){return this.hostElement.querySelector('[slot="'+e+'"]')},getParent(e){return this.hostElement.closest(e)},passChildAttr(e,t,r){if(Array.isArray(e)){e.forEach((e=>{this.hostElement.querySelectorAll(e).forEach((e=>e.setAttribute(t,r)))}))}else{this.hostElement.querySelectorAll(e).forEach((e=>e.setAttribute(t,r)))}},removeChildAttr(e,t){if(Array.isArray(e)){e.forEach((e=>{this.hostElement.querySelectorAll(e).forEach((e=>e.removeAttribute(t)))}))}else{this.hostElement.querySelectorAll(e).forEach((e=>e.removeAttribute(t)))}},get slottedChildren(){const e=this.hostElement.shadowRoot.querySelector("slot");if(e){return e.assignedNodes().filter((e=>e.nodeName!=="#text"))}return[]},classes(e){const t=Array.isArray(e)?e.join(" "):e;if(this.hostElement){return this.hostElement.classList.toString()+" "+t}return t}});const n=e=>{if(typeof e==="string"){return["true","True","TRUE","1"].indexOf(e)!==-1?"true":"false"}else if(typeof e==="number"){return e>0?"true":"false"}else if(typeof e==="boolean"){return e?"true":"false"}else{return e?"true":"false"}};const o=e=>{if(typeof e==="string"){return["true","True","TRUE","1","On","on","ON"].indexOf(e)!==-1?"on":"off"}else if(typeof e==="number"){return e>0?"on":"off"}else if(typeof e==="boolean"){return e?"on":"off"}else{return e?"on":"off"}};const f=e=>typeof e==="undefined"?undefined:n(e);const u=e=>typeof e==="undefined"?undefined:o(e);export{n as a,r as b,
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
const e=e=>{if(Array.isArray(e)===false)return;return e.filter((e=>!!e)).join(" ").trim()};const t=e=>{const t=e.querySelector("slot");if(t){return t.assignedNodes().filter((e=>e.nodeName!=="#text"))}return[]};const r=e=>e?"true":"false";const s=e=>({get hostElement(){return e},get name(){return this.hostElement.nodeName.toLowerCase()},hasSlot(e){return!!this.getSlot(e)},isSlotEmpty(e){const t=this.getSlot(e);if(t){return t.childNodes.length===0}return false},getSlot(e){return this.hostElement.querySelector('[slot="'+e+'"]')},getParent(e){return this.hostElement.closest(e)},passChildAttr(e,t,r){if(Array.isArray(e)){e.forEach((e=>{this.hostElement.querySelectorAll(e).forEach((e=>e.setAttribute(t,r)))}))}else{this.hostElement.querySelectorAll(e).forEach((e=>e.setAttribute(t,r)))}},removeChildAttr(e,t){if(Array.isArray(e)){e.forEach((e=>{this.hostElement.querySelectorAll(e).forEach((e=>e.removeAttribute(t)))}))}else{this.hostElement.querySelectorAll(e).forEach((e=>e.removeAttribute(t)))}},get slottedChildren(){const e=this.hostElement.shadowRoot.querySelector("slot");if(e){return e.assignedNodes().filter((e=>e.nodeName!=="#text"))}return[]},classes(e){const t=Array.isArray(e)?e.join(" "):e;if(this.hostElement){return this.hostElement.classList.toString()+" "+t}return t}});const n=e=>{if(typeof e==="string"){return["true","True","TRUE","1"].indexOf(e)!==-1?"true":"false"}else if(typeof e==="number"){return e>0?"true":"false"}else if(typeof e==="boolean"){return e?"true":"false"}else{return e?"true":"false"}};const o=e=>{if(typeof e==="string"){return["true","True","TRUE","1","On","on","ON"].indexOf(e)!==-1?"on":"off"}else if(typeof e==="number"){return e>0?"on":"off"}else if(typeof e==="boolean"){return e?"on":"off"}else{return e?"on":"off"}};const f=e=>typeof e==="undefined"?undefined:n(e);const u=e=>typeof e==="undefined"?undefined:o(e);const i=e=>e?"0":"-1";export{n as a,r as b,i as c,u as d,s as g,e as p,t as s,f as t};
|
|
2
|
+
//# sourceMappingURL=p-5de606f8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["prepareClasses","classes","Array","isArray","filter","classname","join","trim","slottedChildren","host","slotted","querySelector","assignedNodes","node","nodeName","booleanString","value","govHost","hostElement","name","this","toLowerCase","hasSlot","getSlot","isSlotEmpty","slot","childNodes","length","getParent","element","closest","passChildAttr","selector","forEach","querySelectorAll","child","setAttribute","removeChildAttr","removeAttribute","shadowRoot","clearClasses","classList","toString","toBoolAttr","indexOf","toOnOffAttr","toBoolAttrIfDefined","undefined","toOnOffAttrIfDefined","boolToFocusValue"],"sources":["../../../packages/core/src/helpers/Dom/template.ts"],"sourcesContent":["import {HTMLStencilElement} from '@stencil/core/internal'\nimport {GovHost} from './template.types'\nimport {Nullable} from '../../types/interfaces'\n\nexport const prepareClasses = (classes: string[]): string => {\n\tif (Array.isArray(classes) === false) return\n\treturn classes\n\t\t.filter(classname => !!classname)\n\t\t.join(' ')\n\t\t.trim()\n}\n\nexport const slottedChildren = (host: HTMLStencilElement): Node[] => {\n\tconst slotted = host.querySelector('slot') as HTMLSlotElement\n\tif (slotted) {\n\t\treturn slotted.assignedNodes().filter(node => {\n\t\t\treturn node.nodeName !== '#text'\n\t\t})\n\t}\n\treturn []\n}\n\nexport const booleanString = (value: boolean): string => {\n\treturn value ? 'true' : 'false'\n}\n\nexport const govHost = (host: HTMLStencilElement): GovHost => {\n\treturn {\n\t\tget hostElement(): HTMLStencilElement {\n\t\t\treturn host\n\t\t},\n\t\tget name(): string {\n\t\t\treturn this.hostElement.nodeName.toLowerCase()\n\t\t},\n\t\thasSlot(name: string): boolean {\n\t\t\treturn !!this.getSlot(name)\n\t\t},\n\t\tisSlotEmpty(name: string): boolean {\n\t\t\tconst slot = this.getSlot(name)\n\t\t\tif (slot) {\n\t\t\t\treturn slot.childNodes.length === 0\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tgetSlot(name: string): HTMLElement {\n\t\t\treturn this.hostElement.querySelector('[slot=\"' + name + '\"]')\n\t\t},\n\t\tgetParent(element): Nullable<HTMLElement> {\n\t\t\treturn this.hostElement.closest(element)\n\t\t},\n\t\tpassChildAttr(selector: string | string[], name: string, value: any): void {\n\t\t\tif (Array.isArray(selector)) {\n\t\t\t\tselector.forEach(selector => {\n\t\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.setAttribute(name, value))\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.setAttribute(name, value))\n\t\t\t}\n\t\t},\n\t\tremoveChildAttr(selector: string | string[], name: string): void {\n\t\t\tif (Array.isArray(selector)) {\n\t\t\t\tselector.forEach(selector => {\n\t\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.removeAttribute(name))\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.removeAttribute(name))\n\t\t\t}\n\t\t},\n\t\tget slottedChildren(): Node[] {\n\t\t\tconst slotted = this.hostElement.shadowRoot.querySelector('slot') as HTMLSlotElement\n\t\t\tif (slotted) {\n\t\t\t\treturn slotted.assignedNodes().filter(node => {\n\t\t\t\t\treturn node.nodeName !== '#text'\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t\tclasses(classes: string | string[]): string {\n\t\t\tconst clearClasses = Array.isArray(classes) ? classes.join(' ') : classes\n\t\t\tif (this.hostElement) {\n\t\t\t\treturn this.hostElement.classList.toString() + ' ' + clearClasses\n\t\t\t}\n\t\t\treturn clearClasses\n\t\t},\n\t}\n}\n\nexport const toBoolAttr = (value: boolean | string | number): string => {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1 ? 'true' : 'false'\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0 ? 'true' : 'false'\n\t} else if (typeof value === 'boolean') {\n\t\treturn value ? 'true' : 'false'\n\t} else {\n\t\treturn value ? 'true' : 'false'\n\t}\n}\n\nexport const toOnOffAttr = (value: boolean | string | number): string => {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1', 'On', 'on', 'ON'].indexOf(value) !== -1 ? 'on' : 'off'\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0 ? 'on' : 'off'\n\t} else if (typeof value === 'boolean') {\n\t\treturn value ? 'on' : 'off'\n\t} else {\n\t\treturn value ? 'on' : 'off'\n\t}\n}\n\nexport const toBoolAttrIfDefined = (value: boolean | string | number | undefined | null): undefined | string => {\n\treturn typeof value === 'undefined' ? undefined : toBoolAttr(value)\n}\n\nexport const toOnOffAttrIfDefined = (value: boolean | string | number | undefined | null): undefined | string => {\n\treturn typeof value === 'undefined' ? undefined : toOnOffAttr(value)\n}\n\nexport const boolToFocusValue = (value: boolean): undefined | string => {\n\treturn value ? '0' : '-1'\n}\n"],"mappings":"MAIaA,EAAkBC,IAC9B,GAAIC,MAAMC,QAAQF,KAAa,MAAO,OACtC,OAAOA,EACLG,QAAOC,KAAeA,IACtBC,KAAK,KACLC,MAAM,E,MAGIC,EAAmBC,IAC/B,MAAMC,EAAUD,EAAKE,cAAc,QACnC,GAAID,EAAS,CACZ,OAAOA,EAAQE,gBAAgBR,QAAOS,GAC9BA,EAAKC,WAAa,S,CAG3B,MAAO,EAAE,E,MAGGC,EAAiBC,GACtBA,EAAQ,OAAS,Q,MAGZC,EAAWR,IAChB,CACN,eAAIS,GACH,OAAOT,C,EAER,QAAIU,GACH,OAAOC,KAAKF,YAAYJ,SAASO,a,EAElC,OAAAC,CAAQH,GACP,QAASC,KAAKG,QAAQJ,E,EAEvB,WAAAK,CAAYL,GACX,MAAMM,EAAOL,KAAKG,QAAQJ,GAC1B,GAAIM,EAAM,CACT,OAAOA,EAAKC,WAAWC,SAAW,C,CAEnC,OAAO,K,EAER,OAAAJ,CAAQJ,GACP,OAAOC,KAAKF,YAAYP,cAAc,UAAYQ,EAAO,K,EAE1D,SAAAS,CAAUC,GACT,OAAOT,KAAKF,YAAYY,QAAQD,E,EAEjC,aAAAE,CAAcC,EAA6Bb,EAAcH,GACxD,GAAId,MAAMC,QAAQ6B,GAAW,CAC5BA,EAASC,SAAQD,IAChBZ,KAAKF,YAAYgB,iBAAiBF,GAAUC,SAAQE,GAASA,EAAMC,aAAajB,EAAMH,IAAO,G,KAExF,CACNI,KAAKF,YAAYgB,iBAAiBF,GAAUC,SAAQE,GAASA,EAAMC,aAAajB,EAAMH,I,GAGxF,eAAAqB,CAAgBL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UAAYF,EAAY7B,G,MAGlDiC,EAAoBjC,GACzBA,EAAQ,IAAM,Y"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,h as e,a as o,g as a}from"./p-5bc604a3.js";import{v as s}from"./p-dcb5fb35.js";import{V as g}from"./p-ff7365ae.js";import{p as v}from"./p-03990da5.js";import{g as n}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r,h as e,a as o,g as a}from"./p-5bc604a3.js";import{v as s}from"./p-dcb5fb35.js";import{V as g}from"./p-ff7365ae.js";import{p as v}from"./p-03990da5.js";import{g as n}from"./p-5de606f8.js";import"./p-7f2c9830.js";import"./p-003e6cca.js";v(g,["PRIMARY","SECONDARY","WARNING","ERROR","SUCCESS"]);const i={root:"gov-message",icon:"gov-message__icon",content:"gov-message__content",close:"gov-message__close"};const t='.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-message{position:relative;display:flex;gap:1rem;flex-direction:column;padding:0.75rem 1rem;border-left:0.25rem solid transparent;background:var(--gov-toast-message-bg, var(--gov-color-neutral-white))}.gov-message__icon{flex:0 0 1.25rem;width:1.25rem;height:1.25rem}.gov-message__content{flex:1 1 auto}.gov-message__content>*:last-child{margin-bottom:0}.gov-message__content p{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}@media (min-width: 30em){.gov-message{flex-direction:row}}.gov-message[shadow=""],.gov-message[shadow=true i],.gov-message[shadow="1"]{box-shadow:var(--gov-message-box-shadow, 0 0.25rem 1.25rem rgba(0, 0, 0, 0.1))}.gov-message[variant=warning]{border-left-color:var(--gov-message-warning-color, var(--gov-color-warning));background:var(--gov-message-warning-bg-color, var(--gov-color-warning-100))}.gov-message[variant=warning] .gov-message__icon{color:var(--gov-message-warning-color, var(--gov-color-warning))}.gov-message[variant=warning][inverse=""],.gov-message[variant=warning][inverse=true i],.gov-message[variant=warning][inverse="1"]{background:var(--gov-message-bg-inverse, var(--gov-color-neutral-white))}.gov-message[variant=error]{border-left-color:var(--gov-message-error-color, var(--gov-color-error));background:var(--gov-message-error-bg-color, var(--gov-color-error-100))}.gov-message[variant=error] .gov-message__icon{color:var(--gov-message-error-color, var(--gov-color-error))}.gov-message[variant=error][inverse=""],.gov-message[variant=error][inverse=true i],.gov-message[variant=error][inverse="1"]{background:var(--gov-message-bg-inverse, var(--gov-color-neutral-white))}.gov-message[variant=secondary]{border-left-color:var(--gov-message-secondary-color, var(--gov-color-secondary));background:var(--gov-message-secondary-bg-color, var(--gov-color-secondary-200))}.gov-message[variant=secondary] .gov-message__icon{color:var(--gov-message-secondary-color, var(--gov-color-secondary))}.gov-message[variant=secondary][inverse=""],.gov-message[variant=secondary][inverse=true i],.gov-message[variant=secondary][inverse="1"]{background:var(--gov-message-bg-inverse, var(--gov-color-neutral-white))}.gov-message[variant=success]{border-left-color:var(--gov-message-success-color, var(--gov-color-success));background:var(--gov-message-success-bg-color, var(--gov-color-success-100))}.gov-message[variant=success] .gov-message__icon{color:var(--gov-message-success-color, var(--gov-color-success))}.gov-message[variant=success][inverse=""],.gov-message[variant=success][inverse=true i],.gov-message[variant=success][inverse="1"]{background:var(--gov-message-bg-inverse, var(--gov-color-neutral-white))}.gov-message[variant=primary]{border-left-color:var(--gov-message-primary-color, var(--gov-color-primary));background:var(--gov-message-primary-bg-color, var(--gov-color-primary-100))}.gov-message[variant=primary] .gov-message__icon{color:var(--gov-message-primary-color, var(--gov-color-primary))}.gov-message[variant=primary][inverse=""],.gov-message[variant=primary][inverse=true i],.gov-message[variant=primary][inverse="1"]{background:var(--gov-message-bg-inverse, var(--gov-color-neutral-white))}';const c=class{constructor(e){r(this,e);this.variant=g.PRIMARY;this.h=n(this.host)}validateVariant(r){s(g,r,i.root)}render(){return e(o,{class:this.h.classes(i.root),variant:this.variant,role:"alert"},this.h.hasSlot("icon")&&e("span",{class:i.icon},e("slot",{name:"icon"})),e("div",{class:i.content},e("slot",null)))}get host(){return a(this)}static get watchers(){return{variant:["validateVariant"]}}};c.style=t;export{c as gov_message};
|
|
2
|
+
//# sourceMappingURL=p-60d681a6.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,c as a,h as e,a as t,g as i}from"./p-5bc604a3.js";import{g as r,a as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as o,c as a,h as e,a as t,g as i}from"./p-5bc604a3.js";import{g as r,a as s}from"./p-5de606f8.js";import{c as d}from"./p-003e6cca.js";import{a as l}from"./p-7f2c9830.js";import{a as n}from"./p-7724b535.js";import{c as m}from"./p-24636c53.js";import{d as g}from"./p-03990da5.js";import{M as c}from"./p-be4aab0e.js";const h='.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-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const v=class{constructor(e){o(this,e);this.govClose=a(this,"gov-close",7);this.open=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=r(this.host);this.labelId=m("GovPromptLabel");this.contentId=m("GovPromptContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){l(`[${c.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(c.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(c.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(d()){await g(500);await this.validateWcag()}}render(){const o=this.labelTag;return e(t,{class:this.h.classes(c.rootPrompt),open:this.open},e("dialog",{class:c.dialog,hidden:!this.open,tabindex:"-1",open:this.open,"aria-modal":"true","aria-hidden":s(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},e("div",{class:c.inner},e("div",{class:c.header},this.h.hasSlot("icon")&&e("div",{class:c.icon},e("slot",{name:"icon"})),this.label&&e(o,{class:c.title,id:this.labelId},this.label),e("gov-button",{class:c.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base",ref:o=>this.closeCtaRef=o,"on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"x-lg"}))),e("div",{class:c.content,id:this.contentId},e("slot",null)),e("div",{class:c.actions},e("slot",{name:"actions"})))),this.open?e("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(o){o.stopPropagation();this.hideModal();this.govClose.emit(o)}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){n(this.wcagLabelledBy,"wcag-labelled-by",c.root);n(this.wcagDescribedBy,"wcag-described-by",c.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}};v.style=h;export{v as gov_prompt};
|
|
2
|
+
//# sourceMappingURL=p-64c5748e.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govPromptCss","GovPrompt","constructor","hostRef","this","h","govHost","host","labelId","createID","contentId","validateLabelTag","newValue","validTags","includes","govErrorLog","ModalClass","root","watchOpen","open","closeCtaRef","setFocus","catch","showModal","document","body","classList","add","bodyFix","hideModal","remove","componentWillRender","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","LabelTag","labelTag","Host","class","classes","rootPrompt","dialog","hidden","tabindex","toBoolAttr","wcagLabelledBy","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","close","variant","wcagLabel","wcagCloseLabel","wcagCloseLabelledBy","type","ref","el","onCloseHandler","bind","content","actions","e","stopPropagation","govClose","emit","show","hide","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-promp/gov-prompt.scss?tag=gov-prompt","../../../packages/core/src/components/gov-promp/gov-prompt.tsx"],"sourcesContent":["/*\n * Prompt\n */\n\n// $class: \".gov-prompt\";\n@import \"../gov-modal/gov-modal.scss\";\n\n// #{$class} {\n// \t//\n// }\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {govErrorLog} from '../../helpers/Log/gov.log'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {delay} from '../../utils/utils'\nimport {ModalClass} from '../gov-modal/constants'\n\n@Component({\n\ttag: 'gov-prompt',\n\tstyleUrl: 'gov-prompt.scss',\n})\nexport class GovPrompt {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovPromptLabel')\n\t\tthis.contentId = createID('GovPromptContent')\n\t}\n\n\t@Element() host: HTMLGovPromptElement\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the modal 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: 'wcag-labelled-by'}) wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'wcag-close-label'}) readonly wcagCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({attribute: 'wcag-close-labelled-by'}) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('labelTag')\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tif (newValue && this.closeCtaRef) {\n\t\t\tthis.closeCtaRef.setFocus().catch()\n\t\t}\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.rootPrompt)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\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.wcagLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\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\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.wcagCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\tref={el => (this.closeCtaRef = el)}\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 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={ModalClass.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<div class={ModalClass.actions}>\n\t\t\t\t\t\t\t<slot name=\"actions\"/>\n\t\t\t\t\t\t</div>\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 wcag-label={this.wcagCloseLabel} wcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}/>\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\tthis.hideModal()\n\t\tthis.govClose.emit(e)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root)\n\t}\n}\n"],"mappings":"mUAAA,MAAMA,EAAe,wyF,MCeRC,EAAS,MAMr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AAQ,SACf/C,EAAA,OAAKmC,MAAOxB,EAAWqC,MACtBhD,EAAA,QAAMiD,KAAK,UAGZlD,KAAKmD,OACLlD,EAACgC,EAAQ,CAACG,MAAOxB,EAAWwC,MAAOC,GAAIrD,KAAKI,SAC1CJ,KAAKmD,OAGRlD,EAAA,cACCmC,MAAOxB,EAAW0C,MAClBC,QAAQ,UACRC,UAAWxD,KAAKyD,eAChBd,eAAgB3C,KAAK0D,oBACrBC,KAAK,OACLC,IAAKC,GAAO7D,KAAKgB,YAAc6C,EAAG,eACpB7D,KAAK8D,eAAeC,KAAK/D,OAEvCC,EAAA,YAAUiD,KAAK,WAGjBjD,EAAA,OAAKmC,MAAOxB,EAAWoD,QAASX,GAAIrD,KAAKM,WACxCL,EAAA,cAEDA,EAAA,OAAKmC,MAAOxB,EAAWqD,SACtBhE,EAAA,QAAMiD,KAAK,eAKblD,KAAKe,KACLd,EAAA,6BAA0BD,KAAKyD,eAAc,mBAAoBzD,KAAK0D,oBAAmB,eACpE1D,KAAK8D,eAAeC,KAAK/D,QAC3C,K,CAKC,cAAA8D,CAAeI,GACtBA,EAAEC,kBACFnE,KAAKyB,YACLzB,KAAKoE,SAASC,KAAKH,E,CAOpB,UAAMI,GACLtE,KAAKmB,W,CAON,UAAMoD,GACLvE,KAAKyB,W,CAON,kBAAMM,GACLyC,EAAgBxE,KAAK2C,eAAgB,mBAAoB/B,EAAWC,MACpE2D,EAAgBxE,KAAK4C,gBAAiB,oBAAqBhC,EAAWC,K"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,h as t,a as i,g as e}from"./p-5bc604a3.js";import{T as r,a as n,b as a}from"./p-9a4c910d.js";import{a as s}from"./p-5de606f8.js";import"./p-ff7365ae.js";import"./p-55500e5a.js";import"./p-03990da5.js";const l='.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-tooltip-content{z-index:51;font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);position:absolute;display:none;width:-moz-max-content;width:max-content;max-width:var(--gov-tooltip-content-max-width, 21rem);padding:1rem;border-radius:0.1875rem;background-color:var(--gov-tooltip-content-bg-color, var(--gov-color-primary-300));color:var(--gov-tooltip-content-text-color, var(--gov-color-secondary));letter-spacing:0.0125rem;visibility:hidden;opacity:0;transition:opacity 0.2s ease-in}.gov-tooltip-content::before{content:"";position:absolute;display:block;width:0;height:0;border:0.625rem solid transparent}.gov-tooltip-content gov-button{position:absolute;right:0;top:0}.gov-tooltip-content[persist=""],.gov-tooltip-content[persist=true i],.gov-tooltip-content[persist="1"]{padding-right:3.25rem}.gov-tooltip-content[is-visible=""],.gov-tooltip-content[is-visible=true i],.gov-tooltip-content[is-visible="1"]{display:block;opacity:1}.gov-tooltip-content[variant=secondary]{--gov-tooltip-content-bg-color:var(--gov-tooltip-secondary-bg-color, var(--gov-color-secondary));--gov-tooltip-content-text-color:var(--gov-tooltip-secondary-text-color, var(--gov-color-neutral-white))}.gov-tooltip-content[variant=secondary][inverse=""],.gov-tooltip-content[variant=secondary][inverse=true i],.gov-tooltip-content[variant=secondary][inverse="1"]{--gov-tooltip-content-bg-color:var(--gov-color-neutral-white);--gov-tooltip-content-text-color:var(--gov-tooltip-secondary-text-color-inverse, var(--gov-color-secondary))}.gov-tooltip-content[variant=primary]{--gov-tooltip-content-bg-color:var(--gov-tooltip-primary-bg-color, var(--gov-color-primary-300));--gov-tooltip-content-text-color:var(--gov-tooltip-primary-text-color, var(--gov-color-secondary))}.gov-tooltip-content[variant=primary][inverse=""],.gov-tooltip-content[variant=primary][inverse=true i],.gov-tooltip-content[variant=primary][inverse="1"]{--gov-tooltip-content-bg-color:var(--gov-color-neutral-white);--gov-tooltip-content-text-color:var(--gov-tooltip-primary-text-color-inverse, var(--gov-color-primary))}.gov-tooltip-content[size=s]{--gov-tooltip-content-padding:var(--gov-tooltip-s-padding, 0.5rem);--gov-tooltip-content-arrow-size:var(--gov-tooltip-s-arrow-size, 0.4375rem);--gov-tooltip-content-letter-spacing:var(--gov-tooltip-s-letter-spacing, 0.0125rem);font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing)}.gov-tooltip-content[size=s][persist=true i]{padding-right:var(--gov-tooltip-s-persist-space, 3rem)}.gov-tooltip-content[size=l]{--gov-tooltip-content-padding:var(--gov-tooltip-l-padding, 1rem);--gov-tooltip-content-arrow-size:var(--gov-tooltip-l-arrow-size, 0.875rem);--gov-tooltip-content-letter-spacing:var(--gov-tooltip-l-letter-spacing, 0.002rem);font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing)}.gov-tooltip-content[size=l][persist=true i]{padding-right:var(--gov-tooltip-s-persist-space, 4rem)}.gov-tooltip-content[position=top]::before{left:50%;transform:translateX(-50%)}.gov-tooltip-content[position=top]::before{top:100%;border-bottom-width:0;border-top-color:var(--gov-tooltip-content-bg-color, var(--gov-color-primary-300))}.gov-tooltip-content[position=bottom]::before{left:50%;transform:translateX(-50%)}.gov-tooltip-content[position=bottom]::before{bottom:100%;border-top-width:0;border-bottom-color:var(--gov-tooltip-content-bg-color, var(--gov-color-primary-300))}.gov-tooltip-content[position=left]::before{top:50%;transform:translateY(-50%)}.gov-tooltip-content[position=left]::before{left:100%;border-right-width:0;border-left-color:var(--gov-tooltip-content-bg-color, var(--gov-color-primary-300))}.gov-tooltip-content[position=right]::before{top:50%;transform:translateY(-50%)}.gov-tooltip-content[position=right]::before{right:100%;border-left-width:0;border-right-color:var(--gov-tooltip-content-bg-color, var(--gov-color-primary-300))}';const v=class{constructor(t){o(this,t);this.variant=r.PRIMARY;this.size=n._M;this.persist=false;this.isVisible=false;this.parentId=null}visibleContent(o){clearTimeout(this.timeout);if(o===false){this.timeout=setTimeout((()=>{this.host.style.visibility="hidden"}),250)}else{this.host.style.visibility="visible"}}hideContent(){this.isVisible=false;this.persist=false;const o=document.getElementById(this.parentId);if(o){o.hide().catch()}}render(){return t(i,{class:a.root,role:"tooltip",hidden:!this.isVisible,"aria-hidden":!s(this.isVisible),"is-visible":this.isVisible},t("slot",null),this.persist?t("gov-button",{"on-gov-click":this.hideContent.bind(this),variant:this.variant,size:this.size,type:"base",inverse:this.variant===r.SECONDARY},t("gov-icon",{slot:"left-icon",name:"x-lg",type:"basic"})):null)}get host(){return e(this)}static get watchers(){return{isVisible:["visibleContent"]}}};v.style=l;export{v as gov_tooltip_content};
|
|
2
|
+
//# sourceMappingURL=p-67096d72.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govTooltipContentCss","GovTooltipContent","TooltipVariant","PRIMARY","TooltipSize","_M","visibleContent","newValue","clearTimeout","this","timeout","setTimeout","host","style","visibility","hideContent","isVisible","persist","parentEl","document","getElementById","parentId","hide","catch","render","h","Host","class","TooltipContentClass","root","role","hidden","toBoolAttr","bind","variant","size","type","inverse","SECONDARY","slot","name"],"sources":["../../../packages/core/src/components/gov-tooltip/gov-tooltip-content.scss?tag=gov-tooltip-content","../../../packages/core/src/components/gov-tooltip/gov-tooltip-content.tsx"],"sourcesContent":["/*\n * Tooltip - Content\n */\n\n$class: \".gov-tooltip-content\";\n\n#{$class} {\n\t@include z-index(\"bar\", 1);\n\t@include typography($font-size-m);\n\tposition: absolute;\n\tdisplay: none;\n\twidth: max-content;\n\n\tmax-width: $tooltip-content-max-width;\n\tpadding: rem-calc(16);\n\tborder-radius: rem-calc(3);\n\tbackground-color: $tooltip-content-bg-color;\n\tcolor: $tooltip-content-text-color;\n\tletter-spacing: rem-calc(0.2);\n\tvisibility: hidden;\n\topacity: 0;\n\ttransition: opacity 0.2s ease-in;\n\n\t&::before {\n\t\t@include pseudo();\n\t\twidth: 0;\n\t\theight: 0;\n\t\tborder: rem-calc(10) solid transparent;\n\t}\n\n\t& gov-button {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\t}\n\n\t@include parameter(\"persist\") {\n\t\tpadding-right: rem-calc(52);\n\t}\n\n\t// STATES\n\t@include parameter(\"is-visible\") {\n\t\tdisplay: block;\n\t\topacity: 1;\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $tooltip-content-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t--#{$prefix}tooltip-content-bg-color: #{get(\"bg-color\", $definitions)};\n\t\t\t--#{$prefix}tooltip-content-text-color: #{get(\"text-color\", $definitions)};\n\n\t\t\t// STATES\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\t--#{$prefix}tooltip-content-bg-color: #{color(\"neutral.white\")};\n\t\t\t\t--#{$prefix}tooltip-content-text-color: #{get(\"text-color-inverse\", $definitions)};\n\t\t\t}\n\t\t}\n\t}\n\t@each $size, $definitions in $tooltip-content-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t--#{$prefix}tooltip-content-padding: #{get(\"padding\", $definitions)};\n\t\t\t--#{$prefix}tooltip-content-arrow-size: #{get(\"arrow-size\", $definitions)};\n\t\t\t--#{$prefix}tooltip-content-letter-spacing: #{get(\"letter-spacing\", $definitions)};\n\t\t\t@include typography(get(\"typography\", $definitions));\n\n\t\t\t&[persist=\"true\" i] {\n\t\t\t\tpadding-right: #{get(\"persist-space\", $definitions)};\n\t\t\t}\n\t\t}\n\t}\n\t@each $position, $definitions in $tooltip-content-positions {\n\t\t$oppositeProperty: get(\"oppositeProperty\", $definitions);\n\n\t\t&[position=\"#{$position}\"] {\n\t\t\t&::before {\n\t\t\t\t#{get(\"directionProperty\", $definitions)}: 50%;\n\t\t\t\ttransform: #{get(\"transformFn\", $definitions) }(-50%);\n\t\t\t}\n\n\t\t\t&::before {\n\t\t\t\t#{$position}: 100%;\n\t\t\t\tborder-#{$oppositeProperty}-width: 0;\n\t\t\t\tborder-#{$position}-color: $tooltip-content-bg-color;\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { TooltipContentClass, TooltipSize, TooltipSizeType, TooltipVariant, TooltipVariantType } from \"./constants\"\nimport { toBoolAttr } from \"../../helpers/Dom/template\"\n\n@Component({\n\ttag: \"gov-tooltip-content\",\n\tstyleUrl: \"gov-tooltip-content.scss\",\n})\nexport class GovTooltipContent {\n\tprivate timeout\n\n\t@Element() host: HTMLGovTooltipContentElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly variant?: TooltipVariantType = TooltipVariant.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip is still visible.\n\t */\n\t@Prop() persist?: boolean = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"is-visible\", mutable: true }) isVisible = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"parent-id\" }) parentId: string = null\n\n\t@Watch(\"isVisible\")\n\tvisibleContent(newValue: boolean): void {\n\t\tclearTimeout(this.timeout)\n\t\tif (newValue === false) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.style.visibility = \"hidden\"\n\t\t\t}, 250)\n\t\t} else {\n\t\t\tthis.host.style.visibility = \"visible\"\n\t\t}\n\t}\n\n\thideContent() {\n\t\tthis.isVisible = false\n\t\tthis.persist = false\n\t\tconst parentEl = document.getElementById(this.parentId) as HTMLGovTooltipElement\n\t\tif (parentEl) {\n\t\t\tparentEl.hide().catch()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={TooltipContentClass.root}\n\t\t\t\trole={\"tooltip\"}\n\t\t\t\thidden={!this.isVisible}\n\t\t\t\taria-hidden={!toBoolAttr(this.isVisible)}\n\t\t\t\tis-visible={this.isVisible}>\n\t\t\t\t<slot></slot>\n\t\t\t\t{this.persist ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\ton-gov-click={this.hideContent.bind(this)}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\ttype={\"base\"}\n\t\t\t\t\t\tinverse={this.variant === TooltipVariant.SECONDARY}>\n\t\t\t\t\t\t<gov-icon slot={\"left-icon\"} name={\"x-lg\"} type={\"basic\"}></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"uNAAA,MAAMA,EAAuB,87I,MCQhBC,EAAiB,M,sCAOmBC,EAAeC,Q,UAIrBC,EAAYC,G,aAI1B,M,eAIkC,M,cAIT,I,CAGrD,cAAAC,CAAeC,GACdC,aAAaC,KAAKC,SAClB,GAAIH,IAAa,MAAO,CACvBE,KAAKC,QAAUC,YAAW,KACzBF,KAAKG,KAAKC,MAAMC,WAAa,QAAQ,GACnC,I,KACG,CACNL,KAAKG,KAAKC,MAAMC,WAAa,S,EAI/B,WAAAC,GACCN,KAAKO,UAAY,MACjBP,KAAKQ,QAAU,MACf,MAAMC,EAAWC,SAASC,eAAeX,KAAKY,UAC9C,GAAIH,EAAU,CACbA,EAASI,OAAOC,O,EAIlB,MAAAC,GACC,OACCC,EAACC,EAAI,CACJC,MAAOC,EAAoBC,KAC3BC,KAAM,UACNC,QAAStB,KAAKO,UAAS,eACTgB,EAAWvB,KAAKO,WAAU,aAC5BP,KAAKO,WACjBS,EAAA,aACChB,KAAKQ,QACLQ,EAAA,6BACehB,KAAKM,YAAYkB,KAAKxB,MACpCyB,QAASzB,KAAKyB,QACdC,KAAM1B,KAAK0B,KACXC,KAAM,OACNC,QAAS5B,KAAKyB,UAAYhC,EAAeoC,WACzCb,EAAA,YAAUc,KAAM,YAAaC,KAAM,OAAQJ,KAAM,WAE/C,K"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,h as t,a as i,g as r}from"./p-5bc604a3.js";import{g as o,p as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,h as t,a as i,g as r}from"./p-5bc604a3.js";import{g as o,p as s}from"./p-5de606f8.js";const d={root:"gov-tiles"};const l=".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-tiles{overflow:hidden}.gov-tiles>*{margin:0 -0.0625rem -0.0625rem 0;border:0.0625rem solid var(--gov-tiles-border-color, var(--gov-color-secondary-500));border-width:0 0 0.0625rem}.gov-tiles>*:last-child{border-bottom-width:0}.gov-tiles[no-border]>*{border:none}@media (min-width: 48em){.gov-tiles{display:grid}.gov-tiles--x2{grid-template-columns:repeat(2, 1fr)}.gov-tiles--x2>*{border-width:0.0625rem 0.0625rem 0.0625rem 0}.gov-tiles--x2>*:nth-child(-n+3){border-top-width:0}.gov-tiles--x2>*:nth-child(2n+2){border-right-width:0}}@media (min-width: 48em) and (max-width: 63.99em){.gov-tiles--x3,.gov-tiles--x4{grid-template-columns:repeat(2, 1fr)}.gov-tiles--x3>*,.gov-tiles--x4>*{border-width:0.0625rem 0.0625rem 0.0625rem 0}.gov-tiles--x3>*:nth-child(-n+3),.gov-tiles--x4>*:nth-child(-n+3){border-top-width:0}.gov-tiles--x3>*:nth-child(2n+2),.gov-tiles--x4>*:nth-child(2n+2){border-right-width:0}}@media (min-width: 64em){.gov-tiles--x3{grid-template-columns:repeat(3, 1fr)}.gov-tiles--x3>*{border-width:0.0625rem 0.0625rem 0.0625rem 0}.gov-tiles--x3>*:nth-child(-n+4){border-top-width:0}.gov-tiles--x3>*:nth-child(3n+3){border-right-width:0}}@media (min-width: 64em) and (max-width: 74.99em){.gov-tiles--x4{grid-template-columns:repeat(3, 1fr)}.gov-tiles--x4>*{border-width:0.0625rem 0.0625rem 0.0625rem 0}.gov-tiles--x4>*:nth-child(-n+4){border-top-width:0}.gov-tiles--x4>*:nth-child(3n+3){border-right-width:0}}@media (min-width: 75em){.gov-tiles--x4{grid-template-columns:repeat(4, 1fr)}.gov-tiles--x4>*{border-width:0.0625rem 0.0625rem 0.0625rem 0}.gov-tiles--x4>*:nth-child(-n+5){border-top-width:0}.gov-tiles--x4>*:nth-child(4n+4){border-right-width:0}}";const n=class{constructor(t){e(this,t);this.columns=3;this.noBorder=false;this.h=o(this.host)}get classNames(){return s([d.root,this.columns&&d.root+"--x"+this.columns])}render(){return t(i,{class:this.h.classes(this.classNames)},t("slot",null))}get host(){return r(this)}};n.style=l;export{n as gov_tiles};
|
|
2
|
+
//# sourceMappingURL=p-6bf8e7bf.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,h as r,a as e,g as i}from"./p-5bc604a3.js";import{g as t}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as o,h as r,a as e,g as i}from"./p-5bc604a3.js";import{g as t}from"./p-5de606f8.js";const n={root:"gov-error-code",icon:"gov-error-code__icon",holder:"gov-error-code__holder",content:"gov-error-code__content"};const a=".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-error-code{position:relative;display:block;width:100%}.gov-error-code__holder{margin:0 auto;text-align:center}.gov-error-code__content>*:last-child{margin-bottom:0}.gov-error-code__icon{display:flex;justify-content:center;align-items:center;width:9.375rem;height:9.375rem;margin:0 auto 1.5rem;border-radius:50%;background:var(--gov-error-icon-circle-bg, linear-gradient(to bottom, var(--gov-color-primary-200), var(--gov-color-neutral-white)));color:var(--gov-error-icon-color, var(--gov-color-primary))}.gov-error-code__icon>*{width:6.5625rem;height:6.5625rem}@media (min-width: 48em){.gov-error-code__icon{width:12.5rem;height:12.5rem;margin:0 auto 2rem}.gov-error-code__icon>*{width:8.75rem;height:8.75rem}}";const c=class{constructor(r){o(this,r);this.h=t(this.host)}render(){return r(e,{class:this.h.classes(n.root)},r("div",{class:n.holder},this.h.hasSlot("icon")&&r("div",{class:n.icon},r("slot",{name:"icon"})),r("div",{class:n.content},r("slot",null))))}get host(){return i(this)}};c.style=a;export{c as gov_error_code};
|
|
2
|
+
//# sourceMappingURL=p-72c5997f.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,c as a,h as e,a as t,g as i}from"./p-5bc604a3.js";import{g as s,c as r,a as d}from"./p-5de606f8.js";import{c as l}from"./p-003e6cca.js";import{a as n}from"./p-7f2c9830.js";import{a as m}from"./p-7724b535.js";import{c as g}from"./p-24636c53.js";import{d as h}from"./p-03990da5.js";import{M as c}from"./p-be4aab0e.js";const v='.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-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const p=class{constructor(e){o(this,e);this.govClose=a(this,"gov-close",7);this.open=false;this.blockClose=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=s(this.host);this.labelId=g("GovModalLabel");this.contentId=g("GovModalContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){n(`[${c.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(c.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(c.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(l()){await h(500);await this.validateWcag()}}render(){const o=this.labelTag;return e(t,{class:this.h.classes(c.root),open:this.open},e("dialog",{class:c.dialog,hidden:!this.open,tabindex:r(this.open),open:this.open,"aria-modal":"true","aria-hidden":d(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},e("div",{class:c.inner},e("div",{class:c.header},this.h.hasSlot("icon")&&e("div",{class:c.icon},e("slot",{name:"icon"})),this.label&&e(o,{class:c.title,id:this.labelId},this.label),e("gov-button",{ref:o=>this.closeCtaRef=o,disabled:this.blockClose,class:c.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"x-lg"}))),e("div",{class:c.content,id:this.contentId},e("slot",null)),this.h.hasSlot("footer")&&e("div",{class:c.footer},e("slot",{name:"footer"})))),this.open?e("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(o){o.stopPropagation();if(this.blockClose===false){this.hideModal();this.govClose.emit(o)}}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){m(this.wcagLabelledBy,"wcag-labelled-by",c.root);m(this.wcagDescribedBy,"wcag-described-by",c.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}};p.style=v;export{p as gov_modal};
|
|
2
|
+
//# sourceMappingURL=p-7f158b6f.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govModalCss","GovModal","constructor","hostRef","this","h","govHost","host","labelId","createID","contentId","validateLabelTag","newValue","validTags","includes","govErrorLog","ModalClass","root","watchOpen","open","closeCtaRef","setFocus","catch","showModal","document","body","classList","add","bodyFix","hideModal","remove","componentWillRender","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","LabelTag","labelTag","Host","class","classes","dialog","hidden","tabindex","boolToFocusValue","toBoolAttr","wcagLabelledBy","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","ref","el","disabled","blockClose","close","variant","wcagLabel","wcagCloseLabel","wcagCloseLabelledBy","type","onCloseHandler","bind","content","footer","e","stopPropagation","govClose","emit","show","hide","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-modal/gov-modal.scss?tag=gov-modal","../../../packages/core/src/components/gov-modal/gov-modal.tsx"],"sourcesContent":["/*\n * Modal\n */\n\n$class: \".gov-modal\";\n\n#{$class} {\n\tdisplay: none;\n\n\t&__dialog {\n\t\t@include z-index(\"modal\", 1);\n\t\tposition: fixed;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: 100%;\n\t\tmax-width: $modal-max-width;\n\t\theight: 100%;\n\t\tpadding: rem-calc(8);\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\ttransform: translate(-50%, -50%);\n\t\tpointer-events: none;\n\t}\n\n\t&__inner {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\twidth: 100%;\n\t\tmax-height: 100%;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $modal-bg;\n\t\toverflow: hidden;\n\t\tpointer-events: auto;\n\t\tbox-shadow: get($shadow-l, $shadows);\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: flex-start;\n\t\tpadding: rem-calc(24 16);\n\t\tborder-bottom: $modal-border;\n\t}\n\n\t&__icon {\n\t\tflex: 0 0 auto;\n\t\tpadding-top: calc(((var(--gov-text-#{$font-size-3xl}-font-size) * 1.5) - rem-calc(24)) / 2);\n\n\t\t& > * {\n\t\t\twidth: rem-calc(24);\n\t\t\theight: rem-calc(24);\n\t\t}\n\t}\n\n\t&__title {\n\t\t@include typography($font-size-3xl);\n\t\tmargin: 0;\n\t}\n\n\t&__close {\n\t\tflex: 0 0 auto;\n\t\tmargin-left: auto;\n\t}\n\n\t&__content {\n\t\t@include reset-last-margin();\n\t\theight: 100%;\n\t\tpadding: rem-calc(24 16);\n\t\tcolor: $modal-text-color;\n\t\toverflow: auto;\n\t}\n\n\t&__footer,\n\t&__actions {\n\t\tpadding: rem-calc(24 16);\n\t\tborder-top: $modal-border;\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8 16);\n\t\tflex-wrap: wrap;\n\t\tjustify-content: flex-end;\n\t}\n\n\t// STATES\n\t&__dialog:focus &__inner {\n\t\toutline: $outline;\n\t}\n\n\t@include parameter(\"open\") {\n\t\tdisplay: block;\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t&__dialog {\n\t\t\tmax-width: calc($modal-max-width + 2 * rem-calc(24));\n\t\t\tpadding: rem-calc(24);\n\n\t\t\t&:focus {\n\t\t\t\toutline-offset: rem-calc(-24);\n\t\t\t}\n\t\t}\n\t\t&__inner {\n\t\t\tbox-shadow: get($shadow-xl, $shadows);\n\t\t}\n\n\t\t// VARIANTS\n\t\t&--prompt &__dialog {\n\t\t\tmax-width: calc($modal-prompt-max-width + 2 * rem-calc(24));\n\t\t}\n\t}\n\t@include mq($from: md) {\n\t\t&__header {\n\t\t\tgap: rem-calc(20);\n\t\t\tpadding: rem-calc(32 40 32 48);\n\t\t}\n\t\t&__content {\n\t\t\tpadding: rem-calc(32 48);\n\t\t}\n\t\t&__footer {\n\t\t\tpadding: rem-calc(16 48);\n\t\t}\n\n\t\t// VARIANTS\n\t\t&--prompt {\n\t\t\t#{$class} {\n\t\t\t\t&__header,\n\t\t\t\t&__content,\n\t\t\t\t&__footer,\n\t\t\t\t&__actions {\n\t\t\t\t\tpadding: rem-calc(24);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {boolToFocusValue, govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {govErrorLog} from '../../helpers/Log/gov.log'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {delay} from '../../utils/utils'\nimport {ModalClass} from './constants'\n\n@Component({\n\ttag: 'gov-modal',\n\tstyleUrl: 'gov-modal.scss',\n})\nexport class GovModal {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovModalLabel')\n\t\tthis.contentId = createID('GovModalContent')\n\t}\n\n\t@Element() host: HTMLGovModalElement\n\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Attribute allowing blocking the modal closing\n\t */\n\t@Prop() blockClose = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the modal 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: 'wcag-labelled-by'}) wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'wcag-close-label'}) readonly wcagCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({attribute: 'wcag-close-labelled-by'}) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('labelTag')\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tif (newValue && this.closeCtaRef) {\n\t\t\tthis.closeCtaRef.setFocus().catch()\n\t\t}\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.root)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.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.wcagLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\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={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.wcagCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\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 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={ModalClass.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={ModalClass.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 wcag-label={this.wcagCloseLabel} wcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}/>\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\tif (this.blockClose === false) {\n\t\t\tthis.hideModal()\n\t\t\tthis.govClose.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root)\n\t}\n}\n"],"mappings":"0UAAA,MAAMA,EAAc,wyF,MCePC,EAAQ,MAMpB,WAAAC,CAAAC,G,wDAW8B,M,gBAIT,M,+BAQ+B,S,cAIQ,K,iFAYa,c,mCAtCxEC,KAAKC,E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D,KAAK,UAGZlD,KAAKmD,OACLlD,EAACgC,EAAQ,CAACG,MAAOxB,EAAWwC,MAAOC,GAAIrD,KAAKI,SAC1CJ,KAAKmD,OAGRlD,EAAA,cACCqD,IAAKC,GAAOvD,KAAKgB,YAAcuC,EAC/BC,SAAUxD,KAAKyD,WACfrB,MAAOxB,EAAW8C,MAClBC,QAAQ,UACRC,UAAW5D,KAAK6D,eAChBlB,eAAgB3C,KAAK8D,oBACrBC,KAAK,OAAM,eACG/D,KAAKgE,eAAeC,KAAKjE,OAEvCC,EAAA,YAAUiD,KAAK,WAGjBjD,EAAA,OAAKmC,MAAOxB,EAAWsD,QAASb,GAAIrD,KAAKM,WACxCL,EAAA,cAEAD,KAAKC,EAAE+C,QAAQ,WACf/C,EAAA,OAAKmC,MAAOxB,EAAWuD,QACtBlE,EAAA,QAAMiD,KAAK,cAMdlD,KAAKe,KACLd,EAAA,6BAA0BD,KAAK6D,eAAc,mBAAoB7D,KAAK8D,oBAAmB,eACpE9D,KAAKgE,eAAeC,KAAKjE,QAC3C,K,CAKC,cAAAgE,CAAeI,GACtBA,EAAEC,kBACF,GAAIrE,KAAKyD,aAAe,MAAO,CAC9BzD,KAAKyB,YACLzB,KAAKsE,SAASC,KAAKH,E,EAQrB,UAAMI,GACLxE,KAAKmB,W,CAON,UAAMsD,GACLzE,KAAKyB,W,CAON,kBAAMM,GACL2C,EAAgB1E,KAAK2C,eAAgB,mBAAoB/B,EAAWC,MACpE6D,EAAgB1E,KAAK4C,gBAAiB,oBAAqBhC,EAAWC,K"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as o,h as i,a as l,g as a}from"./p-5bc604a3.js";import{c as r}from"./p-24636c53.js";import{g as t,a as f,t as s}from"./p-28e59384.js";import{a as n,b as d}from"./p-7724b535.js";import{c as m}from"./p-003e6cca.js";import{d as v}from"./p-03990da5.js";import{g}from"./p-0e5fa8bf.js";import"./p-7f2c9830.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";const h={root:"gov-form-file",area:"gov-form-file__area",label:"gov-form-file__label",input:"gov-form-file__input",list:"gov-form-file__list",item:"gov-form-file__item",attachments:"gov-form-file__attachments"};function _(e){const o=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let i=0,l=parseInt(e,10)||0;while(l>=1024&&++i){l=l/1024}return l.toFixed(l<10&&i>0?1:0)+" "+o[i]}function b(e,o){if(typeof o==="string"&&o.length){return o.replace(/\s/g,"").split(",").filter((o=>new RegExp(o.replace("*",".*")).test(e.type))).length>0}else{return true}}function p(e,o){const i=Math.round(e.size);return i<=o}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-file{position:relative;display:block;width:100%}.gov-form-file__label .gov-form-label__label>*:last-child{margin-bottom:0}.gov-form-file__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0.0001;cursor:pointer}.gov-form-file__attachments{margin-top:1rem 0rem 0rem}.gov-form-file__item{display:flex;gap:1rem;align-items:center}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label{pointer-events:none}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label *{color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}.gov-form-file[expanded=""] .gov-form-file__area,.gov-form-file[expanded=true i] .gov-form-file__area,.gov-form-file[expanded="1"] .gov-form-file__area{position:relative;width:100%;padding:2rem 1.375rem 1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center;transition:background-color 150ms ease-in-out;will-change:background-color}.gov-form-file[expanded=""] .gov-form-file__area.highlight,.gov-form-file[expanded=true i] .gov-form-file__area.highlight,.gov-form-file[expanded="1"] .gov-form-file__area.highlight{background-color:var(--gov-color-primary-200)}.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{width:100%;padding:1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center}.gov-form-file[expanded=""] .gov-form-file__attachments,.gov-form-file[expanded=true i] .gov-form-file__attachments,.gov-form-file[expanded="1"] .gov-form-file__attachments{margin:1.5rem 0rem 0rem}.gov-form-file[expanded=""][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__label .gov-form-label__label{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][invalid=""] .gov-form-file__area,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__area,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__area{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][disabled=""] .gov-form-file__area,.gov-form-file[expanded=""][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=""][disabled="1"] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=""] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=true i][disabled="1"] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=""] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=true i] .gov-form-file__area,.gov-form-file[expanded="1"][disabled="1"] .gov-form-file__area{pointer-events:none;color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}@media (min-width: 30em){.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{padding:2rem}}';const u=class{constructor(i){e(this,i);this.govFocus=o(this,"gov-focus",7);this.govBlur=o(this,"gov-blur",7);this.govFiles=o(this,"gov-files",7);this.govAddFile=o(this,"gov-add-file",7);this.govRemoveFile=o(this,"gov-remove-file",7);this.expanded=false;this.required=false;this.disabled=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.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagRemoveLabel="Odebrat soubor {FILE_NAME}";this.wcagAttachmentsLabel="Přílohy";this.files=[];this.fileId=r("GovInputFile");this.h=t(this.host);this.f=g(this.h)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",f(this.invalid));this.f.passAttrToControl("type","File")}registerListeners(){function e(){this.areaRef.classList.add("highlight")}function o(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(e=>{e.preventDefault();e.stopPropagation();const o=e.target.files;this.validateFiles(o)}),false);if(this.expanded){const i=["dragover","dragleave"];const l=["dragenter","dragover","mouseenter"];const a=["dragleave","drop","mouseleave"];i.map((e=>this.inputRef.addEventListener(e,this.preventDefaults.bind(this),false)));l.map((o=>this.inputRef.addEventListener(o,e.bind(this),false)));a.forEach((e=>this.inputRef.addEventListener(e,o.bind(this),false)));this.areaRef.addEventListener("drop",this.handleDrop.bind(this),false)}}preventDefaults(e){e.preventDefault();e.stopPropagation()}handleDrop(e){const o=e.dataTransfer;this.validateFiles(o.files)}validateFiles(e){let o=[];Array.from(e).map((e=>{const i=this.files.find((o=>o.file.name===e.name&&o.file.size===e.size))||null;if(i===null){const i=typeof this.maxFileSize==="number"&&this.maxFileSize>0?p(e,this.maxFileSize):true;const l=b(e,this.accept);const a={id:r("GovFormFile"),file:e,acceptValid:l,sizeValid:i};if(this.displayAttachments){this.files=[...this.files,a]}else{o=[...o,a]}this.govAddFile.emit({component:h.root,file:a})}}));this.govFiles.emit({component:h.root,files:o.length?o:this.files})}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.watchDisabled()}async componentDidRender(){if(m()){await v(500);await this.validateWcag()}this.registerListeners()}render(){return i(l,{class:this.h.classes([h.root]),invalid:s(this.invalid),expanded:s(this.expanded)},i("div",{class:h.area,ref:e=>this.areaRef=e},i("slot",null),i("input",{class:h.input,ref:e=>this.inputRef=e,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,"aria-required":s(this.required),"aria-invalid":s(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":s(this.disabled)})),this.h.hasSlot("attachments")?i("div",{class:h.attachments},i("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?i("div",{class:h.attachments},i("gov-attachments",{label:this.wcagAttachmentsLabel,"wcag-label":this.wcagAttachmentsLabel},this.files.map((e=>i("gov-attachments-item",{"wcag-remove-labelled-by":e.id,"on-gov-remove":()=>this.onRemoveFileHandler(e)},i("span",{class:"sr-only",id:e.id},this.wcagRemoveLabel.replace("{FILE_NAME}",e.file.name)),e.file.name,e.acceptValid===false?i("gov-form-message",{slot:"message",variant:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),e.acceptValid===false?this.errorAccept:null):null,e.sizeValid===false?i("gov-form-message",{slot:"message",variant:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),this.errorSize.replace("{FILE_SIZE}",_(this.maxFileSize))):null,i("span",{slot:"info"},"(",_(e.file.size),")")))))):null)}onRemoveFileHandler(e){const o=this.files.findIndex((o=>o.id===e.id));if(o!==-1){const e=this.files;const i=this.files[o];e.splice(o,1);this.files=[...e];this.govRemoveFile.emit({component:h.root,file:i});this.govFiles.emit({component:h.root,files:e})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:h.root,originalEvent:e})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:h.root,originalEvent:e})}onChangeHandler(e){e.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[]}async validateWcag(){n(this.wcagDescribedBy,"wcag-described-by",h.root);n(this.wcagLabelledBy,"wcag-labelled-by",h.root);d(this.identifier||this.fileId,this.wcagLabelledBy,h.root)}get host(){return a(this)}static get watchers(){return{disabled:["watchDisabled"],invalid:["watchDisabled"]}}};u.style=c;export{u as gov_form_file};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as o,h as i,a as l,g as a}from"./p-5bc604a3.js";import{c as r}from"./p-24636c53.js";import{g as t,a as s,t as f}from"./p-5de606f8.js";import{a as n,b as d}from"./p-7724b535.js";import{c as m}from"./p-003e6cca.js";import{d as v}from"./p-03990da5.js";import{g}from"./p-0e5fa8bf.js";import"./p-7f2c9830.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";const h={root:"gov-form-file",area:"gov-form-file__area",label:"gov-form-file__label",input:"gov-form-file__input",list:"gov-form-file__list",item:"gov-form-file__item",attachments:"gov-form-file__attachments"};function _(e){const o=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let i=0,l=parseInt(e,10)||0;while(l>=1024&&++i){l=l/1024}return l.toFixed(l<10&&i>0?1:0)+" "+o[i]}function b(e,o){if(typeof o==="string"&&o.length){return o.replace(/\s/g,"").split(",").filter((o=>new RegExp(o.replace("*",".*")).test(e.type))).length>0}else{return true}}function p(e,o){const i=Math.round(e.size);return i<=o}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-file{position:relative;display:block;width:100%}.gov-form-file__label .gov-form-label__label>*:last-child{margin-bottom:0}.gov-form-file__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0.0001;cursor:pointer}.gov-form-file__attachments{margin-top:1rem 0rem 0rem}.gov-form-file__item{display:flex;gap:1rem;align-items:center}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label{pointer-events:none}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label *{color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}.gov-form-file[expanded=""] .gov-form-file__area,.gov-form-file[expanded=true i] .gov-form-file__area,.gov-form-file[expanded="1"] .gov-form-file__area{position:relative;width:100%;padding:2rem 1.375rem 1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center;transition:background-color 150ms ease-in-out;will-change:background-color}.gov-form-file[expanded=""] .gov-form-file__area.highlight,.gov-form-file[expanded=true i] .gov-form-file__area.highlight,.gov-form-file[expanded="1"] .gov-form-file__area.highlight{background-color:var(--gov-color-primary-200)}.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{width:100%;padding:1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center}.gov-form-file[expanded=""] .gov-form-file__attachments,.gov-form-file[expanded=true i] .gov-form-file__attachments,.gov-form-file[expanded="1"] .gov-form-file__attachments{margin:1.5rem 0rem 0rem}.gov-form-file[expanded=""][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__label .gov-form-label__label{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][invalid=""] .gov-form-file__area,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__area,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__area{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][disabled=""] .gov-form-file__area,.gov-form-file[expanded=""][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=""][disabled="1"] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=""] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=true i][disabled="1"] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=""] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=true i] .gov-form-file__area,.gov-form-file[expanded="1"][disabled="1"] .gov-form-file__area{pointer-events:none;color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}@media (min-width: 30em){.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{padding:2rem}}';const u=class{constructor(i){e(this,i);this.govFocus=o(this,"gov-focus",7);this.govBlur=o(this,"gov-blur",7);this.govFiles=o(this,"gov-files",7);this.govAddFile=o(this,"gov-add-file",7);this.govRemoveFile=o(this,"gov-remove-file",7);this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=true;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.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagRemoveLabel="Odebrat soubor {FILE_NAME}";this.wcagAttachmentsLabel="Přílohy";this.files=[];this.fileId=r("GovInputFile");this.h=t(this.host);this.f=g(this.h)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",s(this.invalid));this.f.passAttrToControl("type","File")}registerListeners(){function e(){this.areaRef.classList.add("highlight")}function o(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(e=>{e.preventDefault();e.stopPropagation();const o=e.target.files;if(this.resetAfterPick){if(o.length){this.validateFiles(o)}}else{this.validateFiles(o)}}),false);if(this.expanded){const i=["dragover","dragleave"];const l=["dragenter","dragover","mouseenter"];const a=["dragleave","drop","mouseleave"];i.map((e=>this.inputRef.addEventListener(e,this.preventDefaults.bind(this),false)));l.map((o=>this.inputRef.addEventListener(o,e.bind(this),false)));a.forEach((e=>this.inputRef.addEventListener(e,o.bind(this),false)));this.areaRef.addEventListener("drop",this.handleDrop.bind(this),false)}}preventDefaults(e){e.preventDefault();e.stopPropagation()}handleDrop(e){const o=e.dataTransfer;this.validateFiles(o.files)}validateFiles(e){let o=[];Array.from(e).map((e=>{const i=this.files.find((o=>o.file.name===e.name&&o.file.size===e.size))||null;if(i===null||this.ignoreFileDuplicationCheck){const i=typeof this.maxFileSize==="number"&&this.maxFileSize>0?p(e,this.maxFileSize):true;const l=b(e,this.accept);const a={id:r("GovFormFile"),file:e,acceptValid:l,sizeValid:i};if(this.displayAttachments){this.files=[...this.files,a]}else{o=[...o,a]}this.govAddFile.emit({component:h.root,file:a})}}));this.govFiles.emit({component:h.root,files:o.length?o:this.files});if(this.resetAfterPick){this.reset().finally()}}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.watchDisabled()}async componentDidRender(){if(m()){await v(500);await this.validateWcag()}this.registerListeners()}render(){return i(l,{class:this.h.classes([h.root]),invalid:f(this.invalid),expanded:f(this.expanded)},i("div",{class:h.area,ref:e=>this.areaRef=e},i("slot",null),i("input",{class:h.input,ref:e=>this.inputRef=e,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,"aria-required":f(this.required),"aria-invalid":f(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":f(this.disabled)})),this.h.hasSlot("attachments")?i("div",{class:h.attachments},i("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?i("div",{class:h.attachments},i("gov-attachments",{label:this.wcagAttachmentsLabel,"wcag-label":this.wcagAttachmentsLabel},this.files.map((e=>i("gov-attachments-item",{"wcag-remove-labelled-by":e.id,"on-gov-remove":()=>this.onRemoveFileHandler(e)},i("span",{class:"sr-only",id:e.id},this.wcagRemoveLabel.replace("{FILE_NAME}",e.file.name)),e.file.name,e.acceptValid===false?i("gov-form-message",{slot:"message",variant:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),e.acceptValid===false?this.errorAccept:null):null,e.sizeValid===false?i("gov-form-message",{slot:"message",variant:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),this.errorSize.replace("{FILE_SIZE}",_(this.maxFileSize))):null,i("span",{slot:"info"},"(",_(e.file.size),")")))))):null)}onRemoveFileHandler(e){const o=this.files.findIndex((o=>o.id===e.id));if(o!==-1){const e=this.files;const i=this.files[o];e.splice(o,1);this.files=[...e];this.govRemoveFile.emit({component:h.root,file:i});this.govFiles.emit({component:h.root,files:e})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:h.root,originalEvent:e})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:h.root,originalEvent:e})}onChangeHandler(e){e.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];this.inputRef.value=""}async validateWcag(){n(this.wcagDescribedBy,"wcag-described-by",h.root);n(this.wcagLabelledBy,"wcag-labelled-by",h.root);d(this.identifier||this.fileId,this.wcagLabelledBy,h.root)}get host(){return a(this)}static get watchers(){return{disabled:["watchDisabled"],invalid:["watchDisabled"]}}};u.style=c;export{u as gov_form_file};
|
|
2
|
+
//# sourceMappingURL=p-835f1187.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FormFileClass","root","area","label","input","list","item","attachments","formatBytes","bytes","units","l","n","parseInt","toFixed","fileAcceptValidation","file","accept","length","replace","split","filter","RegExp","test","type","fileSizeValidation","maxSize","fileSize","Math","round","size","govFormFileCss","GovFormFile","constructor","hostRef","this","fileId","createID","h","govHost","host","f","govForm","watchDisabled","passControlAttrs","passAttrToControl","toBoolAttr","invalid","registerListeners","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","files","target","resetAfterPick","validateFiles","expanded","events","inEvents","outEvents","map","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","filesBuffer","Array","from","isFile","find","name","ignoreFileDuplicationCheck","isSizeValid","maxFileSize","isAcceptValid","newFile","id","acceptValid","sizeValid","displayAttachments","govAddFile","emit","component","govFiles","reset","finally","componentWillLoad","passAttrToLabel","String","required","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Host","class","classes","toBoolAttrIfDefined","ref","el","identifier","multiple","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","disabled","wcagDescribedBy","wcagLabelledBy","hasSlot","wcagAttachmentsLabel","onRemoveFileHandler","wcagRemoveLabel","slot","variant","errorAccept","errorSize","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","getRef","getAreaRef","value","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.scss?tag=gov-form-file","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tlabel: 'gov-form-file__label',\n\tinput: 'gov-form-file__input',\n\tlist: 'gov-form-file__list',\n\titem: 'gov-form-file__item',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept === 'string' && accept.length) {\n\t\treturn (\n\t\t\taccept\n\t\t\t\t.replace(/\\s/g, '')\n\t\t\t\t.split(',')\n\t\t\t\t.filter(accept => {\n\t\t\t\t\treturn new RegExp(accept.replace('*', '.*')).test(file.type)\n\t\t\t\t}).length > 0\n\t\t)\n\t} else {\n\t\treturn true\n\t}\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","/*\n * File\n */\n\n$class: \".gov-form-file\";\n\n#{$class} {\n\t@include base();\n\t&__label .gov-form-label__label {\n\t\t@include reset-last-margin();\n\t}\n\t&__input {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\topacity: 0.0001;\n\t\tcursor: pointer;\n\t}\n\t&__attachments {\n\t\tmargin-top: rem-calc(16 0 0);\n\t}\n\t&__item {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: center;\n\t}\n\n\t// STATES\n\t@include parameter(\"disabled\") {\n\t\t#{$class} {\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\tpointer-events: none;\n\t\t\t\t* {\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"expanded\") {\n\t\t#{$class} {\n\t\t\t&__area {\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(32) rem-calc(22) rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t\ttransition: background-color $t ease-in-out;\n\t\t\t\twill-change: background-color;\n\t\t\t\t&.highlight {\n\t\t\t\t\tbackground-color: color(\"primary.200\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t}\n\t\t\t&__attachments {\n\t\t\t\tmargin: rem-calc(24 0 0);\n\t\t\t}\n\t\t}\n\n\t\t// STATES\n\t\t@include parameter(\"invalid\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t\t&__area {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t@include parameter(\"disabled\") {\n\t\t\t#{$class} {\n\t\t\t\t&__area {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t@include parameter(\"expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tpadding: rem-calc(32);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {validateWcagLabelFor, validateWcagRef} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {delay} from \"../../../utils/utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\n\n@Component({\n\ttag: \"gov-form-file\",\n\tstyleUrl: \"gov-form-file.scss\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = true\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Description of the list of attachments\n\t */\n\t@Prop({attribute: \"attachments-label\"}) readonly attachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: \"wcag-described-by\"}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"wcag-remove-label\"}) readonly wcagRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"wcag-attachments-label\"}) readonly wcagAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\t@State() files: GovFormFileItem[] = []\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"drop\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\n\t\t\tthis.areaRef.addEventListener(\"drop\", this.handleDrop.bind(this), false)\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.watchDisabled()\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\n\t\tthis.registerListeners()\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])} invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\texpanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.wcagAttachmentsLabel} wcag-label={this.wcagAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item wcag-remove-labelled-by={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.wcagRemoveLabel.replace(\"{FILE_NAME}\", item.file.name)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tthis.inputRef.value = '';\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormFileClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy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,EAAKU,KAAKc,MAAK,UAKhD,K,CAKC,mBAAA8F,CAAoB5G,GAC3B,MAAMkH,EAAQ/F,KAAKyB,MAAMuE,WAAU7H,GAAQA,EAAKgF,KAAOtE,EAAKsE,KAC5D,GAAI4C,KAAW,EAAG,CACjB,MAAMtE,EAAQzB,KAAKyB,MACnB,MAAMwE,EAAajG,KAAKyB,MAAMsE,GAC9BtE,EAAMyE,OAAOH,EAAO,GACpB/F,KAAKyB,MAAQ,IAAIA,GACjBzB,KAAKmG,cAAc3C,KAAK,CACvBC,UAAW5F,EAAcC,KACzBe,KAAMoH,IAEPjG,KAAK0D,SAASF,KAAK,CAClBC,UAAW5F,EAAcC,KACzB2D,S,EAKK,cAAAwD,CAAe3D,GACtBA,EAAEE,kBACFxB,KAAKoG,SAAS5C,KAAK,CAClBC,UAAW5F,EAAcC,KACzBuI,cAAe/E,G,CAIT,aAAA6D,CAAc7D,GACrBA,EAAEE,kBACFxB,KAAKsG,QAAQ9C,KAAK,CACjBC,UAAW5F,EAAcC,KACzBuI,cAAe/E,G,CAIT,eAAAyD,CAAgBzD,GACvBA,EAAEE,iB,CAOH,YAAM+E,GACL,OAAOvG,KAAKoB,Q,CAOb,gBAAMoF,GACL,OAAOxG,KAAKe,O,CAOb,WAAM4C,GACL3D,KAAKyB,MAAQ,GACbzB,KAAKoB,SAASqF,MAAQ,E,CAOvB,kBAAMrC,GACLsC,EAAgB1G,KAAKqF,gBAAiB,oBAAqBxH,EAAcC,MACzE4I,EAAgB1G,KAAKsF,eAAgB,mBAAoBzH,EAAcC,MACvE6I,EAAqB3G,KAAK4E,YAAc5E,KAAKC,OAAQD,KAAKsF,eAAgBzH,EAAcC,K"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,h as i,a as n,g as a}from"./p-5bc604a3.js";import{g as r,p as t}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as o,h as i,a as n,g as a}from"./p-5bc604a3.js";import{g as r,p as t}from"./p-5de606f8.js";const e={root:"gov-loading",content:"gov-loading__content",icon:"gov-loading__icon"};const s=".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-loading{display:block}.gov-loading__content{z-index:101;position:fixed;top:50%;left:50%;display:flex;gap:1rem;flex-direction:column;align-items:center;min-width:9.6875rem;padding:1.5rem;border-radius:0.5rem;background:var(--gov-loading-bg, rgba(var(--gov-color-secondary-400-rgb), 0.8));color:var(--gov-loading-color, var(--gov-color-primary));text-align:center;transform:translate(-50%, -50%)}.gov-loading__icon{width:4rem;height:4rem;line-height:1}.gov-loading__icon svg{width:100%;height:100%}";const g=class{constructor(i){o(this,i);this.h=r(this.host)}render(){return i(n,{class:this.h.classes(e.root)},i("div",{class:e.content},i("gov-icon",{class:t([e.icon,"gov-spin-animation"]),name:"loader"}),i("slot",null)),i("gov-backdrop",{inverse:true}))}get host(){return a(this)}};g.style=s;export{g as gov_loading};
|
|
2
|
+
//# sourceMappingURL=p-90c068ff.entry.js.map
|