@swisspost/design-system-components 10.0.0-next.38 → 10.0.0-next.40
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/index-2b2b85e5.js +96 -0
- package/dist/cjs/index-b60129c4.js +2 -6
- package/dist/cjs/index.cjs.js +23 -29
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-3e61e6f3.js → package-b731881e.js} +1 -1
- package/dist/cjs/placement-b2bb6ec4.js +18 -0
- package/dist/cjs/post-accordion-item-5c879102.js +161 -0
- package/dist/cjs/post-accordion_2.cjs.entry.js +16 -0
- package/dist/cjs/{post-avatar-22bfd12e.js → post-avatar-4f1681df.js} +21 -4
- package/dist/cjs/post-avatar.cjs.entry.js +3 -4
- package/dist/cjs/{post-back-to-top-f682ea05.js → post-back-to-top-abbb4ac4.js} +8 -11
- package/dist/cjs/post-back-to-top.cjs.entry.js +3 -5
- package/dist/cjs/{post-banner-5c749a94.js → post-banner-4d99c51c.js} +12 -17
- package/dist/cjs/post-banner.cjs.entry.js +3 -8
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +3 -7
- package/dist/cjs/{post-breadcrumbs-76f55ae5.js → post-breadcrumbs-5ceabb10.js} +13 -7
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +3 -3
- package/dist/cjs/{post-card-control-161a7102.js → post-card-control-b657aeaa.js} +42 -21
- package/dist/cjs/post-card-control.cjs.entry.js +3 -5
- package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -9
- package/dist/cjs/{post-collapsible-trigger-6cdf4481.js → post-collapsible-trigger-33f09d6c.js} +5 -8
- package/dist/cjs/post-collapsible_2.cjs.entry.js +3 -8
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/{post-footer-15d78645.js → post-footer-022cf408.js} +39 -11
- package/dist/cjs/post-footer.cjs.entry.js +3 -2
- package/dist/cjs/{post-linkarea-095d1928.js → post-linkarea-5fbb2e25.js} +2 -2
- package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
- package/dist/cjs/{post-menu-item-387e079b.js → post-menu-item-d4cc4742.js} +4 -4
- package/dist/cjs/{post-popover-388c8091.js → post-popover-b7cd0091.js} +20 -5
- package/dist/cjs/post-popover.cjs.entry.js +4 -2
- package/dist/cjs/{post-rating-246e4d89.js → post-rating-c81d1ac3.js} +29 -8
- package/dist/cjs/post-rating.cjs.entry.js +4 -2
- package/dist/cjs/{post-tab-header-0e9d0e06.js → post-tab-header-1db15093.js} +4 -4
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -4
- package/dist/cjs/{post-tab-panel-f952714f.js → post-tab-panel-698981b8.js} +11 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +4 -2
- package/dist/cjs/{post-tabs-97c30d81.js → post-tabs-79eab811.js} +2 -2
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tag-58003cf0.js → post-tag-66a52727.js} +18 -5
- package/dist/cjs/post-tag.cjs.entry.js +4 -2
- package/dist/cjs/{post-togglebutton-87c984d8.js → post-togglebutton-a6b8b75d.js} +89 -92
- package/dist/cjs/{post-tooltip-28e7711a.js → post-tooltip-560cf42c.js} +11 -10
- package/dist/cjs/{post-tooltip-trigger-cbc53d14.js → post-tooltip-trigger-2a54e3e4.js} +6 -8
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +3 -3
- package/dist/cjs/post-tooltip.cjs.entry.js +4 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +7 -7
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -6
- package/dist/collection/components/post-avatar/post-avatar.js +25 -2
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +8 -10
- package/dist/collection/components/post-banner/post-banner.js +13 -18
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +15 -7
- package/dist/collection/components/post-card-control/post-card-control.js +58 -33
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +4 -5
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +39 -8
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +29 -54
- package/dist/collection/components/post-icon/post-icon.js +17 -37
- package/dist/collection/components/post-language-option/post-language-option.js +13 -13
- package/dist/collection/components/post-language-switch/post-language-switch.js +5 -5
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-list/post-list.js +1 -1
- package/dist/collection/components/post-list-item/post-list-item.js +1 -1
- 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-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +3 -3
- package/dist/collection/components/post-menu/post-menu.js +13 -2
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
- package/dist/collection/components/post-popover/post-popover.js +21 -2
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -4
- package/dist/collection/components/post-rating/post-rating.js +29 -2
- package/dist/collection/components/post-tab-header/post-tab-header.js +6 -11
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +13 -2
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-tag/post-tag.js +23 -11
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -12
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +12 -12
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +5 -7
- package/dist/collection/types/index.js +2 -0
- package/dist/collection/types/placement.js +14 -0
- package/dist/collection/types/property-types.js +1 -0
- package/dist/collection/utils/is-value-empty.js +4 -0
- package/dist/collection/utils/property-checkers/check-one-of.js +3 -4
- package/dist/collection/utils/property-checkers/check-pattern.js +3 -4
- package/dist/collection/utils/property-checkers/check-type.js +4 -6
- package/dist/collection/utils/property-checkers/check-url.js +5 -5
- package/dist/collection/utils/property-checkers/constants.js +1 -1
- package/dist/collection/utils/property-checkers/empty-or.js +4 -6
- package/dist/collection/utils/property-checkers/index.js +6 -6
- package/dist/collection/utils/property-checkers/required-and.js +14 -0
- package/dist/components/index2.js +60 -19
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +6 -6
- package/dist/components/post-accordion2.js +8 -8
- package/dist/components/post-avatar2.js +24 -4
- package/dist/components/post-back-to-top2.js +9 -12
- package/dist/components/post-banner2.js +12 -18
- package/dist/components/post-breadcrumb-item2.js +2 -2
- package/dist/components/post-breadcrumbs2.js +14 -7
- package/dist/components/post-card-control2.js +41 -16
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +3 -5
- package/dist/components/post-collapsible2.js +2 -2
- package/dist/components/post-footer2.js +46 -9
- package/dist/components/post-header2.js +31 -33
- package/dist/components/post-icon2.js +9 -25
- package/dist/components/post-language-option2.js +9 -10
- package/dist/components/post-language-switch2.js +4 -6
- package/dist/components/post-linkarea2.js +1 -1
- package/dist/components/post-list-item2.js +1 -1
- package/dist/components/post-list2.js +1 -1
- package/dist/components/post-logo2.js +2 -2
- package/dist/components/post-mainnavigation2.js +2 -2
- package/dist/components/post-megadropdown-trigger2.js +4 -4
- package/dist/components/post-megadropdown2.js +2 -2
- package/dist/components/post-menu-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +3 -3
- package/dist/components/post-menu2.js +12 -2
- package/dist/components/post-popover2.js +20 -3
- package/dist/components/post-popovercontainer2.js +37 -3
- package/dist/components/post-rating2.js +26 -1
- package/dist/components/post-tab-header2.js +3 -3
- package/dist/components/post-tab-panel2.js +12 -1
- package/dist/components/post-tabs2.js +1 -1
- package/dist/components/post-tag2.js +19 -5
- package/dist/components/post-togglebutton2.js +1 -12
- package/dist/components/post-tooltip-trigger2.js +5 -7
- package/dist/components/post-tooltip2.js +11 -11
- package/dist/components/switch-variants.js +3 -0
- package/dist/docs.json +49 -89
- package/dist/esm/index-f4d19816.js +2 -6
- package/dist/esm/index-ffccd040.js +88 -0
- package/dist/esm/index.js +22 -28
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-9374eb90.js +3 -0
- package/dist/esm/placement-8d56605d.js +16 -0
- package/dist/esm/post-accordion-item-f416bd95.js +158 -0
- package/dist/esm/post-accordion_2.entry.js +7 -0
- package/dist/esm/{post-avatar-639dc17a.js → post-avatar-2cb5190b.js} +21 -4
- package/dist/esm/post-avatar.entry.js +3 -4
- package/dist/esm/{post-back-to-top-8099279e.js → post-back-to-top-f877d4c6.js} +8 -11
- package/dist/esm/post-back-to-top.entry.js +3 -5
- package/dist/esm/{post-banner-54834fbf.js → post-banner-576a5adb.js} +12 -17
- package/dist/esm/post-banner.entry.js +3 -8
- package/dist/esm/post-breadcrumb-item_2.entry.js +3 -7
- package/dist/esm/{post-breadcrumbs-caf56014.js → post-breadcrumbs-63223336.js} +13 -7
- package/dist/esm/post-breadcrumbs.entry.js +3 -3
- package/dist/esm/{post-card-control-b063586b.js → post-card-control-2eebe7b4.js} +37 -16
- package/dist/esm/post-card-control.entry.js +3 -5
- package/dist/esm/post-closebutton_15.entry.js +5 -9
- package/dist/esm/{post-collapsible-trigger-727bcde1.js → post-collapsible-trigger-561df34e.js} +5 -8
- package/dist/esm/post-collapsible_2.entry.js +3 -8
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/{post-footer-16f1a8de.js → post-footer-a270f67b.js} +36 -8
- package/dist/esm/post-footer.entry.js +3 -2
- package/dist/esm/{post-linkarea-4e4228fb.js → post-linkarea-456ce63d.js} +2 -2
- package/dist/esm/post-linkarea.entry.js +2 -2
- package/dist/esm/{post-menu-item-e9dd8173.js → post-menu-item-e051284c.js} +4 -4
- package/dist/esm/{post-popover-46ede6b5.js → post-popover-7c3c9072.js} +17 -2
- package/dist/esm/post-popover.entry.js +4 -2
- package/dist/esm/{post-rating-8d0d970b.js → post-rating-2c9dd11f.js} +23 -2
- package/dist/esm/post-rating.entry.js +4 -2
- package/dist/esm/{post-tab-header-8224c7c2.js → post-tab-header-f90b2f93.js} +4 -4
- package/dist/esm/post-tab-header.entry.js +3 -4
- package/dist/esm/{post-tab-panel-dfdeccd3.js → post-tab-panel-c19b5e30.js} +11 -2
- package/dist/esm/post-tab-panel.entry.js +4 -2
- package/dist/esm/{post-tabs-fabd0569.js → post-tabs-0dadedf2.js} +2 -2
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tag-13994238.js → post-tag-b8be3b0c.js} +18 -5
- package/dist/esm/post-tag.entry.js +4 -2
- package/dist/esm/{post-togglebutton-87967c5b.js → post-togglebutton-83339cc9.js} +89 -92
- package/dist/esm/{post-tooltip-eecaa4c7.js → post-tooltip-3cc82984.js} +11 -10
- package/dist/esm/{post-tooltip-trigger-642cbb22.js → post-tooltip-trigger-898c3dbc.js} +6 -8
- package/dist/esm/post-tooltip-trigger.entry.js +3 -3
- package/dist/esm/post-tooltip.entry.js +4 -3
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-104ddc50.js +1 -0
- package/dist/post-components/p-13b41e32.entry.js +1 -0
- package/dist/post-components/p-1906d77c.js +1 -0
- package/dist/post-components/p-19d0e6ea.entry.js +1 -0
- package/dist/post-components/p-1b9afb34.entry.js +1 -0
- package/dist/post-components/{p-a07f85ee.js → p-1fbffc90.js} +1 -1
- package/dist/post-components/p-234925fa.js +1 -0
- package/dist/post-components/p-23fb976f.entry.js +1 -0
- package/dist/post-components/p-24c42ebe.entry.js +1 -0
- package/dist/post-components/{p-19317b15.js → p-28c19671.js} +2 -2
- package/dist/post-components/p-37aaa30f.js +1 -0
- package/dist/post-components/p-3baf0b40.entry.js +1 -0
- package/dist/post-components/p-4390192f.js +1 -0
- package/dist/post-components/p-4a071696.js +1 -0
- package/dist/post-components/p-4c2d5072.js +1 -0
- package/dist/post-components/p-51b6114c.entry.js +1 -0
- package/dist/post-components/p-59a38c23.js +1 -0
- package/dist/post-components/p-5fb4fc65.js +1 -0
- package/dist/post-components/p-64c13aaf.entry.js +1 -0
- package/dist/post-components/p-66679f9d.entry.js +1 -0
- package/dist/post-components/p-68a98f0b.js +1 -0
- package/dist/post-components/{p-692ba59d.js → p-6a4dc55e.js} +1 -1
- package/dist/post-components/p-789f9a23.entry.js +1 -0
- package/dist/post-components/p-7e6eae42.js +1 -0
- package/dist/post-components/p-8117dd0c.js +1 -0
- package/dist/post-components/p-814c0c4d.entry.js +1 -0
- package/dist/post-components/p-87e0d6fa.js +1 -0
- package/dist/post-components/p-988d20f4.js +1 -0
- package/dist/post-components/p-9b1e4e52.entry.js +1 -0
- package/dist/post-components/p-ab44a18c.entry.js +1 -0
- package/dist/post-components/p-b176309b.js +1 -0
- package/dist/post-components/p-b2952b0e.entry.js +1 -0
- package/dist/post-components/p-c10b2a2f.js +1 -0
- package/dist/post-components/{p-0dcd25ab.js → p-c80cb846.js} +1 -1
- package/dist/post-components/p-da4704c1.js +1 -0
- package/dist/post-components/p-dc4de84a.entry.js +1 -0
- package/dist/post-components/p-f1f0ace3.entry.js +1 -0
- package/dist/post-components/p-f34fb6c4.entry.js +1 -0
- package/dist/post-components/p-f6f914bb.js +1 -0
- package/dist/post-components/p-fe7e64cf.entry.js +1 -0
- package/dist/post-components/p-fee94252.entry.js +1 -0
- package/dist/post-components/post-components.css +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/prebuild.js +26 -0
- package/dist/types/components/post-accordion/post-accordion.d.ts +2 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +3 -0
- 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 +3 -4
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +2 -1
- package/dist/types/components/post-card-control/post-card-control.d.ts +10 -6
- package/dist/types/components/post-footer/post-footer.d.ts +8 -2
- package/dist/types/components/post-header/post-header.d.ts +5 -9
- package/dist/types/components/post-icon/post-icon.d.ts +5 -7
- package/dist/types/components/post-language-option/post-language-option.d.ts +5 -5
- package/dist/types/components/post-logo/post-logo.d.ts +1 -1
- package/dist/types/components/post-menu/post-menu.d.ts +1 -0
- package/dist/types/components/post-popover/post-popover.d.ts +2 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +3 -0
- package/dist/types/components/post-rating/post-rating.d.ts +4 -0
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +1 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +5 -3
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +0 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +3 -3
- package/dist/types/components.d.ts +38 -59
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/placement.d.ts +1 -0
- package/dist/types/types/property-types.d.ts +1 -0
- package/dist/types/utils/is-value-empty.d.ts +1 -0
- package/dist/types/utils/property-checkers/check-one-of.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-type.d.ts +2 -2
- package/dist/types/utils/property-checkers/check-url.d.ts +1 -1
- package/dist/types/utils/property-checkers/constants.d.ts +1 -1
- package/dist/types/utils/property-checkers/empty-or.d.ts +3 -1
- package/dist/types/utils/property-checkers/index.d.ts +16 -9
- package/dist/types/utils/property-checkers/required-and.d.ts +3 -0
- package/loaders/index2.js +60 -19
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +6 -6
- package/loaders/post-accordion.js +1 -124
- package/{dist/esm/post-accordion-03796d13.js → loaders/post-accordion2.js} +43 -20
- package/loaders/post-avatar.js +24 -4
- package/loaders/post-back-to-top.js +9 -12
- package/loaders/post-banner.js +12 -18
- package/loaders/post-breadcrumb-item2.js +2 -2
- package/loaders/post-breadcrumbs.js +14 -7
- package/loaders/post-card-control.js +41 -16
- package/loaders/post-closebutton.js +1 -1
- package/loaders/post-collapsible-trigger2.js +3 -5
- package/loaders/post-collapsible2.js +2 -2
- package/loaders/post-footer.js +46 -9
- package/loaders/post-header.js +31 -33
- package/loaders/post-icon2.js +9 -25
- package/loaders/post-language-option.js +9 -10
- package/loaders/post-language-switch.js +4 -6
- package/loaders/post-linkarea.js +1 -1
- package/loaders/post-list-item.js +1 -1
- package/loaders/post-list.js +1 -1
- package/loaders/post-logo.js +2 -2
- package/loaders/post-mainnavigation.js +2 -2
- package/loaders/post-megadropdown-trigger.js +4 -4
- package/loaders/post-megadropdown.js +2 -2
- package/loaders/post-menu-item2.js +1 -1
- package/loaders/post-menu-trigger2.js +3 -3
- package/loaders/post-menu2.js +12 -2
- package/loaders/post-popover.js +20 -3
- package/loaders/post-popovercontainer.js +1 -1
- package/loaders/post-popovercontainer2.js +37 -3
- package/loaders/post-rating.js +26 -1
- package/loaders/post-tab-header.js +3 -3
- package/loaders/post-tab-panel.js +12 -1
- package/loaders/post-tabs.js +1 -1
- package/loaders/post-tag.js +19 -5
- package/loaders/post-togglebutton.js +1 -12
- package/loaders/post-tooltip-trigger.js +5 -7
- package/loaders/post-tooltip.js +11 -11
- package/loaders/switch-variants.js +3 -0
- package/package.json +19 -9
- package/dist/cjs/check-non-empty-bd99d236.js +0 -15
- package/dist/cjs/check-one-of-75d270b5.js +0 -13
- package/dist/cjs/check-type-cdbf6d29.js +0 -21
- package/dist/cjs/check-url-220a286c.js +0 -19
- package/dist/cjs/constants-238701d3.js +0 -5
- package/dist/cjs/heading-levels-608d432e.js +0 -5
- package/dist/cjs/index-23e36ff7.js +0 -37
- package/dist/cjs/post-accordion-e54524be.js +0 -105
- package/dist/cjs/post-accordion-item-86f11a16.js +0 -64
- package/dist/cjs/post-accordion-item.cjs.entry.js +0 -20
- package/dist/cjs/post-accordion.cjs.entry.js +0 -15
- package/dist/collection/utils/property-checkers/check-non-empty.js +0 -10
- package/dist/components/check-non-empty.js +0 -13
- package/dist/components/check-one-of.js +0 -11
- package/dist/components/check-type.js +0 -19
- package/dist/components/constants.js +0 -3
- package/dist/esm/check-non-empty-258a56b3.js +0 -13
- package/dist/esm/check-one-of-0bee20f5.js +0 -11
- package/dist/esm/check-type-37d5d307.js +0 -19
- package/dist/esm/check-url-17962bc8.js +0 -17
- package/dist/esm/constants-8d548297.js +0 -3
- package/dist/esm/heading-levels-5b7b4349.js +0 -3
- package/dist/esm/index-8f8fe5b0.js +0 -32
- package/dist/esm/package-33ac2576.js +0 -3
- package/dist/esm/post-accordion-item-d29c49e5.js +0 -62
- package/dist/esm/post-accordion-item.entry.js +0 -12
- package/dist/esm/post-accordion.entry.js +0 -7
- package/dist/post-components/p-0539071d.js +0 -1
- package/dist/post-components/p-181c73d5.js +0 -1
- package/dist/post-components/p-1ef9415b.js +0 -1
- package/dist/post-components/p-247a1668.js +0 -1
- package/dist/post-components/p-24d0695f.entry.js +0 -1
- package/dist/post-components/p-2e50a07d.entry.js +0 -1
- package/dist/post-components/p-30eb4d87.js +0 -1
- package/dist/post-components/p-440193f4.js +0 -1
- package/dist/post-components/p-46008c18.entry.js +0 -1
- package/dist/post-components/p-47ab2c2b.entry.js +0 -1
- package/dist/post-components/p-4c049de0.entry.js +0 -1
- package/dist/post-components/p-4c4acc32.entry.js +0 -1
- package/dist/post-components/p-5d473fcd.js +0 -1
- package/dist/post-components/p-5d539b30.js +0 -1
- package/dist/post-components/p-6783e509.entry.js +0 -1
- package/dist/post-components/p-6933fb57.entry.js +0 -1
- package/dist/post-components/p-72197a6b.js +0 -1
- package/dist/post-components/p-7709c14a.js +0 -1
- package/dist/post-components/p-77910344.entry.js +0 -1
- package/dist/post-components/p-80e5100e.entry.js +0 -1
- package/dist/post-components/p-84fbf49c.js +0 -1
- package/dist/post-components/p-85fdc2d3.js +0 -1
- package/dist/post-components/p-8c09291c.js +0 -1
- package/dist/post-components/p-93da1a5f.js +0 -1
- package/dist/post-components/p-9b8ee310.entry.js +0 -1
- package/dist/post-components/p-9efb84d3.entry.js +0 -1
- package/dist/post-components/p-9fbf2f82.entry.js +0 -1
- package/dist/post-components/p-a25019de.js +0 -1
- package/dist/post-components/p-a710ee00.js +0 -1
- package/dist/post-components/p-b94e5b4d.entry.js +0 -1
- package/dist/post-components/p-c2348d3d.js +0 -1
- package/dist/post-components/p-c6b03446.entry.js +0 -1
- package/dist/post-components/p-d0dfd5f9.js +0 -1
- package/dist/post-components/p-d45df336.js +0 -1
- package/dist/post-components/p-d4890d50.entry.js +0 -1
- package/dist/post-components/p-d5210531.entry.js +0 -1
- package/dist/post-components/p-dd39c542.entry.js +0 -1
- package/dist/post-components/p-df6c8a4c.js +0 -1
- package/dist/post-components/p-e068a41e.js +0 -1
- package/dist/post-components/p-e585c6fe.js +0 -1
- package/dist/post-components/p-f2c4a48d.js +0 -1
- package/dist/post-components/p-f31b9b5d.entry.js +0 -1
- package/dist/post-components/p-f58252d5.entry.js +0 -1
- package/dist/post-components/p-fda767f0.js +0 -1
- package/dist/types/utils/property-checkers/check-non-empty.d.ts +0 -3
- package/loaders/check-non-empty.js +0 -13
- package/loaders/check-one-of.js +0 -11
- package/loaders/check-type.js +0 -19
- package/loaders/constants.js +0 -3
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { IS_BROWSER } from "../../utils/index";
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
|
+
import { IS_BROWSER, checkEmptyOrOneOf, checkEmptyOrType } from "../../utils/index";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
import { arrow, autoUpdate, computePosition, flip, inline, limitShift, offset, shift, size, } from "@floating-ui/dom";
|
|
5
|
+
import { PLACEMENT_TYPES } from "../../types/index";
|
|
5
6
|
// Polyfill for popovers, can be removed when https://caniuse.com/?search=popover is green
|
|
6
7
|
import { apply, isSupported } from "@oddbird/popover-polyfill/dist/popover-fn.js";
|
|
7
8
|
/**
|
|
@@ -16,6 +17,15 @@ export class PostPopovercontainer {
|
|
|
16
17
|
this.manualClose = false;
|
|
17
18
|
this.safeSpace = undefined;
|
|
18
19
|
}
|
|
20
|
+
validatePlacement() {
|
|
21
|
+
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
22
|
+
}
|
|
23
|
+
validateEdgeGap() {
|
|
24
|
+
checkEmptyOrType(this, 'edgeGap', 'number');
|
|
25
|
+
}
|
|
26
|
+
validateSafeSpace() {
|
|
27
|
+
checkEmptyOrOneOf(this, 'safeSpace', ['triangle', 'trapezoid']);
|
|
28
|
+
}
|
|
19
29
|
/**
|
|
20
30
|
* Updates cursor position for safe space feature when popover is open.
|
|
21
31
|
* Sets CSS custom properties for dynamic styling of safe area.
|
|
@@ -225,9 +235,9 @@ export class PostPopovercontainer {
|
|
|
225
235
|
}
|
|
226
236
|
render() {
|
|
227
237
|
const animationClass = this.animation ? `animate-${this.animation}` : '';
|
|
228
|
-
return (h(Host, { key: '
|
|
238
|
+
return (h(Host, { key: 'c5f30bf3c07bbc6af797368b4951c9a1b5d596ef', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: 'afae0976b169831fe49df860d44cd80fa0ae0b3a', class: animationClass }, this.arrow && (h("span", { key: '08e89fda623b139c1b1fba283a9d508757cd1b3d', class: "arrow", ref: el => {
|
|
229
239
|
this.arrowRef = el;
|
|
230
|
-
} })), h("slot", { key: '
|
|
240
|
+
} })), h("slot", { key: 'fa3f48c319dca350cbd456f2daf8ab5975b99d8f' }))));
|
|
231
241
|
}
|
|
232
242
|
static get is() { return "post-popovercontainer"; }
|
|
233
243
|
static get originalStyleUrls() {
|
|
@@ -460,6 +470,18 @@ export class PostPopovercontainer {
|
|
|
460
470
|
};
|
|
461
471
|
}
|
|
462
472
|
static get elementRef() { return "host"; }
|
|
473
|
+
static get watchers() {
|
|
474
|
+
return [{
|
|
475
|
+
"propName": "placement",
|
|
476
|
+
"methodName": "validatePlacement"
|
|
477
|
+
}, {
|
|
478
|
+
"propName": "edgeGap",
|
|
479
|
+
"methodName": "validateEdgeGap"
|
|
480
|
+
}, {
|
|
481
|
+
"propName": "safeSpace",
|
|
482
|
+
"methodName": "validateSafeSpace"
|
|
483
|
+
}];
|
|
484
|
+
}
|
|
463
485
|
}
|
|
464
486
|
PostPopovercontainer.STATIC_SIDES = {
|
|
465
487
|
top: 'bottom',
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
+
import { checkRequiredAndType } from "../../utils/index";
|
|
3
4
|
export class PostRating {
|
|
5
|
+
validateLabel() {
|
|
6
|
+
checkRequiredAndType(this, 'label', 'string');
|
|
7
|
+
}
|
|
8
|
+
validateStars() {
|
|
9
|
+
checkRequiredAndType(this, 'stars', 'number');
|
|
10
|
+
}
|
|
11
|
+
validateCurrentRating() {
|
|
12
|
+
checkRequiredAndType(this, 'currentRating', 'number');
|
|
13
|
+
}
|
|
14
|
+
componentWillLoad() {
|
|
15
|
+
this.validateLabel();
|
|
16
|
+
this.validateStars();
|
|
17
|
+
this.validateCurrentRating();
|
|
18
|
+
}
|
|
4
19
|
constructor() {
|
|
5
20
|
this.hasChanged = false;
|
|
6
21
|
this.hoveredIndex = undefined;
|
|
@@ -64,7 +79,7 @@ export class PostRating {
|
|
|
64
79
|
}
|
|
65
80
|
}
|
|
66
81
|
render() {
|
|
67
|
-
return (h(Host, { key: '
|
|
82
|
+
return (h(Host, { key: '588c5d3c4600faa939cab4b673e27d08182323da', "data-version": version }, h("div", { key: '8fced4724505cdc2f3fb3160cf276ed1280b5431', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} out of ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
|
|
68
83
|
'star': true,
|
|
69
84
|
'before-hover': i < this.hoveredIndex,
|
|
70
85
|
'active': i < Math.round(this.currentRating),
|
|
@@ -199,4 +214,16 @@ export class PostRating {
|
|
|
199
214
|
}];
|
|
200
215
|
}
|
|
201
216
|
static get elementRef() { return "host"; }
|
|
217
|
+
static get watchers() {
|
|
218
|
+
return [{
|
|
219
|
+
"propName": "label",
|
|
220
|
+
"methodName": "validateLabel"
|
|
221
|
+
}, {
|
|
222
|
+
"propName": "stars",
|
|
223
|
+
"methodName": "validateStars"
|
|
224
|
+
}, {
|
|
225
|
+
"propName": "currentRating",
|
|
226
|
+
"methodName": "validateCurrentRating"
|
|
227
|
+
}];
|
|
228
|
+
}
|
|
202
229
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import {
|
|
3
|
+
import { checkRequiredAndType } from "../../utils/index";
|
|
4
4
|
import { nanoid } from "nanoid";
|
|
5
5
|
/**
|
|
6
6
|
* @slot default - Slot for the content of the tab header.
|
|
@@ -11,13 +11,13 @@ export class PostTabHeader {
|
|
|
11
11
|
this.panel = undefined;
|
|
12
12
|
}
|
|
13
13
|
validateFor() {
|
|
14
|
-
|
|
14
|
+
checkRequiredAndType(this, 'panel', 'string');
|
|
15
15
|
}
|
|
16
16
|
componentWillLoad() {
|
|
17
17
|
this.tabId = `tab-${this.host.id || nanoid(6)}`;
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '829043a1f87aef4e965e3f830cc29eca5ed13864', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: 'c1d6a7d9120b494e898a502eac31341d7fc8d87b' })));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "post-tab-header"; }
|
|
23
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -37,16 +37,11 @@ export class PostTabHeader {
|
|
|
37
37
|
"type": "string",
|
|
38
38
|
"mutable": false,
|
|
39
39
|
"complexType": {
|
|
40
|
-
"original": "
|
|
40
|
+
"original": "string",
|
|
41
41
|
"resolved": "string",
|
|
42
|
-
"references": {
|
|
43
|
-
"HTMLPostTabPanelElement": {
|
|
44
|
-
"location": "global",
|
|
45
|
-
"id": "global::HTMLPostTabPanelElement"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
42
|
+
"references": {}
|
|
48
43
|
},
|
|
49
|
-
"required":
|
|
44
|
+
"required": true,
|
|
50
45
|
"optional": false,
|
|
51
46
|
"docs": {
|
|
52
47
|
"tags": [],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
3
|
import { nanoid } from "nanoid";
|
|
4
|
+
import { checkRequiredAndType } from "../../utils/index";
|
|
4
5
|
/**
|
|
5
6
|
* @slot default - Slot for placing the content of the tab panel.
|
|
6
7
|
*/
|
|
@@ -9,12 +10,16 @@ export class PostTabPanel {
|
|
|
9
10
|
this.panelId = undefined;
|
|
10
11
|
this.name = undefined;
|
|
11
12
|
}
|
|
13
|
+
validateName() {
|
|
14
|
+
checkRequiredAndType(this, 'name', 'string');
|
|
15
|
+
}
|
|
12
16
|
componentWillLoad() {
|
|
17
|
+
this.validateName();
|
|
13
18
|
// get the id set on the host element or use a random id by default
|
|
14
19
|
this.panelId = `panel-${this.host.id || nanoid(6)}`;
|
|
15
20
|
}
|
|
16
21
|
render() {
|
|
17
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: '366d1b6074bf4212e7fc56500680ed12d8d83599', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '940f8dcf9e1302dfdd1c859e356799a2f2c7fe54' })));
|
|
18
23
|
}
|
|
19
24
|
static get is() { return "post-tab-panel"; }
|
|
20
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -38,7 +43,7 @@ export class PostTabPanel {
|
|
|
38
43
|
"resolved": "string",
|
|
39
44
|
"references": {}
|
|
40
45
|
},
|
|
41
|
-
"required":
|
|
46
|
+
"required": true,
|
|
42
47
|
"optional": false,
|
|
43
48
|
"docs": {
|
|
44
49
|
"tags": [],
|
|
@@ -55,4 +60,10 @@ export class PostTabPanel {
|
|
|
55
60
|
};
|
|
56
61
|
}
|
|
57
62
|
static get elementRef() { return "host"; }
|
|
63
|
+
static get watchers() {
|
|
64
|
+
return [{
|
|
65
|
+
"propName": "name",
|
|
66
|
+
"methodName": "validateName"
|
|
67
|
+
}];
|
|
68
|
+
}
|
|
58
69
|
}
|
|
@@ -141,7 +141,7 @@ export class PostTabs {
|
|
|
141
141
|
nextTab.focus();
|
|
142
142
|
}
|
|
143
143
|
render() {
|
|
144
|
-
return (h(Host, { key: '
|
|
144
|
+
return (h(Host, { key: '621652f2abeb8162e2d67261c57000a9d6e7b4ca', "data-version": version }, h("div", { key: '9cf2693b826588d3f099d30157886f70c34aa8b7', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '4d4a0f242a30ec484c4557880b4c184b47d74612', class: "tabs", role: "tablist" }, h("slot", { key: '44df627213090710a6171fae2b1b8698e1f68fa5', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: 'ec23dfe409569899a3b95cf3e2cd6fe2deae8c9b', class: "tab-content", part: "content" }, h("slot", { key: '16374ab8fae907d5d2c7229069dd7511f118c3ac', onSlotchange: () => this.moveMisplacedTabs() }))));
|
|
145
145
|
}
|
|
146
146
|
static get is() { return "post-tabs"; }
|
|
147
147
|
static get encapsulation() { return "shadow"; }
|
|
@@ -171,7 +171,7 @@ export class PostTabs {
|
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
"required": false,
|
|
174
|
-
"optional":
|
|
174
|
+
"optional": true,
|
|
175
175
|
"docs": {
|
|
176
176
|
"tags": [],
|
|
177
177
|
"text": "The name of the panel that is initially shown.\nIf not specified, it defaults to the panel associated with the first tab.\n\n**Changing this value after initialization has no effect.**"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
+
import { checkEmptyOrOneOf, checkEmptyOrType } from "../../utils/index";
|
|
3
4
|
/**
|
|
4
5
|
* @slot default - Content to place in the `default` slot.<p>Markup accepted: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Inline-level_content">inline content</a>.</p>
|
|
5
6
|
*/
|
|
@@ -7,16 +8,21 @@ export class PostTag {
|
|
|
7
8
|
constructor() {
|
|
8
9
|
this.classes = undefined;
|
|
9
10
|
this.variant = undefined;
|
|
10
|
-
this.size =
|
|
11
|
-
this.icon =
|
|
11
|
+
this.size = undefined;
|
|
12
|
+
this.icon = undefined;
|
|
12
13
|
this.setClasses = this.setClasses.bind(this);
|
|
13
14
|
}
|
|
14
15
|
variantChanged() {
|
|
16
|
+
checkEmptyOrOneOf(this, 'variant', ['white', 'info', 'success', 'error', 'warning', 'yellow']);
|
|
15
17
|
this.setClasses();
|
|
16
18
|
}
|
|
17
19
|
sizeChanged() {
|
|
20
|
+
checkEmptyOrOneOf(this, 'size', ['sm']);
|
|
18
21
|
this.setClasses();
|
|
19
22
|
}
|
|
23
|
+
validateName() {
|
|
24
|
+
checkEmptyOrType(this, 'icon', 'string');
|
|
25
|
+
}
|
|
20
26
|
setClasses() {
|
|
21
27
|
this.classes = [
|
|
22
28
|
'tag',
|
|
@@ -26,11 +32,16 @@ export class PostTag {
|
|
|
26
32
|
.filter(c => c !== null)
|
|
27
33
|
.join(' ');
|
|
28
34
|
}
|
|
35
|
+
componentWillLoad() {
|
|
36
|
+
this.validateName();
|
|
37
|
+
this.variantChanged();
|
|
38
|
+
this.sizeChanged();
|
|
39
|
+
}
|
|
29
40
|
connectedCallback() {
|
|
30
41
|
this.setClasses();
|
|
31
42
|
}
|
|
32
43
|
render() {
|
|
33
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: '42743d0a7f87680223eef33ff9295827f3c80d4c', "data-version": version }, h("div", { key: '392ad72b23f638d7fdefe7acb20f45c9dcf2d630', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: '71b7dc696dd392dc9b195b363cd79a1fc0e0a708', class: "tag-text" }, h("slot", { key: '91610aff7550df9891fb617d2d9e5bcbcffbe256' })))));
|
|
34
45
|
}
|
|
35
46
|
static get is() { return "post-tag"; }
|
|
36
47
|
static get encapsulation() { return "shadow"; }
|
|
@@ -55,7 +66,7 @@ export class PostTag {
|
|
|
55
66
|
"references": {}
|
|
56
67
|
},
|
|
57
68
|
"required": false,
|
|
58
|
-
"optional":
|
|
69
|
+
"optional": true,
|
|
59
70
|
"docs": {
|
|
60
71
|
"tags": [],
|
|
61
72
|
"text": "Defines the color variant of the component."
|
|
@@ -67,25 +78,24 @@ export class PostTag {
|
|
|
67
78
|
"type": "string",
|
|
68
79
|
"mutable": false,
|
|
69
80
|
"complexType": {
|
|
70
|
-
"original": "
|
|
81
|
+
"original": "'sm'",
|
|
71
82
|
"resolved": "\"sm\"",
|
|
72
83
|
"references": {}
|
|
73
84
|
},
|
|
74
85
|
"required": false,
|
|
75
|
-
"optional":
|
|
86
|
+
"optional": true,
|
|
76
87
|
"docs": {
|
|
77
88
|
"tags": [],
|
|
78
89
|
"text": "Defines the size of the component."
|
|
79
90
|
},
|
|
80
91
|
"attribute": "size",
|
|
81
|
-
"reflect": false
|
|
82
|
-
"defaultValue": "null"
|
|
92
|
+
"reflect": false
|
|
83
93
|
},
|
|
84
94
|
"icon": {
|
|
85
95
|
"type": "string",
|
|
86
96
|
"mutable": false,
|
|
87
97
|
"complexType": {
|
|
88
|
-
"original": "
|
|
98
|
+
"original": "string",
|
|
89
99
|
"resolved": "string",
|
|
90
100
|
"references": {}
|
|
91
101
|
},
|
|
@@ -96,8 +106,7 @@ export class PostTag {
|
|
|
96
106
|
"text": "Defines the icon `name` inside of the component.\n<span className=\"banner banner-sm banner-info\">If not set the icon will not show up.</span>\nTo learn which icons are available, please visit our <a href=\"/?path=/docs/0dcfe3c0-bfc0-4107-b43b-7e9d825b805f--docs\">icon library</a>."
|
|
97
107
|
},
|
|
98
108
|
"attribute": "icon",
|
|
99
|
-
"reflect": false
|
|
100
|
-
"defaultValue": "null"
|
|
109
|
+
"reflect": false
|
|
101
110
|
}
|
|
102
111
|
};
|
|
103
112
|
}
|
|
@@ -114,6 +123,9 @@ export class PostTag {
|
|
|
114
123
|
}, {
|
|
115
124
|
"propName": "size",
|
|
116
125
|
"methodName": "sizeChanged"
|
|
126
|
+
}, {
|
|
127
|
+
"propName": "icon",
|
|
128
|
+
"methodName": "validateName"
|
|
117
129
|
}];
|
|
118
130
|
}
|
|
119
131
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import { checkType } from "../../utils/index";
|
|
4
3
|
/**
|
|
5
4
|
* @slot default - Slot for the content of the button.
|
|
6
5
|
*/
|
|
@@ -18,17 +17,13 @@ export class PostTogglebutton {
|
|
|
18
17
|
};
|
|
19
18
|
this.toggled = false;
|
|
20
19
|
}
|
|
21
|
-
validateToggled() {
|
|
22
|
-
checkType(this, 'toggled', 'boolean');
|
|
23
|
-
}
|
|
24
20
|
componentWillLoad() {
|
|
25
|
-
this.validateToggled();
|
|
26
21
|
// add event listener to not override listener that might be set on the host
|
|
27
22
|
this.host.addEventListener('click', () => this.handleClick());
|
|
28
23
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
29
24
|
}
|
|
30
25
|
render() {
|
|
31
|
-
return (h(Host, { key: '
|
|
26
|
+
return (h(Host, { key: '1025fb988460e85c92e49241889363e1bcc840eb', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '20d3eb9415685fb9a00a5613474c432f6638692e' })));
|
|
32
27
|
}
|
|
33
28
|
static get is() { return "post-togglebutton"; }
|
|
34
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -65,10 +60,4 @@ export class PostTogglebutton {
|
|
|
65
60
|
};
|
|
66
61
|
}
|
|
67
62
|
static get elementRef() { return "host"; }
|
|
68
|
-
static get watchers() {
|
|
69
|
-
return [{
|
|
70
|
-
"propName": "toggled",
|
|
71
|
-
"methodName": "validateToggled"
|
|
72
|
-
}];
|
|
73
|
-
}
|
|
74
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{display:none}:host([open]){display:
|
|
1
|
+
:host{display:none}:host([open]){display:contents}post-popovercontainer[arrow]::after{position:absolute;content:"";inset:-13px;z-index:-1}post-popovercontainer>div{padding:var(--post-core-dimension-4) var(--post-core-dimension-8);max-width:280px;min-height:32px;word-wrap:break-word;white-space:normal}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import {
|
|
3
|
+
import { checkEmptyOrOneOf } from "../../utils/index";
|
|
4
|
+
import { PLACEMENT_TYPES } from "../../types/index";
|
|
4
5
|
export class PostTooltip {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.placement = 'top';
|
|
7
8
|
this.arrow = false;
|
|
8
|
-
this.animation =
|
|
9
|
+
this.animation = undefined;
|
|
9
10
|
this.open = false;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
validatePlacement() {
|
|
13
|
+
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
this.
|
|
15
|
+
componentWillLoad() {
|
|
16
|
+
this.validatePlacement();
|
|
16
17
|
}
|
|
17
18
|
componentDidLoad() {
|
|
18
19
|
if (!this.host.id) {
|
|
@@ -53,7 +54,7 @@ export class PostTooltip {
|
|
|
53
54
|
}
|
|
54
55
|
render() {
|
|
55
56
|
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
56
|
-
return (h(Host, { key: '
|
|
57
|
+
return (h(Host, { key: '1e1d3f4e204b42c8202af63bd7dec12de3c8e16a', "data-version": version, role: "tooltip" }, h("post-popovercontainer", { key: 'e410952b4e75915e51d57eec2dbecce2b5d55733', safeSpace: "trapezoid", class: popoverClass, arrow: this.arrow, animation: this.animation, placement: this.placement, onPostToggle: e => this.handleToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '494e3136dbe96cf611a41753711efb03cab30a12' }))));
|
|
57
58
|
}
|
|
58
59
|
static get is() { return "post-tooltip"; }
|
|
59
60
|
static get encapsulation() { return "shadow"; }
|
|
@@ -115,7 +116,7 @@ export class PostTooltip {
|
|
|
115
116
|
"type": "string",
|
|
116
117
|
"mutable": false,
|
|
117
118
|
"complexType": {
|
|
118
|
-
"original": "'pop-in'
|
|
119
|
+
"original": "'pop-in'",
|
|
119
120
|
"resolved": "\"pop-in\"",
|
|
120
121
|
"references": {}
|
|
121
122
|
},
|
|
@@ -126,8 +127,7 @@ export class PostTooltip {
|
|
|
126
127
|
"text": "Choose a tooltip animation"
|
|
127
128
|
},
|
|
128
129
|
"attribute": "animation",
|
|
129
|
-
"reflect": false
|
|
130
|
-
"defaultValue": "null"
|
|
130
|
+
"reflect": false
|
|
131
131
|
},
|
|
132
132
|
"open": {
|
|
133
133
|
"type": "boolean",
|
|
@@ -236,8 +236,8 @@ export class PostTooltip {
|
|
|
236
236
|
static get elementRef() { return "host"; }
|
|
237
237
|
static get watchers() {
|
|
238
238
|
return [{
|
|
239
|
-
"propName": "
|
|
240
|
-
"methodName": "
|
|
239
|
+
"propName": "placement",
|
|
240
|
+
"methodName": "validatePlacement"
|
|
241
241
|
}];
|
|
242
242
|
}
|
|
243
243
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { checkEmptyOrType, IS_BROWSER } from "../../utils/index";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
import isFocusable from "ally.js/is/focusable";
|
|
5
5
|
const TRIGGER_EVENTS = ['pointerenter', 'pointerleave', 'focusin', 'focusout', 'long-press'];
|
|
@@ -27,15 +27,13 @@ export class PostTooltipTrigger {
|
|
|
27
27
|
this.boundTooltipHandler = this.handleTooltipEvent.bind(this);
|
|
28
28
|
}
|
|
29
29
|
validateControlFor() {
|
|
30
|
-
|
|
30
|
+
checkEmptyOrType(this, 'for', 'string');
|
|
31
31
|
}
|
|
32
32
|
get tooltip() {
|
|
33
33
|
if (!IS_BROWSER)
|
|
34
34
|
return null;
|
|
35
35
|
const ref = document.getElementById(this.for);
|
|
36
|
-
return ref?.localName === 'post-tooltip'
|
|
37
|
-
? ref
|
|
38
|
-
: null;
|
|
36
|
+
return ref?.localName === 'post-tooltip' ? ref : null;
|
|
39
37
|
}
|
|
40
38
|
componentDidLoad() {
|
|
41
39
|
this.setupTrigger();
|
|
@@ -143,7 +141,7 @@ export class PostTooltipTrigger {
|
|
|
143
141
|
handleLeave(event) {
|
|
144
142
|
const newTarget = event.relatedTarget;
|
|
145
143
|
if ((this.tooltip && newTarget && this.tooltip.contains(newTarget)) ||
|
|
146
|
-
|
|
144
|
+
newTarget === this.trigger) {
|
|
147
145
|
return;
|
|
148
146
|
}
|
|
149
147
|
this.interestLostHandler();
|
|
@@ -167,7 +165,7 @@ export class PostTooltipTrigger {
|
|
|
167
165
|
this.tooltip?.hide();
|
|
168
166
|
}
|
|
169
167
|
render() {
|
|
170
|
-
return (h(Host, { key: '
|
|
168
|
+
return (h(Host, { key: '26ac11df6c2961e3dd51722f6981185db17c6efb', "data-version": version }, h("slot", { key: 'd08036f40d0a6708b8614232134b0d5b4eba4b78', onSlotchange: () => this.handleSlotChange() })));
|
|
171
169
|
}
|
|
172
170
|
static get is() { return "post-tooltip-trigger"; }
|
|
173
171
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export function checkOneOf(component, prop, possibleValues
|
|
1
|
+
export function checkOneOf(component, prop, possibleValues) {
|
|
2
2
|
const componentName = component.host.localName;
|
|
3
3
|
const value = component[prop];
|
|
4
|
-
const
|
|
5
|
-
const message = customMessage || defaultMessage;
|
|
4
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
|
|
6
5
|
if (!possibleValues.includes(value)) {
|
|
7
|
-
|
|
6
|
+
console.error(message);
|
|
8
7
|
}
|
|
9
8
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export function checkPattern(component, prop, pattern
|
|
1
|
+
export function checkPattern(component, prop, pattern) {
|
|
2
2
|
const componentName = component.host.localName;
|
|
3
3
|
const value = component[prop];
|
|
4
|
-
const
|
|
5
|
-
const message = customMessage || defaultMessage;
|
|
4
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must follow the format \`${pattern}\`.`;
|
|
6
5
|
if (typeof value !== 'string' || !pattern.test(value)) {
|
|
7
|
-
|
|
6
|
+
console.error(message);
|
|
8
7
|
}
|
|
9
8
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
export function checkType(component, prop, type
|
|
1
|
+
export function checkType(component, prop, type) {
|
|
2
2
|
const componentName = component.host.localName;
|
|
3
3
|
const value = component[prop];
|
|
4
4
|
const typeIsArray = type === 'array';
|
|
5
5
|
const valueIsArray = Array.isArray(value);
|
|
6
|
-
const
|
|
7
|
-
${type}\`.`;
|
|
8
|
-
const message = customMessage || defaultMessage;
|
|
6
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`${type}\`.`;
|
|
9
7
|
if (typeIsArray || valueIsArray) {
|
|
10
8
|
if (valueIsArray !== typeIsArray) {
|
|
11
|
-
|
|
9
|
+
console.error(message);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
14
12
|
else if (typeof value !== type) {
|
|
15
|
-
|
|
13
|
+
console.error(message);
|
|
16
14
|
}
|
|
17
15
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export function checkUrl(component, prop
|
|
1
|
+
export function checkUrl(component, prop) {
|
|
2
2
|
const componentName = component.host.localName;
|
|
3
3
|
const value = component[prop];
|
|
4
|
-
const
|
|
5
|
-
const message = customMessage || defaultMessage;
|
|
4
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
|
|
6
5
|
if (typeof value !== 'string' && !(value instanceof URL)) {
|
|
7
|
-
|
|
6
|
+
console.error(message);
|
|
7
|
+
return;
|
|
8
8
|
}
|
|
9
9
|
try {
|
|
10
10
|
new URL(value, 'https://www.post.ch');
|
|
11
11
|
}
|
|
12
12
|
catch {
|
|
13
|
-
|
|
13
|
+
console.error(message);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const EMPTY_VALUES = [undefined, null, ''];
|
|
1
|
+
export const EMPTY_VALUES = [undefined, null, '', NaN];
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isValueEmpty } from "../is-value-empty";
|
|
2
2
|
export function emptyOr(check) {
|
|
3
|
-
return (...
|
|
4
|
-
const component = args[0];
|
|
5
|
-
const prop = args[1];
|
|
3
|
+
return (component, prop, ...extraArgs) => {
|
|
6
4
|
const value = component[prop];
|
|
7
|
-
if (!
|
|
8
|
-
check(...
|
|
5
|
+
if (!isValueEmpty(value)) {
|
|
6
|
+
check(component, prop, ...extraArgs);
|
|
9
7
|
}
|
|
10
8
|
};
|
|
11
9
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { requiredAnd } from "./required-and";
|
|
2
2
|
import { checkOneOf } from "./check-one-of";
|
|
3
3
|
import { checkPattern } from "./check-pattern";
|
|
4
4
|
import { checkType } from "./check-type";
|
|
5
5
|
import { checkUrl } from "./check-url";
|
|
6
|
+
import { emptyOr } from "./empty-or";
|
|
6
7
|
export const checkEmptyOrOneOf = emptyOr(checkOneOf);
|
|
7
8
|
export const checkEmptyOrPattern = emptyOr(checkPattern);
|
|
8
9
|
export const checkEmptyOrType = emptyOr(checkType);
|
|
9
10
|
export const checkEmptyOrUrl = emptyOr(checkUrl);
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export * from './check-url';
|
|
11
|
+
export const checkRequiredAndOneOf = requiredAnd(checkOneOf);
|
|
12
|
+
export const checkRequiredAndPattern = requiredAnd(checkPattern);
|
|
13
|
+
export const checkRequiredAndType = requiredAnd(checkType);
|
|
14
|
+
export const checkRequiredAndUrl = requiredAnd(checkUrl);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isValueEmpty } from "../is-value-empty";
|
|
2
|
+
export function requiredAnd(check) {
|
|
3
|
+
return (component, prop, ...extraArgs) => {
|
|
4
|
+
const componentName = component.host.localName;
|
|
5
|
+
const value = component[prop];
|
|
6
|
+
const message = `The prop \`${String(prop)}\` of the \`${componentName}\` component is not defined.`;
|
|
7
|
+
if (isValueEmpty(value)) {
|
|
8
|
+
throw new Error(message);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
check(component, prop, ...extraArgs);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|