@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
|
@@ -1,258 +1,30 @@
|
|
|
1
|
-
import { Component, Prop, h,
|
|
2
|
-
import {
|
|
3
|
-
const documentElement = document.documentElement;
|
|
1
|
+
import { Component, Prop, h, Listen, } from "@stencil/core";
|
|
2
|
+
import { PopoverPositions } from "../../../beans";
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Tooltip component.
|
|
5
|
+
* It is basically a wrapper for the `<z-popover>` component with custom configuration.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @cssprop --z-popover-theme--surface - background color of the popover.
|
|
8
|
+
* @cssprop --z-popover-theme--text - foreground color of the popover.
|
|
9
|
+
* @cssprop --z-popover-shadow-filter - drop-shadow filter of the popover.
|
|
8
10
|
*/
|
|
9
|
-
function findScrollableParent(element) {
|
|
10
|
-
let parent = element.parentNode;
|
|
11
|
-
while (parent && parent !== documentElement) {
|
|
12
|
-
const { overflow, overflowX, overflowY } = window.getComputedStyle(parent);
|
|
13
|
-
if (overflow === 'hidden' ||
|
|
14
|
-
overflowY === 'hidden' ||
|
|
15
|
-
overflowX === 'hidden') {
|
|
16
|
-
return parent;
|
|
17
|
-
}
|
|
18
|
-
if ((parent.scrollHeight > parent.clientHeight && overflow !== 'visible' && overflowY !== 'visible') ||
|
|
19
|
-
(parent.scrollWidth > parent.clientWidth && overflow !== 'visible' && overflowX !== 'visible')) {
|
|
20
|
-
return parent;
|
|
21
|
-
}
|
|
22
|
-
parent = parent.parentNode;
|
|
23
|
-
}
|
|
24
|
-
return documentElement;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Calculate computed offset.
|
|
28
|
-
* It includes matrix transformations.
|
|
29
|
-
* @param element The target element.
|
|
30
|
-
* @param targetParentOffset The relative offset parent.
|
|
31
|
-
* @return A client rect object.
|
|
32
|
-
*/
|
|
33
|
-
function computeOffset(element, targetParentOffset) {
|
|
34
|
-
const rect = element.getBoundingClientRect();
|
|
35
|
-
const width = rect.width;
|
|
36
|
-
const height = rect.height;
|
|
37
|
-
let top = 0;
|
|
38
|
-
let left = 0;
|
|
39
|
-
let offsetParent = element;
|
|
40
|
-
while (offsetParent && offsetParent != targetParentOffset) {
|
|
41
|
-
left += offsetParent.offsetLeft;
|
|
42
|
-
// document.body sometimes has offsetTop == 0 but still has an
|
|
43
|
-
// offset because of children margins!
|
|
44
|
-
if (offsetParent === document.body) {
|
|
45
|
-
top += offsetParent.getBoundingClientRect().top + window.scrollY;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
top += offsetParent.offsetTop;
|
|
49
|
-
}
|
|
50
|
-
if (window.DOMMatrix) {
|
|
51
|
-
const style = window.getComputedStyle(offsetParent);
|
|
52
|
-
const transform = style.transform || style.webkitTransform;
|
|
53
|
-
const domMatrix = new DOMMatrix(transform);
|
|
54
|
-
if (domMatrix) {
|
|
55
|
-
left += domMatrix.m41;
|
|
56
|
-
if (offsetParent !== document.body) {
|
|
57
|
-
top += domMatrix.m42;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (!offsetParent.offsetParent) {
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
offsetParent = offsetParent.offsetParent;
|
|
65
|
-
}
|
|
66
|
-
let parentWidth;
|
|
67
|
-
let parentHeight;
|
|
68
|
-
if (offsetParent === document.body) {
|
|
69
|
-
parentWidth = window.innerWidth;
|
|
70
|
-
parentHeight = window.innerHeight;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
parentWidth = offsetParent.offsetWidth;
|
|
74
|
-
parentHeight = offsetParent.offsetHeight;
|
|
75
|
-
}
|
|
76
|
-
const right = parentWidth - left - rect.width;
|
|
77
|
-
const bottom = parentHeight - top - rect.height;
|
|
78
|
-
return { top, right, bottom, left, width, height };
|
|
79
|
-
}
|
|
80
11
|
export class ZTooltip {
|
|
81
12
|
constructor() {
|
|
82
13
|
/** Tooltip position. */
|
|
83
|
-
this.
|
|
14
|
+
this.position = PopoverPositions.AUTO;
|
|
15
|
+
/** Enable tooltip dark mode. */
|
|
16
|
+
this.dark = false;
|
|
84
17
|
/**
|
|
85
18
|
* The open state of the tooltip.
|
|
86
19
|
*/
|
|
87
20
|
this.open = false;
|
|
88
21
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Object
|
|
92
|
-
.values(TooltipPosition)
|
|
93
|
-
.every((position) => newValue !== position)) {
|
|
94
|
-
this.type = TooltipPosition.AUTO;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
onPositionChange() {
|
|
98
|
-
this.positionChange.emit({ position: this.position });
|
|
99
|
-
}
|
|
100
|
-
disconnectedCallback() {
|
|
101
|
-
cancelAnimationFrame(this.animationFrameRequestId);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Setup tooltip behaviors on opening.
|
|
105
|
-
*/
|
|
106
|
-
onOpen() {
|
|
107
|
-
cancelAnimationFrame(this.animationFrameRequestId);
|
|
108
|
-
if (this.content) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (this.open) {
|
|
112
|
-
const setPosition = () => {
|
|
113
|
-
if (this.open) {
|
|
114
|
-
this.setPosition();
|
|
115
|
-
this.animationFrameRequestId = requestAnimationFrame(setPosition);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
setPosition();
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
const style = this.host.style;
|
|
122
|
-
style.removeProperty("top");
|
|
123
|
-
style.removeProperty("right");
|
|
124
|
-
style.removeProperty("bottom");
|
|
125
|
-
style.removeProperty("left");
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Set the position of the tooltip.
|
|
130
|
-
*/
|
|
131
|
-
setPosition() {
|
|
132
|
-
let element;
|
|
133
|
-
if (typeof this.bindTo === "string") {
|
|
134
|
-
element = this.host.ownerDocument.querySelector(this.bindTo);
|
|
135
|
-
}
|
|
136
|
-
else if (this.bindTo) {
|
|
137
|
-
element = this.bindTo;
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
element = this.host.parentElement;
|
|
141
|
-
}
|
|
142
|
-
if (!element) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const scrollContainer = findScrollableParent(element);
|
|
146
|
-
const scrollingBoundingRect = scrollContainer.getBoundingClientRect();
|
|
147
|
-
const offsetContainer = this.host.offsetParent;
|
|
148
|
-
const relativeBoundingRect = offsetContainer ? computeOffset(offsetContainer, scrollContainer) : { top: 0, right: 0, bottom: 0, left: 0 };
|
|
149
|
-
const boundingRect = computeOffset(element, scrollContainer);
|
|
150
|
-
const top = boundingRect.top - scrollContainer.scrollTop;
|
|
151
|
-
const bottom = scrollingBoundingRect.height - (boundingRect.top + boundingRect.height) + scrollContainer.scrollTop;
|
|
152
|
-
const left = boundingRect.left - scrollContainer.scrollLeft;
|
|
153
|
-
const right = scrollingBoundingRect.width - (boundingRect.left + boundingRect.width) + scrollContainer.scrollLeft;
|
|
154
|
-
const overflowBottom = Math.max(0, scrollingBoundingRect.top + scrollingBoundingRect.height - window.innerHeight);
|
|
155
|
-
const overflowRight = Math.max(0, scrollingBoundingRect.left + scrollingBoundingRect.width - window.innerWidth);
|
|
156
|
-
const availableTop = Math.min(top, top + scrollingBoundingRect.top);
|
|
157
|
-
const availableBottom = Math.min(bottom, bottom - overflowBottom);
|
|
158
|
-
const availableLeft = Math.min(left, left + scrollingBoundingRect.left);
|
|
159
|
-
const availableRight = Math.min(right, right - overflowRight);
|
|
160
|
-
const availableHeight = availableTop + availableBottom + boundingRect.height;
|
|
161
|
-
const availableWidth = availableLeft + availableRight + boundingRect.width;
|
|
162
|
-
let position = this.type;
|
|
163
|
-
if (position === TooltipPosition.AUTO) {
|
|
164
|
-
/**
|
|
165
|
-
* The `AUTO` position tries to place the tooltip in the "safest" area,
|
|
166
|
-
* where there's more space available.
|
|
167
|
-
*/
|
|
168
|
-
const positions = [];
|
|
169
|
-
if (availableTop / availableHeight > 0.9) {
|
|
170
|
-
positions.unshift(TooltipPosition.TOP);
|
|
171
|
-
}
|
|
172
|
-
else if (availableTop / availableHeight > 0.6) {
|
|
173
|
-
positions.push(TooltipPosition.TOP);
|
|
174
|
-
}
|
|
175
|
-
else if (availableTop / availableHeight < 0.1) {
|
|
176
|
-
positions.unshift(TooltipPosition.BOTTOM);
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
positions.push(TooltipPosition.BOTTOM);
|
|
180
|
-
}
|
|
181
|
-
if (availableLeft / availableWidth > 0.6) {
|
|
182
|
-
positions.push(TooltipPosition.LEFT);
|
|
183
|
-
}
|
|
184
|
-
else if (availableLeft / availableWidth < 0.4) {
|
|
185
|
-
positions.push(TooltipPosition.RIGHT);
|
|
186
|
-
}
|
|
187
|
-
position = positions.join("_");
|
|
188
|
-
}
|
|
189
|
-
const style = this.host.style;
|
|
190
|
-
if (!this.content) {
|
|
191
|
-
style.position = "absolute";
|
|
192
|
-
}
|
|
193
|
-
const offsetTop = boundingRect.top - relativeBoundingRect.top;
|
|
194
|
-
const offsetRight = boundingRect.right - relativeBoundingRect.right;
|
|
195
|
-
const offsetBottom = boundingRect.bottom - relativeBoundingRect.bottom;
|
|
196
|
-
const offsetLeft = boundingRect.left - relativeBoundingRect.left;
|
|
197
|
-
if (position === TooltipPosition.TOP ||
|
|
198
|
-
position === TooltipPosition.TOP_RIGHT ||
|
|
199
|
-
position === TooltipPosition.TOP_LEFT) {
|
|
200
|
-
style.top = "auto";
|
|
201
|
-
style.bottom = `${offsetBottom + boundingRect.height}px`;
|
|
202
|
-
}
|
|
203
|
-
if (position === TooltipPosition.BOTTOM ||
|
|
204
|
-
position === TooltipPosition.BOTTOM_RIGHT ||
|
|
205
|
-
position === TooltipPosition.BOTTOM_LEFT) {
|
|
206
|
-
style.top = `${offsetTop + boundingRect.height}px`;
|
|
207
|
-
style.bottom = "auto";
|
|
208
|
-
}
|
|
209
|
-
if (position === TooltipPosition.TOP ||
|
|
210
|
-
position === TooltipPosition.BOTTOM) {
|
|
211
|
-
style.left = `${offsetLeft +
|
|
212
|
-
(boundingRect.width / 2) -
|
|
213
|
-
(this.host.clientWidth / 2)}px`;
|
|
214
|
-
}
|
|
215
|
-
if (position === TooltipPosition.TOP_RIGHT ||
|
|
216
|
-
position === TooltipPosition.BOTTOM_RIGHT) {
|
|
217
|
-
style.right = "auto";
|
|
218
|
-
style.left = `${offsetLeft + boundingRect.width}px`;
|
|
219
|
-
}
|
|
220
|
-
if (position === TooltipPosition.TOP_LEFT ||
|
|
221
|
-
position === TooltipPosition.BOTTOM_LEFT) {
|
|
222
|
-
style.left = "auto";
|
|
223
|
-
style.right = `${offsetRight + boundingRect.width}px`;
|
|
224
|
-
}
|
|
225
|
-
if (position === TooltipPosition.RIGHT ||
|
|
226
|
-
position === TooltipPosition.LEFT) {
|
|
227
|
-
style.top = `${offsetTop +
|
|
228
|
-
(boundingRect.height / 2) -
|
|
229
|
-
(this.host.clientHeight / 2)}px`;
|
|
230
|
-
style.bottom = "auto";
|
|
231
|
-
}
|
|
232
|
-
if (position === TooltipPosition.RIGHT) {
|
|
233
|
-
style.right = "auto";
|
|
234
|
-
style.left = `${offsetLeft + boundingRect.width}px`;
|
|
235
|
-
}
|
|
236
|
-
if (position === TooltipPosition.LEFT) {
|
|
237
|
-
style.left = "auto";
|
|
238
|
-
style.right = `${offsetRight + boundingRect.width}px`;
|
|
239
|
-
}
|
|
240
|
-
this.position = position;
|
|
241
|
-
}
|
|
242
|
-
componentWillLoad() {
|
|
243
|
-
// Keep backward compatibility
|
|
244
|
-
if (this.content) {
|
|
245
|
-
this.open = true;
|
|
246
|
-
}
|
|
247
|
-
this.validateType(this.type);
|
|
248
|
-
this.onOpen();
|
|
22
|
+
onPopoverOpenChange() {
|
|
23
|
+
this.open = this.popover.open;
|
|
249
24
|
}
|
|
250
25
|
render() {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
return (h(Host, { position: this.position },
|
|
255
|
-
h("slot", null)));
|
|
26
|
+
return h("z-popover", { ref: (el) => (this.popover = el), bindTo: this.bindTo, open: this.open, position: this.position, center: true, showArrow: true },
|
|
27
|
+
h("slot", null));
|
|
256
28
|
}
|
|
257
29
|
static get is() { return "z-tooltip"; }
|
|
258
30
|
static get encapsulation() { return "shadow"; }
|
|
@@ -263,48 +35,46 @@ export class ZTooltip {
|
|
|
263
35
|
"$": ["styles.css"]
|
|
264
36
|
}; }
|
|
265
37
|
static get properties() { return {
|
|
266
|
-
"
|
|
38
|
+
"position": {
|
|
267
39
|
"type": "string",
|
|
268
|
-
"mutable":
|
|
40
|
+
"mutable": true,
|
|
269
41
|
"complexType": {
|
|
270
|
-
"original": "
|
|
271
|
-
"resolved": "
|
|
272
|
-
"references": {
|
|
42
|
+
"original": "PopoverPositions",
|
|
43
|
+
"resolved": "PopoverPositions.AUTO | PopoverPositions.BOTTOM | PopoverPositions.BOTTOM_LEFT | PopoverPositions.BOTTOM_RIGHT | PopoverPositions.LEFT | PopoverPositions.LEFT_BOTTOM | PopoverPositions.LEFT_TOP | PopoverPositions.RIGHT | PopoverPositions.RIGHT_BOTTOM | PopoverPositions.RIGHT_TOP | PopoverPositions.TOP | PopoverPositions.TOP_LEFT | PopoverPositions.TOP_RIGHT",
|
|
44
|
+
"references": {
|
|
45
|
+
"PopoverPositions": {
|
|
46
|
+
"location": "import",
|
|
47
|
+
"path": "../../../beans"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
273
50
|
},
|
|
274
51
|
"required": false,
|
|
275
52
|
"optional": false,
|
|
276
53
|
"docs": {
|
|
277
|
-
"tags": [
|
|
278
|
-
|
|
279
|
-
"text": undefined
|
|
280
|
-
}],
|
|
281
|
-
"text": "Content text."
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": "Tooltip position."
|
|
282
56
|
},
|
|
283
|
-
"attribute": "
|
|
284
|
-
"reflect":
|
|
57
|
+
"attribute": "position",
|
|
58
|
+
"reflect": true,
|
|
59
|
+
"defaultValue": "PopoverPositions.AUTO"
|
|
285
60
|
},
|
|
286
|
-
"
|
|
287
|
-
"type": "
|
|
288
|
-
"mutable":
|
|
61
|
+
"dark": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"mutable": false,
|
|
289
64
|
"complexType": {
|
|
290
|
-
"original": "
|
|
291
|
-
"resolved": "
|
|
292
|
-
"references": {
|
|
293
|
-
"TooltipPosition": {
|
|
294
|
-
"location": "import",
|
|
295
|
-
"path": "../../../beans/index"
|
|
296
|
-
}
|
|
297
|
-
}
|
|
65
|
+
"original": "boolean",
|
|
66
|
+
"resolved": "boolean",
|
|
67
|
+
"references": {}
|
|
298
68
|
},
|
|
299
69
|
"required": false,
|
|
300
70
|
"optional": false,
|
|
301
71
|
"docs": {
|
|
302
72
|
"tags": [],
|
|
303
|
-
"text": "
|
|
73
|
+
"text": "Enable tooltip dark mode."
|
|
304
74
|
},
|
|
305
|
-
"attribute": "
|
|
306
|
-
"reflect":
|
|
307
|
-
"defaultValue": "
|
|
75
|
+
"attribute": "dark",
|
|
76
|
+
"reflect": true,
|
|
77
|
+
"defaultValue": "false"
|
|
308
78
|
},
|
|
309
79
|
"open": {
|
|
310
80
|
"type": "boolean",
|
|
@@ -346,34 +116,11 @@ export class ZTooltip {
|
|
|
346
116
|
"reflect": false
|
|
347
117
|
}
|
|
348
118
|
}; }
|
|
349
|
-
static get
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
"
|
|
354
|
-
"
|
|
355
|
-
"bubbles": true,
|
|
356
|
-
"cancelable": true,
|
|
357
|
-
"composed": true,
|
|
358
|
-
"docs": {
|
|
359
|
-
"tags": [],
|
|
360
|
-
"text": "Position change event."
|
|
361
|
-
},
|
|
362
|
-
"complexType": {
|
|
363
|
-
"original": "any",
|
|
364
|
-
"resolved": "any",
|
|
365
|
-
"references": {}
|
|
366
|
-
}
|
|
367
|
-
}]; }
|
|
368
|
-
static get elementRef() { return "host"; }
|
|
369
|
-
static get watchers() { return [{
|
|
370
|
-
"propName": "type",
|
|
371
|
-
"methodName": "validateType"
|
|
372
|
-
}, {
|
|
373
|
-
"propName": "position",
|
|
374
|
-
"methodName": "onPositionChange"
|
|
375
|
-
}, {
|
|
376
|
-
"propName": "open",
|
|
377
|
-
"methodName": "onOpen"
|
|
119
|
+
static get listeners() { return [{
|
|
120
|
+
"name": "openChange",
|
|
121
|
+
"method": "onPopoverOpenChange",
|
|
122
|
+
"target": undefined,
|
|
123
|
+
"capture": false,
|
|
124
|
+
"passive": false
|
|
378
125
|
}]; }
|
|
379
126
|
}
|
|
@@ -1,128 +1,16 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
--z-tooltip-theme--surface: var(--color-surface01);
|
|
3
3
|
--z-tooltip-theme--text: var(--color-text01);
|
|
4
|
-
--
|
|
5
|
-
--edge-offset: calc(-1 * (var(--arrow-size) + calc(var(--space-unit) * 2)));
|
|
6
|
-
|
|
7
|
-
position: relative;
|
|
8
|
-
display: none;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
padding: var(--space-unit);
|
|
12
|
-
min-width: calc(var(--space-unit) * 8);
|
|
13
|
-
min-height: calc(var(--space-unit) * 4);
|
|
14
|
-
color: var(--z-tooltip-theme--text);
|
|
15
|
-
fill: currentColor;
|
|
16
|
-
font-family: var(--font-family-sans);
|
|
17
|
-
text-align: center;
|
|
18
|
-
border-radius: var(--border-radius-small);
|
|
19
|
-
background: var(--z-tooltip-theme--surface);
|
|
20
|
-
filter: drop-shadow(0 4px 8px var(--shadow-color-base));
|
|
21
|
-
will-change: filter;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:host(.legacy) {
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
padding: calc(var(--space-unit) * 2);
|
|
27
|
-
min-width: auto;
|
|
28
|
-
min-height: auto;
|
|
29
|
-
max-width: 200px;
|
|
30
|
-
font-style: italic;
|
|
31
|
-
line-height: 16px;
|
|
32
|
-
letter-spacing: 0.32px;
|
|
33
|
-
font-size: 12px;
|
|
34
|
-
border: var(--border-size-small) solid var(--gray200);
|
|
35
|
-
border-radius: var(--border-radius);
|
|
36
|
-
filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.08));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:host(.legacy)::before {
|
|
40
|
-
--arrow-size: 14px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host([position])::before {
|
|
44
|
-
--arrow-edge-offset: calc(100% - var(--arrow-size) - var(--space-unit));
|
|
45
|
-
--arrow-center-x-offset: calc(50% - calc(var(--arrow-size) / 2));
|
|
46
|
-
--arrow-center-y-offset: calc(100% - calc(var(--arrow-size) / 2));
|
|
47
|
-
|
|
48
|
-
content: '';
|
|
49
|
-
position: absolute;
|
|
50
|
-
width: var(--arrow-size);
|
|
51
|
-
height: var(--arrow-size);
|
|
52
|
-
background: inherit;
|
|
53
|
-
transform: rotate(45deg);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
:host([open][style*='top:']),
|
|
57
|
-
:host([open][style*='inset:']) {
|
|
58
|
-
display: inline-flex;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
:host([position^='top']) {
|
|
62
|
-
margin-bottom: var(--space-unit);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:host([position='right']) {
|
|
66
|
-
margin-left: var(--space-unit);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
:host([position='top_right']),
|
|
70
|
-
:host([position='bottom_right']) {
|
|
71
|
-
margin-left: var(--edge-offset);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
:host([position^='bottom']) {
|
|
75
|
-
margin-top: var(--space-unit);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
:host([position='left']) {
|
|
79
|
-
margin-right: var(--space-unit);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
:host([position='top_left']),
|
|
83
|
-
:host([position='bottom_left']) {
|
|
84
|
-
margin-right: var(--edge-offset);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* Arrow style */
|
|
88
|
-
|
|
89
|
-
:host([position^='top'])::before {
|
|
90
|
-
top: var(--arrow-center-y-offset);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
:host([position^='bottom'])::before {
|
|
94
|
-
bottom: var(--arrow-center-y-offset);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:host([position='top'])::before,
|
|
98
|
-
:host([position='bottom'])::before {
|
|
99
|
-
left: var(--arrow-center-x-offset);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
:host([position='right'])::before,
|
|
103
|
-
:host([position='left'])::before {
|
|
104
|
-
top: var(--arrow-center-x-offset);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
:host([position='right'])::before {
|
|
108
|
-
right: var(--arrow-center-y-offset);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
:host([position='top_right'])::before,
|
|
112
|
-
:host([position='bottom_right'])::before {
|
|
113
|
-
right: var(--arrow-edge-offset);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
:host([position='left'])::before {
|
|
117
|
-
left: var(--arrow-center-y-offset);
|
|
4
|
+
--z-tooltip-shadow-filter: drop-shadow(0 1px 2px var(--shadow-color-base));
|
|
118
5
|
}
|
|
119
6
|
|
|
120
|
-
:host([
|
|
121
|
-
:
|
|
122
|
-
left: var(--arrow-edge-offset);
|
|
7
|
+
:host([dark]) z-popover {
|
|
8
|
+
--z-popover-theme--surface: var(--color-surface05);
|
|
123
9
|
}
|
|
124
10
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
11
|
+
z-popover {
|
|
12
|
+
--z-popover-padding: var(--space-unit);
|
|
13
|
+
--z-popover-theme--surface: var(--z-tooltip-theme--surface);
|
|
14
|
+
--z-popover-theme--text: var(--z-tooltip-theme--text);
|
|
15
|
+
--z-popover-shadow-filter: var(--z-tooltip-shadow-filter);
|
|
128
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Component, Event,
|
|
2
|
-
import {
|
|
1
|
+
import { Component, Event, Prop, h, } from "@stencil/core";
|
|
2
|
+
import { PopoverPositions } from "../../beans";
|
|
3
3
|
export class ZContextualMenu {
|
|
4
4
|
constructor() {
|
|
5
5
|
/**
|
|
@@ -9,31 +9,41 @@ export class ZContextualMenu {
|
|
|
9
9
|
/**
|
|
10
10
|
* [optional] Sets the position of the popover
|
|
11
11
|
*/
|
|
12
|
-
this.popoverPosition =
|
|
12
|
+
this.popoverPosition = PopoverPositions.BOTTOM_RIGHT;
|
|
13
13
|
}
|
|
14
14
|
componentWillRender() {
|
|
15
15
|
if (this.elements) {
|
|
16
16
|
this.jsonElements = JSON.parse(this.elements.replace(/"/g, '"'));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
componentDidLoad() {
|
|
20
|
+
this.popover.bindTo = this.triggerButton;
|
|
21
|
+
}
|
|
19
22
|
showIcon() {
|
|
20
23
|
return !this.jsonElements.some((element) => !element.icon);
|
|
21
24
|
}
|
|
25
|
+
togglePopover() {
|
|
26
|
+
if (!this.popover.open) {
|
|
27
|
+
this.popover.open = true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
22
30
|
render() {
|
|
23
|
-
var _a;
|
|
24
|
-
return
|
|
25
|
-
h("
|
|
26
|
-
h("z-icon", {
|
|
27
|
-
|
|
31
|
+
var _a, _b;
|
|
32
|
+
return [
|
|
33
|
+
h("button", { ref: (el) => (this.triggerButton = el), "aria-label": ((_a = this.popover) === null || _a === void 0 ? void 0 : _a.open) ? "chiudi menu contestuale" : "apri menu contestuale", onClick: () => this.togglePopover() },
|
|
34
|
+
h("z-icon", { name: "contextual-menu", fill: this.color })),
|
|
35
|
+
h("z-popover", { ref: (el) => (this.popover = el), position: this.popoverPosition },
|
|
36
|
+
h("div", { class: "popover-content-container" },
|
|
28
37
|
h("z-list", null,
|
|
29
|
-
h("z-list-group", { "divider-type": "element" }, (
|
|
38
|
+
h("z-list-group", { "divider-type": "element" }, (_b = this.jsonElements) === null || _b === void 0 ? void 0 : _b.map((element, index) => (h("z-list-element", { clickable: !element.disabled, class: "my-z-list-element", "align-button": "left", "expandable-style": "accordion", color: element.disabled ? `color-disabled03` : this.color, isContextualMenu: true, listElementId: index, onClickItem: (event) => this.clickContextualMenu.emit(event.detail) },
|
|
30
39
|
h("div", { class: element.disabled
|
|
31
40
|
? "disabled-element-container"
|
|
32
41
|
: "element-container" },
|
|
33
42
|
this.showIcon() && (h("div", { class: "element-icon" },
|
|
34
43
|
h("z-icon", { name: element.icon, width: 16, height: 16 }))),
|
|
35
44
|
h("div", { class: "element-text" },
|
|
36
|
-
h("span", null, element.text))))))))))
|
|
45
|
+
h("span", null, element.text))))))))))
|
|
46
|
+
];
|
|
37
47
|
}
|
|
38
48
|
static get is() { return "z-contextual-menu"; }
|
|
39
49
|
static get encapsulation() { return "shadow"; }
|
|
@@ -56,7 +66,7 @@ export class ZContextualMenu {
|
|
|
56
66
|
"optional": true,
|
|
57
67
|
"docs": {
|
|
58
68
|
"tags": [],
|
|
59
|
-
"text": "
|
|
69
|
+
"text": "Elements of ZContextualMenu"
|
|
60
70
|
},
|
|
61
71
|
"attribute": "elements",
|
|
62
72
|
"reflect": false
|
|
@@ -83,10 +93,10 @@ export class ZContextualMenu {
|
|
|
83
93
|
"type": "string",
|
|
84
94
|
"mutable": false,
|
|
85
95
|
"complexType": {
|
|
86
|
-
"original": "
|
|
87
|
-
"resolved": "
|
|
96
|
+
"original": "PopoverPositions",
|
|
97
|
+
"resolved": "PopoverPositions.AUTO | PopoverPositions.BOTTOM | PopoverPositions.BOTTOM_LEFT | PopoverPositions.BOTTOM_RIGHT | PopoverPositions.LEFT | PopoverPositions.LEFT_BOTTOM | PopoverPositions.LEFT_TOP | PopoverPositions.RIGHT | PopoverPositions.RIGHT_BOTTOM | PopoverPositions.RIGHT_TOP | PopoverPositions.TOP | PopoverPositions.TOP_LEFT | PopoverPositions.TOP_RIGHT",
|
|
88
98
|
"references": {
|
|
89
|
-
"
|
|
99
|
+
"PopoverPositions": {
|
|
90
100
|
"location": "import",
|
|
91
101
|
"path": "../../beans"
|
|
92
102
|
}
|
|
@@ -99,8 +109,8 @@ export class ZContextualMenu {
|
|
|
99
109
|
"text": "[optional] Sets the position of the popover"
|
|
100
110
|
},
|
|
101
111
|
"attribute": "popover-position",
|
|
102
|
-
"reflect":
|
|
103
|
-
"defaultValue": "
|
|
112
|
+
"reflect": true,
|
|
113
|
+
"defaultValue": "PopoverPositions.BOTTOM_RIGHT"
|
|
104
114
|
}
|
|
105
115
|
}; }
|
|
106
116
|
static get events() { return [{
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
2
4
|
font-family: var(--font-family-sans);
|
|
3
5
|
font-weight: var(--font-rg);
|
|
4
6
|
}
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
button {
|
|
9
|
+
border: none;
|
|
10
|
+
background: transparent;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
padding: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
z-popover {
|
|
16
|
+
overflow: hidden;
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
.popover-content-container {
|
|
20
|
+
position: relative;
|
|
11
21
|
min-width: 112px;
|
|
12
22
|
max-width: 280px;
|
|
13
23
|
white-space: nowrap;
|
|
14
|
-
|
|
24
|
+
background-color: var(--color-surface02);
|
|
25
|
+
box-shadow: var(--shadow-2);
|
|
15
26
|
}
|
|
16
27
|
|
|
17
28
|
.element-container:hover {
|
|
18
|
-
color: var(--
|
|
19
|
-
fill: var(--
|
|
29
|
+
color: var(--color-hover-primary);
|
|
30
|
+
fill: var(--color-hover-primary);
|
|
20
31
|
}
|
|
21
32
|
|
|
22
33
|
.element-text {
|