@swisspost/design-system-components 1.5.0 → 1.6.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 +13 -0
- package/dist/cjs/check-non-empty-ae713942.js.map +1 -0
- package/dist/cjs/{check-one-of-4c2e8b2e.js → check-one-of-27ad3154.js} +1 -1
- package/dist/cjs/check-one-of-27ad3154.js.map +1 -0
- package/dist/cjs/constants-238701d3.js +7 -0
- package/dist/cjs/constants-238701d3.js.map +1 -0
- package/dist/cjs/fade-35a3633a.js +12 -0
- package/dist/cjs/fade-35a3633a.js.map +1 -0
- package/dist/cjs/index-b38a23e0.js +41 -0
- package/dist/cjs/index-b38a23e0.js.map +1 -0
- package/dist/cjs/{index-12cc37c9.js → index-b619e205.js} +245 -41
- package/dist/cjs/index-b619e205.js.map +1 -0
- package/dist/cjs/index.cjs.js +26 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +3 -12
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/package-7c4db872.js +7 -0
- package/dist/cjs/package-7c4db872.js.map +1 -0
- package/dist/cjs/post-accordion.cjs.entry.js +89 -0
- package/dist/cjs/post-accordion.cjs.entry.js.map +1 -0
- package/dist/cjs/post-alert-c037e6a3.js +101 -0
- package/dist/cjs/post-alert-c037e6a3.js.map +1 -0
- package/dist/cjs/post-alert.cjs.entry.js +9 -97
- package/dist/cjs/post-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/post-collapsible-7c9d23a2.js +93 -0
- package/dist/cjs/post-collapsible-7c9d23a2.js.map +1 -0
- package/dist/cjs/post-collapsible.cjs.entry.js +7 -119
- package/dist/cjs/post-collapsible.cjs.entry.js.map +1 -1
- package/dist/cjs/post-components.cjs.js +3 -6
- package/dist/cjs/post-components.cjs.js.map +1 -1
- package/dist/cjs/post-icon-f418f76a.js +105 -0
- package/dist/cjs/post-icon-f418f76a.js.map +1 -0
- package/dist/cjs/post-icon.cjs.entry.js +8 -100
- package/dist/cjs/post-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tab-header-e08c2a42.js +33 -0
- package/dist/cjs/post-tab-header-e08c2a42.js.map +1 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +6 -26
- package/dist/cjs/post-tab-header.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tab-panel-721f7f32.js +27 -0
- package/dist/cjs/post-tab-panel-721f7f32.js.map +1 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +4 -20
- package/dist/cjs/post-tab-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tabs-4bcc867b.js +153 -0
- package/dist/cjs/post-tabs-4bcc867b.js.map +1 -0
- package/dist/cjs/post-tabs.cjs.entry.js +5 -127
- package/dist/cjs/post-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/post-tooltip-261c5cda.js +5095 -0
- package/dist/cjs/post-tooltip-261c5cda.js.map +1 -0
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -5088
- package/dist/cjs/post-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/animations/collapse.js +13 -0
- package/dist/collection/animations/collapse.js.map +1 -0
- package/dist/collection/animations/fade.js +4 -4
- package/dist/collection/animations/fade.js.map +1 -1
- package/dist/collection/collection-manifest.json +10 -9
- package/dist/collection/components/post-accordion/post-accordion.css +1 -0
- package/dist/collection/components/post-accordion/post-accordion.js +178 -0
- package/dist/collection/components/post-accordion/post-accordion.js.map +1 -0
- package/dist/collection/components/post-alert/post-alert.css +6 -534
- package/dist/collection/components/post-alert/post-alert.js +10 -9
- package/dist/collection/components/post-alert/post-alert.js.map +1 -1
- package/dist/collection/components/post-collapsible/heading-levels.js +2 -0
- package/dist/collection/components/post-collapsible/heading-levels.js.map +1 -0
- package/dist/collection/components/post-collapsible/post-collapsible.css +1 -261
- package/dist/collection/components/post-collapsible/post-collapsible.js +65 -63
- package/dist/collection/components/post-collapsible/post-collapsible.js.map +1 -1
- package/dist/collection/components/post-icon/post-icon.css +1 -102
- package/dist/collection/components/post-icon/post-icon.js +5 -4
- package/dist/collection/components/post-icon/post-icon.js.map +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.css +3 -337
- package/dist/collection/components/post-tab-header/post-tab-header.js +6 -5
- package/dist/collection/components/post-tab-header/post-tab-header.js.map +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.css +1 -3
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -2
- package/dist/collection/components/post-tabs/post-tabs.css +1 -148
- package/dist/collection/components/post-tabs/post-tabs.js +36 -13
- package/dist/collection/components/post-tabs/post-tabs.js.map +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -194
- package/dist/collection/components/post-tooltip/post-tooltip.js +22 -15
- package/dist/collection/components/post-tooltip/post-tooltip.js.map +1 -1
- package/dist/collection/index.js +8 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/index.js +1 -3
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/collection/utils/is-motion-reduced.js +4 -0
- package/dist/collection/utils/is-motion-reduced.js.map +1 -0
- package/dist/collection/utils/property-checkers/check-non-empty.js +1 -1
- package/dist/collection/utils/property-checkers/empty-or.js +1 -1
- package/dist/collection/utils/property-checkers/index.js +4 -4
- package/dist/components/check-non-empty.js +2 -2
- package/dist/components/check-non-empty.js.map +1 -1
- package/dist/components/check-one-of.js.map +1 -1
- package/dist/components/constants.js +5 -0
- package/dist/components/constants.js.map +1 -0
- package/dist/components/fade.js +4 -4
- package/dist/components/fade.js.map +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +8 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +36 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion.d.ts +11 -0
- package/dist/components/post-accordion.js +108 -0
- package/dist/components/post-accordion.js.map +1 -0
- package/dist/components/post-alert.js +1 -129
- package/dist/components/post-alert.js.map +1 -1
- package/dist/components/post-alert2.js +138 -0
- package/dist/components/post-alert2.js.map +1 -0
- package/dist/components/post-collapsible.js +1 -146
- package/dist/components/post-collapsible.js.map +1 -1
- package/dist/components/post-collapsible2.js +117 -0
- package/dist/components/post-collapsible2.js.map +1 -0
- package/dist/components/post-icon2.js +12 -22
- package/dist/components/post-icon2.js.map +1 -1
- package/dist/components/post-tab-header.js +1 -45
- package/dist/components/post-tab-header.js.map +1 -1
- package/dist/components/post-tab-header2.js +51 -0
- package/dist/components/post-tab-header2.js.map +1 -0
- package/dist/components/post-tab-panel.js +1 -39
- package/dist/components/post-tab-panel.js.map +1 -1
- package/dist/components/post-tab-panel2.js +43 -0
- package/dist/components/post-tab-panel2.js.map +1 -0
- package/dist/components/post-tabs.js +1 -146
- package/dist/components/post-tabs.js.map +1 -1
- package/dist/components/post-tabs2.js +169 -0
- package/dist/components/post-tabs2.js.map +1 -0
- package/dist/components/post-tooltip.js +1 -5111
- package/dist/components/post-tooltip.js.map +1 -1
- package/dist/components/post-tooltip2.js +5117 -0
- package/dist/components/post-tooltip2.js.map +1 -0
- package/dist/docs.d.ts +334 -235
- package/dist/docs.json +458 -14
- package/dist/esm/check-non-empty-09c39561.js +11 -0
- package/dist/esm/check-non-empty-09c39561.js.map +1 -0
- package/dist/esm/{check-one-of-ded5e15e.js → check-one-of-74750af9.js} +1 -1
- package/dist/esm/check-one-of-74750af9.js.map +1 -0
- package/dist/esm/constants-8d548297.js +5 -0
- package/dist/esm/constants-8d548297.js.map +1 -0
- package/dist/esm/fade-7fd71785.js +9 -0
- package/dist/esm/fade-7fd71785.js.map +1 -0
- package/dist/esm/index-35921354.js +36 -0
- package/dist/esm/index-35921354.js.map +1 -0
- package/dist/esm/{index-5611074b.js → index-4eff5fc5.js} +245 -41
- package/dist/esm/index-4eff5fc5.js.map +1 -0
- package/dist/esm/index.js +14 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +4 -13
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/package-3bbdb32c.js +5 -0
- package/dist/esm/package-3bbdb32c.js.map +1 -0
- package/dist/esm/post-accordion.entry.js +85 -0
- package/dist/esm/post-accordion.entry.js.map +1 -0
- package/dist/esm/post-alert-5dd43c8b.js +99 -0
- package/dist/esm/post-alert-5dd43c8b.js.map +1 -0
- package/dist/esm/post-alert.entry.js +8 -100
- package/dist/esm/post-alert.entry.js.map +1 -1
- package/dist/esm/post-collapsible-26dc2340.js +91 -0
- package/dist/esm/post-collapsible-26dc2340.js.map +1 -0
- package/dist/esm/post-collapsible.entry.js +6 -122
- package/dist/esm/post-collapsible.entry.js.map +1 -1
- package/dist/esm/post-components.js +4 -7
- package/dist/esm/post-components.js.map +1 -1
- package/dist/esm/post-icon-fb0eb8aa.js +103 -0
- package/dist/esm/post-icon-fb0eb8aa.js.map +1 -0
- package/dist/esm/post-icon.entry.js +7 -103
- package/dist/esm/post-icon.entry.js.map +1 -1
- package/dist/esm/post-tab-header-deebc551.js +31 -0
- package/dist/esm/post-tab-header-deebc551.js.map +1 -0
- package/dist/esm/post-tab-header.entry.js +5 -29
- package/dist/esm/post-tab-header.entry.js.map +1 -1
- package/dist/esm/post-tab-panel-4b820f71.js +25 -0
- package/dist/esm/post-tab-panel-4b820f71.js.map +1 -0
- package/dist/esm/post-tab-panel.entry.js +3 -23
- package/dist/esm/post-tab-panel.entry.js.map +1 -1
- package/dist/esm/post-tabs-2d8d6a33.js +151 -0
- package/dist/esm/post-tabs-2d8d6a33.js.map +1 -0
- package/dist/esm/post-tabs.entry.js +4 -130
- package/dist/esm/post-tabs.entry.js.map +1 -1
- package/dist/esm/post-tooltip-811309c5.js +5093 -0
- package/dist/esm/post-tooltip-811309c5.js.map +1 -0
- package/dist/esm/post-tooltip.entry.js +4 -5091
- package/dist/esm/post-tooltip.entry.js.map +1 -1
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/{p-2b6ab354.entry.js → p-01e8dfe6.js} +3 -3
- package/dist/post-components/p-01e8dfe6.js.map +1 -0
- package/dist/post-components/p-0a49c1a3.entry.js +2 -0
- package/dist/post-components/{p-bcc705f1.js → p-1339f8cd.js} +1 -1
- package/dist/post-components/p-1339f8cd.js.map +1 -0
- package/dist/post-components/p-1a8a8ef2.js +2 -0
- package/dist/post-components/p-1a8a8ef2.js.map +1 -0
- package/dist/post-components/p-27092ac3.entry.js +2 -0
- package/dist/post-components/p-27092ac3.entry.js.map +1 -0
- package/dist/post-components/{p-e5306504.js → p-2737eaf5.js} +1 -1
- package/dist/post-components/p-2737eaf5.js.map +1 -0
- package/dist/post-components/p-332eef46.js +2 -0
- package/dist/post-components/p-332eef46.js.map +1 -0
- package/dist/post-components/p-440193f4.js +2 -0
- package/dist/post-components/p-440193f4.js.map +1 -0
- package/dist/post-components/p-541142fd.js +2 -0
- package/dist/post-components/p-541142fd.js.map +1 -0
- package/dist/post-components/p-574acdb0.js +2 -0
- package/dist/post-components/p-574acdb0.js.map +1 -0
- package/dist/post-components/p-66460e3f.entry.js +2 -0
- package/dist/post-components/p-66460e3f.entry.js.map +1 -0
- package/dist/post-components/p-810ee105.entry.js +2 -0
- package/dist/post-components/p-810ee105.entry.js.map +1 -0
- package/dist/post-components/p-939df031.entry.js +2 -0
- package/dist/post-components/p-939df031.entry.js.map +1 -0
- package/dist/post-components/p-94b3f291.entry.js +2 -0
- package/dist/post-components/p-94b3f291.entry.js.map +1 -0
- package/dist/post-components/p-97000cb6.js +2 -0
- package/dist/post-components/p-97000cb6.js.map +1 -0
- package/dist/post-components/p-a7649277.js +3 -0
- package/dist/post-components/p-a7649277.js.map +1 -0
- package/dist/post-components/p-abd149b3.entry.js +2 -0
- package/dist/post-components/p-abd149b3.entry.js.map +1 -0
- package/dist/post-components/p-b531475e.js +2 -0
- package/dist/post-components/p-b531475e.js.map +1 -0
- package/dist/post-components/p-c6b73d6e.js +2 -0
- package/dist/post-components/p-c6b73d6e.js.map +1 -0
- package/dist/post-components/{p-29535fea.entry.js → p-d4fb9f16.js} +2 -2
- package/dist/post-components/p-d4fb9f16.js.map +1 -0
- package/dist/post-components/p-dfe29f7f.js +2 -0
- package/dist/post-components/p-dfe29f7f.js.map +1 -0
- package/dist/post-components/p-e9dc9039.entry.js +2 -0
- package/dist/post-components/p-e9dc9039.entry.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/animations/collapse.d.ts +2 -0
- package/dist/types/components/post-accordion/post-accordion.d.ts +28 -0
- package/dist/types/components/post-alert/post-alert.d.ts +1 -1
- package/dist/types/components/post-collapsible/heading-levels.d.ts +2 -0
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +16 -12
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -0
- package/dist/types/components.d.ts +79 -3
- package/dist/types/index.d.ts +7 -0
- package/dist/types/stencil-public-runtime.d.ts +38 -5
- package/dist/types/utils/index.d.ts +1 -3
- package/dist/types/utils/is-motion-reduced.d.ts +1 -0
- package/loader/index.d.ts +1 -1
- package/package.json +8 -8
- package/dist/cjs/check-non-empty-35b4d0b5.js +0 -14
- package/dist/cjs/check-non-empty-35b4d0b5.js.map +0 -1
- package/dist/cjs/check-one-of-4c2e8b2e.js.map +0 -1
- package/dist/cjs/check-type-508a21a5.js +0 -18
- package/dist/cjs/check-type-508a21a5.js.map +0 -1
- package/dist/cjs/fade-8c6d4fa7.js +0 -12
- package/dist/cjs/fade-8c6d4fa7.js.map +0 -1
- package/dist/cjs/index-12cc37c9.js.map +0 -1
- package/dist/cjs/index-f8f6f146.js +0 -28
- package/dist/cjs/index-f8f6f146.js.map +0 -1
- package/dist/cjs/package-67091813.js +0 -7
- package/dist/cjs/package-67091813.js.map +0 -1
- package/dist/collection/utils/get-element-height.js +0 -12
- package/dist/collection/utils/get-element-height.js.map +0 -1
- package/dist/collection/utils/on-transition-end.js +0 -15
- package/dist/collection/utils/on-transition-end.js.map +0 -1
- package/dist/collection/utils/should-reduce-motion.js +0 -4
- package/dist/collection/utils/should-reduce-motion.js.map +0 -1
- package/dist/components/check-type.js +0 -16
- package/dist/components/check-type.js.map +0 -1
- package/dist/esm/check-non-empty-554bdf88.js +0 -11
- package/dist/esm/check-non-empty-554bdf88.js.map +0 -1
- package/dist/esm/check-one-of-ded5e15e.js.map +0 -1
- package/dist/esm/check-type-18ebb4e7.js +0 -16
- package/dist/esm/check-type-18ebb4e7.js.map +0 -1
- package/dist/esm/fade-671f1489.js +0 -9
- package/dist/esm/fade-671f1489.js.map +0 -1
- package/dist/esm/index-5611074b.js.map +0 -1
- package/dist/esm/index-7f723686.js +0 -24
- package/dist/esm/index-7f723686.js.map +0 -1
- package/dist/esm/package-f5cb3167.js +0 -5
- package/dist/esm/package-f5cb3167.js.map +0 -1
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/post-components/p-12046db8.entry.js +0 -2
- package/dist/post-components/p-12046db8.entry.js.map +0 -1
- package/dist/post-components/p-15fc087f.js +0 -2
- package/dist/post-components/p-15fc087f.js.map +0 -1
- package/dist/post-components/p-24b07f64.js +0 -2
- package/dist/post-components/p-29535fea.entry.js.map +0 -1
- package/dist/post-components/p-296af738.entry.js +0 -2
- package/dist/post-components/p-296af738.entry.js.map +0 -1
- package/dist/post-components/p-2b6ab354.entry.js.map +0 -1
- package/dist/post-components/p-75a7b352.js +0 -2
- package/dist/post-components/p-75a7b352.js.map +0 -1
- package/dist/post-components/p-a14ec7bb.entry.js +0 -2
- package/dist/post-components/p-a14ec7bb.entry.js.map +0 -1
- package/dist/post-components/p-bcc705f1.js.map +0 -1
- package/dist/post-components/p-c7497ecb.entry.js +0 -2
- package/dist/post-components/p-c7497ecb.entry.js.map +0 -1
- package/dist/post-components/p-c8efe0ae.js +0 -2
- package/dist/post-components/p-c8efe0ae.js.map +0 -1
- package/dist/post-components/p-cc6e4eb8.entry.js +0 -2
- package/dist/post-components/p-cc6e4eb8.entry.js.map +0 -1
- package/dist/post-components/p-d94db268.js +0 -3
- package/dist/post-components/p-d94db268.js.map +0 -1
- package/dist/post-components/p-e5306504.js.map +0 -1
- package/dist/types/utils/get-element-height.d.ts +0 -3
- package/dist/types/utils/on-transition-end.d.ts +0 -1
- package/dist/types/utils/should-reduce-motion.d.ts +0 -1
- /package/dist/post-components/{p-24b07f64.js.map → p-0a49c1a3.entry.js.map} +0 -0
|
@@ -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,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAa,MAAM,eAAe,CAAC;AAOvD,MAAM,OAAO,SAAS;;mBAGD,MAAM,CAAC,UAAU,EAAE;;;;gCAIN,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE;uBAKZ,KAAK;;iBAuBX,KAAK;;gBAsBJ,SAAS;;EA1C5C,mBAAmB,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW;IAClD,SAAS,CAAC,aAAa,EAAE,SAAS,EAAE,wDAAwD,CAAC,CAAC;IAC9F,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;EAChD,CAAC;EAQD,oBAAoB,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY;IACnD,IAAI,IAAI,CAAC,WAAW,EAAE;MACpB,aAAa,CAAC,YAAY,EAAE,2DAA2D,CAAC,CAAC;KAC1F;EACH,CAAC;EAQD,a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,OAAO,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CAC5D;QAEA,IAAI,CAAC,UAAU;UACd,CAAC,CAAC,kBAAkB;UACpB,CAAC,CAAC,mBAAmB,CAEnB,CACD,CACR,CAAC;EACJ,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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading-levels.js","sourceRoot":"","sources":["../../../../src/components/post-collapsible/heading-levels.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAU,CAAC","sourcesContent":["export const HEADING_LEVELS = [1, 2, 3, 4, 5, 6] as const;\n\nexport type HeadingLevel = typeof HEADING_LEVELS[number];\n"]}
|
|
@@ -1,261 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Colors used by the post style guide
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Maps. Allow maps to have custom colors from the project
|
|
6
|
-
* by always merging into a default empty map
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Colors used by the post style guide
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Maps. Allow maps to have custom colors from the project
|
|
13
|
-
* by always merging into a default empty map
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Override the necessary bootstrap
|
|
17
|
-
* colors and maps using colors from
|
|
18
|
-
* the post style guide only.
|
|
19
|
-
*
|
|
20
|
-
* Other bootstrap colors
|
|
21
|
-
* will be available as sass-variables
|
|
22
|
-
* but should not be used.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* Colors used by the post style guide
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Maps. Allow maps to have custom colors from the project
|
|
29
|
-
* by always merging into a default empty map
|
|
30
|
-
*/
|
|
31
|
-
.accordion-item {
|
|
32
|
-
border-block-start: 2px solid hsl(0, 0%, 90%);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.accordion-header {
|
|
36
|
-
font-size: 1.0625rem;
|
|
37
|
-
font-weight: 700;
|
|
38
|
-
line-height: 1.5;
|
|
39
|
-
margin: 0;
|
|
40
|
-
}
|
|
41
|
-
@media (min-width: 1024px) {
|
|
42
|
-
.accordion-header {
|
|
43
|
-
font-size: 1.25rem;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.accordion-button {
|
|
48
|
-
padding: 0;
|
|
49
|
-
overflow: visible;
|
|
50
|
-
border: 0;
|
|
51
|
-
background: none;
|
|
52
|
-
color: inherit;
|
|
53
|
-
font: inherit;
|
|
54
|
-
user-select: none;
|
|
55
|
-
appearance: button;
|
|
56
|
-
width: 100%;
|
|
57
|
-
position: relative;
|
|
58
|
-
padding-block: 1rem;
|
|
59
|
-
padding-inline-start: 1rem;
|
|
60
|
-
padding-inline-end: 2.5rem;
|
|
61
|
-
text-align: start;
|
|
62
|
-
}
|
|
63
|
-
.accordion-button:not(:disabled) {
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
}
|
|
66
|
-
.accordion-button:disabled {
|
|
67
|
-
opacity: 0.4;
|
|
68
|
-
}
|
|
69
|
-
.accordion-button:focus {
|
|
70
|
-
outline: none;
|
|
71
|
-
box-shadow: 0 0 0 0.125rem rgba(51, 51, 51, 0.25);
|
|
72
|
-
}
|
|
73
|
-
.accordion-button::after {
|
|
74
|
-
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
75
|
-
-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.6 7.6 7.6z'/%3E%3C/g%3E%3C/svg%3E");
|
|
76
|
-
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.6 7.6 7.6z'/%3E%3C/g%3E%3C/svg%3E");
|
|
77
|
-
background-color: currentColor;
|
|
78
|
-
content: "";
|
|
79
|
-
display: block;
|
|
80
|
-
height: 1.5rem;
|
|
81
|
-
width: 1.5rem;
|
|
82
|
-
position: absolute;
|
|
83
|
-
inset-inline-end: 1rem;
|
|
84
|
-
inset-block-start: 50%;
|
|
85
|
-
transform: translateY(-50%);
|
|
86
|
-
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
87
|
-
border: 1px solid rgb(var(--post-bg-rgb, 255, 255, 255));
|
|
88
|
-
}
|
|
89
|
-
.accordion-button.collapsed::after {
|
|
90
|
-
transform: translateY(-50%) rotate(-180deg);
|
|
91
|
-
}
|
|
92
|
-
.accordion-button > .text-truncate {
|
|
93
|
-
display: block;
|
|
94
|
-
}
|
|
95
|
-
@media (forced-colors: active), (-ms-high-contrast: active), (-ms-high-contrast: white-on-black) {
|
|
96
|
-
.accordion-button:hover:not(:disabled), .accordion-button:focus-visible:not(:disabled) {
|
|
97
|
-
outline: 2px solid Highlight;
|
|
98
|
-
}
|
|
99
|
-
.accordion-button:disabled {
|
|
100
|
-
opacity: 1 !important;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.accordion-body {
|
|
105
|
-
padding: 0.75rem 1rem 2.5rem;
|
|
106
|
-
border-block-start: 2px solid hsl(0, 0%, 90%);
|
|
107
|
-
}
|
|
108
|
-
.accordion-body h1,
|
|
109
|
-
.accordion-body .h1 {
|
|
110
|
-
font-size: 1.0625rem;
|
|
111
|
-
margin: 2.5rem 0 0;
|
|
112
|
-
font-weight: 700;
|
|
113
|
-
}
|
|
114
|
-
@media (min-width: 1024px) {
|
|
115
|
-
.accordion-body h1,
|
|
116
|
-
.accordion-body .h1 {
|
|
117
|
-
font-size: 1.25rem;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
.accordion-body h2,
|
|
121
|
-
.accordion-body .h2 {
|
|
122
|
-
font-size: 1.0625rem;
|
|
123
|
-
margin: 2.5rem 0 0;
|
|
124
|
-
font-weight: 700;
|
|
125
|
-
}
|
|
126
|
-
@media (min-width: 1024px) {
|
|
127
|
-
.accordion-body h2,
|
|
128
|
-
.accordion-body .h2 {
|
|
129
|
-
font-size: 1.25rem;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
.accordion-body h3,
|
|
133
|
-
.accordion-body .h3 {
|
|
134
|
-
font-size: 1.0625rem;
|
|
135
|
-
margin: 2.5rem 0 0;
|
|
136
|
-
font-weight: 700;
|
|
137
|
-
}
|
|
138
|
-
@media (min-width: 1024px) {
|
|
139
|
-
.accordion-body h3,
|
|
140
|
-
.accordion-body .h3 {
|
|
141
|
-
font-size: 1.25rem;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
.accordion-body h4,
|
|
145
|
-
.accordion-body .h4 {
|
|
146
|
-
font-size: 1.0625rem;
|
|
147
|
-
margin: 2.5rem 0 0;
|
|
148
|
-
font-weight: 700;
|
|
149
|
-
}
|
|
150
|
-
@media (min-width: 1024px) {
|
|
151
|
-
.accordion-body h4,
|
|
152
|
-
.accordion-body .h4 {
|
|
153
|
-
font-size: 1.25rem;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
.accordion-body h5,
|
|
157
|
-
.accordion-body .h5 {
|
|
158
|
-
font-size: 1.0625rem;
|
|
159
|
-
margin: 2.5rem 0 0;
|
|
160
|
-
font-weight: 700;
|
|
161
|
-
}
|
|
162
|
-
@media (min-width: 1024px) {
|
|
163
|
-
.accordion-body h5,
|
|
164
|
-
.accordion-body .h5 {
|
|
165
|
-
font-size: 1.25rem;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
.accordion-body h6,
|
|
169
|
-
.accordion-body .h6 {
|
|
170
|
-
font-size: 1.0625rem;
|
|
171
|
-
margin: 2.5rem 0 0;
|
|
172
|
-
font-weight: 700;
|
|
173
|
-
}
|
|
174
|
-
@media (min-width: 1024px) {
|
|
175
|
-
.accordion-body h6,
|
|
176
|
-
.accordion-body .h6 {
|
|
177
|
-
font-size: 1.25rem;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.accordion-button > :first-child,
|
|
182
|
-
.accordion-body > :first-child {
|
|
183
|
-
margin-block-start: 0 !important;
|
|
184
|
-
}
|
|
185
|
-
.accordion-button > :last-child,
|
|
186
|
-
.accordion-body > :last-child {
|
|
187
|
-
margin-block-end: 0 !important;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/*!
|
|
191
|
-
* Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)
|
|
192
|
-
* Copyright 2011-2021 The Bootstrap Authors
|
|
193
|
-
* Copyright 2011-2021 Twitter, Inc.
|
|
194
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
195
|
-
|
|
196
|
-
* The MIT License (MIT)
|
|
197
|
-
|
|
198
|
-
* Copyright (c) 2011-2020 Twitter, Inc.
|
|
199
|
-
* Copyright (c) 2011-2020 The Bootstrap Authors
|
|
200
|
-
|
|
201
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
202
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
203
|
-
* in the Software without restriction, including without limitation the rights
|
|
204
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
205
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
206
|
-
* furnished to do so, subject to the following conditions:
|
|
207
|
-
|
|
208
|
-
* The above copyright notice and this permission notice shall be included in
|
|
209
|
-
* all copies or substantial portions of the Software.
|
|
210
|
-
|
|
211
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
212
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
213
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
214
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
215
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
216
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
217
|
-
* THE SOFTWARE.
|
|
218
|
-
*/
|
|
219
|
-
.fade {
|
|
220
|
-
transition: opacity 200ms linear;
|
|
221
|
-
}
|
|
222
|
-
@media (prefers-reduced-motion: reduce) {
|
|
223
|
-
.fade {
|
|
224
|
-
transition: none;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
.fade:not(.show) {
|
|
228
|
-
opacity: 0;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.collapse:not(.show) {
|
|
232
|
-
display: none;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.collapsing {
|
|
236
|
-
height: 0;
|
|
237
|
-
overflow: hidden;
|
|
238
|
-
transition: height 250ms cubic-bezier(0.4, 0, 0.2, 1), padding 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
239
|
-
}
|
|
240
|
-
@media (prefers-reduced-motion: reduce) {
|
|
241
|
-
.collapsing {
|
|
242
|
-
transition: none;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
.collapsing.collapse-horizontal {
|
|
246
|
-
width: 0;
|
|
247
|
-
height: auto;
|
|
248
|
-
transition: width 0.35s ease;
|
|
249
|
-
}
|
|
250
|
-
@media (prefers-reduced-motion: reduce) {
|
|
251
|
-
.collapsing.collapse-horizontal {
|
|
252
|
-
transition: none;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
:host {
|
|
257
|
-
display: block;
|
|
258
|
-
}
|
|
259
|
-
:host .accordion-button > ::slotted(.text-truncate) {
|
|
260
|
-
display: block;
|
|
261
|
-
}
|
|
1
|
+
.accordion-item{border-block-start:2px solid #e6e6e6}.accordion-header{font-size:1.0625rem;font-weight:700;line-height:1.5;margin:0}@media(min-width: 1024px){.accordion-header{font-size:1.25rem}}.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;width:100%;position:relative;padding-block:1rem;padding-inline-start:1rem;padding-inline-end:2.5rem;text-align:start}.accordion-button:not(:disabled){cursor:pointer}.accordion-button:disabled{opacity:.4}.accordion-button:focus{outline:none;box-shadow:0 0 0 .125rem rgba(51,51,51,.25)}.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.6 7.6 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.6 7.6 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);border:1px solid rgb(var(--post-bg-rgb, 255, 255, 255))}.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:.75rem 1rem 2.5rem;border-block-start:2px solid #e6e6e6}.accordion-body h1,.accordion-body .h1{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media(min-width: 1024px){.accordion-body h1,.accordion-body .h1{font-size:1.25rem}}.accordion-body h2,.accordion-body .h2{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media(min-width: 1024px){.accordion-body h2,.accordion-body .h2{font-size:1.25rem}}.accordion-body h3,.accordion-body .h3{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media(min-width: 1024px){.accordion-body h3,.accordion-body .h3{font-size:1.25rem}}.accordion-body h4,.accordion-body .h4{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media(min-width: 1024px){.accordion-body h4,.accordion-body .h4{font-size:1.25rem}}.accordion-body h5,.accordion-body .h5{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media(min-width: 1024px){.accordion-body h5,.accordion-body .h5{font-size:1.25rem}}.accordion-body h6,.accordion-body .h6{font-size:1.0625rem;margin:2.5rem 0 0;font-weight:700}@media(min-width: 1024px){.accordion-body h6,.accordion-body .h6{font-size:1.25rem}}.accordion-button>:first-child,.accordion-body>:first-child{margin-block-start:0 !important}.accordion-button>:last-child,.accordion-body>:last-child{margin-block-end:0 !important}:host{display:block}:host .accordion-button>::slotted(.text-truncate){display:block}
|
|
@@ -1,80 +1,60 @@
|
|
|
1
|
-
import { h, Host } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../package.json";
|
|
3
|
+
import { collapse, expand } from "../../animations/collapse";
|
|
4
|
+
import { checkEmptyOrOneOf, checkEmptyOrType, isMotionReduced } from "../../utils";
|
|
5
|
+
import { HEADING_LEVELS } from "./heading-levels";
|
|
5
6
|
export class PostCollapsible {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.isLoaded = false;
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.collapsibleId = undefined;
|
|
9
|
+
this.id = undefined;
|
|
10
|
+
this.isOpen = true;
|
|
11
11
|
this.hasHeader = undefined;
|
|
12
12
|
this.headingTag = undefined;
|
|
13
|
-
this.isOpen = true;
|
|
14
|
-
this.onAccordionButtonClick = () => this.toggle();
|
|
15
13
|
this.collapsed = false;
|
|
16
14
|
this.headingLevel = 2;
|
|
17
15
|
}
|
|
18
16
|
validateCollapsed(newValue = this.collapsed) {
|
|
19
|
-
|
|
20
|
-
if (!this.isLoaded) {
|
|
21
|
-
this.isOpen = !newValue;
|
|
22
|
-
this.collapseClasses = this.getCollapseClasses();
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
this.toggle(!newValue);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
17
|
+
checkEmptyOrType(newValue, 'boolean', 'The `collapsed` property of the `post-collapsible` must be a boolean.');
|
|
29
18
|
}
|
|
30
19
|
validateHeadingLevel(newValue = this.headingLevel) {
|
|
31
|
-
|
|
32
|
-
this.headingTag = `h${newValue}`;
|
|
20
|
+
checkEmptyOrOneOf(newValue, HEADING_LEVELS, 'The `headingLevel` property of the `post-collapsible` must be a number between 1 and 6.');
|
|
33
21
|
}
|
|
34
|
-
|
|
22
|
+
connectedCallback() {
|
|
35
23
|
this.validateCollapsed();
|
|
36
24
|
this.validateHeadingLevel();
|
|
25
|
+
}
|
|
26
|
+
componentWillRender() {
|
|
27
|
+
var _a;
|
|
28
|
+
this.id = this.host.id || `c${crypto.randomUUID()}`;
|
|
37
29
|
this.hasHeader = this.host.querySelectorAll('[slot="header"]').length > 0;
|
|
38
|
-
|
|
39
|
-
console.warn('Be sure to bind the post-collapsible to its control using aria-controls and aria-expanded attributes. More information here: https://getbootstrap.com/docs/5.2/components/collapse/#accessibility');
|
|
40
|
-
}
|
|
41
|
-
this.collapsibleId = this.host.id || `post-collapsible-${nextId++}`;
|
|
42
|
-
this.collapseClasses = this.getCollapseClasses();
|
|
30
|
+
this.headingTag = `h${(_a = this.headingLevel) !== null && _a !== void 0 ? _a : 2}`;
|
|
43
31
|
}
|
|
44
32
|
componentDidLoad() {
|
|
33
|
+
if (this.collapsed)
|
|
34
|
+
void this.toggle(false);
|
|
45
35
|
this.isLoaded = true;
|
|
46
|
-
this.collapsibleElement = this.host.shadowRoot.querySelector(`#${this.collapsibleId}--collapse`);
|
|
47
36
|
}
|
|
48
37
|
/**
|
|
49
38
|
* Triggers the collapse programmatically.
|
|
39
|
+
*
|
|
40
|
+
* If there is a collapsing transition running already, it will be reversed.
|
|
50
41
|
*/
|
|
51
42
|
async toggle(open = !this.isOpen) {
|
|
52
|
-
if (open
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const expandedHeight = getElementHeight(this.collapsibleElement, 'show');
|
|
64
|
-
this.collapseHeight = `${this.isOpen ? 0 : expandedHeight}px`;
|
|
65
|
-
this.collapseClasses = 'collapsing';
|
|
66
|
-
setTimeout(() => {
|
|
67
|
-
this.collapseHeight = `${this.isOpen ? expandedHeight : 0}px`;
|
|
68
|
-
}, 50);
|
|
69
|
-
}
|
|
70
|
-
getCollapseClasses() {
|
|
71
|
-
return this.isOpen ? 'collapse show' : 'collapse';
|
|
43
|
+
if (open === this.isOpen)
|
|
44
|
+
return open;
|
|
45
|
+
this.isOpen = !this.isOpen;
|
|
46
|
+
if (this.isLoaded)
|
|
47
|
+
this.collapseChange.emit();
|
|
48
|
+
const animation = open ? expand(this.collapsible) : collapse(this.collapsible);
|
|
49
|
+
if (!this.isLoaded || isMotionReduced())
|
|
50
|
+
animation.finish();
|
|
51
|
+
await animation.finished;
|
|
52
|
+
animation.commitStyles();
|
|
53
|
+
return this.isOpen;
|
|
72
54
|
}
|
|
73
55
|
render() {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
return (h(Host, { "data-version": version }, h("div", { class: "accordion-item" }, h(this.headingTag, { class: "accordion-header", id: `${this.collapsibleId}--header` }, h("button", { class: `accordion-button ${this.isOpen ? '' : 'collapsed'}`, type: "button", "aria-expanded": `${this.isOpen}`, "aria-controls": `${this.collapsibleId}--collapse`, onClick: this.onAccordionButtonClick }, h("slot", { name: "header" }))), h("div", { id: `${this.collapsibleId}--collapse`, class: `accordion-collapse ${this.collapseClasses}`, style: { height: this.collapseHeight }, "aria-labelledby": `${this.collapsibleId}--header` }, h("div", { class: "accordion-body" }, h("slot", null))))));
|
|
56
|
+
const collapse = (h("div", { "aria-labelledby": this.hasHeader ? `${this.id}--header` : undefined, class: `collapse${this.hasHeader ? ' accordion-collapse' : ''}`, id: `${this.id}--collapse`, ref: el => this.collapsible = el }, this.hasHeader ? (h("div", { class: "accordion-body" }, h("slot", null))) : (h("slot", null))));
|
|
57
|
+
return (h(Host, { id: this.id, "data-version": version }, this.hasHeader ? (h("div", { class: "accordion-item" }, h(this.headingTag, { class: "accordion-header", id: `${this.id}--header` }, h("button", { "aria-controls": `${this.id}--collapse`, "aria-expanded": `${this.isOpen}`, class: `accordion-button${this.isOpen ? '' : ' collapsed'}`, onClick: () => this.toggle(), type: "button" }, h("slot", { name: "header" }))), collapse)) : collapse));
|
|
78
58
|
}
|
|
79
59
|
static get is() { return "post-collapsible"; }
|
|
80
60
|
static get encapsulation() { return "shadow"; }
|
|
@@ -112,9 +92,15 @@ export class PostCollapsible {
|
|
|
112
92
|
"type": "number",
|
|
113
93
|
"mutable": false,
|
|
114
94
|
"complexType": {
|
|
115
|
-
"original": "
|
|
116
|
-
"resolved": "
|
|
117
|
-
"references": {
|
|
95
|
+
"original": "HeadingLevel",
|
|
96
|
+
"resolved": "1 | 2 | 3 | 4 | 5 | 6",
|
|
97
|
+
"references": {
|
|
98
|
+
"HeadingLevel": {
|
|
99
|
+
"location": "import",
|
|
100
|
+
"path": "./heading-levels",
|
|
101
|
+
"id": "src/components/post-collapsible/heading-levels.ts::HeadingLevel"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
118
104
|
},
|
|
119
105
|
"required": false,
|
|
120
106
|
"optional": true,
|
|
@@ -130,15 +116,30 @@ export class PostCollapsible {
|
|
|
130
116
|
}
|
|
131
117
|
static get states() {
|
|
132
118
|
return {
|
|
133
|
-
"
|
|
134
|
-
"collapseHeight": {},
|
|
135
|
-
"collapsibleId": {},
|
|
136
|
-
"hasHeader": {},
|
|
137
|
-
"headingTag": {},
|
|
119
|
+
"id": {},
|
|
138
120
|
"isOpen": {},
|
|
139
|
-
"
|
|
121
|
+
"hasHeader": {},
|
|
122
|
+
"headingTag": {}
|
|
140
123
|
};
|
|
141
124
|
}
|
|
125
|
+
static get events() {
|
|
126
|
+
return [{
|
|
127
|
+
"method": "collapseChange",
|
|
128
|
+
"name": "collapseChange",
|
|
129
|
+
"bubbles": true,
|
|
130
|
+
"cancelable": true,
|
|
131
|
+
"composed": true,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [],
|
|
134
|
+
"text": "An event emitted when the collapse element is shown or hidden, before the transition. It has no payload."
|
|
135
|
+
},
|
|
136
|
+
"complexType": {
|
|
137
|
+
"original": "void",
|
|
138
|
+
"resolved": "void",
|
|
139
|
+
"references": {}
|
|
140
|
+
}
|
|
141
|
+
}];
|
|
142
|
+
}
|
|
142
143
|
static get methods() {
|
|
143
144
|
return {
|
|
144
145
|
"toggle": {
|
|
@@ -150,13 +151,14 @@ export class PostCollapsible {
|
|
|
150
151
|
}],
|
|
151
152
|
"references": {
|
|
152
153
|
"Promise": {
|
|
153
|
-
"location": "global"
|
|
154
|
+
"location": "global",
|
|
155
|
+
"id": "global::Promise"
|
|
154
156
|
}
|
|
155
157
|
},
|
|
156
158
|
"return": "Promise<boolean>"
|
|
157
159
|
},
|
|
158
160
|
"docs": {
|
|
159
|
-
"text": "Triggers the collapse programmatically.",
|
|
161
|
+
"text": "Triggers the collapse programmatically.\n\nIf there is a collapsing transition running already, it will be reversed.",
|
|
160
162
|
"tags": []
|
|
161
163
|
}
|
|
162
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-collapsible.js","sourceRoot":"","sources":["../../../../src/components/post-collapsible/post-collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"post-collapsible.js","sourceRoot":"","sources":["../../../../src/components/post-collapsible/post-collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AAOhE,MAAM,OAAO,eAAe;;IAClB,aAAQ,GAAG,KAAK,CAAC;;kBAMP,IAAI;;;qBAOiB,KAAK;wBAUG,CAAC;;EAPhD,iBAAiB,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS;IACzC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,uEAAuE,CAAC,CAAC;EACjH,CAAC;EAQD,oBAAoB,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY;IAC/C,iBAAiB,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { version } from '../../../package.json';\nimport { collapse, expand } from '../../animations/collapse';\nimport { checkEmptyOrOneOf, checkEmptyOrType, isMotionReduced } from '../../utils';\nimport { HEADING_LEVELS, HeadingLevel } from './heading-levels';\n\n@Component({\n tag: 'post-collapsible',\n styleUrl: 'post-collapsible.scss',\n shadow: true,\n})\nexport class PostCollapsible {\n private isLoaded = false;\n private collapsible: HTMLElement;\n\n @Element() host: HTMLPostCollapsibleElement;\n\n @State() id: string;\n @State() isOpen = true;\n @State() hasHeader: boolean;\n @State() headingTag: string;\n\n /**\n * If `true`, the element is initially collapsed otherwise it is displayed.\n */\n @Prop() readonly collapsed?: boolean = false;\n\n @Watch('collapsed')\n validateCollapsed(newValue = this.collapsed) {\n checkEmptyOrType(newValue, 'boolean', 'The `collapsed` property of the `post-collapsible` must be a boolean.');\n }\n\n /**\n * Defines the hierarchical level of the collapsible header within the headings structure.\n */\n @Prop() readonly headingLevel?: HeadingLevel = 2;\n\n @Watch('headingLevel')\n validateHeadingLevel(newValue = this.headingLevel) {\n checkEmptyOrOneOf(newValue, HEADING_LEVELS, 'The `headingLevel` property of the `post-collapsible` must be a number between 1 and 6.');\n }\n\n /**\n * An event emitted when the collapse element is shown or hidden, before the transition. It has no payload.\n */\n @Event() collapseChange: EventEmitter<void>;\n\n connectedCallback() {\n this.validateCollapsed();\n this.validateHeadingLevel();\n }\n\n componentWillRender() {\n this.id = this.host.id || `c${crypto.randomUUID()}`;\n this.hasHeader = this.host.querySelectorAll('[slot=\"header\"]').length > 0;\n this.headingTag = `h${this.headingLevel ?? 2}`;\n }\n\n componentDidLoad() {\n if (this.collapsed) void this.toggle(false);\n this.isLoaded = true;\n }\n\n /**\n * Triggers the collapse programmatically.\n *\n * If there is a collapsing transition running already, it will be reversed.\n */\n @Method()\n async toggle(open = !this.isOpen): Promise<boolean> {\n if (open === this.isOpen) return open;\n\n this.isOpen = !this.isOpen;\n if (this.isLoaded) this.collapseChange.emit();\n\n const animation = open ? expand(this.collapsible): collapse(this.collapsible);\n\n if (!this.isLoaded || isMotionReduced()) animation.finish();\n\n await animation.finished;\n\n animation.commitStyles();\n\n return this.isOpen;\n }\n\n render() {\n const collapse = (\n <div\n aria-labelledby={this.hasHeader ? `${this.id}--header` : undefined}\n class={`collapse${this.hasHeader ? ' accordion-collapse' : ''}`}\n id={`${this.id}--collapse`}\n ref={el => this.collapsible = el}\n >\n {this.hasHeader ? (\n <div class=\"accordion-body\">\n <slot/>\n </div>\n ) : (\n <slot/>\n )}\n </div>\n );\n\n return (\n <Host id={this.id} data-version={version}>\n {this.hasHeader ? (\n <div class=\"accordion-item\">\n <this.headingTag class=\"accordion-header\" id={`${this.id}--header`}>\n <button\n aria-controls={`${this.id}--collapse`}\n aria-expanded={`${this.isOpen}`}\n class={`accordion-button${this.isOpen ? '' : ' collapsed'}`}\n onClick={() => this.toggle()}\n type=\"button\"\n >\n <slot name=\"header\"/>\n </button>\n </this.headingTag>\n\n {collapse}\n </div>\n ) : collapse}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,102 +1 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: inline-block;
|
|
3
|
-
width: 1em;
|
|
4
|
-
vertical-align: -0.15em;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
svg {
|
|
8
|
-
display: block;
|
|
9
|
-
width: 100%;
|
|
10
|
-
height: 100%;
|
|
11
|
-
fill: currentColor;
|
|
12
|
-
background-color: currentColor;
|
|
13
|
-
-webkit-mask-position: center center;
|
|
14
|
-
mask-position: center center;
|
|
15
|
-
-webkit-mask-repeat: no-repeat;
|
|
16
|
-
mask-repeat: no-repeat;
|
|
17
|
-
-webkit-mask-size: 100%;
|
|
18
|
-
mask-size: 100%;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:host([flip-h]:not([flip-h=false])) {
|
|
22
|
-
scale: -1 1;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
:host([flip-v]:not([flip-v=false])) {
|
|
26
|
-
scale: 1 -1;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:host([flip-h][flip-v]:not([flip-h=false], [flip-v=false])) {
|
|
30
|
-
scale: -1;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:host([animation]) {
|
|
34
|
-
transform-origin: center;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host([animation=cylon]) {
|
|
38
|
-
animation: icon-animation-cylon 0.75s ease-in-out infinite alternate;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:host([animation=cylon-vertical]) {
|
|
42
|
-
animation: icon-animation-cylon-vertical 0.75s ease-in-out infinite alternate;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host([animation=spin]) {
|
|
46
|
-
animation: icon-animation-spin 2s linear infinite normal;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host([animation=spin-reverse]) {
|
|
50
|
-
animation: icon-animation-spin 2s linear infinite reverse;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:host([animation=fade]) {
|
|
54
|
-
animation: icon-animation-fade 0.75s ease-in-out infinite alternate;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
:host([animation=throb]) {
|
|
58
|
-
animation: icon-animation-throb 0.75s ease-in-out infinite alternate;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@keyframes icon-animation-cylon {
|
|
62
|
-
from {
|
|
63
|
-
transform: translateX(-25%);
|
|
64
|
-
}
|
|
65
|
-
to {
|
|
66
|
-
transform: translateX(25%);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
@keyframes icon-animation-cylon-vertical {
|
|
70
|
-
from {
|
|
71
|
-
transform: translateY(25%);
|
|
72
|
-
}
|
|
73
|
-
to {
|
|
74
|
-
transform: translateY(-25%);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
@keyframes icon-animation-fade {
|
|
78
|
-
from {
|
|
79
|
-
opacity: 0.1;
|
|
80
|
-
}
|
|
81
|
-
to {
|
|
82
|
-
opacity: 1;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
@keyframes icon-animation-spin {
|
|
86
|
-
from {
|
|
87
|
-
transform: rotate(0deg);
|
|
88
|
-
}
|
|
89
|
-
to {
|
|
90
|
-
transform: rotate(359deg);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
@keyframes icon-animation-throb {
|
|
94
|
-
from {
|
|
95
|
-
opacity: 0.5;
|
|
96
|
-
transform: scale(0.5);
|
|
97
|
-
}
|
|
98
|
-
to {
|
|
99
|
-
opacity: 1;
|
|
100
|
-
transform: scale(1);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
1
|
+
:host{display:inline-block;width:1em;vertical-align:-0.15em}svg{display:block;width:100%;height:100%;fill:currentColor;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}
|