@swisspost/design-system-components 10.0.0-next.69 → 10.0.0-next.71
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/breakpoints-B0Olgvgc.js +206 -0
- package/dist/cjs/component-on-ready-CifOTqw1.js +24 -0
- package/dist/cjs/{focusable-ZqET_zrB.js → focusable-COT2uiEV.js} +25 -4
- package/dist/cjs/{index-DPdHkdGf.js → index-CCteMCnR.js} +13 -13
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/nanoid-CmjyF1Cm.js +20 -0
- package/dist/cjs/{package-CzSn3NmD.js → package-CscM89A7.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +7 -7
- package/dist/cjs/post-autocomplete.cjs.entry.js +3 -3
- package/dist/cjs/post-avatar.cjs.entry.js +6 -24
- package/dist/cjs/post-back-to-top.cjs.entry.js +3 -3
- package/dist/cjs/post-banner.cjs.entry.js +3 -3
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +30 -33
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +82 -80
- package/dist/cjs/post-closebutton_14.cjs.entry.js +36 -33
- package/dist/cjs/post-collapsible_2.cjs.entry.js +5 -5
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +31 -23
- 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 +4 -4
- package/dist/cjs/post-login-widget.cjs.entry.js +36 -3
- package/dist/cjs/post-number-input.cjs.entry.js +6 -6
- 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 +4 -4
- package/dist/cjs/post-rating.cjs.entry.js +4 -4
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +4 -4
- package/dist/cjs/post-tab-item.cjs.entry.js +6 -6
- package/dist/cjs/post-tab-panel.cjs.entry.js +6 -6
- package/dist/cjs/post-tabs.cjs.entry.js +7 -27
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +16 -12
- package/dist/cjs/post-tooltip.cjs.entry.js +4 -4
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +3 -4
- package/dist/collection/components/post-avatar/avatar-utils.js +2 -2
- package/dist/collection/components/post-avatar/post-avatar.js +3 -40
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +79 -39
- package/dist/collection/components/post-breadcrumb-item/variants.js +1 -0
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +84 -83
- 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/post-date-picker.css +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +2 -2
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +2 -1
- package/dist/collection/components/post-header/post-header.js +4 -4
- package/dist/collection/components/post-icon/post-icon.js +3 -2
- package/dist/collection/components/post-language-menu/post-language-menu.js +2 -3
- 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-login-widget/post-login-widget.css +1 -0
- package/dist/collection/components/post-login-widget/post-login-widget.js +106 -4
- 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.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 +5 -2
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-number-input/post-number-input.js +2 -2
- package/dist/collection/components/post-pagination/post-pagination.js +1 -2
- package/dist/collection/components/post-popover/post-popover.js +1 -1
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +5 -6
- package/dist/collection/components/post-rating/post-rating.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 +2 -3
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -3
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +15 -9
- package/dist/collection/hydrate-stub/index.stub.js +5 -0
- package/dist/collection/test-setup.js +7 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/collection/utils/locales.js +9 -2
- package/dist/collection/utils/nanoid.js +16 -0
- package/dist/collection/utils/property-decorators/array-of.js +22 -0
- package/dist/collection/utils/property-decorators/create-validator-decorator.js +187 -0
- package/dist/collection/utils/property-decorators/date.js +21 -0
- package/dist/collection/utils/property-decorators/index.js +9 -0
- package/dist/collection/utils/property-decorators/iso-date.js +21 -0
- package/dist/collection/utils/property-decorators/one-of.js +22 -0
- package/dist/collection/utils/property-decorators/pattern.js +22 -0
- package/dist/collection/utils/property-decorators/required.js +24 -0
- package/dist/collection/utils/property-decorators/type.js +25 -0
- package/dist/collection/utils/property-decorators/url.js +29 -0
- package/dist/components/breakpoints.js +1 -0
- package/dist/components/component-on-ready.js +1 -0
- package/dist/components/focusable.js +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/nanoid.js +1 -0
- 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-avatar2.js +1 -0
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.js +1 -1
- package/dist/components/post-breadcrumb-item.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-item.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-login-widget.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-item2.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-pagination.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-rating.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-8LXe8Zt_.js +1 -0
- package/dist/components/react/p-BC0-M_SK.js +1 -0
- package/dist/components/react/p-BQ3HlJPr.js +1 -0
- package/dist/components/react/p-BrY4VWTQ.js +1 -0
- package/dist/components/react/p-C7s9oglQ.js +1 -0
- package/dist/components/react/{p-Bj33xnuq.js → p-CTgZ8DGr.js} +1 -1
- package/dist/components/react/{p-DwJ5SwpN.js → p-CVtlwDsT.js} +1 -1
- package/dist/components/react/p-CaLwTf3T.js +1 -0
- package/dist/components/react/p-ClJyTIVM.js +1 -0
- package/dist/components/react/{p-B2BDAeHI.js → p-DGr-hfLq.js} +1 -1
- package/dist/components/react/{p-BYfHrHCb.js → p-DJxdj9pa.js} +1 -1
- package/dist/components/react/p-DKDEtjQe.js +1 -0
- package/dist/components/react/p-DPKR_4uI.js +1 -0
- package/dist/components/react/p-DcEDGaFs.js +1 -0
- package/dist/components/react/{p-DRtzK3cr.js → p-DipfA69b.js} +1 -1
- package/dist/components/react/{p-BbOp03Tv.js → p-DwZxAC2u.js} +1 -1
- package/dist/components/react/p-lpWRZjJp.js +1 -0
- package/dist/components/react/p-x3kxyWSZ.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-login-widget.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-rating.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 +210 -69
- package/dist/esm/breakpoints-BQ3HlJPr.js +202 -0
- package/dist/esm/component-on-ready-lpWRZjJp.js +22 -0
- package/dist/esm/{focusable-BD_WT2MO.js → focusable-C7afHKmo.js} +25 -5
- package/dist/esm/{index-DmAi35UF.js → index-DmBWUef5.js} +13 -13
- package/dist/esm/loader.js +3 -3
- package/dist/esm/nanoid-8LXe8Zt_.js +18 -0
- package/dist/esm/package-x3kxyWSZ.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +6 -6
- package/dist/esm/post-autocomplete.entry.js +3 -3
- package/dist/esm/post-avatar.entry.js +6 -24
- package/dist/esm/post-back-to-top.entry.js +3 -3
- package/dist/esm/post-banner.entry.js +3 -3
- package/dist/esm/post-breadcrumb-item.entry.js +31 -34
- package/dist/esm/post-breadcrumbs.entry.js +82 -80
- package/dist/esm/post-closebutton_14.entry.js +31 -28
- package/dist/esm/post-collapsible_2.entry.js +5 -5
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +15 -7
- package/dist/esm/post-footer.entry.js +5 -5
- 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 +4 -4
- package/dist/esm/post-login-widget.entry.js +36 -3
- package/dist/esm/post-number-input.entry.js +5 -5
- package/dist/esm/post-pagination.entry.js +4 -4
- package/dist/esm/post-popover-trigger.entry.js +5 -5
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/post-rating.entry.js +4 -4
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +4 -4
- package/dist/esm/post-tab-item.entry.js +5 -5
- package/dist/esm/post-tab-panel.entry.js +5 -5
- package/dist/esm/post-tabs.entry.js +6 -26
- package/dist/esm/post-tooltip-trigger.entry.js +16 -12
- package/dist/esm/post-tooltip.entry.js +4 -4
- package/dist/post-components/p-08a0e8e9.entry.js +1 -0
- package/dist/post-components/{p-9fab1847.entry.js → p-1583817b.entry.js} +1 -1
- package/dist/post-components/{p-6644e626.entry.js → p-203d9abd.entry.js} +1 -1
- package/dist/post-components/{p-5ade4255.entry.js → p-2c68af27.entry.js} +1 -1
- package/dist/post-components/{p-f88a161a.entry.js → p-39143e19.entry.js} +1 -1
- package/dist/post-components/p-46dd9e7e.entry.js +1 -0
- package/dist/post-components/{p-c95fcb40.entry.js → p-4b445a35.entry.js} +1 -1
- package/dist/post-components/p-53a8cce5.entry.js +1 -0
- package/dist/post-components/p-72bff1fc.entry.js +1 -0
- package/dist/post-components/{p-8b68164f.entry.js → p-75045028.entry.js} +1 -1
- package/dist/post-components/p-768b4516.entry.js +1 -0
- package/dist/post-components/{p-95df4d4e.entry.js → p-7e072450.entry.js} +1 -1
- package/dist/post-components/{p-0992cba9.entry.js → p-83cb6424.entry.js} +1 -1
- package/dist/post-components/p-8LXe8Zt_.js +1 -0
- package/dist/post-components/{p-d57462a3.entry.js → p-94f4da57.entry.js} +1 -1
- package/dist/post-components/{p-0c249c71.entry.js → p-9dace750.entry.js} +1 -1
- package/dist/post-components/{p-220d0eab.entry.js → p-9ea7e46f.entry.js} +1 -1
- package/dist/post-components/p-BQ3HlJPr.js +1 -0
- package/dist/post-components/p-BrY4VWTQ.js +1 -0
- package/dist/post-components/p-DmBWUef5.js +2 -0
- package/dist/post-components/{p-52f85cba.entry.js → p-a0ac814c.entry.js} +1 -1
- package/dist/post-components/p-a0d12ca8.entry.js +1 -0
- package/dist/post-components/{p-5664d5b5.entry.js → p-bab0f27f.entry.js} +1 -1
- package/dist/post-components/p-cb039d66.entry.js +1 -0
- package/dist/post-components/p-e8cda4e1.entry.js +1 -0
- package/dist/post-components/{p-500a3fc7.entry.js → p-e8e50d5c.entry.js} +1 -1
- package/dist/post-components/p-eb64ec1d.entry.js +1 -0
- package/dist/post-components/p-f0746a9e.entry.js +1 -0
- package/dist/post-components/p-f5e33714.entry.js +1 -0
- package/dist/post-components/{p-cca0cf23.entry.js → p-f93ce33d.entry.js} +1 -1
- package/dist/post-components/{p-272de102.entry.js → p-fd0446b2.entry.js} +1 -1
- package/dist/post-components/p-lpWRZjJp.js +1 -0
- package/dist/post-components/p-x3kxyWSZ.js +1 -0
- package/dist/post-components/post-components.css +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-avatar/avatar-utils.d.ts +1 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +0 -8
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +14 -11
- package/dist/types/components/post-breadcrumb-item/variants.d.ts +2 -0
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +23 -25
- package/dist/types/components/post-footer/post-footer.d.ts +1 -0
- package/dist/types/components/post-login-widget/post-login-widget.d.ts +21 -2
- package/dist/types/components/post-menu/post-menu.d.ts +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -1
- package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +1 -0
- package/dist/types/components.d.ts +68 -24
- package/dist/types/modules.d.ts +2 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/nanoid.d.ts +8 -0
- package/dist/types/utils/property-decorators/array-of.d.ts +9 -0
- package/dist/types/utils/property-decorators/create-validator-decorator.d.ts +43 -0
- package/dist/types/utils/property-decorators/date.d.ts +6 -0
- package/dist/types/utils/property-decorators/index.d.ts +9 -0
- package/dist/types/utils/property-decorators/iso-date.d.ts +6 -0
- package/dist/types/utils/property-decorators/one-of.d.ts +8 -0
- package/dist/types/utils/property-decorators/pattern.d.ts +8 -0
- package/dist/types/utils/property-decorators/required.d.ts +8 -0
- package/dist/types/utils/property-decorators/type.d.ts +9 -0
- package/dist/types/utils/property-decorators/url.d.ts +6 -0
- package/hydrate/index.js +419 -114735
- package/hydrate/index.mjs +419 -114735
- package/hydrate/index.stub.js +5 -0
- package/package.json +28 -18
- package/dist/cjs/index-YBj3gUJp.js +0 -114540
- package/dist/cjs/index.browser-BVb9l9T_.js +0 -16
- package/dist/components/index.browser.js +0 -1
- package/dist/components/index3.js +0 -6
- package/dist/components/post-breadcrumb-item2.js +0 -1
- package/dist/components/react/p-B4l5EAoq.js +0 -1
- package/dist/components/react/p-B4tq6hiA.js +0 -1
- package/dist/components/react/p-CJcRbvrI.js +0 -6
- package/dist/components/react/p-CfQqdIV2.js +0 -1
- package/dist/components/react/p-D1KBbwmi.js +0 -1
- package/dist/components/react/p-DAIxJysJ.js +0 -1
- package/dist/components/react/p-De_QjSNJ.js +0 -1
- package/dist/components/react/p-HNUXY1z7.js +0 -1
- package/dist/components/react/p-PuHMz_9_.js +0 -1
- package/dist/components/react/p-UY924tHr.js +0 -1
- package/dist/components/react/p-nA1BKco0.js +0 -1
- package/dist/esm/index-CJcRbvrI.js +0 -114535
- package/dist/esm/index.browser-nA1BKco0.js +0 -14
- package/dist/esm/package-B4l5EAoq.js +0 -3
- package/dist/post-components/p-1e28d279.entry.js +0 -1
- package/dist/post-components/p-30e5bc99.entry.js +0 -1
- package/dist/post-components/p-694e76be.entry.js +0 -1
- package/dist/post-components/p-906b669b.entry.js +0 -1
- package/dist/post-components/p-92e4a7f7.entry.js +0 -1
- package/dist/post-components/p-B4l5EAoq.js +0 -1
- package/dist/post-components/p-CJcRbvrI.js +0 -6
- package/dist/post-components/p-DmAi35UF.js +0 -2
- package/dist/post-components/p-PuHMz_9_.js +0 -1
- package/dist/post-components/p-c70cad6e.entry.js +0 -1
- package/dist/post-components/p-cd6684e1.entry.js +0 -1
- package/dist/post-components/p-d99bdef2.entry.js +0 -1
- package/dist/post-components/p-dfe811cc.entry.js +0 -1
- package/dist/post-components/p-f14ca918.entry.js +0 -1
- package/dist/post-components/p-fc2882a8.entry.js +0 -1
- package/dist/post-components/p-nA1BKco0.js +0 -1
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/types/language-tags.d.ts +0 -1
- /package/dist/types/{language-tags.js → test-setup.d.ts} +0 -0
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
import { Build, Host, h, } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
+
import { checkRequiredAndType } from "../../utils/index";
|
|
3
4
|
const SESSION_URL = 'https://n.account.post.ch/v1/session/subscribe';
|
|
4
5
|
/**
|
|
5
|
-
* @slot
|
|
6
|
-
* @slot
|
|
6
|
+
* @slot user-links - Links to show in the user menu when the user is authenticated.
|
|
7
|
+
* @slot login-link - Content rendered when the user is not authenticated.
|
|
7
8
|
*/
|
|
8
9
|
export class PostLoginWidget {
|
|
9
10
|
constructor() {
|
|
10
11
|
this.authenticated = null;
|
|
12
|
+
this.user = null;
|
|
13
|
+
}
|
|
14
|
+
validateTextCurrentUser() {
|
|
15
|
+
checkRequiredAndType(this, 'textCurrentUser', 'string');
|
|
16
|
+
}
|
|
17
|
+
validateTextUserMenu() {
|
|
18
|
+
checkRequiredAndType(this, 'textUserMenu', 'string');
|
|
19
|
+
}
|
|
20
|
+
validateTextUserMenuTrigger() {
|
|
21
|
+
checkRequiredAndType(this, 'textUserMenuTrigger', 'string');
|
|
22
|
+
}
|
|
23
|
+
componentDidLoad() {
|
|
24
|
+
this.validateTextCurrentUser();
|
|
25
|
+
this.validateTextUserMenuTrigger();
|
|
26
|
+
this.validateTextUserMenu();
|
|
11
27
|
}
|
|
12
28
|
async componentWillLoad() {
|
|
13
29
|
if (Build.isBrowser) {
|
|
@@ -39,6 +55,7 @@ export class PostLoginWidget {
|
|
|
39
55
|
}
|
|
40
56
|
const json = await response.json();
|
|
41
57
|
const isAuthenticated = json?.data?.email !== undefined;
|
|
58
|
+
this.user = json?.data;
|
|
42
59
|
this.setAuthState(isAuthenticated);
|
|
43
60
|
}
|
|
44
61
|
catch {
|
|
@@ -52,13 +69,85 @@ export class PostLoginWidget {
|
|
|
52
69
|
this.postChange.emit({ authenticated: next });
|
|
53
70
|
}
|
|
54
71
|
render() {
|
|
55
|
-
return (h(Host, { key: '
|
|
72
|
+
return (h(Host, { key: '1d26f4edfaa623ac4f9a9c71bef89413ef3109c0', "data-version": version }, this.authenticated === true ? (h("div", null, h("post-menu-trigger", { for: "user-menu-default" }, h("button", { class: "btn btn-link", type: "button" }, h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, description: this.textCurrentUser.replace('{user}', `${this.user.name} ${this.user.surname}`) }), h("span", { class: "visually-hidden" }, this.textUserMenuTrigger))), h("post-menu", { label: this.textUserMenu, id: "user-menu-default" }, h("div", { slot: "header" }, h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, email: this.user.email, "aria-hidden": "true" }), this.user.name, " ", this.user.surname), h("slot", { name: "user-links" })))) : (h("div", null, h("slot", { name: "login-link" })))));
|
|
56
73
|
}
|
|
57
74
|
static get is() { return "post-login-widget"; }
|
|
58
75
|
static get encapsulation() { return "shadow"; }
|
|
76
|
+
static get originalStyleUrls() {
|
|
77
|
+
return {
|
|
78
|
+
"$": ["post-login-widget.scss"]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
static get styleUrls() {
|
|
82
|
+
return {
|
|
83
|
+
"$": ["post-login-widget.css"]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
static get properties() {
|
|
87
|
+
return {
|
|
88
|
+
"textCurrentUser": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"mutable": false,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "string",
|
|
93
|
+
"resolved": "string",
|
|
94
|
+
"references": {}
|
|
95
|
+
},
|
|
96
|
+
"required": true,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": "Label for the \"Current user is {user}\" accessibility description.\nUse `{user}` as a placeholder \u2014 it will be replaced with the current user's name at runtime."
|
|
101
|
+
},
|
|
102
|
+
"getter": false,
|
|
103
|
+
"setter": false,
|
|
104
|
+
"reflect": true,
|
|
105
|
+
"attribute": "text-current-user"
|
|
106
|
+
},
|
|
107
|
+
"textUserMenu": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "string",
|
|
112
|
+
"resolved": "string",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": true,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": "Accessible label for the dropdown menu"
|
|
120
|
+
},
|
|
121
|
+
"getter": false,
|
|
122
|
+
"setter": false,
|
|
123
|
+
"reflect": true,
|
|
124
|
+
"attribute": "text-user-menu"
|
|
125
|
+
},
|
|
126
|
+
"textUserMenuTrigger": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "string",
|
|
131
|
+
"resolved": "string",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": true,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "Hidden label for the user menu trigger button, for accessibility purposes. It should describe the purpose of the button (e.g. \"Access user links\")."
|
|
139
|
+
},
|
|
140
|
+
"getter": false,
|
|
141
|
+
"setter": false,
|
|
142
|
+
"reflect": true,
|
|
143
|
+
"attribute": "text-user-menu-trigger"
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}
|
|
59
147
|
static get states() {
|
|
60
148
|
return {
|
|
61
|
-
"authenticated": {}
|
|
149
|
+
"authenticated": {},
|
|
150
|
+
"user": {}
|
|
62
151
|
};
|
|
63
152
|
}
|
|
64
153
|
static get events() {
|
|
@@ -117,4 +206,17 @@ export class PostLoginWidget {
|
|
|
117
206
|
}
|
|
118
207
|
};
|
|
119
208
|
}
|
|
209
|
+
static get elementRef() { return "host"; }
|
|
210
|
+
static get watchers() {
|
|
211
|
+
return [{
|
|
212
|
+
"propName": "textCurrentUser",
|
|
213
|
+
"methodName": "validateTextCurrentUser"
|
|
214
|
+
}, {
|
|
215
|
+
"propName": "textUserMenu",
|
|
216
|
+
"methodName": "validateTextUserMenu"
|
|
217
|
+
}, {
|
|
218
|
+
"propName": "textUserMenuTrigger",
|
|
219
|
+
"methodName": "validateTextUserMenuTrigger"
|
|
220
|
+
}];
|
|
221
|
+
}
|
|
120
222
|
}
|
|
@@ -20,7 +20,7 @@ export class PostLogo {
|
|
|
20
20
|
render() {
|
|
21
21
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
22
22
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
23
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: 'f00832f2069ab28ce56369ed8a6649657b1d3668', "data-version": version }, h(LogoTag, { key: 'f8998a0e1e6af06860c6aa19dfec3c62178c370e', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: '3a1a45de5963ec2d9e40b77178e781237e09dd05', class: "description" }, h("slot", { key: '0ee9bfa56bcea5bc77a6b5d76179a5292fd12337', onSlotchange: () => this.checkDescription() })), h("svg", { key: '971626b0c1c55e9c6e0eb2ee3160287b7fb38963', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: '197bbe6025bb47e998dfeb03f0a05de9718e5d65', id: "Logo" }, h("rect", { key: '5c60147c473550ecdce1de55a7c51b710310c7a9', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: 'c09469285fb2ee599e92aabaa02a8529dfa3e086', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: '830aab1cfddf2be961c3866bda044ebce2b8cd3b', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "post-logo"; }
|
|
26
26
|
static get encapsulation() { return "shadow"; }
|
|
@@ -123,7 +123,7 @@ export class PostMainnavigation {
|
|
|
123
123
|
}, NAVBAR_DISABLE_DURATION);
|
|
124
124
|
}
|
|
125
125
|
render() {
|
|
126
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: '4bde4476fd50bef26253dd2d3853f2eb0b2f5ebb', version: version, class: this.canScroll ? 'scrollable' : '' }, h("div", { key: '07db530eb50feade70f4b1a4d39d7ea760d322be', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, h("post-icon", { key: '8a0c6f7713bc3731e937a16542b0d6aca1cad444', "aria-hidden": "true", name: "chevronleft" })), h("nav", { key: '2919c6be730d64d7ca901a2ffa066c6aa0b6da0b', ref: el => (this.navbar = el), "aria-label": this.textMain }, h("slot", { key: '87481c7880f72774fb2c9d3847db171bf6ea9b69' })), h("div", { key: '768c2476e98aa163a23c8717f44ffa4dfd397bcc', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, h("post-icon", { key: '286b02ce9e3e8f3920251f3420c4e07288b306cc', "aria-hidden": "true", name: "chevronright" }))));
|
|
127
127
|
}
|
|
128
128
|
static get is() { return "post-mainnavigation"; }
|
|
129
129
|
static get encapsulation() { return "shadow"; }
|
|
@@ -293,7 +293,7 @@ export class PostMegadropdown {
|
|
|
293
293
|
}
|
|
294
294
|
render() {
|
|
295
295
|
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
296
|
-
return (h(Host, { key: '
|
|
296
|
+
return (h(Host, { key: '78ca1dd237507aa79ab27e14b799be6b557527e4', version: version }, h("div", { key: '98b9d8ad4591f629555cecf3aaac9066bd80d3e3', ref: el => (this.animatedContainer = el), class: "megadropdown", style: containerStyle }, h("div", { key: 'fd93c498a754ba4c01df5551d27980b943efcd16', class: "section" }, this.device !== 'desktop' && this.megadropdownTitle && (h("p", { key: 'bd053626c0faae37625d8cc593d3920986fe6266', class: "megadropdown-title" }, this.megadropdownTitle)), h("div", { key: '0f93113c12833d7161000e56ea08b26b4ebf8552', class: "megadropdown-content" }, h("slot", { key: '09ddced0de6ea2922e97726dff1ee84d8135f755' })), this.device === 'desktop' ? (h("post-closebutton", { onClick: () => this.hide(true), class: "close-button", size: "small", placement: "manual" }, this.textClose)) : (h("button", { onClick: () => this.hide(true), class: "back-button" }, h("post-icon", { name: "arrowleft" }), this.textBack))))));
|
|
297
297
|
}
|
|
298
298
|
static get is() { return "post-megadropdown"; }
|
|
299
299
|
static get encapsulation() { return "shadow"; }
|
|
@@ -77,7 +77,7 @@ export class PostMegadropdownTrigger {
|
|
|
77
77
|
this.megadropdown.toggle();
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: 'f974aa3ce0dc011784b1d64d8b3e8e165ef8608b', "data-version": version }, h("button", { key: 'c24a29b41b3eb6a67c32b7433cd138b492c29c7a', ref: el => (this.interactiveButton = el), type: "button", "aria-haspopup": "menu", "aria-expanded": this.isMegadropdownExpanded.toString(), onClick: this.onClick.bind(this), onKeyDown: this.onKeyDown.bind(this), class: { active: this.active } }, h("span", { key: 'eaa781138c99d5da1f176bfdefa89bed84468bfe' }, h("span", { key: '7164eedf63eda5fbbb69c557f186db1cf4d049f9', innerHTML: this.slottedContent }), h("span", { key: '05681cba35d42b159409230d7535662f87f495f3', "aria-hidden": "true" }, h("slot", { key: '6732bbedae6ed09806e145c417100a94b14357f0' }))), h("post-icon", { key: '32e38c328b482a2405f89afd9b6feb9346e02d2b', name: "chevrondown" }))));
|
|
81
81
|
}
|
|
82
82
|
static get is() { return "post-megadropdown-trigger"; }
|
|
83
83
|
static get encapsulation() { return "shadow"; }
|
|
@@ -189,10 +189,13 @@ export class PostMenu {
|
|
|
189
189
|
// If the element is a slot, get the assigned elements
|
|
190
190
|
.flatMap(el => (el instanceof HTMLSlotElement ? el.assignedElements() : el))
|
|
191
191
|
// For each menu item, get any focusable children (e.g., buttons, links)
|
|
192
|
-
.flatMap(el =>
|
|
192
|
+
.flatMap(el => [
|
|
193
|
+
...getFocusableChildren(el),
|
|
194
|
+
...(el.shadowRoot ? getFocusableChildren(el.shadowRoot) : []),
|
|
195
|
+
]));
|
|
193
196
|
}
|
|
194
197
|
render() {
|
|
195
|
-
return (h(Host, { key: '
|
|
198
|
+
return (h(Host, { key: '6931365341e8a5476c27e5a35d84823162d3a904', "data-version": version }, h("post-popovercontainer", { key: '441654449ad9708c5eba02a383567771cab7a848', onPostShow: this.handlePostShown.bind(this), onPostBeforeToggle: this.handlePostBeforeToggle.bind(this), placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '6436553c2b7c35901a84b3a50798b561dfbb008c', part: "post-menu" }, h("slot", { key: 'af2a5159f3b8e039d00fc6cb1734740eede78121', name: "header" }), h("slot", { key: '01e671b55c02342936efe703dac97096f38b131c' })))));
|
|
196
199
|
}
|
|
197
200
|
static get is() { return "post-menu"; }
|
|
198
201
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;
|
|
1
|
+
post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{width:100%;position:relative;display:flex;align-items:center;padding:.5rem .75rem .5rem 1rem;gap:.75rem;font-size:.875rem;color:#050400;border-radius:0}post-menu-item button post-icon,post-menu-item a post-icon{width:1rem;height:1rem;margin-block:.25rem}@media screen and (min-width: 780px){post-menu-item button,post-menu-item a{font-size:1rem;padding-block:.75rem;gap:1rem}post-menu-item button post-icon,post-menu-item a post-icon{width:1.5rem;height:1.5rem;margin:0}}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem;padding-block:.8125rem}}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:2px !important;border-radius:4px}post-menu-item button:hover,post-menu-item a:hover{background-color:#504f4b;color:#fff}
|
|
@@ -59,7 +59,7 @@ export class PostMenuTrigger {
|
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
62
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: '574ff0ab723270c5a2614e8a34951febc51221ed', "data-version": version }, h("slot", { key: 'cf223c3e85d9ad8b49ba209fa165a27605b9fd09' })));
|
|
63
63
|
}
|
|
64
64
|
static get is() { return "post-menu-trigger"; }
|
|
65
65
|
static get encapsulation() { return "shadow"; }
|
|
@@ -88,10 +88,10 @@ export class PostNumberInput {
|
|
|
88
88
|
}
|
|
89
89
|
render() {
|
|
90
90
|
const areButtonsShown = !!this.input;
|
|
91
|
-
return (h(Host, { key: '
|
|
91
|
+
return (h(Host, { key: 'c8ef21f14edba7dcaf82dc66d7735f3ab3022e4f', "data-version": version, class: {
|
|
92
92
|
'number-input-sm': this.small,
|
|
93
93
|
'disabled': this.isDisabled,
|
|
94
|
-
} }, areButtonsShown && (h("div", { key: '
|
|
94
|
+
} }, areButtonsShown && (h("div", { key: '585049836ec48c09bcf49019375d798d58b1d56b', "aria-hidden": "true", onPointerDown: () => this.step('down'), class: { 'step-button': true, 'disabled': this.isDecrementDisabled } }, h("post-icon", { key: '1891fc6f71f9251e32b254d6a2da72560c86d3f2', name: "minus" }))), h("div", { key: '8cffde72970f70573f7d9afacd023bc87b9d9bae', class: "input-container" }, h("slot", { key: '69cdc0bef28f380690ce4d4887a3bec3a1dc30b9', onSlotchange: () => this.setupInput() })), areButtonsShown && (h("div", { key: '85cc8b04413b1a50ec493b45638f451fc2b5e0fd', "aria-hidden": "true", onPointerDown: () => this.step('up'), class: { 'step-button': true, 'disabled': this.isIncrementDisabled } }, h("post-icon", { key: '00b3a503d183042a406618aaad9a0e3f512e13e7', name: "plus" })))));
|
|
95
95
|
}
|
|
96
96
|
static get is() { return "post-number-input"; }
|
|
97
97
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import { nanoid } from "
|
|
4
|
-
import { checkEmptyOrType, checkRequiredAndType, debounce } from "../../utils/index";
|
|
3
|
+
import { checkEmptyOrType, checkRequiredAndType, debounce, nanoid } from "../../utils/index";
|
|
5
4
|
const ELLIPSIS = '...';
|
|
6
5
|
const MEASUREMENT_DEBOUNCE_MS = 50;
|
|
7
6
|
const RESIZE_DEBOUNCE_MS = 150;
|
|
@@ -62,7 +62,7 @@ export class PostPopover {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return (h(Host, { key: '
|
|
65
|
+
return (h(Host, { key: 'ebbd011aecf3ec0537ae6f27565ae89c4de23520', "data-version": version }, h("post-popovercontainer", { key: 'ed7fe6aa0355ca55e53aa4ae460ea1a40b3f7d82', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '10743a794d6aa31f0847f994800108ebab7c0f34', class: "popover-container" }, h("div", { key: 'dba753e2d2d45989b98ec91a79fe7425f9c9acb6', class: "popover-content" }, h("slot", { key: '2cce9dbfc1bdeda0bb64807dcf5d1cf95255b299' })), h("post-closebutton", { key: 'dd3303403d326eb2fe43f6d3f44b7c5684c8747e', onClick: () => this.hide() }, this.textClose)))));
|
|
66
66
|
}
|
|
67
67
|
static get is() { return "post-popover"; }
|
|
68
68
|
static get encapsulation() { return "shadow"; }
|
|
@@ -105,7 +105,7 @@ export class PostPopoverTrigger {
|
|
|
105
105
|
this.popover?.removeEventListener('postToggle', this.boundHandlePostToggle);
|
|
106
106
|
}
|
|
107
107
|
render() {
|
|
108
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: 'b439e93193ac8e1e7cdceb5b0dcd59de6659400c', "data-version": version }, h("slot", { key: '3a4e192ec9656f2a4b4c69f8d9c8589d770f50b8', onSlotchange: () => this.setupTrigger() })));
|
|
109
109
|
}
|
|
110
110
|
static get is() { return "post-popover-trigger"; }
|
|
111
111
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer polyfill{@supports not selector(:popover-open){:host([popover]:not(.\:popover-open)){display:none}}}:host{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:host>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px;position:relative}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host>div{border:2px solid rgba(0,0,0,0)}}:host [part=post-popovercontainer-border-mask]{display:none;position:absolute;inset:0;border-radius:4px;pointer-events:none}:host .arrow{--post-popovercontainer-arrow-border: var(--post-popovercontainer-arrow-border-width, 0px) solid var(--post-popovercontainer-arrow-border-color, transparent);position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:host .arrow[dynamic-placement=top]{border-bottom-right-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=right]{border-bottom-left-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=bottom]{border-top-left-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=left]{border-top-right-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .arrow[dynamic-placement=top]{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);bottom:-0.3796735336rem !important}:host .arrow[dynamic-placement=left]{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);right:-0.3796735336rem !important}:host .arrow[dynamic-placement=right]{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);left:-0.3796735336rem !important}:host .arrow[dynamic-placement=bottom]{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);top:-0.3796735336rem !important}}:host([tooltip]){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:host([safe-space])::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:host([safe-space=triangle])::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:host([safe-space=trapezoid])::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:host(:not(:has(.arrow)))>div{box-shadow:var(--post-device-elevation-300)}:host(:has(.arrow))>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=top]))>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=left]))>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=right]))>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}
|
|
1
|
+
@layer polyfill{@supports not selector(:popover-open){:host([popover]:not(.\:popover-open)){display:none}}}:host{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:host>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px;position:relative}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host>div{border:2px solid rgba(0,0,0,0)}}:host .popover-scroll{max-height:var(--post-popovercontainer-available-height, none);overflow-y:auto}:host [part=post-popovercontainer-border-mask]{display:none;position:absolute;inset:0;border-radius:4px;pointer-events:none}:host .arrow{--post-popovercontainer-arrow-border: var(--post-popovercontainer-arrow-border-width, 0px) solid var(--post-popovercontainer-arrow-border-color, transparent);position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:host .arrow[dynamic-placement=top]{border-bottom-right-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=right]{border-bottom-left-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=bottom]{border-top-left-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=left]{border-top-right-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .arrow[dynamic-placement=top]{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);bottom:-0.3796735336rem !important}:host .arrow[dynamic-placement=left]{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);right:-0.3796735336rem !important}:host .arrow[dynamic-placement=right]{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);left:-0.3796735336rem !important}:host .arrow[dynamic-placement=bottom]{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);top:-0.3796735336rem !important}}:host([tooltip]){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:host([safe-space])::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:host([safe-space=triangle])::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:host([safe-space=trapezoid])::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:host(:not(:has(.arrow)))>div{box-shadow:var(--post-device-elevation-300)}:host(:has(.arrow))>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=top]))>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=left]))>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:host(:has(.arrow[dynamic-placement=right]))>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}
|
|
@@ -269,10 +269,9 @@ export class PostPopovercontainer {
|
|
|
269
269
|
// flip should come before shift. For non-aligned, shift before flip.
|
|
270
270
|
...(isAligned ? [flipMiddleware, shiftMiddleware] : [shiftMiddleware, flipMiddleware]),
|
|
271
271
|
size({
|
|
272
|
-
apply({ availableWidth, elements }) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
});
|
|
272
|
+
apply({ availableWidth, availableHeight, elements }) {
|
|
273
|
+
elements.floating.style.maxWidth = `${availableWidth - gap * 2}px`;
|
|
274
|
+
elements.floating.style.setProperty('--post-popovercontainer-available-height', `${availableHeight - gap * 2}px`);
|
|
276
275
|
},
|
|
277
276
|
}),
|
|
278
277
|
];
|
|
@@ -346,9 +345,9 @@ export class PostPopovercontainer {
|
|
|
346
345
|
}
|
|
347
346
|
}
|
|
348
347
|
render() {
|
|
349
|
-
return (h(Host, { key: '
|
|
348
|
+
return (h(Host, { key: 'f3d2037a35648aef9031ecb96db8f1755cb06fc9', "data-version": version, popover: "auto" }, h("div", { key: '19a5300eb1388eb51764eae39fc0911864336282', part: "post-popovercontainer-content", class: "popover-content" }, this.arrow && (h("span", { key: 'e7c67a359968faa9001c4be657db7d6930fe6075', "dynamic-placement": this.dynamicPlacement, class: "arrow", ref: el => {
|
|
350
349
|
this.arrowRef = el;
|
|
351
|
-
} })), h("span", { key: '
|
|
350
|
+
} })), h("span", { key: 'b7477bc2e03c196c5983f6b933cedc20b2ed59f8', part: "post-popovercontainer-border-mask" }), h("div", { key: '7c1c50cbd766f6f901e9f3579c6e609da4cf3e37', class: "popover-scroll" }, h("slot", { key: '56c646c3bec1437e394ce0b76cea0f6bc4c6637f' })))));
|
|
352
351
|
}
|
|
353
352
|
static get is() { return "post-popovercontainer"; }
|
|
354
353
|
static get encapsulation() { return "shadow"; }
|
|
@@ -87,7 +87,7 @@ export class PostRating {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
render() {
|
|
90
|
-
return (h(Host, { key: '
|
|
90
|
+
return (h(Host, { key: 'bd452616dc47e25ae0f97eb77869e558eb0e199c', "data-version": version }, h("div", { key: 'a2d59f6007b337d906af31f7ebc4cc57022b0e67', 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} / ${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: {
|
|
91
91
|
'star': true,
|
|
92
92
|
'before-hover': i < this.hoveredIndex,
|
|
93
93
|
'active': i < Math.round(this.currentRating),
|
|
@@ -107,7 +107,7 @@ export class PostStepper {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
render() {
|
|
110
|
-
return (h(Host, { key: '
|
|
110
|
+
return (h(Host, { key: 'eb916a1b9169dc3a461e6307bce1d548d3e49890', "data-version": version }, h("ol", { key: '4e9460bdae8f3ab56789a60e925a3229cb0140ec' }, h("slot", { key: '6da9d8e162d901fdb5cb5edeaf7e394948cca663', onSlotchange: () => this.updateSteps() })), h("div", { key: '546c1da3029799c97fcd5d6146933ee1dd7f7ade', class: "active-step", "aria-hidden": "true" }, h("span", { key: '581c306bd6d7b840c7f74d96199e0197b550e9e0', class: "active-step-label" }, this.mobileActiveStepLabel), h("span", { key: 'c794108854a153e4005b8a3bb4a609fb6441f966', innerHTML: this.mobileActiveStepName }))));
|
|
111
111
|
}
|
|
112
112
|
static get is() { return "post-stepper"; }
|
|
113
113
|
static get encapsulation() { return "shadow"; }
|
|
@@ -2,7 +2,7 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
3
|
export class PostStepperItem {
|
|
4
4
|
render() {
|
|
5
|
-
return (h(Host, { key: '
|
|
5
|
+
return (h(Host, { key: '7f3df658eb7640f582e438f218e3ec62fbb4edee', "data-version": version, role: "listitem" }, h("span", { key: 'bb7b02a3cca04d16626f66c52eb08085a8e9cb26', class: "stepper-item-content" }, h("span", { key: '78ca87ae8956838bc7fffec8e6d9121aa4aa14da', class: "step-hidden-label visually-hidden" }), h("span", { key: '6beecc79f02ed51046e6b7cc5006c305c821f9bc', class: "label" }, h("slot", { key: '5701a12b73a29bd629fa361bcd838c9a7ec88869' })))));
|
|
6
6
|
}
|
|
7
7
|
static get is() { return "post-stepper-item"; }
|
|
8
8
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import { checkRequiredAndType } from "../../utils/index";
|
|
4
|
-
import { nanoid } from "nanoid";
|
|
3
|
+
import { checkRequiredAndType, nanoid } from "../../utils/index";
|
|
5
4
|
/**
|
|
6
5
|
* @slot default - Slot for the content of the tab item. Can contain text or an <a> element for navigation mode.
|
|
7
6
|
*/
|
|
@@ -33,7 +32,7 @@ export class PostTabItem {
|
|
|
33
32
|
this.isNavigationMode = hasAnchor;
|
|
34
33
|
}
|
|
35
34
|
render() {
|
|
36
|
-
return (h(Host, { key: '
|
|
35
|
+
return (h(Host, { key: '9b37b37c161a3a67d30443c5115cc08b90322e34', id: this.tabId, role: !this.isNavigationMode ? 'tab' : undefined, "data-version": version, "data-navigation-mode": this.isNavigationMode.toString(), "aria-selected": !this.isNavigationMode ? 'false' : undefined, tabindex: !this.isNavigationMode ? '-1' : undefined, class: !this.isNavigationMode ? 'tab-title' : 'nav-item' }, h("slot", { key: '63472a86d5d0dfa8e6d1b39677244781205f0c70' })));
|
|
37
36
|
}
|
|
38
37
|
static get is() { return "post-tab-item"; }
|
|
39
38
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import { nanoid } from "
|
|
4
|
-
import { checkRequiredAndType } from "../../utils/index";
|
|
3
|
+
import { checkRequiredAndType, nanoid } from "../../utils/index";
|
|
5
4
|
/**
|
|
6
5
|
* @slot default - Slot for placing the content of the tab panel.
|
|
7
6
|
*/
|
|
@@ -15,7 +14,7 @@ export class PostTabPanel {
|
|
|
15
14
|
this.panelId = `panel-${this.host.id || nanoid(6)}`;
|
|
16
15
|
}
|
|
17
16
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
17
|
+
return (h(Host, { key: 'f6e981cdce4b09ddc60c4fd2cf56af26db9ea7ee', "data-version": version, id: this.panelId, role: "tabpanel", slot: "panels" }, h("slot", { key: '79f2c065cb364b1c15717f349e57e832e06ef054' })));
|
|
19
18
|
}
|
|
20
19
|
static get is() { return "post-tab-panel"; }
|
|
21
20
|
static get encapsulation() { return "shadow"; }
|
|
@@ -291,10 +291,10 @@ export class PostTabs {
|
|
|
291
291
|
}
|
|
292
292
|
render() {
|
|
293
293
|
const TabsContainer = this.isNavigationMode ? 'nav' : 'div';
|
|
294
|
-
return (h(Host, { key: '
|
|
294
|
+
return (h(Host, { key: 'edb1e06b1b1cdd23db32e42ff77dbc64a44905f0', "data-version": version }, h("div", { key: 'd86eb9bb592aff23c38c92b12dfd72623d67f194', class: "tabs-wrapper", part: "post-tabs" }, h(TabsContainer, { key: '6646284be80e647c96065b3c791f34c4b64627f3', class: "tabs", role: this.isNavigationMode ? undefined : 'tablist', "aria-label": this.isNavigationMode ? this.label : undefined }, h("slot", { key: 'c71ddf4391144b7cb71671e8f564e723c408e723', onSlotchange: () => {
|
|
295
295
|
this.moveMisplacedTabs();
|
|
296
296
|
this.enableTabs();
|
|
297
|
-
} }))), !this.isNavigationMode && (h("div", { key: '
|
|
297
|
+
} }))), !this.isNavigationMode && (h("div", { key: '625d5b7d8ab2e8cfacce0c2ac6fa94d6f6fc2953', class: "tab-content", part: "post-tabs-content" }, h("slot", { key: '1ddaf37e585d3e9fbb9722e09829956e28dc7fd6', name: "panels", onSlotchange: () => this.moveMisplacedPanels() })))));
|
|
298
298
|
}
|
|
299
299
|
static get is() { return "post-tabs"; }
|
|
300
300
|
static get encapsulation() { return "shadow"; }
|
|
@@ -27,7 +27,7 @@ export class PostTogglebutton {
|
|
|
27
27
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e), { capture: true });
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: '828f375bfd28dd8f46c2c233cef90abe6c27c488', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '35325c8481638cf30593cda05a67ee74b38bb40c' })));
|
|
31
31
|
}
|
|
32
32
|
static get is() { return "post-togglebutton"; }
|
|
33
33
|
static get encapsulation() { return "shadow"; }
|
|
@@ -64,7 +64,7 @@ export class PostTooltip {
|
|
|
64
64
|
}
|
|
65
65
|
render() {
|
|
66
66
|
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: 'd2927c8847a39198bc0f8ecc62071534a35959d4', "data-version": version }, h("post-popovercontainer", { key: '691d408109cc976d8a46ffeafa6af7ce343fc9da', 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: '85eb8a3ca3e0359044ddc4b24562f0a43d459dc9' }))));
|
|
68
68
|
}
|
|
69
69
|
static get is() { return "post-tooltip"; }
|
|
70
70
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { h, Host, Build } from "@stencil/core";
|
|
2
|
-
import { checkEmptyOrType } from "../../utils/index";
|
|
2
|
+
import { checkEmptyOrType } from "../../utils/property-checkers/index";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
|
-
import isFocusable from "ally.js/is/focusable";
|
|
5
4
|
const TRIGGER_EVENTS = ['pointerenter', 'pointerleave', 'focusin', 'focusout', 'long-press'];
|
|
6
|
-
|
|
7
|
-
(async () => {
|
|
8
|
-
await import('long-press-event');
|
|
9
|
-
})();
|
|
10
|
-
}
|
|
5
|
+
let isFocusable;
|
|
11
6
|
/**
|
|
12
7
|
* @slot default - Content to trigger the tooltip. Can contain any focusable element or will be made focusable automatically.
|
|
13
8
|
*/
|
|
@@ -37,6 +32,17 @@ export class PostTooltipTrigger {
|
|
|
37
32
|
const ref = document.getElementById(this.for);
|
|
38
33
|
return ref?.localName === 'post-tooltip' ? ref : null;
|
|
39
34
|
}
|
|
35
|
+
componentWillLoad() {
|
|
36
|
+
if (Build.isBrowser) {
|
|
37
|
+
// Fire-and-forget: long-press-event registers a global event listener on import.
|
|
38
|
+
import('long-press-event');
|
|
39
|
+
// Load ally.js lazily; setupTrigger uses optional chaining to handle the
|
|
40
|
+
// case where it hasn't loaded yet (falls back to adding tabindex="0").
|
|
41
|
+
import('ally.js/is/focusable').then(m => {
|
|
42
|
+
isFocusable ?? (isFocusable = m.default);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
40
46
|
componentDidLoad() {
|
|
41
47
|
this.setupTrigger();
|
|
42
48
|
this.attachListeners();
|
|
@@ -76,7 +82,7 @@ export class PostTooltipTrigger {
|
|
|
76
82
|
setupTrigger() {
|
|
77
83
|
this.trigger = this.host.querySelector('*');
|
|
78
84
|
if (this.trigger) {
|
|
79
|
-
if (!isFocusable(this.trigger)) {
|
|
85
|
+
if (!isFocusable?.(this.trigger)) {
|
|
80
86
|
this.trigger.setAttribute('tabindex', '0');
|
|
81
87
|
}
|
|
82
88
|
const describedBy = this.trigger.getAttribute('aria-describedby') || '';
|
|
@@ -169,7 +175,7 @@ export class PostTooltipTrigger {
|
|
|
169
175
|
this.tooltip?.hide();
|
|
170
176
|
}
|
|
171
177
|
render() {
|
|
172
|
-
return (h(Host, { key: '
|
|
178
|
+
return (h(Host, { key: '33feebd0dace3160a539e4dc809b0b31e7d7d40b', "data-version": version }, h("slot", { key: '8994560a784d203ad40face20a60ac5bc631507f', onSlotchange: () => this.handleSlotChange() })));
|
|
173
179
|
}
|
|
174
180
|
static get is() { return "post-tooltip-trigger"; }
|
|
175
181
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* eslint-disable unicorn/no-empty-file */
|
|
2
|
+
/**
|
|
3
|
+
* This is a stub file for stencils hydrate app (helps generating declarative shadow DOM (DSD) during server-side rendering).
|
|
4
|
+
* Whenever the hydrate app is imported in a non-nodejs environment, this stub file will be returned instead.
|
|
5
|
+
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './property-checkers';
|
|
2
|
+
export * from './property-decorators';
|
|
2
3
|
export * from './attribute-observer';
|
|
3
4
|
export * from './breakpoints';
|
|
4
5
|
export * from './component-on-ready';
|
|
@@ -14,3 +15,4 @@ export * from './sass-export';
|
|
|
14
15
|
export * from './timeout';
|
|
15
16
|
export * from './is-iso-date';
|
|
16
17
|
export * from './locales';
|
|
18
|
+
export * from './nanoid';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { check } from "language-tags";
|
|
2
1
|
export const FALLBACK_LANGUAGE_CODE = 'en';
|
|
3
2
|
export const FALLBACK_LOCALE_CODE = 'en-GB';
|
|
4
3
|
export const BUDDHIST_CALENDAR_YEAR_OFFSET = 543;
|
|
@@ -13,5 +12,13 @@ export function getLocaleTextDirection(locale) {
|
|
|
13
12
|
return new Date().toLocaleDateString(locale).includes(UNICODE_BIDI.rtl) ? 'rtl' : 'ltr';
|
|
14
13
|
}
|
|
15
14
|
export function isValidLocale(locale) {
|
|
16
|
-
|
|
15
|
+
if (!locale)
|
|
16
|
+
return false;
|
|
17
|
+
try {
|
|
18
|
+
return Intl.DateTimeFormat.supportedLocalesOf(locale).length > 0;
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
console.log(err);
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
17
24
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initially copy'n'pasted from https://github.com/ai/nanoid/blob/main/non-secure/index.js, then adopted to our needs.
|
|
3
|
+
*
|
|
4
|
+
* Our custom implementation generates unique IDs for DOM elements efficiently without requiring cryptographic security (as nanoid).
|
|
5
|
+
* It eliminates the nanoid package dependency (as well as the transistive `node:crypto` dependency in node environments), meeting all our requirements.
|
|
6
|
+
* This approach optimizes performance and minimizes the codebase footprint.
|
|
7
|
+
*/
|
|
8
|
+
const ALPHABET = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
9
|
+
export function nanoid(size = 21) {
|
|
10
|
+
const bytes = crypto.getRandomValues(new Uint8Array(size));
|
|
11
|
+
let id = '';
|
|
12
|
+
for (let i = 0; i < size; i++) {
|
|
13
|
+
id += ALPHABET[bytes[i] & 63];
|
|
14
|
+
}
|
|
15
|
+
return id;
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createValidatorDecorator, getValidationContext } from "./create-validator-decorator";
|
|
2
|
+
/**
|
|
3
|
+
* Property decorator that validates the property value is an array of the specified type.
|
|
4
|
+
*
|
|
5
|
+
* Validation runs on `componentDidLoad` and whenever the property value changes.
|
|
6
|
+
*
|
|
7
|
+
* @param type - The expected type of each array element ('boolean', 'number', 'string').
|
|
8
|
+
*/
|
|
9
|
+
export function ArrayOf(type) {
|
|
10
|
+
return createValidatorDecorator({
|
|
11
|
+
priority: 1,
|
|
12
|
+
blocking: false,
|
|
13
|
+
run(component, property) {
|
|
14
|
+
const { value, showError } = getValidationContext(component, property);
|
|
15
|
+
if (!Array.isArray(value) || value.some(val => typeof val !== type)) {
|
|
16
|
+
showError(`must be a "${type}" array`);
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|