@zanichelli/delta_share 3.1.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wc/cjs/{breakpoints-a55736d0.js → breakpoints-e7c8838e.js} +3 -1
- package/dist/wc/cjs/delta_share.cjs.js +2 -2
- package/dist/wc/cjs/{icons-9d7fe21e.js → icons-6d7ce4fc.js} +111 -0
- package/dist/wc/cjs/{index-1112cdb1.js → index-029f1a7e.js} +43 -10
- package/dist/wc/cjs/index-0c6fe5a8.js +34 -0
- package/dist/wc/cjs/index-1a5d1f46.js +67 -0
- package/dist/wc/cjs/index-2bd3ba9a.js +74 -0
- package/dist/wc/cjs/index-2cac2542.js +79 -0
- package/dist/wc/cjs/index-32a6c022.js +21 -0
- package/dist/wc/cjs/index-42c0b32c.js +20 -0
- package/dist/wc/cjs/index-5da586ad.js +41 -0
- package/dist/wc/cjs/index-6d707e7c.js +21 -0
- package/dist/wc/cjs/index-77820e6c.js +17 -0
- package/dist/wc/cjs/index-7b42e7ce.js +21 -0
- package/dist/wc/cjs/index-903cb132.js +17 -0
- package/dist/wc/cjs/index-9ad9039f.js +22 -0
- package/dist/wc/cjs/index-a8dfd3f3.js +53 -0
- package/dist/wc/cjs/index-d6d2e8ac.js +21 -0
- package/dist/wc/cjs/index-e5699190.js +17 -0
- package/dist/wc/cjs/index-ef01acde.js +29 -0
- package/dist/wc/cjs/{index-9ca7d5e5.js → index-fd6e6c28.js} +8 -0
- package/dist/wc/cjs/{license-activation_11.cjs.entry.js → license-activation_10.cjs.entry.js} +966 -129
- package/dist/wc/cjs/loader.cjs.js +2 -2
- package/dist/wc/cjs/{utils-2bfaab77.js → utils-1ed1ec98.js} +1 -1
- package/dist/wc/cjs/{utils-3ac19501.js → utils-43a3deb6.js} +13 -3
- package/dist/wc/cjs/z-accordion.cjs.entry.js +67 -0
- package/dist/wc/cjs/z-alert.cjs.entry.js +1 -1
- package/dist/wc/cjs/z-anchor-navigation.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-app-header.cjs.entry.js +92 -40
- package/dist/wc/cjs/z-aria-alert.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-avatar.cjs.entry.js +5 -5
- package/dist/wc/cjs/z-book-card.cjs.entry.js +126 -0
- package/dist/wc/cjs/z-breadcrumb.cjs.entry.js +232 -0
- package/dist/wc/cjs/z-button-sort.cjs.entry.js +4 -4
- package/dist/wc/cjs/z-card.cjs.entry.js +6 -19
- package/dist/wc/cjs/z-carousel.cjs.entry.js +8 -4
- package/dist/wc/cjs/z-chip.cjs.entry.js +11 -16
- package/dist/wc/cjs/z-combobox.cjs.entry.js +12 -10
- package/dist/wc/cjs/z-contextual-menu.cjs.entry.js +6 -6
- package/dist/wc/cjs/z-cover-hero.cjs.entry.js +25 -8
- package/dist/wc/cjs/z-date-picker.cjs.entry.js +3 -3
- package/dist/wc/cjs/z-divider.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-dragdrop-area.cjs.entry.js +1 -1
- package/dist/wc/cjs/z-file-upload.cjs.entry.js +5 -5
- package/dist/wc/cjs/z-file.cjs.entry.js +3 -3
- package/dist/wc/cjs/z-ghost-loading.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-info-reveal.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-link.cjs.entry.js +74 -0
- package/dist/wc/cjs/z-list_3.cjs.entry.js +4 -4
- package/dist/wc/cjs/z-logo.cjs.entry.js +1 -1
- package/dist/wc/cjs/z-menu-section.cjs.entry.js +12 -4
- package/dist/wc/cjs/z-menu.cjs.entry.js +27 -15
- package/dist/wc/cjs/z-messages-pocket.cjs.entry.js +3 -3
- package/dist/wc/cjs/z-myz-card-alert.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-myz-card-dictionary.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-myz-card-footer-sections.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-myz-card-footer.cjs.entry.js +16 -4
- package/dist/wc/cjs/z-myz-card-icon.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-myz-card-info.cjs.entry.js +4 -4
- package/dist/wc/cjs/z-myz-card-list.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-myz-card_4.cjs.entry.js +5 -5
- package/dist/wc/cjs/z-myz-list-item.cjs.entry.js +5 -5
- package/dist/wc/cjs/z-myz-list.cjs.entry.js +1 -1
- package/dist/wc/cjs/z-navigation-tab-link.cjs.entry.js +10 -7
- package/dist/wc/cjs/z-navigation-tab.cjs.entry.js +7 -7
- package/dist/wc/cjs/z-navigation-tabs.cjs.entry.js +152 -49
- package/dist/wc/cjs/z-notification.cjs.entry.js +1 -1
- package/dist/wc/cjs/z-offcanvas_2.cjs.entry.js +281 -0
- package/dist/wc/cjs/z-otp.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-pagination.cjs.entry.js +3 -3
- package/dist/wc/cjs/z-panel-elem.cjs.entry.js +7 -3
- package/dist/wc/cjs/z-pocket-message.cjs.entry.js +1 -1
- package/dist/wc/cjs/z-pocket_3.cjs.entry.js +4 -4
- package/dist/wc/cjs/z-popover.cjs.entry.js +6 -5
- package/dist/wc/cjs/z-range-picker.cjs.entry.js +25 -7
- package/dist/wc/cjs/z-section-title.cjs.entry.js +3 -3
- package/dist/wc/cjs/z-select.cjs.entry.js +20 -13
- package/dist/wc/cjs/z-skip-to-content.cjs.entry.js +14 -6
- package/dist/wc/cjs/z-slideshow.cjs.entry.js +5 -5
- package/dist/wc/cjs/z-stepper-item.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-stepper.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-table-body.cjs.entry.js +3 -17
- package/dist/wc/cjs/z-table-cell.cjs.entry.js +4 -29
- package/dist/wc/cjs/z-table-deprecated.cjs.entry.js +91 -0
- package/dist/wc/cjs/z-table-empty-box.cjs.entry.js +3 -24
- package/dist/wc/cjs/z-table-expanded-row.cjs.entry.js +3 -12
- package/dist/wc/cjs/z-table-footer.cjs.entry.js +3 -16
- package/dist/wc/cjs/z-table-head.cjs.entry.js +3 -16
- package/dist/wc/cjs/z-table-header-row.cjs.entry.js +3 -15
- package/dist/wc/cjs/z-table-header.cjs.entry.js +6 -75
- package/dist/wc/cjs/z-table-row.cjs.entry.js +4 -36
- package/dist/wc/cjs/z-table-sticky-footer.cjs.entry.js +3 -12
- package/dist/wc/cjs/z-table.cjs.entry.js +37 -59
- package/dist/wc/cjs/z-tag.cjs.entry.js +1 -1
- package/dist/wc/cjs/z-tbody.cjs.entry.js +10 -0
- package/dist/wc/cjs/z-td.cjs.entry.js +11 -0
- package/dist/wc/cjs/z-tfoot.cjs.entry.js +10 -0
- package/dist/wc/cjs/z-th.cjs.entry.js +11 -0
- package/dist/wc/cjs/z-thead.cjs.entry.js +10 -0
- package/dist/wc/cjs/z-toast-notification-list.cjs.entry.js +2 -2
- package/dist/wc/cjs/z-toast-notification.cjs.entry.js +3 -3
- package/dist/wc/cjs/z-toggle-button.cjs.entry.js +5 -3
- package/dist/wc/cjs/z-toggle-switch.cjs.entry.js +4 -4
- package/dist/wc/cjs/z-tooltip.cjs.entry.js +11 -5
- package/dist/wc/cjs/z-tr.cjs.entry.js +15 -0
- package/dist/wc/cjs/z-visually-hidden.cjs.entry.js +1 -1
- package/dist/wc/collection/collection-manifest.json +10 -4
- package/dist/wc/collection/components/license-activation/license-activation.js +23 -19
- package/dist/wc/collection/components/license-activation-form/license-activation-form.css +15 -8
- package/dist/wc/collection/components/license-activation-form/license-activation-form.js +13 -37
- package/dist/wc/custom-elements/index.js +2737 -840
- package/dist/wc/delta_share/delta_share.esm.js +1 -1
- package/dist/wc/delta_share/p-0365fad8.entry.js +1 -0
- package/dist/wc/delta_share/p-042bd3f6.js +1 -0
- package/dist/wc/delta_share/{p-9ad5616e.entry.js → p-059e9ee0.entry.js} +1 -1
- package/dist/wc/delta_share/p-05c9d96f.entry.js +1 -0
- package/dist/wc/delta_share/{p-578f4d61.entry.js → p-065a8ef6.entry.js} +1 -1
- package/dist/wc/delta_share/{p-5e503d5f.entry.js → p-08af13db.entry.js} +1 -1
- package/dist/wc/delta_share/{p-c31b160e.entry.js → p-09de99b2.entry.js} +1 -1
- package/dist/wc/delta_share/p-0e74cc07.entry.js +1 -0
- package/dist/wc/delta_share/{p-9e5596cd.entry.js → p-105ddd7d.entry.js} +1 -1
- package/dist/wc/delta_share/p-112478b5.js +1 -0
- package/dist/wc/delta_share/p-1553bc63.entry.js +1 -0
- package/dist/wc/delta_share/{p-0aa553ea.entry.js → p-16e61c27.entry.js} +1 -1
- package/dist/wc/delta_share/p-172a32d0.entry.js +1 -0
- package/dist/wc/delta_share/p-18ac49f8.entry.js +1 -0
- package/dist/wc/delta_share/p-18fcc8c7.js +1 -0
- package/dist/wc/delta_share/p-1c37c8f2.js +1 -0
- package/dist/wc/delta_share/{p-3cf0c6a5.entry.js → p-1e9b4693.entry.js} +1 -1
- package/dist/wc/delta_share/{p-bc10cf1a.entry.js → p-2439bd5d.entry.js} +1 -1
- package/dist/wc/delta_share/p-293a7ee2.entry.js +1 -0
- package/dist/wc/delta_share/{p-bcb29c7a.entry.js → p-2a4fe864.entry.js} +1 -1
- package/dist/wc/delta_share/p-2b4c3aab.js +1 -0
- package/dist/wc/delta_share/{p-6c54d53f.entry.js → p-2ca8ccb2.entry.js} +1 -1
- package/dist/wc/delta_share/p-2ed166b8.entry.js +1 -0
- package/dist/wc/delta_share/p-319c1a3e.entry.js +1 -0
- package/dist/wc/delta_share/p-37c5c92e.js +1 -0
- package/dist/wc/delta_share/p-3984a6c2.entry.js +1 -0
- package/dist/wc/delta_share/p-3b3f83a6.entry.js +1 -0
- package/dist/wc/delta_share/p-3f4dbb4f.entry.js +3 -0
- package/dist/wc/delta_share/{p-a815651c.entry.js → p-3fac6e84.entry.js} +1 -1
- package/dist/wc/delta_share/p-4018719d.entry.js +1 -0
- package/dist/wc/delta_share/{p-57f2b8d8.entry.js → p-44d6f07c.entry.js} +1 -1
- package/dist/wc/delta_share/{p-8d532866.entry.js → p-47ec520c.js} +1 -1
- package/dist/wc/delta_share/p-47f3e677.js +1 -0
- package/dist/wc/delta_share/{p-42dd4f36.entry.js → p-4a51a3c6.entry.js} +1 -1
- package/dist/wc/delta_share/p-4b2719fc.entry.js +1 -0
- package/dist/wc/delta_share/p-4c9ec16c.entry.js +1 -0
- package/dist/wc/delta_share/p-4ff6d958.entry.js +1 -0
- package/dist/wc/delta_share/p-536412c7.entry.js +1 -0
- package/dist/wc/delta_share/p-551bf917.js +1 -0
- package/dist/wc/delta_share/{p-8876b438.entry.js → p-57a1a7a3.entry.js} +1 -1
- package/dist/wc/delta_share/p-58991db7.js +1 -0
- package/dist/wc/delta_share/p-595c8d39.entry.js +1 -0
- package/dist/wc/delta_share/p-5989869c.js +1 -0
- package/dist/wc/delta_share/p-5f97902c.entry.js +1 -0
- package/dist/wc/delta_share/{p-950aa417.entry.js → p-6658206d.entry.js} +1 -1
- package/dist/wc/delta_share/p-67f03907.entry.js +1 -0
- package/dist/wc/delta_share/{p-d8e80ee8.entry.js → p-69d9835f.js} +1 -1
- package/dist/wc/delta_share/p-6bd46452.entry.js +1 -0
- package/dist/wc/delta_share/p-6be926f4.js +1 -0
- package/dist/wc/delta_share/p-6cb698e0.entry.js +1 -0
- package/dist/wc/delta_share/p-6e8df0ae.entry.js +1 -0
- package/dist/wc/delta_share/p-6f95cb22.entry.js +1 -0
- package/dist/wc/delta_share/p-7142f1dc.entry.js +1 -0
- package/dist/wc/delta_share/p-7b00c3b1.entry.js +1 -0
- package/dist/wc/delta_share/{p-963999a8.entry.js → p-7b668937.entry.js} +1 -1
- package/dist/wc/delta_share/p-7cb2f788.entry.js +1 -0
- package/dist/wc/delta_share/{p-8710e686.entry.js → p-82630451.entry.js} +1 -1
- package/dist/wc/delta_share/p-84a8b959.entry.js +1 -0
- package/dist/wc/delta_share/p-84e4e924.entry.js +1 -0
- package/dist/wc/delta_share/{p-829539a5.entry.js → p-8650dcb7.entry.js} +1 -1
- package/dist/wc/delta_share/p-8a0d51f7.entry.js +1 -0
- package/dist/wc/delta_share/{p-2f289949.entry.js → p-8f286d70.entry.js} +1 -1
- package/dist/wc/delta_share/p-8f38cd92.entry.js +1 -0
- package/dist/wc/delta_share/{p-81ddcb87.entry.js → p-8f6424ca.entry.js} +1 -1
- package/dist/wc/delta_share/p-96f53236.entry.js +1 -0
- package/dist/wc/delta_share/p-9ef9046f.entry.js +1 -0
- package/dist/wc/delta_share/p-9faa9434.entry.js +1 -0
- package/dist/wc/delta_share/{p-b38b27f2.entry.js → p-a051e83a.entry.js} +1 -1
- package/dist/wc/delta_share/{p-45dcece4.entry.js → p-a14153cc.entry.js} +1 -1
- package/dist/wc/delta_share/p-a3dc62bb.js +1 -0
- package/dist/wc/delta_share/p-aa8f533e.entry.js +1 -0
- package/dist/wc/delta_share/p-ab6dbdae.entry.js +1 -0
- package/dist/wc/delta_share/p-aeec6792.entry.js +1 -0
- package/dist/wc/delta_share/p-af60173c.entry.js +1 -0
- package/dist/wc/delta_share/p-bb15cf8b.entry.js +1 -0
- package/dist/wc/delta_share/p-c0ccd95c.entry.js +1 -0
- package/dist/wc/delta_share/p-c1b16c6e.entry.js +1 -0
- package/dist/wc/delta_share/p-c5f5fb78.entry.js +1 -0
- package/dist/wc/delta_share/p-c64950a2.entry.js +1 -0
- package/dist/wc/delta_share/p-c7678d37.js +1 -0
- package/dist/wc/delta_share/{p-1009b417.entry.js → p-ce115f77.entry.js} +1 -1
- package/dist/wc/delta_share/{p-7546c464.entry.js → p-d1062520.js} +1 -1
- package/dist/wc/delta_share/p-d231964b.entry.js +1 -0
- package/dist/wc/delta_share/p-d4fbf66b.entry.js +1 -0
- package/dist/wc/delta_share/{p-0bb97b61.js → p-d50ea6ea.js} +1 -1
- package/dist/wc/delta_share/p-d52d3e5c.js +1 -0
- package/dist/wc/delta_share/p-d6eef1ed.entry.js +1 -0
- package/dist/wc/delta_share/p-d8592d42.js +1 -0
- package/dist/wc/delta_share/p-d888ec2a.entry.js +1 -0
- package/dist/wc/delta_share/p-db7371fa.entry.js +1 -0
- package/dist/wc/delta_share/p-dd409bfb.js +1 -0
- package/dist/wc/delta_share/p-df6ae14f.js +1 -0
- package/dist/wc/delta_share/{p-4eb940ca.entry.js → p-e182b6dc.entry.js} +1 -1
- package/dist/wc/delta_share/p-e7f23a1e.entry.js +1 -0
- package/dist/wc/delta_share/p-ebd0e41d.entry.js +1 -0
- package/dist/wc/delta_share/{p-0bff6d57.entry.js → p-eddfcccc.entry.js} +1 -1
- package/dist/wc/delta_share/p-f77ae63f.entry.js +1 -0
- package/dist/wc/delta_share/p-f8091230.entry.js +1 -0
- package/dist/wc/delta_share/p-f894f849.entry.js +1 -0
- package/dist/wc/delta_share/p-f903c87f.entry.js +1 -0
- package/dist/wc/delta_share/p-fe486d84.entry.js +1 -0
- package/dist/wc/delta_share/p-fe53cbde.entry.js +1 -0
- package/dist/wc/delta_share/p-ff24a080.js +1 -0
- package/dist/wc/delta_share/p-ff98ef8e.entry.js +1 -0
- package/dist/wc/esm/breakpoints-3c3dbb8c.js +5 -0
- package/dist/wc/esm/delta_share.js +2 -2
- package/dist/wc/esm/{icons-7a34b033.js → icons-6196a79a.js} +111 -0
- package/dist/wc/esm/index-0cf1e7ae.js +19 -0
- package/dist/wc/esm/index-2a8923e8.js +18 -0
- package/dist/wc/esm/index-2ae14d02.js +65 -0
- package/dist/wc/esm/{index-b3a91e19.js → index-396432db.js} +8 -0
- package/dist/wc/esm/index-48b6c0e6.js +15 -0
- package/dist/wc/esm/index-5445c84d.js +19 -0
- package/dist/wc/esm/index-6642fa3a.js +15 -0
- package/dist/wc/esm/index-81516a9a.js +19 -0
- package/dist/wc/esm/{index-4f1e2705.js → index-9d240d39.js} +44 -11
- package/dist/wc/esm/index-b6d67648.js +39 -0
- package/dist/wc/esm/index-be084691.js +77 -0
- package/dist/wc/esm/index-c3e3c74b.js +51 -0
- package/dist/wc/esm/index-c74188e2.js +19 -0
- package/dist/wc/esm/index-c8e57c08.js +20 -0
- package/dist/wc/esm/index-cbe7ef0a.js +27 -0
- package/dist/wc/esm/index-df217b14.js +32 -0
- package/dist/wc/esm/index-e14dd015.js +15 -0
- package/dist/wc/esm/index-ea60f2c2.js +72 -0
- package/dist/wc/esm/{license-activation_11.entry.js → license-activation_10.entry.js} +967 -129
- package/dist/wc/esm/loader.js +2 -2
- package/dist/wc/esm/{utils-711517a4.js → utils-5e6dc3fe.js} +1 -1
- package/dist/wc/esm/{utils-5a24a17b.js → utils-bc5ea6f7.js} +13 -4
- package/dist/wc/esm/z-accordion.entry.js +63 -0
- package/dist/wc/esm/z-alert.entry.js +1 -1
- package/dist/wc/esm/z-anchor-navigation.entry.js +2 -2
- package/dist/wc/esm/z-app-header.entry.js +92 -40
- package/dist/wc/esm/z-aria-alert.entry.js +2 -2
- package/dist/wc/esm/z-avatar.entry.js +5 -5
- package/dist/wc/esm/z-book-card.entry.js +122 -0
- package/dist/wc/esm/z-breadcrumb.entry.js +228 -0
- package/dist/wc/esm/z-button-sort.entry.js +4 -4
- package/dist/wc/esm/z-card.entry.js +6 -19
- package/dist/wc/esm/z-carousel.entry.js +8 -4
- package/dist/wc/esm/z-chip.entry.js +11 -16
- package/dist/wc/esm/z-combobox.entry.js +12 -10
- package/dist/wc/esm/z-contextual-menu.entry.js +6 -6
- package/dist/wc/esm/z-cover-hero.entry.js +25 -8
- package/dist/wc/esm/z-date-picker.entry.js +3 -3
- package/dist/wc/esm/z-divider.entry.js +2 -2
- package/dist/wc/esm/z-dragdrop-area.entry.js +1 -1
- package/dist/wc/esm/z-file-upload.entry.js +5 -5
- package/dist/wc/esm/z-file.entry.js +3 -3
- package/dist/wc/esm/z-ghost-loading.entry.js +2 -2
- package/dist/wc/esm/z-info-reveal.entry.js +2 -2
- package/dist/wc/esm/z-link.entry.js +70 -0
- package/dist/wc/esm/z-list_3.entry.js +4 -4
- package/dist/wc/esm/z-logo.entry.js +1 -1
- package/dist/wc/esm/z-menu-section.entry.js +12 -4
- package/dist/wc/esm/z-menu.entry.js +27 -15
- package/dist/wc/esm/z-messages-pocket.entry.js +3 -3
- package/dist/wc/esm/z-myz-card-alert.entry.js +2 -2
- package/dist/wc/esm/z-myz-card-dictionary.entry.js +2 -2
- package/dist/wc/esm/z-myz-card-footer-sections.entry.js +2 -2
- package/dist/wc/esm/z-myz-card-footer.entry.js +16 -4
- package/dist/wc/esm/z-myz-card-icon.entry.js +2 -2
- package/dist/wc/esm/z-myz-card-info.entry.js +4 -4
- package/dist/wc/esm/z-myz-card-list.entry.js +2 -2
- package/dist/wc/esm/z-myz-card_4.entry.js +5 -5
- package/dist/wc/esm/z-myz-list-item.entry.js +5 -5
- package/dist/wc/esm/z-myz-list.entry.js +1 -1
- package/dist/wc/esm/z-navigation-tab-link.entry.js +10 -7
- package/dist/wc/esm/z-navigation-tab.entry.js +7 -7
- package/dist/wc/esm/z-navigation-tabs.entry.js +152 -49
- package/dist/wc/esm/z-notification.entry.js +1 -1
- package/dist/wc/esm/z-offcanvas_2.entry.js +276 -0
- package/dist/wc/esm/z-otp.entry.js +2 -2
- package/dist/wc/esm/z-pagination.entry.js +3 -3
- package/dist/wc/esm/z-panel-elem.entry.js +7 -3
- package/dist/wc/esm/z-pocket-message.entry.js +1 -1
- package/dist/wc/esm/z-pocket_3.entry.js +4 -4
- package/dist/wc/esm/z-popover.entry.js +6 -5
- package/dist/wc/esm/z-range-picker.entry.js +25 -7
- package/dist/wc/esm/z-section-title.entry.js +3 -3
- package/dist/wc/esm/z-select.entry.js +20 -13
- package/dist/wc/esm/z-skip-to-content.entry.js +14 -6
- package/dist/wc/esm/z-slideshow.entry.js +5 -5
- package/dist/wc/esm/z-stepper-item.entry.js +2 -2
- package/dist/wc/esm/z-stepper.entry.js +2 -2
- package/dist/wc/esm/z-table-body.entry.js +2 -20
- package/dist/wc/esm/z-table-cell.entry.js +3 -32
- package/dist/wc/esm/z-table-deprecated.entry.js +87 -0
- package/dist/wc/esm/z-table-empty-box.entry.js +2 -27
- package/dist/wc/esm/z-table-expanded-row.entry.js +2 -15
- package/dist/wc/esm/z-table-footer.entry.js +2 -19
- package/dist/wc/esm/z-table-head.entry.js +2 -19
- package/dist/wc/esm/z-table-header-row.entry.js +2 -18
- package/dist/wc/esm/z-table-header.entry.js +5 -78
- package/dist/wc/esm/z-table-row.entry.js +3 -39
- package/dist/wc/esm/z-table-sticky-footer.entry.js +2 -15
- package/dist/wc/esm/z-table.entry.js +37 -59
- package/dist/wc/esm/z-tag.entry.js +1 -1
- package/dist/wc/esm/z-tbody.entry.js +2 -0
- package/dist/wc/esm/z-td.entry.js +3 -0
- package/dist/wc/esm/z-tfoot.entry.js +2 -0
- package/dist/wc/esm/z-th.entry.js +3 -0
- package/dist/wc/esm/z-thead.entry.js +2 -0
- package/dist/wc/esm/z-toast-notification-list.entry.js +2 -2
- package/dist/wc/esm/z-toast-notification.entry.js +3 -3
- package/dist/wc/esm/z-toggle-button.entry.js +5 -3
- package/dist/wc/esm/z-toggle-switch.entry.js +4 -4
- package/dist/wc/esm/z-tooltip.entry.js +11 -5
- package/dist/wc/esm/z-tr.entry.js +7 -0
- package/dist/wc/esm/z-visually-hidden.entry.js +1 -1
- package/dist/wc/types/components/license-activation/license-activation.d.ts +2 -3
- package/dist/wc/types/components/license-activation-form/license-activation-form.d.ts +2 -5
- package/dist/wc/types/components.d.ts +0 -2
- package/package.json +1 -1
- package/dist/wc/cjs/z-app-switcher.cjs.entry.js +0 -29
- package/dist/wc/cjs/z-body.cjs.entry.js +0 -18
- package/dist/wc/cjs/z-heading.cjs.entry.js +0 -18
- package/dist/wc/cjs/z-offcanvas.cjs.entry.js +0 -70
- package/dist/wc/cjs/z-searchbar.cjs.entry.js +0 -235
- package/dist/wc/cjs/z-typography.cjs.entry.js +0 -30
- package/dist/wc/delta_share/p-0434c900.entry.js +0 -1
- package/dist/wc/delta_share/p-063881e2.entry.js +0 -1
- package/dist/wc/delta_share/p-0667e9cd.entry.js +0 -1
- package/dist/wc/delta_share/p-0f55558e.js +0 -1
- package/dist/wc/delta_share/p-1c2d7c30.entry.js +0 -1
- package/dist/wc/delta_share/p-1d2cb6f9.entry.js +0 -1
- package/dist/wc/delta_share/p-23905d08.entry.js +0 -1
- package/dist/wc/delta_share/p-29310a24.entry.js +0 -1
- package/dist/wc/delta_share/p-3fa29874.entry.js +0 -1
- package/dist/wc/delta_share/p-42e9c740.entry.js +0 -1
- package/dist/wc/delta_share/p-500ff0dd.entry.js +0 -1
- package/dist/wc/delta_share/p-51431ace.js +0 -1
- package/dist/wc/delta_share/p-5530ca81.entry.js +0 -1
- package/dist/wc/delta_share/p-5d88112c.entry.js +0 -1
- package/dist/wc/delta_share/p-61264c72.entry.js +0 -1
- package/dist/wc/delta_share/p-64decd7d.entry.js +0 -1
- package/dist/wc/delta_share/p-65be6de6.entry.js +0 -1
- package/dist/wc/delta_share/p-6cb8def6.entry.js +0 -1
- package/dist/wc/delta_share/p-6d853df0.entry.js +0 -1
- package/dist/wc/delta_share/p-702dd7b4.entry.js +0 -1
- package/dist/wc/delta_share/p-74b71f61.entry.js +0 -1
- package/dist/wc/delta_share/p-78d71789.js +0 -1
- package/dist/wc/delta_share/p-7ae0c21f.js +0 -1
- package/dist/wc/delta_share/p-86a8888e.entry.js +0 -3
- package/dist/wc/delta_share/p-8794c0c7.entry.js +0 -1
- package/dist/wc/delta_share/p-8825d8e4.entry.js +0 -1
- package/dist/wc/delta_share/p-8cc7c2c7.entry.js +0 -1
- package/dist/wc/delta_share/p-8d91a5b7.entry.js +0 -1
- package/dist/wc/delta_share/p-90fdd23f.entry.js +0 -1
- package/dist/wc/delta_share/p-925fc6c3.entry.js +0 -1
- package/dist/wc/delta_share/p-963f64a8.entry.js +0 -1
- package/dist/wc/delta_share/p-99ffd017.entry.js +0 -1
- package/dist/wc/delta_share/p-a150a778.entry.js +0 -1
- package/dist/wc/delta_share/p-a2b564ef.entry.js +0 -1
- package/dist/wc/delta_share/p-a64544de.entry.js +0 -1
- package/dist/wc/delta_share/p-a6b403f9.entry.js +0 -1
- package/dist/wc/delta_share/p-afb5bfe5.entry.js +0 -1
- package/dist/wc/delta_share/p-b16fd965.entry.js +0 -1
- package/dist/wc/delta_share/p-badf3f24.entry.js +0 -1
- package/dist/wc/delta_share/p-be7f8da0.entry.js +0 -1
- package/dist/wc/delta_share/p-c229c90e.entry.js +0 -1
- package/dist/wc/delta_share/p-c436e1af.entry.js +0 -1
- package/dist/wc/delta_share/p-c51ebb01.entry.js +0 -1
- package/dist/wc/delta_share/p-c885d25c.entry.js +0 -1
- package/dist/wc/delta_share/p-c9df8e5d.entry.js +0 -1
- package/dist/wc/delta_share/p-cb16715b.entry.js +0 -1
- package/dist/wc/delta_share/p-cf58d833.js +0 -1
- package/dist/wc/delta_share/p-d586adfc.entry.js +0 -1
- package/dist/wc/delta_share/p-d69c3b08.entry.js +0 -1
- package/dist/wc/delta_share/p-ddab353c.entry.js +0 -1
- package/dist/wc/delta_share/p-ea6c67f2.entry.js +0 -1
- package/dist/wc/delta_share/p-ee0a8f1f.entry.js +0 -1
- package/dist/wc/delta_share/p-fc49c455.entry.js +0 -1
- package/dist/wc/esm/breakpoints-e07f80e7.js +0 -4
- package/dist/wc/esm/z-app-switcher.entry.js +0 -25
- package/dist/wc/esm/z-body.entry.js +0 -14
- package/dist/wc/esm/z-heading.entry.js +0 -14
- package/dist/wc/esm/z-offcanvas.entry.js +0 -66
- package/dist/wc/esm/z-searchbar.entry.js +0 -231
- package/dist/wc/esm/z-typography.entry.js +0 -26
package/dist/wc/cjs/{license-activation_11.cjs.entry.js → license-activation_10.cjs.entry.js}
RENAMED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-fd6e6c28.js');
|
|
6
6
|
const _commonjsHelpers = require('./_commonjsHelpers-537d719a.js');
|
|
7
|
-
const index$1 = require('./index-
|
|
8
|
-
const icons = require('./icons-
|
|
9
|
-
const utils = require('./utils-
|
|
10
|
-
require('./breakpoints-
|
|
7
|
+
const index$1 = require('./index-029f1a7e.js');
|
|
8
|
+
const icons = require('./icons-6d7ce4fc.js');
|
|
9
|
+
const utils = require('./utils-43a3deb6.js');
|
|
10
|
+
require('./breakpoints-e7c8838e.js');
|
|
11
11
|
|
|
12
12
|
var DeviceEnum;
|
|
13
13
|
(function (DeviceEnum) {
|
|
@@ -69,10 +69,10 @@ const debounce = (fn, ms) => {
|
|
|
69
69
|
*
|
|
70
70
|
* Better leak in Edge than to be useless.
|
|
71
71
|
*/
|
|
72
|
-
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
72
|
+
const isConnected$1 = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
73
73
|
const cleanupElements = debounce((map) => {
|
|
74
74
|
for (let key of map.keys()) {
|
|
75
|
-
map.set(key, map.get(key).filter(isConnected));
|
|
75
|
+
map.set(key, map.get(key).filter(isConnected$1));
|
|
76
76
|
}
|
|
77
77
|
}, 2000);
|
|
78
78
|
const stencilSubscription = ({ on }) => {
|
|
@@ -1738,7 +1738,6 @@ const LicenseActivation = class {
|
|
|
1738
1738
|
this.licenseStatusChange = index.createEvent(this, "licenseStatusChange", 7);
|
|
1739
1739
|
/** env: values: "local" | "devmy" | "testmy" | "demomy" | "prod" */
|
|
1740
1740
|
this.env = "prod";
|
|
1741
|
-
this.initialShowInfoBox = false;
|
|
1742
1741
|
this.licenseActivationState = licenseInitialState;
|
|
1743
1742
|
}
|
|
1744
1743
|
async componentWillLoad() {
|
|
@@ -1763,8 +1762,7 @@ const LicenseActivation = class {
|
|
|
1763
1762
|
this.licenseModalState.emit({ value: "closed" });
|
|
1764
1763
|
this.resetStore();
|
|
1765
1764
|
}
|
|
1766
|
-
handleLicenseModalOpen(
|
|
1767
|
-
this.initialShowInfoBox = initialShowInfoBox;
|
|
1765
|
+
handleLicenseModalOpen() {
|
|
1768
1766
|
this.submitClicked = true;
|
|
1769
1767
|
this.modalState = "open";
|
|
1770
1768
|
this.licenseModalState.emit({ value: "open" });
|
|
@@ -1799,7 +1797,7 @@ const LicenseActivation = class {
|
|
|
1799
1797
|
if (this.licenseActivationState.licenseActivationCode === sampleCode) {
|
|
1800
1798
|
this.licenseActivationState = Object.assign(Object.assign({}, this.licenseActivationState), { licenseActivationMessage: sampleCodeError, licenseActivationStatus: "fail", licenseActivationApiData: null });
|
|
1801
1799
|
this.emitStatusChange();
|
|
1802
|
-
this.handleLicenseModalOpen(
|
|
1800
|
+
this.handleLicenseModalOpen();
|
|
1803
1801
|
}
|
|
1804
1802
|
try {
|
|
1805
1803
|
const response = await post(url, { code: this.licenseActivationState.licenseActivationCode }, null, requestOpt);
|
|
@@ -1810,20 +1808,20 @@ const LicenseActivation = class {
|
|
|
1810
1808
|
this.emitStatusChange();
|
|
1811
1809
|
response.ok
|
|
1812
1810
|
? this.handleLicenseModalClose()
|
|
1813
|
-
: this.handleLicenseModalOpen(
|
|
1811
|
+
: this.handleLicenseModalOpen();
|
|
1814
1812
|
}
|
|
1815
1813
|
catch (error) {
|
|
1816
1814
|
const { response } = error;
|
|
1817
1815
|
this.licenseActivationState = Object.assign(Object.assign({}, this.licenseActivationState), { licenseActivationApiLoading: false, licenseActivationApiLoaded: true, licenseActivationApiError: error, licenseActivationStatus: "fail", licenseActivationMessage: handleResponseError(await response.json()), licenseActivationApiData: null });
|
|
1818
1816
|
this.emitStatusChange();
|
|
1819
|
-
this.handleLicenseModalOpen(
|
|
1817
|
+
this.handleLicenseModalOpen();
|
|
1820
1818
|
}
|
|
1821
1819
|
}
|
|
1822
1820
|
async handleSubmitButtonClick(inputVal) {
|
|
1823
1821
|
const { licenseActivationState: { licenseActivationStatus }, } = this;
|
|
1824
1822
|
this.licenseActivationState = Object.assign(Object.assign({}, this.licenseActivationState), { licenseActivationCode: inputVal });
|
|
1825
1823
|
if (!inputVal) {
|
|
1826
|
-
this.handleLicenseModalOpen(
|
|
1824
|
+
this.handleLicenseModalOpen();
|
|
1827
1825
|
}
|
|
1828
1826
|
if ((this.variant === LicenseActivationVariantEnum.modal ||
|
|
1829
1827
|
this.modalState === "open" ||
|
|
@@ -1850,19 +1848,27 @@ const LicenseActivation = class {
|
|
|
1850
1848
|
renderLicenseActivationModal() {
|
|
1851
1849
|
return (index.h("license-activation-modal", { id: `${this.host.id}-modal`, "modal-title": this.cms["newdashboard.licenseActivation.modalTitle"], onActivationModalClose: () => this.handleLicenseModalClose(), resetStore: this.resetStore }, this.renderLicenseActivationForm(LicenseActivationVariantEnum.modal)));
|
|
1852
1850
|
}
|
|
1853
|
-
retrieveTextsObject() {
|
|
1854
|
-
const { inputMessage, inputLabel, inputPlaceholder, buttonLabel,
|
|
1851
|
+
retrieveTextsObject(variant) {
|
|
1852
|
+
const { inputMessage, inputLabel, inputPlaceholder, buttonLabel, additionalDescription, buttonIcon, previewInputPlaceholder, previewButtonLabel, previewButtonIcon, previewButtonSize, } = this;
|
|
1855
1853
|
const { licenseActivationStatus } = this.licenseActivationState;
|
|
1854
|
+
let description = null, defaultInputMessage = null;
|
|
1855
|
+
if (variant === LicenseActivationVariantEnum.modal) {
|
|
1856
|
+
description =
|
|
1857
|
+
additionalDescription ||
|
|
1858
|
+
this.cms["newdashboard.licenseActivation.additionalDescription"];
|
|
1859
|
+
}
|
|
1860
|
+
else {
|
|
1861
|
+
defaultInputMessage =
|
|
1862
|
+
this.cms["newdashboard.licenseActivation.inputHelperMessage"];
|
|
1863
|
+
}
|
|
1856
1864
|
return {
|
|
1857
1865
|
inputStatus: this.mapInputStatus(licenseActivationStatus),
|
|
1858
|
-
inputMessage: inputMessage ||
|
|
1859
|
-
this.cms["newdashboard.licenseActivation.inputHelperMessage"],
|
|
1866
|
+
inputMessage: inputMessage || defaultInputMessage,
|
|
1860
1867
|
placeholder: inputPlaceholder ||
|
|
1861
1868
|
this.cms["newdashboard.licenseActivation.inputPlaceholder"],
|
|
1862
1869
|
inputLabel: inputLabel || this.cms["newdashboard.licenseActivation.inputLabel"],
|
|
1863
|
-
buttonLabel:
|
|
1864
|
-
|
|
1865
|
-
: this.cms["newdashboard.onboarding.licenseActivation.submitLabel"],
|
|
1870
|
+
buttonLabel: buttonLabel ||
|
|
1871
|
+
this.cms["newdashboard.onboarding.licenseActivation.submitLabel"],
|
|
1866
1872
|
buttonIcon,
|
|
1867
1873
|
previewInputPlaceholder,
|
|
1868
1874
|
previewButtonLabel,
|
|
@@ -1874,15 +1880,14 @@ const LicenseActivation = class {
|
|
|
1874
1880
|
infoBoxIcon: `${this.environment.URL_S3_IMAGES_FOLDER}bollinoSIAE.svg`,
|
|
1875
1881
|
infoBoxContent: this.cms["newdashboard.licenseActivation.infoBoxContent"],
|
|
1876
1882
|
supportLink: this.cms["newdashboard.licenseActivation.contactUs.url"],
|
|
1877
|
-
additionalDescription:
|
|
1878
|
-
additionalDescription,
|
|
1883
|
+
additionalDescription: description,
|
|
1879
1884
|
};
|
|
1880
1885
|
}
|
|
1881
1886
|
renderLicenseActivationForm(variant) {
|
|
1882
1887
|
const { componentid } = this;
|
|
1883
1888
|
const { licenseActivationState: { licenseActivationMessage, licenseActivationCode, licenseActivationApiLoading, }, } = this;
|
|
1884
|
-
const textObject = this.retrieveTextsObject();
|
|
1885
|
-
return (index.h("license-activation-form", { direction: "column", error: licenseActivationMessage, initialCode: licenseActivationCode, formTexts: textObject, requestLoading: !!licenseActivationApiLoading, enableButton: this.enableFormSubmitButton, formid: componentid,
|
|
1889
|
+
const textObject = this.retrieveTextsObject(variant);
|
|
1890
|
+
return (index.h("license-activation-form", { direction: "column", error: licenseActivationMessage, initialCode: licenseActivationCode, formTexts: textObject, requestLoading: !!licenseActivationApiLoading, enableButton: this.enableFormSubmitButton, formid: componentid, onFormInputChange: (e) => this.handleFormInputChange(e.detail.value), onSubmitButtonClick: (e) => this.handleSubmitButtonClick(e.detail.value), variant: variant, handleModalOpen: () => this.handleLicenseModalOpen() }));
|
|
1886
1891
|
}
|
|
1887
1892
|
renderMobileButton() {
|
|
1888
1893
|
return (index.h("z-button", { onClick: () => this.handleMobileButtonClick() }, this.cms["newdashboard.onboarding.licenseActivation.mobileSubmitLabel"]));
|
|
@@ -1927,7 +1932,7 @@ const LicenseActivationBox = class {
|
|
|
1927
1932
|
};
|
|
1928
1933
|
LicenseActivationBox.style = licenseActivationBoxCss;
|
|
1929
1934
|
|
|
1930
|
-
const licenseActivationFormCss = ".sc-license-activation-form-h{display:block}.sc-license-activation-form-h>div.sc-license-activation-form>.body-3.sc-license-activation-form{display:block;margin-bottom:calc(var(--space-unit) *
|
|
1935
|
+
const licenseActivationFormCss = ".sc-license-activation-form-h{display:block}.sc-license-activation-form-h>div.sc-license-activation-form>.body-3.sc-license-activation-form{display:block;margin-bottom:calc(var(--space-unit) * 4)}.sc-license-activation-form-h>div.sc-license-activation-form>z-button.sc-license-activation-form{padding:calc(var(--space-unit) * 2) 0;width:100%}.sc-license-activation-form-h>div.sc-license-activation-form>z-input.sc-license-activation-form{width:100%}.sc-license-activation-form-h>div.sc-license-activation-form>z-info-box.sc-license-activation-form>div.sc-license-activation-form{display:flex}[variant=\"modal\"].sc-license-activation-form-h{padding:calc(var(--space-unit) * 2)}[variant=\"modal\"].sc-license-activation-form-h .error-section.sc-license-activation-form{display:flex;flex-direction:column;border-top:var(--border-size-small) solid var(--color-surface03);margin-top:calc(var(--space-unit) * 3);padding-top:calc(var(--space-unit) * 2)}[variant=\"modal\"].sc-license-activation-form-h .error-section.sc-license-activation-form>span.sc-license-activation-form{padding:calc(var(--space-unit) * 2) 0;display:block;color:var(--color-text01);fill:var(--color-text01);font-family:var(--dashboard-font);font-weight:var(--font-sb);font-size:14px;line-height:20px}[variant=\"preview\"].sc-license-activation-form-h{margin:0;padding:0}[variant=\"preview\"].sc-license-activation-form-h>div.sc-license-activation-form>z-button.sc-license-activation-form{margin:0;padding:0;width:initial}[variant=\"preview\"].sc-license-activation-form-h .license-input-container.sc-license-activation-form{width:100%;margin-right:calc(var(--space-unit) * 2)}[variant=\"modal\"].sc-license-activation-form-h .infobox-content.sc-license-activation-form{display:flex;align-items:center;color:var(--color-link-primary);column-gap:0.5em;padding:calc(var(--space-unit) / 2) 0}[variant=\"modal\"].sc-license-activation-form-h .infobox-content.sc-license-activation-form z-icon.sc-license-activation-form{fill:var(--color-link-primary)}.sc-license-activation-form-h .license-input-container.sc-license-activation-form>z-input.sc-license-activation-form{width:100%}@media only screen and (min-width: 768px){[variant=\"modal\"].sc-license-activation-form-h{padding:calc(var(--space-unit) * 3);width:396px}.sc-license-activation-form-h>div.sc-license-activation-form{display:flex;flex-direction:row}[variant=\"modal\"].sc-license-activation-form-h>div.sc-license-activation-form{flex-direction:column}.sc-license-activation-form-h>div.sc-license-activation-form>z-button.sc-license-activation-form{padding-top:calc(var(--space-unit) * 3);padding-left:calc(var(--space-unit) * 2);width:auto}[variant=\"preview\"].sc-license-activation-form-h>div.sc-license-activation-form>z-button.sc-license-activation-form{padding-top:0}[variant=\"modal\"].sc-license-activation-form-h>div.sc-license-activation-form>z-button.sc-license-activation-form{padding:calc(var(--space-unit) * 3) 0 calc(var(--space-unit) * 2);width:max-content}[variant=\"modal\"].sc-license-activation-form-h .error-section.sc-license-activation-form>z-button.sc-license-activation-form{width:max-content}}@media only screen and (min-width: 1152px){.sc-license-activation-form-h>div.sc-license-activation-form{flex-direction:row}}@media only screen and (min-width: 1366px){[variant=\"modal\"].sc-license-activation-form-h{padding:calc(var(--space-unit) * 4);width:477px}}";
|
|
1931
1936
|
|
|
1932
1937
|
const LicenseActivationForm = class {
|
|
1933
1938
|
constructor(hostRef) {
|
|
@@ -1955,7 +1960,6 @@ const LicenseActivationForm = class {
|
|
|
1955
1960
|
}
|
|
1956
1961
|
}
|
|
1957
1962
|
componentWillLoad() {
|
|
1958
|
-
this.showInfoBox = !!this.initialShowInfoBox;
|
|
1959
1963
|
this.inputVal = this.initialCode ? this.initialCode : "";
|
|
1960
1964
|
}
|
|
1961
1965
|
handleFormInputChange(detail) {
|
|
@@ -1966,9 +1970,6 @@ const LicenseActivationForm = class {
|
|
|
1966
1970
|
this.submitButtonClick.emit({ value: inputVal });
|
|
1967
1971
|
}
|
|
1968
1972
|
handleInfoClick() {
|
|
1969
|
-
if (this.variant === LicenseActivationVariantEnum.modal) {
|
|
1970
|
-
this.showInfoBox = true;
|
|
1971
|
-
}
|
|
1972
1973
|
if (this.variant === LicenseActivationVariantEnum.box ||
|
|
1973
1974
|
this.variant === LicenseActivationVariantEnum.preview) {
|
|
1974
1975
|
this.handleModalOpen();
|
|
@@ -2004,34 +2005,27 @@ const LicenseActivationForm = class {
|
|
|
2004
2005
|
const disabled = (this.variant === LicenseActivationVariantEnum.modal && !this.inputVal) ||
|
|
2005
2006
|
!!this.requestLoading ||
|
|
2006
2007
|
!this.enableButton;
|
|
2007
|
-
return (index.h("z-button", { variant: index$1.ButtonVariant.primary, size: this.getButtonSize(this.variant), icon: this.getButtonIcon(this.variant), disabled: disabled, onClick: () => this.handleSubmitButtonClick(this.inputVal) }, this.getButtonLabel(this.variant)));
|
|
2008
|
+
return (index.h("z-button", { ariaLabel: "attiva il libro digitale", variant: index$1.ButtonVariant.primary, size: this.getButtonSize(this.variant), icon: this.getButtonIcon(this.variant), disabled: disabled, onClick: () => this.handleSubmitButtonClick(this.inputVal) }, this.getButtonLabel(this.variant)));
|
|
2008
2009
|
}
|
|
2009
2010
|
renderAdditionalDescription() {
|
|
2010
2011
|
const { additionalDescription } = this.formTexts;
|
|
2011
2012
|
if (!additionalDescription)
|
|
2012
2013
|
return;
|
|
2013
|
-
return index.h("span", { class: "body-3"
|
|
2014
|
+
return (index.h("span", { class: "body-3", innerHTML: manageMarkupContent(additionalDescription) }));
|
|
2014
2015
|
}
|
|
2015
2016
|
renderInfoLink() {
|
|
2016
2017
|
const { linkLabel } = this.formTexts;
|
|
2017
2018
|
if (this.variant === LicenseActivationVariantEnum.preview)
|
|
2018
2019
|
return;
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
} }, linkLabel));
|
|
2020
|
+
if (this.variant === LicenseActivationVariantEnum.modal)
|
|
2021
|
+
return (index.h("span", { class: "infobox-content body-4-sb" }, index.h("z-icon", { name: "question-mark" }), " ", linkLabel));
|
|
2022
|
+
return (index.h("button", { class: "z-link z-link-icon z-link-sb", "aria-label": `${linkLabel} clicca per avere maggiori informazioni`, onClick: () => this.handleInfoClick() }, index.h("z-icon", { name: "question-mark" }), linkLabel));
|
|
2023
2023
|
}
|
|
2024
2024
|
renderInfoBox() {
|
|
2025
|
-
if (
|
|
2025
|
+
if (this.variant !== LicenseActivationVariantEnum.modal)
|
|
2026
2026
|
return;
|
|
2027
2027
|
const { infoBoxContent, infoBoxIcon } = this.formTexts;
|
|
2028
|
-
return (index.h("z-info-box", { boxid: "singleInputFormInfoSection", isclosable:
|
|
2029
|
-
}
|
|
2030
|
-
handleInfoBoxClick(e) {
|
|
2031
|
-
const cp = e.composedPath();
|
|
2032
|
-
if (cp.find((elem) => elem.dataset && elem.dataset.action === "infoBoxClose")) {
|
|
2033
|
-
this.showInfoBox = false;
|
|
2034
|
-
}
|
|
2028
|
+
return (index.h("z-info-box", { boxid: "singleInputFormInfoSection", isclosable: false }, index.h("div", { slot: "content" }, infoBoxIcon && (index.h("span", { "aria-hidden": "true" }, index.h("img", { src: infoBoxIcon, alt: "" }))), infoBoxContent && (index.h("span", { innerHTML: manageMarkupContent(infoBoxContent) })))));
|
|
2035
2029
|
}
|
|
2036
2030
|
redirectToSupport() {
|
|
2037
2031
|
const { formTexts } = this;
|
|
@@ -2101,7 +2095,7 @@ const LicenseActivationModal = class {
|
|
|
2101
2095
|
};
|
|
2102
2096
|
LicenseActivationModal.style = licenseActivationModalCss;
|
|
2103
2097
|
|
|
2104
|
-
const stylesCss$
|
|
2098
|
+
const stylesCss$5 = ".sc-z-button-h{display:inline-block;--z-icon-width:16px;--z-icon-height:16px;--z-icon-right-margin:0}[disabled].sc-z-button-h:not([disabled=\"false\"]){pointer-events:none}.sc-z-button-h .z-button--container.sc-z-button{display:inline-flex;width:100%;box-sizing:border-box;align-items:center;justify-content:center;padding:0;border-width:var(--border-size-medium);border-style:solid;border-radius:var(--border-radius);cursor:pointer;fill:currentcolor;font-family:var(--font-family-sans);font-size:14px;font-weight:var(--font-sb);letter-spacing:0.3px;line-height:1;outline:none;text-decoration:none;text-transform:uppercase;white-space:nowrap}.sc-z-button-h .z-button--container.sc-z-button:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-button-h .z-button--container.z-button--has-text.sc-z-button{min-width:calc(var(--space-unit) * 8);padding:0 calc(var(--space-unit) * 2)}.sc-z-button-h .z-button--container.z-button--has-text.sc-z-button z-icon.sc-z-button{--z-icon-right-margin:var(--space-unit)}[size=\"big\"].sc-z-button-h .z-button--container.sc-z-button{min-width:44px;height:44px}[size=\"small\"].sc-z-button-h .z-button--container.sc-z-button{min-width:36px;height:36px}[size=\"x-small\"].sc-z-button-h .z-button--container.sc-z-button{min-width:32px;height:32px}[variant=\"primary\"].sc-z-button-h .z-button--container.sc-z-button{border-color:var(--color-primary01);background-color:var(--color-primary01);color:var(--color-text-inverse)}@media (hover: hover){[variant=\"primary\"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-hover-primary);background-color:var(--color-hover-primary);color:var(--color-text-inverse)}}[variant=\"primary\"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-pressed-primary);background-color:var(--color-pressed-primary);box-shadow:var(--shadow-2);color:var(--color-text-inverse)}[variant=\"primary\"][disabled].sc-z-button-h:not([disabled=\"false\"]) .z-button--container.sc-z-button{border-color:var(--color-disabled01);background-color:var(--color-disabled01);color:var(--color-disabled02)}[variant=\"secondary\"].sc-z-button-h .z-button--container.sc-z-button{border-color:var(--color-primary01);background-color:var(--color-surface01);color:var(--color-primary01)}@media (hover: hover){[variant=\"secondary\"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-hover-primary);background-color:var(--color-surface01);color:var(--color-hover-primary)}}[variant=\"secondary\"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-pressed-primary);background-color:var(--color-surface01);box-shadow:var(--shadow-2);color:var(--color-pressed-primary)}[variant=\"secondary\"][disabled].sc-z-button-h:not([disabled=\"false\"]) .z-button--container.sc-z-button{border-color:var(--color-disabled01);background-color:var(--color-surface01);color:var(--color-disabled02)}[variant=\"tertiary\"].sc-z-button-h .z-button--container.sc-z-button{border-color:var(--color-primary02);background-color:var(--color-primary02);color:var(--color-primary01)}@media (hover: hover){[variant=\"tertiary\"].sc-z-button-h .z-button--container.sc-z-button:hover{border-color:var(--color-primary03);background-color:var(--color-primary03);color:var(--color-hover-primary)}}[variant=\"tertiary\"].sc-z-button-h .z-button--container.sc-z-button:focus:focus-visible{border-color:var(--color-surface01);background-color:var(--color-surface01);color:var(--color-primary01)}[variant=\"tertiary\"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-surface01);background-color:var(--color-surface01);box-shadow:var(--shadow-2);color:var(--color-primary01)}[variant=\"tertiary\"][disabled].sc-z-button-h:not([disabled=\"false\"]) .z-button--container.sc-z-button{border-color:transparent;background-color:transparent;color:var(--color-disabled02)}";
|
|
2105
2099
|
|
|
2106
2100
|
const ZButton = class {
|
|
2107
2101
|
constructor(hostRef) {
|
|
@@ -2115,7 +2109,7 @@ const ZButton = class {
|
|
|
2115
2109
|
/** Graphical variant: `primary`, `secondary`, `tertiary`. Defaults to `primary`. */
|
|
2116
2110
|
this.variant = index$1.ButtonVariant.PRIMARY;
|
|
2117
2111
|
/** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
|
|
2118
|
-
this.size = index$1.
|
|
2112
|
+
this.size = index$1.ControlSize.BIG;
|
|
2119
2113
|
}
|
|
2120
2114
|
getAttributes() {
|
|
2121
2115
|
return {
|
|
@@ -2130,13 +2124,13 @@ const ZButton = class {
|
|
|
2130
2124
|
if (this.href) {
|
|
2131
2125
|
return (index.h("a", Object.assign({}, this.getAttributes(), { "aria-label": this.ariaLabel, href: this.href, target: this.target }), this.icon && (index.h("z-icon", { name: this.icon, width: 16, height: 16 })), index.h("slot", null)));
|
|
2132
2126
|
}
|
|
2133
|
-
return (index.h("button", Object.assign({}, this.getAttributes(), { "aria-label": this.ariaLabel, name: this.name, type: this.type, disabled: this.disabled }), this.icon && (index.h("z-icon", { name: this.icon, width: 16, height: 16 })), index.h("slot", null)));
|
|
2127
|
+
return (index.h("button", Object.assign({}, this.getAttributes(), { "aria-label": this.ariaLabel, name: this.name, type: this.type, role: this.role, disabled: this.disabled }), this.icon && (index.h("z-icon", { name: this.icon, width: 16, height: 16 })), index.h("slot", null)));
|
|
2134
2128
|
}
|
|
2135
2129
|
get hostElement() { return index.getElement(this); }
|
|
2136
2130
|
};
|
|
2137
|
-
ZButton.style = stylesCss$
|
|
2131
|
+
ZButton.style = stylesCss$5;
|
|
2138
2132
|
|
|
2139
|
-
const stylesCss$
|
|
2133
|
+
const stylesCss$4 = ":host{margin-right:var(--z-icon-right-margin, 0);margin-left:var(--z-icon-left-margin, 0);line-height:0;vertical-align:middle}:host svg:not([width]){width:var(--z-icon-width, 18px)}:host svg:not([height]){height:var(--z-icon-height, 18px)}";
|
|
2140
2134
|
|
|
2141
2135
|
const ZIcon = class {
|
|
2142
2136
|
constructor(hostRef) {
|
|
@@ -2152,9 +2146,9 @@ const ZIcon = class {
|
|
|
2152
2146
|
return (index.h(index.Host, { "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 1000 1000", width: this.width, height: this.height, id: this.iconid, fill: this.fill ? `var(--${this.fill})` : "" }, this.selectPathOrPolygon(icons.ICONS[this.name]))));
|
|
2153
2147
|
}
|
|
2154
2148
|
};
|
|
2155
|
-
ZIcon.style = stylesCss$
|
|
2149
|
+
ZIcon.style = stylesCss$4;
|
|
2156
2150
|
|
|
2157
|
-
const stylesCss$
|
|
2151
|
+
const stylesCss$3 = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>div{display:flex;width:inherit;padding:calc(var(--space-unit) * 2);background:var(--color-primary03);border-radius:var(--border-radius)}:host>div>slot{color:var(--color-text01);font-size:14px}:host>div>z-icon{margin-left:calc(var(--space-unit) * 2);cursor:pointer;fill:var(--color-primary01)}";
|
|
2158
2152
|
|
|
2159
2153
|
const ZInfoBox = class {
|
|
2160
2154
|
constructor(hostRef) {
|
|
@@ -2170,9 +2164,9 @@ const ZInfoBox = class {
|
|
|
2170
2164
|
return (index.h("div", { id: this.boxid }, index.h("slot", { name: "content" }), this.isclosable && (index.h("z-icon", { name: "multiply", "data-action": "infoBoxClose", onClick: () => this.emitInfoBoxClose() }))));
|
|
2171
2165
|
}
|
|
2172
2166
|
};
|
|
2173
|
-
ZInfoBox.style = stylesCss$
|
|
2167
|
+
ZInfoBox.style = stylesCss$3;
|
|
2174
2168
|
|
|
2175
|
-
const stylesCss$3 = ".sc-z-input-h{display:inline-block;width:inherit}input.sc-z-input::-ms-clear,input.sc-z-input::-ms-reveal{display:none}.sc-z-input-h input.sc-z-input::-ms-clear,.sc-z-input-h input.sc-z-input::-ms-reveal{display:none}input.sc-z-input,textarea.sc-z-input,.textarea-wrapper.sc-z-input{box-sizing:border-box;border:var(--border-size-small) solid var(--color-surface04);background:var(--color-input-field01);border-radius:var(--border-radius-small);color:var(--color-text01);fill:var(--color-icon02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg);outline:none}.cursor-select.sc-z-input-h input.sc-z-input{cursor:pointer}.sc-z-input-h:not(.active-select) input.sc-z-input:focus:focus-visible,.textarea-wrapper.sc-z-input:focus-within{box-shadow:var(--shadow-focus-primary)}input.sc-z-input:focus:focus-visible,textarea.sc-z-input:focus:focus-visible{color:var(--color-primary02)}.active-select.sc-z-input-h input.sc-z-input{border:var(--border-size-small) solid var(--blue500)}.cursor-select.sc-z-input-h input.sc-z-input:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-input-h input[readonly].sc-z-input:focus:focus-visible{box-shadow:none;pointer-events:none}.filled.sc-z-input{border-color:var(--color-surface05)}.input-success.sc-z-input{border-color:var(--color-success01);background:var(--color-success-inverse);fill:var(--color-success01)}.input-error.sc-z-input{border-color:var(--color-error01);background:var(--color-error-inverse);fill:var(--color-error01)}.input-warning.sc-z-input{border-color:var(--color-warning01);background:var(--color-warning-inverse);fill:var(--color-warning01)}input.sc-z-input:hover,.textarea-wrapper.sc-z-input:hover{outline:var(--border-size-medium) solid var(--color-surface04);outline-offset:-2px}.sc-z-input-h:not(.active-select) input[readonly].sc-z-input,.readonly.sc-z-input{border-color:var(--color-disabled01);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) .textarea-wrapper.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) z-icon.sc-z-input{border-color:var(--color-disabled01);box-shadow:none;color:var(--color-disabled02);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input:hover{border-width:var(--border-size-small)}input.sc-z-input::placeholder,textarea.sc-z-input::placeholder{color:var(--color-text05)}.sc-z-input::-webkit-textarea-placeholder{color:var(--color-text05)}.sc-z-input:-ms-textarea-placeholder{color:var(--color-text05)}.sc-z-input::placeholder{color:var(--color-text05)}label.input-label.sc-z-input{display:block;padding-bottom:var(--space-unit);color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}[disabled].sc-z-input-h:not([disabled=\"false\"]) label.input-label.sc-z-input{color:var(--color-disabled02)}.text-wrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1;fill:var(--color-icon02)}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{width:100%;height:calc(var(--space-unit) * 5.5);box-sizing:border-box;padding:0 calc(var(--space-unit) * 1.5);margin:0}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.sc-z-input,.text-wrapper.sc-z-input>div.sc-z-input>input.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 5.25)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 8)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input{position:absolute;z-index:2;top:50%;right:calc(var(--space-unit) * 1.5);display:flex;pointer-events:none;transform:translateY(-50%)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input{padding:0;border:0;background:none;color:inherit;font:inherit;pointer-events:initial}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input+button.icon-button.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.reset-icon.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.toggle-password-icon.sc-z-input{cursor:pointer}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:hover,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:focus,.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill:active{background:var(--color-white) !important;background-clip:text !important;-webkit-transition-delay:99999s !important}.textarea-wrapper.sc-z-input{padding:calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}textarea.sc-z-input::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-track{background-color:transparent}textarea.sc-z-input::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}textarea.sc-z-input{width:100%;min-height:132px;padding:0;border:none;margin:0;resize:none}.radio-wrapper.sc-z-input,.checkbox-wrapper.sc-z-input{position:relative;display:inline-flex;flex-direction:row;align-items:center;color:var(--color-text01);fill:var(--color-primary01);font-family:var(--font-family-sans)}.radio-wrapper.sc-z-input:hover,.checkbox-wrapper.sc-z-input:hover{color:var(--color-hover-primary);fill:currentcolor}.radio-wrapper.sc-z-input>input.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input{position:absolute;z-index:-1;opacity:0;pointer-events:none}.radio-wrapper.sc-z-input .radio-label.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{display:inline-flex;align-items:center;margin:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1;text-transform:inherit}.radio-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.checkbox-label.sc-z-input{cursor:pointer}.radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{cursor:pointer;fill:inherit}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input{flex-direction:row}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input{flex-direction:row-reverse}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:var(--space-unit)}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:var(--space-unit)}.radio-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkbox-label.sc-z-input>z-icon.sc-z-input{border-radius:var(--border-radius-small);box-shadow:var(--shadow-focus-primary)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input{color:var(--color-disabled02)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input>z-icon.sc-z-input{cursor:default;fill:var(--color-disabled01)}";
|
|
2169
|
+
const stylesCss$2 = ".sc-z-input-h{display:inline-block;width:inherit}input.sc-z-input::-ms-clear,input.sc-z-input::-ms-reveal{display:none}.sc-z-input-h input.sc-z-input::-ms-clear,.sc-z-input-h input.sc-z-input::-ms-reveal{display:none}input.sc-z-input,textarea.sc-z-input,.textarea-wrapper.sc-z-input{box-sizing:border-box;border:var(--border-size-small) solid var(--color-surface04);background:var(--color-input-field01);border-radius:var(--border-radius-small);color:var(--color-text01);fill:var(--color-icon02);font-family:var(--font-family-sans);font-size:var(--font-size-3);font-weight:var(--font-rg);outline:none}[size=\"small\"].sc-z-input-h input.sc-z-input,[size=\"small\"].sc-z-input-h textarea.sc-z-input,[size=\"small\"].sc-z-input-h .textarea-wrapper.sc-z-input,[size=\"x-small\"].sc-z-input-h input.sc-z-input,[size=\"x-small\"].sc-z-input-h textarea.sc-z-input,[size=\"x-small\"].sc-z-input-h .textarea-wrapper.sc-z-input{font-size:var(--font-size-2)}.cursor-select.sc-z-input-h input.sc-z-input{cursor:pointer}.sc-z-input-h:not(.active-select) input.sc-z-input:focus:focus-visible,.textarea-wrapper.sc-z-input:focus-within{box-shadow:var(--shadow-focus-primary)}input.sc-z-input:focus:focus-visible,textarea.sc-z-input:focus:focus-visible{color:var(--color-input-field02)}.active-select.sc-z-input-h input.sc-z-input{border:var(--border-size-small) solid var(--blue500)}.cursor-select.sc-z-input-h input.sc-z-input:focus:focus-visible{box-shadow:var(--shadow-focus-primary)}.sc-z-input-h input[readonly].sc-z-input:focus:focus-visible{box-shadow:none}.filled.sc-z-input{border-color:var(--color-surface05)}.input-success.sc-z-input{border-color:var(--color-success01);background:var(--color-success-inverse);fill:var(--color-success01)}.input-error.sc-z-input{border-color:var(--color-error01);background:var(--color-error-inverse);fill:var(--color-error01)}.input-warning.sc-z-input{border-color:var(--color-warning01);background:var(--color-warning-inverse);fill:var(--color-warning01)}input.sc-z-input:hover,.textarea-wrapper.sc-z-input:hover{outline:var(--border-size-medium) solid var(--color-surface04);outline-offset:-2px}.sc-z-input-h:not(.active-select) input[readonly].sc-z-input,.readonly.sc-z-input{border-color:var(--color-disabled01);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) .textarea-wrapper.sc-z-input,[disabled].sc-z-input-h:not([disabled=\"false\"]) z-icon.sc-z-input{border-color:var(--color-disabled01);box-shadow:none;color:var(--color-disabled02);fill:var(--color-disabled01);pointer-events:none}[disabled].sc-z-input-h:not([disabled=\"false\"]) input.sc-z-input:hover{border-width:var(--border-size-small)}input.sc-z-input::placeholder,textarea.sc-z-input::placeholder{color:var(--color-text05)}.sc-z-input::-webkit-textarea-placeholder{color:var(--color-text05)}.sc-z-input:-ms-textarea-placeholder{color:var(--color-text05)}.sc-z-input::placeholder{color:var(--color-text05)}label.input-label.sc-z-input{display:block;padding-bottom:var(--space-unit);color:var(--color-text02);font-family:var(--font-family-sans);font-size:var(--font-size-1);font-weight:var(--font-sb);text-align:left;text-transform:uppercase}[disabled].sc-z-input-h:not([disabled=\"false\"]) label.input-label.sc-z-input{color:var(--color-disabled02)}.text-wrapper.sc-z-input>div.sc-z-input{position:relative;z-index:1;fill:var(--color-icon02)}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{width:100%;height:calc(var(--space-unit) * 5.5);box-sizing:border-box;padding:0 calc(var(--space-unit) * 1.5);margin:0}[size=\"small\"].sc-z-input-h .text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{height:calc(var(--space-unit) * 4.5)}[size=\"x-small\"].sc-z-input-h .text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input{height:calc(var(--space-unit) * 4)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.sc-z-input,.text-wrapper.sc-z-input>div.sc-z-input>input.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 5.25)}.text-wrapper.sc-z-input>div.sc-z-input>input.has-icon.has-clear-icon.sc-z-input{padding-right:calc(var(--space-unit) * 8)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input{position:absolute;z-index:2;top:50%;right:calc(var(--space-unit) * 1.5);display:flex;pointer-events:none;transform:translateY(-50%)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input{padding:0;border:0;background:none;color:inherit;font:inherit;pointer-events:initial}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input+button.icon-button.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.hidden.sc-z-input{display:none}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.reset-icon.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.toggle-password-icon.sc-z-input{cursor:pointer}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.sc-z-input{--z-icon-width:18px;--z-icon-height:18px;display:block}.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.small.sc-z-input,.text-wrapper.sc-z-input .icons-wrapper.sc-z-input>button.icon-button.sc-z-input>z-icon.x-small.sc-z-input{--z-icon-width:16px;--z-icon-height:16px}.text-wrapper.sc-z-input>div.sc-z-input>input.sc-z-input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #fff inset;-webkit-text-fill-color:currentcolor}.textarea-wrapper.sc-z-input{padding:calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}textarea.sc-z-input::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-track{background-color:transparent}textarea.sc-z-input::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}textarea.sc-z-input::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}textarea.sc-z-input{width:100%;min-height:132px;padding:0;border:none;margin:0;resize:none}.radio-wrapper.sc-z-input,.checkbox-wrapper.sc-z-input{position:relative;display:inline-flex;flex-direction:row;align-items:center;color:var(--color-text01);fill:var(--color-primary01);font-family:var(--font-family-sans)}.radio-wrapper.sc-z-input:hover,.checkbox-wrapper.sc-z-input:hover{color:var(--color-hover-primary);fill:currentcolor}.radio-wrapper.sc-z-input>input.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input{position:absolute;z-index:-1;opacity:0;pointer-events:none}.radio-wrapper.sc-z-input .radio-label.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{display:inline-flex;align-items:center;margin:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1;text-transform:inherit}.radio-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input input.sc-z-input:not(:disabled)+.checkbox-label.sc-z-input{cursor:pointer}.radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{cursor:pointer;fill:inherit}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{--z-icon-width:16px;--z-icon-height:16px}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{font-size:var(--font-size-2)}[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input z-icon.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input z-icon.sc-z-input{--z-icon-width:14px;--z-icon-height:14px}[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.sc-z-input{font-size:var(--font-size-1)}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input{flex-direction:row}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input{flex-direction:row-reverse}.radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:var(--space-unit)}.radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,.checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:var(--space-unit)}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.after.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.after.sc-z-input>span.sc-z-input{margin-left:calc(var(--space-unit) * 0.5)}[size=\"small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,[size=\"small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .radio-wrapper.sc-z-input .radio-label.before.sc-z-input>span.sc-z-input,[size=\"x-small\"].sc-z-input-h .checkbox-wrapper.sc-z-input .checkbox-label.before.sc-z-input>span.sc-z-input{margin-right:calc(var(--space-unit) * 0.5)}.radio-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:focus:focus-visible+.checkbox-label.sc-z-input>z-icon.sc-z-input{border-radius:var(--border-radius-small);box-shadow:var(--shadow-focus-primary)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input{color:var(--color-disabled02)}.radio-wrapper.sc-z-input>input.sc-z-input:disabled+.radio-label.sc-z-input>z-icon.sc-z-input,.checkbox-wrapper.sc-z-input>input.sc-z-input:disabled+.checkbox-label.sc-z-input>z-icon.sc-z-input{cursor:default;fill:var(--color-disabled01)}";
|
|
2176
2170
|
|
|
2177
2171
|
const ZInput = class {
|
|
2178
2172
|
constructor(hostRef) {
|
|
@@ -2199,6 +2193,8 @@ const ZInput = class {
|
|
|
2199
2193
|
this.labelPosition = index$1.LabelPosition.RIGHT;
|
|
2200
2194
|
/** render clear icon when typing (optional): available for text */
|
|
2201
2195
|
this.hasclearicon = true;
|
|
2196
|
+
/** Available sizes: `big`, `small` and `x-small`. Defaults to `big`. */
|
|
2197
|
+
this.size = index$1.ControlSize.BIG;
|
|
2202
2198
|
this.isTyping = false;
|
|
2203
2199
|
this.passwordHidden = true;
|
|
2204
2200
|
this.typingtimeout = 300;
|
|
@@ -2278,6 +2274,8 @@ const ZInput = class {
|
|
|
2278
2274
|
readonly: this.readonly,
|
|
2279
2275
|
required: this.required,
|
|
2280
2276
|
title: this.htmltitle,
|
|
2277
|
+
minlength: this.minlength,
|
|
2278
|
+
maxlength: this.maxlength,
|
|
2281
2279
|
class: {
|
|
2282
2280
|
[`input-${this.status}`]: !!this.status,
|
|
2283
2281
|
filled: !!this.value,
|
|
@@ -2318,7 +2316,7 @@ const ZInput = class {
|
|
|
2318
2316
|
if (this.hasclearicon && type != index$1.InputType.NUMBER) {
|
|
2319
2317
|
Object.assign(attr.class, { "has-clear-icon": true });
|
|
2320
2318
|
}
|
|
2321
|
-
return (index.h("div", { class: "text-wrapper" }, this.renderLabel(), index.h("div", null, index.h("input", Object.assign({ type: type === index$1.InputType.PASSWORD && !this.passwordHidden ? index$1.InputType.TEXT : type }, attr)), this.renderIcons()), this.renderMessage()));
|
|
2319
|
+
return (index.h("div", { class: "text-wrapper" }, this.renderLabel(), index.h("div", null, index.h("input", Object.assign({ type: type === index$1.InputType.PASSWORD && !this.passwordHidden ? index$1.InputType.TEXT : type }, attr, { ref: (el) => (this.inputRef = el) })), this.renderIcons()), this.renderMessage()));
|
|
2322
2320
|
}
|
|
2323
2321
|
renderLabel() {
|
|
2324
2322
|
if (!this.label) {
|
|
@@ -2336,22 +2334,26 @@ const ZInput = class {
|
|
|
2336
2334
|
if (!this.icon) {
|
|
2337
2335
|
return;
|
|
2338
2336
|
}
|
|
2339
|
-
return (index.h("button", { type: "button", class: "icon-button input-icon", tabIndex: -1 }, index.h("z-icon", { name: this.icon })));
|
|
2337
|
+
return (index.h("button", { type: "button", class: "icon-button input-icon", tabIndex: -1, "aria-hidden": "true" }, index.h("z-icon", { name: this.icon, class: this.size })));
|
|
2340
2338
|
}
|
|
2341
2339
|
renderResetIcon() {
|
|
2340
|
+
let hidden = false;
|
|
2342
2341
|
if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == index$1.InputType.NUMBER) {
|
|
2343
|
-
|
|
2342
|
+
hidden = true;
|
|
2344
2343
|
}
|
|
2345
|
-
return (index.h("button", { type: "button", class:
|
|
2344
|
+
return (index.h("button", { type: "button", class: `icon-button reset-icon ${hidden ? "hidden" : ""}`, "aria-label": "cancella il contenuto dell'input", onClick: () => {
|
|
2345
|
+
this.inputRef.value = "";
|
|
2346
|
+
this.emitInputChange("");
|
|
2347
|
+
} }, index.h("z-icon", { name: "multiply", class: this.size })));
|
|
2346
2348
|
}
|
|
2347
2349
|
renderShowHidePassword() {
|
|
2348
|
-
return (index.h("button", { type: "button", class: "icon-button toggle-password-icon", disabled: this.disabled, "aria-label": this.passwordHidden ? "mostra password" : "nascondi password", onClick: () => (this.passwordHidden = !this.passwordHidden) }, index.h("z-icon", { name: this.passwordHidden ? "view-filled" : "view-off-filled" })));
|
|
2350
|
+
return (index.h("button", { type: "button", class: "icon-button toggle-password-icon", disabled: this.disabled, "aria-label": this.passwordHidden ? "mostra password" : "nascondi password", onClick: () => (this.passwordHidden = !this.passwordHidden) }, index.h("z-icon", { name: this.passwordHidden ? "view-filled" : "view-off-filled", class: this.size })));
|
|
2349
2351
|
}
|
|
2350
2352
|
renderMessage() {
|
|
2351
2353
|
if (utils.boolean(this.message) === false) {
|
|
2352
2354
|
return;
|
|
2353
2355
|
}
|
|
2354
|
-
return (index.h("z-input-message", { message: utils.boolean(this.message) === true ? undefined : this.message, status: this.status }));
|
|
2356
|
+
return (index.h("z-input-message", { message: utils.boolean(this.message) === true ? undefined : this.message, status: this.status, class: this.size }));
|
|
2355
2357
|
}
|
|
2356
2358
|
/* END text/password/email/number */
|
|
2357
2359
|
/* START textarea */
|
|
@@ -2371,7 +2373,7 @@ const ZInput = class {
|
|
|
2371
2373
|
"checkbox-label": true,
|
|
2372
2374
|
"after": this.labelPosition === index$1.LabelPosition.RIGHT,
|
|
2373
2375
|
"before": this.labelPosition === index$1.LabelPosition.LEFT,
|
|
2374
|
-
} }, index.h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true" }), this.label && index.h("span", { innerHTML: this.label }))));
|
|
2376
|
+
} }, index.h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true", class: this.size }), this.label && index.h("span", { innerHTML: this.label }))));
|
|
2375
2377
|
}
|
|
2376
2378
|
/* END checkbox */
|
|
2377
2379
|
/* START radio */
|
|
@@ -2380,26 +2382,31 @@ const ZInput = class {
|
|
|
2380
2382
|
"radio-label": true,
|
|
2381
2383
|
"after": this.labelPosition === index$1.LabelPosition.RIGHT,
|
|
2382
2384
|
"before": this.labelPosition === index$1.LabelPosition.LEFT,
|
|
2383
|
-
} }, index.h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true" }), this.label && index.h("span", { innerHTML: this.label }))));
|
|
2385
|
+
} }, index.h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true", class: this.size }), this.label && index.h("span", { innerHTML: this.label }))));
|
|
2384
2386
|
}
|
|
2385
2387
|
/* END radio */
|
|
2386
2388
|
render() {
|
|
2389
|
+
let input;
|
|
2387
2390
|
switch (this.type) {
|
|
2388
2391
|
case index$1.InputType.TEXTAREA:
|
|
2389
|
-
|
|
2392
|
+
input = this.renderTextarea();
|
|
2393
|
+
break;
|
|
2390
2394
|
case index$1.InputType.CHECKBOX:
|
|
2391
|
-
|
|
2395
|
+
input = this.renderCheckbox();
|
|
2396
|
+
break;
|
|
2392
2397
|
case index$1.InputType.RADIO:
|
|
2393
|
-
|
|
2398
|
+
input = this.renderRadio();
|
|
2399
|
+
break;
|
|
2394
2400
|
default:
|
|
2395
|
-
|
|
2401
|
+
input = this.renderInputText(this.type);
|
|
2396
2402
|
}
|
|
2403
|
+
return index.h(index.Host, null, input);
|
|
2397
2404
|
}
|
|
2398
2405
|
get hostElement() { return index.getElement(this); }
|
|
2399
2406
|
};
|
|
2400
|
-
ZInput.style = stylesCss$
|
|
2407
|
+
ZInput.style = stylesCss$2;
|
|
2401
2408
|
|
|
2402
|
-
const stylesCss$
|
|
2409
|
+
const stylesCss$1 = ":host{display:flex;min-height:calc(var(--space-unit) * 2.5);align-items:start;margin-top:var(--space-unit);color:var(--color-text05);fill:currentcolor;font-family:var(--font-family-sans);font-size:var(--font-size-2);letter-spacing:0.16px}:host(.small),:host(.x-small){margin-top:calc(var(--space-unit) * 0.5);font-size:var(--font-size-1)}:host([status=\"success\"]){color:var(--color-text-success)}:host([status=\"error\"]){color:var(--color-text-error)}:host([status=\"warning\"]){color:var(--color-warning02)}:host(:focus){outline:none}:host>z-icon{--z-icon-width:calc(var(--space-unit) * 2);--z-icon-height:calc(var(--space-unit) * 2);--z-icon-right-margin:var(--space-unit);margin-top:calc(var(--space-unit) * 0.25)}:host(.small)>z-icon,:host(.x-small)>z-icon{--z-icon-width:14px;--z-icon-height:14px;--z-icon-right-margin:calc(var(--space-unit) * 0.5)}";
|
|
2403
2410
|
|
|
2404
2411
|
const ZInputMessage = class {
|
|
2405
2412
|
constructor(hostRef) {
|
|
@@ -2425,76 +2432,866 @@ const ZInputMessage = class {
|
|
|
2425
2432
|
"status": ["onMessageChange"]
|
|
2426
2433
|
}; }
|
|
2427
2434
|
};
|
|
2428
|
-
ZInputMessage.style = stylesCss$
|
|
2435
|
+
ZInputMessage.style = stylesCss$1;
|
|
2436
|
+
|
|
2437
|
+
// nb. This is for IE10 and lower _only_.
|
|
2438
|
+
var supportCustomEvent = window.CustomEvent;
|
|
2439
|
+
if (!supportCustomEvent || typeof supportCustomEvent === 'object') {
|
|
2440
|
+
supportCustomEvent = function CustomEvent(event, x) {
|
|
2441
|
+
x = x || {};
|
|
2442
|
+
var ev = document.createEvent('CustomEvent');
|
|
2443
|
+
ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);
|
|
2444
|
+
return ev;
|
|
2445
|
+
};
|
|
2446
|
+
supportCustomEvent.prototype = window.Event.prototype;
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
/**
|
|
2450
|
+
* Dispatches the passed event to both an "on<type>" handler as well as via the
|
|
2451
|
+
* normal dispatch operation. Does not bubble.
|
|
2452
|
+
*
|
|
2453
|
+
* @param {!EventTarget} target
|
|
2454
|
+
* @param {!Event} event
|
|
2455
|
+
* @return {boolean}
|
|
2456
|
+
*/
|
|
2457
|
+
function safeDispatchEvent(target, event) {
|
|
2458
|
+
var check = 'on' + event.type.toLowerCase();
|
|
2459
|
+
if (typeof target[check] === 'function') {
|
|
2460
|
+
target[check](event);
|
|
2461
|
+
}
|
|
2462
|
+
return target.dispatchEvent(event);
|
|
2463
|
+
}
|
|
2429
2464
|
|
|
2430
|
-
|
|
2465
|
+
/**
|
|
2466
|
+
* @param {Element} el to check for stacking context
|
|
2467
|
+
* @return {boolean} whether this el or its parents creates a stacking context
|
|
2468
|
+
*/
|
|
2469
|
+
function createsStackingContext(el) {
|
|
2470
|
+
while (el && el !== document.body) {
|
|
2471
|
+
var s = window.getComputedStyle(el);
|
|
2472
|
+
var invalid = function(k, ok) {
|
|
2473
|
+
return !(s[k] === undefined || s[k] === ok);
|
|
2474
|
+
};
|
|
2431
2475
|
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
/** white variant flag (optional) */
|
|
2445
|
-
this.iswhite = false;
|
|
2446
|
-
/** link text variant (optional) */
|
|
2447
|
-
this.textcolor = "primary";
|
|
2448
|
-
/** big link version */
|
|
2449
|
-
this.big = false;
|
|
2450
|
-
/** link icon position (optional) */
|
|
2451
|
-
this.iconposition = "left";
|
|
2452
|
-
/** draw underline on text (optional) */
|
|
2453
|
-
this.underline = false;
|
|
2454
|
-
this.iconSize = 18;
|
|
2455
|
-
this.emitZLinkClick = this.emitZLinkClick.bind(this);
|
|
2456
|
-
this.emitZLinkInteraction = this.emitZLinkInteraction.bind(this);
|
|
2476
|
+
if (s.opacity < 1 ||
|
|
2477
|
+
invalid('zIndex', 'auto') ||
|
|
2478
|
+
invalid('transform', 'none') ||
|
|
2479
|
+
invalid('mixBlendMode', 'normal') ||
|
|
2480
|
+
invalid('filter', 'none') ||
|
|
2481
|
+
invalid('perspective', 'none') ||
|
|
2482
|
+
s['isolation'] === 'isolate' ||
|
|
2483
|
+
s.position === 'fixed' ||
|
|
2484
|
+
s.webkitOverflowScrolling === 'touch') {
|
|
2485
|
+
return true;
|
|
2486
|
+
}
|
|
2487
|
+
el = el.parentElement;
|
|
2457
2488
|
}
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2489
|
+
return false;
|
|
2490
|
+
}
|
|
2491
|
+
|
|
2492
|
+
/**
|
|
2493
|
+
* Finds the nearest <dialog> from the passed element.
|
|
2494
|
+
*
|
|
2495
|
+
* @param {Element} el to search from
|
|
2496
|
+
* @return {HTMLDialogElement} dialog found
|
|
2497
|
+
*/
|
|
2498
|
+
function findNearestDialog(el) {
|
|
2499
|
+
while (el) {
|
|
2500
|
+
if (el.localName === 'dialog') {
|
|
2501
|
+
return /** @type {HTMLDialogElement} */ (el);
|
|
2461
2502
|
}
|
|
2462
|
-
if (
|
|
2463
|
-
|
|
2503
|
+
if (el.parentElement) {
|
|
2504
|
+
el = el.parentElement;
|
|
2505
|
+
} else if (el.parentNode) {
|
|
2506
|
+
el = el.parentNode.host;
|
|
2507
|
+
} else {
|
|
2508
|
+
el = null;
|
|
2464
2509
|
}
|
|
2465
2510
|
}
|
|
2466
|
-
|
|
2467
|
-
|
|
2511
|
+
return null;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
/**
|
|
2515
|
+
* Blur the specified element, as long as it's not the HTML body element.
|
|
2516
|
+
* This works around an IE9/10 bug - blurring the body causes Windows to
|
|
2517
|
+
* blur the whole application.
|
|
2518
|
+
*
|
|
2519
|
+
* @param {Element} el to blur
|
|
2520
|
+
*/
|
|
2521
|
+
function safeBlur(el) {
|
|
2522
|
+
// Find the actual focused element when the active element is inside a shadow root
|
|
2523
|
+
while (el && el.shadowRoot && el.shadowRoot.activeElement) {
|
|
2524
|
+
el = el.shadowRoot.activeElement;
|
|
2468
2525
|
}
|
|
2469
|
-
|
|
2470
|
-
|
|
2526
|
+
|
|
2527
|
+
if (el && el.blur && el !== document.body) {
|
|
2528
|
+
el.blur();
|
|
2471
2529
|
}
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
/**
|
|
2533
|
+
* @param {!NodeList} nodeList to search
|
|
2534
|
+
* @param {Node} node to find
|
|
2535
|
+
* @return {boolean} whether node is inside nodeList
|
|
2536
|
+
*/
|
|
2537
|
+
function inNodeList(nodeList, node) {
|
|
2538
|
+
for (var i = 0; i < nodeList.length; ++i) {
|
|
2539
|
+
if (nodeList[i] === node) {
|
|
2540
|
+
return true;
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
return false;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
/**
|
|
2547
|
+
* @param {HTMLFormElement} el to check
|
|
2548
|
+
* @return {boolean} whether this form has method="dialog"
|
|
2549
|
+
*/
|
|
2550
|
+
function isFormMethodDialog(el) {
|
|
2551
|
+
if (!el || !el.hasAttribute('method')) {
|
|
2552
|
+
return false;
|
|
2553
|
+
}
|
|
2554
|
+
return el.getAttribute('method').toLowerCase() === 'dialog';
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
/**
|
|
2558
|
+
* @param {!DocumentFragment|!Element} hostElement
|
|
2559
|
+
* @return {?Element}
|
|
2560
|
+
*/
|
|
2561
|
+
function findFocusableElementWithin(hostElement) {
|
|
2562
|
+
// Note that this is 'any focusable area'. This list is probably not exhaustive, but the
|
|
2563
|
+
// alternative involves stepping through and trying to focus everything.
|
|
2564
|
+
var opts = ['button', 'input', 'keygen', 'select', 'textarea'];
|
|
2565
|
+
var query = opts.map(function(el) {
|
|
2566
|
+
return el + ':not([disabled])';
|
|
2567
|
+
});
|
|
2568
|
+
// TODO(samthor): tabindex values that are not numeric are not focusable.
|
|
2569
|
+
query.push('[tabindex]:not([disabled]):not([tabindex=""])'); // tabindex != "", not disabled
|
|
2570
|
+
var target = hostElement.querySelector(query.join(', '));
|
|
2571
|
+
|
|
2572
|
+
if (!target && 'attachShadow' in Element.prototype) {
|
|
2573
|
+
// If we haven't found a focusable target, see if the host element contains an element
|
|
2574
|
+
// which has a shadowRoot.
|
|
2575
|
+
// Recursively search for the first focusable item in shadow roots.
|
|
2576
|
+
var elems = hostElement.querySelectorAll('*');
|
|
2577
|
+
for (var i = 0; i < elems.length; i++) {
|
|
2578
|
+
if (elems[i].tagName && elems[i].shadowRoot) {
|
|
2579
|
+
target = findFocusableElementWithin(elems[i].shadowRoot);
|
|
2580
|
+
if (target) {
|
|
2581
|
+
break;
|
|
2582
|
+
}
|
|
2478
2583
|
}
|
|
2479
2584
|
}
|
|
2480
2585
|
}
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2586
|
+
return target;
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
/**
|
|
2590
|
+
* Determines if an element is attached to the DOM.
|
|
2591
|
+
* @param {Element} element to check
|
|
2592
|
+
* @return {boolean} whether the element is in DOM
|
|
2593
|
+
*/
|
|
2594
|
+
function isConnected(element) {
|
|
2595
|
+
return element.isConnected || document.body.contains(element);
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
/**
|
|
2599
|
+
* @param {!Event} event
|
|
2600
|
+
* @return {?Element}
|
|
2601
|
+
*/
|
|
2602
|
+
function findFormSubmitter(event) {
|
|
2603
|
+
if (event.submitter) {
|
|
2604
|
+
return event.submitter;
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2607
|
+
var form = event.target;
|
|
2608
|
+
if (!(form instanceof HTMLFormElement)) {
|
|
2609
|
+
return null;
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
var submitter = dialogPolyfill.formSubmitter;
|
|
2613
|
+
if (!submitter) {
|
|
2614
|
+
var target = event.target;
|
|
2615
|
+
var root = ('getRootNode' in target && target.getRootNode() || document);
|
|
2616
|
+
submitter = root.activeElement;
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
if (!submitter || submitter.form !== form) {
|
|
2620
|
+
return null;
|
|
2621
|
+
}
|
|
2622
|
+
return submitter;
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
/**
|
|
2626
|
+
* @param {!Event} event
|
|
2627
|
+
*/
|
|
2628
|
+
function maybeHandleSubmit(event) {
|
|
2629
|
+
if (event.defaultPrevented) {
|
|
2630
|
+
return;
|
|
2631
|
+
}
|
|
2632
|
+
var form = /** @type {!HTMLFormElement} */ (event.target);
|
|
2633
|
+
|
|
2634
|
+
// We'd have a value if we clicked on an imagemap.
|
|
2635
|
+
var value = dialogPolyfill.imagemapUseValue;
|
|
2636
|
+
var submitter = findFormSubmitter(event);
|
|
2637
|
+
if (value === null && submitter) {
|
|
2638
|
+
value = submitter.value;
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
// There should always be a dialog as this handler is added specifically on them, but check just
|
|
2642
|
+
// in case.
|
|
2643
|
+
var dialog = findNearestDialog(form);
|
|
2644
|
+
if (!dialog) {
|
|
2645
|
+
return;
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
// Prefer formmethod on the button.
|
|
2649
|
+
var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');
|
|
2650
|
+
if (formmethod !== 'dialog') {
|
|
2651
|
+
return;
|
|
2652
|
+
}
|
|
2653
|
+
event.preventDefault();
|
|
2654
|
+
|
|
2655
|
+
if (value != null) {
|
|
2656
|
+
// nb. we explicitly check against null/undefined
|
|
2657
|
+
dialog.close(value);
|
|
2658
|
+
} else {
|
|
2659
|
+
dialog.close();
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
/**
|
|
2664
|
+
* @param {!HTMLDialogElement} dialog to upgrade
|
|
2665
|
+
* @constructor
|
|
2666
|
+
*/
|
|
2667
|
+
function dialogPolyfillInfo(dialog) {
|
|
2668
|
+
this.dialog_ = dialog;
|
|
2669
|
+
this.replacedStyleTop_ = false;
|
|
2670
|
+
this.openAsModal_ = false;
|
|
2671
|
+
|
|
2672
|
+
// Set a11y role. Browsers that support dialog implicitly know this already.
|
|
2673
|
+
if (!dialog.hasAttribute('role')) {
|
|
2674
|
+
dialog.setAttribute('role', 'dialog');
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
dialog.show = this.show.bind(this);
|
|
2678
|
+
dialog.showModal = this.showModal.bind(this);
|
|
2679
|
+
dialog.close = this.close.bind(this);
|
|
2680
|
+
|
|
2681
|
+
dialog.addEventListener('submit', maybeHandleSubmit, false);
|
|
2682
|
+
|
|
2683
|
+
if (!('returnValue' in dialog)) {
|
|
2684
|
+
dialog.returnValue = '';
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
if ('MutationObserver' in window) {
|
|
2688
|
+
var mo = new MutationObserver(this.maybeHideModal.bind(this));
|
|
2689
|
+
mo.observe(dialog, {attributes: true, attributeFilter: ['open']});
|
|
2690
|
+
} else {
|
|
2691
|
+
// IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also
|
|
2692
|
+
// seem to fire even if the element was removed as part of a parent removal. Use the removed
|
|
2693
|
+
// events to force downgrade (useful if removed/immediately added).
|
|
2694
|
+
var removed = false;
|
|
2695
|
+
var cb = function() {
|
|
2696
|
+
removed ? this.downgradeModal() : this.maybeHideModal();
|
|
2697
|
+
removed = false;
|
|
2698
|
+
}.bind(this);
|
|
2699
|
+
var timeout;
|
|
2700
|
+
var delayModel = function(ev) {
|
|
2701
|
+
if (ev.target !== dialog) { return; } // not for a child element
|
|
2702
|
+
var cand = 'DOMNodeRemoved';
|
|
2703
|
+
removed |= (ev.type.substr(0, cand.length) === cand);
|
|
2704
|
+
window.clearTimeout(timeout);
|
|
2705
|
+
timeout = window.setTimeout(cb, 0);
|
|
2706
|
+
};
|
|
2707
|
+
['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {
|
|
2708
|
+
dialog.addEventListener(name, delayModel);
|
|
2709
|
+
});
|
|
2710
|
+
}
|
|
2711
|
+
// Note that the DOM is observed inside DialogManager while any dialog
|
|
2712
|
+
// is being displayed as a modal, to catch modal removal from the DOM.
|
|
2713
|
+
|
|
2714
|
+
Object.defineProperty(dialog, 'open', {
|
|
2715
|
+
set: this.setOpen.bind(this),
|
|
2716
|
+
get: dialog.hasAttribute.bind(dialog, 'open')
|
|
2717
|
+
});
|
|
2718
|
+
|
|
2719
|
+
this.backdrop_ = document.createElement('div');
|
|
2720
|
+
this.backdrop_.className = 'backdrop';
|
|
2721
|
+
this.backdrop_.addEventListener('mouseup' , this.backdropMouseEvent_.bind(this));
|
|
2722
|
+
this.backdrop_.addEventListener('mousedown', this.backdropMouseEvent_.bind(this));
|
|
2723
|
+
this.backdrop_.addEventListener('click' , this.backdropMouseEvent_.bind(this));
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
dialogPolyfillInfo.prototype = /** @type {HTMLDialogElement.prototype} */ ({
|
|
2727
|
+
|
|
2728
|
+
get dialog() {
|
|
2729
|
+
return this.dialog_;
|
|
2730
|
+
},
|
|
2731
|
+
|
|
2732
|
+
/**
|
|
2733
|
+
* Maybe remove this dialog from the modal top layer. This is called when
|
|
2734
|
+
* a modal dialog may no longer be tenable, e.g., when the dialog is no
|
|
2735
|
+
* longer open or is no longer part of the DOM.
|
|
2736
|
+
*/
|
|
2737
|
+
maybeHideModal: function() {
|
|
2738
|
+
if (this.dialog_.hasAttribute('open') && isConnected(this.dialog_)) { return; }
|
|
2739
|
+
this.downgradeModal();
|
|
2740
|
+
},
|
|
2741
|
+
|
|
2742
|
+
/**
|
|
2743
|
+
* Remove this dialog from the modal top layer, leaving it as a non-modal.
|
|
2744
|
+
*/
|
|
2745
|
+
downgradeModal: function() {
|
|
2746
|
+
if (!this.openAsModal_) { return; }
|
|
2747
|
+
this.openAsModal_ = false;
|
|
2748
|
+
this.dialog_.style.zIndex = '';
|
|
2749
|
+
|
|
2750
|
+
// This won't match the native <dialog> exactly because if the user set top on a centered
|
|
2751
|
+
// polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's
|
|
2752
|
+
// possible to polyfill this perfectly.
|
|
2753
|
+
if (this.replacedStyleTop_) {
|
|
2754
|
+
this.dialog_.style.top = '';
|
|
2755
|
+
this.replacedStyleTop_ = false;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
// Clear the backdrop and remove from the manager.
|
|
2759
|
+
this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);
|
|
2760
|
+
dialogPolyfill.dm.removeDialog(this);
|
|
2761
|
+
},
|
|
2762
|
+
|
|
2763
|
+
/**
|
|
2764
|
+
* @param {boolean} value whether to open or close this dialog
|
|
2765
|
+
*/
|
|
2766
|
+
setOpen: function(value) {
|
|
2767
|
+
if (value) {
|
|
2768
|
+
this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');
|
|
2769
|
+
} else {
|
|
2770
|
+
this.dialog_.removeAttribute('open');
|
|
2771
|
+
this.maybeHideModal(); // nb. redundant with MutationObserver
|
|
2772
|
+
}
|
|
2773
|
+
},
|
|
2774
|
+
|
|
2775
|
+
/**
|
|
2776
|
+
* Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if
|
|
2777
|
+
* they were on the dialog itself.
|
|
2778
|
+
*
|
|
2779
|
+
* @param {!Event} e to redirect
|
|
2780
|
+
*/
|
|
2781
|
+
backdropMouseEvent_: function(e) {
|
|
2782
|
+
if (!this.dialog_.hasAttribute('tabindex')) {
|
|
2783
|
+
// Clicking on the backdrop should move the implicit cursor, even if dialog cannot be
|
|
2784
|
+
// focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this
|
|
2785
|
+
// would not be needed - clicks would move the implicit cursor there.
|
|
2786
|
+
var fake = document.createElement('div');
|
|
2787
|
+
this.dialog_.insertBefore(fake, this.dialog_.firstChild);
|
|
2788
|
+
fake.tabIndex = -1;
|
|
2789
|
+
fake.focus();
|
|
2790
|
+
this.dialog_.removeChild(fake);
|
|
2791
|
+
} else {
|
|
2792
|
+
this.dialog_.focus();
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
var redirectedEvent = document.createEvent('MouseEvents');
|
|
2796
|
+
redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,
|
|
2797
|
+
e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,
|
|
2798
|
+
e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);
|
|
2799
|
+
this.dialog_.dispatchEvent(redirectedEvent);
|
|
2800
|
+
e.stopPropagation();
|
|
2801
|
+
},
|
|
2802
|
+
|
|
2803
|
+
/**
|
|
2804
|
+
* Focuses on the first focusable element within the dialog. This will always blur the current
|
|
2805
|
+
* focus, even if nothing within the dialog is found.
|
|
2806
|
+
*/
|
|
2807
|
+
focus_: function() {
|
|
2808
|
+
// Find element with `autofocus` attribute, or fall back to the first form/tabindex control.
|
|
2809
|
+
var target = this.dialog_.querySelector('[autofocus]:not([disabled])');
|
|
2810
|
+
if (!target && this.dialog_.tabIndex >= 0) {
|
|
2811
|
+
target = this.dialog_;
|
|
2812
|
+
}
|
|
2813
|
+
if (!target) {
|
|
2814
|
+
target = findFocusableElementWithin(this.dialog_);
|
|
2815
|
+
}
|
|
2816
|
+
safeBlur(document.activeElement);
|
|
2817
|
+
target && target.focus();
|
|
2818
|
+
},
|
|
2819
|
+
|
|
2820
|
+
/**
|
|
2821
|
+
* Sets the zIndex for the backdrop and dialog.
|
|
2822
|
+
*
|
|
2823
|
+
* @param {number} dialogZ
|
|
2824
|
+
* @param {number} backdropZ
|
|
2825
|
+
*/
|
|
2826
|
+
updateZIndex: function(dialogZ, backdropZ) {
|
|
2827
|
+
if (dialogZ < backdropZ) {
|
|
2828
|
+
throw new Error('dialogZ should never be < backdropZ');
|
|
2829
|
+
}
|
|
2830
|
+
this.dialog_.style.zIndex = dialogZ;
|
|
2831
|
+
this.backdrop_.style.zIndex = backdropZ;
|
|
2832
|
+
},
|
|
2833
|
+
|
|
2834
|
+
/**
|
|
2835
|
+
* Shows the dialog. If the dialog is already open, this does nothing.
|
|
2836
|
+
*/
|
|
2837
|
+
show: function() {
|
|
2838
|
+
if (!this.dialog_.open) {
|
|
2839
|
+
this.setOpen(true);
|
|
2840
|
+
this.focus_();
|
|
2841
|
+
}
|
|
2842
|
+
},
|
|
2843
|
+
|
|
2844
|
+
/**
|
|
2845
|
+
* Show this dialog modally.
|
|
2846
|
+
*/
|
|
2847
|
+
showModal: function() {
|
|
2848
|
+
if (this.dialog_.hasAttribute('open')) {
|
|
2849
|
+
throw new Error('Failed to execute \'showModal\' on dialog: The element is already open, and therefore cannot be opened modally.');
|
|
2850
|
+
}
|
|
2851
|
+
if (!isConnected(this.dialog_)) {
|
|
2852
|
+
throw new Error('Failed to execute \'showModal\' on dialog: The element is not in a Document.');
|
|
2853
|
+
}
|
|
2854
|
+
if (!dialogPolyfill.dm.pushDialog(this)) {
|
|
2855
|
+
throw new Error('Failed to execute \'showModal\' on dialog: There are too many open modal dialogs.');
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
if (createsStackingContext(this.dialog_.parentElement)) {
|
|
2859
|
+
console.warn('A dialog is being shown inside a stacking context. ' +
|
|
2860
|
+
'This may cause it to be unusable. For more information, see this link: ' +
|
|
2861
|
+
'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
this.setOpen(true);
|
|
2865
|
+
this.openAsModal_ = true;
|
|
2866
|
+
|
|
2867
|
+
// Optionally center vertically, relative to the current viewport.
|
|
2868
|
+
if (dialogPolyfill.needsCentering(this.dialog_)) {
|
|
2869
|
+
dialogPolyfill.reposition(this.dialog_);
|
|
2870
|
+
this.replacedStyleTop_ = true;
|
|
2871
|
+
} else {
|
|
2872
|
+
this.replacedStyleTop_ = false;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
// Insert backdrop.
|
|
2876
|
+
this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);
|
|
2877
|
+
|
|
2878
|
+
// Focus on whatever inside the dialog.
|
|
2879
|
+
this.focus_();
|
|
2880
|
+
},
|
|
2881
|
+
|
|
2882
|
+
/**
|
|
2883
|
+
* Closes this HTMLDialogElement. This is optional vs clearing the open
|
|
2884
|
+
* attribute, however this fires a 'close' event.
|
|
2885
|
+
*
|
|
2886
|
+
* @param {string=} opt_returnValue to use as the returnValue
|
|
2887
|
+
*/
|
|
2888
|
+
close: function(opt_returnValue) {
|
|
2889
|
+
if (!this.dialog_.hasAttribute('open')) {
|
|
2890
|
+
throw new Error('Failed to execute \'close\' on dialog: The element does not have an \'open\' attribute, and therefore cannot be closed.');
|
|
2891
|
+
}
|
|
2892
|
+
this.setOpen(false);
|
|
2893
|
+
|
|
2894
|
+
// Leave returnValue untouched in case it was set directly on the element
|
|
2895
|
+
if (opt_returnValue !== undefined) {
|
|
2896
|
+
this.dialog_.returnValue = opt_returnValue;
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
// Triggering "close" event for any attached listeners on the <dialog>.
|
|
2900
|
+
var closeEvent = new supportCustomEvent('close', {
|
|
2901
|
+
bubbles: false,
|
|
2902
|
+
cancelable: false
|
|
2903
|
+
});
|
|
2904
|
+
safeDispatchEvent(this.dialog_, closeEvent);
|
|
2905
|
+
}
|
|
2906
|
+
|
|
2907
|
+
});
|
|
2908
|
+
|
|
2909
|
+
var dialogPolyfill = {};
|
|
2910
|
+
|
|
2911
|
+
dialogPolyfill.reposition = function(element) {
|
|
2912
|
+
var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
|
|
2913
|
+
var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;
|
|
2914
|
+
element.style.top = Math.max(scrollTop, topValue) + 'px';
|
|
2915
|
+
};
|
|
2916
|
+
|
|
2917
|
+
dialogPolyfill.isInlinePositionSetByStylesheet = function(element) {
|
|
2918
|
+
for (var i = 0; i < document.styleSheets.length; ++i) {
|
|
2919
|
+
var styleSheet = document.styleSheets[i];
|
|
2920
|
+
var cssRules = null;
|
|
2921
|
+
// Some browsers throw on cssRules.
|
|
2922
|
+
try {
|
|
2923
|
+
cssRules = styleSheet.cssRules;
|
|
2924
|
+
} catch (e) {}
|
|
2925
|
+
if (!cssRules) { continue; }
|
|
2926
|
+
for (var j = 0; j < cssRules.length; ++j) {
|
|
2927
|
+
var rule = cssRules[j];
|
|
2928
|
+
var selectedNodes = null;
|
|
2929
|
+
// Ignore errors on invalid selector texts.
|
|
2930
|
+
try {
|
|
2931
|
+
selectedNodes = document.querySelectorAll(rule.selectorText);
|
|
2932
|
+
} catch(e) {}
|
|
2933
|
+
if (!selectedNodes || !inNodeList(selectedNodes, element)) {
|
|
2934
|
+
continue;
|
|
2935
|
+
}
|
|
2936
|
+
var cssTop = rule.style.getPropertyValue('top');
|
|
2937
|
+
var cssBottom = rule.style.getPropertyValue('bottom');
|
|
2938
|
+
if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {
|
|
2939
|
+
return true;
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
return false;
|
|
2944
|
+
};
|
|
2945
|
+
|
|
2946
|
+
dialogPolyfill.needsCentering = function(dialog) {
|
|
2947
|
+
var computedStyle = window.getComputedStyle(dialog);
|
|
2948
|
+
if (computedStyle.position !== 'absolute') {
|
|
2949
|
+
return false;
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
// We must determine whether the top/bottom specified value is non-auto. In
|
|
2953
|
+
// WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but
|
|
2954
|
+
// Firefox returns the used value. So we do this crazy thing instead: check
|
|
2955
|
+
// the inline style and then go through CSS rules.
|
|
2956
|
+
if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||
|
|
2957
|
+
(dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {
|
|
2958
|
+
return false;
|
|
2959
|
+
}
|
|
2960
|
+
return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);
|
|
2961
|
+
};
|
|
2962
|
+
|
|
2963
|
+
/**
|
|
2964
|
+
* @param {!Element} element to force upgrade
|
|
2965
|
+
*/
|
|
2966
|
+
dialogPolyfill.forceRegisterDialog = function(element) {
|
|
2967
|
+
if (window.HTMLDialogElement || element.showModal) {
|
|
2968
|
+
console.warn('This browser already supports <dialog>, the polyfill ' +
|
|
2969
|
+
'may not work correctly', element);
|
|
2970
|
+
}
|
|
2971
|
+
if (element.localName !== 'dialog') {
|
|
2972
|
+
throw new Error('Failed to register dialog: The element is not a dialog.');
|
|
2973
|
+
}
|
|
2974
|
+
new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));
|
|
2975
|
+
};
|
|
2976
|
+
|
|
2977
|
+
/**
|
|
2978
|
+
* @param {!Element} element to upgrade, if necessary
|
|
2979
|
+
*/
|
|
2980
|
+
dialogPolyfill.registerDialog = function(element) {
|
|
2981
|
+
if (!element.showModal) {
|
|
2982
|
+
dialogPolyfill.forceRegisterDialog(element);
|
|
2492
2983
|
}
|
|
2493
|
-
get hostElement() { return index.getElement(this); }
|
|
2494
2984
|
};
|
|
2495
|
-
ZLink.style = stylesCss$1;
|
|
2496
2985
|
|
|
2497
|
-
|
|
2986
|
+
/**
|
|
2987
|
+
* @constructor
|
|
2988
|
+
*/
|
|
2989
|
+
dialogPolyfill.DialogManager = function() {
|
|
2990
|
+
/** @type {!Array<!dialogPolyfillInfo>} */
|
|
2991
|
+
this.pendingDialogStack = [];
|
|
2992
|
+
|
|
2993
|
+
var checkDOM = this.checkDOM_.bind(this);
|
|
2994
|
+
|
|
2995
|
+
// The overlay is used to simulate how a modal dialog blocks the document.
|
|
2996
|
+
// The blocking dialog is positioned on top of the overlay, and the rest of
|
|
2997
|
+
// the dialogs on the pending dialog stack are positioned below it. In the
|
|
2998
|
+
// actual implementation, the modal dialog stacking is controlled by the
|
|
2999
|
+
// top layer, where z-index has no effect.
|
|
3000
|
+
this.overlay = document.createElement('div');
|
|
3001
|
+
this.overlay.className = '_dialog_overlay';
|
|
3002
|
+
this.overlay.addEventListener('click', function(e) {
|
|
3003
|
+
this.forwardTab_ = undefined;
|
|
3004
|
+
e.stopPropagation();
|
|
3005
|
+
checkDOM([]); // sanity-check DOM
|
|
3006
|
+
}.bind(this));
|
|
3007
|
+
|
|
3008
|
+
this.handleKey_ = this.handleKey_.bind(this);
|
|
3009
|
+
this.handleFocus_ = this.handleFocus_.bind(this);
|
|
3010
|
+
|
|
3011
|
+
this.zIndexLow_ = 100000;
|
|
3012
|
+
this.zIndexHigh_ = 100000 + 150;
|
|
3013
|
+
|
|
3014
|
+
this.forwardTab_ = undefined;
|
|
3015
|
+
|
|
3016
|
+
if ('MutationObserver' in window) {
|
|
3017
|
+
this.mo_ = new MutationObserver(function(records) {
|
|
3018
|
+
var removed = [];
|
|
3019
|
+
records.forEach(function(rec) {
|
|
3020
|
+
for (var i = 0, c; c = rec.removedNodes[i]; ++i) {
|
|
3021
|
+
if (!(c instanceof Element)) {
|
|
3022
|
+
continue;
|
|
3023
|
+
} else if (c.localName === 'dialog') {
|
|
3024
|
+
removed.push(c);
|
|
3025
|
+
}
|
|
3026
|
+
removed = removed.concat(c.querySelectorAll('dialog'));
|
|
3027
|
+
}
|
|
3028
|
+
});
|
|
3029
|
+
removed.length && checkDOM(removed);
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
};
|
|
3033
|
+
|
|
3034
|
+
/**
|
|
3035
|
+
* Called on the first modal dialog being shown. Adds the overlay and related
|
|
3036
|
+
* handlers.
|
|
3037
|
+
*/
|
|
3038
|
+
dialogPolyfill.DialogManager.prototype.blockDocument = function() {
|
|
3039
|
+
document.documentElement.addEventListener('focus', this.handleFocus_, true);
|
|
3040
|
+
document.addEventListener('keydown', this.handleKey_);
|
|
3041
|
+
this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});
|
|
3042
|
+
};
|
|
3043
|
+
|
|
3044
|
+
/**
|
|
3045
|
+
* Called on the first modal dialog being removed, i.e., when no more modal
|
|
3046
|
+
* dialogs are visible.
|
|
3047
|
+
*/
|
|
3048
|
+
dialogPolyfill.DialogManager.prototype.unblockDocument = function() {
|
|
3049
|
+
document.documentElement.removeEventListener('focus', this.handleFocus_, true);
|
|
3050
|
+
document.removeEventListener('keydown', this.handleKey_);
|
|
3051
|
+
this.mo_ && this.mo_.disconnect();
|
|
3052
|
+
};
|
|
3053
|
+
|
|
3054
|
+
/**
|
|
3055
|
+
* Updates the stacking of all known dialogs.
|
|
3056
|
+
*/
|
|
3057
|
+
dialogPolyfill.DialogManager.prototype.updateStacking = function() {
|
|
3058
|
+
var zIndex = this.zIndexHigh_;
|
|
3059
|
+
|
|
3060
|
+
for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {
|
|
3061
|
+
dpi.updateZIndex(--zIndex, --zIndex);
|
|
3062
|
+
if (i === 0) {
|
|
3063
|
+
this.overlay.style.zIndex = --zIndex;
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
// Make the overlay a sibling of the dialog itself.
|
|
3068
|
+
var last = this.pendingDialogStack[0];
|
|
3069
|
+
if (last) {
|
|
3070
|
+
var p = last.dialog.parentNode || document.body;
|
|
3071
|
+
p.appendChild(this.overlay);
|
|
3072
|
+
} else if (this.overlay.parentNode) {
|
|
3073
|
+
this.overlay.parentNode.removeChild(this.overlay);
|
|
3074
|
+
}
|
|
3075
|
+
};
|
|
3076
|
+
|
|
3077
|
+
/**
|
|
3078
|
+
* @param {Element} candidate to check if contained or is the top-most modal dialog
|
|
3079
|
+
* @return {boolean} whether candidate is contained in top dialog
|
|
3080
|
+
*/
|
|
3081
|
+
dialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {
|
|
3082
|
+
while (candidate = findNearestDialog(candidate)) {
|
|
3083
|
+
for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {
|
|
3084
|
+
if (dpi.dialog === candidate) {
|
|
3085
|
+
return i === 0; // only valid if top-most
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
candidate = candidate.parentElement;
|
|
3089
|
+
}
|
|
3090
|
+
return false;
|
|
3091
|
+
};
|
|
3092
|
+
|
|
3093
|
+
dialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {
|
|
3094
|
+
var target = event.composedPath ? event.composedPath()[0] : event.target;
|
|
3095
|
+
|
|
3096
|
+
if (this.containedByTopDialog_(target)) { return; }
|
|
3097
|
+
|
|
3098
|
+
if (document.activeElement === document.documentElement) { return; }
|
|
3099
|
+
|
|
3100
|
+
event.preventDefault();
|
|
3101
|
+
event.stopPropagation();
|
|
3102
|
+
safeBlur(/** @type {Element} */ (target));
|
|
3103
|
+
|
|
3104
|
+
if (this.forwardTab_ === undefined) { return; } // move focus only from a tab key
|
|
3105
|
+
|
|
3106
|
+
var dpi = this.pendingDialogStack[0];
|
|
3107
|
+
var dialog = dpi.dialog;
|
|
3108
|
+
var position = dialog.compareDocumentPosition(target);
|
|
3109
|
+
if (position & Node.DOCUMENT_POSITION_PRECEDING) {
|
|
3110
|
+
if (this.forwardTab_) {
|
|
3111
|
+
// forward
|
|
3112
|
+
dpi.focus_();
|
|
3113
|
+
} else if (target !== document.documentElement) {
|
|
3114
|
+
// backwards if we're not already focused on <html>
|
|
3115
|
+
document.documentElement.focus();
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
return false;
|
|
3120
|
+
};
|
|
3121
|
+
|
|
3122
|
+
dialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {
|
|
3123
|
+
this.forwardTab_ = undefined;
|
|
3124
|
+
if (event.keyCode === 27) {
|
|
3125
|
+
event.preventDefault();
|
|
3126
|
+
event.stopPropagation();
|
|
3127
|
+
var cancelEvent = new supportCustomEvent('cancel', {
|
|
3128
|
+
bubbles: false,
|
|
3129
|
+
cancelable: true
|
|
3130
|
+
});
|
|
3131
|
+
var dpi = this.pendingDialogStack[0];
|
|
3132
|
+
if (dpi && safeDispatchEvent(dpi.dialog, cancelEvent)) {
|
|
3133
|
+
dpi.dialog.close();
|
|
3134
|
+
}
|
|
3135
|
+
} else if (event.keyCode === 9) {
|
|
3136
|
+
this.forwardTab_ = !event.shiftKey;
|
|
3137
|
+
}
|
|
3138
|
+
};
|
|
3139
|
+
|
|
3140
|
+
/**
|
|
3141
|
+
* Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are
|
|
3142
|
+
* removed and immediately readded don't stay modal, they become normal.
|
|
3143
|
+
*
|
|
3144
|
+
* @param {!Array<!HTMLDialogElement>} removed that have definitely been removed
|
|
3145
|
+
*/
|
|
3146
|
+
dialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {
|
|
3147
|
+
// This operates on a clone because it may cause it to change. Each change also calls
|
|
3148
|
+
// updateStacking, which only actually needs to happen once. But who removes many modal dialogs
|
|
3149
|
+
// at a time?!
|
|
3150
|
+
var clone = this.pendingDialogStack.slice();
|
|
3151
|
+
clone.forEach(function(dpi) {
|
|
3152
|
+
if (removed.indexOf(dpi.dialog) !== -1) {
|
|
3153
|
+
dpi.downgradeModal();
|
|
3154
|
+
} else {
|
|
3155
|
+
dpi.maybeHideModal();
|
|
3156
|
+
}
|
|
3157
|
+
});
|
|
3158
|
+
};
|
|
3159
|
+
|
|
3160
|
+
/**
|
|
3161
|
+
* @param {!dialogPolyfillInfo} dpi
|
|
3162
|
+
* @return {boolean} whether the dialog was allowed
|
|
3163
|
+
*/
|
|
3164
|
+
dialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {
|
|
3165
|
+
var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;
|
|
3166
|
+
if (this.pendingDialogStack.length >= allowed) {
|
|
3167
|
+
return false;
|
|
3168
|
+
}
|
|
3169
|
+
if (this.pendingDialogStack.unshift(dpi) === 1) {
|
|
3170
|
+
this.blockDocument();
|
|
3171
|
+
}
|
|
3172
|
+
this.updateStacking();
|
|
3173
|
+
return true;
|
|
3174
|
+
};
|
|
3175
|
+
|
|
3176
|
+
/**
|
|
3177
|
+
* @param {!dialogPolyfillInfo} dpi
|
|
3178
|
+
*/
|
|
3179
|
+
dialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {
|
|
3180
|
+
var index = this.pendingDialogStack.indexOf(dpi);
|
|
3181
|
+
if (index === -1) { return; }
|
|
3182
|
+
|
|
3183
|
+
this.pendingDialogStack.splice(index, 1);
|
|
3184
|
+
if (this.pendingDialogStack.length === 0) {
|
|
3185
|
+
this.unblockDocument();
|
|
3186
|
+
}
|
|
3187
|
+
this.updateStacking();
|
|
3188
|
+
};
|
|
3189
|
+
|
|
3190
|
+
dialogPolyfill.dm = new dialogPolyfill.DialogManager();
|
|
3191
|
+
dialogPolyfill.formSubmitter = null;
|
|
3192
|
+
dialogPolyfill.imagemapUseValue = null;
|
|
3193
|
+
|
|
3194
|
+
/**
|
|
3195
|
+
* Installs global handlers, such as click listers and native method overrides. These are needed
|
|
3196
|
+
* even if a no dialog is registered, as they deal with <form method="dialog">.
|
|
3197
|
+
*/
|
|
3198
|
+
if (window.HTMLDialogElement === undefined) {
|
|
3199
|
+
|
|
3200
|
+
/**
|
|
3201
|
+
* If HTMLFormElement translates method="DIALOG" into 'get', then replace the descriptor with
|
|
3202
|
+
* one that returns the correct value.
|
|
3203
|
+
*/
|
|
3204
|
+
var testForm = document.createElement('form');
|
|
3205
|
+
testForm.setAttribute('method', 'dialog');
|
|
3206
|
+
if (testForm.method !== 'dialog') {
|
|
3207
|
+
var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');
|
|
3208
|
+
if (methodDescriptor) {
|
|
3209
|
+
// nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything
|
|
3210
|
+
// and don't bother to update the element.
|
|
3211
|
+
var realGet = methodDescriptor.get;
|
|
3212
|
+
methodDescriptor.get = function() {
|
|
3213
|
+
if (isFormMethodDialog(this)) {
|
|
3214
|
+
return 'dialog';
|
|
3215
|
+
}
|
|
3216
|
+
return realGet.call(this);
|
|
3217
|
+
};
|
|
3218
|
+
var realSet = methodDescriptor.set;
|
|
3219
|
+
/** @this {HTMLElement} */
|
|
3220
|
+
methodDescriptor.set = function(v) {
|
|
3221
|
+
if (typeof v === 'string' && v.toLowerCase() === 'dialog') {
|
|
3222
|
+
return this.setAttribute('method', v);
|
|
3223
|
+
}
|
|
3224
|
+
return realSet.call(this, v);
|
|
3225
|
+
};
|
|
3226
|
+
Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
|
|
3230
|
+
/**
|
|
3231
|
+
* Global 'click' handler, to capture the <input type="submit"> or <button> element which has
|
|
3232
|
+
* submitted a <form method="dialog">. Needed as Safari and others don't report this inside
|
|
3233
|
+
* document.activeElement.
|
|
3234
|
+
*/
|
|
3235
|
+
document.addEventListener('click', function(ev) {
|
|
3236
|
+
dialogPolyfill.formSubmitter = null;
|
|
3237
|
+
dialogPolyfill.imagemapUseValue = null;
|
|
3238
|
+
if (ev.defaultPrevented) { return; } // e.g. a submit which prevents default submission
|
|
3239
|
+
|
|
3240
|
+
var target = /** @type {Element} */ (ev.target);
|
|
3241
|
+
if ('composedPath' in ev) {
|
|
3242
|
+
var path = ev.composedPath();
|
|
3243
|
+
target = path.shift() || target;
|
|
3244
|
+
}
|
|
3245
|
+
if (!target || !isFormMethodDialog(target.form)) { return; }
|
|
3246
|
+
|
|
3247
|
+
var valid = (target.type === 'submit' && ['button', 'input'].indexOf(target.localName) > -1);
|
|
3248
|
+
if (!valid) {
|
|
3249
|
+
if (!(target.localName === 'input' && target.type === 'image')) { return; }
|
|
3250
|
+
// this is a <input type="image">, which can submit forms
|
|
3251
|
+
dialogPolyfill.imagemapUseValue = ev.offsetX + ',' + ev.offsetY;
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
var dialog = findNearestDialog(target);
|
|
3255
|
+
if (!dialog) { return; }
|
|
3256
|
+
|
|
3257
|
+
dialogPolyfill.formSubmitter = target;
|
|
3258
|
+
|
|
3259
|
+
}, false);
|
|
3260
|
+
|
|
3261
|
+
/**
|
|
3262
|
+
* Global 'submit' handler. This handles submits of `method="dialog"` which are invalid, i.e.,
|
|
3263
|
+
* outside a dialog. They get prevented.
|
|
3264
|
+
*/
|
|
3265
|
+
document.addEventListener('submit', function(ev) {
|
|
3266
|
+
var form = ev.target;
|
|
3267
|
+
var dialog = findNearestDialog(form);
|
|
3268
|
+
if (dialog) {
|
|
3269
|
+
return; // ignore, handle there
|
|
3270
|
+
}
|
|
3271
|
+
|
|
3272
|
+
var submitter = findFormSubmitter(ev);
|
|
3273
|
+
var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');
|
|
3274
|
+
if (formmethod === 'dialog') {
|
|
3275
|
+
ev.preventDefault();
|
|
3276
|
+
}
|
|
3277
|
+
});
|
|
3278
|
+
|
|
3279
|
+
/**
|
|
3280
|
+
* Replace the native HTMLFormElement.submit() method, as it won't fire the
|
|
3281
|
+
* submit event and give us a chance to respond.
|
|
3282
|
+
*/
|
|
3283
|
+
var nativeFormSubmit = HTMLFormElement.prototype.submit;
|
|
3284
|
+
var replacementFormSubmit = function () {
|
|
3285
|
+
if (!isFormMethodDialog(this)) {
|
|
3286
|
+
return nativeFormSubmit.call(this);
|
|
3287
|
+
}
|
|
3288
|
+
var dialog = findNearestDialog(this);
|
|
3289
|
+
dialog && dialog.close();
|
|
3290
|
+
};
|
|
3291
|
+
HTMLFormElement.prototype.submit = replacementFormSubmit;
|
|
3292
|
+
}
|
|
3293
|
+
|
|
3294
|
+
const stylesCss = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>dialog{padding:0;border:none;margin:0;background-color:transparent}:host>dialog:modal{width:100%;max-width:100%;max-height:100%}:host>dialog::backdrop{display:none}:host>dialog+.backdrop{display:none}:host>dialog:not([open]){display:none}:host>dialog[open]{display:block}.modal-container{z-index:1010;display:flex;overflow:-moz-scrollbars-none;width:100%;height:100vh;flex-direction:column}.modal-container>.modal-content-scroll-outside{overflow:auto;background:var(--color-surface01)}.modal-container>header{padding:calc(var(--space-unit) * 2 - 2px) calc(var(--space-unit) * 2);background:var(--color-surface02)}.modal-container>header button{padding:0;border:none;margin:0;margin-left:auto;background:transparent;cursor:pointer}.modal-container>header z-icon{--z-icon-width:calc(var(--space-unit) * 2.5);--z-icon-height:calc(var(--space-unit) * 2.5);display:flex;fill:var(--color-icon01)}.modal-container>header>div{display:flex;width:100%;align-items:center;margin-right:calc(var(--space-unit) * 2)}.modal-container>header h1,.modal-container>header h2{padding:0;margin:0;color:var(--color-text01);font-weight:var(--font-rg)}.modal-container>header h1{font-size:var(--font-size-5);letter-spacing:0;line-height:1.4}.modal-container>header h2{font-size:var(--font-size-3);letter-spacing:0;line-height:1.5}.modal-container>header>div>h1 *:empty{display:none}.modal-container>header h1+h2{margin-top:calc(var(--space-unit) * 0.5)}.modal-container-scroll-inside>.modal-content-scroll-inside{overflow:hidden auto;flex:1 auto;background:var(--color-surface01)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar-thumb,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01)}.modal-container-scroll-inside>.modal-content-scroll-inside::-webkit-scrollbar-thumb:hover,.modal-container-scroll-outside>.modal-content-scroll-outside::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.modal-container-scroll-inside .modal-content-scroll-inside,.modal-container-scroll-outside .modal-content-scroll-outside{scrollbar-color:var(--color-primary01) transparent}@media only screen and (min-width: 768px){.modal-background{position:fixed;top:0;left:0;overflow:hidden;width:100vw;height:100vh;background-color:var(--gray900);opacity:0.7}.modal-background.modal-background-scroll-outside{position:sticky}.modal-container-scroll-inside{position:fixed;top:calc(var(--space-unit) * 6);left:50%;overflow:hidden;width:auto;min-width:calc(var(--space-unit) * 40);height:auto;min-height:calc(var(--space-unit) * 40);max-height:calc(100vh - calc(var(--space-unit) * 6 * 2));border-radius:var(--border-radius);transform:translateX(-50%)}.modal-container-scroll-outside{position:absolute;top:calc(var(--space-unit) * 6);left:50%;display:block;overflow:initial;width:auto;min-width:calc(var(--space-unit) * 40);height:auto;min-height:calc(var(--space-unit) * 40);max-height:calc(100vh - calc(var(--space-unit) * 6 * 2));transform:translateX(-50%)}.modal-container>.modal-content-scroll-outside{overflow:initial}.modal-container-scroll-outside>header,.modal-container-scroll-inside>header{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius)}.modal-container-scroll-outside::after{display:block;height:calc(var(--space-unit) * 6);content:\" \"}.modal-dialog{position:fixed;top:0;left:0;height:auto;overflow-x:hidden;overflow-y:auto}.modal-content-scroll-outside{border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius)}.modal-dialog::-webkit-scrollbar{display:none}.modal-container>header z-icon{--z-icon-width:calc(var(--space-unit) * 3);--z-icon-height:calc(var(--space-unit) * 3)}}@media only screen and (min-width: 768px) and (max-width: 1151px){.modal-container>header{padding:calc(var(--space-unit) * 3 - 2px) calc(var(--space-unit) * 3)}}@media only screen and (min-width: 1152px){.modal-container>header{padding:calc(var(--space-unit) * 4 - 4px) calc(var(--space-unit) * 4)}.modal-container>header h1{font-size:var(--font-size-6);letter-spacing:0;line-height:1.33}.modal-container>header h2{font-size:var(--font-size-4);letter-spacing:0;line-height:1.5}.modal-container>header h1+h2{margin-top:0}}";
|
|
2498
3295
|
|
|
2499
3296
|
const FOCUSABLE_ELEMENTS_SELECTOR = ':is(button, input, select, textarea, [contenteditable=""], [contenteditable="true"], a[href], [tabindex], summary):not([disabled], [disabled=""], [tabindex="-1"], [aria-hidden="true"], [hidden])';
|
|
2500
3297
|
const ZModal = class {
|
|
@@ -2507,18 +3304,32 @@ const ZModal = class {
|
|
|
2507
3304
|
this.closeButtonLabel = "chiudi modale";
|
|
2508
3305
|
/** add role "alertdialog" to dialog (optional, default is false) */
|
|
2509
3306
|
this.alertdialog = false;
|
|
3307
|
+
/** if true, the modal is closable (optional, default is true) */
|
|
3308
|
+
this.closable = true;
|
|
3309
|
+
/** if true, the modal can scroll inside, if false the viewport can scroll */
|
|
3310
|
+
this.scrollInside = true;
|
|
2510
3311
|
}
|
|
2511
3312
|
emitModalClose() {
|
|
2512
|
-
|
|
3313
|
+
if (this.closable) {
|
|
3314
|
+
this.modalClose.emit({ modalid: this.modalid });
|
|
3315
|
+
}
|
|
2513
3316
|
}
|
|
2514
3317
|
emitModalHeaderActive() {
|
|
2515
3318
|
this.modalHeaderActive.emit({ modalid: this.modalid });
|
|
2516
3319
|
}
|
|
2517
3320
|
emitBackgroundClick() {
|
|
2518
|
-
|
|
3321
|
+
if (this.closable) {
|
|
3322
|
+
this.modalBackgroundClick.emit({ modalid: this.modalid });
|
|
3323
|
+
}
|
|
2519
3324
|
}
|
|
2520
3325
|
componentDidLoad() {
|
|
2521
|
-
|
|
3326
|
+
if (typeof HTMLDialogElement !== "function") {
|
|
3327
|
+
dialogPolyfill.registerDialog(this.dialog);
|
|
3328
|
+
this.dialog.setAttribute("open", "true");
|
|
3329
|
+
}
|
|
3330
|
+
else {
|
|
3331
|
+
this.open();
|
|
3332
|
+
}
|
|
2522
3333
|
}
|
|
2523
3334
|
/** open modal */
|
|
2524
3335
|
async open() {
|
|
@@ -2528,7 +3339,9 @@ const ZModal = class {
|
|
|
2528
3339
|
/** close modal */
|
|
2529
3340
|
async close() {
|
|
2530
3341
|
var _a;
|
|
2531
|
-
(
|
|
3342
|
+
if (this.closable) {
|
|
3343
|
+
(_a = this.dialog) === null || _a === void 0 ? void 0 : _a.close();
|
|
3344
|
+
}
|
|
2532
3345
|
}
|
|
2533
3346
|
/**
|
|
2534
3347
|
* Get a list of focusable elements in the dialog.
|
|
@@ -2563,8 +3376,33 @@ const ZModal = class {
|
|
|
2563
3376
|
firstFocusableElement.focus();
|
|
2564
3377
|
}
|
|
2565
3378
|
}
|
|
3379
|
+
closeButtonSlot() {
|
|
3380
|
+
if (this.closable) {
|
|
3381
|
+
return (index.h("slot", { name: "modalCloseButton" }, index.h("button", { "aria-label": this.closeButtonLabel, onClick: () => this.close() }, index.h("z-icon", { name: "multiply-circle-filled" }))));
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
handleEscape(e) {
|
|
3385
|
+
if (this.closable) {
|
|
3386
|
+
return;
|
|
3387
|
+
}
|
|
3388
|
+
e.preventDefault();
|
|
3389
|
+
}
|
|
2566
3390
|
render() {
|
|
2567
|
-
return (index.h("dialog", {
|
|
3391
|
+
return (index.h("dialog", { class: {
|
|
3392
|
+
"modal-dialog": !this.scrollInside,
|
|
3393
|
+
}, "aria-labelledby": "modal-title", "aria-describedby": "modal-content", role: this.alertdialog ? "alertdialog" : undefined, ref: (el) => (this.dialog = el), onClose: () => this.emitModalClose(),
|
|
3394
|
+
// @ts-ignore
|
|
3395
|
+
onCancel: (e) => this.handleEscape(e) }, index.h("div", { class: {
|
|
3396
|
+
"modal-container": true,
|
|
3397
|
+
"modal-container-scroll-inside": this.scrollInside,
|
|
3398
|
+
"modal-container-scroll-outside": !this.scrollInside,
|
|
3399
|
+
}, id: this.modalid }, index.h("header", { onClick: this.emitModalHeaderActive.bind(this) }, index.h("div", null, this.modaltitle && index.h("h1", { id: "modal-title" }, this.modaltitle), this.closeButtonSlot()), this.modalsubtitle && index.h("h2", { id: "modal-subtitle" }, this.modalsubtitle)), index.h("div", { class: {
|
|
3400
|
+
"modal-content-scroll-inside": this.scrollInside,
|
|
3401
|
+
"modal-content-scroll-outside": !this.scrollInside,
|
|
3402
|
+
}, id: "modal-content" }, index.h("slot", { name: "modalContent" }))), index.h("div", { class: {
|
|
3403
|
+
"modal-background": true,
|
|
3404
|
+
"modal-background-scroll-outside": !this.scrollInside,
|
|
3405
|
+
}, "data-action": "modalBackground", "data-modal": this.modalid, onClick: () => {
|
|
2568
3406
|
this.emitBackgroundClick();
|
|
2569
3407
|
this.close();
|
|
2570
3408
|
} })));
|
|
@@ -2582,5 +3420,4 @@ exports.z_icon = ZIcon;
|
|
|
2582
3420
|
exports.z_info_box = ZInfoBox;
|
|
2583
3421
|
exports.z_input = ZInput;
|
|
2584
3422
|
exports.z_input_message = ZInputMessage;
|
|
2585
|
-
exports.z_link = ZLink;
|
|
2586
3423
|
exports.z_modal = ZModal;
|