@swisspost/design-system-components 1.6.2 → 1.7.0
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/{check-non-empty-ae713942.js → check-non-empty-eeaa8f77.js} +4 -4
- package/dist/cjs/check-non-empty-eeaa8f77.js.map +1 -0
- package/dist/cjs/index-8c288b1a.js +45 -0
- package/dist/cjs/index-8c288b1a.js.map +1 -0
- package/dist/cjs/{index-e7618bb3.js → index-c07c0cdb.js} +79 -59
- package/dist/cjs/index-c07c0cdb.js.map +1 -0
- package/dist/cjs/index.cjs.js +17 -12
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/package-cd0e9960.js +7 -0
- package/dist/cjs/package-cd0e9960.js.map +1 -0
- package/dist/cjs/post-accordion-f2e00198.js +87 -0
- package/dist/cjs/post-accordion-f2e00198.js.map +1 -0
- package/dist/cjs/post-accordion.cjs.entry.js +4 -80
- package/dist/cjs/post-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/post-alert-6d0b5e58.js +101 -0
- package/dist/cjs/{post-alert-1fb90f2d.js.map → post-alert-6d0b5e58.js.map} +1 -1
- package/dist/cjs/post-alert.cjs.entry.js +5 -6
- package/dist/cjs/post-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/post-collapsible-0b8dce97.js +93 -0
- package/dist/cjs/post-collapsible-0b8dce97.js.map +1 -0
- package/dist/cjs/post-collapsible.cjs.entry.js +4 -5
- package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/post-components.cjs.js.map +1 -1
- package/dist/cjs/post-icon-3dbb7728.js +105 -0
- package/dist/cjs/post-icon-3dbb7728.js.map +1 -0
- package/dist/cjs/post-icon.cjs.entry.js +5 -6
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/post-popover-ea22d235.js +118 -0
- package/dist/cjs/post-popover-ea22d235.js.map +1 -0
- package/dist/cjs/post-popover.cjs.entry.js +13 -0
- package/dist/cjs/post-popover.cjs.entry.js.map +1 -0
- package/dist/cjs/post-popovercontainer-42e4ab15.js +1878 -0
- package/dist/cjs/post-popovercontainer-42e4ab15.js.map +1 -0
- package/dist/cjs/post-popovercontainer.cjs.entry.js +13 -0
- package/dist/cjs/post-popovercontainer.cjs.entry.js.map +1 -0
- package/dist/cjs/post-tab-header-09074905.js +33 -0
- package/dist/cjs/{post-tab-header-a3845fe5.js.map → post-tab-header-09074905.js.map} +1 -1
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
- package/dist/cjs/post-tab-panel-9547b9ac.js +27 -0
- package/dist/cjs/{post-tab-panel-b7326ff8.js.map → post-tab-panel-9547b9ac.js.map} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/post-tabs-2ec2778e.js +153 -0
- package/dist/cjs/post-tabs-2ec2778e.js.map +1 -0
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/{post-tooltip-2becc97a.js → post-tooltip-c802c51f.js} +78 -1754
- package/dist/cjs/post-tooltip-c802c51f.js.map +1 -0
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -4
- package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/animations/collapse.js +5 -5
- package/dist/collection/animations/collapse.js.map +1 -1
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/post-accordion/post-accordion.js +167 -166
- package/dist/collection/components/post-accordion/post-accordion.js.map +1 -1
- package/dist/collection/components/post-alert/post-alert.css +2 -2
- package/dist/collection/components/post-alert/post-alert.js +246 -246
- package/dist/collection/components/post-alert/post-alert.js.map +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +170 -169
- package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
- package/dist/collection/components/post-icon/post-icon.css +1 -1
- package/dist/collection/components/post-icon/post-icon.js +250 -250
- package/dist/collection/components/post-icon/post-icon.js.map +1 -1
- package/dist/collection/components/post-popover/post-popover.css +3 -0
- package/dist/collection/components/post-popover/post-popover.js +267 -0
- package/dist/collection/components/post-popover/post-popover.js.map +1 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +288 -0
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js.map +1 -0
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +62 -62
- package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +50 -50
- package/dist/collection/components/post-tab-panel/post-tab-panel.js.map +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +224 -223
- package/dist/collection/components/post-tabs/post-tabs.js.map +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +192 -325
- package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -1
- package/dist/collection/index.js +3 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/is-motion-reduced.js +1 -1
- package/dist/collection/utils/is-motion-reduced.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-non-empty.js +3 -3
- package/dist/collection/utils/property-checkers/check-non-empty.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-one-of.js +2 -2
- package/dist/collection/utils/property-checkers/check-one-of.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-pattern.js +2 -2
- package/dist/collection/utils/property-checkers/check-pattern.js.map +1 -1
- package/dist/collection/utils/property-checkers/check-type.js +10 -10
- package/dist/collection/utils/property-checkers/check-type.js.map +1 -1
- package/dist/collection/utils/property-checkers/empty-or.js +5 -5
- package/dist/collection/utils/property-checkers/empty-or.js.map +1 -1
- package/dist/components/check-non-empty.js +3 -3
- package/dist/components/check-non-empty.js.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +22 -18
- package/dist/components/index2.js.map +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion.d.ts +2 -2
- package/dist/components/post-accordion.js +1 -101
- package/dist/components/post-accordion.js.map +1 -1
- package/dist/components/post-accordion2.js +105 -0
- package/dist/components/post-accordion2.js.map +1 -0
- package/dist/components/post-alert.d.ts +2 -2
- package/dist/components/post-alert2.js +119 -119
- package/dist/components/post-alert2.js.map +1 -1
- package/dist/components/post-collapsible.d.ts +2 -2
- package/dist/components/post-collapsible2.js +91 -91
- package/dist/components/post-collapsible2.js.map +1 -1
- package/dist/components/post-icon.d.ts +2 -2
- package/dist/components/post-icon2.js +118 -118
- package/dist/components/post-icon2.js.map +1 -1
- package/dist/components/post-popover.d.ts +11 -0
- package/dist/components/post-popover.js +8 -0
- package/dist/components/post-popover.js.map +1 -0
- package/dist/components/post-popover2.js +144 -0
- package/dist/components/post-popover2.js.map +1 -0
- package/dist/components/post-popovercontainer.d.ts +11 -0
- package/dist/components/post-popovercontainer.js +8 -0
- package/dist/components/post-popovercontainer.js.map +1 -0
- package/dist/components/post-popovercontainer2.js +1897 -0
- package/dist/components/post-popovercontainer2.js.map +1 -0
- package/dist/components/post-tab-header.d.ts +2 -2
- package/dist/components/post-tab-header2.js +38 -38
- package/dist/components/post-tab-header2.js.map +1 -1
- package/dist/components/post-tab-panel.d.ts +2 -2
- package/dist/components/post-tab-panel2.js +30 -30
- package/dist/components/post-tab-panel2.js.map +1 -1
- package/dist/components/post-tabs.d.ts +2 -2
- package/dist/components/post-tabs2.js +147 -147
- package/dist/components/post-tabs2.js.map +1 -1
- package/dist/components/post-tooltip.d.ts +2 -2
- package/dist/components/post-tooltip2.js +100 -1774
- package/dist/components/post-tooltip2.js.map +1 -1
- package/dist/docs.d.ts +1 -21
- package/dist/docs.json +610 -78
- package/dist/esm/check-non-empty-58bd6b17.js +11 -0
- package/dist/esm/{check-non-empty-09c39561.js.map → check-non-empty-58bd6b17.js.map} +1 -1
- package/dist/esm/index-1427953c.js +40 -0
- package/dist/esm/index-1427953c.js.map +1 -0
- package/dist/esm/{index-08d62a75.js → index-35998e08.js} +79 -59
- package/dist/esm/index-35998e08.js.map +1 -0
- package/dist/esm/index.js +14 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-337354c3.js +5 -0
- package/dist/esm/package-337354c3.js.map +1 -0
- package/dist/esm/post-accordion-c2013bb3.js +85 -0
- package/dist/esm/post-accordion-c2013bb3.js.map +1 -0
- package/dist/esm/post-accordion.entry.js +3 -83
- package/dist/esm/post-accordion.entry.js.map +1 -1
- package/dist/esm/post-alert-7254a70f.js +99 -0
- package/dist/esm/{post-alert-46926902.js.map → post-alert-7254a70f.js.map} +1 -1
- package/dist/esm/post-alert.entry.js +5 -6
- package/dist/esm/post-alert.entry.js.map +1 -1
- package/dist/esm/post-collapsible-4464cc98.js +91 -0
- package/dist/esm/post-collapsible-4464cc98.js.map +1 -0
- package/dist/esm/post-collapsible.entry.js +4 -5
- package/dist/esm/post-collapsible.entry.js.map +1 -1
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/post-components.js.map +1 -1
- package/dist/esm/post-icon-e0bbf0f5.js +103 -0
- package/dist/esm/post-icon-e0bbf0f5.js.map +1 -0
- package/dist/esm/post-icon.entry.js +5 -6
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/esm/post-popover-25eb3f76.js +116 -0
- package/dist/esm/post-popover-25eb3f76.js.map +1 -0
- package/dist/esm/post-popover.entry.js +5 -0
- package/dist/esm/post-popover.entry.js.map +1 -0
- package/dist/esm/post-popovercontainer-54117eea.js +1876 -0
- package/dist/esm/post-popovercontainer-54117eea.js.map +1 -0
- package/dist/esm/post-popovercontainer.entry.js +5 -0
- package/dist/esm/post-popovercontainer.entry.js.map +1 -0
- package/dist/esm/post-tab-header-1684b507.js +31 -0
- package/dist/esm/{post-tab-header-84b12382.js.map → post-tab-header-1684b507.js.map} +1 -1
- package/dist/esm/post-tab-header.entry.js +4 -4
- package/dist/esm/post-tab-panel-add26fe5.js +25 -0
- package/dist/esm/{post-tab-panel-216c0b6e.js.map → post-tab-panel-add26fe5.js.map} +1 -1
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/post-tabs-d738e61f.js +151 -0
- package/dist/esm/post-tabs-d738e61f.js.map +1 -0
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/{post-tooltip-47f2146d.js → post-tooltip-57928808.js} +78 -1754
- package/dist/esm/post-tooltip-57928808.js.map +1 -0
- package/dist/esm/post-tooltip.entry.js +3 -4
- package/dist/esm/post-tooltip.entry.js.map +1 -1
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-05e85f2b.entry.js +2 -0
- package/dist/post-components/p-08abd53e.entry.js +2 -0
- package/dist/post-components/p-09892ad1.js +2 -0
- package/dist/post-components/{p-57b48dff.js.map → p-09892ad1.js.map} +1 -1
- package/dist/post-components/p-1e9ec4a9.entry.js +2 -0
- package/dist/post-components/p-1f55663e.js +2 -0
- package/dist/post-components/p-1f55663e.js.map +1 -0
- package/dist/post-components/p-30c60b6c.entry.js +2 -0
- package/dist/post-components/p-38d97f62.entry.js +2 -0
- package/dist/post-components/p-4c188911.entry.js +2 -0
- package/dist/post-components/p-568bb469.entry.js +2 -0
- package/dist/post-components/p-65c8bd5c.entry.js +2 -0
- package/dist/post-components/p-6e3158e8.js +2 -0
- package/dist/post-components/{p-21549a50.js.map → p-6e3158e8.js.map} +1 -1
- package/dist/post-components/p-7d32dfb7.js +2 -0
- package/dist/post-components/{p-57fdeeab.js.map → p-7d32dfb7.js.map} +1 -1
- package/dist/post-components/p-81591ad0.js +3 -0
- package/dist/post-components/p-81591ad0.js.map +1 -0
- package/dist/post-components/p-96f4ebc4.js +2 -0
- package/dist/post-components/p-96f4ebc4.js.map +1 -0
- package/dist/post-components/p-9bd5f824.js +2 -0
- package/dist/post-components/p-9bd5f824.js.map +1 -0
- package/dist/post-components/{p-b531475e.js → p-b095519d.js} +1 -1
- package/dist/post-components/p-b4b4f59a.js +2 -0
- package/dist/post-components/p-bd032124.js +2 -0
- package/dist/post-components/p-bd032124.js.map +1 -0
- package/dist/post-components/p-c5858d52.entry.js +2 -0
- package/dist/post-components/p-c5858d52.entry.js.map +1 -0
- package/dist/post-components/{p-ce907090.entry.js → p-dbd07f20.js} +2 -2
- package/dist/post-components/p-de493e36.js +2 -0
- package/dist/post-components/p-de493e36.js.map +1 -0
- package/dist/post-components/p-eaddd6cc.js +2 -0
- package/dist/post-components/p-eaddd6cc.js.map +1 -0
- package/dist/post-components/p-ed73d4c0.entry.js +2 -0
- package/dist/post-components/p-ed73d4c0.entry.js.map +1 -0
- package/dist/post-components/p-f994dce8.js +9 -0
- package/dist/post-components/p-f994dce8.js.map +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/post-components/post-components.esm.js.map +1 -1
- package/dist/types/components/post-accordion/post-accordion.d.ts +26 -26
- package/dist/types/components/post-alert/post-alert.d.ts +45 -45
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +31 -31
- package/dist/types/components/post-icon/post-icon.d.ts +43 -43
- package/dist/types/components/post-popover/post-popover.d.ts +53 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +62 -0
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +9 -9
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +8 -8
- package/dist/types/components/post-tabs/post-tabs.d.ts +32 -32
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +35 -62
- package/dist/types/components.d.ts +115 -10
- package/dist/types/index.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/package.json +16 -14
- package/dist/cjs/check-non-empty-ae713942.js.map +0 -1
- package/dist/cjs/check-one-of-27ad3154.js +0 -10
- package/dist/cjs/check-one-of-27ad3154.js.map +0 -1
- package/dist/cjs/index-b38a23e0.js +0 -41
- package/dist/cjs/index-b38a23e0.js.map +0 -1
- package/dist/cjs/index-e7618bb3.js.map +0 -1
- package/dist/cjs/package-041a8597.js +0 -7
- package/dist/cjs/package-041a8597.js.map +0 -1
- package/dist/cjs/post-alert-1fb90f2d.js +0 -101
- package/dist/cjs/post-collapsible-e46002bb.js +0 -93
- package/dist/cjs/post-collapsible-e46002bb.js.map +0 -1
- package/dist/cjs/post-icon-91f6603a.js +0 -105
- package/dist/cjs/post-icon-91f6603a.js.map +0 -1
- package/dist/cjs/post-tab-header-a3845fe5.js +0 -33
- package/dist/cjs/post-tab-panel-b7326ff8.js +0 -27
- package/dist/cjs/post-tabs-384a1fab.js +0 -153
- package/dist/cjs/post-tabs-384a1fab.js.map +0 -1
- package/dist/cjs/post-tooltip-2becc97a.js.map +0 -1
- package/dist/components/check-one-of.js +0 -8
- package/dist/components/check-one-of.js.map +0 -1
- package/dist/esm/check-non-empty-09c39561.js +0 -11
- package/dist/esm/check-one-of-74750af9.js +0 -8
- package/dist/esm/check-one-of-74750af9.js.map +0 -1
- package/dist/esm/index-08d62a75.js.map +0 -1
- package/dist/esm/index-35921354.js +0 -36
- package/dist/esm/index-35921354.js.map +0 -1
- package/dist/esm/package-a962a93d.js +0 -5
- package/dist/esm/package-a962a93d.js.map +0 -1
- package/dist/esm/post-alert-46926902.js +0 -99
- package/dist/esm/post-collapsible-f1b6592d.js +0 -91
- package/dist/esm/post-collapsible-f1b6592d.js.map +0 -1
- package/dist/esm/post-icon-fb627697.js +0 -103
- package/dist/esm/post-icon-fb627697.js.map +0 -1
- package/dist/esm/post-tab-header-84b12382.js +0 -31
- package/dist/esm/post-tab-panel-216c0b6e.js +0 -25
- package/dist/esm/post-tabs-e235d663.js +0 -151
- package/dist/esm/post-tabs-e235d663.js.map +0 -1
- package/dist/esm/post-tooltip-47f2146d.js.map +0 -1
- package/dist/post-components/p-03fe58da.js +0 -2
- package/dist/post-components/p-03fe58da.js.map +0 -1
- package/dist/post-components/p-1339f8cd.js +0 -2
- package/dist/post-components/p-1339f8cd.js.map +0 -1
- package/dist/post-components/p-151b55c0.entry.js +0 -2
- package/dist/post-components/p-21549a50.js +0 -2
- package/dist/post-components/p-4cb18ddf.js +0 -9
- package/dist/post-components/p-4cb18ddf.js.map +0 -1
- package/dist/post-components/p-4e24f13b.entry.js +0 -2
- package/dist/post-components/p-57b48dff.js +0 -2
- package/dist/post-components/p-57fdeeab.js +0 -2
- package/dist/post-components/p-58cc7b5a.entry.js +0 -2
- package/dist/post-components/p-6cafa644.entry.js +0 -2
- package/dist/post-components/p-7f370d77.entry.js +0 -2
- package/dist/post-components/p-7f4eba57.js +0 -2
- package/dist/post-components/p-8c006e7d.js +0 -3
- package/dist/post-components/p-8c006e7d.js.map +0 -1
- package/dist/post-components/p-aee47e1a.entry.js +0 -2
- package/dist/post-components/p-b5e1fd89.js +0 -2
- package/dist/post-components/p-b5e1fd89.js.map +0 -1
- package/dist/post-components/p-d13111f2.js +0 -2
- package/dist/post-components/p-dfe29f7f.js +0 -2
- package/dist/post-components/p-dfe29f7f.js.map +0 -1
- package/dist/post-components/p-f35c2075.entry.js +0 -2
- /package/dist/post-components/{p-151b55c0.entry.js.map → p-05e85f2b.entry.js.map} +0 -0
- /package/dist/post-components/{p-4e24f13b.entry.js.map → p-08abd53e.entry.js.map} +0 -0
- /package/dist/post-components/{p-58cc7b5a.entry.js.map → p-1e9ec4a9.entry.js.map} +0 -0
- /package/dist/post-components/{p-6cafa644.entry.js.map → p-30c60b6c.entry.js.map} +0 -0
- /package/dist/post-components/{p-7f370d77.entry.js.map → p-38d97f62.entry.js.map} +0 -0
- /package/dist/post-components/{p-aee47e1a.entry.js.map → p-4c188911.entry.js.map} +0 -0
- /package/dist/post-components/{p-d13111f2.js.map → p-568bb469.entry.js.map} +0 -0
- /package/dist/post-components/{p-f35c2075.entry.js.map → p-65c8bd5c.entry.js.map} +0 -0
- /package/dist/post-components/{p-b531475e.js.map → p-b095519d.js.map} +0 -0
- /package/dist/post-components/{p-7f4eba57.js.map → p-b4b4f59a.js.map} +0 -0
- /package/dist/post-components/{p-ce907090.entry.js.map → p-dbd07f20.js.map} +0 -0
|
@@ -4,254 +4,254 @@ import { fadeOut } from "../../animations";
|
|
|
4
4
|
import { checkEmptyOrOneOf, checkEmptyOrPattern, checkNonEmpty, checkType } from "../../utils";
|
|
5
5
|
import { ALERT_TYPES } from "./alert-types";
|
|
6
6
|
export class PostAlert {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
validateDismissible(isDismissible = this.dismissible) {
|
|
20
|
-
checkType(isDismissible, 'boolean', 'The post-alert "dismissible" prop should be a boolean.');
|
|
21
|
-
setTimeout(() => this.validateDismissLabel());
|
|
22
|
-
}
|
|
23
|
-
validateDismissLabel(dismissLabel = this.dismissLabel) {
|
|
24
|
-
if (this.dismissible) {
|
|
25
|
-
checkNonEmpty(dismissLabel, 'Dismissible post-alert\'s require a "dismiss-label" prop.');
|
|
7
|
+
constructor() {
|
|
8
|
+
this.alertId = crypto.randomUUID();
|
|
9
|
+
this.classes = undefined;
|
|
10
|
+
this.hasActions = undefined;
|
|
11
|
+
this.hasHeading = undefined;
|
|
12
|
+
this.onDismissButtonClick = () => this.dismiss();
|
|
13
|
+
this.dismissible = false;
|
|
14
|
+
this.dismissLabel = undefined;
|
|
15
|
+
this.fixed = false;
|
|
16
|
+
this.icon = undefined;
|
|
17
|
+
this.type = 'primary';
|
|
26
18
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
validateType(type = this.type) {
|
|
35
|
-
checkEmptyOrOneOf(type, ALERT_TYPES, `The post-alert requires a type form: ${ALERT_TYPES.join(', ')}`);
|
|
36
|
-
}
|
|
37
|
-
connectedCallback() {
|
|
38
|
-
this.validateDismissible();
|
|
39
|
-
this.validateFixed();
|
|
40
|
-
this.validateIcon();
|
|
41
|
-
this.validateType();
|
|
42
|
-
}
|
|
43
|
-
componentWillRender() {
|
|
44
|
-
var _a;
|
|
45
|
-
this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;
|
|
46
|
-
this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;
|
|
47
|
-
this.classes = `alert alert-${(_a = this.type) !== null && _a !== void 0 ? _a : 'primary'}`;
|
|
48
|
-
if (this.dismissible)
|
|
49
|
-
this.classes += ' alert-dismissible';
|
|
50
|
-
if (this.hasActions)
|
|
51
|
-
this.classes += ' alert-action';
|
|
52
|
-
if (this.fixed)
|
|
53
|
-
this.classes += ' alert-fixed-bottom';
|
|
54
|
-
if (this.icon === 'none')
|
|
55
|
-
this.classes += ' no-icon';
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Triggers alert dismissal programmatically (same as clicking on the close button (×)).
|
|
59
|
-
*/
|
|
60
|
-
async dismiss() {
|
|
61
|
-
const dismissal = fadeOut(this.host);
|
|
62
|
-
await dismissal.finished;
|
|
63
|
-
this.host.remove();
|
|
64
|
-
this.dismissed.emit();
|
|
65
|
-
}
|
|
66
|
-
render() {
|
|
67
|
-
const defaultAlertContent = [
|
|
68
|
-
this.hasHeading && (h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, h("slot", { name: "heading" }))),
|
|
69
|
-
h("slot", { key: `${this.alertId}-message` })
|
|
70
|
-
];
|
|
71
|
-
const actionAlertContent = [
|
|
72
|
-
h("div", { key: `${this.alertId}-content`, class: "alert-content" }, defaultAlertContent),
|
|
73
|
-
h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, h("slot", { name: "actions" })),
|
|
74
|
-
];
|
|
75
|
-
return (h(Host, { "data-version": version }, h("div", { role: "alert", class: this.classes }, this.dismissible && (h("button", { class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.alertId}-icon`, name: this.icon })), this.hasActions
|
|
76
|
-
? actionAlertContent
|
|
77
|
-
: defaultAlertContent)));
|
|
78
|
-
}
|
|
79
|
-
static get is() { return "post-alert"; }
|
|
80
|
-
static get encapsulation() { return "shadow"; }
|
|
81
|
-
static get originalStyleUrls() {
|
|
82
|
-
return {
|
|
83
|
-
"$": ["post-alert.scss"]
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
static get styleUrls() {
|
|
87
|
-
return {
|
|
88
|
-
"$": ["post-alert.css"]
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
static get properties() {
|
|
92
|
-
return {
|
|
93
|
-
"dismissible": {
|
|
94
|
-
"type": "boolean",
|
|
95
|
-
"mutable": false,
|
|
96
|
-
"complexType": {
|
|
97
|
-
"original": "boolean",
|
|
98
|
-
"resolved": "boolean",
|
|
99
|
-
"references": {}
|
|
100
|
-
},
|
|
101
|
-
"required": false,
|
|
102
|
-
"optional": false,
|
|
103
|
-
"docs": {
|
|
104
|
-
"tags": [],
|
|
105
|
-
"text": "If `true`, a close button (\u00D7) is displayed and the alert can be dismissed by the user."
|
|
106
|
-
},
|
|
107
|
-
"attribute": "dismissible",
|
|
108
|
-
"reflect": false,
|
|
109
|
-
"defaultValue": "false"
|
|
110
|
-
},
|
|
111
|
-
"dismissLabel": {
|
|
112
|
-
"type": "string",
|
|
113
|
-
"mutable": false,
|
|
114
|
-
"complexType": {
|
|
115
|
-
"original": "string",
|
|
116
|
-
"resolved": "string",
|
|
117
|
-
"references": {}
|
|
118
|
-
},
|
|
119
|
-
"required": false,
|
|
120
|
-
"optional": false,
|
|
121
|
-
"docs": {
|
|
122
|
-
"tags": [],
|
|
123
|
-
"text": "The label to use for the close button of a dismissible alert."
|
|
124
|
-
},
|
|
125
|
-
"attribute": "dismiss-label",
|
|
126
|
-
"reflect": false
|
|
127
|
-
},
|
|
128
|
-
"fixed": {
|
|
129
|
-
"type": "boolean",
|
|
130
|
-
"mutable": false,
|
|
131
|
-
"complexType": {
|
|
132
|
-
"original": "boolean",
|
|
133
|
-
"resolved": "boolean",
|
|
134
|
-
"references": {}
|
|
135
|
-
},
|
|
136
|
-
"required": false,
|
|
137
|
-
"optional": false,
|
|
138
|
-
"docs": {
|
|
139
|
-
"tags": [],
|
|
140
|
-
"text": "If `true`, the alert is positioned at the bottom of the window, from edge to edge."
|
|
141
|
-
},
|
|
142
|
-
"attribute": "fixed",
|
|
143
|
-
"reflect": false,
|
|
144
|
-
"defaultValue": "false"
|
|
145
|
-
},
|
|
146
|
-
"icon": {
|
|
147
|
-
"type": "string",
|
|
148
|
-
"mutable": false,
|
|
149
|
-
"complexType": {
|
|
150
|
-
"original": "string",
|
|
151
|
-
"resolved": "string",
|
|
152
|
-
"references": {}
|
|
153
|
-
},
|
|
154
|
-
"required": false,
|
|
155
|
-
"optional": false,
|
|
156
|
-
"docs": {
|
|
157
|
-
"tags": [],
|
|
158
|
-
"text": "The icon to display in the alert. By default, the icon depends on the alert type.\n\nIf `none`, no icon is displayed."
|
|
159
|
-
},
|
|
160
|
-
"attribute": "icon",
|
|
161
|
-
"reflect": false
|
|
162
|
-
},
|
|
163
|
-
"type": {
|
|
164
|
-
"type": "string",
|
|
165
|
-
"mutable": false,
|
|
166
|
-
"complexType": {
|
|
167
|
-
"original": "AlertType",
|
|
168
|
-
"resolved": "\"danger\" | \"gray\" | \"info\" | \"primary\" | \"success\" | \"warning\"",
|
|
169
|
-
"references": {
|
|
170
|
-
"AlertType": {
|
|
171
|
-
"location": "import",
|
|
172
|
-
"path": "./alert-types",
|
|
173
|
-
"id": "src/components/post-alert/alert-types.ts::AlertType"
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
"required": false,
|
|
178
|
-
"optional": false,
|
|
179
|
-
"docs": {
|
|
180
|
-
"tags": [],
|
|
181
|
-
"text": "The type of the alert."
|
|
182
|
-
},
|
|
183
|
-
"attribute": "type",
|
|
184
|
-
"reflect": false,
|
|
185
|
-
"defaultValue": "'primary'"
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
static get states() {
|
|
190
|
-
return {
|
|
191
|
-
"alertId": {},
|
|
192
|
-
"classes": {},
|
|
193
|
-
"hasActions": {},
|
|
194
|
-
"hasHeading": {},
|
|
195
|
-
"onDismissButtonClick": {}
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
static get events() {
|
|
199
|
-
return [{
|
|
200
|
-
"method": "dismissed",
|
|
201
|
-
"name": "dismissed",
|
|
202
|
-
"bubbles": true,
|
|
203
|
-
"cancelable": true,
|
|
204
|
-
"composed": true,
|
|
205
|
-
"docs": {
|
|
206
|
-
"tags": [],
|
|
207
|
-
"text": "An event emitted when the alert element is dismissed, after the transition.\nIt has no payload and only relevant for dismissible alerts."
|
|
208
|
-
},
|
|
209
|
-
"complexType": {
|
|
210
|
-
"original": "void",
|
|
211
|
-
"resolved": "void",
|
|
212
|
-
"references": {}
|
|
19
|
+
validateDismissible(isDismissible = this.dismissible) {
|
|
20
|
+
checkType(isDismissible, 'boolean', 'The post-alert "dismissible" prop should be a boolean.');
|
|
21
|
+
setTimeout(() => this.validateDismissLabel());
|
|
22
|
+
}
|
|
23
|
+
validateDismissLabel(dismissLabel = this.dismissLabel) {
|
|
24
|
+
if (this.dismissible) {
|
|
25
|
+
checkNonEmpty(dismissLabel, 'Dismissible post-alert\'s require a "dismiss-label" prop.');
|
|
213
26
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
27
|
+
}
|
|
28
|
+
validateFixed(isFixed = this.fixed) {
|
|
29
|
+
checkType(isFixed, 'boolean', 'The post-alert "fixed" prop should be a boolean.');
|
|
30
|
+
}
|
|
31
|
+
validateIcon(icon = this.icon) {
|
|
32
|
+
checkEmptyOrPattern(icon, /\d{4}|none/, 'The post-alert "icon" prop should be a 4-digits string.');
|
|
33
|
+
}
|
|
34
|
+
validateType(type = this.type) {
|
|
35
|
+
checkEmptyOrOneOf(type, ALERT_TYPES, `The post-alert requires a type form: ${ALERT_TYPES.join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
this.validateDismissible();
|
|
39
|
+
this.validateFixed();
|
|
40
|
+
this.validateIcon();
|
|
41
|
+
this.validateType();
|
|
42
|
+
}
|
|
43
|
+
componentWillRender() {
|
|
44
|
+
var _a;
|
|
45
|
+
this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;
|
|
46
|
+
this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;
|
|
47
|
+
this.classes = `alert alert-${(_a = this.type) !== null && _a !== void 0 ? _a : 'primary'}`;
|
|
48
|
+
if (this.dismissible)
|
|
49
|
+
this.classes += ' alert-dismissible';
|
|
50
|
+
if (this.hasActions)
|
|
51
|
+
this.classes += ' alert-action';
|
|
52
|
+
if (this.fixed)
|
|
53
|
+
this.classes += ' alert-fixed-bottom';
|
|
54
|
+
if (this.icon === 'none')
|
|
55
|
+
this.classes += ' no-icon';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Triggers alert dismissal programmatically (same as clicking on the close button (×)).
|
|
59
|
+
*/
|
|
60
|
+
async dismiss() {
|
|
61
|
+
const dismissal = fadeOut(this.host);
|
|
62
|
+
await dismissal.finished;
|
|
63
|
+
this.host.remove();
|
|
64
|
+
this.dismissed.emit();
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
const defaultAlertContent = [
|
|
68
|
+
this.hasHeading && (h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, h("slot", { name: "heading" }))),
|
|
69
|
+
h("slot", { key: `${this.alertId}-message` })
|
|
70
|
+
];
|
|
71
|
+
const actionAlertContent = [
|
|
72
|
+
h("div", { key: `${this.alertId}-content`, class: "alert-content" }, defaultAlertContent),
|
|
73
|
+
h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, h("slot", { name: "actions" })),
|
|
74
|
+
];
|
|
75
|
+
return (h(Host, { "data-version": version }, h("div", { role: "alert", class: this.classes }, this.dismissible && (h("button", { class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.alertId}-icon`, name: this.icon })), this.hasActions
|
|
76
|
+
? actionAlertContent
|
|
77
|
+
: defaultAlertContent)));
|
|
78
|
+
}
|
|
79
|
+
static get is() { return "post-alert"; }
|
|
80
|
+
static get encapsulation() { return "shadow"; }
|
|
81
|
+
static get originalStyleUrls() {
|
|
82
|
+
return {
|
|
83
|
+
"$": ["post-alert.scss"]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
static get styleUrls() {
|
|
87
|
+
return {
|
|
88
|
+
"$": ["post-alert.css"]
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
static get properties() {
|
|
92
|
+
return {
|
|
93
|
+
"dismissible": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"mutable": false,
|
|
96
|
+
"complexType": {
|
|
97
|
+
"original": "boolean",
|
|
98
|
+
"resolved": "boolean",
|
|
99
|
+
"references": {}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": "If `true`, a close button (\u00D7) is displayed and the alert can be dismissed by the user."
|
|
106
|
+
},
|
|
107
|
+
"attribute": "dismissible",
|
|
108
|
+
"reflect": false,
|
|
109
|
+
"defaultValue": "false"
|
|
110
|
+
},
|
|
111
|
+
"dismissLabel": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"mutable": false,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "string",
|
|
116
|
+
"resolved": "string",
|
|
117
|
+
"references": {}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": "The label to use for the close button of a dismissible alert."
|
|
124
|
+
},
|
|
125
|
+
"attribute": "dismiss-label",
|
|
126
|
+
"reflect": false
|
|
127
|
+
},
|
|
128
|
+
"fixed": {
|
|
129
|
+
"type": "boolean",
|
|
130
|
+
"mutable": false,
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "boolean",
|
|
133
|
+
"resolved": "boolean",
|
|
134
|
+
"references": {}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": false,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "If `true`, the alert is positioned at the bottom of the window, from edge to edge."
|
|
141
|
+
},
|
|
142
|
+
"attribute": "fixed",
|
|
143
|
+
"reflect": false,
|
|
144
|
+
"defaultValue": "false"
|
|
145
|
+
},
|
|
146
|
+
"icon": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"mutable": false,
|
|
149
|
+
"complexType": {
|
|
150
|
+
"original": "string",
|
|
151
|
+
"resolved": "string",
|
|
152
|
+
"references": {}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "The icon to display in the alert. By default, the icon depends on the alert type.\n\nIf `none`, no icon is displayed."
|
|
159
|
+
},
|
|
160
|
+
"attribute": "icon",
|
|
161
|
+
"reflect": false
|
|
162
|
+
},
|
|
163
|
+
"type": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"mutable": false,
|
|
166
|
+
"complexType": {
|
|
167
|
+
"original": "AlertType",
|
|
168
|
+
"resolved": "\"danger\" | \"gray\" | \"info\" | \"primary\" | \"success\" | \"warning\"",
|
|
169
|
+
"references": {
|
|
170
|
+
"AlertType": {
|
|
171
|
+
"location": "import",
|
|
172
|
+
"path": "./alert-types",
|
|
173
|
+
"id": "src/components/post-alert/alert-types.ts::AlertType"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"required": false,
|
|
178
|
+
"optional": false,
|
|
179
|
+
"docs": {
|
|
180
|
+
"tags": [],
|
|
181
|
+
"text": "The type of the alert."
|
|
182
|
+
},
|
|
183
|
+
"attribute": "type",
|
|
184
|
+
"reflect": false,
|
|
185
|
+
"defaultValue": "'primary'"
|
|
226
186
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
static get states() {
|
|
190
|
+
return {
|
|
191
|
+
"alertId": {},
|
|
192
|
+
"classes": {},
|
|
193
|
+
"hasActions": {},
|
|
194
|
+
"hasHeading": {},
|
|
195
|
+
"onDismissButtonClick": {}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
static get events() {
|
|
199
|
+
return [{
|
|
200
|
+
"method": "dismissed",
|
|
201
|
+
"name": "dismissed",
|
|
202
|
+
"bubbles": true,
|
|
203
|
+
"cancelable": true,
|
|
204
|
+
"composed": true,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "An event emitted when the alert element is dismissed, after the transition.\nIt has no payload and only relevant for dismissible alerts."
|
|
208
|
+
},
|
|
209
|
+
"complexType": {
|
|
210
|
+
"original": "void",
|
|
211
|
+
"resolved": "void",
|
|
212
|
+
"references": {}
|
|
213
|
+
}
|
|
214
|
+
}];
|
|
215
|
+
}
|
|
216
|
+
static get methods() {
|
|
217
|
+
return {
|
|
218
|
+
"dismiss": {
|
|
219
|
+
"complexType": {
|
|
220
|
+
"signature": "() => Promise<void>",
|
|
221
|
+
"parameters": [],
|
|
222
|
+
"references": {
|
|
223
|
+
"Promise": {
|
|
224
|
+
"location": "global",
|
|
225
|
+
"id": "global::Promise"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"return": "Promise<void>"
|
|
229
|
+
},
|
|
230
|
+
"docs": {
|
|
231
|
+
"text": "Triggers alert dismissal programmatically (same as clicking on the close button (\u00D7)).",
|
|
232
|
+
"tags": []
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
static get elementRef() { return "host"; }
|
|
238
|
+
static get watchers() {
|
|
239
|
+
return [{
|
|
240
|
+
"propName": "dismissible",
|
|
241
|
+
"methodName": "validateDismissible"
|
|
242
|
+
}, {
|
|
243
|
+
"propName": "dismissLabel",
|
|
244
|
+
"methodName": "validateDismissLabel"
|
|
245
|
+
}, {
|
|
246
|
+
"propName": "fixed",
|
|
247
|
+
"methodName": "validateFixed"
|
|
248
|
+
}, {
|
|
249
|
+
"propName": "icon",
|
|
250
|
+
"methodName": "validateIcon"
|
|
251
|
+
}, {
|
|
252
|
+
"propName": "type",
|
|
253
|
+
"methodName": "validateType"
|
|
254
|
+
}];
|
|
255
|
+
}
|
|
256
256
|
}
|
|
257
257
|
//# sourceMappingURL=post-alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-alert.js","sourceRoot":"","sources":["../../../../src/components/post-alert/post-alert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,M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iBAAW,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CAC5D;gBAEA,IAAI,CAAC,UAAU;oBACd,CAAC,CAAC,kBAAkB;oBACpB,CAAC,CAAC,mBAAmB,CAEnB,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { fadeOut } from '../../animations';\nimport { checkEmptyOrOneOf, checkEmptyOrPattern, checkNonEmpty, checkType } from '../../utils';\nimport { ALERT_TYPES, AlertType } from './alert-types';\n\n@Component({\n tag: 'post-alert',\n styleUrl: 'post-alert.scss',\n shadow: true,\n})\nexport class PostAlert {\n @Element() host: HTMLPostAlertElement;\n\n @State() alertId = crypto.randomUUID();\n @State() classes: string;\n @State() hasActions: boolean;\n @State() hasHeading: boolean;\n @State() onDismissButtonClick = () => this.dismiss();\n\n /**\n * If `true`, a close button (×) is displayed and the alert can be dismissed by the user.\n */\n @Prop() readonly dismissible: boolean = false;\n\n @Watch('dismissible')\n validateDismissible(isDismissible = this.dismissible) {\n checkType(isDismissible, 'boolean', 'The post-alert \"dismissible\" prop should be a boolean.');\n setTimeout(() => this.validateDismissLabel());\n }\n\n /**\n * The label to use for the close button of a dismissible alert.\n */\n @Prop() readonly dismissLabel: string;\n\n @Watch('dismissLabel')\n validateDismissLabel(dismissLabel = this.dismissLabel) {\n if (this.dismissible) {\n checkNonEmpty(dismissLabel, 'Dismissible post-alert\\'s require a \"dismiss-label\" prop.');\n }\n }\n\n /**\n * If `true`, the alert is positioned at the bottom of the window, from edge to edge.\n */\n @Prop() readonly fixed: boolean = false;\n\n @Watch('fixed')\n validateFixed(isFixed = this.fixed) {\n checkType(isFixed, 'boolean', 'The post-alert \"fixed\" prop should be a boolean.');\n }\n\n /**\n * The icon to display in the alert. By default, the icon depends on the alert type.\n *\n * If `none`, no icon is displayed.\n */\n @Prop() readonly icon: string;\n\n @Watch('icon')\n validateIcon(icon = this.icon) {\n checkEmptyOrPattern(icon, /\\d{4}|none/, 'The post-alert \"icon\" prop should be a 4-digits string.');\n }\n\n /**\n * The type of the alert.\n */\n @Prop() readonly type: AlertType = 'primary';\n\n @Watch('type')\n validateType(type = this.type) {\n checkEmptyOrOneOf(type, ALERT_TYPES, `The post-alert requires a type form: ${ALERT_TYPES.join(', ')}`);\n }\n\n /**\n * An event emitted when the alert element is dismissed, after the transition.\n * It has no payload and only relevant for dismissible alerts.\n */\n @Event() dismissed: EventEmitter<void>;\n\n connectedCallback() {\n this.validateDismissible();\n this.validateFixed();\n this.validateIcon();\n this.validateType();\n }\n\n componentWillRender() {\n this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;\n this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;\n\n this.classes = `alert alert-${this.type ?? 'primary'}`;\n if (this.dismissible) this.classes += ' alert-dismissible';\n if (this.hasActions) this.classes += ' alert-action';\n if (this.fixed) this.classes += ' alert-fixed-bottom';\n if (this.icon === 'none') this.classes += ' no-icon';\n }\n\n /**\n * Triggers alert dismissal programmatically (same as clicking on the close button (×)).\n */\n @Method()\n async dismiss() {\n const dismissal = fadeOut(this.host);\n\n await dismissal.finished;\n\n this.host.remove();\n this.dismissed.emit();\n }\n\n render() {\n const defaultAlertContent = [\n this.hasHeading && (\n <div key={`${this.alertId}-heading`} class=\"alert-heading\">\n <slot name=\"heading\"/>\n </div>\n ),\n <slot key={`${this.alertId}-message`}/>\n ];\n\n const actionAlertContent = [\n <div key={`${this.alertId}-content`} class=\"alert-content\">\n {defaultAlertContent}\n </div>,\n <div key={`${this.alertId}-buttons`} class=\"alert-buttons\">\n <slot name=\"actions\"/>\n </div>,\n ];\n\n return (\n <Host data-version={version}>\n <div role=\"alert\" class={this.classes}>\n {this.dismissible && (\n <button class=\"btn-close\" onClick={this.onDismissButtonClick}>\n <span class=\"visually-hidden\">{this.dismissLabel}</span>\n </button>\n )}\n\n {this.icon && this.icon !== 'none' && (\n <post-icon key={`${this.alertId}-icon`} name={this.icon} />\n )}\n\n {this.hasActions\n ? actionAlertContent\n : defaultAlertContent\n }\n </div>\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.accordion-item{border-block
|
|
1
|
+
.accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item{--post-bg-opacity: 1;background-color:rgba(var(--post-bg-rgb), var(--post-bg-opacity)) !important;color:var(--post-contrast-color) !important}.accordion-item,.bg-light .accordion-item,.bg-gray .accordion-item{--post-contrast-color: #000;--post-contrast-color-inverted: #fff;--post-gray-10: hsl(0, 0%, 90%);--post-gray-20: hsl(0, 0%, 80%);--post-gray-40: hsl(0, 0%, 60%);--post-gray-60: hsl(0, 0%, 40%);--post-gray-80: hsl(0, 0%, 20%);--post-yellow: #fc0;--post-light: #faf9f8;--post-gray: #f4f3f1;--post-dark: hsl(0, 0%, 20%);--post-primary: hsl(0, 0%, 20%);--post-white: #fff;--post-black: #000;--post-info: #cce4ee;--post-success: #2c911c;--post-warning: #f49e00;--post-danger: #a51728;--post-nightblue: #004976;--post-nightblue-bright: #0076a8;--post-petrol: #006d68;--post-petrol-bright: #00968f;--post-coral: #9e2a2f;--post-coral-bright: #e03c31;--post-olive: #716135;--post-olive-bright: #aa9d2e;--post-purple: #80276c;--post-purple-bright: #c5299b;--post-aubergine: #523178;--post-aubergine-bright: #7566a0;--post-success-green: #2c871d;--post-error-red: #a51728;--post-warning-orange: #f49e00;--post-success-background: #c0debb;--post-error-background: #ffdade;--post-warning-background: #fce2b2;--post-contrast-color-rgb: 0, 0, 0;--post-contrast-color-inverted-rgb: 255, 255, 255;--post-gray-10-rgb: 230, 230, 230;--post-gray-20-rgb: 204, 204, 204;--post-gray-40-rgb: 153, 153, 153;--post-gray-60-rgb: 102, 102, 102;--post-gray-80-rgb: 51, 51, 51;--post-yellow-rgb: 255, 204, 0;--post-light-rgb: 250, 249, 248;--post-gray-rgb: 244, 243, 241;--post-dark-rgb: 51, 51, 51;--post-primary-rgb: 51, 51, 51;--post-white-rgb: 255, 255, 255;--post-black-rgb: 0, 0, 0;--post-info-rgb: 204, 228, 238;--post-success-rgb: 44, 145, 28;--post-warning-rgb: 244, 158, 0;--post-danger-rgb: 165, 23, 40;--post-nightblue-rgb: 0, 73, 118;--post-nightblue-bright-rgb: 0, 118, 168;--post-petrol-rgb: 0, 109, 104;--post-petrol-bright-rgb: 0, 150, 143;--post-coral-rgb: 158, 42, 47;--post-coral-bright-rgb: 224, 60, 49;--post-olive-rgb: 113, 97, 53;--post-olive-bright-rgb: 170, 157, 46;--post-purple-rgb: 128, 39, 108;--post-purple-bright-rgb: 197, 41, 155;--post-aubergine-rgb: 82, 49, 120;--post-aubergine-bright-rgb: 117, 102, 160;--post-success-green-rgb: 44, 135, 29;--post-error-red-rgb: 165, 23, 40;--post-warning-orange-rgb: 244, 158, 0;--post-success-background-rgb: 192, 222, 187;--post-error-background-rgb: 255, 218, 222;--post-warning-background-rgb: 252, 226, 178}.accordion-item{border-block:2px solid #666;--post-bg-rgb: 244, 243, 241}.accordion-item+.accordion-item{border-block-start:0}.bg-light .accordion-item{--post-bg-rgb: 255, 255, 255}.bg-gray .accordion-item{--post-bg-rgb: 255, 255, 255}.accordion-header{color:#333;font-size:1rem;font-weight:700;line-height:1.5;margin:0}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;-webkit-appearance:button;appearance:button;outline:none;width:100%;position:relative;padding-block:1rem;padding-inline-start:1rem;padding-inline-end:3rem;text-align:start;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms}.accordion-button:focus-visible{outline:2px solid #1976c8}.accordion-button:hover{color:#000;background-color:#e6e6e6}.accordion-button:disabled{opacity:.4;pointer-events:none}.accordion-button::after{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6z'/%3E%3C/g%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xml:space='preserve' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='icon'%3E%3Cpath d='m23.6 18.3-.9.9-6.7-6.6-6.6 6.6-.9-.9 7.5-7.6z'/%3E%3C/g%3E%3C/svg%3E");background-color:currentColor;content:"";display:block;height:1.5rem;width:1.5rem;position:absolute;inset-inline-end:1rem;inset-block-start:50%;transform:translateY(-50%);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed::after{transform:translateY(-50%) rotate(-180deg)}.accordion-button>.text-truncate{display:block}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover:not(:disabled),.accordion-button:focus-visible:not(:disabled){outline:2px solid Highlight}.accordion-button:disabled{opacity:1 !important}}.accordion-body{padding:.5rem 1rem 1rem;font-weight:300}.accordion-button>*,.accordion-body>:first-child{margin-block-start:0 !important}.accordion-button>*,.accordion-body>:last-child{margin-block-end:0 !important}:host{display:block}.accordion-button{cursor:pointer}.accordion-button>::slotted(.text-truncate){display:block}post-collapsible+post-collapsible::part(accordion-item){border-block-start:0 !important}
|