@zanichelli/albe-web-components 18.7.7-RC1 → 18.8.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/CHANGELOG.md +30 -0
- package/dist/cjs/index-96af6326.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +18 -18
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-avatar.cjs.entry.js +2 -2
- package/dist/cjs/z-book-card.cjs.entry.js +15 -14
- package/dist/cjs/z-book-card.cjs.entry.js.map +1 -1
- package/dist/{components/placeholder-cover.js → cjs/z-book-cover.cjs.entry.js} +26 -2
- package/dist/cjs/z-book-cover.cjs.entry.js.map +1 -0
- package/dist/cjs/z-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/z-button-sort.cjs.entry.js +1 -1
- package/dist/cjs/z-chip.cjs.entry.js +2 -2
- package/dist/cjs/z-combobox.cjs.entry.js +26 -41
- package/dist/cjs/z-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/z-cover-hero.cjs.entry.js +2 -2
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +4 -4
- package/dist/cjs/z-ghost-loading.cjs.entry.js +1 -1
- package/dist/cjs/z-info-box.cjs.entry.js +1 -1
- package/dist/cjs/z-info-reveal.cjs.entry.js +1 -1
- package/dist/cjs/z-logo.cjs.entry.js +1 -1
- package/dist/cjs/z-menu-section.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-icon.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-list.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card_4.cjs.entry.js +4 -4
- package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-list.cjs.entry.js +1 -1
- package/dist/cjs/z-navigation-tabs.cjs.entry.js +2 -2
- package/dist/cjs/z-notification.cjs.entry.js +1 -1
- package/dist/cjs/z-otp.cjs.entry.js +2 -2
- package/dist/cjs/z-panel-elem.cjs.entry.js +2 -2
- package/dist/cjs/z-popover.cjs.entry.js +1 -1
- package/dist/cjs/z-result-card.cjs.entry.js +6 -14
- package/dist/cjs/z-result-card.cjs.entry.js.map +1 -1
- package/dist/cjs/z-select.cjs.entry.js +2 -2
- package/dist/cjs/z-select.cjs.entry.js.map +1 -1
- package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
- package/dist/cjs/z-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/z-stepper.cjs.entry.js +1 -1
- package/dist/cjs/z-toast-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
- package/dist/cjs/z-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/z-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/z-visually-hidden.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/book-card/z-book-card/index.js +66 -29
- package/dist/collection/components/book-card/z-book-card/index.js.map +1 -1
- package/dist/collection/components/book-card/z-book-card/index.stories.js +11 -13
- package/dist/collection/components/book-card/z-book-card/index.stories.js.map +1 -1
- package/dist/collection/components/book-card/z-book-card/styles.css +35 -67
- package/dist/collection/components/z-app-header/index.js +2 -1
- package/dist/collection/components/z-app-header/index.js.map +1 -1
- package/dist/collection/components/z-app-header/index.stories.js +16 -0
- package/dist/collection/components/z-app-header/index.stories.js.map +1 -1
- package/dist/collection/components/z-app-header/styles.css +2 -1
- package/dist/collection/components/z-aria-alert/index.js +1 -1
- package/dist/collection/components/z-avatar/index.js +2 -2
- package/dist/collection/components/z-book-cover/index.js +113 -0
- package/dist/collection/components/z-book-cover/index.js.map +1 -0
- package/dist/collection/components/z-book-cover/index.stories.js +31 -0
- package/dist/collection/components/z-book-cover/index.stories.js.map +1 -0
- package/dist/collection/components/z-book-cover/styles.css +95 -0
- package/dist/collection/components/z-breadcrumb/index.js +2 -2
- package/dist/collection/components/z-button-sort/index.js +1 -1
- package/dist/collection/components/z-chip/index.js +2 -2
- package/dist/collection/components/z-combobox/index.js +25 -40
- package/dist/collection/components/z-combobox/index.js.map +1 -1
- package/dist/collection/components/z-combobox/styles.css +0 -8
- package/dist/collection/components/z-cover-hero/index.js +2 -2
- package/dist/collection/components/z-divider/index.js +1 -1
- package/dist/collection/components/z-ghost-loading/index.js +1 -1
- package/dist/collection/components/z-info-box/index.js +1 -1
- package/dist/collection/components/z-info-reveal/index.js +1 -1
- package/dist/collection/components/z-input/index.js +17 -19
- package/dist/collection/components/z-input/index.js.map +1 -1
- package/dist/collection/components/z-input-message/index.js +1 -1
- package/dist/collection/components/z-logo/index.js +1 -1
- package/dist/collection/components/z-menu-section/index.js +1 -1
- package/dist/collection/components/z-modal/index.js +4 -4
- package/dist/collection/components/z-navigation-tabs/index.js +2 -2
- package/dist/collection/components/z-notification/index.js +1 -1
- package/dist/collection/components/z-offcanvas/index.js +21 -1
- package/dist/collection/components/z-offcanvas/index.js.map +1 -1
- package/dist/collection/components/z-offcanvas/index.stories.js +12 -0
- package/dist/collection/components/z-offcanvas/index.stories.js.map +1 -1
- package/dist/collection/components/z-offcanvas/styles.css +5 -4
- package/dist/collection/components/z-panel-elem/index.js +2 -2
- package/dist/collection/components/z-popover/index.js +1 -1
- package/dist/collection/components/{result-card/z-result-card → z-result-card}/index.js +10 -18
- package/dist/collection/components/z-result-card/index.js.map +1 -0
- package/dist/collection/components/{result-card/z-result-card → z-result-card}/styles.css +39 -108
- package/dist/collection/components/z-result-card/z-result-card.stories.js.map +1 -0
- package/dist/collection/components/z-searchbar/index.js +1 -1
- package/dist/collection/components/z-select/index.js +2 -2
- package/dist/collection/components/z-select/index.js.map +1 -1
- package/dist/collection/components/z-skip-to-content/index.js +1 -1
- package/dist/collection/components/z-stepper/index.js +1 -1
- package/dist/collection/components/z-stepper-item/index.js +1 -1
- package/dist/collection/components/z-toast-notification/index.js +1 -1
- package/dist/collection/components/z-toast-notification-list/index.js +1 -1
- package/dist/collection/components/z-toggle-button/index.js +2 -2
- package/dist/collection/components/z-toggle-switch/index.js +3 -3
- package/dist/collection/components/z-tooltip/index.js +1 -1
- package/dist/collection/components/z-visually-hidden/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js +2 -2
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index10.js +24 -65
- package/dist/components/index10.js.map +1 -1
- package/dist/components/index11.js +58 -308
- package/dist/components/index11.js.map +1 -1
- package/dist/components/index12.js +311 -37
- package/dist/components/index12.js.map +1 -1
- package/dist/components/index13.js +40 -27
- package/dist/components/index13.js.map +1 -1
- package/dist/components/index14.js +23 -151
- package/dist/components/index14.js.map +1 -1
- package/dist/components/index15.js +144 -37
- package/dist/components/index15.js.map +1 -1
- package/dist/components/index16.js +42 -1008
- package/dist/components/index16.js.map +1 -1
- package/dist/components/index17.js +1012 -37
- package/dist/components/index17.js.map +1 -1
- package/dist/components/index18.js +42 -10
- package/dist/components/index18.js.map +1 -1
- package/dist/components/index19.js +10 -22
- package/dist/components/index19.js.map +1 -1
- package/dist/components/index20.js +16 -33
- package/dist/components/index20.js.map +1 -1
- package/dist/components/index21.js +39 -43
- package/dist/components/index21.js.map +1 -1
- package/dist/components/index22.js +44 -81
- package/dist/components/index22.js.map +1 -1
- package/dist/components/index23.js +60 -430
- package/dist/components/index23.js.map +1 -1
- package/dist/components/index24.js +415 -341
- package/dist/components/index24.js.map +1 -1
- package/dist/components/index25.js +376 -19
- package/dist/components/index25.js.map +1 -1
- package/dist/components/index26.js +45 -0
- package/dist/components/index26.js.map +1 -0
- package/dist/components/index3.js +1 -1
- package/dist/components/index4.js +23 -60
- package/dist/components/index4.js.map +1 -1
- package/dist/components/index5.js +53 -27
- package/dist/components/index5.js.map +1 -1
- package/dist/components/index6.js +34 -18
- package/dist/components/index6.js.map +1 -1
- package/dist/components/index7.js +18 -41
- package/dist/components/index7.js.map +1 -1
- package/dist/components/index8.js +41 -11
- package/dist/components/index8.js.map +1 -1
- package/dist/components/index9.js +10 -28
- package/dist/components/index9.js.map +1 -1
- package/dist/components/z-accordion.js +1 -1
- package/dist/components/z-anchor-navigation.js +2 -2
- package/dist/components/z-app-header-deprecated.js +11 -11
- package/dist/components/z-app-header.js +13 -13
- package/dist/components/z-app-header.js.map +1 -1
- package/dist/components/z-aria-alert.js +1 -1
- package/dist/components/z-avatar.js +2 -2
- package/dist/components/z-book-card-app.js +2 -2
- package/dist/components/z-book-card-deprecated.js +1 -1
- package/dist/components/z-book-card.js +26 -17
- package/dist/components/z-book-card.js.map +1 -1
- package/dist/components/z-book-cover.d.ts +11 -0
- package/dist/components/z-book-cover.js +8 -0
- package/dist/components/z-book-cover.js.map +1 -0
- package/dist/components/z-breadcrumb.js +8 -8
- package/dist/components/z-button-sort.js +2 -2
- package/dist/components/z-button.js +1 -1
- package/dist/components/z-card.js +1 -1
- package/dist/components/z-carousel.js +3 -3
- package/dist/components/z-chip.js +1 -1
- package/dist/components/z-combobox.js +32 -47
- package/dist/components/z-combobox.js.map +1 -1
- package/dist/components/z-cover-hero.js +2 -2
- package/dist/components/z-date-picker.js +3 -3
- package/dist/components/z-divider.js +1 -1
- package/dist/components/z-dragdrop-area.js +1 -1
- package/dist/components/z-file-upload.js +4 -4
- package/dist/components/z-file.js +3 -3
- package/dist/components/z-ghost-loading.js +1 -1
- package/dist/components/z-icon.js +1 -1
- package/dist/components/z-info-box.js +2 -2
- package/dist/components/z-info-reveal.js +1 -1
- package/dist/components/z-input-message.js +1 -1
- package/dist/components/z-input.js +1 -1
- package/dist/components/z-list-element.js +1 -1
- package/dist/components/z-list-group.js +1 -1
- package/dist/components/z-list.js +1 -1
- package/dist/components/z-logo.js +1 -1
- package/dist/components/z-menu-deprecated.js +1 -1
- package/dist/components/z-menu-section-deprecated.js +1 -1
- package/dist/components/z-menu-section.js +2 -2
- package/dist/components/z-menu.js +1 -1
- package/dist/components/z-modal.js +1 -1
- package/dist/components/z-myz-card-alert.js +2 -2
- package/dist/components/z-myz-card-body.js +1 -1
- package/dist/components/z-myz-card-cover.js +1 -1
- package/dist/components/z-myz-card-dictionary.js +7 -7
- package/dist/components/z-myz-card-footer-sections.js +1 -1
- package/dist/components/z-myz-card-footer.js +1 -1
- package/dist/components/z-myz-card-header.js +1 -1
- package/dist/components/z-myz-card-icon.js +2 -2
- package/dist/components/z-myz-card-info.js +3 -3
- package/dist/components/z-myz-card-list.js +1 -1
- package/dist/components/z-myz-card.js +1 -1
- package/dist/components/z-myz-list-item.js +1 -1
- package/dist/components/z-myz-list.js +3 -3
- package/dist/components/z-navigation-tabs.js +3 -3
- package/dist/components/z-notification.js +2 -2
- package/dist/components/z-offcanvas.js +1 -1
- package/dist/components/z-otp.js +4 -4
- package/dist/components/z-pagination.js +4 -4
- package/dist/components/z-panel-elem.js +3 -3
- package/dist/components/z-popover.js +1 -1
- package/dist/components/z-range-picker.js +3 -3
- package/dist/components/z-result-card.js +14 -16
- package/dist/components/z-result-card.js.map +1 -1
- package/dist/components/z-searchbar.js +1 -1
- package/dist/components/z-section-title.js +1 -1
- package/dist/components/z-select.js +10 -10
- package/dist/components/z-select.js.map +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/components/z-slideshow.js +1 -1
- package/dist/components/z-stepper-item.js +2 -2
- package/dist/components/z-stepper.js +1 -1
- package/dist/components/z-table.js +1 -1
- package/dist/components/z-tag.js +1 -1
- package/dist/components/z-td.js +3 -3
- package/dist/components/z-th.js +3 -3
- package/dist/components/z-toast-notification-list.js +1 -1
- package/dist/components/z-toast-notification.js +2 -2
- package/dist/components/z-toggle-button.js +3 -3
- package/dist/components/z-toggle-switch.js +4 -4
- package/dist/components/z-tooltip.js +2 -2
- package/dist/components/z-tr.js +2 -2
- package/dist/components/z-tree-list.js +4 -4
- package/dist/components/z-visually-hidden.js +1 -1
- package/dist/esm/index-c8ceadeb.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-alert.entry.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +18 -18
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-aria-alert.entry.js +1 -1
- package/dist/esm/z-avatar.entry.js +2 -2
- package/dist/esm/z-book-card.entry.js +15 -14
- package/dist/esm/z-book-card.entry.js.map +1 -1
- package/dist/{cjs/placeholder-cover-b679e768.js → esm/z-book-cover.entry.js} +21 -3
- package/dist/esm/z-book-cover.entry.js.map +1 -0
- package/dist/esm/z-breadcrumb.entry.js +2 -2
- package/dist/esm/z-button-sort.entry.js +1 -1
- package/dist/esm/z-chip.entry.js +2 -2
- package/dist/esm/z-combobox.entry.js +26 -41
- package/dist/esm/z-combobox.entry.js.map +1 -1
- package/dist/esm/z-cover-hero.entry.js +2 -2
- package/dist/esm/z-dragdrop-area_2.entry.js +4 -4
- package/dist/esm/z-ghost-loading.entry.js +1 -1
- package/dist/esm/z-info-box.entry.js +1 -1
- package/dist/esm/z-info-reveal.entry.js +1 -1
- package/dist/esm/z-logo.entry.js +1 -1
- package/dist/esm/z-menu-section.entry.js +1 -1
- package/dist/esm/z-myz-card-alert.entry.js +1 -1
- package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
- package/dist/esm/z-myz-card-footer-sections.entry.js +1 -1
- package/dist/esm/z-myz-card-footer.entry.js +1 -1
- package/dist/esm/z-myz-card-icon.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-card-list.entry.js +1 -1
- package/dist/esm/z-myz-card_4.entry.js +4 -4
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-myz-list.entry.js +1 -1
- package/dist/esm/z-navigation-tabs.entry.js +2 -2
- package/dist/esm/z-notification.entry.js +1 -1
- package/dist/esm/z-otp.entry.js +2 -2
- package/dist/esm/z-panel-elem.entry.js +2 -2
- package/dist/esm/z-popover.entry.js +1 -1
- package/dist/esm/z-result-card.entry.js +6 -14
- package/dist/esm/z-result-card.entry.js.map +1 -1
- package/dist/esm/z-select.entry.js +2 -2
- package/dist/esm/z-select.entry.js.map +1 -1
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-stepper-item.entry.js +1 -1
- package/dist/esm/z-stepper.entry.js +1 -1
- package/dist/esm/z-toast-notification-list.entry.js +1 -1
- package/dist/esm/z-toast-notification.entry.js +1 -1
- package/dist/esm/z-toggle-button.entry.js +2 -2
- package/dist/esm/z-toggle-switch.entry.js +3 -3
- package/dist/esm/z-tooltip.entry.js +1 -1
- package/dist/esm/z-visually-hidden.entry.js +1 -1
- package/dist/types/components/book-card/z-book-card/index.d.ts +20 -16
- package/dist/types/components/book-card/z-book-card/index.stories.d.ts +2 -35
- package/dist/types/components/z-app-header/index.d.ts +1 -0
- package/dist/types/components/z-app-header/index.stories.d.ts +8 -0
- package/dist/types/components/z-book-cover/index.d.ts +23 -0
- package/dist/types/components/z-book-cover/index.stories.d.ts +21 -0
- package/dist/types/components/z-combobox/index.d.ts +1 -0
- package/dist/types/components/z-input/index.d.ts +4 -4
- package/dist/types/components/z-offcanvas/index.d.ts +2 -0
- package/dist/types/components/z-offcanvas/index.stories.d.ts +9 -0
- package/dist/types/components/{result-card/z-result-card → z-result-card}/index.d.ts +8 -26
- package/dist/types/components.d.ts +185 -76
- package/{www/build/p-8117a929.entry.js → dist/web-components-library/p-01f941c2.entry.js} +2 -2
- package/dist/web-components-library/{p-0756fe6f.entry.js → p-028dd72a.entry.js} +2 -2
- package/{www/build/p-e160545f.entry.js → dist/web-components-library/p-0990d475.entry.js} +2 -2
- package/{www/build/p-e160545f.entry.js.map → dist/web-components-library/p-0990d475.entry.js.map} +1 -1
- package/dist/web-components-library/{p-6ca0ee2f.entry.js → p-0a49dd1c.entry.js} +2 -2
- package/dist/web-components-library/{p-09ba466b.entry.js → p-240de9aa.entry.js} +2 -2
- package/dist/web-components-library/{p-f1c55eda.entry.js → p-28534fb5.entry.js} +2 -2
- package/{www/build/p-966cbf03.entry.js → dist/web-components-library/p-28d83c86.entry.js} +2 -2
- package/dist/web-components-library/{p-cbab66f7.entry.js → p-2bdac94e.entry.js} +2 -2
- package/dist/web-components-library/{p-e8419614.entry.js → p-2ffdfbb1.entry.js} +2 -2
- package/dist/web-components-library/p-31bd2a1c.entry.js +2 -0
- package/dist/web-components-library/p-31bd2a1c.entry.js.map +1 -0
- package/dist/web-components-library/{p-8c52635e.entry.js → p-4551b0df.entry.js} +2 -2
- package/dist/web-components-library/{p-e639e1bc.entry.js → p-460b2068.entry.js} +2 -2
- package/{www/build/p-0eab3c09.entry.js → dist/web-components-library/p-46ea0b2e.entry.js} +3 -3
- package/dist/web-components-library/{p-689b0280.entry.js → p-4a257653.entry.js} +2 -2
- package/dist/web-components-library/{p-8dec332e.entry.js → p-4aaf0172.entry.js} +2 -2
- package/dist/web-components-library/{p-d6d3a92a.entry.js → p-4affbb99.entry.js} +2 -2
- package/dist/web-components-library/{p-caa491ca.entry.js → p-5989465b.entry.js} +2 -2
- package/dist/web-components-library/{p-d8aa6afa.entry.js → p-5a1f98a2.entry.js} +2 -2
- package/{www/build/p-d0d54d42.entry.js → dist/web-components-library/p-5c5882c6.entry.js} +2 -2
- package/dist/web-components-library/{p-01302e57.entry.js → p-5f94986f.entry.js} +2 -2
- package/dist/web-components-library/p-6cff173f.entry.js +2 -0
- package/dist/web-components-library/{p-97608d16.entry.js.map → p-6cff173f.entry.js.map} +1 -1
- package/dist/web-components-library/p-6cffbabc.entry.js +2 -0
- package/{www/build/p-ac585bcd.entry.js.map → dist/web-components-library/p-6cffbabc.entry.js.map} +1 -1
- package/dist/web-components-library/{p-1ad8810a.entry.js → p-7194003a.entry.js} +2 -2
- package/{www/build/p-2b8eb0c2.entry.js → dist/web-components-library/p-78146cef.entry.js} +2 -2
- package/dist/web-components-library/{p-4fbcf534.entry.js → p-7a4f6a5b.entry.js} +2 -2
- package/dist/web-components-library/{p-6793061a.entry.js → p-7ceddb7a.entry.js} +2 -2
- package/dist/web-components-library/{p-4c730d4a.entry.js → p-86160fe3.entry.js} +2 -2
- package/dist/web-components-library/{p-63c1bde5.entry.js → p-863fd1c4.entry.js} +2 -2
- package/dist/web-components-library/p-8fc213c2.entry.js +2 -0
- package/dist/web-components-library/p-8fc213c2.entry.js.map +1 -0
- package/dist/web-components-library/{p-5cf3a797.entry.js → p-943db3a8.entry.js} +2 -2
- package/dist/web-components-library/{p-dc5ba112.entry.js → p-94916bdf.entry.js} +2 -2
- package/dist/web-components-library/p-a2e87cec.entry.js +2 -0
- package/dist/web-components-library/{p-badd98ad.entry.js → p-ac477ae7.entry.js} +2 -2
- package/dist/web-components-library/p-af5e8524.entry.js +2 -0
- package/dist/web-components-library/{p-7916e0f7.entry.js → p-b3f1b5c1.entry.js} +2 -2
- package/dist/web-components-library/{p-962c7f6b.entry.js → p-ceeb3e2a.entry.js} +2 -2
- package/dist/web-components-library/p-d60684d5.entry.js +2 -0
- package/dist/web-components-library/p-d60684d5.entry.js.map +1 -0
- package/dist/web-components-library/{p-cb1de7b4.entry.js → p-dc086eb5.entry.js} +2 -2
- package/dist/web-components-library/p-deb7f8d7.entry.js +2 -0
- package/dist/web-components-library/{p-6273db7f.entry.js → p-e0b88075.entry.js} +2 -2
- package/dist/web-components-library/p-e4bb1256.entry.js +2 -0
- package/dist/web-components-library/p-e4bb1256.entry.js.map +1 -0
- package/dist/web-components-library/{p-e231e811.entry.js → p-f487290e.entry.js} +2 -2
- package/dist/web-components-library/p-f4bac89b.entry.js +2 -0
- package/dist/web-components-library/p-f4bac89b.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +2 -3
- package/react/components.d.ts +1 -0
- package/react/components.js +3 -2
- package/react/components.js.map +1 -1
- package/{dist/web-components-library/p-8117a929.entry.js → www/build/p-01f941c2.entry.js} +2 -2
- package/www/build/{p-0756fe6f.entry.js → p-028dd72a.entry.js} +2 -2
- package/{dist/web-components-library/p-e160545f.entry.js → www/build/p-0990d475.entry.js} +2 -2
- package/{dist/web-components-library/p-e160545f.entry.js.map → www/build/p-0990d475.entry.js.map} +1 -1
- package/www/build/{p-6ca0ee2f.entry.js → p-0a49dd1c.entry.js} +2 -2
- package/www/build/{p-09ba466b.entry.js → p-240de9aa.entry.js} +2 -2
- package/www/build/{p-f1c55eda.entry.js → p-28534fb5.entry.js} +2 -2
- package/{dist/web-components-library/p-966cbf03.entry.js → www/build/p-28d83c86.entry.js} +2 -2
- package/www/build/{p-cbab66f7.entry.js → p-2bdac94e.entry.js} +2 -2
- package/www/build/{p-e8419614.entry.js → p-2ffdfbb1.entry.js} +2 -2
- package/www/build/p-31bd2a1c.entry.js +2 -0
- package/www/build/p-31bd2a1c.entry.js.map +1 -0
- package/www/build/{p-8c52635e.entry.js → p-4551b0df.entry.js} +2 -2
- package/www/build/{p-e639e1bc.entry.js → p-460b2068.entry.js} +2 -2
- package/{dist/web-components-library/p-0eab3c09.entry.js → www/build/p-46ea0b2e.entry.js} +3 -3
- package/www/build/{p-689b0280.entry.js → p-4a257653.entry.js} +2 -2
- package/www/build/{p-8dec332e.entry.js → p-4aaf0172.entry.js} +2 -2
- package/www/build/{p-d6d3a92a.entry.js → p-4affbb99.entry.js} +2 -2
- package/www/build/{p-caa491ca.entry.js → p-5989465b.entry.js} +2 -2
- package/www/build/{p-d8aa6afa.entry.js → p-5a1f98a2.entry.js} +2 -2
- package/{dist/web-components-library/p-d0d54d42.entry.js → www/build/p-5c5882c6.entry.js} +2 -2
- package/www/build/{p-01302e57.entry.js → p-5f94986f.entry.js} +2 -2
- package/www/build/p-6cff173f.entry.js +2 -0
- package/www/build/{p-97608d16.entry.js.map → p-6cff173f.entry.js.map} +1 -1
- package/www/build/p-6cffbabc.entry.js +2 -0
- package/{dist/web-components-library/p-ac585bcd.entry.js.map → www/build/p-6cffbabc.entry.js.map} +1 -1
- package/www/build/{p-1ad8810a.entry.js → p-7194003a.entry.js} +2 -2
- package/{dist/web-components-library/p-2b8eb0c2.entry.js → www/build/p-78146cef.entry.js} +2 -2
- package/www/build/{p-4fbcf534.entry.js → p-7a4f6a5b.entry.js} +2 -2
- package/www/build/{p-6793061a.entry.js → p-7ceddb7a.entry.js} +2 -2
- package/www/build/{p-4c730d4a.entry.js → p-86160fe3.entry.js} +2 -2
- package/www/build/{p-63c1bde5.entry.js → p-863fd1c4.entry.js} +2 -2
- package/www/build/p-8fc213c2.entry.js +2 -0
- package/www/build/p-8fc213c2.entry.js.map +1 -0
- package/www/build/{p-5cf3a797.entry.js → p-943db3a8.entry.js} +2 -2
- package/www/build/{p-dc5ba112.entry.js → p-94916bdf.entry.js} +2 -2
- package/www/build/p-a2e87cec.entry.js +2 -0
- package/www/build/{p-badd98ad.entry.js → p-ac477ae7.entry.js} +2 -2
- package/www/build/p-af5e8524.entry.js +2 -0
- package/www/build/{p-7916e0f7.entry.js → p-b3f1b5c1.entry.js} +2 -2
- package/www/build/p-b716b49c.js +2 -0
- package/www/build/{p-962c7f6b.entry.js → p-ceeb3e2a.entry.js} +2 -2
- package/www/build/p-d60684d5.entry.js +2 -0
- package/www/build/p-d60684d5.entry.js.map +1 -0
- package/www/build/{p-cb1de7b4.entry.js → p-dc086eb5.entry.js} +2 -2
- package/www/build/p-deb7f8d7.entry.js +2 -0
- package/www/build/{p-6273db7f.entry.js → p-e0b88075.entry.js} +2 -2
- package/www/build/p-e4bb1256.entry.js +2 -0
- package/www/build/p-e4bb1256.entry.js.map +1 -0
- package/www/build/{p-e231e811.entry.js → p-f487290e.entry.js} +2 -2
- package/www/build/p-f4bac89b.entry.js +2 -0
- package/www/build/p-f4bac89b.entry.js.map +1 -0
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/placeholder-cover-b679e768.js.map +0 -1
- package/dist/collection/components/result-card/z-result-card/index.js.map +0 -1
- package/dist/collection/components/result-card/z-result-card/z-result-card.stories.js.map +0 -1
- package/dist/components/placeholder-cover.js.map +0 -1
- package/dist/esm/placeholder-cover-9346be8f.js +0 -5
- package/dist/esm/placeholder-cover-9346be8f.js.map +0 -1
- package/dist/web-components-library/p-165d5acc.entry.js +0 -2
- package/dist/web-components-library/p-165d5acc.entry.js.map +0 -1
- package/dist/web-components-library/p-310c2215.entry.js +0 -2
- package/dist/web-components-library/p-310c2215.entry.js.map +0 -1
- package/dist/web-components-library/p-3ed25564.entry.js +0 -2
- package/dist/web-components-library/p-67edb420.entry.js +0 -2
- package/dist/web-components-library/p-74819cbe.entry.js +0 -2
- package/dist/web-components-library/p-8d55127c.entry.js +0 -2
- package/dist/web-components-library/p-8d55127c.entry.js.map +0 -1
- package/dist/web-components-library/p-8d923a1d.js +0 -2
- package/dist/web-components-library/p-8d923a1d.js.map +0 -1
- package/dist/web-components-library/p-97608d16.entry.js +0 -2
- package/dist/web-components-library/p-abd17b10.entry.js +0 -2
- package/dist/web-components-library/p-abd17b10.entry.js.map +0 -1
- package/dist/web-components-library/p-ac585bcd.entry.js +0 -2
- package/www/build/p-165d5acc.entry.js +0 -2
- package/www/build/p-165d5acc.entry.js.map +0 -1
- package/www/build/p-310c2215.entry.js +0 -2
- package/www/build/p-310c2215.entry.js.map +0 -1
- package/www/build/p-3ed25564.entry.js +0 -2
- package/www/build/p-67edb420.entry.js +0 -2
- package/www/build/p-74819cbe.entry.js +0 -2
- package/www/build/p-8d55127c.entry.js +0 -2
- package/www/build/p-8d55127c.entry.js.map +0 -1
- package/www/build/p-8d923a1d.js +0 -2
- package/www/build/p-8d923a1d.js.map +0 -1
- package/www/build/p-97608d16.entry.js +0 -2
- package/www/build/p-abd17b10.entry.js +0 -2
- package/www/build/p-abd17b10.entry.js.map +0 -1
- package/www/build/p-ac585bcd.entry.js +0 -2
- package/www/build/p-f9314f48.js +0 -2
- /package/dist/collection/components/{result-card/z-result-card → z-result-card}/z-result-card.stories.js +0 -0
- /package/dist/types/components/{result-card/z-result-card → z-result-card}/z-result-card.stories.d.ts +0 -0
- /package/dist/web-components-library/{p-8117a929.entry.js.map → p-01f941c2.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-0756fe6f.entry.js.map → p-028dd72a.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-6ca0ee2f.entry.js.map → p-0a49dd1c.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-09ba466b.entry.js.map → p-240de9aa.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-f1c55eda.entry.js.map → p-28534fb5.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-966cbf03.entry.js.map → p-28d83c86.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-cbab66f7.entry.js.map → p-2bdac94e.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-e8419614.entry.js.map → p-2ffdfbb1.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-8c52635e.entry.js.map → p-4551b0df.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-e639e1bc.entry.js.map → p-460b2068.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-0eab3c09.entry.js.map → p-46ea0b2e.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-689b0280.entry.js.map → p-4a257653.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-8dec332e.entry.js.map → p-4aaf0172.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-d6d3a92a.entry.js.map → p-4affbb99.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-caa491ca.entry.js.map → p-5989465b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-d8aa6afa.entry.js.map → p-5a1f98a2.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-d0d54d42.entry.js.map → p-5c5882c6.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-01302e57.entry.js.map → p-5f94986f.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-1ad8810a.entry.js.map → p-7194003a.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-2b8eb0c2.entry.js.map → p-78146cef.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-4fbcf534.entry.js.map → p-7a4f6a5b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-6793061a.entry.js.map → p-7ceddb7a.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-4c730d4a.entry.js.map → p-86160fe3.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-63c1bde5.entry.js.map → p-863fd1c4.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-5cf3a797.entry.js.map → p-943db3a8.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-dc5ba112.entry.js.map → p-94916bdf.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-67edb420.entry.js.map → p-a2e87cec.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-badd98ad.entry.js.map → p-ac477ae7.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-3ed25564.entry.js.map → p-af5e8524.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-7916e0f7.entry.js.map → p-b3f1b5c1.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-962c7f6b.entry.js.map → p-ceeb3e2a.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-cb1de7b4.entry.js.map → p-dc086eb5.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-74819cbe.entry.js.map → p-deb7f8d7.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-6273db7f.entry.js.map → p-e0b88075.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-e231e811.entry.js.map → p-f487290e.entry.js.map} +0 -0
- /package/www/build/{p-8117a929.entry.js.map → p-01f941c2.entry.js.map} +0 -0
- /package/www/build/{p-0756fe6f.entry.js.map → p-028dd72a.entry.js.map} +0 -0
- /package/www/build/{p-6ca0ee2f.entry.js.map → p-0a49dd1c.entry.js.map} +0 -0
- /package/www/build/{p-09ba466b.entry.js.map → p-240de9aa.entry.js.map} +0 -0
- /package/www/build/{p-f1c55eda.entry.js.map → p-28534fb5.entry.js.map} +0 -0
- /package/www/build/{p-966cbf03.entry.js.map → p-28d83c86.entry.js.map} +0 -0
- /package/www/build/{p-cbab66f7.entry.js.map → p-2bdac94e.entry.js.map} +0 -0
- /package/www/build/{p-e8419614.entry.js.map → p-2ffdfbb1.entry.js.map} +0 -0
- /package/www/build/{p-8c52635e.entry.js.map → p-4551b0df.entry.js.map} +0 -0
- /package/www/build/{p-e639e1bc.entry.js.map → p-460b2068.entry.js.map} +0 -0
- /package/www/build/{p-0eab3c09.entry.js.map → p-46ea0b2e.entry.js.map} +0 -0
- /package/www/build/{p-689b0280.entry.js.map → p-4a257653.entry.js.map} +0 -0
- /package/www/build/{p-8dec332e.entry.js.map → p-4aaf0172.entry.js.map} +0 -0
- /package/www/build/{p-d6d3a92a.entry.js.map → p-4affbb99.entry.js.map} +0 -0
- /package/www/build/{p-caa491ca.entry.js.map → p-5989465b.entry.js.map} +0 -0
- /package/www/build/{p-d8aa6afa.entry.js.map → p-5a1f98a2.entry.js.map} +0 -0
- /package/www/build/{p-d0d54d42.entry.js.map → p-5c5882c6.entry.js.map} +0 -0
- /package/www/build/{p-01302e57.entry.js.map → p-5f94986f.entry.js.map} +0 -0
- /package/www/build/{p-1ad8810a.entry.js.map → p-7194003a.entry.js.map} +0 -0
- /package/www/build/{p-2b8eb0c2.entry.js.map → p-78146cef.entry.js.map} +0 -0
- /package/www/build/{p-4fbcf534.entry.js.map → p-7a4f6a5b.entry.js.map} +0 -0
- /package/www/build/{p-6793061a.entry.js.map → p-7ceddb7a.entry.js.map} +0 -0
- /package/www/build/{p-4c730d4a.entry.js.map → p-86160fe3.entry.js.map} +0 -0
- /package/www/build/{p-63c1bde5.entry.js.map → p-863fd1c4.entry.js.map} +0 -0
- /package/www/build/{p-5cf3a797.entry.js.map → p-943db3a8.entry.js.map} +0 -0
- /package/www/build/{p-dc5ba112.entry.js.map → p-94916bdf.entry.js.map} +0 -0
- /package/www/build/{p-67edb420.entry.js.map → p-a2e87cec.entry.js.map} +0 -0
- /package/www/build/{p-badd98ad.entry.js.map → p-ac477ae7.entry.js.map} +0 -0
- /package/www/build/{p-3ed25564.entry.js.map → p-af5e8524.entry.js.map} +0 -0
- /package/www/build/{p-7916e0f7.entry.js.map → p-b3f1b5c1.entry.js.map} +0 -0
- /package/www/build/{p-962c7f6b.entry.js.map → p-ceeb3e2a.entry.js.map} +0 -0
- /package/www/build/{p-cb1de7b4.entry.js.map → p-dc086eb5.entry.js.map} +0 -0
- /package/www/build/{p-74819cbe.entry.js.map → p-deb7f8d7.entry.js.map} +0 -0
- /package/www/build/{p-6273db7f.entry.js.map → p-e0b88075.entry.js.map} +0 -0
- /package/www/build/{p-e231e811.entry.js.map → p-f487290e.entry.js.map} +0 -0
|
@@ -1,402 +1,476 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { d as defineCustomElement$9 } from './index4.js';
|
|
5
|
-
import { d as defineCustomElement$8 } from './index6.js';
|
|
6
|
-
import { d as defineCustomElement$7 } from './index9.js';
|
|
7
|
-
import { d as defineCustomElement$6 } from './index11.js';
|
|
8
|
-
import { d as defineCustomElement$5 } from './index12.js';
|
|
9
|
-
import { d as defineCustomElement$4 } from './index13.js';
|
|
10
|
-
import { d as defineCustomElement$3 } from './index14.js';
|
|
11
|
-
import { d as defineCustomElement$2 } from './index15.js';
|
|
12
|
-
import { d as defineCustomElement$1 } from './index25.js';
|
|
2
|
+
import { P as PopoverPosition, g as KeyboardCode, p as Device } from './index2.js';
|
|
3
|
+
import { a as containsElement, i as findScrollableParent, g as getDevice, j as isElementVisibleInContainer } from './utils.js';
|
|
13
4
|
|
|
14
|
-
const stylesCss = ":host{
|
|
15
|
-
const
|
|
5
|
+
const stylesCss = ":host{position:fixed;display:none;max-width:calc(100% - var(--grid-margin) * 2);max-height:calc(100% - var(--grid-margin) * 2);padding:var(--z-popover-padding, 0);background:var(--z-popover-theme--surface, var(--color-surface01));border-radius:var(--border-radius-small);color:var(--z-popover-theme--text, var(--color-default-text));fill:currentcolor;filter:var(--z-popover-shadow-filter, drop-shadow(0 1px 2px var(--shadow-color-base)));text-align:center;visibility:hidden;}:host([open]:not([open=\"false\"])[current-position]){display:block}:host([center][current-position=\"top\"]),:host([center][current-position=\"bottom\"]){transform:translateX(-50%)}:host([center][current-position=\"right\"]),:host([center][current-position=\"left\"]){transform:translateY(-50%)}:host([current-position^=\"top\"]){margin:0 0 var(--space-unit)}:host([current-position^=\"bottom\"]){margin:var(--space-unit) 0 0}:host([current-position^=\"left\"]){margin:0 var(--space-unit) 0 0}:host([current-position^=\"right\"]){margin:0 0 0 var(--space-unit)}:host([current-position])::before{--arrow-size:6px;--arrow-edge-offset:calc(100% - var(--space-unit) - (var(--arrow-size) / 2));--arrow-center-x-offset:calc(50% - (var(--arrow-size) / 2));--arrow-center-y-offset:calc(100% - (var(--arrow-size) / 2));position:absolute;display:block;width:var(--arrow-size);height:var(--arrow-size);background:var(--z-popover-theme--surface, var(--color-surface01));content:\"\";transform:rotate(45deg)}:host([show-arrow=\"false\"])::before,:host(:not([show-arrow]))::before{display:none}:host([current-position^=\"top\"])::before{top:var(--arrow-center-y-offset)}:host([current-position^=\"bottom\"])::before{bottom:var(--arrow-center-y-offset)}:host([current-position=\"top\"])::before,:host([current-position=\"bottom\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before,:host([current-position=\"left\"])::before{bottom:var(--arrow-edge-offset)}:host([current-position=\"right\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"top_right\"])::before,:host([current-position=\"bottom_right\"])::before{right:var(--arrow-edge-offset)}:host([current-position=\"top_left\"])::before,:host([current-position=\"bottom_left\"])::before{left:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"left_top\"])::before{top:var(--arrow-edge-offset)}:host([current-position=\"right_top\"])::before,:host([current-position=\"right_bottom\"])::before{right:var(--arrow-center-y-offset)}:host([current-position=\"left_top\"])::before,:host([current-position=\"left_bottom\"])::before{left:var(--arrow-center-y-offset)}:host([current-position=\"right_bottom\"])::before,:host([current-position=\"left_bottom\"])::before{bottom:var(--arrow-edge-offset)}:host([center][current-position=\"top\"])::before,:host([center][current-position=\"bottom\"])::before{right:auto;left:var(--arrow-center-x-offset)}:host([center][current-position=\"right\"])::before,:host([center][current-position=\"left\"])::before{top:var(--arrow-center-x-offset);bottom:auto}";
|
|
6
|
+
const ZPopoverStyle0 = stylesCss;
|
|
16
7
|
|
|
17
|
-
const
|
|
8
|
+
const ZPopover = /*@__PURE__*/ proxyCustomElement(class ZPopover extends HTMLElement {
|
|
18
9
|
constructor() {
|
|
19
10
|
super();
|
|
20
11
|
this.__registerHost();
|
|
21
12
|
this.__attachShadow();
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.resultsCount = undefined;
|
|
34
|
-
this.searchHelperLabel = "Cerca {searchString}";
|
|
35
|
-
this.resultsItems = undefined;
|
|
36
|
-
this.sortResultsItems = false;
|
|
37
|
-
this.showSearchButton = false;
|
|
38
|
-
this.searchButtonIconOnly = false;
|
|
39
|
-
this.size = ControlSize.BIG;
|
|
40
|
-
this.variant = ButtonVariant.PRIMARY;
|
|
41
|
-
this.searchString = this.value;
|
|
42
|
-
this.currResultsCount = 0;
|
|
43
|
-
this.showResults = false;
|
|
44
|
-
this.isMobile = false;
|
|
45
|
-
this.selectedItem = undefined;
|
|
13
|
+
this.positionChange = createEvent(this, "positionChange", 7);
|
|
14
|
+
this.openChange = createEvent(this, "openChange", 7);
|
|
15
|
+
/** space tolerance for space calculations */
|
|
16
|
+
this.spaceTolerance = 3;
|
|
17
|
+
this.position = PopoverPosition.TOP;
|
|
18
|
+
this.open = false;
|
|
19
|
+
this.bindTo = undefined;
|
|
20
|
+
this.showArrow = false;
|
|
21
|
+
this.center = false;
|
|
22
|
+
this.closable = true;
|
|
23
|
+
this.currentPosition = undefined;
|
|
46
24
|
}
|
|
47
|
-
|
|
48
|
-
this.
|
|
49
|
-
|
|
50
|
-
emitSearchTyping(search) {
|
|
51
|
-
this.searchTyping.emit(search);
|
|
52
|
-
}
|
|
53
|
-
emitSearchItemClick(item) {
|
|
54
|
-
this.searchItemClick.emit(item);
|
|
55
|
-
this.selectedItem = item;
|
|
56
|
-
this.searchString = "";
|
|
57
|
-
}
|
|
58
|
-
watchItems() {
|
|
59
|
-
this.resultsItemsList = this.getResultsItemsList();
|
|
60
|
-
}
|
|
61
|
-
watchResultsCount() {
|
|
62
|
-
this.currResultsCount = this.resultsCount;
|
|
63
|
-
}
|
|
64
|
-
watchValue() {
|
|
65
|
-
this.searchString = this.value;
|
|
66
|
-
}
|
|
67
|
-
watchSearchString() {
|
|
68
|
-
this.emitSearchTyping(this.searchString);
|
|
69
|
-
this.items = [];
|
|
70
|
-
if (!this.searchString) {
|
|
71
|
-
this.currResultsCount = this.resultsCount;
|
|
25
|
+
closePopoverWithKeyboard(e) {
|
|
26
|
+
if (this.closable && e.key === KeyboardCode.ESC) {
|
|
27
|
+
this.open = false;
|
|
72
28
|
}
|
|
73
29
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Close the popover when clicking outside of its content.
|
|
32
|
+
* Stop event propagation if the click was fired by popover's trigger element,
|
|
33
|
+
* to prevent close and reopen glitches.
|
|
34
|
+
*/
|
|
35
|
+
handleOutsideClick(e) {
|
|
36
|
+
const target = e.target;
|
|
37
|
+
if (!this.closable || !this.open || containsElement(this.host, target)) {
|
|
38
|
+
return;
|
|
77
39
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
82
|
-
}
|
|
83
|
-
componentDidLoad() {
|
|
84
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
85
|
-
if (getDevice() === Device.MOBILE && !this.isMobile) {
|
|
86
|
-
this.isMobile = true;
|
|
87
|
-
}
|
|
88
|
-
if (getDevice() !== Device.MOBILE && this.isMobile) {
|
|
89
|
-
this.isMobile = false;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
this.resizeObserver.observe(this.element);
|
|
93
|
-
}
|
|
94
|
-
componentWillLoad() {
|
|
95
|
-
this.resultsItemsList = this.getResultsItemsList();
|
|
96
|
-
this.currResultsCount = this.resultsCount;
|
|
97
|
-
}
|
|
98
|
-
getResultsItemsList() {
|
|
99
|
-
return typeof this.resultsItems === "string" ? JSON.parse(this.resultsItems) : this.resultsItems;
|
|
100
|
-
}
|
|
101
|
-
getGroupedItems(items) {
|
|
102
|
-
const groupedItems = {};
|
|
103
|
-
items.forEach((item) => {
|
|
104
|
-
var _a;
|
|
105
|
-
const key = `${item === null || item === void 0 ? void 0 : item.category}${item === null || item === void 0 ? void 0 : item.subcategory}`;
|
|
106
|
-
groupedItems[key] = (_a = groupedItems[key]) !== null && _a !== void 0 ? _a : {
|
|
107
|
-
category: item === null || item === void 0 ? void 0 : item.category,
|
|
108
|
-
subcategory: item === null || item === void 0 ? void 0 : item.subcategory,
|
|
109
|
-
items: [],
|
|
110
|
-
};
|
|
111
|
-
groupedItems[key]["items"].push(item);
|
|
112
|
-
});
|
|
113
|
-
if (this.sortResultsItems) {
|
|
114
|
-
return Object.keys(groupedItems)
|
|
115
|
-
.sort()
|
|
116
|
-
.reduce((obj, key) => {
|
|
117
|
-
obj[key] = Object.assign(Object.assign({}, groupedItems[key]), { items: groupedItems[key]["items"].sort((a, b) => {
|
|
118
|
-
const nameA = a.label.toUpperCase();
|
|
119
|
-
const nameB = b.label.toUpperCase();
|
|
120
|
-
if (nameA < nameB) {
|
|
121
|
-
return -1;
|
|
122
|
-
}
|
|
123
|
-
if (nameA > nameB) {
|
|
124
|
-
return 1;
|
|
125
|
-
}
|
|
126
|
-
return 0;
|
|
127
|
-
}) });
|
|
128
|
-
return obj;
|
|
129
|
-
}, {});
|
|
40
|
+
if (containsElement(this.boundElement, target)) {
|
|
41
|
+
// stop propagation if the click was on the trigger element to prevent close and reopen glitches
|
|
42
|
+
e.stopPropagation();
|
|
130
43
|
}
|
|
131
|
-
|
|
44
|
+
this.open = false;
|
|
132
45
|
}
|
|
133
|
-
|
|
134
|
-
if (!
|
|
135
|
-
|
|
46
|
+
validatePosition(newValue) {
|
|
47
|
+
if (!Object.values(PopoverPosition).includes(newValue) || newValue === PopoverPosition.AUTO) {
|
|
48
|
+
newValue = PopoverPosition.TOP;
|
|
49
|
+
this.position = newValue;
|
|
136
50
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
e.stopPropagation();
|
|
141
|
-
this.searchString = e.detail.value;
|
|
142
|
-
if (this.selectedItem) {
|
|
143
|
-
this.selectedItem = undefined;
|
|
51
|
+
this.currentPosition = newValue;
|
|
52
|
+
if (this.open) {
|
|
53
|
+
this.setPosition();
|
|
144
54
|
}
|
|
145
55
|
}
|
|
146
|
-
|
|
147
|
-
|
|
56
|
+
/** Setup popover behaviors when `open` changes. */
|
|
57
|
+
onOpen() {
|
|
58
|
+
cancelAnimationFrame(this.animationFrameRequestId);
|
|
59
|
+
this.openChange.emit({ open: this.open });
|
|
60
|
+
if (!this.open) {
|
|
61
|
+
Object.assign(this.host.style, {
|
|
62
|
+
// Reset all positioning properties
|
|
63
|
+
top: "auto",
|
|
64
|
+
right: "auto",
|
|
65
|
+
bottom: "auto",
|
|
66
|
+
left: "auto",
|
|
67
|
+
maxWidth: "",
|
|
68
|
+
maxHeight: "",
|
|
69
|
+
// Set initial visibility to hidden while calculating position...
|
|
70
|
+
visibility: "hidden",
|
|
71
|
+
});
|
|
72
|
+
this.currentPosition = undefined;
|
|
148
73
|
return;
|
|
149
74
|
}
|
|
150
|
-
|
|
75
|
+
const updatePositionLoop = () => {
|
|
76
|
+
if (!this.open) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.setPosition();
|
|
80
|
+
this.animationFrameRequestId = requestAnimationFrame(updatePositionLoop);
|
|
81
|
+
};
|
|
82
|
+
// call `setPosition` after a tick to ensure the DOM is ready and sizes are available
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
updatePositionLoop();
|
|
85
|
+
}, 0);
|
|
151
86
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const searchbar = cp.find((elem) => elem.nodeName === "Z-SEARCHBAR");
|
|
155
|
-
if (!searchbar || searchbar.htmlid !== this.htmlid) {
|
|
156
|
-
this.showResults = false;
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
if (cp.find((elem) => { var _a; return (elem === null || elem === void 0 ? void 0 : elem.nodeName) === "Z-INPUT" || ((_a = elem === null || elem === void 0 ? void 0 : elem.classList) === null || _a === void 0 ? void 0 : _a.contains("results")); })) {
|
|
160
|
-
this.showResults = true;
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
this.showResults = false;
|
|
87
|
+
onBindingChange() {
|
|
88
|
+
this.findBoundElement();
|
|
164
89
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return
|
|
168
|
-
this.inputRef = val;
|
|
169
|
-
}, htmlid: `input-${this.htmlid}`, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => {
|
|
170
|
-
handleEnterKeydSubmit(e, () => this.handleSubmit());
|
|
171
|
-
this.handleArrowsNavigation(e);
|
|
172
|
-
}, value: this.searchString || ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.label), ariaLabel: this.placeholder, size: this.size }));
|
|
90
|
+
/** Returns the offset modifier to use in calculations to align the popover with the bound element. */
|
|
91
|
+
get offsetModifier() {
|
|
92
|
+
return this.center ? 0.5 : 0;
|
|
173
93
|
}
|
|
174
|
-
|
|
175
|
-
if (
|
|
176
|
-
|
|
94
|
+
findBoundElement() {
|
|
95
|
+
if (typeof this.bindTo === "string") {
|
|
96
|
+
this.boundElement = this.host.ownerDocument.querySelector(this.bindTo);
|
|
177
97
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const ariaLabel = this.searchButtonIconOnly ? { "aria-label": "CERCA" } : null;
|
|
181
|
-
const defaultProps = Object.assign(Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp), ariaLabel);
|
|
182
|
-
return h("z-button", Object.assign({}, defaultProps), buttonLabel);
|
|
183
|
-
}
|
|
184
|
-
renderResults() {
|
|
185
|
-
if (!this.showResults ||
|
|
186
|
-
!this.autocomplete ||
|
|
187
|
-
!this.searchString ||
|
|
188
|
-
this.searchString.length < this.autocompleteMinChars ||
|
|
189
|
-
!this.resultsItemsList) {
|
|
190
|
-
return null;
|
|
98
|
+
else if (this.bindTo) {
|
|
99
|
+
this.boundElement = this.bindTo;
|
|
191
100
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
renderResultsList() {
|
|
195
|
-
var _a, _b;
|
|
196
|
-
if (this.preventSubmit && !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
197
|
-
return (h("span", { class: "item item-no-results" }, "Non abbiamo trovato risultati per ", h("b", null, this.searchString), h("br", null), h("br", null), "Cosa puoi fare?", h("ul", null, h("li", null, "Verificare di aver scritto bene"), h("li", null, "Provare a cercare un'altra parola"), h("li", null, "Provare a cercare qualcosa di pi\u00F9 generico"))));
|
|
101
|
+
else {
|
|
102
|
+
this.boundElement = this.host.parentElement;
|
|
198
103
|
}
|
|
199
|
-
return (h("z-list", { role: "listbox", id: `list-${this.htmlid}` }, this.renderSearchHelper(!!((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)), this.renderItems(), this.renderShowAllResults()));
|
|
200
104
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Check if element has enough space to the right and left to be centered.
|
|
107
|
+
* Used for `TOP` and `BOTTOM` position.
|
|
108
|
+
* When `center` is not enabled, only one side needs to be checked and `RIGHT` is the default.
|
|
109
|
+
*/
|
|
110
|
+
hasCenteredHorizontalSpace(availableLeft, availableRight, hostWidth, boundElementWidth) {
|
|
111
|
+
const requiredSideSpace = (hostWidth - boundElementWidth) * (1 - this.offsetModifier);
|
|
112
|
+
if (!this.center) {
|
|
113
|
+
return availableRight >= requiredSideSpace - this.spaceTolerance;
|
|
205
114
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
let counter = 0;
|
|
209
|
-
Object.values(groupedItems).forEach((groupItem, index, array) => {
|
|
210
|
-
if (this.checkResultsCount(counter)) {
|
|
211
|
-
const listGroupsElements = [];
|
|
212
|
-
groupItem.items.forEach((item, subindex, subarray) => {
|
|
213
|
-
if (this.checkResultsCount(counter)) {
|
|
214
|
-
const isLast = index === array.length - 1 && subindex === subarray.length - 1;
|
|
215
|
-
listGroupsElements.push(this.renderItem(item, subindex, !isLast));
|
|
216
|
-
}
|
|
217
|
-
counter++;
|
|
218
|
-
});
|
|
219
|
-
if (listGroupsElements.length) {
|
|
220
|
-
listGroups.push(h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, this.renderItemCategory(groupItem), listGroupsElements));
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
return listGroups;
|
|
115
|
+
return (availableRight >= requiredSideSpace - this.spaceTolerance &&
|
|
116
|
+
availableLeft >= requiredSideSpace - this.spaceTolerance);
|
|
225
117
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Check if element has enough space to the top and bottom to be centered.
|
|
120
|
+
* Used for `RIGHT` and `LEFT` position.
|
|
121
|
+
* When `center` is not enabled, only one side needs to be checked and `BOTTOM` is the default.
|
|
122
|
+
*/
|
|
123
|
+
hasCenteredVerticalSpace(availableTop, availableBottom, hostHeight, boundElementHeight) {
|
|
124
|
+
const requiredSideSpace = (hostHeight - boundElementHeight) * (1 - this.offsetModifier);
|
|
125
|
+
if (!this.center) {
|
|
126
|
+
return availableBottom >= requiredSideSpace - this.spaceTolerance;
|
|
232
127
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
128
|
+
return (availableTop >= requiredSideSpace - this.spaceTolerance &&
|
|
129
|
+
availableBottom >= requiredSideSpace - this.spaceTolerance);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Check if there is enough space in the given direction to fit the popover.
|
|
133
|
+
* Used for composed positions like TOP_RIGHT, LEFT_BOTTOM, etc.
|
|
134
|
+
*/
|
|
135
|
+
hasEnoughSideSpace(availableSpace, hostSize, boundElementSize, offsetModifier) {
|
|
136
|
+
return availableSpace >= hostSize - boundElementSize * (1 - offsetModifier) - this.spaceTolerance;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Given a desired position and available space around the bound element, returns the best position
|
|
140
|
+
* that fits the popover, trying all positions if needed.
|
|
141
|
+
* Takes into account offsetModifier for centering.
|
|
142
|
+
* @param desiredPosition The desired position of the popover.
|
|
143
|
+
* @param availableSpace The available space around the bound element.
|
|
144
|
+
*/
|
|
145
|
+
getOptimalPopoverPosition(desiredPosition, availableSpace) {
|
|
146
|
+
const hostWidth = this.host.offsetWidth;
|
|
147
|
+
const hostHeight = this.host.offsetHeight;
|
|
148
|
+
const boundElementWidth = this.boundElement.getBoundingClientRect().width;
|
|
149
|
+
const boundElementHeight = this.boundElement.getBoundingClientRect().height;
|
|
150
|
+
const offsetModifier = this.offsetModifier;
|
|
151
|
+
/** Check if there is enough space to fit the popover in the desired position */
|
|
152
|
+
const fits = (pos) => {
|
|
153
|
+
switch (pos) {
|
|
154
|
+
case PopoverPosition.TOP:
|
|
155
|
+
return (availableSpace.top >= hostHeight - this.spaceTolerance &&
|
|
156
|
+
this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth));
|
|
157
|
+
case PopoverPosition.TOP_RIGHT:
|
|
158
|
+
return (availableSpace.top >= hostHeight &&
|
|
159
|
+
this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier));
|
|
160
|
+
case PopoverPosition.TOP_LEFT:
|
|
161
|
+
return (availableSpace.top >= hostHeight &&
|
|
162
|
+
this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier));
|
|
163
|
+
case PopoverPosition.RIGHT:
|
|
164
|
+
return (availableSpace.right >= hostWidth &&
|
|
165
|
+
this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight));
|
|
166
|
+
case PopoverPosition.RIGHT_BOTTOM:
|
|
167
|
+
return (availableSpace.right >= hostWidth &&
|
|
168
|
+
this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier));
|
|
169
|
+
case PopoverPosition.RIGHT_TOP:
|
|
170
|
+
return (availableSpace.right >= hostWidth &&
|
|
171
|
+
this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier));
|
|
172
|
+
case PopoverPosition.BOTTOM:
|
|
173
|
+
return (availableSpace.bottom >= hostHeight &&
|
|
174
|
+
this.hasCenteredHorizontalSpace(availableSpace.left, availableSpace.right, hostWidth, boundElementWidth));
|
|
175
|
+
case PopoverPosition.BOTTOM_LEFT:
|
|
176
|
+
return (availableSpace.bottom >= hostHeight &&
|
|
177
|
+
this.hasEnoughSideSpace(availableSpace.left, hostWidth, boundElementWidth, offsetModifier));
|
|
178
|
+
case PopoverPosition.BOTTOM_RIGHT:
|
|
179
|
+
return (availableSpace.bottom >= hostHeight &&
|
|
180
|
+
this.hasEnoughSideSpace(availableSpace.right, hostWidth, boundElementWidth, offsetModifier));
|
|
181
|
+
case PopoverPosition.LEFT:
|
|
182
|
+
return (availableSpace.left >= hostWidth &&
|
|
183
|
+
this.hasCenteredVerticalSpace(availableSpace.top, availableSpace.bottom, hostHeight, boundElementHeight));
|
|
184
|
+
case PopoverPosition.LEFT_TOP:
|
|
185
|
+
return (availableSpace.left >= hostWidth &&
|
|
186
|
+
this.hasEnoughSideSpace(availableSpace.top, hostHeight, boundElementHeight, offsetModifier));
|
|
187
|
+
case PopoverPosition.LEFT_BOTTOM:
|
|
188
|
+
return (availableSpace.left >= hostWidth &&
|
|
189
|
+
this.hasEnoughSideSpace(availableSpace.bottom, hostHeight, boundElementHeight, offsetModifier));
|
|
190
|
+
default:
|
|
191
|
+
return false;
|
|
237
192
|
}
|
|
238
|
-
|
|
193
|
+
};
|
|
194
|
+
// Check desired position first
|
|
195
|
+
if (fits(desiredPosition)) {
|
|
196
|
+
return desiredPosition;
|
|
239
197
|
}
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (nextIndex < this.items.length) {
|
|
246
|
-
this.items[nextIndex].focus();
|
|
247
|
-
this.items[nextIndex].classList.add("focused");
|
|
248
|
-
}
|
|
198
|
+
// Find position index and create rotation starting from next position
|
|
199
|
+
const positions = ZPopover.positionOrder;
|
|
200
|
+
const startIndex = positions.indexOf(desiredPosition);
|
|
201
|
+
if (startIndex === -1) {
|
|
202
|
+
return desiredPosition; // fallback if position not found
|
|
249
203
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
.querySelector("input")
|
|
257
|
-
.setSelectionRange(this.inputRef.value.length, this.inputRef.value.length);
|
|
258
|
-
}
|
|
259
|
-
if (prevIndex >= 0) {
|
|
260
|
-
this.items[prevIndex].focus();
|
|
261
|
-
this.items[prevIndex].classList.add("focused");
|
|
204
|
+
// Try all other positions starting from the next one
|
|
205
|
+
for (let i = 1; i < positions.length; i++) {
|
|
206
|
+
const posIndex = (startIndex + i) % positions.length;
|
|
207
|
+
const pos = positions[posIndex];
|
|
208
|
+
if (fits(pos)) {
|
|
209
|
+
return pos;
|
|
262
210
|
}
|
|
263
211
|
}
|
|
212
|
+
return this.findBestFallbackPosition(availableSpace);
|
|
264
213
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
214
|
+
/** Find the best fallback position based on available space when no position fits perfectly. */
|
|
215
|
+
findBestFallbackPosition(availableSpace) {
|
|
216
|
+
// Determine which horizontal and vertical direction has the most available space
|
|
217
|
+
const bestHorizontalDirection = availableSpace.right >= availableSpace.left ? PopoverPosition.RIGHT : PopoverPosition.LEFT;
|
|
218
|
+
const bestVerticalDirection = availableSpace.bottom >= availableSpace.top ? PopoverPosition.BOTTOM : PopoverPosition.TOP;
|
|
219
|
+
// Choose the main direction based on which axis has more space overall
|
|
220
|
+
const maxHorizontalSpace = Math.max(availableSpace.right, availableSpace.left);
|
|
221
|
+
const maxVerticalSpace = Math.max(availableSpace.bottom, availableSpace.top);
|
|
222
|
+
const mainDirection = maxVerticalSpace >= maxHorizontalSpace ? bestVerticalDirection : bestHorizontalDirection;
|
|
223
|
+
// Decide if a secondary direction is needed
|
|
224
|
+
// Only add a secondary direction if the difference between min and max in that axis is at least double
|
|
225
|
+
let needsSecondaryDirection = false;
|
|
226
|
+
if (mainDirection === bestVerticalDirection) {
|
|
227
|
+
// If main direction is vertical, check horizontal space difference
|
|
228
|
+
const minHorizontalSpace = Math.min(availableSpace.right, availableSpace.left);
|
|
229
|
+
needsSecondaryDirection = maxHorizontalSpace >= minHorizontalSpace * 2;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
// If main direction is horizontal, check vertical space difference
|
|
233
|
+
const minVerticalSpace = Math.min(availableSpace.bottom, availableSpace.top);
|
|
234
|
+
needsSecondaryDirection = maxVerticalSpace >= minVerticalSpace * 2;
|
|
235
|
+
}
|
|
236
|
+
if (!needsSecondaryDirection) {
|
|
237
|
+
return mainDirection;
|
|
238
|
+
}
|
|
239
|
+
const secondaryDirection = mainDirection === bestVerticalDirection ? bestHorizontalDirection : bestVerticalDirection;
|
|
240
|
+
// Return a combined position (e.g., "bottom_right")
|
|
241
|
+
return `${mainDirection}_${secondaryDirection}`;
|
|
273
242
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
243
|
+
/**
|
|
244
|
+
* Calculate available space around the element bound with the popover, based on its nearest scrollable ancestor.
|
|
245
|
+
*
|
|
246
|
+
* Calculations for `right` and `bottom` can be a little bit confusing because `boundingRect.right` and `bottom` may not be what you expect...
|
|
247
|
+
* For more information see the explanation in the docs.
|
|
248
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#return_value
|
|
249
|
+
*/
|
|
250
|
+
calculateAvailableSpace() {
|
|
251
|
+
const boundElementRect = this.boundElement.getBoundingClientRect();
|
|
252
|
+
if (this.lastBoundRect &&
|
|
253
|
+
this.lastBoundRect.x === boundElementRect.x &&
|
|
254
|
+
this.lastBoundRect.y === boundElementRect.y &&
|
|
255
|
+
this.lastBoundRect.width === boundElementRect.width &&
|
|
256
|
+
this.lastBoundRect.height === boundElementRect.height &&
|
|
257
|
+
this.cachedAvailableSpace) {
|
|
258
|
+
// If the bound element's rect hasn't changed, return the cached rect
|
|
259
|
+
return this.cachedAvailableSpace;
|
|
277
260
|
}
|
|
278
|
-
|
|
261
|
+
this.lastBoundRect = boundElementRect;
|
|
262
|
+
const scrollableParent = findScrollableParent(this.boundElement);
|
|
263
|
+
const scrollableParentRect = scrollableParent.getBoundingClientRect();
|
|
264
|
+
const hasNestedScrollableParent = scrollableParent !== this.boundElement.ownerDocument.documentElement;
|
|
265
|
+
const documentWidth = this.boundElement.ownerDocument.documentElement.clientWidth;
|
|
266
|
+
const documentHeight = this.boundElement.ownerDocument.documentElement.clientHeight;
|
|
267
|
+
const safeSpace = 8; // extra space to avoid popover being too close to the edges
|
|
268
|
+
// These deltas represent the offset between the scrollable parent and the viewport.
|
|
269
|
+
// They are used to adjust the available space calculations when the scrollable parent is not the document or body,
|
|
270
|
+
// to try to fit the popover inside the scrollable parent.
|
|
271
|
+
const deltaTop = hasNestedScrollableParent ? scrollableParentRect.top : 0;
|
|
272
|
+
const deltaRight = hasNestedScrollableParent ? documentWidth - scrollableParentRect.right : 0;
|
|
273
|
+
const deltaBottom = hasNestedScrollableParent ? documentHeight - scrollableParentRect.bottom : 0;
|
|
274
|
+
const deltaLeft = hasNestedScrollableParent ? scrollableParentRect.left : 0;
|
|
275
|
+
this.cachedAvailableSpace = {
|
|
276
|
+
top: boundElementRect.top - deltaTop - safeSpace,
|
|
277
|
+
right: documentWidth - boundElementRect.right - deltaRight - safeSpace,
|
|
278
|
+
bottom: documentHeight - boundElementRect.bottom - deltaBottom - safeSpace,
|
|
279
|
+
left: boundElementRect.left - deltaLeft - safeSpace,
|
|
280
|
+
};
|
|
281
|
+
return this.cachedAvailableSpace;
|
|
282
|
+
}
|
|
283
|
+
/** Calculate the space around an element relative to the viewport. */
|
|
284
|
+
calculateElementOffsets(element) {
|
|
285
|
+
const elementRect = element.getBoundingClientRect();
|
|
286
|
+
const viewportWidth = element.ownerDocument.documentElement.clientWidth;
|
|
287
|
+
const viewportHeight = element.ownerDocument.documentElement.clientHeight;
|
|
288
|
+
return {
|
|
289
|
+
top: elementRect.top,
|
|
290
|
+
right: viewportWidth - elementRect.right,
|
|
291
|
+
bottom: viewportHeight - elementRect.bottom,
|
|
292
|
+
left: elementRect.left,
|
|
293
|
+
};
|
|
279
294
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
295
|
+
/** Apply positioning styles based on passed position. */
|
|
296
|
+
applyPositionStyles(position, availableSpace) {
|
|
297
|
+
const boundElementWidth = this.boundElement.offsetWidth;
|
|
298
|
+
const boundElementHeight = this.boundElement.offsetHeight;
|
|
299
|
+
/** Distance between the popover and the bound element */
|
|
300
|
+
const distanceFromBound = 8;
|
|
301
|
+
const offsetModifier = this.offsetModifier;
|
|
302
|
+
/** Distance between the arrow center and the popover edge. Needed to align the center of the arrow with the center of the bound element when `showArrow` and `center` are enabled. */
|
|
303
|
+
const arrowModifier = this.showArrow && this.center ? 8 : 0;
|
|
304
|
+
const hostStyle = this.host.style;
|
|
305
|
+
const boundElementOffsets = this.calculateElementOffsets(this.boundElement);
|
|
306
|
+
let maxWidth;
|
|
307
|
+
let maxHeight;
|
|
308
|
+
switch (position) {
|
|
309
|
+
case PopoverPosition.TOP:
|
|
310
|
+
case PopoverPosition.TOP_RIGHT:
|
|
311
|
+
hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight}px`;
|
|
312
|
+
hostStyle.left = `${boundElementOffsets.left + boundElementWidth * offsetModifier - (position === PopoverPosition.TOP_RIGHT ? arrowModifier : 0)}px`;
|
|
313
|
+
maxHeight = availableSpace.top - distanceFromBound;
|
|
314
|
+
if (position === PopoverPosition.TOP_RIGHT) {
|
|
315
|
+
maxWidth = availableSpace.right + boundElementWidth * offsetModifier;
|
|
316
|
+
}
|
|
317
|
+
break;
|
|
318
|
+
case PopoverPosition.TOP_LEFT:
|
|
319
|
+
hostStyle.right = `${boundElementOffsets.right + boundElementWidth * offsetModifier - arrowModifier}px`;
|
|
320
|
+
hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight}px`;
|
|
321
|
+
maxWidth = availableSpace.left + boundElementWidth * offsetModifier;
|
|
322
|
+
maxHeight = availableSpace.top - distanceFromBound;
|
|
323
|
+
break;
|
|
324
|
+
case PopoverPosition.BOTTOM:
|
|
325
|
+
case PopoverPosition.BOTTOM_RIGHT:
|
|
326
|
+
hostStyle.top = `${boundElementOffsets.top + boundElementHeight}px`;
|
|
327
|
+
hostStyle.left = `${boundElementOffsets.left + boundElementWidth * offsetModifier - (position === PopoverPosition.BOTTOM_RIGHT ? arrowModifier : 0)}px`;
|
|
328
|
+
maxHeight = availableSpace.bottom - distanceFromBound;
|
|
329
|
+
if (position === PopoverPosition.BOTTOM_RIGHT) {
|
|
330
|
+
maxWidth = availableSpace.right + boundElementWidth * offsetModifier;
|
|
331
|
+
}
|
|
332
|
+
break;
|
|
333
|
+
case PopoverPosition.BOTTOM_LEFT:
|
|
334
|
+
hostStyle.top = `${boundElementOffsets.top + boundElementHeight}px`;
|
|
335
|
+
hostStyle.right = `${boundElementOffsets.right + boundElementWidth * offsetModifier - arrowModifier}px`;
|
|
336
|
+
maxWidth = availableSpace.left + boundElementWidth * offsetModifier;
|
|
337
|
+
maxHeight = availableSpace.bottom - distanceFromBound;
|
|
338
|
+
break;
|
|
339
|
+
case PopoverPosition.RIGHT:
|
|
340
|
+
case PopoverPosition.RIGHT_BOTTOM:
|
|
341
|
+
hostStyle.top = `${boundElementOffsets.top + boundElementHeight * offsetModifier - (position === PopoverPosition.RIGHT_BOTTOM ? arrowModifier : 0)}px`;
|
|
342
|
+
hostStyle.left = `${boundElementOffsets.left + boundElementWidth}px`;
|
|
343
|
+
maxWidth = availableSpace.right - distanceFromBound;
|
|
344
|
+
if (position === PopoverPosition.RIGHT) {
|
|
345
|
+
maxHeight = availableSpace.top + availableSpace.bottom + boundElementHeight;
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
case PopoverPosition.RIGHT_TOP:
|
|
352
|
+
hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight * offsetModifier - arrowModifier}px`;
|
|
353
|
+
hostStyle.left = `${boundElementOffsets.left + boundElementWidth}px`;
|
|
354
|
+
maxWidth = availableSpace.right - distanceFromBound;
|
|
355
|
+
maxHeight = availableSpace.top + boundElementHeight * offsetModifier;
|
|
356
|
+
break;
|
|
357
|
+
case PopoverPosition.LEFT:
|
|
358
|
+
case PopoverPosition.LEFT_BOTTOM:
|
|
359
|
+
hostStyle.top = `${boundElementOffsets.top + boundElementHeight * offsetModifier - (position === PopoverPosition.LEFT_BOTTOM ? arrowModifier : 0)}px`;
|
|
360
|
+
hostStyle.right = `${boundElementOffsets.right + boundElementWidth}px`;
|
|
361
|
+
maxWidth = availableSpace.left - distanceFromBound;
|
|
362
|
+
if (position === PopoverPosition.LEFT_BOTTOM) {
|
|
363
|
+
maxHeight = availableSpace.bottom + boundElementHeight * offsetModifier;
|
|
364
|
+
}
|
|
365
|
+
break;
|
|
366
|
+
case PopoverPosition.LEFT_TOP:
|
|
367
|
+
hostStyle.right = `${boundElementOffsets.right + boundElementWidth}px`;
|
|
368
|
+
hostStyle.bottom = `${boundElementOffsets.bottom + boundElementHeight * offsetModifier - arrowModifier}px`;
|
|
369
|
+
maxWidth = availableSpace.left - distanceFromBound;
|
|
370
|
+
maxHeight = availableSpace.top + boundElementHeight * offsetModifier;
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
if (getDevice() !== Device.MOBILE) {
|
|
374
|
+
// Only force max sizes on non-mobile viewports
|
|
375
|
+
Object.assign(hostStyle, {
|
|
376
|
+
maxWidth: maxWidth ? `${maxWidth}px` : "",
|
|
377
|
+
maxHeight: maxHeight ? `${maxHeight}px` : "",
|
|
378
|
+
});
|
|
283
379
|
}
|
|
284
|
-
return (h("span", { class: "category-heading", slot: "header-title" }, h("span", { class: "category" }, groupItem.category), (groupItem === null || groupItem === void 0 ? void 0 : groupItem.subcategory) && h("span", { class: "subcategory" }, groupItem.subcategory)));
|
|
285
380
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
381
|
+
/** Set the position of the popover. */
|
|
382
|
+
setPosition() {
|
|
383
|
+
if (!this.boundElement) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
if (!isElementVisibleInContainer(this.boundElement, findScrollableParent(this.boundElement))) {
|
|
387
|
+
// If the bound element is not visible, hide the popover too
|
|
388
|
+
this.open = false;
|
|
389
|
+
return;
|
|
289
390
|
}
|
|
290
|
-
|
|
391
|
+
Object.assign(this.host.style, {
|
|
392
|
+
// Reset all positioning properties
|
|
393
|
+
top: "auto",
|
|
394
|
+
right: "auto",
|
|
395
|
+
bottom: "auto",
|
|
396
|
+
left: "auto",
|
|
397
|
+
maxWidth: "",
|
|
398
|
+
maxHeight: "",
|
|
399
|
+
// Set initial visibility to hidden while calculating position...
|
|
400
|
+
visibility: "hidden",
|
|
401
|
+
});
|
|
402
|
+
const availableSpace = this.calculateAvailableSpace();
|
|
403
|
+
const position = this.getOptimalPopoverPosition(this.position, availableSpace);
|
|
404
|
+
this.applyPositionStyles(position, availableSpace);
|
|
405
|
+
this.currentPosition = position;
|
|
406
|
+
this.positionChange.emit({ position: this.currentPosition });
|
|
407
|
+
// ...then restore the visibility
|
|
408
|
+
this.host.style.visibility = "visible";
|
|
291
409
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
410
|
+
componentWillLoad() {
|
|
411
|
+
this.validatePosition(this.position);
|
|
412
|
+
}
|
|
413
|
+
componentDidLoad() {
|
|
414
|
+
this.findBoundElement();
|
|
415
|
+
if (this.open) {
|
|
416
|
+
this.onOpen();
|
|
299
417
|
}
|
|
300
|
-
|
|
418
|
+
}
|
|
419
|
+
disconnectedCallback() {
|
|
420
|
+
cancelAnimationFrame(this.animationFrameRequestId);
|
|
301
421
|
}
|
|
302
422
|
render() {
|
|
303
|
-
return (h(Host, { key: '
|
|
423
|
+
return (h(Host, { key: 'aeb6c7ccabc279af16d9a957e732ad611612589f', "current-position": this.currentPosition }, h("slot", { key: '77fecb1bbfa49e1a8f97c078e7cef01a03420d9c' })));
|
|
304
424
|
}
|
|
305
|
-
get
|
|
425
|
+
get host() { return this; }
|
|
306
426
|
static get watchers() { return {
|
|
307
|
-
"
|
|
308
|
-
"
|
|
309
|
-
"
|
|
310
|
-
"searchString": ["watchSearchString"],
|
|
311
|
-
"showResults": ["watchShowResults"]
|
|
427
|
+
"position": ["validatePosition"],
|
|
428
|
+
"open": ["onOpen"],
|
|
429
|
+
"bindTo": ["onBindingChange"]
|
|
312
430
|
}; }
|
|
313
|
-
static get style() { return
|
|
314
|
-
}, [1, "z-
|
|
315
|
-
"
|
|
316
|
-
"
|
|
317
|
-
"
|
|
318
|
-
"
|
|
319
|
-
"
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
|
|
323
|
-
"
|
|
324
|
-
"
|
|
325
|
-
"
|
|
326
|
-
"searchButtonIconOnly": [4, "search-button-icon-only"],
|
|
327
|
-
"size": [1],
|
|
328
|
-
"variant": [1],
|
|
329
|
-
"searchString": [32],
|
|
330
|
-
"currResultsCount": [32],
|
|
331
|
-
"showResults": [32],
|
|
332
|
-
"isMobile": [32],
|
|
333
|
-
"selectedItem": [32]
|
|
334
|
-
}, [[4, "click", "handleOutsideClick"]], {
|
|
335
|
-
"resultsItems": ["watchItems"],
|
|
336
|
-
"resultsCount": ["watchResultsCount"],
|
|
337
|
-
"value": ["watchValue"],
|
|
338
|
-
"searchString": ["watchSearchString"],
|
|
339
|
-
"showResults": ["watchShowResults"]
|
|
431
|
+
static get style() { return ZPopoverStyle0; }
|
|
432
|
+
}, [1, "z-popover", {
|
|
433
|
+
"position": [1537],
|
|
434
|
+
"open": [1540],
|
|
435
|
+
"bindTo": [1, "bind-to"],
|
|
436
|
+
"showArrow": [516, "show-arrow"],
|
|
437
|
+
"center": [516],
|
|
438
|
+
"closable": [4],
|
|
439
|
+
"currentPosition": [32]
|
|
440
|
+
}, [[8, "keyup", "closePopoverWithKeyboard"], [18, "click", "handleOutsideClick"]], {
|
|
441
|
+
"position": ["validatePosition"],
|
|
442
|
+
"open": ["onOpen"],
|
|
443
|
+
"bindTo": ["onBindingChange"]
|
|
340
444
|
}]);
|
|
445
|
+
// Clockwise order of positions.
|
|
446
|
+
ZPopover.positionOrder = [
|
|
447
|
+
PopoverPosition.TOP,
|
|
448
|
+
PopoverPosition.TOP_RIGHT,
|
|
449
|
+
PopoverPosition.TOP_LEFT,
|
|
450
|
+
PopoverPosition.RIGHT,
|
|
451
|
+
PopoverPosition.RIGHT_BOTTOM,
|
|
452
|
+
PopoverPosition.RIGHT_TOP,
|
|
453
|
+
PopoverPosition.BOTTOM,
|
|
454
|
+
PopoverPosition.BOTTOM_LEFT,
|
|
455
|
+
PopoverPosition.BOTTOM_RIGHT,
|
|
456
|
+
PopoverPosition.LEFT,
|
|
457
|
+
PopoverPosition.LEFT_TOP,
|
|
458
|
+
PopoverPosition.LEFT_BOTTOM,
|
|
459
|
+
];
|
|
341
460
|
function defineCustomElement() {
|
|
342
461
|
if (typeof customElements === "undefined") {
|
|
343
462
|
return;
|
|
344
463
|
}
|
|
345
|
-
const components = ["z-
|
|
464
|
+
const components = ["z-popover"];
|
|
346
465
|
components.forEach(tagName => { switch (tagName) {
|
|
347
|
-
case "z-
|
|
348
|
-
if (!customElements.get(tagName)) {
|
|
349
|
-
customElements.define(tagName, ZSearchbar);
|
|
350
|
-
}
|
|
351
|
-
break;
|
|
352
|
-
case "z-button":
|
|
353
|
-
if (!customElements.get(tagName)) {
|
|
354
|
-
defineCustomElement$9();
|
|
355
|
-
}
|
|
356
|
-
break;
|
|
357
|
-
case "z-divider":
|
|
358
|
-
if (!customElements.get(tagName)) {
|
|
359
|
-
defineCustomElement$8();
|
|
360
|
-
}
|
|
361
|
-
break;
|
|
362
|
-
case "z-icon":
|
|
363
|
-
if (!customElements.get(tagName)) {
|
|
364
|
-
defineCustomElement$7();
|
|
365
|
-
}
|
|
366
|
-
break;
|
|
367
|
-
case "z-input":
|
|
368
|
-
if (!customElements.get(tagName)) {
|
|
369
|
-
defineCustomElement$6();
|
|
370
|
-
}
|
|
371
|
-
break;
|
|
372
|
-
case "z-input-message":
|
|
373
|
-
if (!customElements.get(tagName)) {
|
|
374
|
-
defineCustomElement$5();
|
|
375
|
-
}
|
|
376
|
-
break;
|
|
377
|
-
case "z-list":
|
|
378
|
-
if (!customElements.get(tagName)) {
|
|
379
|
-
defineCustomElement$4();
|
|
380
|
-
}
|
|
381
|
-
break;
|
|
382
|
-
case "z-list-element":
|
|
383
|
-
if (!customElements.get(tagName)) {
|
|
384
|
-
defineCustomElement$3();
|
|
385
|
-
}
|
|
386
|
-
break;
|
|
387
|
-
case "z-list-group":
|
|
388
|
-
if (!customElements.get(tagName)) {
|
|
389
|
-
defineCustomElement$2();
|
|
390
|
-
}
|
|
391
|
-
break;
|
|
392
|
-
case "z-tag":
|
|
466
|
+
case "z-popover":
|
|
393
467
|
if (!customElements.get(tagName)) {
|
|
394
|
-
|
|
468
|
+
customElements.define(tagName, ZPopover);
|
|
395
469
|
}
|
|
396
470
|
break;
|
|
397
471
|
} });
|
|
398
472
|
}
|
|
399
473
|
|
|
400
|
-
export {
|
|
474
|
+
export { ZPopover as Z, defineCustomElement as d };
|
|
401
475
|
|
|
402
476
|
//# sourceMappingURL=index24.js.map
|