@zanichelli/albe-web-components 12.6.1-rc1 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2939 -0
- package/dist/cjs/index-dc60bee7.js +10 -58
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-9573c34a.js → utils-2b313a8e.js} +1 -1
- package/dist/cjs/{utils-9573c34a.js.map → utils-2b313a8e.js.map} +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-alert.cjs.entry.js +1 -1
- package/dist/{esm/icons-f212e30c.js → cjs/z-app-header_12.cjs.entry.js} +1019 -2
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -0
- package/dist/cjs/z-cover-hero.cjs.entry.js +2 -2
- package/dist/cjs/z-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +1024 -0
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +1 -0
- package/dist/cjs/z-file-upload.cjs.entry.js +194 -0
- package/dist/cjs/z-file-upload.cjs.entry.js.map +1 -0
- package/dist/cjs/z-ghost-loading.cjs.entry.js +1 -1
- package/dist/cjs/z-info-reveal.cjs.entry.js +1 -1
- package/dist/cjs/z-link.cjs.entry.js +1 -1
- package/dist/cjs/z-messages-pocket.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-icon.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-list.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card_4.cjs.entry.js +4 -4
- package/dist/cjs/z-myz-list.cjs.entry.js +1 -1
- package/dist/cjs/z-otp.cjs.entry.js +2 -2
- package/dist/cjs/z-pocket-message.cjs.entry.js +1 -1
- package/dist/cjs/z-pocket_3.cjs.entry.js +3 -3
- package/dist/cjs/z-popover.cjs.entry.js +1 -1
- package/dist/cjs/z-range-picker.cjs.entry.js +1 -1
- package/dist/cjs/z-section-title.cjs.entry.js +1 -1
- package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
- package/dist/cjs/z-visually-hidden.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +0 -14
- package/dist/collection/components/file-upload/z-file-upload/index.js +1 -23
- package/dist/collection/components/file-upload/z-file-upload/index.js.map +1 -1
- package/dist/collection/components/inputs/z-searchbar/index.js +3 -1
- package/dist/collection/components/inputs/z-searchbar/index.js.map +1 -1
- package/dist/collection/components/inputs/z-searchbar/styles.css +5 -2
- package/dist/collection/components/list/z-list-element/index.js +1 -26
- package/dist/collection/components/list/z-list-element/index.js.map +1 -1
- package/dist/collection/components/list/z-list-element/styles.css +12 -37
- package/dist/collection/components/z-cover-hero/index.js +2 -2
- package/dist/collection/components/z-divider/index.js +1 -1
- package/dist/collection/components/z-ghost-loading/index.js +1 -1
- package/dist/collection/components/z-info-reveal/index.js +1 -1
- package/dist/collection/components/z-offcanvas/index.js +1 -1
- package/dist/collection/components/z-offcanvas/styles.css +1 -1
- package/dist/collection/components/z-popover/index.js +1 -1
- package/dist/collection/components/z-section-title/index.js +1 -1
- package/dist/collection/components/z-skip-to-content/index.js +1 -1
- package/dist/collection/components/z-tag/index.js +2 -2
- package/dist/collection/components/z-visually-hidden/index.js +1 -1
- package/dist/collection/deprecated/z-link/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/pocket/z-messages-pocket/index.js +1 -1
- package/dist/collection/snowflakes/myz/pocket/z-pocket/index.js +1 -1
- package/dist/collection/snowflakes/myz/pocket/z-pocket-body/index.js +1 -1
- package/dist/collection/snowflakes/myz/pocket/z-pocket-header/index.js +1 -1
- package/dist/collection/snowflakes/myz/pocket/z-pocket-message/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js +2 -2
- package/dist/components/index.d.ts +0 -28
- package/dist/components/index.js +0 -14
- package/dist/components/index.js.map +1 -1
- package/dist/components/index13.js +2 -10
- package/dist/components/index13.js.map +1 -1
- package/dist/components/index16.js +1 -1
- package/dist/components/index17.js +1 -1
- package/dist/components/index18.js +1 -1
- package/dist/components/index19.js +1 -1
- package/dist/components/index21.js +2 -2
- package/dist/components/index21.js.map +1 -1
- package/dist/components/index22.js +1 -1
- package/dist/components/index23.js +1 -1
- package/dist/components/index24.js +1 -1
- package/dist/components/index25.js +1 -1
- package/dist/components/index26.js +3 -3
- package/dist/components/index26.js.map +1 -1
- package/dist/components/index27.js +17 -37
- package/dist/components/index27.js.map +1 -1
- package/dist/components/index3.js +1 -1
- package/dist/components/index6.js +1 -1
- package/dist/components/index8.js +1 -1
- package/dist/components/z-app-header.js +1 -1
- package/dist/components/z-cover-hero.js +2 -2
- package/dist/components/z-file-upload.js +1 -6
- package/dist/components/z-file-upload.js.map +1 -1
- package/dist/components/z-info-reveal.js +1 -1
- package/dist/components/z-link.js +1 -1
- package/dist/components/z-messages-pocket.js +1 -1
- package/dist/components/z-myz-card-alert.js +1 -1
- package/dist/components/z-myz-card-dictionary.js +1 -1
- package/dist/components/z-myz-card-footer-sections.js +1 -1
- package/dist/components/z-myz-card-footer.js +1 -1
- package/dist/components/z-myz-card-icon.js +1 -1
- package/dist/components/z-myz-card-info.js +1 -1
- package/dist/components/z-myz-card-list.js +1 -1
- package/dist/components/z-myz-list.js +1 -1
- package/dist/components/z-otp.js +2 -2
- package/dist/components/z-pocket-message.js +1 -1
- package/dist/components/z-section-title.js +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/components/z-tag.js +1 -1
- package/dist/components/z-visually-hidden.js +1 -1
- package/dist/esm/index-f16bc2ca.js +10 -58
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-d29ea23d.js → utils-cd008fbc.js} +1 -1
- package/dist/esm/{utils-d29ea23d.js.map → utils-cd008fbc.js.map} +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-alert.entry.js +1 -1
- package/dist/{cjs/icons-be077181.js → esm/z-app-header_12.entry.js} +1003 -3
- package/dist/esm/z-app-header_12.entry.js.map +1 -0
- package/dist/esm/z-cover-hero.entry.js +2 -2
- package/dist/esm/z-date-picker.entry.js +1 -1
- package/dist/esm/z-dragdrop-area_2.entry.js +1019 -0
- package/dist/esm/z-dragdrop-area_2.entry.js.map +1 -0
- package/dist/esm/z-file-upload.entry.js +190 -0
- package/dist/esm/z-file-upload.entry.js.map +1 -0
- package/dist/esm/z-ghost-loading.entry.js +1 -1
- package/dist/esm/z-info-reveal.entry.js +1 -1
- package/dist/esm/z-link.entry.js +1 -1
- package/dist/esm/z-messages-pocket.entry.js +1 -1
- package/dist/esm/z-myz-card-alert.entry.js +1 -1
- package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
- package/dist/esm/z-myz-card-footer-sections.entry.js +1 -1
- package/dist/esm/z-myz-card-footer.entry.js +1 -1
- package/dist/esm/z-myz-card-icon.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +1 -1
- package/dist/esm/z-myz-card-list.entry.js +1 -1
- package/dist/esm/z-myz-card_4.entry.js +4 -4
- package/dist/esm/z-myz-list.entry.js +1 -1
- package/dist/esm/z-otp.entry.js +2 -2
- package/dist/esm/z-pocket-message.entry.js +1 -1
- package/dist/esm/z-pocket_3.entry.js +3 -3
- package/dist/esm/z-popover.entry.js +1 -1
- package/dist/esm/z-range-picker.entry.js +1 -1
- package/dist/esm/z-section-title.entry.js +1 -1
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-visually-hidden.entry.js +1 -1
- package/dist/types/components/file-upload/z-file-upload/index.d.ts +0 -2
- package/dist/types/components/inputs/z-searchbar/index.d.ts +2 -0
- package/dist/types/components/list/z-list-element/index.d.ts +0 -5
- package/dist/types/components.d.ts +10 -893
- package/dist/web-components-library/{p-6d0bb567.entry.js → p-00d7315a.entry.js} +2 -2
- package/dist/web-components-library/{p-10c29fb4.entry.js → p-04755b76.entry.js} +2 -2
- package/dist/web-components-library/{p-7d4cd2e8.entry.js → p-05b39597.entry.js} +2 -2
- package/dist/web-components-library/{p-5a174821.entry.js → p-0d799f83.entry.js} +2 -2
- package/dist/web-components-library/{p-83657b33.entry.js → p-120a809e.entry.js} +2 -2
- package/dist/web-components-library/{p-fa4a2862.entry.js → p-239fb968.entry.js} +2 -2
- package/dist/web-components-library/{p-378b2bbf.entry.js → p-24ab494d.entry.js} +2 -2
- package/dist/web-components-library/{p-f97c093d.entry.js → p-2637ab23.entry.js} +2 -2
- package/{www/build/p-af78542a.js → dist/web-components-library/p-49a35cf0.js} +1 -1
- package/dist/web-components-library/p-4c40561d.entry.js +2 -0
- package/dist/web-components-library/p-5023f7d5.entry.js +2 -0
- package/dist/web-components-library/p-5023f7d5.entry.js.map +1 -0
- package/dist/web-components-library/p-52fa5f80.entry.js +2 -0
- package/dist/web-components-library/p-52fa5f80.entry.js.map +1 -0
- package/dist/web-components-library/p-5d67d311.entry.js +2 -0
- package/dist/web-components-library/{p-ae71256f.entry.js → p-5eb0a064.entry.js} +2 -2
- package/dist/web-components-library/{p-2f72475d.entry.js → p-6edd5dbe.entry.js} +2 -2
- package/dist/web-components-library/{p-402bd7f6.entry.js → p-8d81a5c8.entry.js} +2 -2
- package/dist/web-components-library/p-91a7c5a9.entry.js +2 -0
- package/dist/web-components-library/p-91a7c5a9.entry.js.map +1 -0
- package/dist/web-components-library/{p-210fbe0f.entry.js → p-942e5126.entry.js} +2 -2
- package/{www/build/p-af27423a.entry.js → dist/web-components-library/p-95104b91.entry.js} +2 -2
- package/dist/web-components-library/{p-9e71d6b3.entry.js → p-996c1471.entry.js} +2 -2
- package/{www/build/p-bb8037c4.entry.js → dist/web-components-library/p-a53ab86e.entry.js} +2 -2
- package/dist/web-components-library/{p-ac497c80.entry.js → p-b57362ef.entry.js} +2 -2
- package/dist/web-components-library/{p-97bba1f2.entry.js → p-b670ffa5.entry.js} +2 -2
- package/dist/web-components-library/{p-38c63f28.entry.js → p-d1f8ca38.entry.js} +2 -2
- package/dist/web-components-library/{p-9882e8a5.entry.js → p-d251f105.entry.js} +2 -2
- package/dist/web-components-library/{p-e3e48e64.entry.js → p-d92765b6.entry.js} +2 -2
- package/dist/web-components-library/{p-5d220bbc.entry.js → p-dbc437d8.entry.js} +2 -2
- package/{www/build/p-d83dfde7.entry.js → dist/web-components-library/p-fe6f5926.entry.js} +2 -2
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/dist/web-components-library/web-components-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/react/components.d.ts +0 -14
- package/react/components.js +2 -16
- package/react/components.js.map +1 -1
- package/src-react/index.ts +1 -0
- package/www/build/{p-6d0bb567.entry.js → p-00d7315a.entry.js} +2 -2
- package/www/build/{p-10c29fb4.entry.js → p-04755b76.entry.js} +2 -2
- package/www/build/{p-7d4cd2e8.entry.js → p-05b39597.entry.js} +2 -2
- package/www/build/{p-5a174821.entry.js → p-0d799f83.entry.js} +2 -2
- package/www/build/{p-83657b33.entry.js → p-120a809e.entry.js} +2 -2
- package/www/build/{p-fa4a2862.entry.js → p-239fb968.entry.js} +2 -2
- package/www/build/{p-378b2bbf.entry.js → p-24ab494d.entry.js} +2 -2
- package/www/build/{p-f97c093d.entry.js → p-2637ab23.entry.js} +2 -2
- package/{dist/web-components-library/p-af78542a.js → www/build/p-49a35cf0.js} +1 -1
- package/www/build/p-4c40561d.entry.js +2 -0
- package/www/build/p-5023f7d5.entry.js +2 -0
- package/www/build/p-5023f7d5.entry.js.map +1 -0
- package/www/build/p-52fa5f80.entry.js +2 -0
- package/www/build/p-52fa5f80.entry.js.map +1 -0
- package/www/build/p-56810079.js +2 -0
- package/www/build/p-5d67d311.entry.js +2 -0
- package/www/build/{p-ae71256f.entry.js → p-5eb0a064.entry.js} +2 -2
- package/www/build/{p-2f72475d.entry.js → p-6edd5dbe.entry.js} +2 -2
- package/www/build/{p-402bd7f6.entry.js → p-8d81a5c8.entry.js} +2 -2
- package/www/build/p-91a7c5a9.entry.js +2 -0
- package/www/build/p-91a7c5a9.entry.js.map +1 -0
- package/www/build/{p-210fbe0f.entry.js → p-942e5126.entry.js} +2 -2
- package/{dist/web-components-library/p-af27423a.entry.js → www/build/p-95104b91.entry.js} +2 -2
- package/www/build/{p-9e71d6b3.entry.js → p-996c1471.entry.js} +2 -2
- package/{dist/web-components-library/p-bb8037c4.entry.js → www/build/p-a53ab86e.entry.js} +2 -2
- package/www/build/{p-ac497c80.entry.js → p-b57362ef.entry.js} +2 -2
- package/www/build/{p-97bba1f2.entry.js → p-b670ffa5.entry.js} +2 -2
- package/www/build/{p-38c63f28.entry.js → p-d1f8ca38.entry.js} +2 -2
- package/www/build/{p-9882e8a5.entry.js → p-d251f105.entry.js} +2 -2
- package/www/build/{p-e3e48e64.entry.js → p-d92765b6.entry.js} +2 -2
- package/www/build/{p-5d220bbc.entry.js → p-dbc437d8.entry.js} +2 -2
- package/{dist/web-components-library/p-d83dfde7.entry.js → www/build/p-fe6f5926.entry.js} +2 -2
- package/www/build/web-components-library.esm.js +1 -1
- package/www/build/web-components-library.esm.js.map +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/icons-be077181.js.map +0 -1
- package/dist/cjs/index-0a7baee3.js +0 -24
- package/dist/cjs/index-0a7baee3.js.map +0 -1
- package/dist/cjs/index-37180b8d.js +0 -24
- package/dist/cjs/index-37180b8d.js.map +0 -1
- package/dist/cjs/index-4468a6b7.js +0 -24
- package/dist/cjs/index-4468a6b7.js.map +0 -1
- package/dist/cjs/index-715aa3be.js +0 -21
- package/dist/cjs/index-715aa3be.js.map +0 -1
- package/dist/cjs/index-7a1c32d4.js +0 -30
- package/dist/cjs/index-7a1c32d4.js.map +0 -1
- package/dist/cjs/index-7f3e61f0.js +0 -82
- package/dist/cjs/index-7f3e61f0.js.map +0 -1
- package/dist/cjs/index-96c2bc8f.js +0 -25
- package/dist/cjs/index-96c2bc8f.js.map +0 -1
- package/dist/cjs/index-a30259f3.js +0 -37
- package/dist/cjs/index-a30259f3.js.map +0 -1
- package/dist/cjs/index-a7aedd7c.js +0 -20
- package/dist/cjs/index-a7aedd7c.js.map +0 -1
- package/dist/cjs/index-d669dfd0.js +0 -43
- package/dist/cjs/index-d669dfd0.js.map +0 -1
- package/dist/cjs/z-app-header_15.cjs.entry.js +0 -2230
- package/dist/cjs/z-app-header_15.cjs.entry.js.map +0 -1
- package/dist/cjs/z-contextual-menu.cjs.entry.js +0 -44
- package/dist/cjs/z-contextual-menu.cjs.entry.js.map +0 -1
- package/dist/cjs/z-navigation-tab-link.cjs.entry.js +0 -72
- package/dist/cjs/z-navigation-tab-link.cjs.entry.js.map +0 -1
- package/dist/cjs/z-navigation-tab.cjs.entry.js +0 -69
- package/dist/cjs/z-navigation-tab.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-body.cjs.entry.js +0 -12
- package/dist/cjs/z-table-body.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-cell.cjs.entry.js +0 -13
- package/dist/cjs/z-table-cell.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-deprecated.cjs.entry.js +0 -92
- package/dist/cjs/z-table-deprecated.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-empty-box.cjs.entry.js +0 -12
- package/dist/cjs/z-table-empty-box.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-expanded-row.cjs.entry.js +0 -12
- package/dist/cjs/z-table-expanded-row.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-footer.cjs.entry.js +0 -12
- package/dist/cjs/z-table-footer.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-head.cjs.entry.js +0 -12
- package/dist/cjs/z-table-head.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-header-row.cjs.entry.js +0 -12
- package/dist/cjs/z-table-header-row.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-header.cjs.entry.js +0 -15
- package/dist/cjs/z-table-header.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-row.cjs.entry.js +0 -13
- package/dist/cjs/z-table-row.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table-sticky-footer.cjs.entry.js +0 -12
- package/dist/cjs/z-table-sticky-footer.cjs.entry.js.map +0 -1
- package/dist/collection/components/z-contextual-menu/index.js +0 -123
- package/dist/collection/components/z-contextual-menu/index.js.map +0 -1
- package/dist/collection/components/z-contextual-menu/index.spec.js +0 -74
- package/dist/collection/components/z-contextual-menu/index.spec.js.map +0 -1
- package/dist/collection/components/z-contextual-menu/styles.css +0 -60
- package/dist/collection/components/z-contextual-menu/test.e2e.js +0 -11
- package/dist/collection/components/z-contextual-menu/test.e2e.js.map +0 -1
- package/dist/collection/deprecated/navigation-tab.css +0 -138
- package/dist/collection/deprecated/z-navigation-tab/index.js +0 -286
- package/dist/collection/deprecated/z-navigation-tab/index.js.map +0 -1
- package/dist/collection/deprecated/z-navigation-tab-link/index.js +0 -321
- package/dist/collection/deprecated/z-navigation-tab-link/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-body/index.js +0 -27
- package/dist/collection/deprecated/z-table-deprecated/z-table-body/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-body/index.spec.js +0 -21
- package/dist/collection/deprecated/z-table-deprecated/z-table-body/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-body/styles.css +0 -9
- package/dist/collection/deprecated/z-table-deprecated/z-table-cell/index.js +0 -85
- package/dist/collection/deprecated/z-table-deprecated/z-table-cell/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-cell/index.spec.js +0 -50
- package/dist/collection/deprecated/z-table-deprecated/z-table-cell/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-cell/styles.css +0 -58
- package/dist/collection/deprecated/z-table-deprecated/z-table-deprecated/index.js +0 -362
- package/dist/collection/deprecated/z-table-deprecated/z-table-deprecated/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-deprecated/styles.css +0 -115
- package/dist/collection/deprecated/z-table-deprecated/z-table-empty-box/index.js +0 -74
- package/dist/collection/deprecated/z-table-deprecated/z-table-empty-box/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-empty-box/index.spec.js +0 -46
- package/dist/collection/deprecated/z-table-deprecated/z-table-empty-box/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-empty-box/styles.css +0 -38
- package/dist/collection/deprecated/z-table-deprecated/z-table-expanded-row/index.js +0 -46
- package/dist/collection/deprecated/z-table-deprecated/z-table-expanded-row/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-expanded-row/index.spec.js +0 -13
- package/dist/collection/deprecated/z-table-deprecated/z-table-expanded-row/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-expanded-row/styles.css +0 -9
- package/dist/collection/deprecated/z-table-deprecated/z-table-footer/index.js +0 -26
- package/dist/collection/deprecated/z-table-deprecated/z-table-footer/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-footer/index.spec.js +0 -23
- package/dist/collection/deprecated/z-table-deprecated/z-table-footer/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-footer/styles.css +0 -5
- package/dist/collection/deprecated/z-table-deprecated/z-table-head/index.js +0 -26
- package/dist/collection/deprecated/z-table-deprecated/z-table-head/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-head/index.spec.js +0 -23
- package/dist/collection/deprecated/z-table-deprecated/z-table-head/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-head/styles.css +0 -5
- package/dist/collection/deprecated/z-table-deprecated/z-table-header/index.js +0 -227
- package/dist/collection/deprecated/z-table-deprecated/z-table-header/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-header/index.spec.js +0 -227
- package/dist/collection/deprecated/z-table-deprecated/z-table-header/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-header/styles.css +0 -71
- package/dist/collection/deprecated/z-table-deprecated/z-table-header-row/index.js +0 -48
- package/dist/collection/deprecated/z-table-deprecated/z-table-header-row/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-header-row/index.spec.js +0 -28
- package/dist/collection/deprecated/z-table-deprecated/z-table-header-row/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-header-row/styles.css +0 -13
- package/dist/collection/deprecated/z-table-deprecated/z-table-row/index.js +0 -96
- package/dist/collection/deprecated/z-table-deprecated/z-table-row/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-row/index.spec.js +0 -23
- package/dist/collection/deprecated/z-table-deprecated/z-table-row/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-row/styles.css +0 -45
- package/dist/collection/deprecated/z-table-deprecated/z-table-sticky-footer/index.js +0 -23
- package/dist/collection/deprecated/z-table-deprecated/z-table-sticky-footer/index.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-sticky-footer/index.spec.js +0 -16
- package/dist/collection/deprecated/z-table-deprecated/z-table-sticky-footer/index.spec.js.map +0 -1
- package/dist/collection/deprecated/z-table-deprecated/z-table-sticky-footer/styles.css +0 -11
- package/dist/components/index28.js +0 -45
- package/dist/components/index28.js.map +0 -1
- package/dist/components/index29.js +0 -120
- package/dist/components/index29.js.map +0 -1
- package/dist/components/index30.js +0 -46
- package/dist/components/index30.js.map +0 -1
- package/dist/components/z-contextual-menu.d.ts +0 -11
- package/dist/components/z-contextual-menu.js +0 -98
- package/dist/components/z-contextual-menu.js.map +0 -1
- package/dist/components/z-navigation-tab-link.d.ts +0 -11
- package/dist/components/z-navigation-tab-link.js +0 -105
- package/dist/components/z-navigation-tab-link.js.map +0 -1
- package/dist/components/z-navigation-tab.d.ts +0 -11
- package/dist/components/z-navigation-tab.js +0 -100
- package/dist/components/z-navigation-tab.js.map +0 -1
- package/dist/components/z-table-body.d.ts +0 -11
- package/dist/components/z-table-body.js +0 -40
- package/dist/components/z-table-body.js.map +0 -1
- package/dist/components/z-table-cell.d.ts +0 -11
- package/dist/components/z-table-cell.js +0 -8
- package/dist/components/z-table-cell.js.map +0 -1
- package/dist/components/z-table-deprecated.d.ts +0 -11
- package/dist/components/z-table-deprecated.js +0 -127
- package/dist/components/z-table-deprecated.js.map +0 -1
- package/dist/components/z-table-empty-box.d.ts +0 -11
- package/dist/components/z-table-empty-box.js +0 -8
- package/dist/components/z-table-empty-box.js.map +0 -1
- package/dist/components/z-table-expanded-row.d.ts +0 -11
- package/dist/components/z-table-expanded-row.js +0 -39
- package/dist/components/z-table-expanded-row.js.map +0 -1
- package/dist/components/z-table-footer.d.ts +0 -11
- package/dist/components/z-table-footer.js +0 -39
- package/dist/components/z-table-footer.js.map +0 -1
- package/dist/components/z-table-head.d.ts +0 -11
- package/dist/components/z-table-head.js +0 -39
- package/dist/components/z-table-head.js.map +0 -1
- package/dist/components/z-table-header-row.d.ts +0 -11
- package/dist/components/z-table-header-row.js +0 -65
- package/dist/components/z-table-header-row.js.map +0 -1
- package/dist/components/z-table-header.d.ts +0 -11
- package/dist/components/z-table-header.js +0 -8
- package/dist/components/z-table-header.js.map +0 -1
- package/dist/components/z-table-row.d.ts +0 -11
- package/dist/components/z-table-row.js +0 -79
- package/dist/components/z-table-row.js.map +0 -1
- package/dist/components/z-table-sticky-footer.d.ts +0 -11
- package/dist/components/z-table-sticky-footer.js +0 -35
- package/dist/components/z-table-sticky-footer.js.map +0 -1
- package/dist/esm/icons-f212e30c.js.map +0 -1
- package/dist/esm/index-0c3f6c0f.js +0 -80
- package/dist/esm/index-0c3f6c0f.js.map +0 -1
- package/dist/esm/index-1ad3694a.js +0 -19
- package/dist/esm/index-1ad3694a.js.map +0 -1
- package/dist/esm/index-42dcef4f.js +0 -41
- package/dist/esm/index-42dcef4f.js.map +0 -1
- package/dist/esm/index-55b38815.js +0 -18
- package/dist/esm/index-55b38815.js.map +0 -1
- package/dist/esm/index-5b6bb2e2.js +0 -28
- package/dist/esm/index-5b6bb2e2.js.map +0 -1
- package/dist/esm/index-659b7228.js +0 -35
- package/dist/esm/index-659b7228.js.map +0 -1
- package/dist/esm/index-73ab3b9b.js +0 -22
- package/dist/esm/index-73ab3b9b.js.map +0 -1
- package/dist/esm/index-754a9620.js +0 -22
- package/dist/esm/index-754a9620.js.map +0 -1
- package/dist/esm/index-829d5a8b.js +0 -23
- package/dist/esm/index-829d5a8b.js.map +0 -1
- package/dist/esm/index-c3277075.js +0 -22
- package/dist/esm/index-c3277075.js.map +0 -1
- package/dist/esm/z-app-header_15.entry.js +0 -2212
- package/dist/esm/z-app-header_15.entry.js.map +0 -1
- package/dist/esm/z-contextual-menu.entry.js +0 -40
- package/dist/esm/z-contextual-menu.entry.js.map +0 -1
- package/dist/esm/z-navigation-tab-link.entry.js +0 -68
- package/dist/esm/z-navigation-tab-link.entry.js.map +0 -1
- package/dist/esm/z-navigation-tab.entry.js +0 -65
- package/dist/esm/z-navigation-tab.entry.js.map +0 -1
- package/dist/esm/z-table-body.entry.js +0 -4
- package/dist/esm/z-table-body.entry.js.map +0 -1
- package/dist/esm/z-table-cell.entry.js +0 -5
- package/dist/esm/z-table-cell.entry.js.map +0 -1
- package/dist/esm/z-table-deprecated.entry.js +0 -88
- package/dist/esm/z-table-deprecated.entry.js.map +0 -1
- package/dist/esm/z-table-empty-box.entry.js +0 -4
- package/dist/esm/z-table-empty-box.entry.js.map +0 -1
- package/dist/esm/z-table-expanded-row.entry.js +0 -4
- package/dist/esm/z-table-expanded-row.entry.js.map +0 -1
- package/dist/esm/z-table-footer.entry.js +0 -4
- package/dist/esm/z-table-footer.entry.js.map +0 -1
- package/dist/esm/z-table-head.entry.js +0 -4
- package/dist/esm/z-table-head.entry.js.map +0 -1
- package/dist/esm/z-table-header-row.entry.js +0 -4
- package/dist/esm/z-table-header-row.entry.js.map +0 -1
- package/dist/esm/z-table-header.entry.js +0 -7
- package/dist/esm/z-table-header.entry.js.map +0 -1
- package/dist/esm/z-table-row.entry.js +0 -5
- package/dist/esm/z-table-row.entry.js.map +0 -1
- package/dist/esm/z-table-sticky-footer.entry.js +0 -4
- package/dist/esm/z-table-sticky-footer.entry.js.map +0 -1
- package/dist/types/components/z-contextual-menu/index.d.ts +0 -26
- package/dist/types/deprecated/z-navigation-tab/index.d.ts +0 -69
- package/dist/types/deprecated/z-navigation-tab-link/index.d.ts +0 -77
- package/dist/types/deprecated/z-table-deprecated/z-table-body/index.d.ts +0 -8
- package/dist/types/deprecated/z-table-deprecated/z-table-cell/index.d.ts +0 -14
- package/dist/types/deprecated/z-table-deprecated/z-table-deprecated/index.d.ts +0 -59
- package/dist/types/deprecated/z-table-deprecated/z-table-empty-box/index.d.ts +0 -15
- package/dist/types/deprecated/z-table-deprecated/z-table-expanded-row/index.d.ts +0 -8
- package/dist/types/deprecated/z-table-deprecated/z-table-footer/index.d.ts +0 -8
- package/dist/types/deprecated/z-table-deprecated/z-table-head/index.d.ts +0 -8
- package/dist/types/deprecated/z-table-deprecated/z-table-header/index.d.ts +0 -31
- package/dist/types/deprecated/z-table-deprecated/z-table-header-row/index.d.ts +0 -9
- package/dist/types/deprecated/z-table-deprecated/z-table-row/index.d.ts +0 -16
- package/dist/types/deprecated/z-table-deprecated/z-table-sticky-footer/index.d.ts +0 -7
- package/dist/web-components-library/p-011a7536.js +0 -2
- package/dist/web-components-library/p-011a7536.js.map +0 -1
- package/dist/web-components-library/p-16f0fc17.entry.js +0 -2
- package/dist/web-components-library/p-16f0fc17.entry.js.map +0 -1
- package/dist/web-components-library/p-2731d501.entry.js +0 -2
- package/dist/web-components-library/p-2731d501.entry.js.map +0 -1
- package/dist/web-components-library/p-28c6bb97.entry.js +0 -2
- package/dist/web-components-library/p-28c6bb97.entry.js.map +0 -1
- package/dist/web-components-library/p-3441cb4e.entry.js +0 -2
- package/dist/web-components-library/p-3441cb4e.entry.js.map +0 -1
- package/dist/web-components-library/p-356aac96.js +0 -2
- package/dist/web-components-library/p-356aac96.js.map +0 -1
- package/dist/web-components-library/p-40f68d35.entry.js +0 -2
- package/dist/web-components-library/p-40f68d35.entry.js.map +0 -1
- package/dist/web-components-library/p-4686b762.js +0 -2
- package/dist/web-components-library/p-4686b762.js.map +0 -1
- package/dist/web-components-library/p-472eb82d.entry.js +0 -2
- package/dist/web-components-library/p-472eb82d.entry.js.map +0 -1
- package/dist/web-components-library/p-4bc82510.js +0 -2
- package/dist/web-components-library/p-4bc82510.js.map +0 -1
- package/dist/web-components-library/p-55d22af2.js +0 -2
- package/dist/web-components-library/p-55d22af2.js.map +0 -1
- package/dist/web-components-library/p-5e585fe9.js +0 -2
- package/dist/web-components-library/p-5e585fe9.js.map +0 -1
- package/dist/web-components-library/p-6087739d.js +0 -2
- package/dist/web-components-library/p-6087739d.js.map +0 -1
- package/dist/web-components-library/p-626a5bb1.entry.js +0 -2
- package/dist/web-components-library/p-626a5bb1.entry.js.map +0 -1
- package/dist/web-components-library/p-6790a3c1.js +0 -2
- package/dist/web-components-library/p-6790a3c1.js.map +0 -1
- package/dist/web-components-library/p-68a9a3dd.entry.js +0 -2
- package/dist/web-components-library/p-68a9a3dd.entry.js.map +0 -1
- package/dist/web-components-library/p-69697329.entry.js +0 -2
- package/dist/web-components-library/p-69697329.entry.js.map +0 -1
- package/dist/web-components-library/p-6aba107d.entry.js +0 -2
- package/dist/web-components-library/p-6aba107d.entry.js.map +0 -1
- package/dist/web-components-library/p-820c2503.js +0 -2
- package/dist/web-components-library/p-820c2503.js.map +0 -1
- package/dist/web-components-library/p-98e8d64f.entry.js +0 -2
- package/dist/web-components-library/p-98e8d64f.entry.js.map +0 -1
- package/dist/web-components-library/p-9bcb606c.entry.js +0 -2
- package/dist/web-components-library/p-9bcb606c.entry.js.map +0 -1
- package/dist/web-components-library/p-b1b69181.entry.js +0 -2
- package/dist/web-components-library/p-b1b69181.entry.js.map +0 -1
- package/dist/web-components-library/p-b99dd793.entry.js +0 -2
- package/dist/web-components-library/p-b99dd793.entry.js.map +0 -1
- package/dist/web-components-library/p-ca5975a3.js +0 -2
- package/dist/web-components-library/p-ca5975a3.js.map +0 -1
- package/dist/web-components-library/p-cc46f0ce.js +0 -2
- package/dist/web-components-library/p-cc46f0ce.js.map +0 -1
- package/dist/web-components-library/p-ebcf6b4d.entry.js +0 -2
- package/dist/web-components-library/p-ed03b414.entry.js +0 -2
- package/dist/web-components-library/p-ed03b414.entry.js.map +0 -1
- package/dist/web-components-library/p-fe8d7642.entry.js +0 -2
- package/www/build/p-011a7536.js +0 -2
- package/www/build/p-011a7536.js.map +0 -1
- package/www/build/p-16f0fc17.entry.js +0 -2
- package/www/build/p-16f0fc17.entry.js.map +0 -1
- package/www/build/p-2731d501.entry.js +0 -2
- package/www/build/p-2731d501.entry.js.map +0 -1
- package/www/build/p-28c6bb97.entry.js +0 -2
- package/www/build/p-28c6bb97.entry.js.map +0 -1
- package/www/build/p-3441cb4e.entry.js +0 -2
- package/www/build/p-3441cb4e.entry.js.map +0 -1
- package/www/build/p-356aac96.js +0 -2
- package/www/build/p-356aac96.js.map +0 -1
- package/www/build/p-40f68d35.entry.js +0 -2
- package/www/build/p-40f68d35.entry.js.map +0 -1
- package/www/build/p-4686b762.js +0 -2
- package/www/build/p-4686b762.js.map +0 -1
- package/www/build/p-472eb82d.entry.js +0 -2
- package/www/build/p-472eb82d.entry.js.map +0 -1
- package/www/build/p-48fe43ec.js +0 -2
- package/www/build/p-4bc82510.js +0 -2
- package/www/build/p-4bc82510.js.map +0 -1
- package/www/build/p-55d22af2.js +0 -2
- package/www/build/p-55d22af2.js.map +0 -1
- package/www/build/p-5e585fe9.js +0 -2
- package/www/build/p-5e585fe9.js.map +0 -1
- package/www/build/p-6087739d.js +0 -2
- package/www/build/p-6087739d.js.map +0 -1
- package/www/build/p-626a5bb1.entry.js +0 -2
- package/www/build/p-626a5bb1.entry.js.map +0 -1
- package/www/build/p-6790a3c1.js +0 -2
- package/www/build/p-6790a3c1.js.map +0 -1
- package/www/build/p-68a9a3dd.entry.js +0 -2
- package/www/build/p-68a9a3dd.entry.js.map +0 -1
- package/www/build/p-69697329.entry.js +0 -2
- package/www/build/p-69697329.entry.js.map +0 -1
- package/www/build/p-6aba107d.entry.js +0 -2
- package/www/build/p-6aba107d.entry.js.map +0 -1
- package/www/build/p-820c2503.js +0 -2
- package/www/build/p-820c2503.js.map +0 -1
- package/www/build/p-98e8d64f.entry.js +0 -2
- package/www/build/p-98e8d64f.entry.js.map +0 -1
- package/www/build/p-9bcb606c.entry.js +0 -2
- package/www/build/p-9bcb606c.entry.js.map +0 -1
- package/www/build/p-b1b69181.entry.js +0 -2
- package/www/build/p-b1b69181.entry.js.map +0 -1
- package/www/build/p-b99dd793.entry.js +0 -2
- package/www/build/p-b99dd793.entry.js.map +0 -1
- package/www/build/p-ca5975a3.js +0 -2
- package/www/build/p-ca5975a3.js.map +0 -1
- package/www/build/p-cc46f0ce.js +0 -2
- package/www/build/p-cc46f0ce.js.map +0 -1
- package/www/build/p-ebcf6b4d.entry.js +0 -2
- package/www/build/p-ed03b414.entry.js +0 -2
- package/www/build/p-ed03b414.entry.js.map +0 -1
- package/www/build/p-fe8d7642.entry.js +0 -2
- /package/dist/web-components-library/{p-6d0bb567.entry.js.map → p-00d7315a.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-10c29fb4.entry.js.map → p-04755b76.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-7d4cd2e8.entry.js.map → p-05b39597.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-5a174821.entry.js.map → p-0d799f83.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-83657b33.entry.js.map → p-120a809e.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-fa4a2862.entry.js.map → p-239fb968.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-378b2bbf.entry.js.map → p-24ab494d.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-f97c093d.entry.js.map → p-2637ab23.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-af78542a.js.map → p-49a35cf0.js.map} +0 -0
- /package/dist/web-components-library/{p-ebcf6b4d.entry.js.map → p-4c40561d.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-fe8d7642.entry.js.map → p-5d67d311.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-ae71256f.entry.js.map → p-5eb0a064.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-2f72475d.entry.js.map → p-6edd5dbe.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-402bd7f6.entry.js.map → p-8d81a5c8.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-210fbe0f.entry.js.map → p-942e5126.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-af27423a.entry.js.map → p-95104b91.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-9e71d6b3.entry.js.map → p-996c1471.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-bb8037c4.entry.js.map → p-a53ab86e.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-ac497c80.entry.js.map → p-b57362ef.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-97bba1f2.entry.js.map → p-b670ffa5.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-38c63f28.entry.js.map → p-d1f8ca38.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-9882e8a5.entry.js.map → p-d251f105.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-e3e48e64.entry.js.map → p-d92765b6.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-5d220bbc.entry.js.map → p-dbc437d8.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-d83dfde7.entry.js.map → p-fe6f5926.entry.js.map} +0 -0
- /package/www/build/{p-6d0bb567.entry.js.map → p-00d7315a.entry.js.map} +0 -0
- /package/www/build/{p-10c29fb4.entry.js.map → p-04755b76.entry.js.map} +0 -0
- /package/www/build/{p-7d4cd2e8.entry.js.map → p-05b39597.entry.js.map} +0 -0
- /package/www/build/{p-5a174821.entry.js.map → p-0d799f83.entry.js.map} +0 -0
- /package/www/build/{p-83657b33.entry.js.map → p-120a809e.entry.js.map} +0 -0
- /package/www/build/{p-fa4a2862.entry.js.map → p-239fb968.entry.js.map} +0 -0
- /package/www/build/{p-378b2bbf.entry.js.map → p-24ab494d.entry.js.map} +0 -0
- /package/www/build/{p-f97c093d.entry.js.map → p-2637ab23.entry.js.map} +0 -0
- /package/www/build/{p-af78542a.js.map → p-49a35cf0.js.map} +0 -0
- /package/www/build/{p-ebcf6b4d.entry.js.map → p-4c40561d.entry.js.map} +0 -0
- /package/www/build/{p-fe8d7642.entry.js.map → p-5d67d311.entry.js.map} +0 -0
- /package/www/build/{p-ae71256f.entry.js.map → p-5eb0a064.entry.js.map} +0 -0
- /package/www/build/{p-2f72475d.entry.js.map → p-6edd5dbe.entry.js.map} +0 -0
- /package/www/build/{p-402bd7f6.entry.js.map → p-8d81a5c8.entry.js.map} +0 -0
- /package/www/build/{p-210fbe0f.entry.js.map → p-942e5126.entry.js.map} +0 -0
- /package/www/build/{p-af27423a.entry.js.map → p-95104b91.entry.js.map} +0 -0
- /package/www/build/{p-9e71d6b3.entry.js.map → p-996c1471.entry.js.map} +0 -0
- /package/www/build/{p-bb8037c4.entry.js.map → p-a53ab86e.entry.js.map} +0 -0
- /package/www/build/{p-ac497c80.entry.js.map → p-b57362ef.entry.js.map} +0 -0
- /package/www/build/{p-97bba1f2.entry.js.map → p-b670ffa5.entry.js.map} +0 -0
- /package/www/build/{p-38c63f28.entry.js.map → p-d1f8ca38.entry.js.map} +0 -0
- /package/www/build/{p-9882e8a5.entry.js.map → p-d251f105.entry.js.map} +0 -0
- /package/www/build/{p-e3e48e64.entry.js.map → p-d92765b6.entry.js.map} +0 -0
- /package/www/build/{p-5d220bbc.entry.js.map → p-dbc437d8.entry.js.map} +0 -0
- /package/www/build/{p-d83dfde7.entry.js.map → p-fe6f5926.entry.js.map} +0 -0
|
@@ -1,2212 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-f16bc2ca.js';
|
|
2
|
-
import { O as OffCanvasVariant, v as TransitionDirection, B as ButtonVariant, e as ControlSize, c as ButtonType, D as DividerSize, h as DividerOrientation, w as ZFileUploadType, p as Device, k as LabelPosition, I as InputType, i as ListSize, m as ListType, j as ExpandableListButtonAlign, l as ListDividerType, E as ExpandableListStyle, g as KeyboardCode } from './index-2255c6c8.js';
|
|
3
|
-
import { g as getDevice, r as randomId, b as boolean, h as handleEnterKeydSubmit } from './utils-7983d02c.js';
|
|
4
|
-
import { I as ICONS } from './icons-f212e30c.js';
|
|
5
|
-
import './breakpoints-680e0e56.js';
|
|
6
|
-
|
|
7
|
-
const stylesCss$e = ":host{--app-header-typography-1-size:24px;--app-header-typography-2-size:28px;--app-header-typography-3-size:32px;--app-header-typography-4-size:36px;--app-header-typography-5-size:42px;--app-header-typography-6-size:48px;--app-header-typography-7-size:54px;--app-header-typography-8-size:60px;--app-header-typography-9-size:68px;--app-header-typography-10-size:76px;--app-header-typography-11-size:84px;--app-header-typography-12-size:92px;--app-header-typography-1-lineheight:1.33;--app-header-typography-2-lineheight:1.29;--app-header-typography-3-lineheight:1.25;--app-header-typography-4-lineheight:1.24;--app-header-typography-5-lineheight:1.24;--app-header-typography-6-lineheight:1.25;--app-header-typography-7-lineheight:1.2;--app-header-typography-8-lineheight:1.26;--app-header-typography-9-lineheight:1.24;--app-header-typography-10-lineheight:1.26;--app-header-typography-11-lineheight:1.2;--app-header-typography-12-lineheight:1.2;--app-header-typography-1-tracking:calc(-0.2 / 1em);--app-header-typography-2-tracking:calc(-0.4 / 1em);--app-header-typography-3-tracking:calc(-0.6 / 1em);--app-header-typography-4-tracking:calc(-0.8 / 1em);--app-header-typography-5-tracking:calc(-1 / 1em);--app-header-typography-6-tracking:calc(-1.2 / 1em);--app-header-typography-7-tracking:calc(-1.4 / 1em);--app-header-typography-8-tracking:calc(-1.6 / 1em);--app-header-typography-9-tracking:calc(-1.8 / 1em);--app-header-typography-10-tracking:calc(-2 / 1em);--app-header-typography-11-tracking:calc(-2.2 / 1em);--app-header-typography-12-tracking:calc(-2.4 / 1em);--app-header-content-max-width:100%;--app-header-height:auto;--app-header-top-offset:48px;--app-header-drawer-trigger-size:calc(var(--space-unit) * 4);--app-header-bg:var(--color-surface01);--app-header-stucked-bg:var(--color-surface01);--app-header-text-color:var(--color-text01);--app-header-title-font-size:var(--app-header-typography-3-size);--app-header-title-lineheight:var(--app-header-typography-3-lineheight);--app-header-title-letter-spacing:var(--app-header-typography-3-tracking);--app-header-stucked-text-color:var(--color-text01);position:relative;display:block;height:var(--app-header-height);color:var(--app-header-text-color)}:host,*{box-sizing:border-box}.heading-panel{position:relative;display:flex;width:100%;max-width:var(--app-header-content-max-width);flex-direction:column;flex-grow:0;flex-shrink:0;align-items:baseline;padding:var(--grid-margin);margin:0 auto;background:var(--app-header-bg);gap:calc(var(--space-unit) * 2) calc(var(--space-unit) * 5)}.hero-container+.heading-panel{background:transparent}:host(:empty) .heading-panel{padding:0}.heading-container{position:relative;z-index:1;display:flex;width:100%;max-width:100%;flex:1 auto;flex-direction:column;justify-content:flex-start}.heading-title{display:flex;max-width:100%;flex-direction:row;align-items:flex-start;column-gap:calc(var(--space-unit) * 2)}::slotted([slot=\"title\"]),.heading-stuck .heading-title>*,::slotted([slot=\"stucked-title\"]){margin:0;font-family:\"IBM Plex Serif\", serif;font-weight:var(--font-bd)}::slotted([slot=\"title\"]){font-size:var(--app-header-title-font-size);letter-spacing:var(--app-header-title-letter-spacing);line-height:var(--app-header-title-lineheight)}.heading-stuck .heading-title>*,::slotted([slot=\"stucked-title\"]){font-size:var(--app-header-typography-3-size);letter-spacing:var(--app-header-typography-3-tracking);line-height:var(--app-header-typography-3-lineheight)}:host(:not([menu-length=\"0\"])) .heading-subtitle{padding-left:calc(var(--app-header-drawer-trigger-size) + (var(--space-unit) * 2))}::slotted([slot=\"top-subtitle\"]),::slotted([slot=\"subtitle\"]){margin:0;font-family:var(--font-family-sans);font-size:20px;font-style:italic;line-height:26px}::slotted([slot=\"subtitle\"]){font-weight:500}::slotted([slot=\"top-subtitle\"]){font-weight:400}.menu-container{display:flex;width:100%;flex:1 auto;flex-flow:row wrap}:host([menu-length=\"0\"]:not([enable-search])) .menu-container,.menu-container:empty{display:none}.menu-container ::slotted([open]){position:relative;z-index:3}z-searchbar{z-index:0;display:flex;width:auto;min-width:calc(var(--space-unit) * 32);flex:1 auto;align-items:center;margin-left:auto}.heading-stuck{position:fixed;z-index:20;top:var(--app-header-top-offset);left:0;width:100%;max-width:100%;animation:slide-stuck-heading-in 250ms ease-out;background:var(--app-header-stucked-bg);box-shadow:var(--shadow-2);color:var(--app-header-stucked-text-color)}.heading-stuck-content{display:flex;max-width:var(--app-header-content-max-width);align-items:center;padding:var(--space-unit) var(--grid-margin);margin:0 auto;column-gap:calc(var(--space-unit) * 2)}.heading-stuck .heading-title{overflow:hidden}.heading-stuck .heading-title>*,.heading-stuck .heading-title ::slotted([slot=\"stucked-title\"]){display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.heading-stuck-content z-button{margin-left:auto}.drawer-trigger{padding:0;border:0;margin:0;appearance:none;background:none;border-radius:0;color:inherit;cursor:pointer}.drawer-trigger z-icon{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);fill:currentcolor}.heading-container :is(.drawer-trigger,z-button.search-page-button){display:flex;height:calc(var(--app-header-title-font-size) * var(--app-header-title-lineheight));align-items:center}.heading-container z-button.search-page-button{margin-left:auto}.drawer-content{display:none}z-offcanvas[open] .drawer-content{display:flex;width:100%;flex:1 auto;flex-direction:column;row-gap:calc(var(--space-unit) * 2.5)}z-offcanvas[open] .drawer-content ::slotted(z-menu){width:100%}.drawer-close{--z-icon-width:var(--app-header-drawer-trigger-size);--z-icon-height:var(--app-header-drawer-trigger-size);padding:0;border:0;margin:var(--space-unit) 0 calc(var(--space-unit) * 2.5);appearance:none;background:transparent;border-radius:0;color:inherit;cursor:pointer;fill:currentcolor;font-size:inherit;outline:none}.drawer-close:focus-visible{box-shadow:var(--shadow-focus-primary)}.hero-container{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%}:host([overlay]) .heading-panel .drawer-trigger z-icon,:host([overlay]) .heading-panel .heading-container,:host([overlay]) .heading-panel .menu-container{color:var(--color-white);fill:var(--color-white)}:host([overlay]) .heading-panel .menu-container ::slotted(z-menu){--z-menu-label-color:var(--color-white)}:host([overlay]) .hero-container::after{position:absolute;z-index:0;top:0;left:0;width:100%;height:100%;background:var(--color-black);content:\"\";opacity:0.5}.hero-container img,.hero-container ::slotted(*){position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:top center;-webkit-user-drag:none}@media (min-width: 768px){:host{--app-header-title-font-size:var(--app-header-typography-6-size);--app-header-title-lineheight:var(--app-header-typography-6-lineheight);--app-header-title-letter-spacing:var(--app-header-typography-6-tracking)}.heading-panel{flex-flow:row wrap;align-items:center;padding-bottom:calc(var(--space-unit) * 2)}.heading-container{margin-right:auto}:host(:is([flow=\"offcanvas\"],[menu-length=\"0\"])) :is(.heading-container,.menu-container){width:auto}:host(:not([flow=\"offcanvas\"])) .heading-subtitle{padding-left:0}.menu-container{flex:initial;align-items:center}:host([menu-length=\"0\"]) .menu-container:not(:empty){height:calc(var(--app-header-title-font-size) * var(--app-header-title-lineheight))}:host(:not([flow=\"offcanvas\"])) .menu-container{gap:var(--space-unit) calc(var(--space-unit) * 5)}:host(:not([flow=\"offcanvas\"])) .heading-container .drawer-trigger{display:none}}@media (min-width: 1152px){:host{--app-header-title-font-size:var(--app-header-typography-7-size);--app-header-title-lineheight:var(--app-header-typography-7-lineheight);--app-header-title-letter-spacing:var(--app-header-typography-7-tracking)}.heading-panel{justify-content:flex-start;padding-bottom:calc(var(--space-unit) * 3)}.heading-container,.menu-container{width:auto}:host([flow=\"stack\"]) .heading-panel{flex-flow:column;align-items:flex-start}:host([flow=\"stack\"]) .menu-container{width:100%}:host(:not([flow=\"offcanvas\"],[menu-length=\"0\"])) .heading-panel{row-gap:calc(var(--space-unit) * 3)}z-searchbar{min-width:calc(var(--space-unit) * 45);flex:initial}}@media (min-width: 1366px){:host{--app-header-title-font-size:var(--app-header-typography-9-size);--app-header-title-lineheight:var(--app-header-typography-9-lineheight);--app-header-title-letter-spacing:var(--app-header-typography-9-tracking)}}@keyframes slide-stuck-heading-in{0%{transform:translate3d(0, -100%, 0)}100%{transform:none}}";
|
|
8
|
-
const ZAppHeaderStyle0 = stylesCss$e;
|
|
9
|
-
|
|
10
|
-
const SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== "undefined";
|
|
11
|
-
const ZAppHeader = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
registerInstance(this, hostRef);
|
|
14
|
-
this.sticking = createEvent(this, "sticking", 7);
|
|
15
|
-
this.observer = SUPPORT_INTERSECTION_OBSERVER &&
|
|
16
|
-
new IntersectionObserver(([entry]) => {
|
|
17
|
-
this._stuck = !entry.isIntersecting;
|
|
18
|
-
}, {
|
|
19
|
-
threshold: 0.5,
|
|
20
|
-
});
|
|
21
|
-
this.stuck = false;
|
|
22
|
-
this.hero = undefined;
|
|
23
|
-
this.overlay = false;
|
|
24
|
-
this.flow = "auto";
|
|
25
|
-
this.drawerOpen = false;
|
|
26
|
-
this.enableSearch = false;
|
|
27
|
-
this.searchPlaceholder = "Cerca";
|
|
28
|
-
this.searchString = "";
|
|
29
|
-
this.searchPageUrl = undefined;
|
|
30
|
-
this._stuck = false;
|
|
31
|
-
this.currentViewport = "mobile";
|
|
32
|
-
this.menuLength = undefined;
|
|
33
|
-
this.openDrawer = this.openDrawer.bind(this);
|
|
34
|
-
this.closeDrawer = this.closeDrawer.bind(this);
|
|
35
|
-
this.collectMenuElements = this.collectMenuElements.bind(this);
|
|
36
|
-
}
|
|
37
|
-
evaluateViewport() {
|
|
38
|
-
if (window.innerWidth < 768) {
|
|
39
|
-
this.currentViewport = "mobile";
|
|
40
|
-
}
|
|
41
|
-
else if (window.innerWidth >= 768 && window.innerWidth < 1152) {
|
|
42
|
-
this.currentViewport = "tablet";
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
this.currentViewport = "desktop";
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
onStuck() {
|
|
49
|
-
const scrollParent = this.scrollParent;
|
|
50
|
-
if (!scrollParent) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
this.sticking.emit(this._stuck);
|
|
54
|
-
}
|
|
55
|
-
setMenuFloatingMode() {
|
|
56
|
-
if (this.menuElements.length === 0) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const elements = this.menuElements;
|
|
60
|
-
elements.forEach((element) => {
|
|
61
|
-
element.open = false;
|
|
62
|
-
element.floating = !this.drawerOpen;
|
|
63
|
-
element.verticalContext = this.drawerOpen;
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
get title() {
|
|
67
|
-
const titleElement = this.hostElement.querySelector('[slot="title"]');
|
|
68
|
-
if (titleElement === null) {
|
|
69
|
-
return "";
|
|
70
|
-
}
|
|
71
|
-
return titleElement.textContent.trim();
|
|
72
|
-
}
|
|
73
|
-
get scrollParent() {
|
|
74
|
-
const parent = this.hostElement.offsetParent;
|
|
75
|
-
if (parent === document.body || parent === document.documentElement) {
|
|
76
|
-
return window;
|
|
77
|
-
}
|
|
78
|
-
return parent;
|
|
79
|
-
}
|
|
80
|
-
get canShowMenu() {
|
|
81
|
-
return this.flow !== "offcanvas" && this.currentViewport !== "mobile" && !this.drawerOpen;
|
|
82
|
-
}
|
|
83
|
-
get canShowSearchbar() {
|
|
84
|
-
if (!this.enableSearch) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
// Always show the searchbar on desktop, even if a searchPageUrl is set
|
|
88
|
-
if (this.searchPageUrl) {
|
|
89
|
-
return this.currentViewport === "desktop";
|
|
90
|
-
}
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Whether the header has a hero image, either as a prop or as a slot.
|
|
95
|
-
*/
|
|
96
|
-
get hasHero() {
|
|
97
|
-
return !!this.hero || this.hostElement.querySelector("[slot=hero]") !== null;
|
|
98
|
-
}
|
|
99
|
-
openDrawer() {
|
|
100
|
-
this.drawerOpen = true;
|
|
101
|
-
}
|
|
102
|
-
closeDrawer() {
|
|
103
|
-
this.drawerOpen = false;
|
|
104
|
-
}
|
|
105
|
-
collectMenuElements() {
|
|
106
|
-
const menuElements = (this.menuElements = this.hostElement.querySelectorAll('[slot="menu"]'));
|
|
107
|
-
this.menuLength = menuElements.length;
|
|
108
|
-
this.setMenuFloatingMode();
|
|
109
|
-
}
|
|
110
|
-
enableStuckObserver() {
|
|
111
|
-
if (this.observer) {
|
|
112
|
-
this.observer.observe(this.container);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
disableStuckMode() {
|
|
116
|
-
this._stuck = false;
|
|
117
|
-
if (this.observer) {
|
|
118
|
-
this.observer.unobserve(this.container);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
onStuckMode() {
|
|
122
|
-
if (this.stuck) {
|
|
123
|
-
this.enableStuckObserver();
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
this.disableStuckMode();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
renderSearchLinkButton() {
|
|
130
|
-
if (!this.enableSearch || !this.searchPageUrl || this.currentViewport === "desktop") {
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
return (h("z-button", { class: "search-page-button", variant: ButtonVariant.SECONDARY, href: this.searchPageUrl, icon: "search", size: ControlSize.X_SMALL }));
|
|
134
|
-
}
|
|
135
|
-
renderSeachbar(searchButtonIconOnly) {
|
|
136
|
-
return (h("z-searchbar", { value: this.searchString, placeholder: this.searchPlaceholder, showSearchButton: true, searchButtonIconOnly: searchButtonIconOnly, size: ControlSize.X_SMALL, variant: ButtonVariant.SECONDARY, preventSubmit: this.searchString.length < 3, onSearchTyping: (e) => (this.searchString = e.detail) }));
|
|
137
|
-
}
|
|
138
|
-
componentDidLoad() {
|
|
139
|
-
this.collectMenuElements();
|
|
140
|
-
this.onStuckMode();
|
|
141
|
-
this.evaluateViewport();
|
|
142
|
-
}
|
|
143
|
-
render() {
|
|
144
|
-
return (h(Host, { key: '10a6de9066a2b47fce8c05b28584ebcfbd9d308e', "menu-length": this.menuLength }, this.hasHero && (h("div", { class: "hero-container" }, h("slot", { name: "hero" }, this.hero && (h("img", { alt: "", src: this.hero }))))), h("div", { key: '598744c6237cb30c4d4e467b45944a7879dce93e', class: "heading-panel", ref: (el) => (this.container = el) }, h("div", { key: '2132ed4349abc878b8cec1ca73978fa42dd5c5a4', class: "heading-container" }, h("div", { key: 'd3dcd130c4968e278ca5e0a610ad59a51b630abf', class: "heading-subtitle" }, h("slot", { key: 'd86a2a02577aad72e68d78fccee74d0cafd395e6', name: "top-subtitle" })), h("div", { key: '59f31cad85c438e675a419267cbd1e41b06009c8', class: "heading-title" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("slot", { key: '48a7e46471a03d776f15d30114ffdaf7f90b15cd', name: "title" }), this.renderSearchLinkButton()), h("div", { key: '41320040925b00a83fb6ed7bcd8911b2e2e1b88e', class: "heading-subtitle" }, h("slot", { key: '2da90e290780904617080944c2bcc507e918f9f7', name: "subtitle" }))), (this.canShowMenu || this.canShowSearchbar) && (h("div", { class: "menu-container" }, this.canShowMenu && (h("slot", { name: "menu", onSlotchange: this.collectMenuElements })), this.canShowSearchbar && this.renderSeachbar(this.currentViewport !== "desktop")))), h("z-offcanvas", { key: 'd54bb515efad20ca24686a5bc0743b9e3906dfef', variant: OffCanvasVariant.OVERLAY, transitiondirection: TransitionDirection.RIGHT, open: this.drawerOpen, onCanvasOpenStatusChanged: (ev) => (this.drawerOpen = ev.detail) }, h("button", { key: '22a9c1865a7fcb9660dbcb14c4202e6c78c2166b', class: "drawer-close", "aria-label": "Chiudi menu", onClick: this.closeDrawer, slot: "canvasContent", "aria-hidden": `${!this.drawerOpen}`, disabled: !this.drawerOpen }, h("z-icon", { key: '6bba2e8d9c1d081a8d826654eed502cab8018b87', name: "close" })), h("div", { key: 'edbd9d23c8adc99adc65a6a343e6587a55b4d12c', class: "drawer-content", slot: "canvasContent", "aria-hidden": `${!this.drawerOpen}` }, h("slot", { key: 'd8ba82c48339422e6a2db733839c8cf8062dd2c3', name: "menu", onSlotchange: this.collectMenuElements }))), this._stuck && (h("div", { class: "heading-stuck" }, h("div", { class: "heading-stuck-content" }, this.menuLength > 0 && (h("button", { class: "drawer-trigger", "aria-label": "Apri menu", onClick: this.openDrawer }, h("z-icon", { name: "burger-menu" }))), h("div", { class: "heading-title" }, h("slot", { name: "stucked-title" }, this.title)), this.renderSearchLinkButton(), this.canShowSearchbar && this.currentViewport === "desktop" && this.renderSeachbar(false))))));
|
|
145
|
-
}
|
|
146
|
-
get hostElement() { return getElement(this); }
|
|
147
|
-
static get watchers() { return {
|
|
148
|
-
"_stuck": ["onStuck"],
|
|
149
|
-
"drawerOpen": ["setMenuFloatingMode"],
|
|
150
|
-
"stuck": ["onStuckMode"]
|
|
151
|
-
}; }
|
|
152
|
-
};
|
|
153
|
-
ZAppHeader.style = ZAppHeaderStyle0;
|
|
154
|
-
|
|
155
|
-
const stylesCss$d = ".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-primary02);background-color:var(--color-primary02);color:var(--color-primary01)}[variant=\"tertiary\"].sc-z-button-h .z-button--container.sc-z-button:active{border-color:var(--color-primary02);background-color:var(--color-primary02);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:var(--color-disabled01);background-color:var(--color-disabled01);color:var(--color-disabled02)}";
|
|
156
|
-
const ZButtonStyle0 = stylesCss$d;
|
|
157
|
-
|
|
158
|
-
const ZButton = class {
|
|
159
|
-
constructor(hostRef) {
|
|
160
|
-
registerInstance(this, hostRef);
|
|
161
|
-
this.ariaLabel = "";
|
|
162
|
-
this.role = undefined;
|
|
163
|
-
this.href = undefined;
|
|
164
|
-
this.target = undefined;
|
|
165
|
-
this.htmlid = undefined;
|
|
166
|
-
this.name = undefined;
|
|
167
|
-
this.disabled = false;
|
|
168
|
-
this.type = ButtonType.BUTTON;
|
|
169
|
-
this.variant = ButtonVariant.PRIMARY;
|
|
170
|
-
this.icon = undefined;
|
|
171
|
-
this.size = ControlSize.BIG;
|
|
172
|
-
}
|
|
173
|
-
getAttributes() {
|
|
174
|
-
return {
|
|
175
|
-
id: this.htmlid,
|
|
176
|
-
class: {
|
|
177
|
-
"z-button--container": true,
|
|
178
|
-
"z-button--has-text": !!this.hostElement.textContent.trim(),
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
render() {
|
|
183
|
-
if (this.href) {
|
|
184
|
-
return (h("a", Object.assign({}, this.getAttributes(), { "aria-label": this.ariaLabel, href: this.href, target: this.target }), this.icon && h("z-icon", { name: this.icon }), h("slot", null)));
|
|
185
|
-
}
|
|
186
|
-
return (h("button", Object.assign({}, this.getAttributes(), { "aria-label": this.ariaLabel, name: this.name, type: this.type, role: this.role, disabled: this.disabled }), this.icon && h("z-icon", { name: this.icon }), h("slot", null)));
|
|
187
|
-
}
|
|
188
|
-
get hostElement() { return getElement(this); }
|
|
189
|
-
};
|
|
190
|
-
ZButton.style = ZButtonStyle0;
|
|
191
|
-
|
|
192
|
-
const stylesCss$c = ".sc-z-divider-h{display:block;padding:0;margin:0}.divider-horizontal.sc-z-divider-h{width:100%}.divider-vertical.sc-z-divider-h{height:100%}.divider-small.divider-horizontal.sc-z-divider-h{height:var(--border-size-small)}.divider-medium.divider-horizontal.sc-z-divider-h{height:var(--border-size-medium)}.divider-large.divider-horizontal.sc-z-divider-h{height:var(--border-size-large)}.divider-small.divider-vertical.sc-z-divider-h{width:var(--border-size-small)}.divider-medium.divider-vertical.sc-z-divider-h{width:var(--border-size-medium)}.divider-large.divider-vertical.sc-z-divider-h{width:var(--border-size-large)}";
|
|
193
|
-
const ZDividerStyle0 = stylesCss$c;
|
|
194
|
-
|
|
195
|
-
const ZDivider = class {
|
|
196
|
-
constructor(hostRef) {
|
|
197
|
-
registerInstance(this, hostRef);
|
|
198
|
-
this.size = DividerSize.SMALL;
|
|
199
|
-
this.color = "gray200";
|
|
200
|
-
this.orientation = DividerOrientation.HORIZONTAL;
|
|
201
|
-
}
|
|
202
|
-
render() {
|
|
203
|
-
return (h(Host, { key: 'ae08a473772cfda024b84cdf94e83e634a66c73f', class: `divider-${this.size} divider-${this.orientation}`, style: { backgroundColor: `var(--${this.color})` } }));
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
ZDivider.style = ZDividerStyle0;
|
|
207
|
-
|
|
208
|
-
const stylesCss$b = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.dragdrop{position:relative;display:flex;height:228px;flex-direction:column;padding:calc(var(--space-unit) * 2);border-color:var(--color-surface04);background-color:var(--color-surface02);background-image:url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='2' ry='2' stroke='%23CACCCEFF' stroke-width='2' stroke-dasharray='15%2c 10%2c 14%2c 11' stroke-dashoffset='3' stroke-linecap='square'/%3e%3c/svg%3e\");border-radius:2px;color:var(--color-text01)}:host>.dragdrop.dragover *{pointer-events:none}:host>.dragdrop .dragover-container{position:absolute;z-index:10;top:0;left:0;display:none;width:100%;height:100%;background-color:var(--color-primary03);box-shadow:var(--shadow-focus-primary)}:host>.dragdrop .dragover-container .dragover-message{padding:10px 28px;background-color:var(--color-link-primary);color:var(--color-text04)}:host>.dragdrop.dragover .dragover-container{display:flex;align-items:center;justify-content:center}";
|
|
209
|
-
const ZDragdropAreaStyle0 = stylesCss$b;
|
|
210
|
-
|
|
211
|
-
const ZDragdropArea = class {
|
|
212
|
-
constructor(hostRef) {
|
|
213
|
-
registerInstance(this, hostRef);
|
|
214
|
-
this.fileDropped = createEvent(this, "fileDropped", 7);
|
|
215
|
-
this.dragAndDropLabel = undefined;
|
|
216
|
-
}
|
|
217
|
-
fileDroppedHandler(files) {
|
|
218
|
-
this.fileDropped.emit(files);
|
|
219
|
-
}
|
|
220
|
-
renderOnDragOverMessage() {
|
|
221
|
-
return (h("div", { class: "dragover-container" }, h("div", { class: "dragover-message" }, h("span", { class: "body-2-sb" }, this.dragAndDropLabel))));
|
|
222
|
-
}
|
|
223
|
-
render() {
|
|
224
|
-
return (h("div", { key: '8bd841a6a59b438bd0e794a842aa6326dd88ef04', tabIndex: 0, ref: (val) => (this.dragDropContainer = val), class: "dragdrop", onDragOver: (e) => {
|
|
225
|
-
e.preventDefault();
|
|
226
|
-
this.dragDropContainer.classList.add("dragover");
|
|
227
|
-
}, onDragLeave: () => {
|
|
228
|
-
this.dragDropContainer.classList.remove("dragover");
|
|
229
|
-
}, onDrop: (e) => {
|
|
230
|
-
e.preventDefault();
|
|
231
|
-
if (e.dataTransfer.files.length) {
|
|
232
|
-
this.dragDropContainer.classList.remove("dragover");
|
|
233
|
-
this.fileDroppedHandler(e.dataTransfer.files);
|
|
234
|
-
}
|
|
235
|
-
} }, this.renderOnDragOverMessage(), h("slot", { key: 'd99944c1db4408ff5028f628e35c9d5225a37055' })));
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
ZDragdropArea.style = ZDragdropAreaStyle0;
|
|
239
|
-
|
|
240
|
-
const stylesCss$a = ":host{color:var(--color-text01);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.container{display:flex;flex-direction:column}:host .modal-wrapper{display:flex;align-items:center;justify-content:center;padding:calc(var(--space-unit) * 2)}:host .modal-wrapper>.files-wrapper{display:flex;flex-direction:column;margin:calc(var(--space-unit) * 4);gap:var(--space-unit)}:host .text-container{display:flex;flex-direction:column;margin:auto}:host .text-container .body-1{text-align:center}:host .text-container .upload-link{color:var(--color-link-primary);cursor:pointer}:host .text-container .upload-link-text{margin-bottom:var(--space-unit)}input#file-elem{display:none}#title{display:inline-block;margin:calc(var(--space-unit) * 2.5) 0 calc(var(--space-unit) * 4);font-size:calc(var(--space-unit) * 3);font-weight:var(--font-sb)}:host>.container>z-button{display:inline-block;margin-top:calc(var(--space-unit) * 3)}:host>.container>.files-container.hidden{display:none}:host>.container>.files-container>.heading-4-sb{display:inline-block;margin:calc(var(--space-unit) * 3) 0;font-size:calc(var(--space-unit) * 2);font-weight:var(--font-sb)}:host([type=\"dragdrop\"])>.container>.files-container>.heading-4-sb{margin-top:0;margin-bottom:calc(var(--space-unit) * 3)}:host>.container>.files-container>.files-wrapper{display:flex;flex-wrap:wrap;column-gap:calc(var(--space-unit) * 2);row-gap:calc(var(--space-unit) * 2)}:host>.container>.files-container>z-divider{margin-top:calc(var(--space-unit) * 3);margin-bottom:0}:host([type=\"dragdrop\"])>.container>.files-container>z-divider{margin:calc(var(--space-unit) * 3) 0}@media only screen and (min-width: 768px){:host>.container>z-button{align-self:flex-start}:host .modal-wrapper{padding:calc(var(--space-unit) * 3)}}@media only screen and (min-width: 1152px){:host .modal-wrapper{padding:calc(var(--space-unit) * 4)}}";
|
|
241
|
-
const ZFileUploadStyle0 = stylesCss$a;
|
|
242
|
-
|
|
243
|
-
const ZFileUpload = class {
|
|
244
|
-
constructor(hostRef) {
|
|
245
|
-
registerInstance(this, hostRef);
|
|
246
|
-
this.fileInput = createEvent(this, "fileInput", 7);
|
|
247
|
-
this.inputAttributes = {
|
|
248
|
-
type: "file",
|
|
249
|
-
id: "file-elem",
|
|
250
|
-
multiple: true,
|
|
251
|
-
};
|
|
252
|
-
this.type = ZFileUploadType.DEFAULT;
|
|
253
|
-
this.buttonVariant = undefined;
|
|
254
|
-
this.acceptedFormat = undefined;
|
|
255
|
-
this.fileMaxSize = undefined;
|
|
256
|
-
this.mainTitle = undefined;
|
|
257
|
-
this.description = undefined;
|
|
258
|
-
this.files = [];
|
|
259
|
-
this.uploadBtnLabel = "allega";
|
|
260
|
-
this.dragAndDropLabel = "Rilascia i file in questa area per allegarli.";
|
|
261
|
-
this.hasFileSection = true;
|
|
262
|
-
this.invalidFiles = undefined;
|
|
263
|
-
}
|
|
264
|
-
/** Listen removeFile event sent from z-file component */
|
|
265
|
-
removeFileListener(e) {
|
|
266
|
-
const files = this.files;
|
|
267
|
-
const file = files.find((file) => file.name === e.detail.fileName);
|
|
268
|
-
if (file) {
|
|
269
|
-
const index = files.indexOf(file);
|
|
270
|
-
if (index >= 0) {
|
|
271
|
-
files.splice(index, 1);
|
|
272
|
-
this.files = [...files];
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
/** Listen fileDropped event sent from z-dragdrop-area component */
|
|
277
|
-
fileDroppedListener(e) {
|
|
278
|
-
this.input.files = e.detail;
|
|
279
|
-
this.fileInputHandler();
|
|
280
|
-
}
|
|
281
|
-
componentDidUpdate() {
|
|
282
|
-
this.handleAccessibility();
|
|
283
|
-
this.invalidFiles.size && this.errorModal.focus();
|
|
284
|
-
}
|
|
285
|
-
componentWillLoad() {
|
|
286
|
-
this.invalidFiles = new Map();
|
|
287
|
-
}
|
|
288
|
-
fileInputHandler() {
|
|
289
|
-
if (this.input.files.length) {
|
|
290
|
-
this.invalidFiles = this.checkFiles(Array.from(this.input.files));
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
/** get array of uploaded files */
|
|
294
|
-
async getFiles() {
|
|
295
|
-
return this.files;
|
|
296
|
-
}
|
|
297
|
-
getType() {
|
|
298
|
-
if (getDevice() !== Device.DESKTOP && getDevice() !== Device.DESKTOP_WIDE) {
|
|
299
|
-
return ZFileUploadType.DEFAULT;
|
|
300
|
-
}
|
|
301
|
-
return this.type;
|
|
302
|
-
}
|
|
303
|
-
handleAccessibility() {
|
|
304
|
-
const lastFile = this.el.querySelector("z-file:last-child z-chip button");
|
|
305
|
-
if (this.files.length > 0 && lastFile) {
|
|
306
|
-
lastFile.focus();
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
this.getType() === ZFileUploadType.DEFAULT
|
|
310
|
-
? this.button.querySelector("button").focus()
|
|
311
|
-
: this.uploadLink.focus();
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
checkFiles(files) {
|
|
315
|
-
const errors = new Map();
|
|
316
|
-
const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;
|
|
317
|
-
const formatErrorString = " ha un'estensione non prevista";
|
|
318
|
-
files.forEach((file) => {
|
|
319
|
-
const fileSize = file.size / 1024 / 1024;
|
|
320
|
-
const fileFormatOk = this.acceptedFormat
|
|
321
|
-
.split(",")
|
|
322
|
-
.some((ext) => file.name.toLowerCase().endsWith(ext.trim()));
|
|
323
|
-
const fileSizeOk = fileSize <= this.fileMaxSize;
|
|
324
|
-
if (fileSizeOk && fileFormatOk) {
|
|
325
|
-
if (!this.files.find((f) => f.name === file.name)) {
|
|
326
|
-
this.files.push(file);
|
|
327
|
-
this.fileInput.emit(file);
|
|
328
|
-
this.input.value = "";
|
|
329
|
-
}
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
errors.set(file.name, []);
|
|
333
|
-
if (!fileSizeOk) {
|
|
334
|
-
errors.get(file.name).push(sizeErrorString);
|
|
335
|
-
}
|
|
336
|
-
if (!fileFormatOk) {
|
|
337
|
-
errors.get(file.name).push(formatErrorString);
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
return errors;
|
|
341
|
-
}
|
|
342
|
-
renderTitle() {
|
|
343
|
-
return h("span", { id: "title" }, this.mainTitle);
|
|
344
|
-
}
|
|
345
|
-
renderDescription(cssClass) {
|
|
346
|
-
return h("span", { class: cssClass }, this.description);
|
|
347
|
-
}
|
|
348
|
-
renderAllowedFileExtensions() {
|
|
349
|
-
let fileFormatString = "";
|
|
350
|
-
let fileWeightString = "";
|
|
351
|
-
if (this.acceptedFormat) {
|
|
352
|
-
const fileFormat = this.acceptedFormat
|
|
353
|
-
.split(", ")
|
|
354
|
-
.map((string) => string.substring(1).toUpperCase())
|
|
355
|
-
.join(", ");
|
|
356
|
-
fileFormatString = ` nei formati ${fileFormat}`;
|
|
357
|
-
}
|
|
358
|
-
if (this.fileMaxSize) {
|
|
359
|
-
fileWeightString = ` per un massimo di ${this.fileMaxSize}MB di peso`;
|
|
360
|
-
}
|
|
361
|
-
const finalString = `Puoi allegare file${fileFormatString}${fileWeightString}.`;
|
|
362
|
-
return h("span", { class: "body-3" }, fileFormatString || fileWeightString ? finalString : null);
|
|
363
|
-
}
|
|
364
|
-
renderFileSection() {
|
|
365
|
-
if (!this.hasFileSection) {
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
return (h("section", { class: `files-container ${!this.files.length ? "hidden" : ""}` }, h("span", { class: "heading-4-sb" }, "File appena caricati"), h("div", { class: "files-wrapper" }, h("slot", { name: "files" })), h("z-divider", { size: DividerSize.MEDIUM })));
|
|
369
|
-
}
|
|
370
|
-
renderInput() {
|
|
371
|
-
return (h("input", Object.assign({}, this.inputAttributes, { onChange: () => this.fileInputHandler(), accept: this.acceptedFormat, ref: (val) => (this.input = val) })));
|
|
372
|
-
}
|
|
373
|
-
renderUploadButton() {
|
|
374
|
-
return [
|
|
375
|
-
this.renderInput(),
|
|
376
|
-
h("z-button", { onClick: () => this.input.click(), onKeyPress: (e) => {
|
|
377
|
-
if (e.code == "Space" || e.code == "Enter") {
|
|
378
|
-
e.preventDefault();
|
|
379
|
-
this.input.click();
|
|
380
|
-
}
|
|
381
|
-
}, id: "fileSelect", variant: this.buttonVariant, icon: "upload", ref: (val) => (this.button = val) }, this.uploadBtnLabel),
|
|
382
|
-
];
|
|
383
|
-
}
|
|
384
|
-
renderUploadLink() {
|
|
385
|
-
return [
|
|
386
|
-
this.renderInput(),
|
|
387
|
-
h("span", { class: "body-1 upload-link-text" }, "Trascina o", " ", h("span", { tabIndex: 0, class: "body-1-sb upload-link", onClick: () => this.input.click(), onKeyPress: (e) => {
|
|
388
|
-
if (e.code == "Space" || e.code == "Enter") {
|
|
389
|
-
e.preventDefault();
|
|
390
|
-
this.input.click();
|
|
391
|
-
}
|
|
392
|
-
}, ref: (val) => (this.uploadLink = val) }, "carica"), " ", "dal tuo computer"),
|
|
393
|
-
];
|
|
394
|
-
}
|
|
395
|
-
renderDefaultMode() {
|
|
396
|
-
return [
|
|
397
|
-
this.renderDescription("body-3-sb"),
|
|
398
|
-
this.renderAllowedFileExtensions(),
|
|
399
|
-
this.renderFileSection(),
|
|
400
|
-
this.renderUploadButton(),
|
|
401
|
-
];
|
|
402
|
-
}
|
|
403
|
-
renderDragDropMode() {
|
|
404
|
-
return [
|
|
405
|
-
this.renderFileSection(),
|
|
406
|
-
h("z-dragdrop-area", { "drag-and-drop-label": this.dragAndDropLabel }, h("div", { class: "text-container" }, this.renderDescription("body-1"), this.renderUploadLink(), this.renderAllowedFileExtensions())),
|
|
407
|
-
];
|
|
408
|
-
}
|
|
409
|
-
formatErrorString(key, value) {
|
|
410
|
-
var _a, _b;
|
|
411
|
-
const bothErrors = value[0] && value[1] ? ", ed " : "";
|
|
412
|
-
return `Il file ${key} ${(_a = value[0]) !== null && _a !== void 0 ? _a : ""}${bothErrors}${(_b = value[1]) !== null && _b !== void 0 ? _b : ""}.`;
|
|
413
|
-
}
|
|
414
|
-
handleErrorModalContent() {
|
|
415
|
-
return (h("div", { slot: "modalContent" }, h("div", { class: "modal-wrapper" }, h("div", { class: "files" }, Array.from(this.invalidFiles).map(([key, value]) => {
|
|
416
|
-
return h("span", { class: "body-3" }, this.formatErrorString(key, value));
|
|
417
|
-
})))));
|
|
418
|
-
}
|
|
419
|
-
render() {
|
|
420
|
-
return (h(Host, { key: '46b4fcbc231e01141adf45e82ff89b215b78f973' }, h("div", { key: '53fc8651254f42780909ad8d6c9c36311e626dc9', tabIndex: 0, class: `container ${this.getType()}` }, this.mainTitle && this.renderTitle(), this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()), !!this.invalidFiles.size && (h("z-modal", { modalid: `file-upload-${this.type}-error-modal`, tabIndex: 0, ref: (val) => (this.errorModal = val), modaltitle: "Attenzione", onModalClose: () => (this.invalidFiles = new Map()), onModalBackgroundClick: () => (this.invalidFiles = new Map()) }, this.handleErrorModalContent()))));
|
|
421
|
-
}
|
|
422
|
-
get el() { return getElement(this); }
|
|
423
|
-
};
|
|
424
|
-
ZFileUpload.style = ZFileUploadStyle0;
|
|
425
|
-
|
|
426
|
-
const stylesCss$9 = ":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)}";
|
|
427
|
-
const ZIconStyle0 = stylesCss$9;
|
|
428
|
-
|
|
429
|
-
const ZIcon = class {
|
|
430
|
-
constructor(hostRef) {
|
|
431
|
-
registerInstance(this, hostRef);
|
|
432
|
-
this.name = undefined;
|
|
433
|
-
this.height = undefined;
|
|
434
|
-
this.width = undefined;
|
|
435
|
-
this.iconid = undefined;
|
|
436
|
-
this.fill = undefined;
|
|
437
|
-
}
|
|
438
|
-
selectPathOrPolygon(iconValue) {
|
|
439
|
-
if (iconValue === null || iconValue === void 0 ? void 0 : iconValue.startsWith("M")) {
|
|
440
|
-
return h("path", { d: ICONS[this.name] });
|
|
441
|
-
}
|
|
442
|
-
return h("polygon", { points: ICONS[this.name] });
|
|
443
|
-
}
|
|
444
|
-
render() {
|
|
445
|
-
return (h(Host, { key: '2b01f04c92ac8e4772036eb52aad46a62d46d35c', "aria-hidden": "true" }, h("svg", { key: '18067d6877c79af11d5af240d030c8f82531cf6b', viewBox: "0 0 1000 1000", width: this.width, height: this.height, id: this.iconid, fill: this.fill ? `var(--${this.fill})` : "" }, this.selectPathOrPolygon(ICONS[this.name]))));
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
ZIcon.style = ZIconStyle0;
|
|
449
|
-
|
|
450
|
-
const stylesCss$8 = ".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,[readonly=\"false\"].sc-z-input-h .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(--color-primary01)}.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:not([readonly]):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)}";
|
|
451
|
-
const ZInputStyle0 = stylesCss$8;
|
|
452
|
-
|
|
453
|
-
const ZInput = class {
|
|
454
|
-
constructor(hostRef) {
|
|
455
|
-
registerInstance(this, hostRef);
|
|
456
|
-
this.inputChange = createEvent(this, "inputChange", 7);
|
|
457
|
-
this.startTyping = createEvent(this, "startTyping", 7);
|
|
458
|
-
this.stopTyping = createEvent(this, "stopTyping", 7);
|
|
459
|
-
this.inputCheck = createEvent(this, "inputCheck", 7);
|
|
460
|
-
this.typingtimeout = 300;
|
|
461
|
-
this.htmlid = `id-${randomId()}`;
|
|
462
|
-
this.type = undefined;
|
|
463
|
-
this.name = undefined;
|
|
464
|
-
this.label = undefined;
|
|
465
|
-
this.ariaLabel = "";
|
|
466
|
-
this.ariaExpanded = undefined;
|
|
467
|
-
this.ariaControls = undefined;
|
|
468
|
-
this.ariaAutocomplete = undefined;
|
|
469
|
-
this.ariaActivedescendant = undefined;
|
|
470
|
-
this.value = undefined;
|
|
471
|
-
this.disabled = false;
|
|
472
|
-
this.readonly = false;
|
|
473
|
-
this.required = false;
|
|
474
|
-
this.checked = false;
|
|
475
|
-
this.placeholder = undefined;
|
|
476
|
-
this.htmltitle = undefined;
|
|
477
|
-
this.status = undefined;
|
|
478
|
-
this.message = true;
|
|
479
|
-
this.labelPosition = LabelPosition.RIGHT;
|
|
480
|
-
this.autocomplete = undefined;
|
|
481
|
-
this.role = undefined;
|
|
482
|
-
this.hasclearicon = true;
|
|
483
|
-
this.icon = undefined;
|
|
484
|
-
this.min = undefined;
|
|
485
|
-
this.minlength = undefined;
|
|
486
|
-
this.max = undefined;
|
|
487
|
-
this.maxlength = undefined;
|
|
488
|
-
this.step = undefined;
|
|
489
|
-
this.pattern = undefined;
|
|
490
|
-
this.size = ControlSize.BIG;
|
|
491
|
-
this.isTyping = false;
|
|
492
|
-
this.passwordHidden = true;
|
|
493
|
-
}
|
|
494
|
-
inputCheckListener(e) {
|
|
495
|
-
const data = e.detail;
|
|
496
|
-
switch (this.type) {
|
|
497
|
-
case InputType.RADIO:
|
|
498
|
-
if (data.type === InputType.RADIO && data.name === this.name && data.id !== this.htmlid) {
|
|
499
|
-
this.checked = false;
|
|
500
|
-
}
|
|
501
|
-
break;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
/** get checked status */
|
|
505
|
-
async isChecked() {
|
|
506
|
-
switch (this.type) {
|
|
507
|
-
case InputType.CHECKBOX:
|
|
508
|
-
case InputType.RADIO:
|
|
509
|
-
return this.checked;
|
|
510
|
-
default:
|
|
511
|
-
console.warn("`isChecked` method is only available for type `checkbox` and `radio`");
|
|
512
|
-
return false;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
emitInputChange(value) {
|
|
516
|
-
if (!this.isTyping) {
|
|
517
|
-
this.emitStartTyping();
|
|
518
|
-
}
|
|
519
|
-
let validity;
|
|
520
|
-
if (this.type === InputType.TEXTAREA) {
|
|
521
|
-
validity = this.getValidity("textarea");
|
|
522
|
-
}
|
|
523
|
-
else {
|
|
524
|
-
validity = this.getValidity("input");
|
|
525
|
-
}
|
|
526
|
-
this.value = value;
|
|
527
|
-
this.inputChange.emit({ value, validity });
|
|
528
|
-
clearTimeout(this.timer);
|
|
529
|
-
this.timer = setTimeout(() => {
|
|
530
|
-
this.emitStopTyping(this.value, validity);
|
|
531
|
-
}, this.typingtimeout);
|
|
532
|
-
}
|
|
533
|
-
emitStartTyping() {
|
|
534
|
-
this.isTyping = true;
|
|
535
|
-
this.startTyping.emit();
|
|
536
|
-
}
|
|
537
|
-
emitStopTyping(value, validity) {
|
|
538
|
-
this.isTyping = false;
|
|
539
|
-
this.stopTyping.emit({
|
|
540
|
-
value: value,
|
|
541
|
-
validity: validity,
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
emitInputCheck(checked) {
|
|
545
|
-
this.inputCheck.emit({
|
|
546
|
-
id: this.htmlid,
|
|
547
|
-
checked: checked,
|
|
548
|
-
type: this.type,
|
|
549
|
-
name: this.name,
|
|
550
|
-
value: this.value,
|
|
551
|
-
validity: this.getValidity("input"),
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
getValidity(type) {
|
|
555
|
-
const input = this.hostElement.querySelector(type);
|
|
556
|
-
return input.validity;
|
|
557
|
-
}
|
|
558
|
-
/* START text/password/email/number */
|
|
559
|
-
getTextAttributes() {
|
|
560
|
-
return {
|
|
561
|
-
id: this.htmlid,
|
|
562
|
-
name: this.name,
|
|
563
|
-
placeholder: this.placeholder,
|
|
564
|
-
value: this.value,
|
|
565
|
-
disabled: this.disabled,
|
|
566
|
-
readonly: this.readonly,
|
|
567
|
-
required: this.required,
|
|
568
|
-
title: this.htmltitle,
|
|
569
|
-
minlength: this.minlength,
|
|
570
|
-
maxlength: this.maxlength,
|
|
571
|
-
class: {
|
|
572
|
-
[`input-${this.status}`]: !!this.status,
|
|
573
|
-
filled: !!this.value,
|
|
574
|
-
},
|
|
575
|
-
autocomplete: this.autocomplete,
|
|
576
|
-
onInput: (e) => this.emitInputChange(e.target.value),
|
|
577
|
-
};
|
|
578
|
-
}
|
|
579
|
-
getNumberAttributes(type) {
|
|
580
|
-
if (type != InputType.NUMBER) {
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
return {
|
|
584
|
-
min: this.min,
|
|
585
|
-
max: this.max,
|
|
586
|
-
step: this.step,
|
|
587
|
-
};
|
|
588
|
-
}
|
|
589
|
-
getPatternAttribute(type) {
|
|
590
|
-
if (type != InputType.PASSWORD &&
|
|
591
|
-
type != InputType.TEXT &&
|
|
592
|
-
type != InputType.TEL &&
|
|
593
|
-
type != InputType.SEARCH &&
|
|
594
|
-
type != InputType.URL &&
|
|
595
|
-
type != InputType.EMAIL) {
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
return {
|
|
599
|
-
pattern: this.pattern,
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
getRoleAttribute() {
|
|
603
|
-
return this.role ? { role: this.role } : {};
|
|
604
|
-
}
|
|
605
|
-
getAriaAttrubutes() {
|
|
606
|
-
const expanded = this.ariaExpanded ? { "aria-expanded": this.ariaExpanded } : {};
|
|
607
|
-
const controls = this.ariaControls ? { "aria-controls": this.ariaControls } : {};
|
|
608
|
-
const autocomplete = this.ariaAutocomplete ? { "aria-autocomplete": this.ariaAutocomplete } : {};
|
|
609
|
-
const activedescendant = this.ariaActivedescendant ? { "aria-activedescendant": this.ariaActivedescendant } : {};
|
|
610
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, expanded), controls), autocomplete), activedescendant);
|
|
611
|
-
}
|
|
612
|
-
renderInputText(type = InputType.TEXT) {
|
|
613
|
-
const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
|
|
614
|
-
const attr = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.getTextAttributes()), this.getNumberAttributes(type)), this.getPatternAttribute(type)), ariaLabel), this.getRoleAttribute()), this.getAriaAttrubutes());
|
|
615
|
-
if (this.icon || type === InputType.PASSWORD) {
|
|
616
|
-
Object.assign(attr.class, { "has-icon": true });
|
|
617
|
-
}
|
|
618
|
-
if (this.hasclearicon && type != InputType.NUMBER) {
|
|
619
|
-
Object.assign(attr.class, { "has-clear-icon": true });
|
|
620
|
-
}
|
|
621
|
-
return (h("div", { class: "text-wrapper" }, this.renderLabel(), h("div", null, h("input", Object.assign({ type: type === InputType.PASSWORD && !this.passwordHidden ? InputType.TEXT : type }, attr, { ref: (el) => (this.inputRef = el) })), this.renderIcons()), this.renderMessage()));
|
|
622
|
-
}
|
|
623
|
-
renderLabel() {
|
|
624
|
-
if (!this.label) {
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
return (h("label", { class: "input-label body-5-sb", id: `${this.htmlid}_label`, htmlFor: this.htmlid }, this.label));
|
|
628
|
-
}
|
|
629
|
-
renderIcons() {
|
|
630
|
-
return (h("span", { class: "icons-wrapper" }, this.renderResetIcon(), this.renderIcon()));
|
|
631
|
-
}
|
|
632
|
-
renderIcon() {
|
|
633
|
-
if (this.type === InputType.PASSWORD) {
|
|
634
|
-
return this.renderShowHidePassword();
|
|
635
|
-
}
|
|
636
|
-
if (!this.icon) {
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
return (h("button", { type: "button", class: "icon-button input-icon", tabIndex: -1, "aria-hidden": "true" }, h("z-icon", { name: this.icon, class: this.size })));
|
|
640
|
-
}
|
|
641
|
-
renderResetIcon() {
|
|
642
|
-
let hidden = false;
|
|
643
|
-
if (!this.hasclearicon || !this.value || this.disabled || this.readonly || this.type == InputType.NUMBER) {
|
|
644
|
-
hidden = true;
|
|
645
|
-
}
|
|
646
|
-
return (h("button", { type: "button", class: `icon-button reset-icon ${hidden ? "hidden" : ""}`, "aria-label": "cancella il contenuto dell'input", onClick: () => {
|
|
647
|
-
this.inputRef.value = "";
|
|
648
|
-
this.emitInputChange("");
|
|
649
|
-
} }, h("z-icon", { name: "multiply", class: this.size })));
|
|
650
|
-
}
|
|
651
|
-
renderShowHidePassword() {
|
|
652
|
-
return (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) }, h("z-icon", { name: this.passwordHidden ? "view-filled" : "view-off-filled", class: this.size })));
|
|
653
|
-
}
|
|
654
|
-
renderMessage() {
|
|
655
|
-
if (boolean(this.message) === false) {
|
|
656
|
-
return;
|
|
657
|
-
}
|
|
658
|
-
return (h("z-input-message", { message: boolean(this.message) === true ? undefined : this.message, status: this.status, class: this.size }));
|
|
659
|
-
}
|
|
660
|
-
/* END text/password/email/number */
|
|
661
|
-
/* START textarea */
|
|
662
|
-
renderTextarea() {
|
|
663
|
-
const attributes = this.getTextAttributes();
|
|
664
|
-
const ariaLabel = this.ariaLabel ? { "aria-label": this.ariaLabel } : {};
|
|
665
|
-
return (h("div", { class: "text-wrapper" }, this.renderLabel(), h("div", { class: Object.assign(Object.assign({}, attributes.class), { "textarea-wrapper": true, "readonly": attributes.readonly }) }, h("textarea", Object.assign({}, attributes, ariaLabel, this.getRoleAttribute()))), this.renderMessage()));
|
|
666
|
-
}
|
|
667
|
-
/* END textarea */
|
|
668
|
-
handleCheck(ev) {
|
|
669
|
-
this.checked = ev.target.checked;
|
|
670
|
-
this.emitInputCheck(this.checked);
|
|
671
|
-
}
|
|
672
|
-
/* START checkbox */
|
|
673
|
-
renderCheckbox() {
|
|
674
|
-
return (h("div", { class: "checkbox-wrapper" }, h("input", Object.assign({ id: this.htmlid, type: "checkbox", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, required: this.required, onChange: this.handleCheck.bind(this), value: this.value }, this.getRoleAttribute())), h("label", { htmlFor: this.htmlid, class: {
|
|
675
|
-
"checkbox-label": true,
|
|
676
|
-
"after": this.labelPosition === LabelPosition.RIGHT,
|
|
677
|
-
"before": this.labelPosition === LabelPosition.LEFT,
|
|
678
|
-
} }, h("z-icon", { name: this.checked ? "checkbox-checked" : "checkbox", "aria-hidden": "true", class: this.size }), this.label && h("span", { innerHTML: this.label }))));
|
|
679
|
-
}
|
|
680
|
-
/* END checkbox */
|
|
681
|
-
/* START radio */
|
|
682
|
-
renderRadio() {
|
|
683
|
-
return (h("div", { class: "radio-wrapper" }, h("input", Object.assign({ id: this.htmlid, type: "radio", name: this.name, checked: this.checked, disabled: this.disabled, readonly: this.readonly, onChange: this.handleCheck.bind(this), value: this.value }, this.getRoleAttribute())), h("label", { htmlFor: this.htmlid, class: {
|
|
684
|
-
"radio-label": true,
|
|
685
|
-
"after": this.labelPosition === LabelPosition.RIGHT,
|
|
686
|
-
"before": this.labelPosition === LabelPosition.LEFT,
|
|
687
|
-
} }, h("z-icon", { name: this.checked ? "radio-button-checked" : "radio-button", "aria-hidden": "true", class: this.size }), this.label && h("span", { innerHTML: this.label }))));
|
|
688
|
-
}
|
|
689
|
-
/* END radio */
|
|
690
|
-
render() {
|
|
691
|
-
let input;
|
|
692
|
-
switch (this.type) {
|
|
693
|
-
case InputType.TEXTAREA:
|
|
694
|
-
input = this.renderTextarea();
|
|
695
|
-
break;
|
|
696
|
-
case InputType.CHECKBOX:
|
|
697
|
-
input = this.renderCheckbox();
|
|
698
|
-
break;
|
|
699
|
-
case InputType.RADIO:
|
|
700
|
-
input = this.renderRadio();
|
|
701
|
-
break;
|
|
702
|
-
default:
|
|
703
|
-
input = this.renderInputText(this.type);
|
|
704
|
-
}
|
|
705
|
-
return h(Host, { key: '67a39cc20219fa02de2cca264a5d51428f4359f3' }, input);
|
|
706
|
-
}
|
|
707
|
-
get hostElement() { return getElement(this); }
|
|
708
|
-
};
|
|
709
|
-
ZInput.style = ZInputStyle0;
|
|
710
|
-
|
|
711
|
-
const stylesCss$7 = ":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)}";
|
|
712
|
-
const ZInputMessageStyle0 = stylesCss$7;
|
|
713
|
-
|
|
714
|
-
const ZInputMessage = class {
|
|
715
|
-
constructor(hostRef) {
|
|
716
|
-
registerInstance(this, hostRef);
|
|
717
|
-
this.statusIcons = {
|
|
718
|
-
success: "checkmark-circle",
|
|
719
|
-
error: "multiply-circled",
|
|
720
|
-
warning: "exclamation-circle",
|
|
721
|
-
};
|
|
722
|
-
this.message = undefined;
|
|
723
|
-
this.status = undefined;
|
|
724
|
-
this.statusRole = {};
|
|
725
|
-
}
|
|
726
|
-
onMessageChange() {
|
|
727
|
-
this.statusRole = this.message && this.status ? { role: "alert" } : {};
|
|
728
|
-
}
|
|
729
|
-
componentWillLoad() {
|
|
730
|
-
this.onMessageChange();
|
|
731
|
-
}
|
|
732
|
-
render() {
|
|
733
|
-
return (h(Host, Object.assign({ key: '7cb2d7df7604fbc5801ce1eb9142155a4905861d' }, this.statusRole, { "aria-label": this.message }), this.statusIcons[this.status] && this.message && h("z-icon", { name: this.statusIcons[this.status] }), h("span", { key: 'd1734748c3be02eba1d40526855bc4ea69e454f8', innerHTML: this.message })));
|
|
734
|
-
}
|
|
735
|
-
static get watchers() { return {
|
|
736
|
-
"message": ["onMessageChange"],
|
|
737
|
-
"status": ["onMessageChange"]
|
|
738
|
-
}; }
|
|
739
|
-
};
|
|
740
|
-
ZInputMessage.style = ZInputMessageStyle0;
|
|
741
|
-
|
|
742
|
-
const stylesCss$6 = ":host{display:flex;flex-direction:column;font-family:var(--font-family-sans);font-weight:var(--font-rg)}";
|
|
743
|
-
const ZListStyle0 = stylesCss$6;
|
|
744
|
-
|
|
745
|
-
const ZList = class {
|
|
746
|
-
constructor(hostRef) {
|
|
747
|
-
registerInstance(this, hostRef);
|
|
748
|
-
this.size = ListSize.MEDIUM;
|
|
749
|
-
this.listType = ListType.NONE;
|
|
750
|
-
this.role = "list";
|
|
751
|
-
}
|
|
752
|
-
setChildrenSizeType() {
|
|
753
|
-
const children = this.host.children;
|
|
754
|
-
for (let i = 0; i < children.length; i++) {
|
|
755
|
-
children[i].setAttribute("size", this.size);
|
|
756
|
-
children[i].setAttribute("list-type", this.listType);
|
|
757
|
-
children[i].setAttribute("list-element-position", (i + 1).toString());
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
componentDidLoad() {
|
|
761
|
-
this.setChildrenSizeType();
|
|
762
|
-
}
|
|
763
|
-
render() {
|
|
764
|
-
return (h(Host, { key: '2593adc6912a0a49a9e38eadd5056d779cac33b4' }, h("slot", { key: '5fb99c0f4cad9633c84d2c353334fc5c816be5a5' })));
|
|
765
|
-
}
|
|
766
|
-
get host() { return getElement(this); }
|
|
767
|
-
};
|
|
768
|
-
ZList.style = ZListStyle0;
|
|
769
|
-
|
|
770
|
-
const stylesCss$5 = ":host{outline:none}:host>.container,:host>.container-contextual-menu{--background-color-list-element:var(--color-surface01);--background-hover-color-list-element:var(--color-surface02);--background-active-color-list-element:var(--color-surface02);display:flex;box-sizing:border-box;flex-direction:column;justify-content:center;font-family:var(--font-family-sans);font-weight:var(--font-rg);outline:none}:host([size=\"small\"])>.container{min-height:calc(var(--space-unit) * 4);padding:calc(var(--space-unit) / 2) 0}:host([size=\"medium\"])>.container{min-height:calc(var(--space-unit) * 5);padding:var(--space-unit) 0}:host([size=\"large\"])>.container{min-height:calc(var(--space-unit) * 7);padding:calc(var(--space-unit) * 2) 0}:host([size=\"x-large\"])>.container{min-height:calc(var(--space-unit) * 9);padding:calc(var(--space-unit) * 3) 0}:host([expandable])>.container,:host([expandable])>.container-contextual-menu,:host([clickable])>.container,:host([clickable])>.container-contextual-menu{cursor:pointer}:host([expandable]:hover)>.container,:host([expandable]:hover)>.container-contextual-menu,:host([clickable]:hover)>.container,:host([clickable]:hover)>.container-contextual-menu{background-color:var(--background-hover-color-list-element)}:host([expandable]:focus:focus-visible)>.container,:host([expandable]:focus:focus-visible)>.container-contextual-menu,:host([clickable]:focus:focus-visible)>.container,:host([clickable]:focus:focus-visible)>.container-contextual-menu{box-shadow:var(--shadow-focus-primary)}:host([clickable]:not([expandable]))>.container.clicked,:host([clickable]:not([expandable]))>.container-contextual-menu.clicked{box-shadow:var(--shadow-focus-primary)}:host([expandable]:active)>.container,:host([expandable]:active)>.container-contextual-menu,:host([clickable]:active)>.container,:host([clickable]:active)>.container-contextual-menu{background-color:var(--background-active-color-list-element)}:host([align-button=\"left\"][expandable])>.container>.z-list-element-container,:host([align-button=\"left\"][expandable])>.container-contextual-menu>.z-list-element-container{display:flex}:host([align-button=\"right\"][expandable])>.container>.z-list-element-container,:host([align-button=\"right\"][expandable])>.container-contextual-menu>.z-list-element-container{display:flex;flex-direction:row-reverse;justify-content:space-between}:host([align-button=\"left\"][expandable])>.container>.z-list-element-container>z-icon,:host([align-button=\"left\"][expandable])>.container-contextual-menu>.z-list-element-container>z-icon{margin-right:var(--space-unit)}:host([align-button=\"right\"][expandable])>.container>.z-list-element-container>z-icon,:host([align-button=\"right\"][expandable])>.container-contextual-menu>.z-list-element-container>z-icon{margin-left:var(--space-unit)}:host>.container>.z-list-element-inner-container,:host>.container-contextual-menu>.z-list-element-inner-container{display:none}:host>.container>.z-list-element-inner-container.expanded,:host>.container-contextual-menu>.z-list-element-inner-container.expanded{display:block}:host([clickable]:hover)>.container-contextual-menu{background-color:var(--color-surface03)}.container-contextual-menu:focus-visible{box-shadow:var(--shadow-focus-primary);outline:none}.z-list-content-container{display:flex;align-items:center}";
|
|
771
|
-
const ZListElementStyle0 = stylesCss$5;
|
|
772
|
-
|
|
773
|
-
const ZListElement = class {
|
|
774
|
-
accessibleFocusHandler(e) {
|
|
775
|
-
if (this.listElementId === e.detail) {
|
|
776
|
-
const toFocus = this.host.shadowRoot.getElementById(`z-list-element-id-${e.detail}`);
|
|
777
|
-
toFocus.focus();
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* Constructor.
|
|
782
|
-
*/
|
|
783
|
-
constructor(hostRef) {
|
|
784
|
-
registerInstance(this, hostRef);
|
|
785
|
-
this.accessibleFocus = createEvent(this, "accessibleFocus", 7);
|
|
786
|
-
this.ariaDescendantFocus = createEvent(this, "ariaDescendantFocus", 7);
|
|
787
|
-
this.clickItem = createEvent(this, "clickItem", 7);
|
|
788
|
-
this.openElementConfig = {
|
|
789
|
-
accordion: {
|
|
790
|
-
open: "minus-circled",
|
|
791
|
-
close: "plus-circled",
|
|
792
|
-
},
|
|
793
|
-
menu: {
|
|
794
|
-
open: "chevron-up",
|
|
795
|
-
close: "chevron-down",
|
|
796
|
-
},
|
|
797
|
-
};
|
|
798
|
-
this.alignButton = ExpandableListButtonAlign.LEFT;
|
|
799
|
-
this.clickable = false;
|
|
800
|
-
this.dividerColor = "color-surface03";
|
|
801
|
-
this.dividerType = ListDividerType.NONE;
|
|
802
|
-
this.dividerSize = DividerSize.SMALL;
|
|
803
|
-
this.expandable = false;
|
|
804
|
-
this.expandableStyle = ExpandableListStyle.ACCORDION;
|
|
805
|
-
this.listElementId = undefined;
|
|
806
|
-
this.size = ListSize.MEDIUM;
|
|
807
|
-
this.color = "none";
|
|
808
|
-
this.disabled = false;
|
|
809
|
-
this.isContextualMenu = false;
|
|
810
|
-
this.listElementPosition = "0";
|
|
811
|
-
this.listType = ListType.NONE;
|
|
812
|
-
this.role = "listitem";
|
|
813
|
-
this.showInnerContent = false;
|
|
814
|
-
this.handleClick = this.handleClick.bind(this);
|
|
815
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
816
|
-
}
|
|
817
|
-
/**
|
|
818
|
-
* Handler for click on element. If element is expandable, change state.
|
|
819
|
-
* @returns void
|
|
820
|
-
*/
|
|
821
|
-
handleClick() {
|
|
822
|
-
this.clickItem.emit(this.listElementId);
|
|
823
|
-
if (!this.expandable) {
|
|
824
|
-
return;
|
|
825
|
-
}
|
|
826
|
-
this.showInnerContent = !this.showInnerContent;
|
|
827
|
-
}
|
|
828
|
-
calculateClass() {
|
|
829
|
-
if (this.isContextualMenu) {
|
|
830
|
-
return "container-contextual-menu";
|
|
831
|
-
}
|
|
832
|
-
return "container";
|
|
833
|
-
}
|
|
834
|
-
handleKeyDown(event) {
|
|
835
|
-
const expandByKey = event.code === KeyboardCode.ENTER;
|
|
836
|
-
switch (event.code) {
|
|
837
|
-
case KeyboardCode.ARROW_DOWN:
|
|
838
|
-
event.preventDefault();
|
|
839
|
-
this.accessibleFocus.emit(this.listElementId + 1);
|
|
840
|
-
break;
|
|
841
|
-
case KeyboardCode.ARROW_UP:
|
|
842
|
-
event.preventDefault();
|
|
843
|
-
this.accessibleFocus.emit(this.listElementId - 1);
|
|
844
|
-
break;
|
|
845
|
-
case KeyboardCode.ENTER:
|
|
846
|
-
event.preventDefault();
|
|
847
|
-
this.clickItem.emit(this.listElementId);
|
|
848
|
-
break;
|
|
849
|
-
}
|
|
850
|
-
if (!this.expandable || !expandByKey) {
|
|
851
|
-
return;
|
|
852
|
-
}
|
|
853
|
-
this.showInnerContent = !this.showInnerContent;
|
|
854
|
-
}
|
|
855
|
-
/**
|
|
856
|
-
* Renders button to expand element.
|
|
857
|
-
* @returns expadable button
|
|
858
|
-
*/
|
|
859
|
-
renderExpandableButton() {
|
|
860
|
-
if (!this.expandable) {
|
|
861
|
-
return null;
|
|
862
|
-
}
|
|
863
|
-
return (h("z-icon", { name: this.showInnerContent
|
|
864
|
-
? this.openElementConfig[this.expandableStyle].open
|
|
865
|
-
: this.openElementConfig[this.expandableStyle].close }));
|
|
866
|
-
}
|
|
867
|
-
/**
|
|
868
|
-
* Renders expanded content if element is expandable.
|
|
869
|
-
* @returns expanded content
|
|
870
|
-
*/
|
|
871
|
-
renderExpandedContent() {
|
|
872
|
-
if (!this.expandable) {
|
|
873
|
-
return null;
|
|
874
|
-
}
|
|
875
|
-
return (h("div", { class: {
|
|
876
|
-
"z-list-element-inner-container": true,
|
|
877
|
-
"expanded": this.showInnerContent,
|
|
878
|
-
} }, h("slot", { name: "inner-content" })));
|
|
879
|
-
}
|
|
880
|
-
/**
|
|
881
|
-
* Renders content of the z-list-element
|
|
882
|
-
* @returns list content
|
|
883
|
-
*/
|
|
884
|
-
renderContent() {
|
|
885
|
-
if (this.listType === ListType.NONE) {
|
|
886
|
-
return h("slot", null);
|
|
887
|
-
}
|
|
888
|
-
if (this.listType === ListType.ORDERED) {
|
|
889
|
-
return (h("div", { class: "z-list-content-container" }, h("div", null, this.listElementPosition, ".\u2003"), h("slot", null)));
|
|
890
|
-
}
|
|
891
|
-
if (this.listType === ListType.UNORDERED) {
|
|
892
|
-
return (h("div", { class: "z-list-content-container" }, h("span", null, "\u2022\u2003"), h("slot", null)));
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
render() {
|
|
896
|
-
return (h(Host, { key: '3c55ce5744a82e1b1871f658d0d63dc49a55fbba', "aria-expanded": this.expandable ? this.showInnerContent : null, onClick: this.handleClick, onFocus: () => this.ariaDescendantFocus.emit(this.listElementId), onKeyDown: this.handleKeyDown, clickable: this.clickable && !this.disabled, tabIndex: !this.isContextualMenu ? "0" : null }, h("div", { key: 'f9ccf0529e72d61ffed2f8da94461b6d0d904447', class: `${this.calculateClass()}`, style: { color: `var(--${this.color})` }, tabindex: this.isContextualMenu ? "0" : "-1", id: `z-list-element-id-${this.listElementId}`, part: "list-item-container" }, h("div", { key: '9747b70e158f1e0a50bd392bc11724df0951196e', class: "z-list-element-container" }, this.renderExpandableButton(), this.renderContent()), this.renderExpandedContent()), this.dividerType === ListDividerType.ELEMENT && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))));
|
|
897
|
-
}
|
|
898
|
-
get host() { return getElement(this); }
|
|
899
|
-
};
|
|
900
|
-
ZListElement.style = ZListElementStyle0;
|
|
901
|
-
|
|
902
|
-
const stylesCss$4 = ":host{font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host>.z-list-group-header-container{color:var(--gray700);font-size:var(--font-size-2);font-weight:var(--font-sb) !important;letter-spacing:0.16px;line-height:1.4}:host>.z-list-group-header-container.has-header{padding-top:var(--space-unit);padding-bottom:var(--space-unit)}:host>.z-list-group-header-container.has-header>z-divider{margin-top:var(--space-unit)}";
|
|
903
|
-
const ZListGroupStyle0 = stylesCss$4;
|
|
904
|
-
|
|
905
|
-
const ZListGroup = class {
|
|
906
|
-
constructor(hostRef) {
|
|
907
|
-
registerInstance(this, hostRef);
|
|
908
|
-
this.size = ListSize.MEDIUM;
|
|
909
|
-
this.dividerType = ListDividerType.NONE;
|
|
910
|
-
this.dividerSize = DividerSize.SMALL;
|
|
911
|
-
this.dividerColor = "gray200";
|
|
912
|
-
this.listType = ListType.NONE;
|
|
913
|
-
}
|
|
914
|
-
componentDidLoad() {
|
|
915
|
-
const children = this.host.children;
|
|
916
|
-
for (let i = 0; i < children.length; i++) {
|
|
917
|
-
if (children.length - 1 > i) {
|
|
918
|
-
children[i].setAttribute("divider-type", this.dividerType);
|
|
919
|
-
children[i].setAttribute("divider-size", this.dividerSize);
|
|
920
|
-
children[i].setAttribute("divider-color", this.dividerColor);
|
|
921
|
-
}
|
|
922
|
-
children[i].setAttribute("size", this.size);
|
|
923
|
-
children[i].setAttribute("list-type", this.listType);
|
|
924
|
-
children[i].setAttribute("list-element-position", i.toString());
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
componentWillLoad() {
|
|
928
|
-
this.hasHeader = !!this.host.querySelector('[slot="header-title"]');
|
|
929
|
-
}
|
|
930
|
-
render() {
|
|
931
|
-
return (h(Host, { key: 'c25db9a48f30bf98694c87dce08463ac6b314719', role: "group" }, h("div", { key: '354ea1928b4f2e58b46ef2eb18e84234e9db2cd9', class: {
|
|
932
|
-
"z-list-group-header-container": true,
|
|
933
|
-
"has-header": this.hasHeader,
|
|
934
|
-
} }, h("slot", { key: '48b577a0a6b35ab74eb9b70c53dd9462ab57e92d', name: "header-title" }), this.dividerType === ListDividerType.HEADER && (h("z-divider", { color: this.dividerColor, size: this.dividerSize }))), h("slot", { key: '407e9151406fdc7f01b0ba40a69bd0516d5cc1f4' })));
|
|
935
|
-
}
|
|
936
|
-
get host() { return getElement(this); }
|
|
937
|
-
};
|
|
938
|
-
ZListGroup.style = ZListGroupStyle0;
|
|
939
|
-
|
|
940
|
-
// nb. This is for IE10 and lower _only_.
|
|
941
|
-
var supportCustomEvent = window.CustomEvent;
|
|
942
|
-
if (!supportCustomEvent || typeof supportCustomEvent === 'object') {
|
|
943
|
-
supportCustomEvent = function CustomEvent(event, x) {
|
|
944
|
-
x = x || {};
|
|
945
|
-
var ev = document.createEvent('CustomEvent');
|
|
946
|
-
ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);
|
|
947
|
-
return ev;
|
|
948
|
-
};
|
|
949
|
-
supportCustomEvent.prototype = window.Event.prototype;
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
/**
|
|
953
|
-
* Dispatches the passed event to both an "on<type>" handler as well as via the
|
|
954
|
-
* normal dispatch operation. Does not bubble.
|
|
955
|
-
*
|
|
956
|
-
* @param {!EventTarget} target
|
|
957
|
-
* @param {!Event} event
|
|
958
|
-
* @return {boolean}
|
|
959
|
-
*/
|
|
960
|
-
function safeDispatchEvent(target, event) {
|
|
961
|
-
var check = 'on' + event.type.toLowerCase();
|
|
962
|
-
if (typeof target[check] === 'function') {
|
|
963
|
-
target[check](event);
|
|
964
|
-
}
|
|
965
|
-
return target.dispatchEvent(event);
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
/**
|
|
969
|
-
* @param {Element} el to check for stacking context
|
|
970
|
-
* @return {boolean} whether this el or its parents creates a stacking context
|
|
971
|
-
*/
|
|
972
|
-
function createsStackingContext(el) {
|
|
973
|
-
while (el && el !== document.body) {
|
|
974
|
-
var s = window.getComputedStyle(el);
|
|
975
|
-
var invalid = function(k, ok) {
|
|
976
|
-
return !(s[k] === undefined || s[k] === ok);
|
|
977
|
-
};
|
|
978
|
-
|
|
979
|
-
if (s.opacity < 1 ||
|
|
980
|
-
invalid('zIndex', 'auto') ||
|
|
981
|
-
invalid('transform', 'none') ||
|
|
982
|
-
invalid('mixBlendMode', 'normal') ||
|
|
983
|
-
invalid('filter', 'none') ||
|
|
984
|
-
invalid('perspective', 'none') ||
|
|
985
|
-
s['isolation'] === 'isolate' ||
|
|
986
|
-
s.position === 'fixed' ||
|
|
987
|
-
s.webkitOverflowScrolling === 'touch') {
|
|
988
|
-
return true;
|
|
989
|
-
}
|
|
990
|
-
el = el.parentElement;
|
|
991
|
-
}
|
|
992
|
-
return false;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
/**
|
|
996
|
-
* Finds the nearest <dialog> from the passed element.
|
|
997
|
-
*
|
|
998
|
-
* @param {Element} el to search from
|
|
999
|
-
* @return {HTMLDialogElement} dialog found
|
|
1000
|
-
*/
|
|
1001
|
-
function findNearestDialog(el) {
|
|
1002
|
-
while (el) {
|
|
1003
|
-
if (el.localName === 'dialog') {
|
|
1004
|
-
return /** @type {HTMLDialogElement} */ (el);
|
|
1005
|
-
}
|
|
1006
|
-
if (el.parentElement) {
|
|
1007
|
-
el = el.parentElement;
|
|
1008
|
-
} else if (el.parentNode) {
|
|
1009
|
-
el = el.parentNode.host;
|
|
1010
|
-
} else {
|
|
1011
|
-
el = null;
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
return null;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
/**
|
|
1018
|
-
* Blur the specified element, as long as it's not the HTML body element.
|
|
1019
|
-
* This works around an IE9/10 bug - blurring the body causes Windows to
|
|
1020
|
-
* blur the whole application.
|
|
1021
|
-
*
|
|
1022
|
-
* @param {Element} el to blur
|
|
1023
|
-
*/
|
|
1024
|
-
function safeBlur(el) {
|
|
1025
|
-
// Find the actual focused element when the active element is inside a shadow root
|
|
1026
|
-
while (el && el.shadowRoot && el.shadowRoot.activeElement) {
|
|
1027
|
-
el = el.shadowRoot.activeElement;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
if (el && el.blur && el !== document.body) {
|
|
1031
|
-
el.blur();
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
/**
|
|
1036
|
-
* @param {!NodeList} nodeList to search
|
|
1037
|
-
* @param {Node} node to find
|
|
1038
|
-
* @return {boolean} whether node is inside nodeList
|
|
1039
|
-
*/
|
|
1040
|
-
function inNodeList(nodeList, node) {
|
|
1041
|
-
for (var i = 0; i < nodeList.length; ++i) {
|
|
1042
|
-
if (nodeList[i] === node) {
|
|
1043
|
-
return true;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
return false;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
/**
|
|
1050
|
-
* @param {HTMLFormElement} el to check
|
|
1051
|
-
* @return {boolean} whether this form has method="dialog"
|
|
1052
|
-
*/
|
|
1053
|
-
function isFormMethodDialog(el) {
|
|
1054
|
-
if (!el || !el.hasAttribute('method')) {
|
|
1055
|
-
return false;
|
|
1056
|
-
}
|
|
1057
|
-
return el.getAttribute('method').toLowerCase() === 'dialog';
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
/**
|
|
1061
|
-
* @param {!DocumentFragment|!Element} hostElement
|
|
1062
|
-
* @return {?Element}
|
|
1063
|
-
*/
|
|
1064
|
-
function findFocusableElementWithin(hostElement) {
|
|
1065
|
-
// Note that this is 'any focusable area'. This list is probably not exhaustive, but the
|
|
1066
|
-
// alternative involves stepping through and trying to focus everything.
|
|
1067
|
-
var opts = ['button', 'input', 'keygen', 'select', 'textarea'];
|
|
1068
|
-
var query = opts.map(function(el) {
|
|
1069
|
-
return el + ':not([disabled])';
|
|
1070
|
-
});
|
|
1071
|
-
// TODO(samthor): tabindex values that are not numeric are not focusable.
|
|
1072
|
-
query.push('[tabindex]:not([disabled]):not([tabindex=""])'); // tabindex != "", not disabled
|
|
1073
|
-
var target = hostElement.querySelector(query.join(', '));
|
|
1074
|
-
|
|
1075
|
-
if (!target && 'attachShadow' in Element.prototype) {
|
|
1076
|
-
// If we haven't found a focusable target, see if the host element contains an element
|
|
1077
|
-
// which has a shadowRoot.
|
|
1078
|
-
// Recursively search for the first focusable item in shadow roots.
|
|
1079
|
-
var elems = hostElement.querySelectorAll('*');
|
|
1080
|
-
for (var i = 0; i < elems.length; i++) {
|
|
1081
|
-
if (elems[i].tagName && elems[i].shadowRoot) {
|
|
1082
|
-
target = findFocusableElementWithin(elems[i].shadowRoot);
|
|
1083
|
-
if (target) {
|
|
1084
|
-
break;
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
return target;
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
* Determines if an element is attached to the DOM.
|
|
1094
|
-
* @param {Element} element to check
|
|
1095
|
-
* @return {boolean} whether the element is in DOM
|
|
1096
|
-
*/
|
|
1097
|
-
function isConnected(element) {
|
|
1098
|
-
return element.isConnected || document.body.contains(element);
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
/**
|
|
1102
|
-
* @param {!Event} event
|
|
1103
|
-
* @return {?Element}
|
|
1104
|
-
*/
|
|
1105
|
-
function findFormSubmitter(event) {
|
|
1106
|
-
if (event.submitter) {
|
|
1107
|
-
return event.submitter;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
var form = event.target;
|
|
1111
|
-
if (!(form instanceof HTMLFormElement)) {
|
|
1112
|
-
return null;
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
var submitter = dialogPolyfill.formSubmitter;
|
|
1116
|
-
if (!submitter) {
|
|
1117
|
-
var target = event.target;
|
|
1118
|
-
var root = ('getRootNode' in target && target.getRootNode() || document);
|
|
1119
|
-
submitter = root.activeElement;
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
if (!submitter || submitter.form !== form) {
|
|
1123
|
-
return null;
|
|
1124
|
-
}
|
|
1125
|
-
return submitter;
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
/**
|
|
1129
|
-
* @param {!Event} event
|
|
1130
|
-
*/
|
|
1131
|
-
function maybeHandleSubmit(event) {
|
|
1132
|
-
if (event.defaultPrevented) {
|
|
1133
|
-
return;
|
|
1134
|
-
}
|
|
1135
|
-
var form = /** @type {!HTMLFormElement} */ (event.target);
|
|
1136
|
-
|
|
1137
|
-
// We'd have a value if we clicked on an imagemap.
|
|
1138
|
-
var value = dialogPolyfill.imagemapUseValue;
|
|
1139
|
-
var submitter = findFormSubmitter(event);
|
|
1140
|
-
if (value === null && submitter) {
|
|
1141
|
-
value = submitter.value;
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
// There should always be a dialog as this handler is added specifically on them, but check just
|
|
1145
|
-
// in case.
|
|
1146
|
-
var dialog = findNearestDialog(form);
|
|
1147
|
-
if (!dialog) {
|
|
1148
|
-
return;
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
// Prefer formmethod on the button.
|
|
1152
|
-
var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');
|
|
1153
|
-
if (formmethod !== 'dialog') {
|
|
1154
|
-
return;
|
|
1155
|
-
}
|
|
1156
|
-
event.preventDefault();
|
|
1157
|
-
|
|
1158
|
-
if (value != null) {
|
|
1159
|
-
// nb. we explicitly check against null/undefined
|
|
1160
|
-
dialog.close(value);
|
|
1161
|
-
} else {
|
|
1162
|
-
dialog.close();
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
/**
|
|
1167
|
-
* @param {!HTMLDialogElement} dialog to upgrade
|
|
1168
|
-
* @constructor
|
|
1169
|
-
*/
|
|
1170
|
-
function dialogPolyfillInfo(dialog) {
|
|
1171
|
-
this.dialog_ = dialog;
|
|
1172
|
-
this.replacedStyleTop_ = false;
|
|
1173
|
-
this.openAsModal_ = false;
|
|
1174
|
-
|
|
1175
|
-
// Set a11y role. Browsers that support dialog implicitly know this already.
|
|
1176
|
-
if (!dialog.hasAttribute('role')) {
|
|
1177
|
-
dialog.setAttribute('role', 'dialog');
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
dialog.show = this.show.bind(this);
|
|
1181
|
-
dialog.showModal = this.showModal.bind(this);
|
|
1182
|
-
dialog.close = this.close.bind(this);
|
|
1183
|
-
|
|
1184
|
-
dialog.addEventListener('submit', maybeHandleSubmit, false);
|
|
1185
|
-
|
|
1186
|
-
if (!('returnValue' in dialog)) {
|
|
1187
|
-
dialog.returnValue = '';
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
if ('MutationObserver' in window) {
|
|
1191
|
-
var mo = new MutationObserver(this.maybeHideModal.bind(this));
|
|
1192
|
-
mo.observe(dialog, {attributes: true, attributeFilter: ['open']});
|
|
1193
|
-
} else {
|
|
1194
|
-
// IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also
|
|
1195
|
-
// seem to fire even if the element was removed as part of a parent removal. Use the removed
|
|
1196
|
-
// events to force downgrade (useful if removed/immediately added).
|
|
1197
|
-
var removed = false;
|
|
1198
|
-
var cb = function() {
|
|
1199
|
-
removed ? this.downgradeModal() : this.maybeHideModal();
|
|
1200
|
-
removed = false;
|
|
1201
|
-
}.bind(this);
|
|
1202
|
-
var timeout;
|
|
1203
|
-
var delayModel = function(ev) {
|
|
1204
|
-
if (ev.target !== dialog) { return; } // not for a child element
|
|
1205
|
-
var cand = 'DOMNodeRemoved';
|
|
1206
|
-
removed |= (ev.type.substr(0, cand.length) === cand);
|
|
1207
|
-
window.clearTimeout(timeout);
|
|
1208
|
-
timeout = window.setTimeout(cb, 0);
|
|
1209
|
-
};
|
|
1210
|
-
['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {
|
|
1211
|
-
dialog.addEventListener(name, delayModel);
|
|
1212
|
-
});
|
|
1213
|
-
}
|
|
1214
|
-
// Note that the DOM is observed inside DialogManager while any dialog
|
|
1215
|
-
// is being displayed as a modal, to catch modal removal from the DOM.
|
|
1216
|
-
|
|
1217
|
-
Object.defineProperty(dialog, 'open', {
|
|
1218
|
-
set: this.setOpen.bind(this),
|
|
1219
|
-
get: dialog.hasAttribute.bind(dialog, 'open')
|
|
1220
|
-
});
|
|
1221
|
-
|
|
1222
|
-
this.backdrop_ = document.createElement('div');
|
|
1223
|
-
this.backdrop_.className = 'backdrop';
|
|
1224
|
-
this.backdrop_.addEventListener('mouseup' , this.backdropMouseEvent_.bind(this));
|
|
1225
|
-
this.backdrop_.addEventListener('mousedown', this.backdropMouseEvent_.bind(this));
|
|
1226
|
-
this.backdrop_.addEventListener('click' , this.backdropMouseEvent_.bind(this));
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
dialogPolyfillInfo.prototype = /** @type {HTMLDialogElement.prototype} */ ({
|
|
1230
|
-
|
|
1231
|
-
get dialog() {
|
|
1232
|
-
return this.dialog_;
|
|
1233
|
-
},
|
|
1234
|
-
|
|
1235
|
-
/**
|
|
1236
|
-
* Maybe remove this dialog from the modal top layer. This is called when
|
|
1237
|
-
* a modal dialog may no longer be tenable, e.g., when the dialog is no
|
|
1238
|
-
* longer open or is no longer part of the DOM.
|
|
1239
|
-
*/
|
|
1240
|
-
maybeHideModal: function() {
|
|
1241
|
-
if (this.dialog_.hasAttribute('open') && isConnected(this.dialog_)) { return; }
|
|
1242
|
-
this.downgradeModal();
|
|
1243
|
-
},
|
|
1244
|
-
|
|
1245
|
-
/**
|
|
1246
|
-
* Remove this dialog from the modal top layer, leaving it as a non-modal.
|
|
1247
|
-
*/
|
|
1248
|
-
downgradeModal: function() {
|
|
1249
|
-
if (!this.openAsModal_) { return; }
|
|
1250
|
-
this.openAsModal_ = false;
|
|
1251
|
-
this.dialog_.style.zIndex = '';
|
|
1252
|
-
|
|
1253
|
-
// This won't match the native <dialog> exactly because if the user set top on a centered
|
|
1254
|
-
// polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's
|
|
1255
|
-
// possible to polyfill this perfectly.
|
|
1256
|
-
if (this.replacedStyleTop_) {
|
|
1257
|
-
this.dialog_.style.top = '';
|
|
1258
|
-
this.replacedStyleTop_ = false;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
// Clear the backdrop and remove from the manager.
|
|
1262
|
-
this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);
|
|
1263
|
-
dialogPolyfill.dm.removeDialog(this);
|
|
1264
|
-
},
|
|
1265
|
-
|
|
1266
|
-
/**
|
|
1267
|
-
* @param {boolean} value whether to open or close this dialog
|
|
1268
|
-
*/
|
|
1269
|
-
setOpen: function(value) {
|
|
1270
|
-
if (value) {
|
|
1271
|
-
this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');
|
|
1272
|
-
} else {
|
|
1273
|
-
this.dialog_.removeAttribute('open');
|
|
1274
|
-
this.maybeHideModal(); // nb. redundant with MutationObserver
|
|
1275
|
-
}
|
|
1276
|
-
},
|
|
1277
|
-
|
|
1278
|
-
/**
|
|
1279
|
-
* Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if
|
|
1280
|
-
* they were on the dialog itself.
|
|
1281
|
-
*
|
|
1282
|
-
* @param {!Event} e to redirect
|
|
1283
|
-
*/
|
|
1284
|
-
backdropMouseEvent_: function(e) {
|
|
1285
|
-
if (!this.dialog_.hasAttribute('tabindex')) {
|
|
1286
|
-
// Clicking on the backdrop should move the implicit cursor, even if dialog cannot be
|
|
1287
|
-
// focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this
|
|
1288
|
-
// would not be needed - clicks would move the implicit cursor there.
|
|
1289
|
-
var fake = document.createElement('div');
|
|
1290
|
-
this.dialog_.insertBefore(fake, this.dialog_.firstChild);
|
|
1291
|
-
fake.tabIndex = -1;
|
|
1292
|
-
fake.focus();
|
|
1293
|
-
this.dialog_.removeChild(fake);
|
|
1294
|
-
} else {
|
|
1295
|
-
this.dialog_.focus();
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
var redirectedEvent = document.createEvent('MouseEvents');
|
|
1299
|
-
redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,
|
|
1300
|
-
e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,
|
|
1301
|
-
e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);
|
|
1302
|
-
this.dialog_.dispatchEvent(redirectedEvent);
|
|
1303
|
-
e.stopPropagation();
|
|
1304
|
-
},
|
|
1305
|
-
|
|
1306
|
-
/**
|
|
1307
|
-
* Focuses on the first focusable element within the dialog. This will always blur the current
|
|
1308
|
-
* focus, even if nothing within the dialog is found.
|
|
1309
|
-
*/
|
|
1310
|
-
focus_: function() {
|
|
1311
|
-
// Find element with `autofocus` attribute, or fall back to the first form/tabindex control.
|
|
1312
|
-
var target = this.dialog_.querySelector('[autofocus]:not([disabled])');
|
|
1313
|
-
if (!target && this.dialog_.tabIndex >= 0) {
|
|
1314
|
-
target = this.dialog_;
|
|
1315
|
-
}
|
|
1316
|
-
if (!target) {
|
|
1317
|
-
target = findFocusableElementWithin(this.dialog_);
|
|
1318
|
-
}
|
|
1319
|
-
safeBlur(document.activeElement);
|
|
1320
|
-
target && target.focus();
|
|
1321
|
-
},
|
|
1322
|
-
|
|
1323
|
-
/**
|
|
1324
|
-
* Sets the zIndex for the backdrop and dialog.
|
|
1325
|
-
*
|
|
1326
|
-
* @param {number} dialogZ
|
|
1327
|
-
* @param {number} backdropZ
|
|
1328
|
-
*/
|
|
1329
|
-
updateZIndex: function(dialogZ, backdropZ) {
|
|
1330
|
-
if (dialogZ < backdropZ) {
|
|
1331
|
-
throw new Error('dialogZ should never be < backdropZ');
|
|
1332
|
-
}
|
|
1333
|
-
this.dialog_.style.zIndex = dialogZ;
|
|
1334
|
-
this.backdrop_.style.zIndex = backdropZ;
|
|
1335
|
-
},
|
|
1336
|
-
|
|
1337
|
-
/**
|
|
1338
|
-
* Shows the dialog. If the dialog is already open, this does nothing.
|
|
1339
|
-
*/
|
|
1340
|
-
show: function() {
|
|
1341
|
-
if (!this.dialog_.open) {
|
|
1342
|
-
this.setOpen(true);
|
|
1343
|
-
this.focus_();
|
|
1344
|
-
}
|
|
1345
|
-
},
|
|
1346
|
-
|
|
1347
|
-
/**
|
|
1348
|
-
* Show this dialog modally.
|
|
1349
|
-
*/
|
|
1350
|
-
showModal: function() {
|
|
1351
|
-
if (this.dialog_.hasAttribute('open')) {
|
|
1352
|
-
throw new Error('Failed to execute \'showModal\' on dialog: The element is already open, and therefore cannot be opened modally.');
|
|
1353
|
-
}
|
|
1354
|
-
if (!isConnected(this.dialog_)) {
|
|
1355
|
-
throw new Error('Failed to execute \'showModal\' on dialog: The element is not in a Document.');
|
|
1356
|
-
}
|
|
1357
|
-
if (!dialogPolyfill.dm.pushDialog(this)) {
|
|
1358
|
-
throw new Error('Failed to execute \'showModal\' on dialog: There are too many open modal dialogs.');
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
if (createsStackingContext(this.dialog_.parentElement)) {
|
|
1362
|
-
console.warn('A dialog is being shown inside a stacking context. ' +
|
|
1363
|
-
'This may cause it to be unusable. For more information, see this link: ' +
|
|
1364
|
-
'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
this.setOpen(true);
|
|
1368
|
-
this.openAsModal_ = true;
|
|
1369
|
-
|
|
1370
|
-
// Optionally center vertically, relative to the current viewport.
|
|
1371
|
-
if (dialogPolyfill.needsCentering(this.dialog_)) {
|
|
1372
|
-
dialogPolyfill.reposition(this.dialog_);
|
|
1373
|
-
this.replacedStyleTop_ = true;
|
|
1374
|
-
} else {
|
|
1375
|
-
this.replacedStyleTop_ = false;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
// Insert backdrop.
|
|
1379
|
-
this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);
|
|
1380
|
-
|
|
1381
|
-
// Focus on whatever inside the dialog.
|
|
1382
|
-
this.focus_();
|
|
1383
|
-
},
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* Closes this HTMLDialogElement. This is optional vs clearing the open
|
|
1387
|
-
* attribute, however this fires a 'close' event.
|
|
1388
|
-
*
|
|
1389
|
-
* @param {string=} opt_returnValue to use as the returnValue
|
|
1390
|
-
*/
|
|
1391
|
-
close: function(opt_returnValue) {
|
|
1392
|
-
if (!this.dialog_.hasAttribute('open')) {
|
|
1393
|
-
throw new Error('Failed to execute \'close\' on dialog: The element does not have an \'open\' attribute, and therefore cannot be closed.');
|
|
1394
|
-
}
|
|
1395
|
-
this.setOpen(false);
|
|
1396
|
-
|
|
1397
|
-
// Leave returnValue untouched in case it was set directly on the element
|
|
1398
|
-
if (opt_returnValue !== undefined) {
|
|
1399
|
-
this.dialog_.returnValue = opt_returnValue;
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
// Triggering "close" event for any attached listeners on the <dialog>.
|
|
1403
|
-
var closeEvent = new supportCustomEvent('close', {
|
|
1404
|
-
bubbles: false,
|
|
1405
|
-
cancelable: false
|
|
1406
|
-
});
|
|
1407
|
-
safeDispatchEvent(this.dialog_, closeEvent);
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
});
|
|
1411
|
-
|
|
1412
|
-
var dialogPolyfill = {};
|
|
1413
|
-
|
|
1414
|
-
dialogPolyfill.reposition = function(element) {
|
|
1415
|
-
var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
|
|
1416
|
-
var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;
|
|
1417
|
-
element.style.top = Math.max(scrollTop, topValue) + 'px';
|
|
1418
|
-
};
|
|
1419
|
-
|
|
1420
|
-
dialogPolyfill.isInlinePositionSetByStylesheet = function(element) {
|
|
1421
|
-
for (var i = 0; i < document.styleSheets.length; ++i) {
|
|
1422
|
-
var styleSheet = document.styleSheets[i];
|
|
1423
|
-
var cssRules = null;
|
|
1424
|
-
// Some browsers throw on cssRules.
|
|
1425
|
-
try {
|
|
1426
|
-
cssRules = styleSheet.cssRules;
|
|
1427
|
-
} catch (e) {}
|
|
1428
|
-
if (!cssRules) { continue; }
|
|
1429
|
-
for (var j = 0; j < cssRules.length; ++j) {
|
|
1430
|
-
var rule = cssRules[j];
|
|
1431
|
-
var selectedNodes = null;
|
|
1432
|
-
// Ignore errors on invalid selector texts.
|
|
1433
|
-
try {
|
|
1434
|
-
selectedNodes = document.querySelectorAll(rule.selectorText);
|
|
1435
|
-
} catch(e) {}
|
|
1436
|
-
if (!selectedNodes || !inNodeList(selectedNodes, element)) {
|
|
1437
|
-
continue;
|
|
1438
|
-
}
|
|
1439
|
-
var cssTop = rule.style.getPropertyValue('top');
|
|
1440
|
-
var cssBottom = rule.style.getPropertyValue('bottom');
|
|
1441
|
-
if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {
|
|
1442
|
-
return true;
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
return false;
|
|
1447
|
-
};
|
|
1448
|
-
|
|
1449
|
-
dialogPolyfill.needsCentering = function(dialog) {
|
|
1450
|
-
var computedStyle = window.getComputedStyle(dialog);
|
|
1451
|
-
if (computedStyle.position !== 'absolute') {
|
|
1452
|
-
return false;
|
|
1453
|
-
}
|
|
1454
|
-
|
|
1455
|
-
// We must determine whether the top/bottom specified value is non-auto. In
|
|
1456
|
-
// WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but
|
|
1457
|
-
// Firefox returns the used value. So we do this crazy thing instead: check
|
|
1458
|
-
// the inline style and then go through CSS rules.
|
|
1459
|
-
if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||
|
|
1460
|
-
(dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {
|
|
1461
|
-
return false;
|
|
1462
|
-
}
|
|
1463
|
-
return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);
|
|
1464
|
-
};
|
|
1465
|
-
|
|
1466
|
-
/**
|
|
1467
|
-
* @param {!Element} element to force upgrade
|
|
1468
|
-
*/
|
|
1469
|
-
dialogPolyfill.forceRegisterDialog = function(element) {
|
|
1470
|
-
if (window.HTMLDialogElement || element.showModal) {
|
|
1471
|
-
console.warn('This browser already supports <dialog>, the polyfill ' +
|
|
1472
|
-
'may not work correctly', element);
|
|
1473
|
-
}
|
|
1474
|
-
if (element.localName !== 'dialog') {
|
|
1475
|
-
throw new Error('Failed to register dialog: The element is not a dialog.');
|
|
1476
|
-
}
|
|
1477
|
-
new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));
|
|
1478
|
-
};
|
|
1479
|
-
|
|
1480
|
-
/**
|
|
1481
|
-
* @param {!Element} element to upgrade, if necessary
|
|
1482
|
-
*/
|
|
1483
|
-
dialogPolyfill.registerDialog = function(element) {
|
|
1484
|
-
if (!element.showModal) {
|
|
1485
|
-
dialogPolyfill.forceRegisterDialog(element);
|
|
1486
|
-
}
|
|
1487
|
-
};
|
|
1488
|
-
|
|
1489
|
-
/**
|
|
1490
|
-
* @constructor
|
|
1491
|
-
*/
|
|
1492
|
-
dialogPolyfill.DialogManager = function() {
|
|
1493
|
-
/** @type {!Array<!dialogPolyfillInfo>} */
|
|
1494
|
-
this.pendingDialogStack = [];
|
|
1495
|
-
|
|
1496
|
-
var checkDOM = this.checkDOM_.bind(this);
|
|
1497
|
-
|
|
1498
|
-
// The overlay is used to simulate how a modal dialog blocks the document.
|
|
1499
|
-
// The blocking dialog is positioned on top of the overlay, and the rest of
|
|
1500
|
-
// the dialogs on the pending dialog stack are positioned below it. In the
|
|
1501
|
-
// actual implementation, the modal dialog stacking is controlled by the
|
|
1502
|
-
// top layer, where z-index has no effect.
|
|
1503
|
-
this.overlay = document.createElement('div');
|
|
1504
|
-
this.overlay.className = '_dialog_overlay';
|
|
1505
|
-
this.overlay.addEventListener('click', function(e) {
|
|
1506
|
-
this.forwardTab_ = undefined;
|
|
1507
|
-
e.stopPropagation();
|
|
1508
|
-
checkDOM([]); // sanity-check DOM
|
|
1509
|
-
}.bind(this));
|
|
1510
|
-
|
|
1511
|
-
this.handleKey_ = this.handleKey_.bind(this);
|
|
1512
|
-
this.handleFocus_ = this.handleFocus_.bind(this);
|
|
1513
|
-
|
|
1514
|
-
this.zIndexLow_ = 100000;
|
|
1515
|
-
this.zIndexHigh_ = 100000 + 150;
|
|
1516
|
-
|
|
1517
|
-
this.forwardTab_ = undefined;
|
|
1518
|
-
|
|
1519
|
-
if ('MutationObserver' in window) {
|
|
1520
|
-
this.mo_ = new MutationObserver(function(records) {
|
|
1521
|
-
var removed = [];
|
|
1522
|
-
records.forEach(function(rec) {
|
|
1523
|
-
for (var i = 0, c; c = rec.removedNodes[i]; ++i) {
|
|
1524
|
-
if (!(c instanceof Element)) {
|
|
1525
|
-
continue;
|
|
1526
|
-
} else if (c.localName === 'dialog') {
|
|
1527
|
-
removed.push(c);
|
|
1528
|
-
}
|
|
1529
|
-
removed = removed.concat(c.querySelectorAll('dialog'));
|
|
1530
|
-
}
|
|
1531
|
-
});
|
|
1532
|
-
removed.length && checkDOM(removed);
|
|
1533
|
-
});
|
|
1534
|
-
}
|
|
1535
|
-
};
|
|
1536
|
-
|
|
1537
|
-
/**
|
|
1538
|
-
* Called on the first modal dialog being shown. Adds the overlay and related
|
|
1539
|
-
* handlers.
|
|
1540
|
-
*/
|
|
1541
|
-
dialogPolyfill.DialogManager.prototype.blockDocument = function() {
|
|
1542
|
-
document.documentElement.addEventListener('focus', this.handleFocus_, true);
|
|
1543
|
-
document.addEventListener('keydown', this.handleKey_);
|
|
1544
|
-
this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});
|
|
1545
|
-
};
|
|
1546
|
-
|
|
1547
|
-
/**
|
|
1548
|
-
* Called on the first modal dialog being removed, i.e., when no more modal
|
|
1549
|
-
* dialogs are visible.
|
|
1550
|
-
*/
|
|
1551
|
-
dialogPolyfill.DialogManager.prototype.unblockDocument = function() {
|
|
1552
|
-
document.documentElement.removeEventListener('focus', this.handleFocus_, true);
|
|
1553
|
-
document.removeEventListener('keydown', this.handleKey_);
|
|
1554
|
-
this.mo_ && this.mo_.disconnect();
|
|
1555
|
-
};
|
|
1556
|
-
|
|
1557
|
-
/**
|
|
1558
|
-
* Updates the stacking of all known dialogs.
|
|
1559
|
-
*/
|
|
1560
|
-
dialogPolyfill.DialogManager.prototype.updateStacking = function() {
|
|
1561
|
-
var zIndex = this.zIndexHigh_;
|
|
1562
|
-
|
|
1563
|
-
for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {
|
|
1564
|
-
dpi.updateZIndex(--zIndex, --zIndex);
|
|
1565
|
-
if (i === 0) {
|
|
1566
|
-
this.overlay.style.zIndex = --zIndex;
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
|
-
// Make the overlay a sibling of the dialog itself.
|
|
1571
|
-
var last = this.pendingDialogStack[0];
|
|
1572
|
-
if (last) {
|
|
1573
|
-
var p = last.dialog.parentNode || document.body;
|
|
1574
|
-
p.appendChild(this.overlay);
|
|
1575
|
-
} else if (this.overlay.parentNode) {
|
|
1576
|
-
this.overlay.parentNode.removeChild(this.overlay);
|
|
1577
|
-
}
|
|
1578
|
-
};
|
|
1579
|
-
|
|
1580
|
-
/**
|
|
1581
|
-
* @param {Element} candidate to check if contained or is the top-most modal dialog
|
|
1582
|
-
* @return {boolean} whether candidate is contained in top dialog
|
|
1583
|
-
*/
|
|
1584
|
-
dialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {
|
|
1585
|
-
while (candidate = findNearestDialog(candidate)) {
|
|
1586
|
-
for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {
|
|
1587
|
-
if (dpi.dialog === candidate) {
|
|
1588
|
-
return i === 0; // only valid if top-most
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
candidate = candidate.parentElement;
|
|
1592
|
-
}
|
|
1593
|
-
return false;
|
|
1594
|
-
};
|
|
1595
|
-
|
|
1596
|
-
dialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {
|
|
1597
|
-
var target = event.composedPath ? event.composedPath()[0] : event.target;
|
|
1598
|
-
|
|
1599
|
-
if (this.containedByTopDialog_(target)) { return; }
|
|
1600
|
-
|
|
1601
|
-
if (document.activeElement === document.documentElement) { return; }
|
|
1602
|
-
|
|
1603
|
-
event.preventDefault();
|
|
1604
|
-
event.stopPropagation();
|
|
1605
|
-
safeBlur(/** @type {Element} */ (target));
|
|
1606
|
-
|
|
1607
|
-
if (this.forwardTab_ === undefined) { return; } // move focus only from a tab key
|
|
1608
|
-
|
|
1609
|
-
var dpi = this.pendingDialogStack[0];
|
|
1610
|
-
var dialog = dpi.dialog;
|
|
1611
|
-
var position = dialog.compareDocumentPosition(target);
|
|
1612
|
-
if (position & Node.DOCUMENT_POSITION_PRECEDING) {
|
|
1613
|
-
if (this.forwardTab_) {
|
|
1614
|
-
// forward
|
|
1615
|
-
dpi.focus_();
|
|
1616
|
-
} else if (target !== document.documentElement) {
|
|
1617
|
-
// backwards if we're not already focused on <html>
|
|
1618
|
-
document.documentElement.focus();
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
return false;
|
|
1623
|
-
};
|
|
1624
|
-
|
|
1625
|
-
dialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {
|
|
1626
|
-
this.forwardTab_ = undefined;
|
|
1627
|
-
if (event.keyCode === 27) {
|
|
1628
|
-
event.preventDefault();
|
|
1629
|
-
event.stopPropagation();
|
|
1630
|
-
var cancelEvent = new supportCustomEvent('cancel', {
|
|
1631
|
-
bubbles: false,
|
|
1632
|
-
cancelable: true
|
|
1633
|
-
});
|
|
1634
|
-
var dpi = this.pendingDialogStack[0];
|
|
1635
|
-
if (dpi && safeDispatchEvent(dpi.dialog, cancelEvent)) {
|
|
1636
|
-
dpi.dialog.close();
|
|
1637
|
-
}
|
|
1638
|
-
} else if (event.keyCode === 9) {
|
|
1639
|
-
this.forwardTab_ = !event.shiftKey;
|
|
1640
|
-
}
|
|
1641
|
-
};
|
|
1642
|
-
|
|
1643
|
-
/**
|
|
1644
|
-
* Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are
|
|
1645
|
-
* removed and immediately readded don't stay modal, they become normal.
|
|
1646
|
-
*
|
|
1647
|
-
* @param {!Array<!HTMLDialogElement>} removed that have definitely been removed
|
|
1648
|
-
*/
|
|
1649
|
-
dialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {
|
|
1650
|
-
// This operates on a clone because it may cause it to change. Each change also calls
|
|
1651
|
-
// updateStacking, which only actually needs to happen once. But who removes many modal dialogs
|
|
1652
|
-
// at a time?!
|
|
1653
|
-
var clone = this.pendingDialogStack.slice();
|
|
1654
|
-
clone.forEach(function(dpi) {
|
|
1655
|
-
if (removed.indexOf(dpi.dialog) !== -1) {
|
|
1656
|
-
dpi.downgradeModal();
|
|
1657
|
-
} else {
|
|
1658
|
-
dpi.maybeHideModal();
|
|
1659
|
-
}
|
|
1660
|
-
});
|
|
1661
|
-
};
|
|
1662
|
-
|
|
1663
|
-
/**
|
|
1664
|
-
* @param {!dialogPolyfillInfo} dpi
|
|
1665
|
-
* @return {boolean} whether the dialog was allowed
|
|
1666
|
-
*/
|
|
1667
|
-
dialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {
|
|
1668
|
-
var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;
|
|
1669
|
-
if (this.pendingDialogStack.length >= allowed) {
|
|
1670
|
-
return false;
|
|
1671
|
-
}
|
|
1672
|
-
if (this.pendingDialogStack.unshift(dpi) === 1) {
|
|
1673
|
-
this.blockDocument();
|
|
1674
|
-
}
|
|
1675
|
-
this.updateStacking();
|
|
1676
|
-
return true;
|
|
1677
|
-
};
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* @param {!dialogPolyfillInfo} dpi
|
|
1681
|
-
*/
|
|
1682
|
-
dialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {
|
|
1683
|
-
var index = this.pendingDialogStack.indexOf(dpi);
|
|
1684
|
-
if (index === -1) { return; }
|
|
1685
|
-
|
|
1686
|
-
this.pendingDialogStack.splice(index, 1);
|
|
1687
|
-
if (this.pendingDialogStack.length === 0) {
|
|
1688
|
-
this.unblockDocument();
|
|
1689
|
-
}
|
|
1690
|
-
this.updateStacking();
|
|
1691
|
-
};
|
|
1692
|
-
|
|
1693
|
-
dialogPolyfill.dm = new dialogPolyfill.DialogManager();
|
|
1694
|
-
dialogPolyfill.formSubmitter = null;
|
|
1695
|
-
dialogPolyfill.imagemapUseValue = null;
|
|
1696
|
-
|
|
1697
|
-
/**
|
|
1698
|
-
* Installs global handlers, such as click listers and native method overrides. These are needed
|
|
1699
|
-
* even if a no dialog is registered, as they deal with <form method="dialog">.
|
|
1700
|
-
*/
|
|
1701
|
-
if (window.HTMLDialogElement === undefined) {
|
|
1702
|
-
|
|
1703
|
-
/**
|
|
1704
|
-
* If HTMLFormElement translates method="DIALOG" into 'get', then replace the descriptor with
|
|
1705
|
-
* one that returns the correct value.
|
|
1706
|
-
*/
|
|
1707
|
-
var testForm = document.createElement('form');
|
|
1708
|
-
testForm.setAttribute('method', 'dialog');
|
|
1709
|
-
if (testForm.method !== 'dialog') {
|
|
1710
|
-
var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');
|
|
1711
|
-
if (methodDescriptor) {
|
|
1712
|
-
// nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything
|
|
1713
|
-
// and don't bother to update the element.
|
|
1714
|
-
var realGet = methodDescriptor.get;
|
|
1715
|
-
methodDescriptor.get = function() {
|
|
1716
|
-
if (isFormMethodDialog(this)) {
|
|
1717
|
-
return 'dialog';
|
|
1718
|
-
}
|
|
1719
|
-
return realGet.call(this);
|
|
1720
|
-
};
|
|
1721
|
-
var realSet = methodDescriptor.set;
|
|
1722
|
-
/** @this {HTMLElement} */
|
|
1723
|
-
methodDescriptor.set = function(v) {
|
|
1724
|
-
if (typeof v === 'string' && v.toLowerCase() === 'dialog') {
|
|
1725
|
-
return this.setAttribute('method', v);
|
|
1726
|
-
}
|
|
1727
|
-
return realSet.call(this, v);
|
|
1728
|
-
};
|
|
1729
|
-
Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
/**
|
|
1734
|
-
* Global 'click' handler, to capture the <input type="submit"> or <button> element which has
|
|
1735
|
-
* submitted a <form method="dialog">. Needed as Safari and others don't report this inside
|
|
1736
|
-
* document.activeElement.
|
|
1737
|
-
*/
|
|
1738
|
-
document.addEventListener('click', function(ev) {
|
|
1739
|
-
dialogPolyfill.formSubmitter = null;
|
|
1740
|
-
dialogPolyfill.imagemapUseValue = null;
|
|
1741
|
-
if (ev.defaultPrevented) { return; } // e.g. a submit which prevents default submission
|
|
1742
|
-
|
|
1743
|
-
var target = /** @type {Element} */ (ev.target);
|
|
1744
|
-
if ('composedPath' in ev) {
|
|
1745
|
-
var path = ev.composedPath();
|
|
1746
|
-
target = path.shift() || target;
|
|
1747
|
-
}
|
|
1748
|
-
if (!target || !isFormMethodDialog(target.form)) { return; }
|
|
1749
|
-
|
|
1750
|
-
var valid = (target.type === 'submit' && ['button', 'input'].indexOf(target.localName) > -1);
|
|
1751
|
-
if (!valid) {
|
|
1752
|
-
if (!(target.localName === 'input' && target.type === 'image')) { return; }
|
|
1753
|
-
// this is a <input type="image">, which can submit forms
|
|
1754
|
-
dialogPolyfill.imagemapUseValue = ev.offsetX + ',' + ev.offsetY;
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
var dialog = findNearestDialog(target);
|
|
1758
|
-
if (!dialog) { return; }
|
|
1759
|
-
|
|
1760
|
-
dialogPolyfill.formSubmitter = target;
|
|
1761
|
-
|
|
1762
|
-
}, false);
|
|
1763
|
-
|
|
1764
|
-
/**
|
|
1765
|
-
* Global 'submit' handler. This handles submits of `method="dialog"` which are invalid, i.e.,
|
|
1766
|
-
* outside a dialog. They get prevented.
|
|
1767
|
-
*/
|
|
1768
|
-
document.addEventListener('submit', function(ev) {
|
|
1769
|
-
var form = ev.target;
|
|
1770
|
-
var dialog = findNearestDialog(form);
|
|
1771
|
-
if (dialog) {
|
|
1772
|
-
return; // ignore, handle there
|
|
1773
|
-
}
|
|
1774
|
-
|
|
1775
|
-
var submitter = findFormSubmitter(ev);
|
|
1776
|
-
var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');
|
|
1777
|
-
if (formmethod === 'dialog') {
|
|
1778
|
-
ev.preventDefault();
|
|
1779
|
-
}
|
|
1780
|
-
});
|
|
1781
|
-
|
|
1782
|
-
/**
|
|
1783
|
-
* Replace the native HTMLFormElement.submit() method, as it won't fire the
|
|
1784
|
-
* submit event and give us a chance to respond.
|
|
1785
|
-
*/
|
|
1786
|
-
var nativeFormSubmit = HTMLFormElement.prototype.submit;
|
|
1787
|
-
var replacementFormSubmit = function () {
|
|
1788
|
-
if (!isFormMethodDialog(this)) {
|
|
1789
|
-
return nativeFormSubmit.call(this);
|
|
1790
|
-
}
|
|
1791
|
-
var dialog = findNearestDialog(this);
|
|
1792
|
-
dialog && dialog.close();
|
|
1793
|
-
};
|
|
1794
|
-
HTMLFormElement.prototype.submit = replacementFormSubmit;
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
const stylesCss$3 = ":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}}";
|
|
1798
|
-
const ZModalStyle0 = stylesCss$3;
|
|
1799
|
-
|
|
1800
|
-
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])';
|
|
1801
|
-
const ZModal = class {
|
|
1802
|
-
constructor(hostRef) {
|
|
1803
|
-
registerInstance(this, hostRef);
|
|
1804
|
-
this.modalClose = createEvent(this, "modalClose", 7);
|
|
1805
|
-
this.modalHeaderActive = createEvent(this, "modalHeaderActive", 7);
|
|
1806
|
-
this.modalBackgroundClick = createEvent(this, "modalBackgroundClick", 7);
|
|
1807
|
-
this.modalid = undefined;
|
|
1808
|
-
this.modaltitle = undefined;
|
|
1809
|
-
this.modalsubtitle = undefined;
|
|
1810
|
-
this.closeButtonLabel = "chiudi modale";
|
|
1811
|
-
this.alertdialog = false;
|
|
1812
|
-
this.closable = true;
|
|
1813
|
-
this.scrollInside = true;
|
|
1814
|
-
}
|
|
1815
|
-
emitModalClose() {
|
|
1816
|
-
if (this.closable) {
|
|
1817
|
-
this.modalClose.emit({ modalid: this.modalid });
|
|
1818
|
-
}
|
|
1819
|
-
}
|
|
1820
|
-
emitModalHeaderActive() {
|
|
1821
|
-
this.modalHeaderActive.emit({ modalid: this.modalid });
|
|
1822
|
-
}
|
|
1823
|
-
emitBackgroundClick() {
|
|
1824
|
-
if (this.closable) {
|
|
1825
|
-
this.modalBackgroundClick.emit({ modalid: this.modalid });
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
componentDidLoad() {
|
|
1829
|
-
if (typeof window.HTMLDialogElement !== "function") {
|
|
1830
|
-
/* workaround to fix `registerDialog` in test environment:
|
|
1831
|
-
stencil converts html elements to MockHTMLElement but this element is missing the `localName` property,
|
|
1832
|
-
which is used by `registerDialog` to recognize the element as dialog */
|
|
1833
|
-
if (!this.dialog.localName) {
|
|
1834
|
-
Object.defineProperty(this.dialog, "localName", { value: "dialog" });
|
|
1835
|
-
}
|
|
1836
|
-
dialogPolyfill.registerDialog(this.dialog);
|
|
1837
|
-
this.dialog.setAttribute("open", "true");
|
|
1838
|
-
}
|
|
1839
|
-
else {
|
|
1840
|
-
this.open();
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
/** open modal */
|
|
1844
|
-
async open() {
|
|
1845
|
-
var _a;
|
|
1846
|
-
(_a = this.dialog) === null || _a === void 0 ? void 0 : _a.showModal();
|
|
1847
|
-
}
|
|
1848
|
-
/** close modal */
|
|
1849
|
-
async close() {
|
|
1850
|
-
var _a;
|
|
1851
|
-
if (this.closable) {
|
|
1852
|
-
(_a = this.dialog) === null || _a === void 0 ? void 0 : _a.close();
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
/**
|
|
1856
|
-
* Get a list of focusable elements in the dialog.
|
|
1857
|
-
* Remove elements with `display: none` from the list, because they're not focusable.
|
|
1858
|
-
*
|
|
1859
|
-
* N.B. The list is built on the assumption that elements inside shadow root are placed ALL before the `modalContent` slot.
|
|
1860
|
-
* Adding focusable elements after the `modalContent` slot would break the order of elements in the list.
|
|
1861
|
-
*/
|
|
1862
|
-
get focusableElements() {
|
|
1863
|
-
return [
|
|
1864
|
-
...Array.from(this.host.shadowRoot.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR)),
|
|
1865
|
-
...Array.from(this.host.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR)),
|
|
1866
|
-
].filter((element) => getComputedStyle(element).display !== "none");
|
|
1867
|
-
}
|
|
1868
|
-
handleKeyDown(e) {
|
|
1869
|
-
if (e.code !== KeyboardCode.TAB) {
|
|
1870
|
-
return;
|
|
1871
|
-
}
|
|
1872
|
-
const focusableElements = this.focusableElements;
|
|
1873
|
-
const shadowActiveElement = this.host.shadowRoot.activeElement;
|
|
1874
|
-
const activeElement = this.host.ownerDocument.activeElement;
|
|
1875
|
-
const firstFocusableElement = focusableElements[0];
|
|
1876
|
-
const lastFocusableElement = focusableElements[focusableElements.length - 1];
|
|
1877
|
-
if (e.shiftKey && (shadowActiveElement == firstFocusableElement || activeElement == firstFocusableElement)) {
|
|
1878
|
-
// shift + tab was pressed and current active element is the first focusable element
|
|
1879
|
-
e.preventDefault();
|
|
1880
|
-
lastFocusableElement.focus();
|
|
1881
|
-
}
|
|
1882
|
-
else if (!e.shiftKey && (shadowActiveElement == lastFocusableElement || activeElement == lastFocusableElement)) {
|
|
1883
|
-
// shift + tab was pressed and current active element is the first focusable element
|
|
1884
|
-
e.preventDefault();
|
|
1885
|
-
firstFocusableElement.focus();
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
closeButtonSlot() {
|
|
1889
|
-
if (this.closable) {
|
|
1890
|
-
return (h("slot", { name: "modalCloseButton" }, h("button", { "aria-label": this.closeButtonLabel, onClick: () => this.close() }, h("z-icon", { name: "multiply-circle-filled" }))));
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
handleEscape(e) {
|
|
1894
|
-
if (this.closable) {
|
|
1895
|
-
return;
|
|
1896
|
-
}
|
|
1897
|
-
e.preventDefault();
|
|
1898
|
-
}
|
|
1899
|
-
render() {
|
|
1900
|
-
return (h("dialog", { key: 'f2dbe7bebb572bf6a00736ede42543c096feccf7', class: {
|
|
1901
|
-
"modal-dialog": !this.scrollInside,
|
|
1902
|
-
}, "aria-labelledby": "modal-title", "aria-describedby": "modal-content", role: this.alertdialog ? "alertdialog" : undefined, ref: (el) => (this.dialog = el), onClose: () => this.emitModalClose(), onCancel: (e) => this.handleEscape(e) }, h("div", { key: '53e9cb2fa74698f0b6a01dcc2f582d5159850aaa', class: {
|
|
1903
|
-
"modal-container": true,
|
|
1904
|
-
"modal-container-scroll-inside": this.scrollInside,
|
|
1905
|
-
"modal-container-scroll-outside": !this.scrollInside,
|
|
1906
|
-
}, id: this.modalid }, h("header", { key: '53e1a607d3e73ac915d295a429b46af592231ea4', onClick: this.emitModalHeaderActive.bind(this) }, h("div", { key: 'b0c66eca76b7f9437780ca2e13c8f168a49a161a' }, this.modaltitle && h("h1", { id: "modal-title" }, this.modaltitle), this.closeButtonSlot()), this.modalsubtitle && h("h2", { id: "modal-subtitle" }, this.modalsubtitle)), h("div", { key: '6fe98736ef22c37f2a99b00e40a245684b880710', class: {
|
|
1907
|
-
"modal-content-scroll-inside": this.scrollInside,
|
|
1908
|
-
"modal-content-scroll-outside": !this.scrollInside,
|
|
1909
|
-
}, id: "modal-content" }, h("slot", { key: '1b0da4801769eb69b3ecdc78de294b8a064dabfe', name: "modalContent" }))), h("div", { key: 'd86093efe62e7eccac464f533997d69905956fcb', class: {
|
|
1910
|
-
"modal-background": true,
|
|
1911
|
-
"modal-background-scroll-outside": !this.scrollInside,
|
|
1912
|
-
}, "data-action": "modalBackground", "data-modal": this.modalid, onClick: () => {
|
|
1913
|
-
this.emitBackgroundClick();
|
|
1914
|
-
this.close();
|
|
1915
|
-
} })));
|
|
1916
|
-
}
|
|
1917
|
-
get host() { return getElement(this); }
|
|
1918
|
-
};
|
|
1919
|
-
ZModal.style = ZModalStyle0;
|
|
1920
|
-
|
|
1921
|
-
const stylesCss$2 = ".sc-z-offcanvas-h{--z-offcanvas--container-width:375px;--z-offcanvas--top-space:0;min-width:100%;height:100%;font-family:var(--font-family-sans);font-weight:var(--font-rg)}.canvas-container.sc-z-offcanvas{display:flex;overflow:-moz-scrollbars-none;overflow:hidden;min-width:100%;height:100%;flex-direction:column;background:var(--color-surface01)}[variant=\"pushcontent\"].sc-z-offcanvas-h{display:none}[open].sc-z-offcanvas-h{display:flex;visibility:visible}.sc-z-offcanvas-h:not([open]){visibility:hidden}[variant=\"overlay\"].sc-z-offcanvas-h{position:fixed;z-index:1000;top:var(--z-offcanvas--top-space);right:0;bottom:0;left:0;display:flex;height:calc(100% - var(--z-offcanvas--top-space))}[variant=\"overlay\"][transitiondirection=\"left\"].sc-z-offcanvas-h{justify-content:end}[variant=\"overlay\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas{z-index:1010}[variant=\"overlay\"].sc-z-offcanvas-h .canvas-background.sc-z-offcanvas{position:absolute;left:0;width:100%;height:100%;background-color:var(--gray900);opacity:0.7}.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{overflow:auto;flex:1 auto;padding:0 calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) calc(var(--space-unit) * 2) 0;overflow-x:hidden}[variant=\"overlay\"].sc-z-offcanvas-h>.canvas-container.sc-z-offcanvas>.canvas-content.sc-z-offcanvas{padding:0 calc(var(--space-unit) * 2) calc(var(--space-unit) * 2) calc(var(--space-unit) * 2);margin:calc(var(--space-unit) * 2) calc(var(--space-unit) / 2) 0 0}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-track{background-color:transparent}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas::-webkit-scrollbar-thumb:hover{background-color:var(--color-hover-primary)}.canvas-container.sc-z-offcanvas .canvas-content.sc-z-offcanvas{scrollbar-color:var(--color-primary01) transparent}@media only screen and (max-width: 768px){[open][transitiondirection=\"left\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection=\"right\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-left 0.4s ease-out}}@media only screen and (min-width: 768px){.sc-z-offcanvas-h{min-width:auto}.canvas-container.sc-z-offcanvas{width:auto;min-width:max(var(--z-offcanvas--container-width), 375px);max-width:max(var(--z-offcanvas--container-width), 375px);height:auto;min-height:calc(var(--space-unit) * 40)}.sc-z-offcanvas-h:not([variant=\"overlay\"])[open]:not(.skip-animation){width:auto;animation:grow 0.4s ease-out}}@keyframes grow{from{width:0}to{width:max(var(--z-offcanvas--container-width), 375px)}}@keyframes enter-left{from{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes enter-right{from{transform:translateX(100%)}to{transform:translateX(0)}}[open][variant=\"overlay\"][transitiondirection=\"left\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-right 0.4s ease-out}[open][transitiondirection=\"right\"].sc-z-offcanvas-h:not(.skip-animation)>.canvas-container.sc-z-offcanvas{animation:enter-left 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"][transitiondirection=\"right\"]>.canvas-container.sc-z-offcanvas{transform:translateX(-100%);transition:visibility 0.4s ease-out, transform 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"][transitiondirection=\"left\"]>.canvas-container.sc-z-offcanvas{transform:translateX(100%);transition:visibility 0.4s ease-out, transform 0.4s ease-out}.sc-z-offcanvas-h:not([open])[variant=\"overlay\"] .canvas-background.sc-z-offcanvas{transition:visibility 0.4s ease-out;visibility:hidden}";
|
|
1922
|
-
const ZOffcanvasStyle0 = stylesCss$2;
|
|
1923
|
-
|
|
1924
|
-
const ZOffcanvas = class {
|
|
1925
|
-
constructor(hostRef) {
|
|
1926
|
-
registerInstance(this, hostRef);
|
|
1927
|
-
this.canvasOpenStatusChanged = createEvent(this, "canvasOpenStatusChanged", 7);
|
|
1928
|
-
this.variant = OffCanvasVariant.PUSHCONTENT;
|
|
1929
|
-
this.open = false;
|
|
1930
|
-
this.transitiondirection = TransitionDirection.LEFT;
|
|
1931
|
-
this.skipLoadAnimation = false;
|
|
1932
|
-
}
|
|
1933
|
-
onOpenChanged() {
|
|
1934
|
-
if (!this.open && this.skipLoadAnimation) {
|
|
1935
|
-
this.skipLoadAnimation = false;
|
|
1936
|
-
}
|
|
1937
|
-
this.handlePageOverflow();
|
|
1938
|
-
this.canvasOpenStatusChanged.emit(this.open);
|
|
1939
|
-
}
|
|
1940
|
-
handlePageOverflow() {
|
|
1941
|
-
const overflow = this.variant === OffCanvasVariant.OVERLAY ? "overflow-y" : "overflow-x";
|
|
1942
|
-
document.body.style[overflow] = this.open ? "hidden" : "";
|
|
1943
|
-
}
|
|
1944
|
-
disconnectedCallback() {
|
|
1945
|
-
this.open = false;
|
|
1946
|
-
}
|
|
1947
|
-
render() {
|
|
1948
|
-
return (h(Host, { key: 'f0f282fa9732f81f98d644210d2b602a53161b7d', class: { "skip-animation": this.skipLoadAnimation } }, h("div", { key: '15bf03615f187509da41d3206b39d705ca34cb50', role: "presentation", class: "canvas-container", onTransitionEnd: () => this.handlePageOverflow() }, h("div", { key: 'ba4444c4f3e6c3d9c9fecc4ff4ab103fc614b6bb', role: "presentation", class: "canvas-content" }, h("slot", { key: '4da6be1451be2a26815c7d6503a1eb9cec7c48f6', name: "canvasContent" }))), this.variant == OffCanvasVariant.OVERLAY && (h("div", { class: "canvas-background", "data-action": "canvasBackground", onClick: () => (this.open = false) }))));
|
|
1949
|
-
}
|
|
1950
|
-
static get watchers() { return {
|
|
1951
|
-
"open": ["onOpenChanged"]
|
|
1952
|
-
}; }
|
|
1953
|
-
};
|
|
1954
|
-
ZOffcanvas.style = ZOffcanvasStyle0;
|
|
1955
|
-
|
|
1956
|
-
const stylesCss$1 = ":host{z-index:15;display:flex;column-gap:calc(var(--space-unit) * 2);font-family:var(--font-family-sans);font-weight:var(--font-rg)}:host,*{box-sizing:border-box}.input-container{position:relative;display:flex;width:100%;flex-direction:column}.results-wrapper{position:absolute;top:calc(100% - 1px);left:0;width:100%;padding:calc(var(--space-unit) / 4);border:var(--border-size-small) solid var(--color-surface03);border-top:none;background:var(--color-surface01)}.results{overflow:auto;max-height:var(--z-searchbar-results-height, 540px);padding:calc(var(--space-unit) / 2) calc(var(--space-unit) * 1.5);scrollbar-color:var(--color-primary01) transparent}.results::-webkit-scrollbar{width:10px;background:linear-gradient(to right, transparent 0 3px, var(--gray200) 3px 7px, transparent 7px 10px);border-radius:var(--border-radius)}.results::-webkit-scrollbar-track{background-color:transparent}.results::-webkit-scrollbar-thumb{width:10px;background-color:var(--color-primary01);border-radius:var(--border-radius)}.results .category-heading{display:block;font-size:var(--font-size-2);font-weight:var(--font-rg);line-height:var(--font-size-3)}.results .category-heading>*{display:block}.results .category-heading>.category{color:var(--color-text05);font-style:italic}.results .category-heading>.subcategory{margin-top:var(--space-unit);color:var(--color-text01);text-transform:uppercase}.results z-list-element{display:block}.results z-list-element>.list-element{display:flex;justify-content:space-between}.results z-list-element>.list-element>z-tag{border:1px solid var(--gray800);font-size:var(--font-size-1);font-weight:var(--font-sb);--z-tag-bg:white;--z-tag-text-color:var(--color-text01)}.results .item{--z-icon-height:12px;--z-icon-width:12px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-start;color:var(--color-text01);column-gap:calc(var(--space-unit) * 1.5);fill:var(--color-icon02);font-size:var(--font-size-2);line-height:var(--font-size-3)}.results .item.ellipsis>.item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.results .item>.item-label mark{background:var(--color-primary03)}.results .item.has-category{padding-left:calc(var(--space-unit) * 3)}.results .item.item-search{--z-icon-height:16px;--z-icon-width:16px}.results .item-show-all{text-align:center}.results .item-no-results{display:block;font-size:var(--font-size-2);font-style:italic;line-height:var(--font-size-5)}.results .item-no-results>ul{padding-left:calc(var(--space-unit) * 2);margin:var(--space-unit)}@media (min-width: 768px){.results .category-heading{font-size:var(--font-size-3);line-height:var(--font-size-6)}.results .item{font-size:var(--font-size-3);line-height:var(--font-size-6)}.results .item.item-search{--z-icon-height:18px;--z-icon-width:18px}.results .item.ellipsis>.item-label{height:24px}}@media (min-width: 1152px){.results .item{cursor:pointer}.results .item-no-results{cursor:default;font-size:var(--font-size-3);line-height:var(--font-size-6)}}:host([size=\"small\"]) .results :is(.item,.category-heading),:host([size=\"x-small\"]) .results :is(.item,.category-heading){font-size:var(--font-size-2)}:host([size=\"small\"]) .results .item:not(.has-category),:host([size=\"x-small\"]) .results .item:not(.has-category){--z-icon-height:16px;--z-icon-width:16px}:host([size=\"small\"])::part(list-item-container){min-height:calc(var(--space-unit) * 4.5);padding:0}:host([size=\"x-small\"])::part(list-item-container){min-height:calc(var(--space-unit) * 4);padding:0}";
|
|
1957
|
-
const ZSearchbarStyle0 = stylesCss$1;
|
|
1958
|
-
|
|
1959
|
-
const ZSearchbar = class {
|
|
1960
|
-
constructor(hostRef) {
|
|
1961
|
-
registerInstance(this, hostRef);
|
|
1962
|
-
this.searchSubmit = createEvent(this, "searchSubmit", 7);
|
|
1963
|
-
this.searchTyping = createEvent(this, "searchTyping", 7);
|
|
1964
|
-
this.searchItemClick = createEvent(this, "searchItemClick", 7);
|
|
1965
|
-
this.resultsItemsList = null;
|
|
1966
|
-
this.htmlid = `searchbar-${randomId()}`;
|
|
1967
|
-
this.preventSubmit = false;
|
|
1968
|
-
this.value = undefined;
|
|
1969
|
-
this.placeholder = undefined;
|
|
1970
|
-
this.autocomplete = false;
|
|
1971
|
-
this.autocompleteMinChars = 3;
|
|
1972
|
-
this.resultsCount = undefined;
|
|
1973
|
-
this.resultsEllipsis = true;
|
|
1974
|
-
this.searchHelperLabel = "Cerca {searchString}";
|
|
1975
|
-
this.resultsItems = undefined;
|
|
1976
|
-
this.sortResultsItems = false;
|
|
1977
|
-
this.showSearchButton = false;
|
|
1978
|
-
this.searchButtonIconOnly = false;
|
|
1979
|
-
this.size = ControlSize.BIG;
|
|
1980
|
-
this.variant = ButtonVariant.PRIMARY;
|
|
1981
|
-
this.searchString = this.value;
|
|
1982
|
-
this.currResultsCount = 0;
|
|
1983
|
-
this.showResults = false;
|
|
1984
|
-
this.isMobile = false;
|
|
1985
|
-
}
|
|
1986
|
-
emitSearchSubmit() {
|
|
1987
|
-
this.searchSubmit.emit(this.inputRef.value);
|
|
1988
|
-
}
|
|
1989
|
-
emitSearchTyping(search) {
|
|
1990
|
-
this.searchTyping.emit(search);
|
|
1991
|
-
}
|
|
1992
|
-
emitSearchItemClick(item) {
|
|
1993
|
-
this.searchItemClick.emit(item);
|
|
1994
|
-
}
|
|
1995
|
-
watchItems() {
|
|
1996
|
-
this.resultsItemsList = this.getResultsItemsList();
|
|
1997
|
-
}
|
|
1998
|
-
watchResultsCount() {
|
|
1999
|
-
this.currResultsCount = this.resultsCount;
|
|
2000
|
-
}
|
|
2001
|
-
watchValue() {
|
|
2002
|
-
this.searchString = this.value;
|
|
2003
|
-
}
|
|
2004
|
-
watchSearchString() {
|
|
2005
|
-
this.emitSearchTyping(this.searchString);
|
|
2006
|
-
if (!this.searchString) {
|
|
2007
|
-
this.currResultsCount = this.resultsCount;
|
|
2008
|
-
}
|
|
2009
|
-
}
|
|
2010
|
-
disconnectedCallback() {
|
|
2011
|
-
this.resizeObserver.disconnect();
|
|
2012
|
-
}
|
|
2013
|
-
componentDidLoad() {
|
|
2014
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
2015
|
-
if (getDevice() === Device.MOBILE && !this.isMobile) {
|
|
2016
|
-
this.isMobile = true;
|
|
2017
|
-
}
|
|
2018
|
-
if (getDevice() !== Device.MOBILE && this.isMobile) {
|
|
2019
|
-
this.isMobile = false;
|
|
2020
|
-
}
|
|
2021
|
-
});
|
|
2022
|
-
this.resizeObserver.observe(this.element);
|
|
2023
|
-
}
|
|
2024
|
-
componentWillLoad() {
|
|
2025
|
-
this.resultsItemsList = this.getResultsItemsList();
|
|
2026
|
-
this.currResultsCount = this.resultsCount;
|
|
2027
|
-
}
|
|
2028
|
-
getResultsItemsList() {
|
|
2029
|
-
return typeof this.resultsItems === "string" ? JSON.parse(this.resultsItems) : this.resultsItems;
|
|
2030
|
-
}
|
|
2031
|
-
getGroupedItems(items) {
|
|
2032
|
-
const groupedItems = {};
|
|
2033
|
-
items.forEach((item) => {
|
|
2034
|
-
var _a;
|
|
2035
|
-
const key = `${item === null || item === void 0 ? void 0 : item.category}${item === null || item === void 0 ? void 0 : item.subcategory}`;
|
|
2036
|
-
groupedItems[key] = (_a = groupedItems[key]) !== null && _a !== void 0 ? _a : {
|
|
2037
|
-
category: item === null || item === void 0 ? void 0 : item.category,
|
|
2038
|
-
subcategory: item === null || item === void 0 ? void 0 : item.subcategory,
|
|
2039
|
-
items: [],
|
|
2040
|
-
};
|
|
2041
|
-
groupedItems[key]["items"].push(item);
|
|
2042
|
-
});
|
|
2043
|
-
if (this.sortResultsItems) {
|
|
2044
|
-
return Object.keys(groupedItems)
|
|
2045
|
-
.sort()
|
|
2046
|
-
.reduce((obj, key) => {
|
|
2047
|
-
obj[key] = Object.assign(Object.assign({}, groupedItems[key]), { items: groupedItems[key]["items"].sort((a, b) => {
|
|
2048
|
-
const nameA = a.label.toUpperCase();
|
|
2049
|
-
const nameB = b.label.toUpperCase();
|
|
2050
|
-
if (nameA < nameB) {
|
|
2051
|
-
return -1;
|
|
2052
|
-
}
|
|
2053
|
-
if (nameA > nameB) {
|
|
2054
|
-
return 1;
|
|
2055
|
-
}
|
|
2056
|
-
return 0;
|
|
2057
|
-
}) });
|
|
2058
|
-
return obj;
|
|
2059
|
-
}, {});
|
|
2060
|
-
}
|
|
2061
|
-
return groupedItems;
|
|
2062
|
-
}
|
|
2063
|
-
checkResultsCount(counter) {
|
|
2064
|
-
if (!this.currResultsCount || counter < this.currResultsCount) {
|
|
2065
|
-
return true;
|
|
2066
|
-
}
|
|
2067
|
-
return false;
|
|
2068
|
-
}
|
|
2069
|
-
handleStopTyping(e) {
|
|
2070
|
-
e.stopPropagation();
|
|
2071
|
-
this.searchString = e.detail.value;
|
|
2072
|
-
}
|
|
2073
|
-
handleSubmit() {
|
|
2074
|
-
if (this.preventSubmit) {
|
|
2075
|
-
return;
|
|
2076
|
-
}
|
|
2077
|
-
this.emitSearchSubmit();
|
|
2078
|
-
}
|
|
2079
|
-
handleOutsideClick(e) {
|
|
2080
|
-
const cp = e.composedPath();
|
|
2081
|
-
const searchbar = cp.find((elem) => elem.nodeName === "Z-SEARCHBAR");
|
|
2082
|
-
if (!searchbar || searchbar.htmlid !== this.htmlid) {
|
|
2083
|
-
this.showResults = false;
|
|
2084
|
-
return;
|
|
2085
|
-
}
|
|
2086
|
-
if (cp.find((elem) => { var _a; return (elem === null || elem === void 0 ? void 0 : elem.nodeName) === "Z-INPUT" || ((_a = elem === null || elem === void 0 ? void 0 : elem.classList) === null || _a === void 0 ? void 0 : _a.contains("results")); })) {
|
|
2087
|
-
this.showResults = true;
|
|
2088
|
-
return;
|
|
2089
|
-
}
|
|
2090
|
-
this.showResults = false;
|
|
2091
|
-
}
|
|
2092
|
-
renderInput() {
|
|
2093
|
-
return (h("z-input", { ref: (val) => {
|
|
2094
|
-
this.inputRef = val;
|
|
2095
|
-
}, message: false, placeholder: this.placeholder, onStopTyping: (e) => this.handleStopTyping(e), onKeyUp: (e) => handleEnterKeydSubmit(e, () => this.handleSubmit()), value: this.value, size: this.size }));
|
|
2096
|
-
}
|
|
2097
|
-
renderButton() {
|
|
2098
|
-
if (!this.showSearchButton) {
|
|
2099
|
-
return null;
|
|
2100
|
-
}
|
|
2101
|
-
const iconProp = this.searchButtonIconOnly ? { icon: "search" } : null;
|
|
2102
|
-
const buttonLabel = this.searchButtonIconOnly ? "" : "CERCA";
|
|
2103
|
-
const defaultProps = Object.assign({ disabled: this.preventSubmit, variant: this.variant, size: this.size, onClick: () => this.handleSubmit() }, iconProp);
|
|
2104
|
-
return h("z-button", Object.assign({}, defaultProps), buttonLabel);
|
|
2105
|
-
}
|
|
2106
|
-
renderResults() {
|
|
2107
|
-
if (!this.showResults ||
|
|
2108
|
-
!this.autocomplete ||
|
|
2109
|
-
!this.searchString ||
|
|
2110
|
-
this.searchString.length < this.autocompleteMinChars ||
|
|
2111
|
-
!this.resultsItemsList) {
|
|
2112
|
-
return null;
|
|
2113
|
-
}
|
|
2114
|
-
return (h("div", { class: "results-wrapper" }, h("div", { class: "results" }, this.renderResultsList())));
|
|
2115
|
-
}
|
|
2116
|
-
renderResultsList() {
|
|
2117
|
-
var _a, _b;
|
|
2118
|
-
if (this.preventSubmit && !((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
2119
|
-
return (h("span", { class: "item item-no-results" }, "Non abbiamo trovato risultati per ", h("b", null, this.searchString), h("br", null), h("br", null), "Cosa puoi fare?", h("ul", null, h("li", null, "Verificare di aver scritto bene"), h("li", null, "Provare a cercare un'altra parola"), h("li", null, "Provare a cercare qualcosa di pi\u00F9 generico"))));
|
|
2120
|
-
}
|
|
2121
|
-
return (h("z-list", { role: "listbox", id: `list-${this.htmlid}` }, this.renderSearchHelper(!!((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)), this.renderItems(), this.renderShowAllResults()));
|
|
2122
|
-
}
|
|
2123
|
-
renderItems() {
|
|
2124
|
-
var _a;
|
|
2125
|
-
if (!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
2126
|
-
return [];
|
|
2127
|
-
}
|
|
2128
|
-
const groupedItems = this.getGroupedItems(this.resultsItemsList);
|
|
2129
|
-
const listGroups = [];
|
|
2130
|
-
let counter = 0;
|
|
2131
|
-
Object.values(groupedItems).forEach((groupItem, index, array) => {
|
|
2132
|
-
if (this.checkResultsCount(counter)) {
|
|
2133
|
-
const listGroupsElements = [];
|
|
2134
|
-
groupItem.items.forEach((item, subindex, subarray) => {
|
|
2135
|
-
if (this.checkResultsCount(counter)) {
|
|
2136
|
-
const isLast = index === array.length - 1 && subindex === subarray.length - 1;
|
|
2137
|
-
listGroupsElements.push(this.renderItem(item, subindex, !isLast));
|
|
2138
|
-
}
|
|
2139
|
-
counter++;
|
|
2140
|
-
});
|
|
2141
|
-
if (listGroupsElements.length) {
|
|
2142
|
-
listGroups.push(h("z-list-group", { "divider-type": ListDividerType.ELEMENT }, this.renderItemCategory(groupItem), listGroupsElements));
|
|
2143
|
-
}
|
|
2144
|
-
}
|
|
2145
|
-
});
|
|
2146
|
-
return listGroups;
|
|
2147
|
-
}
|
|
2148
|
-
renderItem(item, key, divider) {
|
|
2149
|
-
return (h("z-list-element", { id: `list-item-${this.htmlid}-${key}`, role: "option", tabindex: 0, dividerType: divider ? ListDividerType.ELEMENT : undefined, clickable: true, onClickItem: () => this.emitSearchItemClick(item) }, h("div", { class: "list-element" }, h("span", { class: { "item": true, "ellipsis": this.resultsEllipsis, "has-category": !!item.category } }, (item === null || item === void 0 ? void 0 : item.icon) && (h("z-icon", { class: "item-icon", name: item.icon })), h("span", { class: "item-label", title: item.label, innerHTML: this.renderItemLabel(item.label) })), (item === null || item === void 0 ? void 0 : item.tag) && h("z-tag", { icon: item.tag.icon }, !this.isMobile ? item.tag.text : ""))));
|
|
2150
|
-
}
|
|
2151
|
-
renderItemLabel(label) {
|
|
2152
|
-
if (!this.searchString) {
|
|
2153
|
-
return label;
|
|
2154
|
-
}
|
|
2155
|
-
return label.replace(new RegExp(this.searchString.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gmi"), (found) => `<mark>${found}</mark>`);
|
|
2156
|
-
}
|
|
2157
|
-
renderItemCategory(groupItem) {
|
|
2158
|
-
if (!(groupItem === null || groupItem === void 0 ? void 0 : groupItem.category)) {
|
|
2159
|
-
return null;
|
|
2160
|
-
}
|
|
2161
|
-
return (h("span", { class: "category-heading", slot: "header-title" }, h("span", { class: "category" }, groupItem.category), (groupItem === null || groupItem === void 0 ? void 0 : groupItem.subcategory) && h("span", { class: "subcategory" }, groupItem.subcategory)));
|
|
2162
|
-
}
|
|
2163
|
-
renderSearchHelper(hasDivider = true) {
|
|
2164
|
-
if (!this.autocomplete || this.preventSubmit || !this.searchString) {
|
|
2165
|
-
return null;
|
|
2166
|
-
}
|
|
2167
|
-
return (h("z-list-element", { role: "option", tabindex: 0, dividerType: hasDivider ? ListDividerType.ELEMENT : undefined, clickable: true, id: `list-item-${this.htmlid}-search`, onClickItem: () => this.emitSearchSubmit() }, h("span", { class: "item item-search" }, h("z-icon", { class: "search-icon", name: "left-magnifying-glass" }), h("span", { class: "item-label", innerHTML: this.searchHelperLabel.replace("{searchString}", `<mark>${this.searchString}</mark>`) }))));
|
|
2168
|
-
}
|
|
2169
|
-
renderShowAllResults() {
|
|
2170
|
-
var _a, _b;
|
|
2171
|
-
if (!this.currResultsCount ||
|
|
2172
|
-
!this.searchString ||
|
|
2173
|
-
!((_a = this.resultsItemsList) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
2174
|
-
this.currResultsCount >= ((_b = this.resultsItemsList) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
2175
|
-
return null;
|
|
2176
|
-
}
|
|
2177
|
-
return (h("z-list-element", { role: "option", tabindex: 0, clickable: true, id: `list-item-${this.htmlid}-show-all`, onClickItem: () => (this.currResultsCount = 0), color: "color-primary01" }, h("div", { class: "item-show-all" }, "Vedi tutti i risultati")));
|
|
2178
|
-
}
|
|
2179
|
-
render() {
|
|
2180
|
-
return (h(Host, { key: '49e7bb3d48c18519e07ac4952188f271895dd1a1', onFocus: () => (this.showResults = true), onClick: (e) => this.handleOutsideClick(e), class: { "has-submit": this.showSearchButton, "has-results": this.autocomplete } }, h("div", { key: '033d0ae0a35385e0d9d915e18887650b997c5688', class: "input-container" }, this.renderInput(), this.renderResults()), this.renderButton()));
|
|
2181
|
-
}
|
|
2182
|
-
get element() { return getElement(this); }
|
|
2183
|
-
static get watchers() { return {
|
|
2184
|
-
"resultsItems": ["watchItems"],
|
|
2185
|
-
"resultsCount": ["watchResultsCount"],
|
|
2186
|
-
"value": ["watchValue"],
|
|
2187
|
-
"searchString": ["watchSearchString"]
|
|
2188
|
-
}; }
|
|
2189
|
-
};
|
|
2190
|
-
ZSearchbar.style = ZSearchbarStyle0;
|
|
2191
|
-
|
|
2192
|
-
const stylesCss = ".sc-z-tag-h{--z-icon-width:14px;--z-icon-height:14px;--z-tag-text-color:var(--color-primary03);--z-tag-bg:var(--color-hover-primary);display:flex;width:fit-content;max-width:inherit;height:fit-content;max-height:inherit;padding:calc(var(--space-unit) / 2);background-color:var(--z-tag-bg);border-radius:var(--border-radius);color:var(--z-tag-text-color);fill:var(--z-tag-text-color);font-family:var(--font-family-sans);line-height:14px;text-transform:uppercase}.sc-z-tag-h>z-icon.sc-z-tag{margin-right:var(--space-unit)}.expandable.sc-z-tag-h>z-icon.sc-z-tag{margin-right:0;transition:margin-right 0.3s ease-out}.sc-z-tag-h:not(.expandable)>z-icon.sc-z-tag:not(:last-child),.expandable.sc-z-tag-h:hover>z-icon.sc-z-tag:not(:last-child){margin-right:var(--space-unit);transition:margin-right 0.3s ease-out 0s}.expandable.sc-z-tag-h>div.sc-z-tag{overflow:hidden;max-width:0;max-height:0}.expandable.sc-z-tag-h:hover>div.sc-z-tag{max-width:100%;max-height:100%}";
|
|
2193
|
-
const ZTagStyle0 = stylesCss;
|
|
2194
|
-
|
|
2195
|
-
const ZTag = class {
|
|
2196
|
-
constructor(hostRef) {
|
|
2197
|
-
registerInstance(this, hostRef);
|
|
2198
|
-
this.icon = undefined;
|
|
2199
|
-
this.expandable = undefined;
|
|
2200
|
-
}
|
|
2201
|
-
render() {
|
|
2202
|
-
return (h(Host, { key: '9d45170a5cefce5d815ac7b5402123645a8d243b', class: {
|
|
2203
|
-
"body-5-sb": true,
|
|
2204
|
-
"expandable": this.expandable && !!this.icon,
|
|
2205
|
-
} }, this.icon && h("z-icon", { name: this.icon }), h("div", { key: '9cf3b9f7b169709cf109cdab4d0cfe346a9eb29c' }, h("slot", { key: 'c26454112b3fa7ce120eaf50844cb82c9e11e751' }))));
|
|
2206
|
-
}
|
|
2207
|
-
};
|
|
2208
|
-
ZTag.style = ZTagStyle0;
|
|
2209
|
-
|
|
2210
|
-
export { ZAppHeader as z_app_header, ZButton as z_button, ZDivider as z_divider, ZDragdropArea as z_dragdrop_area, ZFileUpload as z_file_upload, ZIcon as z_icon, ZInput as z_input, ZInputMessage as z_input_message, ZList as z_list, ZListElement as z_list_element, ZListGroup as z_list_group, ZModal as z_modal, ZOffcanvas as z_offcanvas, ZSearchbar as z_searchbar, ZTag as z_tag };
|
|
2211
|
-
|
|
2212
|
-
//# sourceMappingURL=z-app-header_15.entry.js.map
|