@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
|
@@ -8,7 +8,7 @@ export declare class PostTabHeader {
|
|
|
8
8
|
* The name of the panel controlled by the tab header.
|
|
9
9
|
*/
|
|
10
10
|
readonly panel: HTMLPostTabPanelElement['name'];
|
|
11
|
-
validateFor(
|
|
11
|
+
validateFor(): void;
|
|
12
12
|
componentWillLoad(): void;
|
|
13
13
|
render(): any;
|
|
14
14
|
}
|
|
@@ -7,7 +7,7 @@ export declare class PostTogglebutton {
|
|
|
7
7
|
* If `true`, the button is in the "on" state, otherwise it is in the "off" state.
|
|
8
8
|
*/
|
|
9
9
|
toggled: boolean;
|
|
10
|
-
validateToggled(
|
|
10
|
+
validateToggled(): void;
|
|
11
11
|
componentWillLoad(): void;
|
|
12
12
|
private handleClick;
|
|
13
13
|
private handleKeydown;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export type PropertyType = 'boolean' | 'number' | 'string' | 'array' | 'object' | 'function';
|
|
2
|
-
export declare function checkType
|
|
2
|
+
export declare function checkType<T extends {
|
|
3
|
+
host: HTMLElement;
|
|
4
|
+
}>(component: T, prop: keyof T, type: PropertyType, customMessage?: string): void;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
export declare const checkEmptyOrOneOf: <T
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
1
|
+
export declare const checkEmptyOrOneOf: <T extends {
|
|
2
|
+
host: HTMLElement;
|
|
3
|
+
}>(component: T, prop: keyof T, possibleValues: readonly unknown[], customMessage?: string) => void;
|
|
4
|
+
export declare const checkEmptyOrPattern: <T extends {
|
|
5
|
+
host: HTMLElement;
|
|
6
|
+
}>(component: T, prop: keyof T, pattern: RegExp, customMessage: string) => void;
|
|
7
|
+
export declare const checkEmptyOrType: <T extends {
|
|
8
|
+
host: HTMLElement;
|
|
9
|
+
}>(component: T, prop: keyof T, type: import("./check-type").PropertyType, customMessage?: string) => void;
|
|
10
|
+
export declare const checkEmptyOrUrl: <T extends {
|
|
11
|
+
host: HTMLElement;
|
|
12
|
+
}>(component: T, prop: keyof T, customMessage?: string) => void;
|
|
5
13
|
export * from './check-non-empty';
|
|
6
14
|
export * from './check-one-of';
|
|
7
15
|
export * from './check-pattern';
|
|
@@ -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
|
|
package/loaders/check-one-of.js
CHANGED
|
@@ -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
|
|
package/loaders/check-type.js
CHANGED
|
@@ -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
|
|
package/loaders/index2.js
CHANGED
|
@@ -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
|
|
package/loaders/package.js
CHANGED
|
@@ -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$1 = /*@__PURE__*/ proxyCustomElement(class PostAccordion ext
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostAccordion ext
|
|
|
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"]
|
package/loaders/post-avatar.js
CHANGED
|
@@ -35,7 +35,7 @@ const PostAvatar$1 = /*@__PURE__*/ proxyCustomElement(class PostAvatar extends H
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBackToTop ext
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBackToTop ext
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBackToTop ext
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBackToTop ext
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBackToTop ext
|
|
|
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"],
|
package/loaders/post-banner.js
CHANGED
|
@@ -29,20 +29,20 @@ const PostBanner$1 = /*@__PURE__*/ proxyCustomElement(class PostBanner extends H
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBanner extends H
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb e
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb e
|
|
|
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$1 = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb e
|
|
|
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"]
|
|
@@ -61,11 +61,11 @@ const PostCardControl$1 = /*@__PURE__*/ proxyCustomElement(class PostCardControl
|
|
|
61
61
|
this.control.checked = this.checked = false;
|
|
62
62
|
this.controlSetChecked(false);
|
|
63
63
|
}
|
|
64
|
-
validateControlLabel(
|
|
65
|
-
checkNonEmpty(
|
|
64
|
+
validateControlLabel() {
|
|
65
|
+
checkNonEmpty(this, 'label');
|
|
66
66
|
}
|
|
67
|
-
validateControlType(
|
|
68
|
-
checkOneOf(type, ['checkbox', 'radio']
|
|
67
|
+
validateControlType() {
|
|
68
|
+
checkOneOf(this, 'type', ['checkbox', 'radio']);
|
|
69
69
|
}
|
|
70
70
|
updateControlChecked(checked = this.checked) {
|
|
71
71
|
this.controlSetChecked(checked);
|
|
@@ -236,14 +236,14 @@ const PostCardControl$1 = /*@__PURE__*/ proxyCustomElement(class PostCardControl
|
|
|
236
236
|
this.hasIcon = Boolean(this.host.querySelector('[slot="icon"]') || this.icon);
|
|
237
237
|
}
|
|
238
238
|
render() {
|
|
239
|
-
return (h(Host, { key: '
|
|
239
|
+
return (h(Host, { key: '6d243226748befc5cdc25f567672859700b04825', "data-version": version, onClick: this.cardClickHandler }, h("div", { key: '0e974eed3c642ca13fa86883c27c0c1e6344d7fd', class: {
|
|
240
240
|
'card-control': true,
|
|
241
241
|
'is-checked': this.checked,
|
|
242
242
|
'is-disabled': this.disabled,
|
|
243
243
|
'is-focused': this.focused,
|
|
244
244
|
'is-valid': this.validity !== null && this.validity !== 'false',
|
|
245
245
|
'is-invalid': this.validity === 'false',
|
|
246
|
-
} }, h("input", { key: '
|
|
246
|
+
} }, h("input", { key: 'bd2a44b835eef5ad2927b3d39721e430deccaf9d', ref: el => (this.control = el), id: this.controlId, class: "card-control--input", type: this.type, name: this.name, value: this.value, checked: this.checked, "aria-describedby": `${this.controlId}_content`, "aria-disabled": this.disabled, "aria-invalid": this.validity === 'false', onClick: this.controlClickHandler, onInput: this.controlChangeHandler, onChange: this.controlChangeHandler, onFocus: this.controlFocusHandler, onBlur: this.controlFocusHandler, onKeyDown: this.controlKeyDownHandler }), h("label", { key: 'a05fc353909de0be2cde8c306bfdc6e7248a59bf', id: `${this.controlId}_label`, htmlFor: this.controlId, class: "card-control--label" }, this.label, this.description ? (h("div", { class: "card-control--description" }, this.description)) : null), this.hasIcon ? (h("div", { class: "card-control--icon" }, h("slot", { name: "icon" }, this.icon ? h("post-icon", { name: this.icon }) : null))) : null, h("div", { key: '348dc3bea78771041ad19530c7265fba2ea189dd', id: `${this.controlId}_content`, class: "card-control--content" }, h("slot", { key: '7e6198e8e3ec1d2aec677be55c5fe8828198e9d7' })))));
|
|
247
247
|
}
|
|
248
248
|
componentDidRender() {
|
|
249
249
|
this.setHostContext();
|
|
@@ -19,8 +19,8 @@ const PostCollapsibleTrigger = /*@__PURE__*/ proxyCustomElement(class PostCollap
|
|
|
19
19
|
* Set the "aria-controls" and "aria-expanded" attributes on the trigger to match the state of the controlled post-collapsible
|
|
20
20
|
*/
|
|
21
21
|
setAriaAttributes() {
|
|
22
|
-
checkNonEmpty(this
|
|
23
|
-
checkType(this
|
|
22
|
+
checkNonEmpty(this, 'for');
|
|
23
|
+
checkType(this, 'for', 'string', 'The post-collapsible-trigger "for" prop should be a id.');
|
|
24
24
|
void this.update();
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
@@ -39,7 +39,7 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
39
39
|
isOpen = true;
|
|
40
40
|
get host() { return this; }
|
|
41
41
|
collapsedChange() {
|
|
42
|
-
checkEmptyOrType(this
|
|
42
|
+
checkEmptyOrType(this, 'collapsed', 'boolean');
|
|
43
43
|
void this.toggle(!this.collapsed);
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
@@ -82,7 +82,7 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
82
82
|
triggers.forEach(trigger => trigger.update());
|
|
83
83
|
}
|
|
84
84
|
render() {
|
|
85
|
-
return (h(Host, { key: '
|
|
85
|
+
return (h(Host, { key: 'a43e25138933a758759b4adcca249757db75cc4b', "data-version": version, tabindex: this.collapsed ? -1 : undefined }, h("slot", { key: '2936f71a6fb3ddedda372e8da4a19dbceecaefa6' })));
|
|
86
86
|
}
|
|
87
87
|
static get watchers() { return {
|
|
88
88
|
"collapsed": ["collapsedChange"]
|
package/loaders/post-footer.js
CHANGED
|
@@ -13,36 +13,37 @@ class Breakpoint {
|
|
|
13
13
|
};
|
|
14
14
|
constructor() {
|
|
15
15
|
if (!this.breakpointMap) {
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
this.breakpointMap =
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
key: keys[i],
|
|
26
|
-
name: names[i],
|
|
27
|
-
};
|
|
28
|
-
})
|
|
16
|
+
const keys = this.getStyles('--post-breakpoint-keys');
|
|
17
|
+
const names = this.getStyles('--post-breakpoint-names');
|
|
18
|
+
const widths = this.getStyles('--post-breakpoint-widths');
|
|
19
|
+
this.breakpointMap = widths
|
|
20
|
+
.map((width, i) => ({
|
|
21
|
+
minWidth: Number(width),
|
|
22
|
+
key: keys[i],
|
|
23
|
+
name: names[i],
|
|
24
|
+
}))
|
|
29
25
|
.reverse();
|
|
30
26
|
window.addEventListener('resize', () => this.updateHandler(), { passive: true });
|
|
31
27
|
}
|
|
32
28
|
}
|
|
29
|
+
getStyles(propertyName) {
|
|
30
|
+
const styles = getComputedStyle(document.documentElement);
|
|
31
|
+
return (styles
|
|
32
|
+
.getPropertyValue(propertyName)
|
|
33
|
+
?.split(',')
|
|
34
|
+
.map(w => w.trim()) ?? []);
|
|
35
|
+
}
|
|
33
36
|
updateHandler(emitEvents = true) {
|
|
34
37
|
const calculated = this.breakpointMap.find(({ minWidth }) => innerWidth >= minWidth);
|
|
35
38
|
if (this.current.key !== calculated.key) {
|
|
36
39
|
this.current.key = calculated.key;
|
|
37
|
-
if (emitEvents)
|
|
40
|
+
if (emitEvents)
|
|
38
41
|
this.dispatchEvent('key');
|
|
39
|
-
}
|
|
40
42
|
}
|
|
41
43
|
if (this.current.name !== calculated.name) {
|
|
42
44
|
this.current.name = calculated.name;
|
|
43
|
-
if (emitEvents)
|
|
45
|
+
if (emitEvents)
|
|
44
46
|
this.dispatchEvent('name');
|
|
45
|
-
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
dispatchEvent(type) {
|
package/loaders/post-header.js
CHANGED
|
@@ -4,7 +4,7 @@ import { v as version } from './package.js';
|
|
|
4
4
|
import { s as slideUp, a as slideDown } from './slide.js';
|
|
5
5
|
import { g as getFocusableChildren } from './get-focusable-children.js';
|
|
6
6
|
|
|
7
|
-
const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:3;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:12px;inset-block-start:calc((var(--global-header-height) - var(--global-header-reduced-height))*-1)}}.global-sub{display:flex;align-items:center;gap:24px}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--global-header-height);width:var(--global-header-height);min-height:var(--global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{height:calc(var(--global-header-height) - var(--header-scroll-top))}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-left:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px;min-height:var(--local-header-min-height);background:#fff;transition:box-shadow .2s ease-in-out;border-block-end:1px solid #e1e0dc}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:calc(-1*(var(--local-header-height) - var(--main-navigation-height)) + var(--global-header-reduced-height));padding-block-start:18px;box-shadow:var(--post-device-elevation-300)}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:
|
|
7
|
+
const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:3;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:12px;inset-block-start:calc((var(--global-header-height) - var(--global-header-reduced-height))*-1)}}.global-sub{display:flex;align-items:center;gap:24px}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--global-header-height);width:var(--global-header-height);min-height:var(--global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{height:calc(var(--global-header-height) - var(--header-scroll-top))}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-left:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px;min-height:var(--local-header-min-height);background:#fff;transition:box-shadow .2s ease-in-out;border-block-end:1px solid #e1e0dc}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:calc(-1*(var(--local-header-height) - var(--main-navigation-height)) + var(--global-header-reduced-height));padding-block-start:18px;box-shadow:var(--post-device-elevation-300)}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:12px;flex-wrap:wrap;gap:16px}.local-header.local-header-mobile-extended{border-bottom:1px solid #e1e0dc}.local-header:not(.local-header-mobile-extended){box-shadow:var(--post-device-elevation-300)}}.local-sub{margin-inline-end:16px}::slotted(.list-inline){margin:0 !important;z-index:3 !important;position:relative !important}::slotted(h1){margin:0 !important;flex-shrink:10;z-index:3}@media screen and (min-width: 600px){::slotted(h1){margin-inline-start:12px !important}}@media screen and (max-width: 599.98px){::slotted(h1){margin-inline-start:8px !important}}@media screen and (min-width: 1024px){::slotted(h1){font-size:28px !important}}@media screen and (max-width: 1023.98px){::slotted(h1){font-size:20px !important;max-width:calc(100vw - 8px - 16px)}}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--global-header-reduced-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:#fff}}@media screen and (max-width: 1023.98px){.navigation{position:fixed;z-index:1;inset-inline:0;background:#fff;inset-block-end:calc(100dvh - var(--header-height))}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:16px 24px;padding-inline:32px}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}.navigation.extended{height:calc(100dvh - var(--header-height));display:flex;flex-direction:column}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){background-color:#fafafa;gap:32px}.navigation-footer{background-color:#f0efed;gap:24px}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:16px}}";
|
|
8
8
|
const PostHeaderStyle0 = postHeaderCss;
|
|
9
9
|
|
|
10
10
|
const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends HTMLElement {
|