@zanichelli/albe-web-components 4.0.4 → 4.2.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 +66 -0
- package/dist/cjs/{index-6b6a3299.js → index-0e75c8cc.js} +16 -45
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/utils-155eec04.js +2706 -0
- package/dist/cjs/{utils-8cc414c9.js → utils-97262bbd.js} +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-switcher_9.cjs.entry.js +736 -0
- package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-avatar.cjs.entry.js +1 -1
- package/dist/cjs/z-button-deprecated.cjs.entry.js +1 -1
- package/dist/cjs/z-button.cjs.entry.js +44 -0
- package/dist/cjs/z-card.cjs.entry.js +69 -0
- package/dist/cjs/z-carousel.cjs.entry.js +24 -0
- package/dist/cjs/z-chip.cjs.entry.js +2 -2
- package/dist/cjs/z-combobox.cjs.entry.js +2 -2
- package/dist/cjs/z-contextual-menu.cjs.entry.js +18 -7
- package/dist/cjs/z-cookiebar.cjs.entry.js +1 -1
- package/dist/cjs/z-date-picker.cjs.entry.js +10 -2701
- package/dist/cjs/z-file-upload.cjs.entry.js +2 -2
- package/dist/cjs/z-file.cjs.entry.js +10 -9
- package/dist/cjs/z-footer.cjs.entry.js +1 -1
- package/dist/cjs/z-ghost-loading.cjs.entry.js +19 -0
- package/dist/cjs/z-input-deprecated.cjs.entry.js +2 -2
- package/dist/cjs/z-input-label_2.cjs.entry.js +2 -2
- package/dist/cjs/z-list-group.cjs.entry.js +1 -1
- package/dist/cjs/z-list_2.cjs.entry.js +1 -1
- package/dist/cjs/z-menu-dropdown_2.cjs.entry.js +2 -2
- package/dist/cjs/z-messages-pocket.cjs.entry.js +1 -1
- package/dist/cjs/z-modal-login.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.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +4 -4
- package/dist/cjs/z-myz-card_4.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-list-item.cjs.entry.js +2 -2
- package/dist/cjs/z-myz-topbar.cjs.entry.js +1 -1
- package/dist/cjs/z-navigation-tab-link.cjs.entry.js +1 -1
- package/dist/cjs/z-navigation-tab.cjs.entry.js +1 -1
- package/dist/cjs/z-navigation-tabs.cjs.entry.js +1 -1
- package/dist/cjs/z-offcanvas.cjs.entry.js +63 -0
- package/dist/cjs/z-otp.cjs.entry.js +1 -1
- package/dist/cjs/z-pagination-bar.cjs.entry.js +2 -2
- package/dist/cjs/z-pocket_3.cjs.entry.js +2 -2
- package/dist/cjs/z-popover-deprecated.cjs.entry.js +338 -0
- package/dist/cjs/z-popover.cjs.entry.js +304 -97
- package/dist/cjs/z-section-title.cjs.entry.js +1 -1
- package/dist/cjs/z-skip-to-content.cjs.entry.js +2 -2
- package/dist/cjs/z-slideshow.cjs.entry.js +2 -2
- package/dist/cjs/z-status-tag.cjs.entry.js +1 -1
- package/dist/cjs/z-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/z-table-header.cjs.entry.js +8 -11
- package/dist/cjs/z-table-row.cjs.entry.js +1 -1
- package/dist/cjs/z-table.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-switch.cjs.entry.js +2 -2
- package/dist/cjs/z-tooltip-deprecated.cjs.entry.js +274 -0
- package/dist/cjs/z-tooltip.cjs.entry.js +8 -251
- package/dist/collection/beans/index.js +16 -45
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/{z-date-picker → date-picker}/styles.css +69 -17
- package/dist/collection/components/date-picker/utils.js +76 -0
- package/dist/collection/components/{z-date-picker → date-picker/z-date-picker}/index.js +13 -84
- package/dist/collection/components/date-picker/z-range-picker/index.js +483 -0
- package/dist/collection/components/file-upload/z-file/index.js +13 -13
- package/dist/collection/components/file-upload/z-file/styles.css +2 -2
- package/dist/collection/components/inputs/z-input/styles.css +2 -0
- package/dist/collection/components/notification/z-tooltip/index.js +45 -298
- package/dist/collection/components/notification/z-tooltip/styles.css +8 -120
- package/dist/collection/components/z-contextual-menu/index.js +26 -16
- package/dist/collection/components/z-contextual-menu/styles.css +16 -5
- package/dist/collection/components/z-popover/index.js +381 -166
- package/dist/collection/components/z-popover/styles.css +91 -180
- package/dist/collection/components/z-table/z-table-header/index.js +10 -16
- package/dist/collection/components/z-table/z-table-header/styles.css +7 -1
- package/dist/collection/deprecated/z-popover-deprecated/index.js +489 -0
- package/dist/collection/deprecated/z-popover-deprecated/styles.css +134 -0
- package/dist/collection/deprecated/z-tooltip-deprecated/index.js +379 -0
- package/dist/collection/deprecated/z-tooltip-deprecated/styles.css +128 -0
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +2 -2
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/styles.css +1 -1
- package/dist/esm/{index-46ca649a.js → index-c1ce8cab.js} +17 -46
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-5d5963ef.js → utils-99c70c57.js} +2 -2
- package/dist/esm/utils-fa9f38ec.js +2701 -0
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-switcher_9.entry.js +724 -0
- package/dist/esm/z-aria-alert.entry.js +1 -1
- package/dist/esm/z-avatar.entry.js +1 -1
- package/dist/esm/z-button-deprecated.entry.js +1 -1
- package/dist/esm/z-button.entry.js +40 -0
- package/dist/esm/z-card.entry.js +65 -0
- package/dist/esm/z-carousel.entry.js +20 -0
- package/dist/esm/z-chip.entry.js +2 -2
- package/dist/esm/z-combobox.entry.js +2 -2
- package/dist/esm/z-contextual-menu.entry.js +19 -8
- package/dist/esm/z-cookiebar.entry.js +1 -1
- package/dist/esm/z-date-picker.entry.js +9 -2700
- package/dist/esm/z-file-upload.entry.js +2 -2
- package/dist/esm/z-file.entry.js +10 -9
- package/dist/esm/z-footer.entry.js +1 -1
- package/dist/esm/z-ghost-loading.entry.js +15 -0
- package/dist/esm/z-input-deprecated.entry.js +2 -2
- package/dist/esm/z-input-label_2.entry.js +2 -2
- package/dist/esm/z-list-group.entry.js +1 -1
- package/dist/esm/z-list_2.entry.js +1 -1
- package/dist/esm/z-menu-dropdown_2.entry.js +2 -2
- package/dist/esm/z-messages-pocket.entry.js +1 -1
- package/dist/esm/z-modal-login.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.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +4 -4
- package/dist/esm/z-myz-card_4.entry.js +1 -1
- package/dist/esm/z-myz-list-item.entry.js +2 -2
- package/dist/esm/z-myz-topbar.entry.js +1 -1
- package/dist/esm/z-navigation-tab-link.entry.js +1 -1
- package/dist/esm/z-navigation-tab.entry.js +1 -1
- package/dist/esm/z-navigation-tabs.entry.js +1 -1
- package/dist/esm/z-offcanvas.entry.js +59 -0
- package/dist/esm/z-otp.entry.js +1 -1
- package/dist/esm/z-pagination-bar.entry.js +2 -2
- package/dist/esm/z-pocket_3.entry.js +2 -2
- package/dist/esm/z-popover-deprecated.entry.js +334 -0
- package/dist/esm/z-popover.entry.js +305 -98
- package/dist/esm/z-section-title.entry.js +1 -1
- package/dist/esm/z-skip-to-content.entry.js +2 -2
- package/dist/esm/z-slideshow.entry.js +2 -2
- package/dist/esm/z-status-tag.entry.js +1 -1
- package/dist/esm/z-table-cell.entry.js +1 -1
- package/dist/esm/z-table-header.entry.js +8 -11
- package/dist/esm/z-table-row.entry.js +1 -1
- package/dist/esm/z-table.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-switch.entry.js +2 -2
- package/dist/esm/z-tooltip-deprecated.entry.js +270 -0
- package/dist/esm/z-tooltip.entry.js +9 -252
- package/dist/types/beans/index.d.ts +7 -33
- package/dist/types/components/date-picker/utils.d.ts +3 -0
- package/dist/types/components/{z-date-picker → date-picker/z-date-picker}/index.d.ts +3 -8
- package/dist/types/components/date-picker/z-range-picker/index.d.ts +43 -0
- package/dist/types/components/file-upload/z-file/index.d.ts +3 -3
- package/dist/types/components/notification/z-tooltip/index.d.ts +14 -29
- package/dist/types/components/z-contextual-menu/index.d.ts +8 -4
- package/dist/types/components/z-popover/index.d.ts +57 -28
- package/dist/types/components/z-table/z-table-header/index.d.ts +2 -1
- package/dist/types/components.d.ts +210 -35
- package/dist/types/deprecated/z-popover-deprecated/index.d.ts +57 -0
- package/dist/types/deprecated/z-tooltip-deprecated/index.d.ts +41 -0
- package/dist/web-components-library/index.esm.js +1 -1
- package/dist/web-components-library/{p-4af112a7.entry.js → p-053846df.entry.js} +1 -1
- package/dist/web-components-library/{p-e2102da3.entry.js → p-0f6edb58.entry.js} +1 -1
- package/dist/web-components-library/p-10be0462.entry.js +1 -0
- package/dist/web-components-library/{p-b15efba3.entry.js → p-15fa8ca4.entry.js} +1 -1
- package/dist/web-components-library/{p-02ea7e49.entry.js → p-1a76a57d.entry.js} +1 -1
- package/{www/build/p-1f73a6d8.entry.js → dist/web-components-library/p-1b1717c9.entry.js} +1 -1
- package/{www/build/p-3edbd35c.entry.js → dist/web-components-library/p-1d5aa37b.entry.js} +1 -1
- package/dist/web-components-library/{p-9074e1a5.entry.js → p-1eb357e8.entry.js} +1 -1
- package/dist/web-components-library/{p-57d1acdc.entry.js → p-28e4abc4.entry.js} +1 -1
- package/dist/web-components-library/p-41f33f7b.entry.js +1 -0
- package/dist/web-components-library/{p-d33fea26.entry.js → p-46aecb12.entry.js} +1 -1
- package/dist/web-components-library/{p-63ccb013.entry.js → p-4be52491.entry.js} +1 -1
- package/{www/build/p-55ddbfe9.entry.js → dist/web-components-library/p-4d6f2f01.entry.js} +1 -1
- package/dist/web-components-library/p-514719d2.entry.js +1 -0
- package/dist/web-components-library/p-53dade4b.entry.js +16 -0
- package/{www/build/p-df4e963b.entry.js → dist/web-components-library/p-55f09348.entry.js} +1 -1
- package/dist/web-components-library/p-5789bbe7.entry.js +1 -0
- package/dist/web-components-library/{p-de25c7f0.entry.js → p-5dcbba4e.entry.js} +1 -1
- package/dist/web-components-library/{p-9f9e4266.entry.js → p-659fc25e.entry.js} +1 -1
- package/dist/web-components-library/{p-8fbc2ce9.entry.js → p-6bbd53ec.entry.js} +1 -1
- package/dist/web-components-library/{p-5be162d5.entry.js → p-6c52ed1b.entry.js} +1 -1
- package/dist/web-components-library/p-78df5dbf.entry.js +1 -0
- package/dist/web-components-library/{p-b9da171f.js → p-7f1cc90f.js} +1 -1
- package/dist/web-components-library/{p-0f17db30.entry.js → p-805af37b.entry.js} +1 -1
- package/dist/web-components-library/p-870dabdc.entry.js +1 -0
- package/dist/web-components-library/{p-43329b81.entry.js → p-897f9491.entry.js} +1 -1
- package/dist/web-components-library/{p-3c111c2a.entry.js → p-8ce4b2c4.entry.js} +1 -1
- package/dist/web-components-library/p-8cf3798f.entry.js +1 -0
- package/dist/web-components-library/p-8ddbbe24.entry.js +1 -0
- package/{www/build/p-dffdf60a.entry.js → dist/web-components-library/p-91ec5eb4.entry.js} +1 -1
- package/dist/web-components-library/{p-292bc0c4.entry.js → p-92895bce.entry.js} +1 -1
- package/dist/web-components-library/p-970bd07c.entry.js +1 -0
- package/dist/web-components-library/{p-6c6b4e80.entry.js → p-990b8236.entry.js} +1 -1
- package/dist/web-components-library/{p-51cdabeb.entry.js → p-99a562cb.entry.js} +1 -1
- package/dist/web-components-library/p-b359a3b4.entry.js +1 -0
- package/dist/web-components-library/p-b6cd034b.js +1 -0
- package/dist/web-components-library/{p-edb8d2ab.entry.js → p-b9cc2dfc.entry.js} +1 -1
- package/dist/web-components-library/p-bfc78a89.entry.js +1 -0
- package/dist/web-components-library/{p-d995d9dc.entry.js → p-c042e745.entry.js} +1 -1
- package/dist/web-components-library/{p-ccdebe3f.entry.js → p-c8383456.entry.js} +1 -1
- package/dist/web-components-library/{p-0e256fdc.entry.js → p-caa21a6f.entry.js} +1 -1
- package/{www/build/p-bfe5693d.entry.js → dist/web-components-library/p-cd88cead.entry.js} +1 -1
- package/dist/web-components-library/p-d04f3cb6.entry.js +1 -0
- package/{www/build/p-9a5ee6c2.entry.js → dist/web-components-library/p-d6361790.entry.js} +1 -1
- package/dist/web-components-library/{p-69ef6ddc.entry.js → p-dd0efdbf.entry.js} +1 -1
- package/dist/web-components-library/p-e007cd0b.entry.js +1 -0
- package/dist/web-components-library/{p-0a0aee35.entry.js → p-e74b3fd9.entry.js} +1 -1
- package/{www/build/p-d97a2db9.entry.js → dist/web-components-library/p-eca4cb15.entry.js} +1 -1
- package/dist/web-components-library/p-ed1cd6b1.js +1 -0
- package/dist/web-components-library/p-f26251dd.entry.js +1 -0
- package/dist/web-components-library/p-f61fd81e.entry.js +1 -0
- package/dist/web-components-library/{p-1727c1c8.entry.js → p-f78d6123.entry.js} +1 -1
- package/dist/web-components-library/p-fbfaa699.entry.js +1 -0
- package/dist/web-components-library/{p-ba29bc12.entry.js → p-fdd91263.entry.js} +1 -1
- package/dist/web-components-library/{p-fe927bf4.entry.js → p-ff4a0f6f.entry.js} +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +1 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +5 -2
- package/react/components.js.map +1 -1
- package/www/build/index.esm.js +1 -1
- package/www/build/{p-4af112a7.entry.js → p-053846df.entry.js} +1 -1
- package/www/build/{p-e2102da3.entry.js → p-0f6edb58.entry.js} +1 -1
- package/www/build/p-10be0462.entry.js +1 -0
- package/www/build/{p-b15efba3.entry.js → p-15fa8ca4.entry.js} +1 -1
- package/www/build/{p-02ea7e49.entry.js → p-1a76a57d.entry.js} +1 -1
- package/{dist/web-components-library/p-1f73a6d8.entry.js → www/build/p-1b1717c9.entry.js} +1 -1
- package/{dist/web-components-library/p-3edbd35c.entry.js → www/build/p-1d5aa37b.entry.js} +1 -1
- package/www/build/{p-9074e1a5.entry.js → p-1eb357e8.entry.js} +1 -1
- package/www/build/{p-57d1acdc.entry.js → p-28e4abc4.entry.js} +1 -1
- package/www/build/p-41f33f7b.entry.js +1 -0
- package/www/build/{p-d33fea26.entry.js → p-46aecb12.entry.js} +1 -1
- package/www/build/{p-63ccb013.entry.js → p-4be52491.entry.js} +1 -1
- package/{dist/web-components-library/p-55ddbfe9.entry.js → www/build/p-4d6f2f01.entry.js} +1 -1
- package/www/build/p-514719d2.entry.js +1 -0
- package/www/build/p-53dade4b.entry.js +16 -0
- package/{dist/web-components-library/p-df4e963b.entry.js → www/build/p-55f09348.entry.js} +1 -1
- package/www/build/p-5789bbe7.entry.js +1 -0
- package/www/build/{p-de25c7f0.entry.js → p-5dcbba4e.entry.js} +1 -1
- package/www/build/{p-9f9e4266.entry.js → p-659fc25e.entry.js} +1 -1
- package/www/build/{p-8fbc2ce9.entry.js → p-6bbd53ec.entry.js} +1 -1
- package/www/build/{p-5be162d5.entry.js → p-6c52ed1b.entry.js} +1 -1
- package/www/build/p-78df5dbf.entry.js +1 -0
- package/www/build/{p-b9da171f.js → p-7f1cc90f.js} +1 -1
- package/www/build/{p-0f17db30.entry.js → p-805af37b.entry.js} +1 -1
- package/www/build/p-870dabdc.entry.js +1 -0
- package/www/build/{p-43329b81.entry.js → p-897f9491.entry.js} +1 -1
- package/www/build/{p-3c111c2a.entry.js → p-8ce4b2c4.entry.js} +1 -1
- package/www/build/p-8cf3798f.entry.js +1 -0
- package/www/build/p-8ddbbe24.entry.js +1 -0
- package/{dist/web-components-library/p-dffdf60a.entry.js → www/build/p-91ec5eb4.entry.js} +1 -1
- package/www/build/{p-292bc0c4.entry.js → p-92895bce.entry.js} +1 -1
- package/www/build/p-970bd07c.entry.js +1 -0
- package/www/build/p-975e9d42.js +129 -0
- package/www/build/{p-6c6b4e80.entry.js → p-990b8236.entry.js} +1 -1
- package/www/build/{p-51cdabeb.entry.js → p-99a562cb.entry.js} +1 -1
- package/www/build/p-b359a3b4.entry.js +1 -0
- package/www/build/p-b6cd034b.js +1 -0
- package/www/build/{p-edb8d2ab.entry.js → p-b9cc2dfc.entry.js} +1 -1
- package/www/build/p-bfc78a89.entry.js +1 -0
- package/www/build/{p-d995d9dc.entry.js → p-c042e745.entry.js} +1 -1
- package/www/build/{p-ccdebe3f.entry.js → p-c8383456.entry.js} +1 -1
- package/www/build/{p-0e256fdc.entry.js → p-caa21a6f.entry.js} +1 -1
- package/{dist/web-components-library/p-bfe5693d.entry.js → www/build/p-cd88cead.entry.js} +1 -1
- package/www/build/p-d04f3cb6.entry.js +1 -0
- package/{dist/web-components-library/p-9a5ee6c2.entry.js → www/build/p-d6361790.entry.js} +1 -1
- package/www/build/{p-69ef6ddc.entry.js → p-dd0efdbf.entry.js} +1 -1
- package/www/build/p-e007cd0b.entry.js +1 -0
- package/www/build/{p-0a0aee35.entry.js → p-e74b3fd9.entry.js} +1 -1
- package/{dist/web-components-library/p-d97a2db9.entry.js → www/build/p-eca4cb15.entry.js} +1 -1
- package/www/build/p-ed1cd6b1.js +1 -0
- package/www/build/p-f26251dd.entry.js +1 -0
- package/www/build/p-f61fd81e.entry.js +1 -0
- package/www/build/{p-1727c1c8.entry.js → p-f78d6123.entry.js} +1 -1
- package/www/build/p-fbfaa699.entry.js +1 -0
- package/www/build/p-fcff1237.css +812 -0
- package/www/build/{p-ba29bc12.entry.js → p-fdd91263.entry.js} +1 -1
- package/www/build/{p-fe927bf4.entry.js → p-ff4a0f6f.entry.js} +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +6 -70
- package/dist/cjs/z-app-switcher_11.cjs.entry.js +0 -377
- package/dist/cjs/z-input_2.cjs.entry.js +0 -228
- package/dist/esm/z-app-switcher_11.entry.js +0 -363
- package/dist/esm/z-input_2.entry.js +0 -223
- package/dist/web-components-library/p-0d29d851.entry.js +0 -1
- package/dist/web-components-library/p-0e408871.entry.js +0 -1
- package/dist/web-components-library/p-0ef6c549.entry.js +0 -1
- package/dist/web-components-library/p-20d62443.entry.js +0 -1
- package/dist/web-components-library/p-562e2d52.entry.js +0 -1
- package/dist/web-components-library/p-5eacbfc7.entry.js +0 -1
- package/dist/web-components-library/p-6218514a.entry.js +0 -1
- package/dist/web-components-library/p-71accd8e.entry.js +0 -1
- package/dist/web-components-library/p-7c6d4440.entry.js +0 -1
- package/dist/web-components-library/p-9f5d707a.js +0 -1
- package/dist/web-components-library/p-a8875b97.entry.js +0 -16
- package/dist/web-components-library/p-e2431b92.entry.js +0 -1
- package/www/build/p-0d29d851.entry.js +0 -1
- package/www/build/p-0e408871.entry.js +0 -1
- package/www/build/p-0ef6c549.entry.js +0 -1
- package/www/build/p-20d62443.entry.js +0 -1
- package/www/build/p-562e2d52.entry.js +0 -1
- package/www/build/p-5eacbfc7.entry.js +0 -1
- package/www/build/p-6218514a.entry.js +0 -1
- package/www/build/p-71accd8e.entry.js +0 -1
- package/www/build/p-7614383b.js +0 -1
- package/www/build/p-7c6d4440.entry.js +0 -1
- package/www/build/p-88b56b6e.css +0 -1
- package/www/build/p-9f5d707a.js +0 -1
- package/www/build/p-a8875b97.entry.js +0 -16
- package/www/build/p-e2431b92.entry.js +0 -1
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-90e18641.js';
|
|
2
|
+
import { P as PopoverPositions } from './index-c1ce8cab.js';
|
|
3
|
+
|
|
4
|
+
const stylesCss = ":host{--z-tooltip-theme--surface:var(--color-surface01);--z-tooltip-theme--text:var(--color-text01);--arrow-size:6px;--edge-offset:calc(-1 * (var(--arrow-size) + calc(var(--space-unit) * 2)));position:relative;display:none;align-items:center;justify-content:center;padding:var(--space-unit);min-width:calc(var(--space-unit) * 8);min-height:calc(var(--space-unit) * 4);color:var(--z-tooltip-theme--text);fill:currentColor;font-family:var(--font-family-sans);text-align:center;border-radius:var(--border-radius-small);background:var(--z-tooltip-theme--surface);filter:drop-shadow(0 4px 8px var(--shadow-color-base));will-change:filter}:host(.legacy){display:inline-flex;padding:calc(var(--space-unit) * 2);min-width:auto;min-height:auto;max-width:200px;font-style:italic;line-height:16px;letter-spacing:0.32px;font-size:12px;border:var(--border-size-small) solid var(--gray200);border-radius:var(--border-radius);filter:drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.08))}:host(.legacy)::before{--arrow-size:14px}:host([position])::before{--arrow-edge-offset:calc(100% - var(--arrow-size) - var(--space-unit));--arrow-center-x-offset:calc(50% - calc(var(--arrow-size) / 2));--arrow-center-y-offset:calc(100% - calc(var(--arrow-size) / 2));content:'';position:absolute;width:var(--arrow-size);height:var(--arrow-size);background:inherit;transform:rotate(45deg)}:host([open][style*='top:']),:host([open][style*='inset:']){display:inline-flex}:host([position^='top']){margin-bottom:var(--space-unit)}:host([position='right']){margin-left:var(--space-unit)}:host([position='top_right']),:host([position='bottom_right']){margin-left:var(--edge-offset)}:host([position^='bottom']){margin-top:var(--space-unit)}:host([position='left']){margin-right:var(--space-unit)}:host([position='top_left']),:host([position='bottom_left']){margin-right:var(--edge-offset)}:host([position^='top'])::before{top:var(--arrow-center-y-offset)}:host([position^='bottom'])::before{bottom:var(--arrow-center-y-offset)}:host([position='top'])::before,:host([position='bottom'])::before{left:var(--arrow-center-x-offset)}:host([position='right'])::before,:host([position='left'])::before{top:var(--arrow-center-x-offset)}:host([position='right'])::before{right:var(--arrow-center-y-offset)}:host([position='top_right'])::before,:host([position='bottom_right'])::before{right:var(--arrow-edge-offset)}:host([position='left'])::before{left:var(--arrow-center-y-offset)}:host([position='top_left'])::before,:host([position='bottom_left'])::before{left:var(--arrow-edge-offset)}::slotted(*){flex:1 auto;overflow:auto}";
|
|
5
|
+
|
|
6
|
+
const documentElement = document.documentElement;
|
|
7
|
+
/**
|
|
8
|
+
* Find the closest scrollable parent of a node.
|
|
9
|
+
*
|
|
10
|
+
* @param {Element} element The node
|
|
11
|
+
*/
|
|
12
|
+
function findScrollableParent(element) {
|
|
13
|
+
let parent = element.parentNode;
|
|
14
|
+
while (parent && parent !== documentElement) {
|
|
15
|
+
const { overflow, overflowX, overflowY } = window.getComputedStyle(parent);
|
|
16
|
+
if (overflow === 'hidden' ||
|
|
17
|
+
overflowY === 'hidden' ||
|
|
18
|
+
overflowX === 'hidden') {
|
|
19
|
+
return parent;
|
|
20
|
+
}
|
|
21
|
+
if ((parent.scrollHeight > parent.clientHeight && overflow !== 'visible' && overflowY !== 'visible') ||
|
|
22
|
+
(parent.scrollWidth > parent.clientWidth && overflow !== 'visible' && overflowX !== 'visible')) {
|
|
23
|
+
return parent;
|
|
24
|
+
}
|
|
25
|
+
parent = parent.parentNode;
|
|
26
|
+
}
|
|
27
|
+
return documentElement;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Calculate computed offset.
|
|
31
|
+
* It includes matrix transformations.
|
|
32
|
+
* @param element The target element.
|
|
33
|
+
* @param targetParentOffset The relative offset parent.
|
|
34
|
+
* @return A client rect object.
|
|
35
|
+
*/
|
|
36
|
+
function computeOffset(element, targetParentOffset) {
|
|
37
|
+
const rect = element.getBoundingClientRect();
|
|
38
|
+
const width = rect.width;
|
|
39
|
+
const height = rect.height;
|
|
40
|
+
let top = 0;
|
|
41
|
+
let left = 0;
|
|
42
|
+
let offsetParent = element;
|
|
43
|
+
while (offsetParent && offsetParent != targetParentOffset) {
|
|
44
|
+
left += offsetParent.offsetLeft;
|
|
45
|
+
// document.body sometimes has offsetTop == 0 but still has an
|
|
46
|
+
// offset because of children margins!
|
|
47
|
+
if (offsetParent === document.body) {
|
|
48
|
+
top += offsetParent.getBoundingClientRect().top + window.scrollY;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
top += offsetParent.offsetTop;
|
|
52
|
+
}
|
|
53
|
+
if (window.DOMMatrix) {
|
|
54
|
+
const style = window.getComputedStyle(offsetParent);
|
|
55
|
+
const transform = style.transform || style.webkitTransform;
|
|
56
|
+
const domMatrix = new DOMMatrix(transform);
|
|
57
|
+
if (domMatrix) {
|
|
58
|
+
left += domMatrix.m41;
|
|
59
|
+
if (offsetParent !== document.body) {
|
|
60
|
+
top += domMatrix.m42;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (!offsetParent.offsetParent) {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
offsetParent = offsetParent.offsetParent;
|
|
68
|
+
}
|
|
69
|
+
let parentWidth;
|
|
70
|
+
let parentHeight;
|
|
71
|
+
if (offsetParent === document.body) {
|
|
72
|
+
parentWidth = window.innerWidth;
|
|
73
|
+
parentHeight = window.innerHeight;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
parentWidth = offsetParent.offsetWidth;
|
|
77
|
+
parentHeight = offsetParent.offsetHeight;
|
|
78
|
+
}
|
|
79
|
+
const right = parentWidth - left - rect.width;
|
|
80
|
+
const bottom = parentHeight - top - rect.height;
|
|
81
|
+
return { top, right, bottom, left, width, height };
|
|
82
|
+
}
|
|
83
|
+
const ZTooltipDeprecated = class {
|
|
84
|
+
constructor(hostRef) {
|
|
85
|
+
registerInstance(this, hostRef);
|
|
86
|
+
this.positionChange = createEvent(this, "positionChange", 7);
|
|
87
|
+
/** Tooltip position. */
|
|
88
|
+
this.type = PopoverPositions.AUTO;
|
|
89
|
+
/**
|
|
90
|
+
* The open state of the tooltip.
|
|
91
|
+
*/
|
|
92
|
+
this.open = false;
|
|
93
|
+
}
|
|
94
|
+
validateType(newValue) {
|
|
95
|
+
if (newValue &&
|
|
96
|
+
Object
|
|
97
|
+
.values(PopoverPositions)
|
|
98
|
+
.every((position) => newValue !== position)) {
|
|
99
|
+
this.type = PopoverPositions.AUTO;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
onPositionChange() {
|
|
103
|
+
this.positionChange.emit({ position: this.position });
|
|
104
|
+
}
|
|
105
|
+
disconnectedCallback() {
|
|
106
|
+
cancelAnimationFrame(this.animationFrameRequestId);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Setup tooltip behaviors on opening.
|
|
110
|
+
*/
|
|
111
|
+
onOpen() {
|
|
112
|
+
cancelAnimationFrame(this.animationFrameRequestId);
|
|
113
|
+
if (this.content) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (this.open) {
|
|
117
|
+
const setPosition = () => {
|
|
118
|
+
if (this.open) {
|
|
119
|
+
this.setPosition();
|
|
120
|
+
this.animationFrameRequestId = requestAnimationFrame(setPosition);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
setPosition();
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const style = this.host.style;
|
|
127
|
+
style.removeProperty("top");
|
|
128
|
+
style.removeProperty("right");
|
|
129
|
+
style.removeProperty("bottom");
|
|
130
|
+
style.removeProperty("left");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Set the position of the tooltip.
|
|
135
|
+
*/
|
|
136
|
+
setPosition() {
|
|
137
|
+
let element;
|
|
138
|
+
if (typeof this.bindTo === "string") {
|
|
139
|
+
element = this.host.ownerDocument.querySelector(this.bindTo);
|
|
140
|
+
}
|
|
141
|
+
else if (this.bindTo) {
|
|
142
|
+
element = this.bindTo;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
element = this.host.parentElement;
|
|
146
|
+
}
|
|
147
|
+
if (!element) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const scrollContainer = findScrollableParent(element);
|
|
151
|
+
const scrollingBoundingRect = scrollContainer.getBoundingClientRect();
|
|
152
|
+
const offsetContainer = this.host.offsetParent;
|
|
153
|
+
const relativeBoundingRect = offsetContainer ? computeOffset(offsetContainer, scrollContainer) : { top: 0, right: 0, bottom: 0, left: 0 };
|
|
154
|
+
const boundingRect = computeOffset(element, scrollContainer);
|
|
155
|
+
const top = boundingRect.top - scrollContainer.scrollTop;
|
|
156
|
+
const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;
|
|
157
|
+
const left = boundingRect.left - scrollContainer.scrollLeft;
|
|
158
|
+
const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;
|
|
159
|
+
const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);
|
|
160
|
+
const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);
|
|
161
|
+
const availableTop = Math.min(top, top + scrollingBoundingRect.top);
|
|
162
|
+
const availableBottom = Math.min(bottom, bottom - overflowBottom);
|
|
163
|
+
const availableLeft = Math.min(left, left + scrollingBoundingRect.left);
|
|
164
|
+
const availableRight = Math.min(right, right - overflowRight);
|
|
165
|
+
const availableHeight = availableTop + availableBottom + boundingRect.height;
|
|
166
|
+
const availableWidth = availableLeft + availableRight + boundingRect.width;
|
|
167
|
+
let position = this.type;
|
|
168
|
+
if (position === PopoverPositions.AUTO) {
|
|
169
|
+
/**
|
|
170
|
+
* The `AUTO` position tries to place the tooltip in the "safest" area,
|
|
171
|
+
* where there's more space available.
|
|
172
|
+
*/
|
|
173
|
+
const positions = [];
|
|
174
|
+
if (availableTop / availableHeight > 0.9) {
|
|
175
|
+
positions.unshift(PopoverPositions.TOP);
|
|
176
|
+
}
|
|
177
|
+
else if (availableTop / availableHeight > 0.6) {
|
|
178
|
+
positions.push(PopoverPositions.TOP);
|
|
179
|
+
}
|
|
180
|
+
else if (availableTop / availableHeight < 0.1) {
|
|
181
|
+
positions.unshift(PopoverPositions.BOTTOM);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
positions.push(PopoverPositions.BOTTOM);
|
|
185
|
+
}
|
|
186
|
+
if (availableLeft / availableWidth > 0.6) {
|
|
187
|
+
positions.push(PopoverPositions.LEFT);
|
|
188
|
+
}
|
|
189
|
+
else if (availableLeft / availableWidth < 0.4) {
|
|
190
|
+
positions.push(PopoverPositions.RIGHT);
|
|
191
|
+
}
|
|
192
|
+
position = positions.join("_");
|
|
193
|
+
}
|
|
194
|
+
const style = this.host.style;
|
|
195
|
+
if (!this.content) {
|
|
196
|
+
style.position = "absolute";
|
|
197
|
+
}
|
|
198
|
+
const offsetTop = boundingRect.top - relativeBoundingRect.top;
|
|
199
|
+
const offsetRight = boundingRect.right - relativeBoundingRect.right;
|
|
200
|
+
const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;
|
|
201
|
+
const offsetLeft = boundingRect.left - relativeBoundingRect.left;
|
|
202
|
+
if (position === PopoverPositions.TOP ||
|
|
203
|
+
position === PopoverPositions.TOP_RIGHT ||
|
|
204
|
+
position === PopoverPositions.TOP_LEFT) {
|
|
205
|
+
style.top = "auto";
|
|
206
|
+
style.bottom = `${offsetBottom + boundingRect.height}px`;
|
|
207
|
+
}
|
|
208
|
+
if (position === PopoverPositions.BOTTOM ||
|
|
209
|
+
position === PopoverPositions.BOTTOM_RIGHT ||
|
|
210
|
+
position === PopoverPositions.BOTTOM_LEFT) {
|
|
211
|
+
style.top = `${offsetTop + boundingRect.height}px`;
|
|
212
|
+
style.bottom = "auto";
|
|
213
|
+
}
|
|
214
|
+
if (position === PopoverPositions.TOP ||
|
|
215
|
+
position === PopoverPositions.BOTTOM) {
|
|
216
|
+
style.left = `${offsetLeft +
|
|
217
|
+
(boundingRect.width / 2) -
|
|
218
|
+
(this.host.clientWidth / 2)}px`;
|
|
219
|
+
}
|
|
220
|
+
if (position === PopoverPositions.TOP_RIGHT ||
|
|
221
|
+
position === PopoverPositions.BOTTOM_RIGHT) {
|
|
222
|
+
style.right = "auto";
|
|
223
|
+
style.left = `${offsetLeft + boundingRect.width}px`;
|
|
224
|
+
}
|
|
225
|
+
if (position === PopoverPositions.TOP_LEFT ||
|
|
226
|
+
position === PopoverPositions.BOTTOM_LEFT) {
|
|
227
|
+
style.left = "auto";
|
|
228
|
+
style.right = `${offsetRight + boundingRect.width}px`;
|
|
229
|
+
}
|
|
230
|
+
if (position === PopoverPositions.RIGHT ||
|
|
231
|
+
position === PopoverPositions.LEFT) {
|
|
232
|
+
style.top = `${offsetTop +
|
|
233
|
+
(boundingRect.height / 2) -
|
|
234
|
+
(this.host.clientHeight / 2)}px`;
|
|
235
|
+
style.bottom = "auto";
|
|
236
|
+
}
|
|
237
|
+
if (position === PopoverPositions.RIGHT) {
|
|
238
|
+
style.right = "auto";
|
|
239
|
+
style.left = `${offsetLeft + boundingRect.width}px`;
|
|
240
|
+
}
|
|
241
|
+
if (position === PopoverPositions.LEFT) {
|
|
242
|
+
style.left = "auto";
|
|
243
|
+
style.right = `${offsetRight + boundingRect.width}px`;
|
|
244
|
+
}
|
|
245
|
+
this.position = position;
|
|
246
|
+
}
|
|
247
|
+
componentWillLoad() {
|
|
248
|
+
// Keep backward compatibility
|
|
249
|
+
if (this.content) {
|
|
250
|
+
this.open = true;
|
|
251
|
+
}
|
|
252
|
+
this.validateType(this.type);
|
|
253
|
+
this.onOpen();
|
|
254
|
+
}
|
|
255
|
+
render() {
|
|
256
|
+
if (this.content) {
|
|
257
|
+
return (h(Host, { class: "legacy", position: this.type }, this.content));
|
|
258
|
+
}
|
|
259
|
+
return (h(Host, { position: this.position }, h("slot", null)));
|
|
260
|
+
}
|
|
261
|
+
get host() { return getElement(this); }
|
|
262
|
+
static get watchers() { return {
|
|
263
|
+
"type": ["validateType"],
|
|
264
|
+
"position": ["onPositionChange"],
|
|
265
|
+
"open": ["onOpen"]
|
|
266
|
+
}; }
|
|
267
|
+
};
|
|
268
|
+
ZTooltipDeprecated.style = stylesCss;
|
|
269
|
+
|
|
270
|
+
export { ZTooltipDeprecated as z_tooltip_deprecated };
|
|
@@ -1,269 +1,26 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, h } from './index-90e18641.js';
|
|
2
|
+
import { P as PopoverPositions } from './index-c1ce8cab.js';
|
|
3
3
|
|
|
4
|
-
const stylesCss = ":host{--z-tooltip-theme--surface:var(--color-surface01);--z-tooltip-theme--text:var(--color-text01);--
|
|
4
|
+
const stylesCss = ":host{--z-tooltip-theme--surface:var(--color-surface01);--z-tooltip-theme--text:var(--color-text01);--z-tooltip-shadow-filter:drop-shadow(0 1px 2px var(--shadow-color-base))}:host([dark]) z-popover{--z-popover-theme--surface:var(--color-surface05)}z-popover{--z-popover-padding:var(--space-unit);--z-popover-theme--surface:var(--z-tooltip-theme--surface);--z-popover-theme--text:var(--z-tooltip-theme--text);--z-popover-shadow-filter:var(--z-tooltip-shadow-filter)}";
|
|
5
5
|
|
|
6
|
-
const documentElement = document.documentElement;
|
|
7
|
-
/**
|
|
8
|
-
* Find the closest scrollable parent of a node.
|
|
9
|
-
*
|
|
10
|
-
* @param {Element} element The node
|
|
11
|
-
*/
|
|
12
|
-
function findScrollableParent(element) {
|
|
13
|
-
let parent = element.parentNode;
|
|
14
|
-
while (parent && parent !== documentElement) {
|
|
15
|
-
const { overflow, overflowX, overflowY } = window.getComputedStyle(parent);
|
|
16
|
-
if (overflow === 'hidden' ||
|
|
17
|
-
overflowY === 'hidden' ||
|
|
18
|
-
overflowX === 'hidden') {
|
|
19
|
-
return parent;
|
|
20
|
-
}
|
|
21
|
-
if ((parent.scrollHeight > parent.clientHeight && overflow !== 'visible' && overflowY !== 'visible') ||
|
|
22
|
-
(parent.scrollWidth > parent.clientWidth && overflow !== 'visible' && overflowX !== 'visible')) {
|
|
23
|
-
return parent;
|
|
24
|
-
}
|
|
25
|
-
parent = parent.parentNode;
|
|
26
|
-
}
|
|
27
|
-
return documentElement;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Calculate computed offset.
|
|
31
|
-
* It includes matrix transformations.
|
|
32
|
-
* @param element The target element.
|
|
33
|
-
* @param targetParentOffset The relative offset parent.
|
|
34
|
-
* @return A client rect object.
|
|
35
|
-
*/
|
|
36
|
-
function computeOffset(element, targetParentOffset) {
|
|
37
|
-
const rect = element.getBoundingClientRect();
|
|
38
|
-
const width = rect.width;
|
|
39
|
-
const height = rect.height;
|
|
40
|
-
let top = 0;
|
|
41
|
-
let left = 0;
|
|
42
|
-
let offsetParent = element;
|
|
43
|
-
while (offsetParent && offsetParent != targetParentOffset) {
|
|
44
|
-
left += offsetParent.offsetLeft;
|
|
45
|
-
// document.body sometimes has offsetTop == 0 but still has an
|
|
46
|
-
// offset because of children margins!
|
|
47
|
-
if (offsetParent === document.body) {
|
|
48
|
-
top += offsetParent.getBoundingClientRect().top + window.scrollY;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
top += offsetParent.offsetTop;
|
|
52
|
-
}
|
|
53
|
-
if (window.DOMMatrix) {
|
|
54
|
-
const style = window.getComputedStyle(offsetParent);
|
|
55
|
-
const transform = style.transform || style.webkitTransform;
|
|
56
|
-
const domMatrix = new DOMMatrix(transform);
|
|
57
|
-
if (domMatrix) {
|
|
58
|
-
left += domMatrix.m41;
|
|
59
|
-
if (offsetParent !== document.body) {
|
|
60
|
-
top += domMatrix.m42;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (!offsetParent.offsetParent) {
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
offsetParent = offsetParent.offsetParent;
|
|
68
|
-
}
|
|
69
|
-
let parentWidth;
|
|
70
|
-
let parentHeight;
|
|
71
|
-
if (offsetParent === document.body) {
|
|
72
|
-
parentWidth = window.innerWidth;
|
|
73
|
-
parentHeight = window.innerHeight;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
parentWidth = offsetParent.offsetWidth;
|
|
77
|
-
parentHeight = offsetParent.offsetHeight;
|
|
78
|
-
}
|
|
79
|
-
const right = parentWidth - left - rect.width;
|
|
80
|
-
const bottom = parentHeight - top - rect.height;
|
|
81
|
-
return { top, right, bottom, left, width, height };
|
|
82
|
-
}
|
|
83
6
|
const ZTooltip = class {
|
|
84
7
|
constructor(hostRef) {
|
|
85
8
|
registerInstance(this, hostRef);
|
|
86
|
-
this.positionChange = createEvent(this, "positionChange", 7);
|
|
87
9
|
/** Tooltip position. */
|
|
88
|
-
this.
|
|
10
|
+
this.position = PopoverPositions.AUTO;
|
|
11
|
+
/** Enable tooltip dark mode. */
|
|
12
|
+
this.dark = false;
|
|
89
13
|
/**
|
|
90
14
|
* The open state of the tooltip.
|
|
91
15
|
*/
|
|
92
16
|
this.open = false;
|
|
93
17
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Object
|
|
97
|
-
.values(TooltipPosition)
|
|
98
|
-
.every((position) => newValue !== position)) {
|
|
99
|
-
this.type = TooltipPosition.AUTO;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
onPositionChange() {
|
|
103
|
-
this.positionChange.emit({ position: this.position });
|
|
104
|
-
}
|
|
105
|
-
disconnectedCallback() {
|
|
106
|
-
cancelAnimationFrame(this.animationFrameRequestId);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Setup tooltip behaviors on opening.
|
|
110
|
-
*/
|
|
111
|
-
onOpen() {
|
|
112
|
-
cancelAnimationFrame(this.animationFrameRequestId);
|
|
113
|
-
if (this.content) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (this.open) {
|
|
117
|
-
const setPosition = () => {
|
|
118
|
-
if (this.open) {
|
|
119
|
-
this.setPosition();
|
|
120
|
-
this.animationFrameRequestId = requestAnimationFrame(setPosition);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
setPosition();
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
const style = this.host.style;
|
|
127
|
-
style.removeProperty("top");
|
|
128
|
-
style.removeProperty("right");
|
|
129
|
-
style.removeProperty("bottom");
|
|
130
|
-
style.removeProperty("left");
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Set the position of the tooltip.
|
|
135
|
-
*/
|
|
136
|
-
setPosition() {
|
|
137
|
-
let element;
|
|
138
|
-
if (typeof this.bindTo === "string") {
|
|
139
|
-
element = this.host.ownerDocument.querySelector(this.bindTo);
|
|
140
|
-
}
|
|
141
|
-
else if (this.bindTo) {
|
|
142
|
-
element = this.bindTo;
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
element = this.host.parentElement;
|
|
146
|
-
}
|
|
147
|
-
if (!element) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const scrollContainer = findScrollableParent(element);
|
|
151
|
-
const scrollingBoundingRect = scrollContainer.getBoundingClientRect();
|
|
152
|
-
const offsetContainer = this.host.offsetParent;
|
|
153
|
-
const relativeBoundingRect = offsetContainer ? computeOffset(offsetContainer, scrollContainer) : { top: 0, right: 0, bottom: 0, left: 0 };
|
|
154
|
-
const boundingRect = computeOffset(element, scrollContainer);
|
|
155
|
-
const top = boundingRect.top - scrollContainer.scrollTop;
|
|
156
|
-
const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;
|
|
157
|
-
const left = boundingRect.left - scrollContainer.scrollLeft;
|
|
158
|
-
const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;
|
|
159
|
-
const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);
|
|
160
|
-
const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);
|
|
161
|
-
const availableTop = Math.min(top, top + scrollingBoundingRect.top);
|
|
162
|
-
const availableBottom = Math.min(bottom, bottom - overflowBottom);
|
|
163
|
-
const availableLeft = Math.min(left, left + scrollingBoundingRect.left);
|
|
164
|
-
const availableRight = Math.min(right, right - overflowRight);
|
|
165
|
-
const availableHeight = availableTop + availableBottom + boundingRect.height;
|
|
166
|
-
const availableWidth = availableLeft + availableRight + boundingRect.width;
|
|
167
|
-
let position = this.type;
|
|
168
|
-
if (position === TooltipPosition.AUTO) {
|
|
169
|
-
/**
|
|
170
|
-
* The `AUTO` position tries to place the tooltip in the "safest" area,
|
|
171
|
-
* where there's more space available.
|
|
172
|
-
*/
|
|
173
|
-
const positions = [];
|
|
174
|
-
if (availableTop / availableHeight > 0.9) {
|
|
175
|
-
positions.unshift(TooltipPosition.TOP);
|
|
176
|
-
}
|
|
177
|
-
else if (availableTop / availableHeight > 0.6) {
|
|
178
|
-
positions.push(TooltipPosition.TOP);
|
|
179
|
-
}
|
|
180
|
-
else if (availableTop / availableHeight < 0.1) {
|
|
181
|
-
positions.unshift(TooltipPosition.BOTTOM);
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
positions.push(TooltipPosition.BOTTOM);
|
|
185
|
-
}
|
|
186
|
-
if (availableLeft / availableWidth > 0.6) {
|
|
187
|
-
positions.push(TooltipPosition.LEFT);
|
|
188
|
-
}
|
|
189
|
-
else if (availableLeft / availableWidth < 0.4) {
|
|
190
|
-
positions.push(TooltipPosition.RIGHT);
|
|
191
|
-
}
|
|
192
|
-
position = positions.join("_");
|
|
193
|
-
}
|
|
194
|
-
const style = this.host.style;
|
|
195
|
-
if (!this.content) {
|
|
196
|
-
style.position = "absolute";
|
|
197
|
-
}
|
|
198
|
-
const offsetTop = boundingRect.top - relativeBoundingRect.top;
|
|
199
|
-
const offsetRight = boundingRect.right - relativeBoundingRect.right;
|
|
200
|
-
const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;
|
|
201
|
-
const offsetLeft = boundingRect.left - relativeBoundingRect.left;
|
|
202
|
-
if (position === TooltipPosition.TOP ||
|
|
203
|
-
position === TooltipPosition.TOP_RIGHT ||
|
|
204
|
-
position === TooltipPosition.TOP_LEFT) {
|
|
205
|
-
style.top = "auto";
|
|
206
|
-
style.bottom = `${offsetBottom + boundingRect.height}px`;
|
|
207
|
-
}
|
|
208
|
-
if (position === TooltipPosition.BOTTOM ||
|
|
209
|
-
position === TooltipPosition.BOTTOM_RIGHT ||
|
|
210
|
-
position === TooltipPosition.BOTTOM_LEFT) {
|
|
211
|
-
style.top = `${offsetTop + boundingRect.height}px`;
|
|
212
|
-
style.bottom = "auto";
|
|
213
|
-
}
|
|
214
|
-
if (position === TooltipPosition.TOP ||
|
|
215
|
-
position === TooltipPosition.BOTTOM) {
|
|
216
|
-
style.left = `${offsetLeft +
|
|
217
|
-
(boundingRect.width / 2) -
|
|
218
|
-
(this.host.clientWidth / 2)}px`;
|
|
219
|
-
}
|
|
220
|
-
if (position === TooltipPosition.TOP_RIGHT ||
|
|
221
|
-
position === TooltipPosition.BOTTOM_RIGHT) {
|
|
222
|
-
style.right = "auto";
|
|
223
|
-
style.left = `${offsetLeft + boundingRect.width}px`;
|
|
224
|
-
}
|
|
225
|
-
if (position === TooltipPosition.TOP_LEFT ||
|
|
226
|
-
position === TooltipPosition.BOTTOM_LEFT) {
|
|
227
|
-
style.left = "auto";
|
|
228
|
-
style.right = `${offsetRight + boundingRect.width}px`;
|
|
229
|
-
}
|
|
230
|
-
if (position === TooltipPosition.RIGHT ||
|
|
231
|
-
position === TooltipPosition.LEFT) {
|
|
232
|
-
style.top = `${offsetTop +
|
|
233
|
-
(boundingRect.height / 2) -
|
|
234
|
-
(this.host.clientHeight / 2)}px`;
|
|
235
|
-
style.bottom = "auto";
|
|
236
|
-
}
|
|
237
|
-
if (position === TooltipPosition.RIGHT) {
|
|
238
|
-
style.right = "auto";
|
|
239
|
-
style.left = `${offsetLeft + boundingRect.width}px`;
|
|
240
|
-
}
|
|
241
|
-
if (position === TooltipPosition.LEFT) {
|
|
242
|
-
style.left = "auto";
|
|
243
|
-
style.right = `${offsetRight + boundingRect.width}px`;
|
|
244
|
-
}
|
|
245
|
-
this.position = position;
|
|
246
|
-
}
|
|
247
|
-
componentWillLoad() {
|
|
248
|
-
// Keep backward compatibility
|
|
249
|
-
if (this.content) {
|
|
250
|
-
this.open = true;
|
|
251
|
-
}
|
|
252
|
-
this.validateType(this.type);
|
|
253
|
-
this.onOpen();
|
|
18
|
+
onPopoverOpenChange() {
|
|
19
|
+
this.open = this.popover.open;
|
|
254
20
|
}
|
|
255
21
|
render() {
|
|
256
|
-
|
|
257
|
-
return (h(Host, { class: "legacy", position: this.type }, this.content));
|
|
258
|
-
}
|
|
259
|
-
return (h(Host, { position: this.position }, h("slot", null)));
|
|
22
|
+
return h("z-popover", { ref: (el) => (this.popover = el), bindTo: this.bindTo, open: this.open, position: this.position, center: true, showArrow: true }, h("slot", null));
|
|
260
23
|
}
|
|
261
|
-
get host() { return getElement(this); }
|
|
262
|
-
static get watchers() { return {
|
|
263
|
-
"type": ["validateType"],
|
|
264
|
-
"position": ["onPositionChange"],
|
|
265
|
-
"open": ["onOpen"]
|
|
266
|
-
}; }
|
|
267
24
|
};
|
|
268
25
|
ZTooltip.style = stylesCss;
|
|
269
26
|
|
|
@@ -138,8 +138,8 @@ export declare enum InputStatusEnum {
|
|
|
138
138
|
error = "error",
|
|
139
139
|
warning = "warning"
|
|
140
140
|
}
|
|
141
|
-
export declare type
|
|
142
|
-
export declare enum
|
|
141
|
+
export declare type PopoverPositionBean = keyof typeof PopoverPositions;
|
|
142
|
+
export declare enum PopoverPositions {
|
|
143
143
|
AUTO = "auto",
|
|
144
144
|
TOP = "top",
|
|
145
145
|
RIGHT = "right",
|
|
@@ -148,7 +148,11 @@ export declare enum TooltipPosition {
|
|
|
148
148
|
TOP_RIGHT = "top_right",
|
|
149
149
|
TOP_LEFT = "top_left",
|
|
150
150
|
BOTTOM_RIGHT = "bottom_right",
|
|
151
|
-
BOTTOM_LEFT = "bottom_left"
|
|
151
|
+
BOTTOM_LEFT = "bottom_left",
|
|
152
|
+
RIGHT_TOP = "right_top",
|
|
153
|
+
RIGHT_BOTTOM = "right_bottom",
|
|
154
|
+
LEFT_TOP = "left_top",
|
|
155
|
+
LEFT_BOTTOM = "left_bottom"
|
|
152
156
|
}
|
|
153
157
|
export declare enum KeyboardKeyCodeEnum {
|
|
154
158
|
TAB = 9,
|
|
@@ -188,36 +192,6 @@ export declare enum ThemeVariant {
|
|
|
188
192
|
dark = "dark",
|
|
189
193
|
light = "light"
|
|
190
194
|
}
|
|
191
|
-
export declare enum PopoverPosition {
|
|
192
|
-
"after-down" = "after-down",
|
|
193
|
-
"after-center" = "after-center",
|
|
194
|
-
"after-up" = "after-up",
|
|
195
|
-
"below-right" = "below-right",
|
|
196
|
-
"below-center" = "below-center",
|
|
197
|
-
"below-left" = "below-left",
|
|
198
|
-
"before-down" = "before-down",
|
|
199
|
-
"before-center" = "before-center",
|
|
200
|
-
"before-up" = "before-up",
|
|
201
|
-
"above-right" = "above-right",
|
|
202
|
-
"above-center" = "above-center",
|
|
203
|
-
"above-left" = "above-left"
|
|
204
|
-
}
|
|
205
|
-
export declare enum PopoverBorderRadius {
|
|
206
|
-
"none" = "none",
|
|
207
|
-
small = "small",
|
|
208
|
-
medium = "medium"
|
|
209
|
-
}
|
|
210
|
-
export declare enum PopoverShadow {
|
|
211
|
-
"shadow-1" = "shadow-1",
|
|
212
|
-
"shadow-2" = "shadow-2",
|
|
213
|
-
"shadow-3" = "shadow-3",
|
|
214
|
-
"shadow-4" = "shadow-4",
|
|
215
|
-
"shadow-6" = "shadow-6",
|
|
216
|
-
"shadow-8" = "shadow-8",
|
|
217
|
-
"shadow-12" = "shadow-12",
|
|
218
|
-
"shadow-16" = "shadow-16",
|
|
219
|
-
"shadow-24" = "shadow-24"
|
|
220
|
-
}
|
|
221
195
|
export declare enum DividerSize {
|
|
222
196
|
small = "small",
|
|
223
197
|
medium = "medium",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EventEmitter } from "
|
|
2
|
-
import { ZDatePickerMode, ZDatePickerPosition } from "
|
|
1
|
+
import { EventEmitter } from "../../../stencil-public-runtime";
|
|
2
|
+
import { ZDatePickerMode, ZDatePickerPosition } from "../../../beans";
|
|
3
3
|
export declare class ZDatePicker {
|
|
4
4
|
element: HTMLElement;
|
|
5
5
|
/** unique id */
|
|
6
|
-
|
|
6
|
+
datePickerId: string;
|
|
7
7
|
/** z-input aria label */
|
|
8
8
|
ariaLabel?: string;
|
|
9
9
|
/** z-input label */
|
|
@@ -19,11 +19,6 @@ export declare class ZDatePicker {
|
|
|
19
19
|
handleKeyDown(ev: KeyboardEvent): void;
|
|
20
20
|
componentWillLoad(): void;
|
|
21
21
|
componentDidLoad(): void;
|
|
22
|
-
setAriaOptions(): void;
|
|
23
|
-
setMonthsAriaOptions(calendar: any, prevMonthArrow: any, nextMonthArrow: any): void;
|
|
24
|
-
setDateAriaOptions(calendar: any, prevMonthArrow: any, nextMonthArrow: any): void;
|
|
25
|
-
setDateTimeAriaOptions(calendar: any, prevMonthArrow: any, nextMonthArrow: any): void;
|
|
26
|
-
setFlatpickrPosition(): void;
|
|
27
22
|
renderSlottedContent(): any;
|
|
28
23
|
renderZInput(): any;
|
|
29
24
|
render(): any;
|