@swisspost/design-system-components 10.0.0-next.75 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{create-validator-decorator-Bimhl6Ib.js → create-validator-decorator-4dRrOF30.js} +1 -1
- package/dist/cjs/{index-CyeY2muT.js → index-BqngpwGa.js} +11 -15
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{one-of-BVQP1dR3.js → one-of-D1veqtsm.js} +1 -1
- package/dist/cjs/{package-JSyXVavg.js → package-Bwdl-T-w.js} +1 -1
- package/dist/cjs/{pattern-BDKu8-v6.js → pattern-B7VKOu5m.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +10 -12
- package/dist/cjs/post-autocomplete.cjs.entry.js +6 -6
- package/dist/cjs/post-avatar.cjs.entry.js +7 -7
- package/dist/cjs/post-back-to-top.cjs.entry.js +6 -6
- package/dist/cjs/post-banner.cjs.entry.js +5 -5
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +7 -7
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +7 -7
- package/dist/cjs/post-closebutton_14.cjs.entry.js +41 -35
- package/dist/cjs/post-collapsible_2.cjs.entry.js +6 -6
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +427 -257
- package/dist/cjs/post-footer.cjs.entry.js +6 -6
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
- package/dist/cjs/post-listbox.cjs.entry.js +3 -3
- package/dist/cjs/post-number-input.cjs.entry.js +5 -4
- package/dist/cjs/post-pagination.cjs.entry.js +5 -5
- package/dist/cjs/post-popover-trigger.cjs.entry.js +5 -5
- package/dist/cjs/post-popover.cjs.entry.js +11 -12
- package/dist/cjs/post-progressbar.cjs.entry.js +4 -4
- package/dist/cjs/post-rating.cjs.entry.js +6 -6
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +7 -7
- package/dist/cjs/post-side-navigation.cjs.entry.js +18 -7
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +7 -7
- package/dist/cjs/post-tab-item.cjs.entry.js +15 -14
- package/dist/cjs/post-tab-panel.cjs.entry.js +6 -6
- package/dist/cjs/post-tabs.cjs.entry.js +196 -74
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -9
- package/dist/cjs/post-tooltip.cjs.entry.js +9 -10
- package/dist/cjs/{required-BsZuSJAl.js → required-Bkz8MOYa.js} +1 -1
- package/dist/cjs/{type-DXpEWY0w.js → type-D8eD1JMd.js} +1 -1
- package/dist/cjs/{url-D-EbWRlF.js → url-C7MnIIZ_.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/post-accordion/post-accordion.js +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +4 -36
- package/dist/collection/components/post-autocomplete/post-autocomplete.js +1 -1
- package/dist/collection/components/post-avatar/post-avatar.js +1 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
- package/dist/collection/components/post-banner/post-banner.js +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +1 -1
- 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 +1 -1
- package/dist/collection/components/post-date-picker/accessibility-utils.js +59 -0
- package/dist/collection/components/post-date-picker/date-utils.js +102 -0
- package/dist/collection/components/post-date-picker/native-mask-element.js +36 -0
- package/dist/collection/components/post-date-picker/post-date-picker.css +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +224 -301
- package/dist/collection/components/post-footer/post-footer.js +1 -1
- package/dist/collection/components/post-header/post-header.js +6 -5
- package/dist/collection/components/post-icon/post-icon.js +1 -1
- package/dist/collection/components/post-language-menu/post-language-menu.js +7 -5
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-listbox/post-listbox.js +1 -1
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
- package/dist/collection/components/post-logo/post-logo.js +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.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +9 -12
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-number-input/post-number-input.js +3 -2
- package/dist/collection/components/post-popover/post-popover.js +12 -22
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +13 -9
- package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.css +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.js +38 -2
- package/dist/collection/components/post-side-navigation/side-navigation-styles.js +1 -0
- package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.css +1 -1
- package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +1 -1
- package/dist/collection/components/post-stepper/post-stepper.js +1 -1
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.js +36 -19
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +3 -2
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +255 -84
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +12 -22
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +2 -4
- package/dist/collection/types/element-api.js +3 -0
- package/dist/component-names.json +0 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +1 -1
- package/dist/components/post-accordion2.js +1 -1
- package/dist/components/post-autocomplete.js +1 -1
- package/dist/components/post-avatar.js +1 -1
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.js +1 -1
- package/dist/components/post-breadcrumbs.js +1 -1
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +1 -1
- package/dist/components/post-collapsible2.js +1 -1
- package/dist/components/post-date-picker.js +1 -1
- package/dist/components/post-footer.js +1 -1
- package/dist/components/post-header.js +1 -1
- package/dist/components/post-icon2.js +1 -1
- package/dist/components/post-language-menu.js +1 -1
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-listbox-option.js +1 -1
- package/dist/components/post-listbox.js +1 -1
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-popover-trigger.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer2.js +1 -1
- package/dist/components/post-progressbar.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-side-navigation-trigger.js +1 -1
- package/dist/components/post-side-navigation.js +1 -1
- package/dist/components/post-stepper-item.js +1 -1
- package/dist/components/post-stepper.js +1 -1
- package/dist/components/post-tab-item.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton2.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/components/react/index.js +1 -1
- package/dist/components/react/{p-DNddZV_h.js → p-Auha71WU.js} +1 -1
- package/dist/components/react/{p-ztiqEfbC.js → p-Bpwt-eYO.js} +1 -1
- package/dist/components/react/p-C6wtG9yO.js +1 -0
- package/dist/components/react/{p-DU4XzTGt.js → p-C7jOKUzv.js} +1 -1
- package/dist/components/react/{p-CbU3QFNG.js → p-Cjo8Ke7t.js} +1 -1
- package/dist/components/react/{p-BUAS73l8.js → p-ClF2qF9A.js} +1 -1
- package/dist/components/react/{p-BUSQG9af.js → p-CyNGpewj.js} +1 -1
- package/dist/components/react/{p-DTg2SXJj.js → p-DvVypwYO.js} +1 -1
- package/dist/components/react/p-SEWFpJgA.js +1 -0
- package/dist/components/react/p-bAeGAkWL.js +1 -0
- package/dist/components/react/{p-B3ZJPCU0.js → p-i1ZFHprG.js} +1 -1
- package/dist/components/react/p-znfTjqEZ.js +1 -0
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-autocomplete.js +1 -1
- package/dist/components/react/post-avatar.js +1 -1
- package/dist/components/react/post-back-to-top.js +1 -1
- package/dist/components/react/post-banner.js +1 -1
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +1 -1
- package/dist/components/react/post-closebutton.js +1 -1
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/post-date-picker.js +1 -1
- package/dist/components/react/post-footer.js +1 -1
- package/dist/components/react/post-header.js +1 -1
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-menu-item.js +1 -1
- package/dist/components/react/post-language-menu.js +1 -1
- package/dist/components/react/post-linkarea.js +1 -1
- package/dist/components/react/post-listbox-option.js +1 -1
- package/dist/components/react/post-listbox.js +1 -1
- package/dist/components/react/post-logo.js +1 -1
- package/dist/components/react/post-mainnavigation.js +1 -1
- package/dist/components/react/post-megadropdown-trigger.js +1 -1
- package/dist/components/react/post-megadropdown.js +1 -1
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-number-input.js +1 -1
- package/dist/components/react/post-pagination.js +1 -1
- package/dist/components/react/post-popover-trigger.js +1 -1
- package/dist/components/react/post-popover.js +1 -1
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-progressbar.js +1 -1
- package/dist/components/react/post-rating.js +1 -1
- package/dist/components/react/post-side-navigation-trigger.js +1 -1
- package/dist/components/react/post-side-navigation.js +1 -1
- package/dist/components/react/post-stepper-item.js +1 -1
- package/dist/components/react/post-stepper.js +1 -1
- package/dist/components/react/post-tab-item.js +1 -1
- package/dist/components/react/post-tab-panel.js +1 -1
- package/dist/components/react/post-tabs.js +1 -1
- package/dist/components/react/post-togglebutton.js +1 -1
- package/dist/components/react/post-tooltip-trigger.js +1 -1
- package/dist/components/react/post-tooltip.js +1 -1
- package/dist/docs.json +287 -473
- package/dist/esm/{create-validator-decorator-BNkS_yAb.js → create-validator-decorator-CYYTw0AS.js} +1 -1
- package/dist/esm/{index-BGeKgZqi.js → index-DE1aWdqx.js} +11 -15
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{one-of-4BD_5pKR.js → one-of-Ug1_Xoes.js} +1 -1
- package/dist/esm/package-SEWFpJgA.js +3 -0
- package/dist/esm/{pattern-D7tnGo1u.js → pattern-WLk4tOqI.js} +1 -1
- package/dist/esm/post-accordion_2.entry.js +10 -12
- package/dist/esm/post-autocomplete.entry.js +6 -6
- package/dist/esm/post-avatar.entry.js +7 -7
- package/dist/esm/post-back-to-top.entry.js +6 -6
- package/dist/esm/post-banner.entry.js +5 -5
- package/dist/esm/post-breadcrumb-item.entry.js +7 -7
- package/dist/esm/post-breadcrumbs.entry.js +7 -7
- package/dist/esm/post-closebutton_14.entry.js +41 -35
- package/dist/esm/post-collapsible_2.entry.js +6 -6
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +427 -257
- package/dist/esm/post-footer.entry.js +6 -6
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-listbox-option.entry.js +4 -4
- package/dist/esm/post-listbox.entry.js +3 -3
- package/dist/esm/post-number-input.entry.js +5 -4
- package/dist/esm/post-pagination.entry.js +5 -5
- package/dist/esm/post-popover-trigger.entry.js +5 -5
- package/dist/esm/post-popover.entry.js +11 -12
- package/dist/esm/post-progressbar.entry.js +4 -4
- package/dist/esm/post-rating.entry.js +6 -6
- package/dist/esm/post-side-navigation-trigger.entry.js +7 -7
- package/dist/esm/post-side-navigation.entry.js +18 -7
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +7 -7
- package/dist/esm/post-tab-item.entry.js +15 -14
- package/dist/esm/post-tab-panel.entry.js +6 -6
- package/dist/esm/post-tabs.entry.js +196 -74
- package/dist/esm/post-tooltip-trigger.entry.js +7 -9
- package/dist/esm/post-tooltip.entry.js +9 -10
- package/dist/esm/{required-DhBxDSbP.js → required-DeOhRbtk.js} +1 -1
- package/dist/esm/{type-icZlikjf.js → type-S-4aPMGU.js} +1 -1
- package/dist/esm/{url-B_2x2YCy.js → url-C8KSrmWc.js} +1 -1
- package/dist/post-components/{p-aff9dd5e.entry.js → p-01b5539a.entry.js} +1 -1
- package/dist/post-components/{p-0a08ae23.entry.js → p-04e29502.entry.js} +1 -1
- package/dist/post-components/p-0b7f4169.entry.js +1 -0
- package/dist/post-components/p-13e1fdbd.entry.js +1 -0
- package/dist/post-components/{p-84c8d952.entry.js → p-1edcfc9e.entry.js} +1 -1
- package/dist/post-components/{p-15fa7e60.entry.js → p-21c83ccd.entry.js} +1 -1
- package/dist/post-components/{p-9ec32e7b.entry.js → p-261e2ffa.entry.js} +1 -1
- package/dist/post-components/{p-fac58cbd.entry.js → p-360d6bf1.entry.js} +1 -1
- package/dist/post-components/{p-D2ex14Ye.js → p-4-_BhJWV.js} +1 -1
- package/dist/post-components/{p-eca119d2.entry.js → p-44461143.entry.js} +1 -1
- package/dist/post-components/p-52e7344c.entry.js +1 -0
- package/dist/post-components/p-6d4be9dd.entry.js +1 -0
- package/dist/post-components/p-6dbe7870.entry.js +1 -0
- package/dist/post-components/{p-97c1f070.entry.js → p-751a949d.entry.js} +1 -1
- package/dist/post-components/{p-e54a6be0.entry.js → p-8e2427d4.entry.js} +1 -1
- package/dist/post-components/{p-3e83aa1f.entry.js → p-8fbbc68f.entry.js} +1 -1
- package/dist/post-components/{p-41b5dbfc.entry.js → p-91948813.entry.js} +1 -1
- package/dist/post-components/p-94064d19.entry.js +1 -0
- package/dist/post-components/{p-6cbb2e7f.entry.js → p-95ad4d06.entry.js} +1 -1
- package/dist/post-components/p-978e4664.entry.js +1 -0
- package/dist/post-components/p-B6uZASBE.js +1 -0
- package/dist/post-components/{p-CIbyqT6u.js → p-BDW1XHCO.js} +1 -1
- package/dist/post-components/p-CiOyV6Mo.js +1 -0
- package/dist/post-components/p-DE1aWdqx.js +2 -0
- package/dist/post-components/{p-8SvFxSp6.js → p-DMiERazc.js} +1 -1
- package/dist/post-components/{p-DH5JdN6V.js → p-NPUljV0P.js} +1 -1
- package/dist/post-components/p-SEWFpJgA.js +1 -0
- package/dist/post-components/{p-923439d1.entry.js → p-b7d6c951.entry.js} +1 -1
- package/dist/post-components/p-c152efb7.entry.js +1 -0
- package/dist/post-components/p-c9461efa.entry.js +1 -0
- package/dist/post-components/p-ddc585e6.entry.js +1 -0
- package/dist/post-components/{p-7ee4b829.entry.js → p-e5172886.entry.js} +1 -1
- package/dist/post-components/{p-9e240299.entry.js → p-e9484492.entry.js} +1 -1
- package/dist/post-components/p-ee1309c9.entry.js +1 -0
- package/dist/post-components/p-f1602e56.entry.js +1 -0
- package/dist/post-components/{p-5d20cbcb.entry.js → p-f1bf80d4.entry.js} +1 -1
- package/dist/post-components/p-fedcbf2d.entry.js +1 -0
- package/dist/post-components/post-components.css +2 -2
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +0 -8
- package/dist/types/components/post-date-picker/accessibility-utils.d.ts +19 -0
- package/dist/types/components/post-date-picker/date-utils.d.ts +48 -0
- package/dist/types/components/post-date-picker/native-mask-element.d.ts +12 -0
- package/dist/types/components/post-date-picker/post-date-picker.d.ts +23 -62
- package/dist/types/components/post-header/post-header.d.ts +2 -1
- package/dist/types/components/post-language-menu/post-language-menu.d.ts +2 -1
- package/dist/types/components/post-menu/post-menu.d.ts +4 -4
- package/dist/types/components/post-popover/post-popover.d.ts +4 -5
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +2 -2
- package/dist/types/components/post-side-navigation/post-side-navigation.d.ts +6 -0
- package/dist/types/components/post-side-navigation/side-navigation-styles.d.ts +2 -0
- package/dist/types/components/post-tab-item/post-tab-item.d.ts +8 -4
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +1 -1
- package/dist/types/components/post-tabs/post-tabs.d.ts +37 -17
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +4 -5
- package/dist/types/components.d.ts +90 -164
- package/dist/types/types/element-api.d.ts +3 -0
- package/hydrate/index.js +812 -596
- package/hydrate/index.mjs +812 -596
- package/package.json +11 -12
- package/dist/cjs/long-press-event-Dx21Ojod.js +0 -276
- package/dist/cjs/post-login-widget.cjs.entry.js +0 -92
- package/dist/collection/components/post-accordion-item/heading-levels.js +0 -1
- package/dist/collection/components/post-login-widget/post-login-widget.css +0 -1
- package/dist/collection/components/post-login-widget/post-login-widget.js +0 -218
- package/dist/collection/components/post-tab-item/post-tab-item.css +0 -1
- package/dist/components/long-press-event.js +0 -8
- package/dist/components/post-avatar2.js +0 -1
- package/dist/components/post-login-widget.d.ts +0 -11
- package/dist/components/post-login-widget.js +0 -1
- package/dist/components/react/p-BNgqqRsB.js +0 -8
- package/dist/components/react/p-C7aYEQh5.js +0 -1
- package/dist/components/react/p-CdhbouMD.js +0 -1
- package/dist/components/react/p-Ci08Eesw.js +0 -1
- package/dist/components/react/p-DWlDkwjY.js +0 -1
- package/dist/components/react/p-wqJxIo5L.js +0 -1
- package/dist/components/react/post-login-widget.d.ts +0 -11
- package/dist/components/react/post-login-widget.js +0 -1
- package/dist/esm/long-press-event-BNgqqRsB.js +0 -274
- package/dist/esm/package-CdhbouMD.js +0 -3
- package/dist/esm/post-login-widget.entry.js +0 -90
- package/dist/post-components/p-001f58d8.entry.js +0 -1
- package/dist/post-components/p-12c8b073.entry.js +0 -1
- package/dist/post-components/p-1839276a.entry.js +0 -1
- package/dist/post-components/p-28eeb5d8.entry.js +0 -1
- package/dist/post-components/p-6a1c4897.entry.js +0 -1
- package/dist/post-components/p-6d14f78a.entry.js +0 -1
- package/dist/post-components/p-6e8b6249.entry.js +0 -1
- package/dist/post-components/p-71918d59.entry.js +0 -1
- package/dist/post-components/p-8139b0cc.entry.js +0 -1
- package/dist/post-components/p-87ebb213.entry.js +0 -1
- package/dist/post-components/p-89da6378.entry.js +0 -1
- package/dist/post-components/p-8caaa149.entry.js +0 -1
- package/dist/post-components/p-BGeKgZqi.js +0 -2
- package/dist/post-components/p-BNgqqRsB.js +0 -8
- package/dist/post-components/p-CdhbouMD.js +0 -1
- package/dist/post-components/p-DiBqDD4N.js +0 -1
- package/dist/post-components/p-I6rSjhbA.js +0 -1
- package/dist/post-components/p-c905a97c.entry.js +0 -1
- package/dist/post-components/p-f9529d40.entry.js +0 -1
- package/dist/types/components/post-accordion-item/heading-levels.d.ts +0 -2
- package/dist/types/components/post-login-widget/post-login-widget.d.ts +0 -45
|
@@ -9,25 +9,48 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
9
9
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
10
|
};
|
|
11
11
|
import { fade } from "../../animations/index";
|
|
12
|
-
import { componentOnReady, Type } from "../../utils/index";
|
|
12
|
+
import { componentOnReady, OneOf, Type } from "../../utils/index";
|
|
13
13
|
import { version } from "../../../../package";
|
|
14
|
-
import { h, Host, } from "@stencil/core";
|
|
14
|
+
import { Build, h, Host, } from "@stencil/core";
|
|
15
15
|
/**
|
|
16
16
|
* @slot default - Slot for placing tab items. Each tab item should be a <post-tab-item> element.
|
|
17
17
|
* @slot panels - Slot for placing tab panels. Each tab panel should be a <post-tab-panel> element.
|
|
18
18
|
* @part post-tabs - The container element that holds the set of tabs.
|
|
19
|
-
* @part post-tabs-content - The container element that displays the content of the currently active tab. Only available in
|
|
19
|
+
* @part post-tabs-content - The container element that displays the content of the currently active tab. Only available in Content variant.
|
|
20
20
|
*/
|
|
21
21
|
export class PostTabs {
|
|
22
22
|
constructor() {
|
|
23
|
+
this.showing = null;
|
|
24
|
+
this.hiding = null;
|
|
23
25
|
this.isLoaded = false;
|
|
24
|
-
this.
|
|
26
|
+
this.isPagesVariant = false;
|
|
27
|
+
this.showLeftScrollButton = false;
|
|
28
|
+
this.showRightScrollButton = false;
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
27
|
-
* Changing this value after initialization has no effect.
|
|
28
|
-
* full width of the screen, from edge to edge.
|
|
30
|
+
* An accessible label for the "previous tab items" button.
|
|
29
31
|
*/
|
|
30
|
-
this.
|
|
32
|
+
this.textPrevTabItems = 'Previous tab items';
|
|
33
|
+
/**
|
|
34
|
+
* An accessible label for the "next tab items" button.
|
|
35
|
+
*/
|
|
36
|
+
this.textNextTabItems = 'Next tab items';
|
|
37
|
+
/**
|
|
38
|
+
* The size of the tabs, corresponding to the different designs in Figma.
|
|
39
|
+
* Default is 'large'.
|
|
40
|
+
*/
|
|
41
|
+
this.size = 'large';
|
|
42
|
+
// Handles the visibility of scroll buttons based on the scroll position of the tabs container
|
|
43
|
+
this.updateScrollButtons = () => {
|
|
44
|
+
if (!this.tabsContainer)
|
|
45
|
+
return;
|
|
46
|
+
const style = getComputedStyle(this.tabsContainer);
|
|
47
|
+
const paddingStart = Number.parseFloat(style.paddingInlineStart) || 0;
|
|
48
|
+
const paddingEnd = Number.parseFloat(style.paddingInlineEnd) || 0;
|
|
49
|
+
const contentWidth = this.tabsContainer.clientWidth - paddingStart - paddingEnd;
|
|
50
|
+
const scrollableWidth = this.tabsContainer.scrollWidth - paddingStart - paddingEnd;
|
|
51
|
+
this.showLeftScrollButton = this.tabsContainer.scrollLeft > 0;
|
|
52
|
+
this.showRightScrollButton = this.tabsContainer.scrollLeft + contentWidth < scrollableWidth;
|
|
53
|
+
};
|
|
31
54
|
}
|
|
32
55
|
get tabs() {
|
|
33
56
|
return Array.from(this.host.querySelectorAll('post-tab-item')).filter(tab => tab.closest('post-tabs') === this.host);
|
|
@@ -36,29 +59,38 @@ export class PostTabs {
|
|
|
36
59
|
return Array.from(this.host.querySelectorAll('post-tab-panel')).filter(panel => panel.closest('post-tabs') === this.host);
|
|
37
60
|
}
|
|
38
61
|
validateLabel() {
|
|
39
|
-
if (this.
|
|
40
|
-
console.error(`[${this.host.localName}] Property "label" is required in
|
|
62
|
+
if (this.isPagesVariant && !this.label) {
|
|
63
|
+
console.error(`[${this.host.localName}] Property "label" is required in Pages variant. Received: ${JSON.stringify(this.label)}.`, this.host);
|
|
41
64
|
}
|
|
42
65
|
}
|
|
43
66
|
componentWillRender() {
|
|
44
|
-
this.
|
|
67
|
+
this.detectVariant();
|
|
45
68
|
}
|
|
46
69
|
componentDidLoad() {
|
|
70
|
+
// Programmatically associates the scroll buttons with the tabs container via the ARIA reflection API, avoiding the need for ID-based aria-controls attributes.
|
|
71
|
+
this.leftScrollButton.ariaControlsElements = [this.tabsContainer];
|
|
72
|
+
this.rightScrollButton.ariaControlsElements = [this.tabsContainer];
|
|
47
73
|
this.moveMisplacedTabs();
|
|
48
74
|
this.moveMisplacedPanels();
|
|
49
75
|
this.enableTabs();
|
|
76
|
+
this.handleScrollButtons();
|
|
50
77
|
this.setupContentObserver();
|
|
78
|
+
this.setupResizeObserver();
|
|
51
79
|
this.validateLabel();
|
|
52
|
-
if (this.
|
|
53
|
-
const activeTab = this.
|
|
80
|
+
if (this.isPagesVariant) {
|
|
81
|
+
const activeTab = this.findActivePagesTab();
|
|
54
82
|
if (activeTab) {
|
|
55
83
|
this.activateTab(activeTab);
|
|
84
|
+
this.scrollTabIntoView(activeTab);
|
|
56
85
|
}
|
|
57
86
|
}
|
|
58
87
|
else {
|
|
59
88
|
const tabToActivate = this.activeTab || this.tabs[0]?.name;
|
|
60
89
|
if (tabToActivate) {
|
|
61
90
|
void this.show(tabToActivate);
|
|
91
|
+
const activeTab = this.tabs.find(t => t.name === tabToActivate);
|
|
92
|
+
if (activeTab)
|
|
93
|
+
this.scrollTabIntoView(activeTab);
|
|
62
94
|
}
|
|
63
95
|
}
|
|
64
96
|
this.isLoaded = true;
|
|
@@ -73,35 +105,43 @@ export class PostTabs {
|
|
|
73
105
|
this.hiding = null;
|
|
74
106
|
}
|
|
75
107
|
if (this.contentObserver) {
|
|
76
|
-
this.contentObserver
|
|
108
|
+
this.contentObserver?.disconnect();
|
|
77
109
|
}
|
|
110
|
+
this.resizeObserver?.disconnect();
|
|
111
|
+
// Remove scroll event listener
|
|
112
|
+
this.tabsContainer?.removeEventListener('scroll', this.updateScrollButtons);
|
|
78
113
|
}
|
|
79
114
|
setupContentObserver() {
|
|
80
115
|
const config = {
|
|
81
116
|
childList: true,
|
|
82
117
|
subtree: true,
|
|
83
118
|
attributes: true,
|
|
84
|
-
attributeFilter: ['data-
|
|
119
|
+
attributeFilter: ['data-pages-variant', 'aria-current'],
|
|
85
120
|
};
|
|
86
121
|
this.contentObserver = new MutationObserver(this.handleContentChange.bind(this));
|
|
87
|
-
this.contentObserver
|
|
122
|
+
this.contentObserver?.observe(this.host, config);
|
|
123
|
+
}
|
|
124
|
+
setupResizeObserver() {
|
|
125
|
+
this.resizeObserver = new ResizeObserver(this.updateScrollButtons);
|
|
126
|
+
this.resizeObserver.observe(this.tabsContainer);
|
|
88
127
|
}
|
|
89
128
|
handleContentChange(mutations) {
|
|
90
|
-
const shouldRedetect = this.
|
|
129
|
+
const shouldRedetect = this.shouldRedetectVariant(mutations);
|
|
91
130
|
const ariaCurrentChanged = this.hasAriaCurrentChanged(mutations);
|
|
92
|
-
if (ariaCurrentChanged && this.
|
|
93
|
-
this.
|
|
131
|
+
if (ariaCurrentChanged && this.isPagesVariant) {
|
|
132
|
+
this.updateActivePagesTab();
|
|
94
133
|
}
|
|
95
134
|
if (shouldRedetect) {
|
|
96
|
-
this.
|
|
135
|
+
this.handleVariantChange();
|
|
97
136
|
}
|
|
137
|
+
this.updateScrollButtons();
|
|
98
138
|
}
|
|
99
|
-
|
|
139
|
+
shouldRedetectVariant(mutations) {
|
|
100
140
|
return mutations.some(mutation => {
|
|
101
141
|
if (mutation.type === 'childList') {
|
|
102
142
|
return mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0;
|
|
103
143
|
}
|
|
104
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'data-
|
|
144
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'data-pages-variant') {
|
|
105
145
|
return true;
|
|
106
146
|
}
|
|
107
147
|
return false;
|
|
@@ -110,25 +150,27 @@ export class PostTabs {
|
|
|
110
150
|
hasAriaCurrentChanged(mutations) {
|
|
111
151
|
return mutations.some(mutation => mutation.type === 'attributes' && mutation.attributeName === 'aria-current');
|
|
112
152
|
}
|
|
113
|
-
|
|
114
|
-
const activeTab = this.
|
|
153
|
+
updateActivePagesTab() {
|
|
154
|
+
const activeTab = this.findActivePagesTab();
|
|
115
155
|
if (activeTab && activeTab !== this.currentActiveTab) {
|
|
116
156
|
this.activateTab(activeTab);
|
|
157
|
+
this.scrollTabIntoView(activeTab, 'smooth');
|
|
117
158
|
}
|
|
118
159
|
}
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
this.
|
|
122
|
-
if (
|
|
160
|
+
handleVariantChange() {
|
|
161
|
+
const previousVariant = this.isPagesVariant;
|
|
162
|
+
this.detectVariant();
|
|
163
|
+
if (previousVariant !== this.isPagesVariant) {
|
|
123
164
|
this.enableTabs();
|
|
124
165
|
this.initializeActiveTab();
|
|
125
166
|
}
|
|
126
167
|
}
|
|
127
168
|
initializeActiveTab() {
|
|
128
|
-
if (this.
|
|
129
|
-
const activeTab = this.
|
|
169
|
+
if (this.isPagesVariant) {
|
|
170
|
+
const activeTab = this.findActivePagesTab();
|
|
130
171
|
if (activeTab) {
|
|
131
172
|
this.activateTab(activeTab);
|
|
173
|
+
this.scrollTabIntoView(activeTab);
|
|
132
174
|
}
|
|
133
175
|
}
|
|
134
176
|
else {
|
|
@@ -138,21 +180,29 @@ export class PostTabs {
|
|
|
138
180
|
}
|
|
139
181
|
}
|
|
140
182
|
}
|
|
141
|
-
|
|
142
|
-
//
|
|
143
|
-
// This works even before post-tab-item sets data-
|
|
144
|
-
const
|
|
183
|
+
detectVariant() {
|
|
184
|
+
// Identify Page Tabs variant by looking for anchor elements in tabs
|
|
185
|
+
// This works even before post-tab-item sets [data-pages-variant] attribute
|
|
186
|
+
const hasPages = this.tabs.some(tab => {
|
|
145
187
|
const hasAnchor = tab.querySelector('a') !== null;
|
|
146
|
-
const
|
|
147
|
-
return hasAnchor ||
|
|
188
|
+
const pagesVariantAttr = tab.dataset.pagesVariant === 'true';
|
|
189
|
+
return hasAnchor || pagesVariantAttr;
|
|
148
190
|
});
|
|
149
191
|
const hasPanels = this.panels.length > 0;
|
|
150
|
-
if (
|
|
151
|
-
throw new Error('PostTabs: Mixed mode detected. Cannot use both
|
|
192
|
+
if (hasPages && hasPanels) {
|
|
193
|
+
throw new Error('PostTabs: Mixed mode detected. Cannot use both Page Tabs (anchor elements) and Content Tabs (post-tab-panel elements) variants at the same time.');
|
|
194
|
+
}
|
|
195
|
+
this.isPagesVariant = hasPages;
|
|
196
|
+
// Removes variant related classes to reset the state and applies the newly detected variant
|
|
197
|
+
this.host.classList.remove('page-tabs', 'content-tabs');
|
|
198
|
+
if (this.isPagesVariant) {
|
|
199
|
+
this.host.classList.add('page-tabs');
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
this.host.classList.add('content-tabs');
|
|
152
203
|
}
|
|
153
|
-
this.isNavigationMode = hasNavigationTabs;
|
|
154
204
|
}
|
|
155
|
-
|
|
205
|
+
findActivePagesTab() {
|
|
156
206
|
return (this.tabs.find(tab => {
|
|
157
207
|
const anchor = tab.querySelector('a[aria-current="page"]');
|
|
158
208
|
return anchor !== null;
|
|
@@ -163,30 +213,55 @@ export class PostTabs {
|
|
|
163
213
|
* Any other panel that was previously shown becomes hidden and its associated tab is unselected.
|
|
164
214
|
*/
|
|
165
215
|
async show(tabName) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
216
|
+
try {
|
|
217
|
+
// do nothing if the tab is already active
|
|
218
|
+
if (tabName === this.currentActiveTab?.name) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const previousTab = this.currentActiveTab;
|
|
222
|
+
const newTab = this.host.querySelector(`post-tab-item[name="${tabName}"]`);
|
|
223
|
+
if (!newTab)
|
|
224
|
+
return;
|
|
225
|
+
this.activateTab(newTab);
|
|
226
|
+
this.scrollTabIntoView(newTab, 'smooth');
|
|
227
|
+
// if a panel is currently being displayed, remove it from the view and complete the associated animation
|
|
228
|
+
if (this.showing) {
|
|
229
|
+
this.showing.finish();
|
|
230
|
+
this.showing = null;
|
|
231
|
+
}
|
|
232
|
+
// hide the currently visible panel only if no other animation is running
|
|
233
|
+
if (previousTab && !this.showing && !this.hiding)
|
|
234
|
+
this.hidePanel(previousTab.name);
|
|
235
|
+
if (await this.awaitAnimation(this.hiding))
|
|
236
|
+
return;
|
|
237
|
+
this.showSelectedPanel();
|
|
238
|
+
if (await this.awaitAnimation(this.showing))
|
|
239
|
+
return;
|
|
240
|
+
if (this.isLoaded && this.currentActiveTab)
|
|
241
|
+
this.postChange.emit(this.currentActiveTab.name);
|
|
169
242
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if (this.showing) {
|
|
175
|
-
this.showing.finish();
|
|
176
|
-
this.showing = null;
|
|
243
|
+
catch (e) {
|
|
244
|
+
if (this.isAbortError(e))
|
|
245
|
+
return;
|
|
246
|
+
throw e;
|
|
177
247
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
248
|
+
}
|
|
249
|
+
// Awaits an animation; returns true if it was aborted (caller should bail out).
|
|
250
|
+
async awaitAnimation(animation) {
|
|
251
|
+
if (!animation)
|
|
252
|
+
return false;
|
|
253
|
+
try {
|
|
254
|
+
await animation.finished;
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
catch (e) {
|
|
258
|
+
if (this.isAbortError(e))
|
|
259
|
+
return true;
|
|
260
|
+
throw e;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
isAbortError(error) {
|
|
264
|
+
return (error instanceof DOMException || error instanceof Error) && error.name === 'AbortError';
|
|
190
265
|
}
|
|
191
266
|
moveMisplacedTabs() {
|
|
192
267
|
if (!this.tabs)
|
|
@@ -212,11 +287,11 @@ export class PostTabs {
|
|
|
212
287
|
return;
|
|
213
288
|
this.tabs.forEach(async (tab) => {
|
|
214
289
|
await componentOnReady(tab);
|
|
215
|
-
// In
|
|
216
|
-
if (this.
|
|
290
|
+
// In Page Tabs variant, navigation is handled by the consumer's routing
|
|
291
|
+
if (this.isPagesVariant) {
|
|
217
292
|
return;
|
|
218
293
|
}
|
|
219
|
-
//
|
|
294
|
+
// Content Tabs variant: set up ARIA relationships and event handlers
|
|
220
295
|
if (tab.getAttribute('aria-controls'))
|
|
221
296
|
return;
|
|
222
297
|
const tabPanel = this.getPanel(tab.name);
|
|
@@ -232,6 +307,17 @@ export class PostTabs {
|
|
|
232
307
|
e.preventDefault();
|
|
233
308
|
void this.show(tab.name);
|
|
234
309
|
}
|
|
310
|
+
if (e.key !== 'Home' && e.key !== 'End')
|
|
311
|
+
return;
|
|
312
|
+
e.preventDefault();
|
|
313
|
+
const enabledTabs = this.tabs.filter(t => !t.hasAttribute('disabled'));
|
|
314
|
+
if (enabledTabs.length === 0)
|
|
315
|
+
return;
|
|
316
|
+
const targetTab = e.key === 'Home' ? enabledTabs[0] : enabledTabs.at(-1);
|
|
317
|
+
if (targetTab) {
|
|
318
|
+
targetTab?.focus();
|
|
319
|
+
void this.show(targetTab.name);
|
|
320
|
+
}
|
|
235
321
|
});
|
|
236
322
|
tab.addEventListener('keydown', (e) => {
|
|
237
323
|
if (e.key === 'ArrowRight' || e.key === 'ArrowLeft')
|
|
@@ -246,14 +332,12 @@ export class PostTabs {
|
|
|
246
332
|
activateTab(tab) {
|
|
247
333
|
// Deactivate previous tab
|
|
248
334
|
if (this.currentActiveTab) {
|
|
249
|
-
this.
|
|
250
|
-
if (!this.isNavigationMode) {
|
|
335
|
+
if (!this.isPagesVariant) {
|
|
251
336
|
this.currentActiveTab.setAttribute('aria-selected', 'false');
|
|
252
337
|
this.currentActiveTab.setAttribute('tabindex', '-1');
|
|
253
338
|
}
|
|
254
339
|
}
|
|
255
|
-
|
|
256
|
-
if (!this.isNavigationMode) {
|
|
340
|
+
if (!this.isPagesVariant) {
|
|
257
341
|
tab.setAttribute('aria-selected', 'true');
|
|
258
342
|
tab.setAttribute('tabindex', '0');
|
|
259
343
|
}
|
|
@@ -270,6 +354,8 @@ export class PostTabs {
|
|
|
270
354
|
};
|
|
271
355
|
}
|
|
272
356
|
showSelectedPanel() {
|
|
357
|
+
if (!this.currentActiveTab)
|
|
358
|
+
return;
|
|
273
359
|
const panel = this.getPanel(this.currentActiveTab.name);
|
|
274
360
|
if (!panel)
|
|
275
361
|
return;
|
|
@@ -299,12 +385,52 @@ export class PostTabs {
|
|
|
299
385
|
nextTab.focus();
|
|
300
386
|
void this.show(nextTab.name);
|
|
301
387
|
}
|
|
388
|
+
scrollTabs(direction) {
|
|
389
|
+
const sign = direction === 'prev' ? -1 : 1;
|
|
390
|
+
const style = getComputedStyle(this.tabsContainer);
|
|
391
|
+
const paddingStart = Number.parseFloat(style.paddingInlineStart) || 0;
|
|
392
|
+
const paddingEnd = Number.parseFloat(style.paddingInlineEnd) || 0;
|
|
393
|
+
const contentWidth = this.tabsContainer.clientWidth - paddingStart - paddingEnd;
|
|
394
|
+
this.tabsContainer.scrollBy({
|
|
395
|
+
left: sign * contentWidth,
|
|
396
|
+
behavior: 'smooth',
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
scrollTabIntoView(tab, behavior = 'instant') {
|
|
400
|
+
const container = this.tabsContainer;
|
|
401
|
+
const style = getComputedStyle(container);
|
|
402
|
+
const paddingStart = Number.parseFloat(style.paddingInlineStart) || 0;
|
|
403
|
+
const paddingEnd = Number.parseFloat(style.paddingInlineEnd) || 0;
|
|
404
|
+
const tabLeft = tab.offsetLeft;
|
|
405
|
+
const tabRight = tabLeft + tab.offsetWidth;
|
|
406
|
+
const containerLeft = container.scrollLeft + paddingStart;
|
|
407
|
+
const containerRight = containerLeft + container.clientWidth - paddingStart - paddingEnd;
|
|
408
|
+
if (tabLeft < containerLeft) {
|
|
409
|
+
container.scrollTo({ left: tabLeft - paddingStart, behavior });
|
|
410
|
+
}
|
|
411
|
+
else if (tabRight > containerRight) {
|
|
412
|
+
container.scrollTo({ left: tabRight - container.clientWidth + paddingEnd, behavior });
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
handleScrollButtons() {
|
|
416
|
+
this.updateScrollButtons();
|
|
417
|
+
this.tabsContainer.addEventListener('scroll', this.updateScrollButtons);
|
|
418
|
+
}
|
|
302
419
|
render() {
|
|
303
|
-
const
|
|
304
|
-
|
|
420
|
+
const activeName = this.activeTab ?? this.tabs[0]?.name;
|
|
421
|
+
const TabsContainer = this.isPagesVariant ? 'nav' : 'div';
|
|
422
|
+
const isSSR = Build.isServer;
|
|
423
|
+
const tabStyle = activeName
|
|
424
|
+
? {
|
|
425
|
+
[`--post-tab-panel-${activeName}`]: 'block',
|
|
426
|
+
[`--post-tab-item-${activeName}`]: '1',
|
|
427
|
+
}
|
|
428
|
+
: undefined;
|
|
429
|
+
const style = isSSR && !this.isPagesVariant ? tabStyle : undefined;
|
|
430
|
+
return (h(Host, { key: '3e187db1375d551ac80bb4facced0ad4d01ec3fd', "data-version": version, style: style }, h("div", { key: '8efd1434819801304bb218bf8af2a9c570153d70', class: "tabs-wrapper", part: "post-tabs" }, h("button", { key: '50d03d1a84e1f92c915d11e9b161498bd938b713', ref: el => (this.leftScrollButton = el), class: "scroll-btn scroll-btn-left", type: "button", "aria-label": this.textPrevTabItems, tabindex: this.showLeftScrollButton ? 0 : -1, hidden: !this.showLeftScrollButton, onClick: () => this.scrollTabs('prev') }, h("post-icon", { key: 'f767e493126954bd9246b4c161aa197f5fe48fcc', name: "chevronleft" })), h(TabsContainer, { key: 'f319b638b3fdfb46d5e793001192bb96e4763cca', ref: el => (this.tabsContainer = el), class: "tabs", role: this.isPagesVariant ? undefined : 'tablist', "aria-label": this.isPagesVariant ? this.label : undefined }, h("slot", { key: '65d15b30402eaf835f506f4cf24dd6373a632c52', onSlotchange: () => {
|
|
305
431
|
this.moveMisplacedTabs();
|
|
306
432
|
this.enableTabs();
|
|
307
|
-
} }))), !this.
|
|
433
|
+
} })), h("button", { key: 'f18317a83f6bd1c28c455ad6cfc8d58cd83c52d2', ref: el => (this.rightScrollButton = el), class: "scroll-btn scroll-btn-right", type: "button", "aria-label": this.textNextTabItems, tabindex: this.showRightScrollButton ? 0 : -1, hidden: !this.showRightScrollButton, onClick: () => this.scrollTabs('next') }, h("post-icon", { key: 'fcc75e1de8c39f3e3e2864e3439e85881001c73c', name: "chevronright" }))), !this.isPagesVariant && (h("div", { key: '487435bf4d776f1771eff2c735e3476a05ef68c4', class: "tab-content", part: "post-tabs-content" }, h("slot", { key: 'bbe284adfc74d502a77ceaade18179101f6aaf30', name: "panels", onSlotchange: () => this.moveMisplacedPanels() })))));
|
|
308
434
|
}
|
|
309
435
|
static get is() { return "post-tabs"; }
|
|
310
436
|
static get encapsulation() { return "shadow"; }
|
|
@@ -320,6 +446,46 @@ export class PostTabs {
|
|
|
320
446
|
}
|
|
321
447
|
static get properties() {
|
|
322
448
|
return {
|
|
449
|
+
"textPrevTabItems": {
|
|
450
|
+
"type": "string",
|
|
451
|
+
"mutable": false,
|
|
452
|
+
"complexType": {
|
|
453
|
+
"original": "string",
|
|
454
|
+
"resolved": "string",
|
|
455
|
+
"references": {}
|
|
456
|
+
},
|
|
457
|
+
"required": false,
|
|
458
|
+
"optional": false,
|
|
459
|
+
"docs": {
|
|
460
|
+
"tags": [],
|
|
461
|
+
"text": "An accessible label for the \"previous tab items\" button."
|
|
462
|
+
},
|
|
463
|
+
"getter": false,
|
|
464
|
+
"setter": false,
|
|
465
|
+
"reflect": true,
|
|
466
|
+
"attribute": "text-prev-tab-items",
|
|
467
|
+
"defaultValue": "'Previous tab items'"
|
|
468
|
+
},
|
|
469
|
+
"textNextTabItems": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"mutable": false,
|
|
472
|
+
"complexType": {
|
|
473
|
+
"original": "string",
|
|
474
|
+
"resolved": "string",
|
|
475
|
+
"references": {}
|
|
476
|
+
},
|
|
477
|
+
"required": false,
|
|
478
|
+
"optional": false,
|
|
479
|
+
"docs": {
|
|
480
|
+
"tags": [],
|
|
481
|
+
"text": "An accessible label for the \"next tab items\" button."
|
|
482
|
+
},
|
|
483
|
+
"getter": false,
|
|
484
|
+
"setter": false,
|
|
485
|
+
"reflect": true,
|
|
486
|
+
"attribute": "text-next-tab-items",
|
|
487
|
+
"defaultValue": "'Next tab items'"
|
|
488
|
+
},
|
|
323
489
|
"activeTab": {
|
|
324
490
|
"type": "string",
|
|
325
491
|
"mutable": false,
|
|
@@ -332,32 +498,32 @@ export class PostTabs {
|
|
|
332
498
|
"optional": true,
|
|
333
499
|
"docs": {
|
|
334
500
|
"tags": [],
|
|
335
|
-
"text": "The name of the tab in the
|
|
501
|
+
"text": "The name of the tab in the Content Tabs variant that is initially active.\nChanging this value after initialization has no effect.\nIf not specified, defaults to the first tab."
|
|
336
502
|
},
|
|
337
503
|
"getter": false,
|
|
338
504
|
"setter": false,
|
|
339
|
-
"reflect":
|
|
505
|
+
"reflect": true,
|
|
340
506
|
"attribute": "active-tab"
|
|
341
507
|
},
|
|
342
|
-
"
|
|
343
|
-
"type": "
|
|
508
|
+
"size": {
|
|
509
|
+
"type": "string",
|
|
344
510
|
"mutable": false,
|
|
345
511
|
"complexType": {
|
|
346
|
-
"original": "
|
|
347
|
-
"resolved": "
|
|
512
|
+
"original": "'small' | 'large'",
|
|
513
|
+
"resolved": "\"large\" | \"small\"",
|
|
348
514
|
"references": {}
|
|
349
515
|
},
|
|
350
516
|
"required": false,
|
|
351
517
|
"optional": false,
|
|
352
518
|
"docs": {
|
|
353
519
|
"tags": [],
|
|
354
|
-
"text": "
|
|
520
|
+
"text": "The size of the tabs, corresponding to the different designs in Figma.\nDefault is 'large'."
|
|
355
521
|
},
|
|
356
522
|
"getter": false,
|
|
357
523
|
"setter": false,
|
|
358
524
|
"reflect": true,
|
|
359
|
-
"attribute": "
|
|
360
|
-
"defaultValue": "
|
|
525
|
+
"attribute": "size",
|
|
526
|
+
"defaultValue": "'large'"
|
|
361
527
|
},
|
|
362
528
|
"label": {
|
|
363
529
|
"type": "string",
|
|
@@ -371,7 +537,7 @@ export class PostTabs {
|
|
|
371
537
|
"optional": true,
|
|
372
538
|
"docs": {
|
|
373
539
|
"tags": [],
|
|
374
|
-
"text": "
|
|
540
|
+
"text": "An accessible label for the Pages Tabs variant"
|
|
375
541
|
},
|
|
376
542
|
"getter": false,
|
|
377
543
|
"setter": false,
|
|
@@ -382,7 +548,9 @@ export class PostTabs {
|
|
|
382
548
|
}
|
|
383
549
|
static get states() {
|
|
384
550
|
return {
|
|
385
|
-
"
|
|
551
|
+
"isPagesVariant": {},
|
|
552
|
+
"showLeftScrollButton": {},
|
|
553
|
+
"showRightScrollButton": {}
|
|
386
554
|
};
|
|
387
555
|
}
|
|
388
556
|
static get events() {
|
|
@@ -394,7 +562,7 @@ export class PostTabs {
|
|
|
394
562
|
"composed": true,
|
|
395
563
|
"docs": {
|
|
396
564
|
"tags": [],
|
|
397
|
-
"text": "An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.\nThe payload is the name of the newly active tab.\nOnly emitted in
|
|
565
|
+
"text": "An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.\nThe payload is the name of the newly active tab.\nOnly emitted in Content Tabs variant."
|
|
398
566
|
},
|
|
399
567
|
"complexType": {
|
|
400
568
|
"original": "string",
|
|
@@ -440,6 +608,9 @@ export class PostTabs {
|
|
|
440
608
|
}];
|
|
441
609
|
}
|
|
442
610
|
}
|
|
611
|
+
__decorate([
|
|
612
|
+
OneOf(['small', 'large'])
|
|
613
|
+
], PostTabs.prototype, "size", void 0);
|
|
443
614
|
__decorate([
|
|
444
615
|
Type('string')
|
|
445
616
|
], PostTabs.prototype, "label", void 0);
|
|
@@ -29,7 +29,7 @@ export class PostTogglebutton {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: '6f61a07946f3e67bace0a883b73c424893c4043d', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: 'fd9b93e45da499dbb790ad675f3db36e248c1960' })));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "post-togglebutton"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -37,8 +37,8 @@ export class PostTooltip {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Programmatically display the tooltip
|
|
41
|
-
*
|
|
40
|
+
* Programmatically display the tooltip,
|
|
41
|
+
* `target` is the HTML element the menu is anchored to.
|
|
42
42
|
*/
|
|
43
43
|
async show(target) {
|
|
44
44
|
if (this.open)
|
|
@@ -52,9 +52,8 @@ export class PostTooltip {
|
|
|
52
52
|
this.popoverRef.hide();
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* Toggle tooltip display
|
|
56
|
-
*
|
|
57
|
-
* @param [force] Pass true to always show or false to always hide
|
|
55
|
+
* Toggle tooltip display,
|
|
56
|
+
* `target` is the HTML element the menu is anchored to.
|
|
58
57
|
*/
|
|
59
58
|
async toggle(target, force) {
|
|
60
59
|
this.popoverRef.toggle(target, force);
|
|
@@ -68,7 +67,7 @@ export class PostTooltip {
|
|
|
68
67
|
}
|
|
69
68
|
render() {
|
|
70
69
|
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
71
|
-
return (h(Host, { key: '
|
|
70
|
+
return (h(Host, { key: 'd49731becbb7395ec68cfae34d316a6248977b53', "data-version": version }, h("post-popovercontainer", { key: '12da18a58c2143ef4c2ddff207d081d091e6a40e', safeSpace: "trapezoid", class: popoverClass, role: "tooltip", arrow: this.arrow, placement: this.placement, onPostBeforeToggle: e => this.handleBeforeToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '5f941c0311eff468be1c6abe7cbcdab8ba272e15' }))));
|
|
72
71
|
}
|
|
73
72
|
static get is() { return "post-tooltip"; }
|
|
74
73
|
static get encapsulation() { return "shadow"; }
|
|
@@ -161,7 +160,7 @@ export class PostTooltip {
|
|
|
161
160
|
"parameters": [{
|
|
162
161
|
"name": "target",
|
|
163
162
|
"type": "HTMLElement",
|
|
164
|
-
"docs": "
|
|
163
|
+
"docs": ""
|
|
165
164
|
}],
|
|
166
165
|
"references": {
|
|
167
166
|
"Promise": {
|
|
@@ -176,11 +175,8 @@ export class PostTooltip {
|
|
|
176
175
|
"return": "Promise<void>"
|
|
177
176
|
},
|
|
178
177
|
"docs": {
|
|
179
|
-
"text": "Programmatically display the tooltip.",
|
|
180
|
-
"tags": [
|
|
181
|
-
"name": "param",
|
|
182
|
-
"text": "target An element where the tooltip should be shown"
|
|
183
|
-
}]
|
|
178
|
+
"text": "Programmatically display the tooltip,\n`target` is the HTML element the menu is anchored to.",
|
|
179
|
+
"tags": []
|
|
184
180
|
}
|
|
185
181
|
},
|
|
186
182
|
"hide": {
|
|
@@ -206,11 +202,11 @@ export class PostTooltip {
|
|
|
206
202
|
"parameters": [{
|
|
207
203
|
"name": "target",
|
|
208
204
|
"type": "HTMLElement",
|
|
209
|
-
"docs": "
|
|
205
|
+
"docs": ""
|
|
210
206
|
}, {
|
|
211
207
|
"name": "force",
|
|
212
208
|
"type": "boolean",
|
|
213
|
-
"docs": "
|
|
209
|
+
"docs": ""
|
|
214
210
|
}],
|
|
215
211
|
"references": {
|
|
216
212
|
"Promise": {
|
|
@@ -225,14 +221,8 @@ export class PostTooltip {
|
|
|
225
221
|
"return": "Promise<void>"
|
|
226
222
|
},
|
|
227
223
|
"docs": {
|
|
228
|
-
"text": "Toggle tooltip display.",
|
|
229
|
-
"tags": [
|
|
230
|
-
"name": "param",
|
|
231
|
-
"text": "target An element where the tooltip should be shown"
|
|
232
|
-
}, {
|
|
233
|
-
"name": "param",
|
|
234
|
-
"text": "force Pass true to always show or false to always hide"
|
|
235
|
-
}]
|
|
224
|
+
"text": "Toggle tooltip display,\n`target` is the HTML element the menu is anchored to.",
|
|
225
|
+
"tags": []
|
|
236
226
|
}
|
|
237
227
|
}
|
|
238
228
|
};
|