@swisspost/design-system-components 9.0.0-next.19 → 9.0.0-next.21
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-bd99d236.js +15 -0
- package/dist/cjs/check-one-of-75d270b5.js +13 -0
- package/dist/cjs/check-type-cdbf6d29.js +21 -0
- package/dist/cjs/check-url-220a286c.js +19 -0
- package/dist/cjs/{index-d4222dcb.js → index-23e36ff7.js} +12 -6
- package/dist/cjs/index.cjs.js +25 -25
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-1403e51d.js → package-c6bc9e82.js} +1 -1
- package/dist/cjs/{post-accordion-e84c9d23.js → post-accordion-d1345784.js} +4 -4
- package/dist/cjs/{post-accordion-item-d1ef00c3.js → post-accordion-item-a796d803.js} +6 -6
- package/dist/cjs/post-accordion-item.cjs.entry.js +6 -6
- package/dist/cjs/post-accordion.cjs.entry.js +3 -3
- package/dist/cjs/{post-avatar-7a8860df.js → post-avatar-b4e96354.js} +3 -3
- package/dist/cjs/post-avatar.cjs.entry.js +3 -3
- package/dist/cjs/{post-back-to-top-6c7057f9.js → post-back-to-top-fc541c6b.js} +12 -12
- package/dist/cjs/post-back-to-top.cjs.entry.js +4 -4
- package/dist/cjs/{post-banner-ecc46714.js → post-banner-46522b4f.js} +15 -15
- package/dist/cjs/post-banner.cjs.entry.js +7 -7
- package/dist/cjs/{post-breadcrumb-dbb85db9.js → post-breadcrumb-799d34da.js} +7 -7
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +6 -6
- package/dist/cjs/post-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/{post-card-control-76f6a5b3.js → post-card-control-7bf7d3f2.js} +9 -9
- package/dist/cjs/post-card-control.cjs.entry.js +4 -4
- package/dist/cjs/post-closebutton_15.cjs.entry.js +7 -7
- package/dist/cjs/{post-collapsible-trigger-8b242323.js → post-collapsible-trigger-0568e3ec.js} +8 -8
- package/dist/cjs/post-collapsible_2.cjs.entry.js +7 -7
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/{post-footer-eeec84e0.js → post-footer-f87a556b.js} +19 -18
- package/dist/cjs/post-footer.cjs.entry.js +2 -2
- package/dist/cjs/{post-linkarea-61dbfe5d.js → post-linkarea-0ccf93fc.js} +1 -1
- package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
- package/dist/cjs/{post-menu-item-12639f7c.js → post-menu-item-eba24c40.js} +7 -8
- package/dist/cjs/{post-popover-9569b144.js → post-popover-35f679f6.js} +1 -1
- package/dist/cjs/post-popover.cjs.entry.js +2 -2
- package/dist/cjs/{post-rating-5645cae4.js → post-rating-d12fa214.js} +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-header-82e8ccd0.js → post-tab-header-89dca04b.js} +5 -5
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-panel-ef3df53e.js → post-tab-panel-ad1ab180.js} +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-8f1e74d9.js → post-tabs-0db75745.js} +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tag-c353e30c.js → post-tag-396a46c9.js} +1 -1
- package/dist/cjs/post-tag.cjs.entry.js +2 -2
- package/dist/cjs/{post-togglebutton-8949d278.js → post-togglebutton-69983699.js} +55 -57
- package/dist/cjs/{post-tooltip-cf18ac29.js → post-tooltip-7174ea97.js} +4 -4
- package/dist/cjs/post-tooltip.cjs.entry.js +6 -6
- package/dist/collection/components/post-accordion/post-accordion.js +2 -2
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +4 -4
- package/dist/collection/components/post-avatar/post-avatar.js +1 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +10 -10
- package/dist/collection/components/post-banner/post-banner.js +11 -11
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +5 -5
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +10 -6
- package/dist/collection/components/post-card-control/post-card-control.js +6 -6
- package/dist/collection/components/post-collapsible/post-collapsible.js +2 -2
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +2 -2
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-icon/post-icon.js +15 -15
- package/dist/collection/components/post-language-option/post-language-option.css +1 -1
- package/dist/collection/components/post-language-option/post-language-option.js +9 -9
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +6 -6
- package/dist/collection/components/post-logo/post-logo.js +2 -2
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +5 -7
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +3 -3
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
- package/dist/collection/components/post-tab-header/post-tab-header.js +3 -3
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +3 -3
- package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
- package/dist/collection/utils/breakpoints.js +18 -17
- package/dist/collection/utils/property-checkers/check-non-empty.js +6 -2
- package/dist/collection/utils/property-checkers/check-one-of.js +6 -2
- package/dist/collection/utils/property-checkers/check-pattern.js +6 -2
- package/dist/collection/utils/property-checkers/check-type.js +8 -3
- package/dist/collection/utils/property-checkers/check-url.js +7 -3
- package/dist/collection/utils/property-checkers/empty-or.js +3 -1
- package/dist/components/check-non-empty.js +6 -2
- package/dist/components/check-one-of.js +6 -2
- package/dist/components/check-type.js +8 -3
- package/dist/components/index2.js +16 -6
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +4 -4
- package/dist/components/post-accordion2.js +2 -2
- package/dist/components/post-avatar2.js +1 -1
- package/dist/components/post-back-to-top2.js +9 -9
- package/dist/components/post-banner2.js +11 -11
- package/dist/components/post-breadcrumb-item2.js +7 -7
- package/dist/components/post-breadcrumb2.js +5 -5
- package/dist/components/post-card-control2.js +6 -6
- package/dist/components/post-collapsible-trigger2.js +2 -2
- package/dist/components/post-collapsible2.js +2 -2
- package/dist/components/post-footer2.js +18 -17
- package/dist/components/post-header2.js +1 -1
- package/dist/components/post-icon2.js +15 -15
- package/dist/components/post-language-option2.js +10 -10
- package/dist/components/post-language-switch2.js +7 -7
- package/dist/components/post-logo2.js +2 -2
- package/dist/components/post-mainnavigation2.js +1 -1
- package/dist/components/post-megadropdown-trigger2.js +3 -3
- package/dist/components/post-megadropdown2.js +6 -8
- package/dist/components/post-menu-trigger2.js +3 -3
- package/dist/components/post-tab-header2.js +3 -3
- package/dist/components/post-togglebutton2.js +3 -3
- package/dist/components/post-tooltip2.js +2 -2
- package/dist/docs.json +1 -1
- package/dist/esm/check-non-empty-258a56b3.js +13 -0
- package/dist/esm/check-one-of-0bee20f5.js +11 -0
- package/dist/esm/check-type-37d5d307.js +19 -0
- package/dist/esm/check-url-17962bc8.js +17 -0
- package/dist/esm/index-8f8fe5b0.js +32 -0
- package/dist/esm/index.js +25 -25
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-5614c98b.js +3 -0
- package/dist/esm/{post-accordion-db14e23a.js → post-accordion-f6d1834d.js} +4 -4
- package/dist/esm/{post-accordion-item-c1f42c05.js → post-accordion-item-7cb93300.js} +6 -6
- package/dist/esm/post-accordion-item.entry.js +6 -6
- package/dist/esm/post-accordion.entry.js +3 -3
- package/dist/esm/{post-avatar-ccda94eb.js → post-avatar-96108967.js} +3 -3
- package/dist/esm/post-avatar.entry.js +3 -3
- package/dist/esm/{post-back-to-top-f038d599.js → post-back-to-top-7f8a61c8.js} +12 -12
- package/dist/esm/post-back-to-top.entry.js +4 -4
- package/dist/esm/{post-banner-a24ccf11.js → post-banner-bb69bce8.js} +15 -15
- package/dist/esm/post-banner.entry.js +7 -7
- package/dist/esm/{post-breadcrumb-e3e4b50c.js → post-breadcrumb-9d9efa4e.js} +7 -7
- package/dist/esm/post-breadcrumb-item_2.entry.js +6 -6
- package/dist/esm/post-breadcrumb.entry.js +3 -3
- package/dist/esm/{post-card-control-0a4497d8.js → post-card-control-fdced7d5.js} +9 -9
- package/dist/esm/post-card-control.entry.js +4 -4
- package/dist/esm/post-closebutton_15.entry.js +7 -7
- package/dist/esm/{post-collapsible-trigger-6b0253d8.js → post-collapsible-trigger-17b2f067.js} +8 -8
- package/dist/esm/post-collapsible_2.entry.js +7 -7
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/{post-footer-fa4a2a32.js → post-footer-2dcd8159.js} +19 -18
- package/dist/esm/post-footer.entry.js +2 -2
- package/dist/esm/{post-linkarea-1458faa8.js → post-linkarea-06c5144d.js} +1 -1
- package/dist/esm/post-linkarea.entry.js +2 -2
- package/dist/esm/{post-menu-item-b9af8b46.js → post-menu-item-e917bf99.js} +7 -8
- package/dist/esm/{post-popover-425eb5c9.js → post-popover-67a3cbf2.js} +1 -1
- package/dist/esm/post-popover.entry.js +2 -2
- package/dist/esm/{post-rating-4057a5b5.js → post-rating-9613bee8.js} +1 -1
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/{post-tab-header-602eb0cb.js → post-tab-header-dff3a025.js} +5 -5
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/{post-tab-panel-fccea5b6.js → post-tab-panel-2b3f82a8.js} +1 -1
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-b9f41051.js → post-tabs-46d1165f.js} +1 -1
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tag-54b70906.js → post-tag-4176268e.js} +1 -1
- package/dist/esm/post-tag.entry.js +2 -2
- package/dist/esm/{post-togglebutton-f6746062.js → post-togglebutton-5892c5bd.js} +55 -57
- package/dist/esm/{post-tooltip-eccf3d93.js → post-tooltip-5a45a569.js} +4 -4
- package/dist/esm/post-tooltip.entry.js +6 -6
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-017dc6c7.js +1 -0
- package/dist/post-components/p-0227b899.js +1 -0
- package/dist/post-components/p-04895a54.js +1 -0
- package/dist/post-components/p-04c38bfe.entry.js +1 -0
- package/dist/post-components/{p-202156ad.js → p-07a0a626.js} +1 -1
- package/dist/post-components/p-12573893.js +1 -0
- package/dist/post-components/p-1289b0a7.entry.js +1 -0
- package/dist/post-components/p-12a11565.js +1 -0
- package/dist/post-components/p-1542a80e.entry.js +1 -0
- package/dist/post-components/p-181c73d5.js +1 -0
- package/dist/post-components/p-254a9bd2.entry.js +1 -0
- package/dist/post-components/p-28500934.entry.js +1 -0
- package/dist/post-components/{p-114bb8ba.js → p-2b1281af.js} +1 -1
- package/dist/post-components/p-2c69e7f2.entry.js +1 -0
- package/dist/post-components/p-30132b19.entry.js +1 -0
- package/dist/post-components/{p-d2d2681a.js → p-30af1d48.js} +1 -1
- package/dist/post-components/p-3bdeb686.entry.js +1 -0
- package/dist/post-components/{p-509fc6e6.js → p-47cb31dd.js} +1 -1
- package/dist/post-components/p-4f41f63e.js +1 -0
- package/dist/post-components/p-52790b8b.js +1 -0
- package/dist/post-components/{p-541c7be9.js → p-59ca0a13.js} +3 -3
- package/dist/post-components/p-5aaa5703.entry.js +1 -0
- package/dist/post-components/p-67a45f16.js +1 -0
- package/dist/post-components/p-6d8ac9bd.entry.js +1 -0
- package/dist/post-components/p-7709c14a.js +1 -0
- package/dist/post-components/p-77cc2a5e.entry.js +1 -0
- package/dist/post-components/p-79c552fb.js +1 -0
- package/dist/post-components/p-7dd05e6d.entry.js +1 -0
- package/dist/post-components/p-803b7598.js +1 -0
- package/dist/post-components/p-85fdc2d3.js +1 -0
- package/dist/post-components/p-98fcf90b.entry.js +1 -0
- package/dist/post-components/p-994fae4c.entry.js +1 -0
- package/dist/post-components/p-a805515a.entry.js +1 -0
- package/dist/post-components/p-b5b48f66.entry.js +1 -0
- package/dist/post-components/{p-5b1c57d5.js → p-b9bf5a5f.js} +1 -1
- package/dist/post-components/{p-b27b7d03.js → p-c6b3a926.js} +1 -1
- package/dist/post-components/p-c9dd3cdb.entry.js +1 -0
- package/dist/post-components/p-cb5e4a06.js +1 -0
- package/dist/post-components/p-d45df336.js +1 -0
- package/dist/post-components/{p-7bf39758.entry.js → p-dd4a5c0a.entry.js} +1 -1
- package/dist/post-components/p-e585c6fe.js +1 -0
- package/dist/post-components/p-e6d54838.entry.js +1 -0
- package/dist/post-components/p-f4b0cc7d.js +1 -0
- package/dist/post-components/p-fe8c300c.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +1 -1
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +1 -1
- package/dist/types/components/post-banner/post-banner.d.ts +4 -4
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +4 -0
- package/dist/types/components/post-card-control/post-card-control.d.ts +2 -2
- package/dist/types/components/post-icon/post-icon.d.ts +6 -6
- package/dist/types/components/post-language-option/post-language-option.d.ts +4 -4
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +3 -3
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +1 -1
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +1 -1
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +1 -1
- package/dist/types/utils/breakpoints.d.ts +1 -0
- package/dist/types/utils/property-checkers/check-non-empty.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-one-of.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-type.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-url.d.ts +3 -1
- package/dist/types/utils/property-checkers/index.d.ts +12 -4
- package/loaders/check-non-empty.js +6 -2
- package/loaders/check-one-of.js +6 -2
- package/loaders/check-type.js +8 -3
- package/loaders/index2.js +16 -6
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +4 -4
- package/loaders/post-accordion.js +2 -2
- package/loaders/post-avatar.js +1 -1
- package/loaders/post-back-to-top.js +9 -9
- package/loaders/post-banner.js +11 -11
- package/loaders/post-breadcrumb-item2.js +7 -7
- package/loaders/post-breadcrumb.js +5 -5
- package/loaders/post-card-control.js +6 -6
- package/loaders/post-collapsible-trigger2.js +2 -2
- package/loaders/post-collapsible2.js +2 -2
- package/loaders/post-footer.js +18 -17
- package/loaders/post-header.js +1 -1
- package/loaders/post-icon2.js +15 -15
- package/loaders/post-language-option.js +10 -10
- package/loaders/post-language-switch.js +7 -7
- package/loaders/post-logo.js +2 -2
- package/loaders/post-mainnavigation.js +1 -1
- package/loaders/post-megadropdown-trigger.js +3 -3
- package/loaders/post-megadropdown.js +6 -8
- package/loaders/post-menu-trigger2.js +3 -3
- package/loaders/post-tab-header.js +3 -3
- package/loaders/post-togglebutton.js +3 -3
- package/loaders/post-tooltip.js +2 -2
- package/package.json +3 -3
- package/dist/cjs/check-non-empty-eeaa8f77.js +0 -11
- package/dist/cjs/check-one-of-ef931478.js +0 -9
- package/dist/cjs/check-type-696d2c51.js +0 -16
- package/dist/cjs/check-url-4c524d85.js +0 -15
- package/dist/esm/check-non-empty-58bd6b17.js +0 -9
- package/dist/esm/check-one-of-0d5858c0.js +0 -7
- package/dist/esm/check-type-a6ccc9a3.js +0 -14
- package/dist/esm/check-url-f84034b1.js +0 -13
- package/dist/esm/index-1b263a63.js +0 -26
- package/dist/esm/package-21cb9eb8.js +0 -3
- package/dist/post-components/p-0337eb03.entry.js +0 -1
- package/dist/post-components/p-0470d5af.entry.js +0 -1
- package/dist/post-components/p-07b75b18.entry.js +0 -1
- package/dist/post-components/p-0d879e8b.js +0 -1
- package/dist/post-components/p-0f6fee8f.js +0 -1
- package/dist/post-components/p-18fa847f.js +0 -1
- package/dist/post-components/p-1c1a614d.js +0 -1
- package/dist/post-components/p-2f5425e2.entry.js +0 -1
- package/dist/post-components/p-39586235.js +0 -1
- package/dist/post-components/p-3b1c2b8a.entry.js +0 -1
- package/dist/post-components/p-46accc5f.js +0 -1
- package/dist/post-components/p-470c7464.js +0 -1
- package/dist/post-components/p-54c98790.js +0 -1
- package/dist/post-components/p-5afa25c7.entry.js +0 -1
- package/dist/post-components/p-5cf79fe3.entry.js +0 -1
- package/dist/post-components/p-5d9c1fc3.entry.js +0 -1
- package/dist/post-components/p-608ba689.entry.js +0 -1
- package/dist/post-components/p-64776810.entry.js +0 -1
- package/dist/post-components/p-6651164c.js +0 -1
- package/dist/post-components/p-7085e0e7.entry.js +0 -1
- package/dist/post-components/p-7dc1ccf0.entry.js +0 -1
- package/dist/post-components/p-81eac2e5.entry.js +0 -1
- package/dist/post-components/p-8562c7dc.js +0 -1
- package/dist/post-components/p-8a31b2fc.entry.js +0 -1
- package/dist/post-components/p-8e7e9942.entry.js +0 -1
- package/dist/post-components/p-a24bf798.js +0 -1
- package/dist/post-components/p-a621090d.js +0 -1
- package/dist/post-components/p-a926c755.js +0 -1
- package/dist/post-components/p-b095519d.js +0 -1
- package/dist/post-components/p-b8100b63.js +0 -1
- package/dist/post-components/p-bacd3e2c.js +0 -1
- package/dist/post-components/p-c48553bd.entry.js +0 -1
- package/dist/post-components/p-cb472e20.js +0 -1
- package/dist/post-components/p-cea81e00.entry.js +0 -1
- package/dist/post-components/p-d8b179fb.js +0 -1
- package/dist/post-components/p-f405f29e.entry.js +0 -1
|
@@ -21,8 +21,8 @@ export class PostMegadropdownTrigger {
|
|
|
21
21
|
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
22
22
|
* @param forValue - The new value of the `for` property.
|
|
23
23
|
*/
|
|
24
|
-
validateControlFor(
|
|
25
|
-
checkType(
|
|
24
|
+
validateControlFor() {
|
|
25
|
+
checkType(this, 'for', 'string');
|
|
26
26
|
}
|
|
27
27
|
get megadropdown() {
|
|
28
28
|
const ref = document.getElementById(this.for);
|
|
@@ -78,7 +78,7 @@ export class PostMegadropdownTrigger {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: '99849b6b851d061c1365eb5d507cba0e7e6e3ae6', "data-version": version, "tab-index": "-1" }, h("button", { key: 'ddd553c4b893538155263e5bd82c763be68eb3f3' }, h("slot", { key: 'eb006c5b13c69a8e089702f1b46f88bc3d74b045' }))));
|
|
82
82
|
}
|
|
83
83
|
static get is() { return "post-megadropdown-trigger"; }
|
|
84
84
|
static get originalStyleUrls() {
|
|
@@ -17,8 +17,8 @@ export class PostMenuTrigger {
|
|
|
17
17
|
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
18
18
|
* @param forValue - The new value of the `for` property.
|
|
19
19
|
*/
|
|
20
|
-
validateControlFor(
|
|
21
|
-
checkType(
|
|
20
|
+
validateControlFor() {
|
|
21
|
+
checkType(this, 'for', 'string');
|
|
22
22
|
}
|
|
23
23
|
get menu() {
|
|
24
24
|
const ref = this.root.getElementById(this.for);
|
|
@@ -73,7 +73,7 @@ export class PostMenuTrigger {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
render() {
|
|
76
|
-
return (h(Host, { key: '
|
|
76
|
+
return (h(Host, { key: '84316d4a69c4231be636e5ff8971752d5af9bab2', "data-version": version, "tab-index": "-1" }, h("slot", { key: 'd3091adcf7033c4dd25e49fa383ccb9773b2d226' })));
|
|
77
77
|
}
|
|
78
78
|
static get is() { return "post-menu-trigger"; }
|
|
79
79
|
static get originalStyleUrls() {
|
|
@@ -11,14 +11,14 @@ export class PostTabHeader {
|
|
|
11
11
|
this.panel = undefined;
|
|
12
12
|
}
|
|
13
13
|
host;
|
|
14
|
-
validateFor(
|
|
15
|
-
checkNonEmpty(
|
|
14
|
+
validateFor() {
|
|
15
|
+
checkNonEmpty(this, 'panel');
|
|
16
16
|
}
|
|
17
17
|
componentWillLoad() {
|
|
18
18
|
this.tabId = `tab-${this.host.id || nanoid(6)}`;
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: '336824660de90bf5c570e9739947927a32612fbd', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '8bfe0b57fa96044692e2db3fd983ccde427558e7' })));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "post-tab-header"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
|
@@ -9,8 +9,8 @@ export class PostTogglebutton {
|
|
|
9
9
|
this.toggled = false;
|
|
10
10
|
}
|
|
11
11
|
host;
|
|
12
|
-
validateToggled(
|
|
13
|
-
checkType(
|
|
12
|
+
validateToggled() {
|
|
13
|
+
checkType(this, 'toggled', 'boolean');
|
|
14
14
|
}
|
|
15
15
|
componentWillLoad() {
|
|
16
16
|
this.validateToggled();
|
|
@@ -29,7 +29,7 @@ export class PostTogglebutton {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: '3a1429a9b67b8cfafae184fe0d060ee3a04974e0', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '9ab1537574423740fc335fde732c699698acac25' })));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "post-togglebutton"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -102,7 +102,7 @@ export class PostTooltip {
|
|
|
102
102
|
wasOpenedByFocus = false;
|
|
103
103
|
host;
|
|
104
104
|
validateDelayed() {
|
|
105
|
-
checkEmptyOrType(this
|
|
105
|
+
checkEmptyOrType(this, 'delayed', 'boolean');
|
|
106
106
|
}
|
|
107
107
|
connectedCallback() {
|
|
108
108
|
this.validateDelayed();
|
|
@@ -216,7 +216,7 @@ export class PostTooltip {
|
|
|
216
216
|
}
|
|
217
217
|
render() {
|
|
218
218
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
219
|
-
return (h(Host, { key: '
|
|
219
|
+
return (h(Host, { key: '89b0e64fd5fde4c21d9c1eb624facff38b287e4a', "data-version": version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '8006874c12a2eebe39682a09db677e8b315dd6bb', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: 'cf3bd12703885fe886f1703038437b59a4d79fd3' }))));
|
|
220
220
|
}
|
|
221
221
|
static get is() { return "post-tooltip"; }
|
|
222
222
|
static get encapsulation() { return "shadow"; }
|
|
@@ -6,36 +6,37 @@ export class Breakpoint {
|
|
|
6
6
|
};
|
|
7
7
|
constructor() {
|
|
8
8
|
if (!this.breakpointMap) {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
this.breakpointMap =
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
key: keys[i],
|
|
19
|
-
name: names[i],
|
|
20
|
-
};
|
|
21
|
-
})
|
|
9
|
+
const keys = this.getStyles('--post-breakpoint-keys');
|
|
10
|
+
const names = this.getStyles('--post-breakpoint-names');
|
|
11
|
+
const widths = this.getStyles('--post-breakpoint-widths');
|
|
12
|
+
this.breakpointMap = widths
|
|
13
|
+
.map((width, i) => ({
|
|
14
|
+
minWidth: Number(width),
|
|
15
|
+
key: keys[i],
|
|
16
|
+
name: names[i],
|
|
17
|
+
}))
|
|
22
18
|
.reverse();
|
|
23
19
|
window.addEventListener('resize', () => this.updateHandler(), { passive: true });
|
|
24
20
|
}
|
|
25
21
|
}
|
|
22
|
+
getStyles(propertyName) {
|
|
23
|
+
const styles = getComputedStyle(document.documentElement);
|
|
24
|
+
return (styles
|
|
25
|
+
.getPropertyValue(propertyName)
|
|
26
|
+
?.split(',')
|
|
27
|
+
.map(w => w.trim()) ?? []);
|
|
28
|
+
}
|
|
26
29
|
updateHandler(emitEvents = true) {
|
|
27
30
|
const calculated = this.breakpointMap.find(({ minWidth }) => innerWidth >= minWidth);
|
|
28
31
|
if (this.current.key !== calculated.key) {
|
|
29
32
|
this.current.key = calculated.key;
|
|
30
|
-
if (emitEvents)
|
|
33
|
+
if (emitEvents)
|
|
31
34
|
this.dispatchEvent('key');
|
|
32
|
-
}
|
|
33
35
|
}
|
|
34
36
|
if (this.current.name !== calculated.name) {
|
|
35
37
|
this.current.name = calculated.name;
|
|
36
|
-
if (emitEvents)
|
|
38
|
+
if (emitEvents)
|
|
37
39
|
this.dispatchEvent('name');
|
|
38
|
-
}
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
dispatchEvent(type) {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EMPTY_VALUES } from "./constants";
|
|
2
|
-
export function checkNonEmpty(
|
|
2
|
+
export function checkNonEmpty(component, prop, customMessage) {
|
|
3
|
+
const componentName = component.host.localName;
|
|
4
|
+
const value = component[prop];
|
|
5
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
|
|
6
|
+
const message = customMessage || defaultMessage;
|
|
3
7
|
if (EMPTY_VALUES.some(v => v === value)) {
|
|
4
|
-
throw new Error(
|
|
8
|
+
throw new Error(message);
|
|
5
9
|
}
|
|
6
10
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export function checkOneOf(
|
|
1
|
+
export function checkOneOf(component, prop, possibleValues, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
4
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
|
|
5
|
+
const message = customMessage || defaultMessage;
|
|
2
6
|
if (!possibleValues.includes(value)) {
|
|
3
|
-
throw new Error(
|
|
7
|
+
throw new Error(message);
|
|
4
8
|
}
|
|
5
9
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export function checkPattern(
|
|
1
|
+
export function checkPattern(component, prop, pattern, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
4
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be follow the format \`${pattern}\`.`;
|
|
5
|
+
const message = customMessage || defaultMessage;
|
|
2
6
|
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
3
|
-
throw new Error(
|
|
7
|
+
throw new Error(message);
|
|
4
8
|
}
|
|
5
9
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
export function checkType(
|
|
1
|
+
export function checkType(component, prop, type, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
2
4
|
const typeIsArray = type === 'array';
|
|
3
5
|
const valueIsArray = Array.isArray(value);
|
|
6
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`
|
|
7
|
+
${type}\`.`;
|
|
8
|
+
const message = customMessage || defaultMessage;
|
|
4
9
|
if (typeIsArray || valueIsArray) {
|
|
5
10
|
if (valueIsArray !== typeIsArray) {
|
|
6
|
-
throw new Error(
|
|
11
|
+
throw new Error(message);
|
|
7
12
|
}
|
|
8
13
|
}
|
|
9
14
|
else if (typeof value !== type) {
|
|
10
|
-
throw new Error(
|
|
15
|
+
throw new Error(message);
|
|
11
16
|
}
|
|
12
17
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
export function checkUrl(
|
|
1
|
+
export function checkUrl(component, prop, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
4
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
|
|
5
|
+
const message = customMessage || defaultMessage;
|
|
2
6
|
if (typeof value !== 'string' && !(value instanceof URL)) {
|
|
3
|
-
throw new Error(
|
|
7
|
+
throw new Error(message);
|
|
4
8
|
}
|
|
5
9
|
try {
|
|
6
10
|
new URL(value, 'https://www.post.ch');
|
|
7
11
|
}
|
|
8
12
|
catch {
|
|
9
|
-
throw new Error(
|
|
13
|
+
throw new Error(message);
|
|
10
14
|
}
|
|
11
15
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { EMPTY_VALUES } from "./constants";
|
|
2
2
|
export function emptyOr(check) {
|
|
3
3
|
return (...args) => {
|
|
4
|
-
const
|
|
4
|
+
const component = args[0];
|
|
5
|
+
const prop = args[1];
|
|
6
|
+
const value = component[prop];
|
|
5
7
|
if (!EMPTY_VALUES.some(v => v === value)) {
|
|
6
8
|
check(...args);
|
|
7
9
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { E as EMPTY_VALUES } from './constants.js';
|
|
2
2
|
|
|
3
|
-
function checkNonEmpty(
|
|
3
|
+
function checkNonEmpty(component, prop, customMessage) {
|
|
4
|
+
const componentName = component.host.localName;
|
|
5
|
+
const value = component[prop];
|
|
6
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
|
|
7
|
+
const message = customMessage || defaultMessage;
|
|
4
8
|
if (EMPTY_VALUES.some(v => v === value)) {
|
|
5
|
-
throw new Error(
|
|
9
|
+
throw new Error(message);
|
|
6
10
|
}
|
|
7
11
|
}
|
|
8
12
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
function checkOneOf(
|
|
1
|
+
function checkOneOf(component, prop, possibleValues, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
4
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
|
|
5
|
+
const message = customMessage || defaultMessage;
|
|
2
6
|
if (!possibleValues.includes(value)) {
|
|
3
|
-
throw new Error(
|
|
7
|
+
throw new Error(message);
|
|
4
8
|
}
|
|
5
9
|
}
|
|
6
10
|
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
function checkType(
|
|
1
|
+
function checkType(component, prop, type, customMessage) {
|
|
2
|
+
const componentName = component.host.localName;
|
|
3
|
+
const value = component[prop];
|
|
2
4
|
const typeIsArray = type === 'array';
|
|
3
5
|
const valueIsArray = Array.isArray(value);
|
|
6
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`
|
|
7
|
+
${type}\`.`;
|
|
8
|
+
const message = customMessage || defaultMessage;
|
|
4
9
|
if (typeIsArray || valueIsArray) {
|
|
5
10
|
if (valueIsArray !== typeIsArray) {
|
|
6
|
-
throw new Error(
|
|
11
|
+
throw new Error(message);
|
|
7
12
|
}
|
|
8
13
|
}
|
|
9
14
|
else if (typeof value !== type) {
|
|
10
|
-
throw new Error(
|
|
15
|
+
throw new Error(message);
|
|
11
16
|
}
|
|
12
17
|
}
|
|
13
18
|
|
|
@@ -4,28 +4,38 @@ import { c as checkType } from './check-type.js';
|
|
|
4
4
|
|
|
5
5
|
function emptyOr(check) {
|
|
6
6
|
return (...args) => {
|
|
7
|
-
const
|
|
7
|
+
const component = args[0];
|
|
8
|
+
const prop = args[1];
|
|
9
|
+
const value = component[prop];
|
|
8
10
|
if (!EMPTY_VALUES.some(v => v === value)) {
|
|
9
11
|
check(...args);
|
|
10
12
|
}
|
|
11
13
|
};
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
function checkPattern(
|
|
16
|
+
function checkPattern(component, prop, pattern, customMessage) {
|
|
17
|
+
const componentName = component.host.localName;
|
|
18
|
+
const value = component[prop];
|
|
19
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be follow the format \`${pattern}\`.`;
|
|
20
|
+
const message = customMessage || defaultMessage;
|
|
15
21
|
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
16
|
-
throw new Error(
|
|
22
|
+
throw new Error(message);
|
|
17
23
|
}
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
function checkUrl(
|
|
26
|
+
function checkUrl(component, prop, customMessage) {
|
|
27
|
+
const componentName = component.host.localName;
|
|
28
|
+
const value = component[prop];
|
|
29
|
+
const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
|
|
30
|
+
const message = customMessage || defaultMessage;
|
|
21
31
|
if (typeof value !== 'string' && !(value instanceof URL)) {
|
|
22
|
-
throw new Error(
|
|
32
|
+
throw new Error(message);
|
|
23
33
|
}
|
|
24
34
|
try {
|
|
25
35
|
new URL(value, 'https://www.post.ch');
|
|
26
36
|
}
|
|
27
37
|
catch {
|
|
28
|
-
throw new Error(
|
|
38
|
+
throw new Error(message);
|
|
29
39
|
}
|
|
30
40
|
}
|
|
31
41
|
|
|
@@ -22,8 +22,8 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
22
22
|
}
|
|
23
23
|
collapsible;
|
|
24
24
|
get host() { return this; }
|
|
25
|
-
validateHeadingLevel(
|
|
26
|
-
checkEmptyOrOneOf(
|
|
25
|
+
validateHeadingLevel() {
|
|
26
|
+
checkEmptyOrOneOf(this, 'headingLevel', HEADING_LEVELS, 'The `heading-level` property of the `post-accordion-item` must be a number between 1 and 6.');
|
|
27
27
|
}
|
|
28
28
|
componentWillLoad() {
|
|
29
29
|
this.id = this.host.id || `p${nanoid(6)}`;
|
|
@@ -53,10 +53,10 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
53
53
|
render() {
|
|
54
54
|
const headingLevel = this.host.closest('post-accordion')?.getAttribute('heading-level');
|
|
55
55
|
const HeadingTag = `h${headingLevel ?? this.headingLevel ?? 2}`;
|
|
56
|
-
return (h(Host, { key: '
|
|
56
|
+
return (h(Host, { key: '4c4baf7ac22c632de6b0bc332ffc275e50bb4d71', id: this.id, "data-version": version }, h("div", { key: '576529323c3adca347ec685688c071e21a2f3a76', part: "accordion-item", class: "accordion-item" }, h("post-collapsible-trigger", { key: 'cc29c396173e55168a3bec963d5e101cb3fb17b2', for: `${this.id}--collapse` }, h(HeadingTag, { key: '76f8eed33f0c84bf6e1a534b04a8ccc0c69c6380', class: "accordion-header", id: `${this.id}--header` }, h("button", { key: 'f56e67ffc94fea0452d1879d3410318b3b12c4bc', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}`, part: "button" }, h("span", { key: 'd5f23318d5c498e0cd9dd1f15c13a636e49b7817', class: {
|
|
57
57
|
'logo-container': true,
|
|
58
58
|
'has-image': !!this.slottedLogo,
|
|
59
|
-
} }, h("slot", { key: '
|
|
59
|
+
} }, h("slot", { key: '051d48cc4201e2d954f4d4bc25c836ddc8e24d0f', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), h("slot", { key: 'e9f687c79fab8bd3bd94e4da022b2aea7e0bba5c', name: "header" }), h("post-icon", { key: 'c1f3486254269ab50a89bd6acf8c714cbbced3b8', name: "2051" })))), h("post-collapsible", { key: '7f3788a90e59cdb4f985fd14c64286cb938a3c23', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, h("div", { key: 'e17ae656614ac27d4f09ebba0a7bb547f88f5728', class: "accordion-body", part: "body" }, h("slot", { key: '0387ebe5ce518bbb8b78c66d919715a78b5ae558' }))))));
|
|
60
60
|
}
|
|
61
61
|
static get watchers() { return {
|
|
62
62
|
"headingLevel": ["validateHeadingLevel"]
|
|
@@ -20,7 +20,7 @@ const PostAccordion = /*@__PURE__*/ proxyCustomElement(class PostAccordion exten
|
|
|
20
20
|
validateHeadingLevel(newValue = this.headingLevel) {
|
|
21
21
|
if (!newValue)
|
|
22
22
|
return;
|
|
23
|
-
checkOneOf(
|
|
23
|
+
checkOneOf(this, 'headingLevel', HEADING_LEVELS, 'The `heading-level` property of the `post-accordion` must be a number between 1 and 6.');
|
|
24
24
|
this.accordionItems.forEach(item => {
|
|
25
25
|
item.setAttribute('heading-level', String(newValue));
|
|
26
26
|
});
|
|
@@ -96,7 +96,7 @@ const PostAccordion = /*@__PURE__*/ proxyCustomElement(class PostAccordion exten
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
render() {
|
|
99
|
-
return (h(Host, { key: '
|
|
99
|
+
return (h(Host, { key: '9ec8ca1ceac6587be68272568f216c958460ac0a', "data-version": version }, h("div", { key: '99887626d105f0e8f86b24e211591e7be820738d', class: "accordion" }, h("slot", { key: '4d8a003377c3a90648818a00144fd5f3a65be084', onSlotchange: () => this.registerAccordionItems() }))));
|
|
100
100
|
}
|
|
101
101
|
static get watchers() { return {
|
|
102
102
|
"headingLevel": ["validateHeadingLevel"]
|
|
@@ -35,7 +35,7 @@ const PostAvatar = /*@__PURE__*/ proxyCustomElement(class PostAvatar extends HTM
|
|
|
35
35
|
static INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
36
36
|
get host() { return this; }
|
|
37
37
|
validateFirstname() {
|
|
38
|
-
checkNonEmpty(this
|
|
38
|
+
checkNonEmpty(this, 'firstname');
|
|
39
39
|
}
|
|
40
40
|
async getAvatar() {
|
|
41
41
|
if (this.slottedImage !== null) {
|
|
@@ -16,7 +16,7 @@ const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop exten
|
|
|
16
16
|
this.label = undefined;
|
|
17
17
|
this.belowFold = false;
|
|
18
18
|
}
|
|
19
|
-
get
|
|
19
|
+
get host() { return this; }
|
|
20
20
|
translateY;
|
|
21
21
|
isBelowFold() {
|
|
22
22
|
return window.scrollY > window.innerHeight;
|
|
@@ -27,10 +27,10 @@ const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop exten
|
|
|
27
27
|
// Watch for changes in belowFold
|
|
28
28
|
watchBelowFold(newValue) {
|
|
29
29
|
if (newValue) {
|
|
30
|
-
slideUp(this.
|
|
30
|
+
slideUp(this.host, this.translateY);
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
slideDown(this.
|
|
33
|
+
slideDown(this.host, this.translateY);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
scrollToTop() {
|
|
@@ -40,8 +40,8 @@ const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop exten
|
|
|
40
40
|
}
|
|
41
41
|
// Validate the label
|
|
42
42
|
validateLabel() {
|
|
43
|
-
checkType(this
|
|
44
|
-
checkNonEmpty(this
|
|
43
|
+
checkType(this, 'label', 'string');
|
|
44
|
+
checkNonEmpty(this, 'label');
|
|
45
45
|
}
|
|
46
46
|
// Set the initial state
|
|
47
47
|
componentWillLoad() {
|
|
@@ -50,14 +50,14 @@ const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop exten
|
|
|
50
50
|
componentDidLoad() {
|
|
51
51
|
window.addEventListener('scroll', this.handleScroll, false);
|
|
52
52
|
this.translateY = window
|
|
53
|
-
.getComputedStyle(this.
|
|
53
|
+
.getComputedStyle(this.host)
|
|
54
54
|
.getPropertyValue('--post-floating-button-translate-y');
|
|
55
55
|
if (!this.belowFold) {
|
|
56
|
-
this.
|
|
56
|
+
this.host.style.transform = `translateY(${this.translateY})`;
|
|
57
57
|
}
|
|
58
58
|
// Initial load
|
|
59
59
|
if (this.belowFold) {
|
|
60
|
-
slideUp(this.
|
|
60
|
+
slideUp(this.host, this.translateY);
|
|
61
61
|
}
|
|
62
62
|
this.validateLabel();
|
|
63
63
|
}
|
|
@@ -65,7 +65,7 @@ const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop exten
|
|
|
65
65
|
window.removeEventListener('scroll', this.handleScroll);
|
|
66
66
|
}
|
|
67
67
|
render() {
|
|
68
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: '4d8c4e05ebcdd088c924ac0329b2238eb1d3c6ca', "data-version": version }, h("button", { key: 'fc37aff8558d7eb4b27a870f11133fc6984f4e11', class: "back-to-top", "aria-hidden": this.belowFold ? 'false' : 'true', tabindex: this.belowFold ? '0' : '-1', onClick: this.scrollToTop }, h("post-icon", { key: '4b978c44982ec0b02798ce75766b2acdd8497412', "aria-hidden": "true", name: "3026" }), h("span", { key: '4a899be348a6c8721696c634970773cd77f685d9', class: "visually-hidden" }, this.label))));
|
|
69
69
|
}
|
|
70
70
|
static get watchers() { return {
|
|
71
71
|
"belowFold": ["watchBelowFold"],
|
|
@@ -29,20 +29,20 @@ const PostBanner = /*@__PURE__*/ proxyCustomElement(class PostBanner extends HTM
|
|
|
29
29
|
this.type = 'neutral';
|
|
30
30
|
}
|
|
31
31
|
get host() { return this; }
|
|
32
|
-
validateDismissible(
|
|
33
|
-
checkType(
|
|
32
|
+
validateDismissible() {
|
|
33
|
+
checkType(this, 'dismissible', 'boolean');
|
|
34
34
|
setTimeout(() => this.validateDismissLabel());
|
|
35
35
|
}
|
|
36
|
-
validateDismissLabel(
|
|
36
|
+
validateDismissLabel() {
|
|
37
37
|
if (this.dismissible) {
|
|
38
|
-
checkNonEmpty(dismissLabel, 'Dismissible post-banner\'s require a "dismiss-label" prop.');
|
|
38
|
+
checkNonEmpty(this, 'dismissLabel', 'Dismissible post-banner\'s require a "dismiss-label" prop.');
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
validateIcon(
|
|
42
|
-
checkEmptyOrPattern(icon, /\d{4}|none/, 'The post-banner "icon" prop should be a 4-
|
|
41
|
+
validateIcon() {
|
|
42
|
+
checkEmptyOrPattern(this, 'icon', /\d{4}|none/, 'The post-banner "icon" prop should be a 4-digit string.');
|
|
43
43
|
}
|
|
44
|
-
validateType(
|
|
45
|
-
checkEmptyOrOneOf(
|
|
44
|
+
validateType() {
|
|
45
|
+
checkEmptyOrOneOf(this, 'type', BANNER_TYPES);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* An event emitted when the banner element is dismissed, after the transition.
|
|
@@ -76,14 +76,14 @@ const PostBanner = /*@__PURE__*/ proxyCustomElement(class PostBanner extends HTM
|
|
|
76
76
|
}
|
|
77
77
|
render() {
|
|
78
78
|
const defaultBannerContent = [
|
|
79
|
-
this.hasHeading && (h("div", { key: `${this.bannerId}-heading`, class: "banner-heading" }, h("slot", { key: '
|
|
79
|
+
this.hasHeading && (h("div", { key: `${this.bannerId}-heading`, class: "banner-heading" }, h("slot", { key: 'd4b29e3591f026b880c4b859a47bcbc3e3b11ced', name: "heading" }))),
|
|
80
80
|
h("slot", { key: `${this.bannerId}-message` }),
|
|
81
81
|
];
|
|
82
82
|
const actionBannerContent = [
|
|
83
83
|
h("div", { key: `${this.bannerId}-content`, class: "banner-content" }, defaultBannerContent),
|
|
84
|
-
h("div", { key: `${this.bannerId}-buttons`, class: "banner-buttons" }, h("slot", { key: '
|
|
84
|
+
h("div", { key: `${this.bannerId}-buttons`, class: "banner-buttons" }, h("slot", { key: '2f1461a2374d736cb3b72641aa150bc611082f56', name: "actions" })),
|
|
85
85
|
];
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: 'ec72012fa82e03b0dca2368025449e1942731c21', "data-version": version }, h("div", { key: 'acae7ac34af951ca9176769ab4bcdc388d769931', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (h("button", { key: '23cc4d77c2825bc76cedcdc321b80b9b0f333e71', class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { key: '2f0753d49fc86f19df743f33a086c14b2a0686f7', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.bannerId}-icon`, name: this.icon })), this.hasActions ? actionBannerContent : defaultBannerContent)));
|
|
87
87
|
}
|
|
88
88
|
static get watchers() { return {
|
|
89
89
|
"dismissible": ["validateDismissible"],
|
|
@@ -12,6 +12,7 @@ const PostBreadcrumbItem = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb
|
|
|
12
12
|
this.__registerHost();
|
|
13
13
|
this.__attachShadow();
|
|
14
14
|
this.url = undefined;
|
|
15
|
+
this.fullUrl = undefined;
|
|
15
16
|
}
|
|
16
17
|
get host() { return this; }
|
|
17
18
|
validUrl;
|
|
@@ -27,11 +28,9 @@ const PostBreadcrumbItem = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb
|
|
|
27
28
|
constructUrl(value) {
|
|
28
29
|
const hasBaseURL = /^https?:\/\//.test(String(this.url));
|
|
29
30
|
if (typeof value === 'string') {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
checkEmptyOrUrl(urlString, 'The "url" property of the post-breadcrumb-item is invalid');
|
|
34
|
-
return urlString;
|
|
31
|
+
this.fullUrl = hasBaseURL ? value : `${window.location.origin}${value}`;
|
|
32
|
+
checkEmptyOrUrl(this, 'fullUrl');
|
|
33
|
+
return this.fullUrl;
|
|
35
34
|
}
|
|
36
35
|
return undefined;
|
|
37
36
|
}
|
|
@@ -49,14 +48,15 @@ const PostBreadcrumbItem = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb
|
|
|
49
48
|
}
|
|
50
49
|
render() {
|
|
51
50
|
const BreadcrumbTag = this.validUrl ? 'a' : 'span';
|
|
52
|
-
return (h(Host, { key: '
|
|
51
|
+
return (h(Host, { key: 'd0444118aa031f4cf6f5161d7aa21900e9768348', "data-version": version }, h("post-icon", { key: '719a76e6e86bbb02526c4610acefb3ad253454af', name: "2111", class: "breadcrumb-item-icon" }), h(BreadcrumbTag, { key: '3f5ffb9c77567dba35efa7938029cd519de55474', class: "breadcrumb-item", ...(this.validUrl ? { href: this.validUrl } : {}), onKeyDown: event => this.handleKeyDown(event) }, h("slot", { key: 'bb1be29905c1533f2238a47a346fb35d6a7645fd' }))));
|
|
53
52
|
}
|
|
54
53
|
static get watchers() { return {
|
|
55
54
|
"url": ["validateUrl"]
|
|
56
55
|
}; }
|
|
57
56
|
static get style() { return PostBreadcrumbItemStyle0; }
|
|
58
57
|
}, [1, "post-breadcrumb-item", {
|
|
59
|
-
"url": [1]
|
|
58
|
+
"url": [1],
|
|
59
|
+
"fullUrl": [32]
|
|
60
60
|
}, undefined, {
|
|
61
61
|
"url": ["validateUrl"]
|
|
62
62
|
}]);
|
|
@@ -27,7 +27,7 @@ const PostBreadcrumb = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb ext
|
|
|
27
27
|
breadcrumbNavRef;
|
|
28
28
|
lastItem;
|
|
29
29
|
validateUrl() {
|
|
30
|
-
checkUrl(this
|
|
30
|
+
checkUrl(this, 'homeUrl');
|
|
31
31
|
}
|
|
32
32
|
componentWillLoad() {
|
|
33
33
|
this.updateBreadcrumbItems();
|
|
@@ -50,7 +50,7 @@ const PostBreadcrumb = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb ext
|
|
|
50
50
|
}, 50);
|
|
51
51
|
// Updates breadcrumb items and sets the last item
|
|
52
52
|
updateBreadcrumbItems() {
|
|
53
|
-
this.breadcrumbItems = Array.from(this.host.querySelectorAll('post-breadcrumb-item')).map(
|
|
53
|
+
this.breadcrumbItems = Array.from(this.host.querySelectorAll('post-breadcrumb-item')).map(item => ({
|
|
54
54
|
text: item.textContent || '',
|
|
55
55
|
url: item.getAttribute('url') || '',
|
|
56
56
|
}));
|
|
@@ -96,18 +96,18 @@ const PostBreadcrumb = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb ext
|
|
|
96
96
|
}
|
|
97
97
|
render() {
|
|
98
98
|
const visibleItems = this.breadcrumbItems.slice(0, -1);
|
|
99
|
-
return (h(Host, { key: '
|
|
99
|
+
return (h(Host, { key: 'd2fd5b6f8319124fa17649c8c5e479e727fc069a', "data-version": version }, h("nav", { key: 'a5f9b38fa054ad46d8972c28d175f864bed3c365', "aria-label": "Breadcrumb", class: "breadcrumbs-nav", ref: el => (this.breadcrumbNavRef = el) }, h("ol", { key: 'ac7ca9a80315ce6ba70e1aaaae6202fbb1a6933e', class: "no-list breadcrumbs-list" }, h("li", { key: '9927b293673f16bbe837419baf7d4a8f97885bc0' }, h("a", { key: '2b2de9924472a3da00f843c7b569358b60d43539', href: this.homeUrl, class: "breadcrumb-link" }, h("span", { key: '540a16d9673e9c423493597468a3db00b7d75cef', class: "visually-hidden" }, this.homeText), h("post-icon", { key: '73fad27cd72f18bb5ea281c88ff2c184d7d8187d', name: "home", class: "home-icon" }))), this.isConcatenated ? (h("div", { class: "menu-trigger-wrapper", "aria-label": "More breadcrumbs", onKeyDown: e => {
|
|
100
100
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
101
101
|
e.preventDefault();
|
|
102
102
|
this.handleBreadcrumbItemClick();
|
|
103
103
|
}
|
|
104
|
-
} }, h("post-icon", { name: "2111", class: "breadcrumb-item-icon" }), h("div", { class: "actual-menu" }, h("post-menu-trigger", { for: "breadcrumb-menu", tabIndex: 0 }, h("button", { class: "btn test", tabIndex: -1 }, "...")), h("post-menu", { id: "breadcrumb-menu" }, visibleItems.map(
|
|
104
|
+
} }, h("post-icon", { name: "2111", class: "breadcrumb-item-icon" }), h("div", { class: "actual-menu" }, h("post-menu-trigger", { for: "breadcrumb-menu", tabIndex: 0 }, h("button", { class: "btn test", tabIndex: -1 }, "...")), h("post-menu", { id: "breadcrumb-menu" }, visibleItems.map(item => (h("post-menu-item", { key: item.url || item.text, class: "breadcrumb-item", onKeyDown: e => {
|
|
105
105
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
106
106
|
const linkElement = e.currentTarget.querySelector('a');
|
|
107
107
|
linkElement?.click();
|
|
108
108
|
e.preventDefault();
|
|
109
109
|
}
|
|
110
|
-
} }, item.url ? h("a", { href: item.url }, item.text) : h("span", null, item.text)))))))) : (visibleItems.map(
|
|
110
|
+
} }, item.url ? h("a", { href: item.url }, item.text) : h("span", null, item.text)))))))) : (visibleItems.map(item => (h("post-breadcrumb-item", { url: item.url, key: item.url || item.text }, item.text)))), this.lastItem && (h("post-breadcrumb-item", { key: '31d86d933720b5f6f6928ccfd251443261e9479e', url: this.lastItem.url, "aria-current": "page", tabindex: -1 }, this.lastItem.text))), h("div", { key: '3248d32aa6a73c97c3071be85174fb8634d4e722', class: "hidden-items" }, h("a", { key: '05b0231d3a5793588aa9ede628a7b1e6d2e2faf0', href: this.homeUrl, class: "hidden-breadcrumb-item" }, h("span", { key: '15a63a894124717cfb2be61779c3971772c38397', class: "visually-hidden" }, this.homeText), h("post-icon", { key: '6c893c56b6a34f311fa66d71c4cb523b00535458', name: "home", class: "home-icon" })), this.breadcrumbItems.map(item => (h("post-breadcrumb-item", { url: item.url, key: `hidden-${item.url || item.text}`, class: "hidden-breadcrumb-item" }, item.text)))))));
|
|
111
111
|
}
|
|
112
112
|
static get watchers() { return {
|
|
113
113
|
"homeUrl": ["validateUrl"]
|