@zanichelli/albe-web-components 16.4.0-rc-2 → 16.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cjs/{index-1bcf6013.js → index-22bdf239.js} +2 -2
- package/dist/cjs/index-22bdf239.js.map +1 -0
- package/dist/cjs/{index-59c3bcbe.js → index-6726b7d2.js} +2 -2
- package/dist/cjs/{index-59c3bcbe.js.map → index-6726b7d2.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/web-components-library.cjs.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +24 -3
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +4 -10
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +1 -1
- package/dist/cjs/z-menu.cjs.entry.js +1 -1
- package/dist/cjs/z-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/z-table.cjs.entry.js +2 -2
- package/dist/cjs/z-th.cjs.entry.js +1 -1
- package/dist/cjs/z-tr.cjs.entry.js +2 -2
- package/dist/collection/beans/index.js.map +1 -1
- package/dist/collection/components/css-components/z-fab/index.stories.js.map +1 -1
- package/dist/collection/components/css-components/z-link/index.stories.js.map +1 -1
- package/dist/collection/components/date-picker/utils.js.map +1 -1
- package/dist/collection/components/date-picker/z-date-picker/index.js.map +1 -1
- package/dist/collection/components/date-picker/z-date-picker/index.stories.js.map +1 -1
- package/dist/collection/components/date-picker/z-range-picker/index.js.map +1 -1
- package/dist/collection/components/date-picker/z-range-picker/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.js.map +1 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.stories.js.map +1 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file/index.stories.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.stories.js.map +1 -1
- package/dist/collection/components/index.js.map +1 -1
- package/dist/collection/components/list/z-list/index.js.map +1 -1
- package/dist/collection/components/list/z-list/index.stories.js.map +1 -1
- package/dist/collection/components/list/z-list-element/index.js.map +1 -1
- package/dist/collection/components/list/z-list-element/index.stories.js.map +1 -1
- package/dist/collection/components/list/z-list-group/index.js.map +1 -1
- package/dist/collection/components/list/z-list-group/index.stories.js.map +1 -1
- package/dist/collection/components/table/cells/z-td/index.js.map +1 -1
- package/dist/collection/components/table/cells/z-th/index.js.map +1 -1
- package/dist/collection/components/table/cells/z-th/styles.css +1 -1
- package/dist/collection/components/table/z-table/index.js.map +1 -1
- package/dist/collection/components/table/z-table/index.stories.js.map +1 -1
- package/dist/collection/components/table/z-tbody/index.js.map +1 -1
- package/dist/collection/components/table/z-tfoot/index.js.map +1 -1
- package/dist/collection/components/table/z-thead/index.js.map +1 -1
- package/dist/collection/components/table/z-tr/index.js.map +1 -1
- package/dist/collection/components/z-accordion/index.js.map +1 -1
- package/dist/collection/components/z-accordion/index.stories.js.map +1 -1
- package/dist/collection/components/z-anchor-navigation/index.js.map +1 -1
- package/dist/collection/components/z-anchor-navigation/index.stories.js.map +1 -1
- package/dist/collection/components/z-app-header/index.js.map +1 -1
- package/dist/collection/components/z-app-header/index.stories.js.map +1 -1
- package/dist/collection/components/z-aria-alert/index.js.map +1 -1
- package/dist/collection/components/z-aria-alert/index.stories.js.map +1 -1
- package/dist/collection/components/z-avatar/index.js.map +1 -1
- package/dist/collection/components/z-avatar/index.stories.js.map +1 -1
- package/dist/collection/components/z-book-card/index.js.map +1 -1
- package/dist/collection/components/z-book-card/index.stories.js.map +1 -1
- package/dist/collection/components/z-breadcrumb/index.js.map +1 -1
- package/dist/collection/components/z-breadcrumb/index.stories.js.map +1 -1
- package/dist/collection/components/z-button/index.js.map +1 -1
- package/dist/collection/components/z-button/index.stories.js.map +1 -1
- package/dist/collection/components/z-button-sort/index.js.map +1 -1
- package/dist/collection/components/z-button-sort/index.stories.js.map +1 -1
- package/dist/collection/components/z-card/index.js.map +1 -1
- package/dist/collection/components/z-card/index.stories.js.map +1 -1
- package/dist/collection/components/z-carousel/index.js.map +1 -1
- package/dist/collection/components/z-carousel/index.stories.js.map +1 -1
- package/dist/collection/components/z-chip/index.js.map +1 -1
- package/dist/collection/components/z-chip/index.stories.js.map +1 -1
- package/dist/collection/components/z-combobox/index.js.map +1 -1
- package/dist/collection/components/z-combobox/index.stories.js.map +1 -1
- package/dist/collection/components/z-cover-hero/index.js.map +1 -1
- package/dist/collection/components/z-cover-hero/index.stories.js.map +1 -1
- package/dist/collection/components/z-divider/index.js.map +1 -1
- package/dist/collection/components/z-divider/index.stories.js.map +1 -1
- package/dist/collection/components/z-ghost-loading/index.js.map +1 -1
- package/dist/collection/components/z-ghost-loading/index.stories.js.map +1 -1
- package/dist/collection/components/z-icon/index.js.map +1 -1
- package/dist/collection/components/z-icon/index.stories.js.map +1 -1
- package/dist/collection/components/z-info-box/index.js.map +1 -1
- package/dist/collection/components/z-info-box/index.stories.js.map +1 -1
- package/dist/collection/components/z-info-reveal/index.js.map +1 -1
- package/dist/collection/components/z-info-reveal/index.stories.js.map +1 -1
- package/dist/collection/components/z-input/index.js.map +1 -1
- package/dist/collection/components/z-input/index.stories.js.map +1 -1
- package/dist/collection/components/z-input-message/index.js.map +1 -1
- package/dist/collection/components/z-input-message/index.stories.js.map +1 -1
- package/dist/collection/components/z-logo/index.js.map +1 -1
- package/dist/collection/components/z-logo/index.stories.js.map +1 -1
- package/dist/collection/components/z-menu/index.js.map +1 -1
- package/dist/collection/components/z-menu/index.stories.js.map +1 -1
- package/dist/collection/components/z-menu/styles.css +1 -0
- package/dist/collection/components/z-menu-section/index.js.map +1 -1
- package/dist/collection/components/z-menu-section/index.stories.js.map +1 -1
- package/dist/collection/components/z-modal/index.js +4 -10
- package/dist/collection/components/z-modal/index.js.map +1 -1
- package/dist/collection/components/z-modal/index.stories.js.map +1 -1
- package/dist/collection/components/z-navigation-tabs/index.js.map +1 -1
- package/dist/collection/components/z-navigation-tabs/index.stories.js.map +1 -1
- package/dist/collection/components/z-notification/index.js.map +1 -1
- package/dist/collection/components/z-notification/index.stories.js.map +1 -1
- package/dist/collection/components/z-offcanvas/index.js +27 -3
- package/dist/collection/components/z-offcanvas/index.js.map +1 -1
- package/dist/collection/components/z-offcanvas/index.stories.js +12 -46
- package/dist/collection/components/z-offcanvas/index.stories.js.map +1 -1
- package/dist/collection/components/z-offcanvas/styles.css +10 -15
- package/dist/collection/components/z-pagination/index.js.map +1 -1
- package/dist/collection/components/z-pagination/index.stories.js.map +1 -1
- package/dist/collection/components/z-panel-elem/index.js.map +1 -1
- package/dist/collection/components/z-panel-elem/index.stories.js.map +1 -1
- package/dist/collection/components/z-popover/index.js.map +1 -1
- package/dist/collection/components/z-popover/index.stories.js.map +1 -1
- package/dist/collection/components/z-searchbar/index.js.map +1 -1
- package/dist/collection/components/z-searchbar/index.stories.js.map +1 -1
- package/dist/collection/components/z-section-title/index.js.map +1 -1
- package/dist/collection/components/z-section-title/index.stories.js.map +1 -1
- package/dist/collection/components/z-select/index.js.map +1 -1
- package/dist/collection/components/z-select/index.stories.js.map +1 -1
- package/dist/collection/components/z-skip-to-content/index.js.map +1 -1
- package/dist/collection/components/z-skip-to-content/index.stories.js.map +1 -1
- package/dist/collection/components/z-stepper/index.js.map +1 -1
- package/dist/collection/components/z-stepper/index.stories.js.map +1 -1
- package/dist/collection/components/z-stepper-item/index.js.map +1 -1
- package/dist/collection/components/z-stepper-item/index.stories.js.map +1 -1
- package/dist/collection/components/z-tag/index.js.map +1 -1
- package/dist/collection/components/z-tag/index.stories.js.map +1 -1
- package/dist/collection/components/z-toast-notification/index.js.map +1 -1
- package/dist/collection/components/z-toast-notification/index.stories.js.map +1 -1
- package/dist/collection/components/z-toast-notification-list/index.js.map +1 -1
- package/dist/collection/components/z-toast-notification-list/index.stories.js.map +1 -1
- package/dist/collection/components/z-toggle-button/index.js.map +1 -1
- package/dist/collection/components/z-toggle-button/index.stories.js.map +1 -1
- package/dist/collection/components/z-toggle-switch/index.js.map +1 -1
- package/dist/collection/components/z-toggle-switch/index.stories.js.map +1 -1
- package/dist/collection/components/z-tooltip/index.js.map +1 -1
- package/dist/collection/components/z-tooltip/index.stories.js.map +1 -1
- package/dist/collection/components/z-visually-hidden/index.js.map +1 -1
- package/dist/collection/components/z-visually-hidden/index.stories.js.map +1 -1
- package/dist/collection/constants/breakpoints.js.map +1 -1
- package/dist/collection/constants/icons.js.map +1 -1
- package/dist/collection/constants/iconset.js +12 -0
- package/dist/collection/constants/iconset.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js.map +1 -1
- package/dist/collection/snowflakes/myz/z-slideshow/index.js.map +1 -1
- package/dist/collection/utils/storybook-utils.js.map +1 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/iconset.js +12 -0
- package/dist/components/iconset.js.map +1 -1
- package/dist/components/index15.js +4 -10
- package/dist/components/index15.js.map +1 -1
- package/dist/components/index21.js +13 -4
- package/dist/components/index21.js.map +1 -1
- package/dist/components/z-menu.js +1 -1
- package/dist/components/z-menu.js.map +1 -1
- package/dist/components/z-th.js +1 -1
- package/dist/components/z-th.js.map +1 -1
- package/dist/docs/grid/index.stories.js +54 -0
- package/dist/docs/grid/index.stories.js.map +1 -0
- package/dist/docs/iconset/index.stories.js +32 -0
- package/dist/docs/iconset/index.stories.js.map +1 -0
- package/dist/docs/themes/index.stories.js +90 -0
- package/dist/docs/themes/index.stories.js.map +1 -0
- package/dist/docs/typography/index.stories.js +186 -0
- package/dist/docs/typography/index.stories.js.map +1 -0
- package/dist/esm/{index-fcf764b5.js → index-681cc2b7.js} +2 -2
- package/dist/esm/index-681cc2b7.js.map +1 -0
- package/dist/esm/{index-2b5c2515.js → index-7b64c875.js} +2 -2
- package/dist/esm/{index-2b5c2515.js.map → index-7b64c875.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +24 -3
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-dragdrop-area_2.entry.js +4 -10
- package/dist/esm/z-dragdrop-area_2.entry.js.map +1 -1
- package/dist/esm/z-menu.entry.js +1 -1
- package/dist/esm/z-menu.entry.js.map +1 -1
- package/dist/esm/z-table.entry.js +2 -2
- package/dist/esm/z-th.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +2 -2
- package/dist/types/components/z-modal/index.d.ts +0 -1
- package/dist/types/components/z-offcanvas/index.d.ts +5 -0
- package/dist/types/components/z-offcanvas/index.stories.d.ts +4 -6
- package/dist/types/components.d.ts +2 -2
- package/dist/types/constants/iconset.d.ts +24 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/grid/index.stories.d.ts +9 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/iconset/index.stories.d.ts +11 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/themes/index.stories.d.ts +27 -0
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/typography/index.stories.d.ts +96 -0
- package/dist/web-components-library/{p-6531d14a.entry.js → p-0c489c4b.entry.js} +2 -2
- package/dist/web-components-library/p-11df2c0a.entry.js +2 -0
- package/dist/web-components-library/p-11df2c0a.entry.js.map +1 -0
- package/dist/web-components-library/{p-cce46031.js → p-13366542.js} +2 -2
- package/dist/web-components-library/p-456f984f.js +2 -0
- package/dist/web-components-library/p-456f984f.js.map +1 -0
- package/dist/web-components-library/p-6b791915.entry.js +2 -0
- package/dist/web-components-library/p-8d443cac.entry.js +2 -0
- package/dist/web-components-library/p-b20bfb34.entry.js +2 -0
- package/dist/web-components-library/p-b20bfb34.entry.js.map +1 -0
- package/dist/web-components-library/p-ceb4403d.entry.js +2 -0
- package/dist/web-components-library/p-ceb4403d.entry.js.map +1 -0
- package/dist/web-components-library/web-components-library.css +529 -28
- 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/www/build/{p-6531d14a.entry.js → p-0c489c4b.entry.js} +2 -2
- package/www/build/p-11df2c0a.entry.js +2 -0
- package/www/build/p-11df2c0a.entry.js.map +1 -0
- package/www/build/{p-cce46031.js → p-13366542.js} +2 -2
- package/www/build/p-1fcf4111.js +2 -0
- package/www/build/p-456f984f.js +2 -0
- package/www/build/p-456f984f.js.map +1 -0
- package/www/build/p-6b791915.entry.js +2 -0
- package/www/build/p-8d443cac.entry.js +2 -0
- package/www/build/p-b20bfb34.entry.js +2 -0
- package/www/build/p-b20bfb34.entry.js.map +1 -0
- package/www/build/p-ceb4403d.entry.js +2 -0
- package/www/build/p-ceb4403d.entry.js.map +1 -0
- package/www/build/{p-ae0a33a2.css → p-d9dbe303.css} +529 -28
- package/www/build/web-components-library.css +529 -28
- 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/index-1bcf6013.js.map +0 -1
- package/dist/esm/index-fcf764b5.js.map +0 -1
- package/dist/web-components-library/p-0c813477.entry.js +0 -2
- package/dist/web-components-library/p-0c813477.entry.js.map +0 -1
- package/dist/web-components-library/p-26ac8973.entry.js +0 -2
- package/dist/web-components-library/p-26ac8973.entry.js.map +0 -1
- package/dist/web-components-library/p-47bf778e.js +0 -2
- package/dist/web-components-library/p-47bf778e.js.map +0 -1
- package/dist/web-components-library/p-67896876.entry.js +0 -2
- package/dist/web-components-library/p-822a2097.entry.js +0 -2
- package/dist/web-components-library/p-b72a4b5e.entry.js +0 -2
- package/dist/web-components-library/p-b72a4b5e.entry.js.map +0 -1
- package/www/build/p-0c813477.entry.js +0 -2
- package/www/build/p-0c813477.entry.js.map +0 -1
- package/www/build/p-26ac8973.entry.js +0 -2
- package/www/build/p-26ac8973.entry.js.map +0 -1
- package/www/build/p-47bf778e.js +0 -2
- package/www/build/p-47bf778e.js.map +0 -1
- package/www/build/p-67896876.entry.js +0 -2
- package/www/build/p-822a2097.entry.js +0 -2
- package/www/build/p-88640e60.js +0 -2
- package/www/build/p-b72a4b5e.entry.js +0 -2
- package/www/build/p-b72a4b5e.entry.js.map +0 -1
- /package/dist/web-components-library/{p-6531d14a.entry.js.map → p-0c489c4b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-cce46031.js.map → p-13366542.js.map} +0 -0
- /package/dist/web-components-library/{p-67896876.entry.js.map → p-6b791915.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-822a2097.entry.js.map → p-8d443cac.entry.js.map} +0 -0
- /package/www/build/{p-6531d14a.entry.js.map → p-0c489c4b.entry.js.map} +0 -0
- /package/www/build/{p-cce46031.js.map → p-13366542.js.map} +0 -0
- /package/www/build/{p-67896876.entry.js.map → p-6b791915.entry.js.map} +0 -0
- /package/www/build/{p-822a2097.entry.js.map → p-8d443cac.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/deprecated/z-app-header-deprecated/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAC,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAEjG,MAAM,6BAA6B,GAAG,OAAO,oBAAoB,KAAK,WAAW,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAMH,MAAM,OAAO,oBAAoB;IAyG/B;QAXQ,aAAQ,GACd,6BAA6B;YAC7B,IAAI,oBAAoB,CACtB,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE;gBACV,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC;YACtC,CAAC,EACD;gBACE,SAAS,EAAE,GAAG;aACf,CACF,CAAC;qBA/FI,KAAK;;uBAcH,KAAK;oBASwB,MAAM;0BAMhC,KAAK;4BAMH,KAAK;iCAMA,OAAO;4BAMZ,EAAE;;sBAcA,KAAK;+BAOqC,QAAQ;;QA8BjE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC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AU,CAC7B,CACV;oBAED,4DAAK,KAAK,EAAC,eAAe;wBACxB,6DAAM,IAAI,EAAC,eAAe,IAAE,IAAI,CAAC,KAAK,CAAQ,CAC1C;oBAEL,IAAI,CAAC,sBAAsB,EAAE;oBAC7B,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CACtF,CACF,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, OffCanvasVariant, TransitionDirection} from \"../../../beans\";\n\nconst SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== \"undefined\";\n\n/**\n * @slot title - Slot for the main title\n * @slot subtitle - Slot for the bottom subtitle. It will not appear in stuck header.\n * @slot top-subtitle - Slot for the top subtitle. It will not appear in stuck header.\n * @slot stucked-title - Title for the stuck header. By default it uses the text from the `title` slot.\n * @cssprop --app-header-typography-1-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `24px`.\n * @cssprop --app-header-typography-2-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `28px`.\n * @cssprop --app-header-typography-3-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `32px`.\n * @cssprop --app-header-typography-4-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `36px`.\n * @cssprop --app-header-typography-5-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `42px`.\n * @cssprop --app-header-typography-6-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `48px`.\n * @cssprop --app-header-typography-7-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `54px`.\n * @cssprop --app-header-typography-8-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `60px`.\n * @cssprop --app-header-typography-9-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `68px`.\n * @cssprop --app-header-typography-10-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `76px`.\n * @cssprop --app-header-typography-11-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `84px`.\n * @cssprop --app-header-typography-12-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `92px`.\n * @cssprop --app-header-typography-1-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.33`.\n * @cssprop --app-header-typography-2-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.29`.\n * @cssprop --app-header-typography-3-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.25`.\n * @cssprop --app-header-typography-4-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.24`.\n * @cssprop --app-header-typography-5-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.24`.\n * @cssprop --app-header-typography-6-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.25`.\n * @cssprop --app-header-typography-7-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.2`.\n * @cssprop --app-header-typography-8-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.26`.\n * @cssprop --app-header-typography-9-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.24`.\n * @cssprop --app-header-typography-10-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.26`.\n * @cssprop --app-header-typography-11-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.2`.\n * @cssprop --app-header-typography-12-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.2`.\n * @cssprop --app-header-typography-1-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-0.2 / 1em)`.\n * @cssprop --app-header-typography-2-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-0.4 / 1em)`.\n * @cssprop --app-header-typography-3-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-0.6 / 1em)`.\n * @cssprop --app-header-typography-4-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-0.8 / 1em)`.\n * @cssprop --app-header-typography-5-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1 / 1em)`.\n * @cssprop --app-header-typography-6-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1.2 / 1em)`.\n * @cssprop --app-header-typography-7-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1.4 / 1em)`.\n * @cssprop --app-header-typography-8-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1.6 / 1em)`.\n * @cssprop --app-header-typography-9-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1.8 / 1em)`.\n * @cssprop --app-header-typography-10-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2 / 1em)`.\n * @cssprop --app-header-typography-11-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2.2 / 1em)`.\n * @cssprop --app-header-typography-12-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2.4 / 1em)`.\n * @cssprop --app-header-content-max-width - Use it to set header's content max width. Useful when the project use a fixed width layout. Defaults to `100%`.\n * @cssprop --app-header-height - Defaults to `auto`.\n * @cssprop --app-header-top-offset - Top offset for the stuck header. Useful when there are other fixed elements above the header. Defaults to `48px` (the height of the main topbar).\n * @cssprop --app-header-drawer-trigger-size - The size of the drawer icon. Defaults to `--space-unit * 4`.\n * @cssprop --app-header-bg - Header background color. Defaults to `--color-surface01`.\n * @cssprop --app-header-stucked-bg - Stuck header background color. Defaults to `--color-surface01`.\n * @cssprop --app-header-text-color - Text color. Useful on `hero` variant to set text color based on the colors of the background image. Defaults to `--color-default-text`.\n * @cssprop --app-header-title-font-size - Variable to customize the title's font size.\n * NOTE: Only use one of the exported `--app-header-typography-*-size` as a value.\n * Defaults to `--app-header-typography-3-size`.\n * @cssprop --app-header-title-lineheight - Variable to customize the title's line-height.\n * NOTE: Only use one of the exported `--app-header-typography-*-lineheight` as a value and use the same level as the one of the font size.\n * Defaults to `--app-header-typography-3-lineheight`.\n * @cssprop --app-header-title-letter-spacing - Variable to customize the title's letter-spacing.\n * NOTE: Only use one of the exported `--app-header-typography-*-tracking` as a value and use the same level as the one of the font size.\n * Defaults to `--app-header-typography-3-tracking`.\n * @cssprop --app-header-stucked-text-color - Stuck header text color. Defaults to `--color-default-text`.\n */\n@Component({\n tag: \"z-app-header-deprecated\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZAppHeaderDeprecated {\n @Element() hostElement: HTMLZAppHeaderDeprecatedElement;\n\n /**\n * Stuck mode for the header.\n * You can programmatically set it using an IntersectionObserver.\n */\n @Prop({reflect: true})\n stuck = false;\n\n /**\n * Set the hero image source for the header.\n * You can also use a [slot=\"hero\"] node for advanced customization.\n */\n @Prop()\n hero: string;\n\n /**\n * Should place an overlay over the hero image.\n * Useful for legibility purpose.\n */\n @Prop({reflect: true})\n overlay = false;\n\n /**\n * Control menu bar position in the header.\n * - auto: the menu bar is positioned near the title\n * - stack: the menu bar is positioned below the title\n * - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu\n */\n @Prop({reflect: true})\n flow: \"auto\" | \"stack\" | \"offcanvas\" = \"auto\";\n\n /**\n * The opening state of the drawer.\n */\n @Prop({reflect: true})\n drawerOpen = false;\n\n /**\n * Enable the search bar.\n */\n @Prop({reflect: true})\n enableSearch = false;\n\n /**\n * Placeholder text for the search bar.\n */\n @Prop()\n searchPlaceholder = \"Cerca\";\n\n /**\n * Search string for the search bar.\n */\n @Prop({mutable: true})\n searchString = \"\";\n\n /**\n * Url to the search page.\n * Set this prop and `enableSearch` to show a link-button on mobile and tablet viewports, instead of the normal searchbar.\n * The link will also appear on the sticky header.\n */\n @Prop()\n searchPageUrl: string;\n\n /**\n * The stuck state of the bar.\n */\n @State()\n private _stuck = false;\n\n /**\n * Current viewport.\n * Used to change the aspect of the search button (icon only) on mobile and tablet.\n */\n @State()\n private currentViewport: \"mobile\" | \"tablet\" | \"desktop\" = \"mobile\";\n\n /**\n * Current count of menu items.\n */\n @State()\n menuLength: number;\n\n /**\n * Emitted when the `stuck` state of the header changes\n */\n @Event()\n sticking: EventEmitter;\n\n private container?: HTMLDivElement;\n\n private menuElements?: NodeListOf<HTMLElement>;\n\n private observer?: IntersectionObserver =\n SUPPORT_INTERSECTION_OBSERVER &&\n new IntersectionObserver(\n ([entry]) => {\n this._stuck = !entry.isIntersecting;\n },\n {\n threshold: 0.5,\n }\n );\n\n constructor() {\n this.openDrawer = this.openDrawer.bind(this);\n this.closeDrawer = this.closeDrawer.bind(this);\n this.collectMenuElements = this.collectMenuElements.bind(this);\n }\n\n @Listen(\"resize\", {target: \"window\", passive: true})\n evaluateViewport(): void {\n if (window.innerWidth < 768) {\n this.currentViewport = \"mobile\";\n } else if (window.innerWidth >= 768 && window.innerWidth < 1152) {\n this.currentViewport = \"tablet\";\n } else {\n this.currentViewport = \"desktop\";\n }\n }\n\n @Watch(\"_stuck\")\n onStuck(): void {\n const scrollParent = this.scrollParent;\n if (!scrollParent) {\n return;\n }\n\n this.sticking.emit(this._stuck);\n }\n\n @Watch(\"drawerOpen\")\n setMenuFloatingMode(): void {\n if (this.menuElements.length === 0) {\n return;\n }\n\n const elements = this.menuElements;\n elements.forEach((element) => {\n (element as HTMLZMenuDeprecatedElement).open = false;\n (element as HTMLZMenuDeprecatedElement).floating = !this.drawerOpen;\n (element as HTMLZMenuDeprecatedElement).verticalContext = this.drawerOpen;\n });\n }\n\n private get title(): string {\n const titleElement = this.hostElement.querySelector('[slot=\"title\"]');\n if (titleElement === null) {\n return \"\";\n }\n\n return titleElement.textContent.trim();\n }\n\n private get scrollParent(): Window | Element {\n const parent = this.hostElement.offsetParent;\n if (parent === document.body || parent === document.documentElement) {\n return window;\n }\n\n return parent;\n }\n\n private get canShowMenu(): boolean {\n return this.flow !== \"offcanvas\" && this.currentViewport !== \"mobile\" && !this.drawerOpen;\n }\n\n private get canShowSearchbar(): boolean {\n if (!this.enableSearch) {\n return false;\n }\n\n // Always show the searchbar on desktop, even if a searchPageUrl is set\n if (this.searchPageUrl) {\n return this.currentViewport === \"desktop\";\n }\n\n return true;\n }\n\n /**\n * Whether the header has a hero image, either as a prop or as a slot.\n */\n private get hasHero(): boolean {\n return !!this.hero || this.hostElement.querySelector(\"[slot=hero]\") !== null;\n }\n\n private openDrawer(): void {\n this.drawerOpen = true;\n }\n\n private closeDrawer(): void {\n this.drawerOpen = false;\n }\n\n private collectMenuElements(): void {\n const menuElements = (this.menuElements = this.hostElement.querySelectorAll('[slot=\"menu\"]'));\n this.menuLength = menuElements.length;\n this.setMenuFloatingMode();\n }\n\n private enableStuckObserver(): void {\n if (this.observer) {\n this.observer.observe(this.container);\n }\n }\n\n private disableStuckMode(): void {\n this._stuck = false;\n if (this.observer) {\n this.observer.unobserve(this.container);\n }\n }\n\n @Watch(\"stuck\")\n onStuckMode(): void {\n if (this.stuck) {\n this.enableStuckObserver();\n } else {\n this.disableStuckMode();\n }\n }\n\n private renderSearchLinkButton(): HTMLZButtonElement | null {\n if (!this.enableSearch || !this.searchPageUrl || this.currentViewport === \"desktop\") {\n return null;\n }\n\n return (\n <z-button\n class=\"search-page-button\"\n variant={ButtonVariant.SECONDARY}\n href={this.searchPageUrl}\n icon=\"search\"\n size={ControlSize.X_SMALL}\n ></z-button>\n );\n }\n\n private renderSeachbar(searchButtonIconOnly: boolean): HTMLZSearchbarElement {\n return (\n <z-searchbar\n value={this.searchString}\n placeholder={this.searchPlaceholder}\n showSearchButton={true}\n searchButtonIconOnly={searchButtonIconOnly}\n size={ControlSize.X_SMALL}\n variant={ButtonVariant.SECONDARY}\n preventSubmit={this.searchString.length < 3}\n onSearchTyping={(e) => (this.searchString = e.detail)}\n />\n );\n }\n\n componentDidLoad(): void {\n this.collectMenuElements();\n this.onStuckMode();\n this.evaluateViewport();\n }\n\n render(): HTMLZAppHeaderElement {\n return (\n <Host menu-length={this.menuLength}>\n {this.hasHero && (\n <div class=\"hero-container\">\n <slot name=\"hero\">\n {this.hero && (\n <img\n alt=\"\"\n src={this.hero}\n />\n )}\n </slot>\n </div>\n )}\n\n <div\n class=\"heading-panel\"\n ref={(el) => (this.container = el)}\n >\n <div class=\"heading-container\">\n <div class=\"heading-subtitle\">\n <slot name=\"top-subtitle\"></slot>\n </div>\n <div class=\"heading-title\">\n {this.menuLength > 0 && (\n <button\n class=\"drawer-trigger\"\n aria-label=\"Apri menu\"\n onClick={this.openDrawer}\n >\n <z-icon name=\"burger-menu\"></z-icon>\n </button>\n )}\n\n <slot name=\"title\"></slot>\n\n {this.renderSearchLinkButton()}\n </div>\n\n <div class=\"heading-subtitle\">\n <slot name=\"subtitle\"></slot>\n </div>\n </div>\n\n {(this.canShowMenu || this.canShowSearchbar) && (\n <div class=\"menu-container\">\n {this.canShowMenu && (\n <slot\n name=\"menu\"\n onSlotchange={this.collectMenuElements}\n ></slot>\n )}\n\n {this.canShowSearchbar && this.renderSeachbar(this.currentViewport !== \"desktop\")}\n </div>\n )}\n </div>\n\n <z-offcanvas\n variant={OffCanvasVariant.OVERLAY}\n transitiondirection={TransitionDirection.RIGHT}\n open={this.drawerOpen}\n onCanvasOpenStatusChanged={(ev) => (this.drawerOpen = ev.detail)}\n >\n <button\n class=\"drawer-close\"\n aria-label=\"Chiudi menu\"\n onClick={this.closeDrawer}\n slot=\"canvasContent\"\n aria-hidden={`${!this.drawerOpen}`}\n disabled={!this.drawerOpen}\n >\n <z-icon name=\"close\"></z-icon>\n </button>\n\n <div\n class=\"drawer-content\"\n slot=\"canvasContent\"\n aria-hidden={`${!this.drawerOpen}`}\n >\n <slot\n name=\"menu\"\n onSlotchange={this.collectMenuElements}\n ></slot>\n </div>\n </z-offcanvas>\n\n {this._stuck && (\n <div class=\"heading-stuck\">\n <div class=\"heading-stuck-content\">\n {this.menuLength > 0 && (\n <button\n class=\"drawer-trigger\"\n aria-label=\"Apri menu\"\n onClick={this.openDrawer}\n >\n <z-icon name=\"burger-menu\"></z-icon>\n </button>\n )}\n\n <div class=\"heading-title\">\n <slot name=\"stucked-title\">{this.title}</slot>\n </div>\n\n {this.renderSearchLinkButton()}\n {this.canShowSearchbar && this.currentViewport === \"desktop\" && this.renderSeachbar(false)}\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/deprecated/z-app-header-deprecated/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAC,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAEjG,MAAM,6BAA6B,GAAG,OAAO,oBAAoB,KAAK,WAAW,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAMH,MAAM,OAAO,oBAAoB;IAyG/B;QAXQ,aAAQ,GACd,6BAA6B;YAC7B,IAAI,oBAAoB,CACtB,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE;gBACV,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC;YACtC,CAAC,EACD;gBACE,SAAS,EAAE,GAAG;aACf,CACF,CAAC;qBA/FI,KAAK;;uBAcH,KAAK;oBASwB,MAAM;0BAMhC,KAAK;4BAMH,KAAK;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AC,IAAI,CACtB,+DACE,KAAK,EAAC,gBAAgB,gBACX,WAAW,EACtB,OAAO,EAAE,IAAI,CAAC,UAAU;wBAExB,+DAAQ,IAAI,EAAC,aAAa,GAAU,CAC7B,CACV;oBAED,4DAAK,KAAK,EAAC,eAAe;wBACxB,6DAAM,IAAI,EAAC,eAAe,IAAE,IAAI,CAAC,KAAK,CAAQ,CAC1C;oBAEL,IAAI,CAAC,sBAAsB,EAAE;oBAC7B,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CACtF,CACF,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\nimport {ButtonVariant, ControlSize, OffCanvasVariant, TransitionDirection} from \"../../../beans\";\n\nconst SUPPORT_INTERSECTION_OBSERVER = typeof IntersectionObserver !== \"undefined\";\n\n/**\n * @slot title - Slot for the main title\n * @slot subtitle - Slot for the bottom subtitle. It will not appear in stuck header.\n * @slot top-subtitle - Slot for the top subtitle. It will not appear in stuck header.\n * @slot stucked-title - Title for the stuck header. By default it uses the text from the `title` slot.\n * @cssprop --app-header-typography-1-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `24px`.\n * @cssprop --app-header-typography-2-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `28px`.\n * @cssprop --app-header-typography-3-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `32px`.\n * @cssprop --app-header-typography-4-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `36px`.\n * @cssprop --app-header-typography-5-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `42px`.\n * @cssprop --app-header-typography-6-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `48px`.\n * @cssprop --app-header-typography-7-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `54px`.\n * @cssprop --app-header-typography-8-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `60px`.\n * @cssprop --app-header-typography-9-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `68px`.\n * @cssprop --app-header-typography-10-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `76px`.\n * @cssprop --app-header-typography-11-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `84px`.\n * @cssprop --app-header-typography-12-size - Part of the heading typography's scale. Use it if you have to override the default value. Value: `92px`.\n * @cssprop --app-header-typography-1-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.33`.\n * @cssprop --app-header-typography-2-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.29`.\n * @cssprop --app-header-typography-3-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.25`.\n * @cssprop --app-header-typography-4-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.24`.\n * @cssprop --app-header-typography-5-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.24`.\n * @cssprop --app-header-typography-6-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.25`.\n * @cssprop --app-header-typography-7-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.2`.\n * @cssprop --app-header-typography-8-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.26`.\n * @cssprop --app-header-typography-9-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.24`.\n * @cssprop --app-header-typography-10-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.26`.\n * @cssprop --app-header-typography-11-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.2`.\n * @cssprop --app-header-typography-12-lineheight - Part of the heading typography's scale. Use it if you have to override the default value. Value: `1.2`.\n * @cssprop --app-header-typography-1-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-0.2 / 1em)`.\n * @cssprop --app-header-typography-2-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-0.4 / 1em)`.\n * @cssprop --app-header-typography-3-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-0.6 / 1em)`.\n * @cssprop --app-header-typography-4-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-0.8 / 1em)`.\n * @cssprop --app-header-typography-5-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1 / 1em)`.\n * @cssprop --app-header-typography-6-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1.2 / 1em)`.\n * @cssprop --app-header-typography-7-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1.4 / 1em)`.\n * @cssprop --app-header-typography-8-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1.6 / 1em)`.\n * @cssprop --app-header-typography-9-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-1.8 / 1em)`.\n * @cssprop --app-header-typography-10-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2 / 1em)`.\n * @cssprop --app-header-typography-11-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2.2 / 1em)`.\n * @cssprop --app-header-typography-12-tracking - Part of the heading typography's scale. Use it if you have to override the default value. Value: `calc(-2.4 / 1em)`.\n * @cssprop --app-header-content-max-width - Use it to set header's content max width. Useful when the project use a fixed width layout. Defaults to `100%`.\n * @cssprop --app-header-height - Defaults to `auto`.\n * @cssprop --app-header-top-offset - Top offset for the stuck header. Useful when there are other fixed elements above the header. Defaults to `48px` (the height of the main topbar).\n * @cssprop --app-header-drawer-trigger-size - The size of the drawer icon. Defaults to `--space-unit * 4`.\n * @cssprop --app-header-bg - Header background color. Defaults to `--color-surface01`.\n * @cssprop --app-header-stucked-bg - Stuck header background color. Defaults to `--color-surface01`.\n * @cssprop --app-header-text-color - Text color. Useful on `hero` variant to set text color based on the colors of the background image. Defaults to `--color-default-text`.\n * @cssprop --app-header-title-font-size - Variable to customize the title's font size.\n * NOTE: Only use one of the exported `--app-header-typography-*-size` as a value.\n * Defaults to `--app-header-typography-3-size`.\n * @cssprop --app-header-title-lineheight - Variable to customize the title's line-height.\n * NOTE: Only use one of the exported `--app-header-typography-*-lineheight` as a value and use the same level as the one of the font size.\n * Defaults to `--app-header-typography-3-lineheight`.\n * @cssprop --app-header-title-letter-spacing - Variable to customize the title's letter-spacing.\n * NOTE: Only use one of the exported `--app-header-typography-*-tracking` as a value and use the same level as the one of the font size.\n * Defaults to `--app-header-typography-3-tracking`.\n * @cssprop --app-header-stucked-text-color - Stuck header text color. Defaults to `--color-default-text`.\n */\n@Component({\n tag: \"z-app-header-deprecated\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZAppHeaderDeprecated {\n @Element() hostElement: HTMLZAppHeaderDeprecatedElement;\n\n /**\n * Stuck mode for the header.\n * You can programmatically set it using an IntersectionObserver.\n */\n @Prop({reflect: true})\n stuck = false;\n\n /**\n * Set the hero image source for the header.\n * You can also use a [slot=\"hero\"] node for advanced customization.\n */\n @Prop()\n hero: string;\n\n /**\n * Should place an overlay over the hero image.\n * Useful for legibility purpose.\n */\n @Prop({reflect: true})\n overlay = false;\n\n /**\n * Control menu bar position in the header.\n * - auto: the menu bar is positioned near the title\n * - stack: the menu bar is positioned below the title\n * - offcanvas: the menu bar is not displayed and a burger icon appears to open the offcanvas menu\n */\n @Prop({reflect: true})\n flow: \"auto\" | \"stack\" | \"offcanvas\" = \"auto\";\n\n /**\n * The opening state of the drawer.\n */\n @Prop({reflect: true})\n drawerOpen = false;\n\n /**\n * Enable the search bar.\n */\n @Prop({reflect: true})\n enableSearch = false;\n\n /**\n * Placeholder text for the search bar.\n */\n @Prop()\n searchPlaceholder = \"Cerca\";\n\n /**\n * Search string for the search bar.\n */\n @Prop({mutable: true})\n searchString = \"\";\n\n /**\n * Url to the search page.\n * Set this prop and `enableSearch` to show a link-button on mobile and tablet viewports, instead of the normal searchbar.\n * The link will also appear on the sticky header.\n */\n @Prop()\n searchPageUrl: string;\n\n /**\n * The stuck state of the bar.\n */\n @State()\n private _stuck = false;\n\n /**\n * Current viewport.\n * Used to change the aspect of the search button (icon only) on mobile and tablet.\n */\n @State()\n private currentViewport: \"mobile\" | \"tablet\" | \"desktop\" = \"mobile\";\n\n /**\n * Current count of menu items.\n */\n @State()\n menuLength: number;\n\n /**\n * Emitted when the `stuck` state of the header changes\n */\n @Event()\n sticking: EventEmitter;\n\n private container?: HTMLDivElement;\n\n private menuElements?: NodeListOf<HTMLElement>;\n\n private observer?: IntersectionObserver =\n SUPPORT_INTERSECTION_OBSERVER &&\n new IntersectionObserver(\n ([entry]) => {\n this._stuck = !entry.isIntersecting;\n },\n {\n threshold: 0.5,\n }\n );\n\n constructor() {\n this.openDrawer = this.openDrawer.bind(this);\n this.closeDrawer = this.closeDrawer.bind(this);\n this.collectMenuElements = this.collectMenuElements.bind(this);\n }\n\n @Listen(\"resize\", {target: \"window\", passive: true})\n evaluateViewport(): void {\n if (window.innerWidth < 768) {\n this.currentViewport = \"mobile\";\n } else if (window.innerWidth >= 768 && window.innerWidth < 1152) {\n this.currentViewport = \"tablet\";\n } else {\n this.currentViewport = \"desktop\";\n }\n }\n\n @Watch(\"_stuck\")\n onStuck(): void {\n const scrollParent = this.scrollParent;\n if (!scrollParent) {\n return;\n }\n\n this.sticking.emit(this._stuck);\n }\n\n @Watch(\"drawerOpen\")\n setMenuFloatingMode(): void {\n if (this.menuElements.length === 0) {\n return;\n }\n\n const elements = this.menuElements;\n elements.forEach((element) => {\n (element as HTMLZMenuDeprecatedElement).open = false;\n (element as HTMLZMenuDeprecatedElement).floating = !this.drawerOpen;\n (element as HTMLZMenuDeprecatedElement).verticalContext = this.drawerOpen;\n });\n }\n\n private get title(): string {\n const titleElement = this.hostElement.querySelector('[slot=\"title\"]');\n if (titleElement === null) {\n return \"\";\n }\n\n return titleElement.textContent.trim();\n }\n\n private get scrollParent(): Window | Element {\n const parent = this.hostElement.offsetParent;\n if (parent === document.body || parent === document.documentElement) {\n return window;\n }\n\n return parent;\n }\n\n private get canShowMenu(): boolean {\n return this.flow !== \"offcanvas\" && this.currentViewport !== \"mobile\" && !this.drawerOpen;\n }\n\n private get canShowSearchbar(): boolean {\n if (!this.enableSearch) {\n return false;\n }\n\n // Always show the searchbar on desktop, even if a searchPageUrl is set\n if (this.searchPageUrl) {\n return this.currentViewport === \"desktop\";\n }\n\n return true;\n }\n\n /**\n * Whether the header has a hero image, either as a prop or as a slot.\n */\n private get hasHero(): boolean {\n return !!this.hero || this.hostElement.querySelector(\"[slot=hero]\") !== null;\n }\n\n private openDrawer(): void {\n this.drawerOpen = true;\n }\n\n private closeDrawer(): void {\n this.drawerOpen = false;\n }\n\n private collectMenuElements(): void {\n const menuElements = (this.menuElements = this.hostElement.querySelectorAll('[slot=\"menu\"]'));\n this.menuLength = menuElements.length;\n this.setMenuFloatingMode();\n }\n\n private enableStuckObserver(): void {\n if (this.observer) {\n this.observer.observe(this.container);\n }\n }\n\n private disableStuckMode(): void {\n this._stuck = false;\n if (this.observer) {\n this.observer.unobserve(this.container);\n }\n }\n\n @Watch(\"stuck\")\n onStuckMode(): void {\n if (this.stuck) {\n this.enableStuckObserver();\n } else {\n this.disableStuckMode();\n }\n }\n\n private renderSearchLinkButton(): HTMLZButtonElement | null {\n if (!this.enableSearch || !this.searchPageUrl || this.currentViewport === \"desktop\") {\n return null;\n }\n\n return (\n <z-button\n class=\"search-page-button\"\n variant={ButtonVariant.SECONDARY}\n href={this.searchPageUrl}\n icon=\"search\"\n size={ControlSize.X_SMALL}\n ></z-button>\n );\n }\n\n private renderSeachbar(searchButtonIconOnly: boolean): HTMLZSearchbarElement {\n return (\n <z-searchbar\n value={this.searchString}\n placeholder={this.searchPlaceholder}\n showSearchButton={true}\n searchButtonIconOnly={searchButtonIconOnly}\n size={ControlSize.X_SMALL}\n variant={ButtonVariant.SECONDARY}\n preventSubmit={this.searchString.length < 3}\n onSearchTyping={(e) => (this.searchString = e.detail)}\n />\n );\n }\n\n componentDidLoad(): void {\n this.collectMenuElements();\n this.onStuckMode();\n this.evaluateViewport();\n }\n\n render(): HTMLZAppHeaderElement {\n return (\n <Host menu-length={this.menuLength}>\n {this.hasHero && (\n <div class=\"hero-container\">\n <slot name=\"hero\">\n {this.hero && (\n <img\n alt=\"\"\n src={this.hero}\n />\n )}\n </slot>\n </div>\n )}\n\n <div\n class=\"heading-panel\"\n ref={(el) => (this.container = el)}\n >\n <div class=\"heading-container\">\n <div class=\"heading-subtitle\">\n <slot name=\"top-subtitle\"></slot>\n </div>\n <div class=\"heading-title\">\n {this.menuLength > 0 && (\n <button\n class=\"drawer-trigger\"\n aria-label=\"Apri menu\"\n onClick={this.openDrawer}\n >\n <z-icon name=\"burger-menu\"></z-icon>\n </button>\n )}\n\n <slot name=\"title\"></slot>\n\n {this.renderSearchLinkButton()}\n </div>\n\n <div class=\"heading-subtitle\">\n <slot name=\"subtitle\"></slot>\n </div>\n </div>\n\n {(this.canShowMenu || this.canShowSearchbar) && (\n <div class=\"menu-container\">\n {this.canShowMenu && (\n <slot\n name=\"menu\"\n onSlotchange={this.collectMenuElements}\n ></slot>\n )}\n\n {this.canShowSearchbar && this.renderSeachbar(this.currentViewport !== \"desktop\")}\n </div>\n )}\n </div>\n\n <z-offcanvas\n variant={OffCanvasVariant.OVERLAY}\n transitiondirection={TransitionDirection.RIGHT}\n open={this.drawerOpen}\n onCanvasOpenStatusChanged={(ev) => (this.drawerOpen = ev.detail)}\n >\n <button\n class=\"drawer-close\"\n aria-label=\"Chiudi menu\"\n onClick={this.closeDrawer}\n slot=\"canvasContent\"\n aria-hidden={`${!this.drawerOpen}`}\n disabled={!this.drawerOpen}\n >\n <z-icon name=\"close\"></z-icon>\n </button>\n\n <div\n class=\"drawer-content\"\n slot=\"canvasContent\"\n aria-hidden={`${!this.drawerOpen}`}\n >\n <slot\n name=\"menu\"\n onSlotchange={this.collectMenuElements}\n ></slot>\n </div>\n </z-offcanvas>\n\n {this._stuck && (\n <div class=\"heading-stuck\">\n <div class=\"heading-stuck-content\">\n {this.menuLength > 0 && (\n <button\n class=\"drawer-trigger\"\n aria-label=\"Apri menu\"\n onClick={this.openDrawer}\n >\n <z-icon name=\"burger-menu\"></z-icon>\n </button>\n )}\n\n <div class=\"heading-title\">\n <slot name=\"stucked-title\">{this.title}</slot>\n </div>\n\n {this.renderSearchLinkButton()}\n {this.canShowSearchbar && this.currentViewport === \"desktop\" && this.renderSeachbar(false)}\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../src/components/deprecated/z-app-header-deprecated/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAsB,MAAM,KAAK,CAAC;AAG9C,OAAO,4BAA4B,CAAC;AACpC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,SAAS,CAAC;AACjB,OAAO,qBAAqB,CAAC;AAI7B,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,iCAAiC;IACxC,SAAS,EAAE,yBAAyB;IACpC,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;YACD,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC;SACxC;KACF;IACD,IAAI,EAAE;QACJ,gCAAgC,EAAE,MAAM;QACxC,cAAc,EAAE,KAAK;QACrB,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE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;sBACP,IAAI,CAAC,YAAY;uBAChB,IAAI,CAAC,aAAa;cAC3B,IAAI,CAAC,IAAI;+CACwB,IAAI,CAAC,gCAAgC,CAAC;aACxE,IAAI,CAAC,IAAI;;;;QAId,IAAI,CAAC,IAAI;QACT,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,IAAI,CAAA;;;;aAID;QACL,gBAAgB,EAAE;+BACK;CACd,CAAC;AAElB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,EAAE,cAAc,CAAC;SAC3C;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;aACK,IAAI,CAAC,IAAI;;+CAEyB,IAAI,CAAC,gCAAgC,CAAC;;;;QAI7E,YAAY,EAAE;+BACS;CACd,CAAC;AAElB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,EAAE,cAAc,CAAC;SAC3C;KACF;IACD,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;;;QAIX,KAAK,EAAE;KACV;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;aACK,IAAI,CAAC,IAAI;;;+CAGyB,IAAI,CAAC,gCAAgC,CAAC;;;;QAI7E,YAAY,EAAE;+BACS;CACd,CAAC","sourcesContent":["import {Meta} from \"@storybook/web-components\";\nimport {html, type TemplateResult} from \"lit\";\nimport {ZAppHeaderDeprecated} from \".\";\nimport {CSSVarsArguments} from \"../../../utils/storybook-utils\";\nimport \"../z-menu-deprecated/index\";\nimport \"../z-menu-section-deprecated/index\";\nimport \"./index\";\nimport \"./index.stories.css\";\n\ntype ZAppHeaderDeprecatedStoriesArgs = ZAppHeaderDeprecated & CSSVarsArguments<\"app-header-content-max-width\">;\n\nconst StoryMeta = {\n title: \"Deprecated/ZAppHeaderDeprecated\",\n component: \"z-app-header-deprecated\",\n parameters: {\n layout: \"fullscreen\",\n },\n argTypes: {\n flow: {\n control: {\n type: \"inline-radio\",\n },\n options: [\"auto\", \"stack\", \"offcanvas\"],\n },\n },\n args: {\n \"--app-header-content-max-width\": \"100%\",\n \"enableSearch\": false,\n \"searchPageUrl\": \"\",\n \"flow\": \"auto\",\n },\n} satisfies Meta<ZAppHeaderDeprecatedStoriesArgs>;\n\nexport default StoryMeta;\n\nconst menuTemplate = (): TemplateResult => {\n return html`\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <a href>Menu label</a>\n </z-menu-deprecated>\n `;\n};\n\nconst longMenuTemplate = (): TemplateResult => {\n return html`\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Not so short menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n `;\n};\n\ntype Story = Meta<ZAppHeaderDeprecatedStoriesArgs>;\n\nexport const Title = {\n parameters: {\n controls: {\n exclude: [\"flow\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const Subtitle = {\n parameters: {\n controls: {\n exclude: [\"flow\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const TopSubtitle = {\n parameters: {\n controls: {\n exclude: [\"flow\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h2 slot=\"top-subtitle\">Payoff dell'applicazione</h2>\n <h1 slot=\"title\">Applicazione</h1>\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const Menu = {\n render: (args) =>\n html`<z-app-header-deprecated\n flow=${args.flow}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const LongTitle = {\n render: (args) =>\n html`<z-app-header-deprecated\n flow=${args.flow}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione con nome veramente lungo che fa andare il menu a capo</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const VeryLongMenu = {\n render: (args) =>\n html`<z-app-header-deprecated\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n flow=${args.flow}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${longMenuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const OffcanvasMenu = {\n parameters: {\n controls: {\n exclude: [\"flow\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n flow=\"offcanvas\"\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${longMenuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const Stuck = {\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">Scroll to see <code>stuck</code> prop in action.</div>\n <div style=\"height: 200vh\">${Story()}</div>\n `,\n ],\n parameters: {\n docs: {\n story: {\n inline: false,\n iframeHeight: \"400px\",\n },\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n stuck\n .flow=${args.flow}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}; --app-header-top-offset: 0\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${longMenuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const MaxWidth = {\n args: {\n \"--app-header-content-max-width\": \"1366px\",\n },\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">Scroll to see max width also in stuck header.</div>\n <div style=\"height: 200vh\">${Story()}</div>\n `,\n ],\n parameters: {\n docs: {\n inlineStories: false,\n iframeHeight: \"400px\",\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n stuck\n .flow=${args.flow}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}; --app-header-top-offset: 0;\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const CoverHeroWithSlottedImage = {\n args: {\n overlay: true,\n hero: \"\",\n },\n render: (args) =>\n html`<z-app-header-deprecated\n id=\"hero\"\n .overlay=${args.overlay}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n .hero=${args.hero}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n flow=${args.flow}\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${args.hero\n ? \"\"\n : html`<img\n slot=\"hero\"\n src=\"https://miro.medium.com/max/2560/1*q8Lf442Gq2Wrb2aNr3urVg.jpeg\"\n alt=\"\"\n />`}\n ${longMenuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const Searchbar = {\n parameters: {\n controls: {\n exclude: [\"searchPageUrl\", \"enableSearch\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n flow=${args.flow}\n enable-search\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const SearchPageButton = {\n parameters: {\n controls: {\n exclude: [\"searchPageUrl\", \"enableSearch\"],\n },\n },\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">\n The prop <code>searchPageUrl</code> only affects the component in tablet and mobile viewports.\n </div>\n ${Story()}\n `,\n ],\n render: (args) =>\n html`<z-app-header-deprecated\n flow=${args.flow}\n enable-search\n search-page-url=\"https://www.zanichelli.it\"\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n"]}
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/deprecated/z-app-header-deprecated/index.stories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C;KACF;IACD,UAAU,EAAE;QACV,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;;;QAIX,KAAK,EAAE;KACV;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;aACK,IAAI,CAAC,IAAI;;;+CAGyB,IAAI,CAAC,gCAAgC,CAAC;;;;QAI7E,YAAY,EAAE;+BACS;CACd,CAAC","sourcesContent":["import {Meta} from \"@storybook/web-components\";\nimport {html, type TemplateResult} from \"lit\";\nimport {ZAppHeaderDeprecated} from \".\";\nimport {CSSVarsArguments} from \"../../../utils/storybook-utils\";\nimport \"../z-menu-deprecated/index\";\nimport \"../z-menu-section-deprecated/index\";\nimport \"./index\";\nimport \"./index.stories.css\";\n\ntype ZAppHeaderDeprecatedStoriesArgs = ZAppHeaderDeprecated & CSSVarsArguments<\"app-header-content-max-width\">;\n\nconst StoryMeta = {\n title: \"Deprecated/ZAppHeaderDeprecated\",\n component: \"z-app-header-deprecated\",\n parameters: {\n layout: \"fullscreen\",\n },\n argTypes: {\n flow: {\n control: {\n type: \"inline-radio\",\n },\n options: [\"auto\", \"stack\", \"offcanvas\"],\n },\n },\n args: {\n \"--app-header-content-max-width\": \"100%\",\n \"enableSearch\": false,\n \"searchPageUrl\": \"\",\n \"flow\": \"auto\",\n },\n} satisfies Meta<ZAppHeaderDeprecatedStoriesArgs>;\n\nexport default StoryMeta;\n\nconst menuTemplate = (): TemplateResult => {\n return html`\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <a href>Menu label</a>\n </z-menu-deprecated>\n `;\n};\n\nconst longMenuTemplate = (): TemplateResult => {\n return html`\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Not so short menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n <z-menu-deprecated\n slot=\"menu\"\n floating\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n `;\n};\n\ntype Story = Meta<ZAppHeaderDeprecatedStoriesArgs>;\n\nexport const Title = {\n parameters: {\n controls: {\n exclude: [\"flow\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const Subtitle = {\n parameters: {\n controls: {\n exclude: [\"flow\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const TopSubtitle = {\n parameters: {\n controls: {\n exclude: [\"flow\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h2 slot=\"top-subtitle\">Payoff dell'applicazione</h2>\n <h1 slot=\"title\">Applicazione</h1>\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const Menu = {\n render: (args) =>\n html`<z-app-header-deprecated\n flow=${args.flow}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const LongTitle = {\n render: (args) =>\n html`<z-app-header-deprecated\n flow=${args.flow}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione con nome veramente lungo che fa andare il menu a capo</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const VeryLongMenu = {\n render: (args) =>\n html`<z-app-header-deprecated\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n flow=${args.flow}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${longMenuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const OffcanvasMenu = {\n parameters: {\n controls: {\n exclude: [\"flow\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n flow=\"offcanvas\"\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${longMenuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const Stuck = {\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">Scroll to see <code>stuck</code> prop in action.</div>\n <div style=\"height: 200vh\">${Story()}</div>\n `,\n ],\n parameters: {\n docs: {\n story: {\n inline: false,\n iframeHeight: \"400px\",\n },\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n stuck\n .flow=${args.flow}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}; --app-header-top-offset: 0\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${longMenuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const MaxWidth = {\n args: {\n \"--app-header-content-max-width\": \"1366px\",\n },\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">Scroll to see max width also in stuck header.</div>\n <div style=\"height: 200vh\">${Story()}</div>\n `,\n ],\n parameters: {\n docs: {\n inlineStories: false,\n iframeHeight: \"400px\",\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n stuck\n .flow=${args.flow}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}; --app-header-top-offset: 0;\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const CoverHeroWithSlottedImage = {\n args: {\n overlay: true,\n hero: \"\",\n },\n render: (args) =>\n html`<z-app-header-deprecated\n id=\"hero\"\n .overlay=${args.overlay}\n .enableSearch=${args.enableSearch}\n .searchPageUrl=${args.searchPageUrl}\n .hero=${args.hero}\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n flow=${args.flow}\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${args.hero\n ? \"\"\n : html`<img\n slot=\"hero\"\n src=\"https://miro.medium.com/max/2560/1*q8Lf442Gq2Wrb2aNr3urVg.jpeg\"\n alt=\"\"\n />`}\n ${longMenuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const Searchbar = {\n parameters: {\n controls: {\n exclude: [\"searchPageUrl\", \"enableSearch\"],\n },\n },\n render: (args) =>\n html`<z-app-header-deprecated\n flow=${args.flow}\n enable-search\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n\nexport const SearchPageButton = {\n parameters: {\n controls: {\n exclude: [\"searchPageUrl\", \"enableSearch\"],\n },\n },\n decorators: [\n (Story) => html`\n <div style=\"padding: 16px var(--grid-margin)\">\n The prop <code>searchPageUrl</code> only affects the component in tablet and mobile viewports.\n </div>\n ${Story()}\n `,\n ],\n render: (args) =>\n html`<z-app-header-deprecated\n flow=${args.flow}\n enable-search\n search-page-url=\"https://www.zanichelli.it\"\n style=\"--app-header-content-max-width: ${args[\"--app-header-content-max-width\"]}\"\n >\n <h1 slot=\"title\">Applicazione</h1>\n <h2 slot=\"subtitle\">Payoff dell'applicazione</h2>\n ${menuTemplate()}\n </z-app-header-deprecated>`,\n} satisfies Story;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/deprecated/z-menu-deprecated/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAE3G;;;;;GAKG;AAMH,MAAM,OAAO,eAAe;IA6ClB,MAAM;QACZ,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACtD,CAAC;IAED,iFAAiF;IAEjF,WAAW,CAAC,EAAc;QACxB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CA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,CACF,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\n\n/**\n * @slot - Menu label\n * @slot header - Header to display as the first entry of the open menu.\n * @slot item - Single entry of the section. Can be slotted multiple times to insert items onto the menu. Use `z-menu-section` for submenus.\n * @cssprop --z-menu-label-color - Color of the label's text.\n */\n@Component({\n tag: \"z-menu-deprecated\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZMenuDeprecated {\n @Element() hostElement: HTMLZMenuDeprecatedElement;\n\n /** Flag to set the active status of the menu. */\n @Prop({reflect: true})\n active?: boolean;\n\n /**\n * Flag to set the display mode of the list.\n * If true, the list will be absolutely positioned under the menu label,\n * stacked beneath it otherwise.\n */\n @Prop({reflect: true})\n floating? = false;\n\n /** The opening state of the menu. */\n @Prop({mutable: true, reflect: true})\n open = false;\n\n /**\n * Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas).\n * A small border is placed under it as a separator from other elements.\n */\n @Prop({reflect: true})\n verticalContext = false;\n\n @State()\n hasHeader: boolean;\n\n @State()\n hasContent: boolean;\n\n private content: HTMLElement;\n\n /** Animation frame request id. */\n private raf: number;\n\n /** The menu has been opened. */\n @Event()\n opened: EventEmitter;\n\n /** The menu has been closed. */\n @Event()\n closed: EventEmitter;\n\n private toggle(): void {\n if (!this.hasContent) {\n return;\n }\n\n this.open = !this.open;\n this.open ? this.opened.emit() : this.closed.emit();\n }\n\n /** Close the floating list when a click is performed outside of this Element. */\n @Listen(\"click\", {target: \"document\"})\n handleClick(ev: MouseEvent): void {\n if (!this.floating || !this.open || this.hostElement.contains(ev.target as Element)) {\n return;\n }\n\n this.reflow();\n this.open = false;\n this.closed.emit();\n }\n\n @Watch(\"open\")\n onOpenChanged(): void {\n if (this.open) {\n this.reflow(true);\n } else {\n cancelAnimationFrame(this.raf);\n }\n }\n\n constructor() {\n this.toggle = this.toggle.bind(this);\n this.checkContent = this.checkContent.bind(this);\n this.onLabelSlotChange = this.onLabelSlotChange.bind(this);\n this.onItemsChange = this.onItemsChange.bind(this);\n }\n\n componentWillLoad(): void {\n this.checkContent();\n }\n\n /**\n * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.\n * @param ev Slotchange event\n */\n private onLabelSlotChange(ev: Event): void {\n const labelElement = (ev.target as HTMLSlotElement).assignedElements()[0] as HTMLElement;\n labelElement.dataset.text = labelElement?.textContent;\n }\n\n /**\n * Correctly set position of the floating menu in order to prevent overflow.\n * @param live Should run the method on every refresh frame.\n */\n private reflow(live = false): void {\n if (this.content) {\n const {style} = this.content;\n const {left} = this.hostElement.getBoundingClientRect();\n const widthPx = getComputedStyle(this.content).width;\n const width = widthPx ? parseFloat(widthPx.replace(\"px\", \"\")) : 375;\n const safeScrollbarSpace = 30;\n style.left = `${Math.min(window.innerWidth - left - width - safeScrollbarSpace, 0)}px`;\n }\n if (live) {\n this.raf = requestAnimationFrame(this.reflow.bind(this, live));\n }\n }\n\n /**\n * Check if some content slot is set.\n */\n private checkContent(): void {\n this.hasHeader = !!this.hostElement.querySelectorAll(\"[slot=header]\").length;\n this.hasContent = !!this.hostElement.querySelectorAll(\"[slot=item]\").length || this.hasHeader;\n }\n\n /**\n * Set `menuitem` role to all menu items.\n * Set the item's inner text to the `data-text` attribute (this is for using bold text avoiding layout shifts).\n */\n private onItemsChange(): void {\n this.checkContent();\n const items = this.hostElement.querySelectorAll<HTMLElement>(\"[slot=item]\");\n items.forEach((item) => {\n item.setAttribute(\"role\", \"menuitem\");\n item.dataset.text = item.textContent;\n });\n }\n\n private renderMenuLabel(): HTMLButtonElement | HTMLDivElement {\n if (this.hasContent) {\n return (\n <button\n class=\"menu-label\"\n aria-expanded={this.open ? \"true\" : \"false\"}\n aria-label={this.open ? \"Chiudi menù\" : \"Apri menù\"}\n onClick={this.toggle}\n >\n <div class=\"menu-label-content\">\n <slot onSlotchange={this.onLabelSlotChange}></slot>\n <z-icon name={this.open ? \"chevron-up\" : \"chevron-down\"} />\n </div>\n </button>\n );\n }\n\n return (\n <div class=\"menu-label\">\n <div class=\"menu-label-content\">\n <slot onSlotchange={this.onLabelSlotChange}></slot>\n </div>\n </div>\n );\n }\n\n render(): HTMLZMenuElement {\n return (\n <Host>\n {this.renderMenuLabel()}\n\n {this.hasContent && (\n <div\n class=\"content\"\n ref={(el) => (this.content = el)}\n >\n {this.hasHeader && (\n <header class=\"header\">\n <slot\n name=\"header\"\n onSlotchange={this.checkContent}\n ></slot>\n </header>\n )}\n\n <div\n class=\"items\"\n role=\"menu\"\n >\n <slot\n name=\"item\"\n onSlotchange={this.onItemsChange}\n ></slot>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/deprecated/z-menu-deprecated/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAE3G;;;;;GAKG;AAMH,MAAM,OAAO,eAAe;IA6ClB,MAAM;QACZ,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACtD,CAAC;IAED,iFAAiF;IAEjF,WAAW,CA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AED,4DACE,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,MAAM;oBAEX,6DACE,IAAI,EAAC,MAAM,EACX,YAAY,EAAE,IAAI,CAAC,aAAa,GAC1B,CACJ,CACF,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h} from \"@stencil/core\";\n\n/**\n * @slot - Menu label\n * @slot header - Header to display as the first entry of the open menu.\n * @slot item - Single entry of the section. Can be slotted multiple times to insert items onto the menu. Use `z-menu-section` for submenus.\n * @cssprop --z-menu-label-color - Color of the label's text.\n */\n@Component({\n tag: \"z-menu-deprecated\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZMenuDeprecated {\n @Element() hostElement: HTMLZMenuDeprecatedElement;\n\n /** Flag to set the active status of the menu. */\n @Prop({reflect: true})\n active?: boolean;\n\n /**\n * Flag to set the display mode of the list.\n * If true, the list will be absolutely positioned under the menu label,\n * stacked beneath it otherwise.\n */\n @Prop({reflect: true})\n floating? = false;\n\n /** The opening state of the menu. */\n @Prop({mutable: true, reflect: true})\n open = false;\n\n /**\n * Tells the component that it's placed in a vertical context with other `ZMenu`s (e.g. in the ZAppHeader's offcanvas).\n * A small border is placed under it as a separator from other elements.\n */\n @Prop({reflect: true})\n verticalContext = false;\n\n @State()\n hasHeader: boolean;\n\n @State()\n hasContent: boolean;\n\n private content: HTMLElement;\n\n /** Animation frame request id. */\n private raf: number;\n\n /** The menu has been opened. */\n @Event()\n opened: EventEmitter;\n\n /** The menu has been closed. */\n @Event()\n closed: EventEmitter;\n\n private toggle(): void {\n if (!this.hasContent) {\n return;\n }\n\n this.open = !this.open;\n this.open ? this.opened.emit() : this.closed.emit();\n }\n\n /** Close the floating list when a click is performed outside of this Element. */\n @Listen(\"click\", {target: \"document\"})\n handleClick(ev: MouseEvent): void {\n if (!this.floating || !this.open || this.hostElement.contains(ev.target as Element)) {\n return;\n }\n\n this.reflow();\n this.open = false;\n this.closed.emit();\n }\n\n @Watch(\"open\")\n onOpenChanged(): void {\n if (this.open) {\n this.reflow(true);\n } else {\n cancelAnimationFrame(this.raf);\n }\n }\n\n constructor() {\n this.toggle = this.toggle.bind(this);\n this.checkContent = this.checkContent.bind(this);\n this.onLabelSlotChange = this.onLabelSlotChange.bind(this);\n this.onItemsChange = this.onItemsChange.bind(this);\n }\n\n componentWillLoad(): void {\n this.checkContent();\n }\n\n /**\n * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.\n * @param ev Slotchange event\n */\n private onLabelSlotChange(ev: Event): void {\n const labelElement = (ev.target as HTMLSlotElement).assignedElements()[0] as HTMLElement;\n labelElement.dataset.text = labelElement?.textContent;\n }\n\n /**\n * Correctly set position of the floating menu in order to prevent overflow.\n * @param live Should run the method on every refresh frame.\n */\n private reflow(live = false): void {\n if (this.content) {\n const {style} = this.content;\n const {left} = this.hostElement.getBoundingClientRect();\n const widthPx = getComputedStyle(this.content).width;\n const width = widthPx ? parseFloat(widthPx.replace(\"px\", \"\")) : 375;\n const safeScrollbarSpace = 30;\n style.left = `${Math.min(window.innerWidth - left - width - safeScrollbarSpace, 0)}px`;\n }\n if (live) {\n this.raf = requestAnimationFrame(this.reflow.bind(this, live));\n }\n }\n\n /**\n * Check if some content slot is set.\n */\n private checkContent(): void {\n this.hasHeader = !!this.hostElement.querySelectorAll(\"[slot=header]\").length;\n this.hasContent = !!this.hostElement.querySelectorAll(\"[slot=item]\").length || this.hasHeader;\n }\n\n /**\n * Set `menuitem` role to all menu items.\n * Set the item's inner text to the `data-text` attribute (this is for using bold text avoiding layout shifts).\n */\n private onItemsChange(): void {\n this.checkContent();\n const items = this.hostElement.querySelectorAll<HTMLElement>(\"[slot=item]\");\n items.forEach((item) => {\n item.setAttribute(\"role\", \"menuitem\");\n item.dataset.text = item.textContent;\n });\n }\n\n private renderMenuLabel(): HTMLButtonElement | HTMLDivElement {\n if (this.hasContent) {\n return (\n <button\n class=\"menu-label\"\n aria-expanded={this.open ? \"true\" : \"false\"}\n aria-label={this.open ? \"Chiudi menù\" : \"Apri menù\"}\n onClick={this.toggle}\n >\n <div class=\"menu-label-content\">\n <slot onSlotchange={this.onLabelSlotChange}></slot>\n <z-icon name={this.open ? \"chevron-up\" : \"chevron-down\"} />\n </div>\n </button>\n );\n }\n\n return (\n <div class=\"menu-label\">\n <div class=\"menu-label-content\">\n <slot onSlotchange={this.onLabelSlotChange}></slot>\n </div>\n </div>\n );\n }\n\n render(): HTMLZMenuElement {\n return (\n <Host>\n {this.renderMenuLabel()}\n\n {this.hasContent && (\n <div\n class=\"content\"\n ref={(el) => (this.content = el)}\n >\n {this.hasHeader && (\n <header class=\"header\">\n <slot\n name=\"header\"\n onSlotchange={this.checkContent}\n ></slot>\n </header>\n )}\n\n <div\n class=\"items\"\n role=\"menu\"\n >\n <slot\n name=\"item\"\n onSlotchange={this.onItemsChange}\n ></slot>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/deprecated/z-menu-deprecated/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,oCAAoC,CAAC;AAC5C,OAAO,SAAS,CAAC;AAEjB,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,4BAA4B;IACnC,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE;QACJ,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,KAAK;KACvB;CAC8B,CAAC;AAElC,eAAe,SAAS,CAAC;AAIzB,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;gBAER,IAAI,CAAC,MAAM;kBACT,IAAI,CAAC,QAAQ;yBACN,IAAI,CAAC,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6C1C;CACc,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;gBAER,IAAI,CAAC,MAAM;kBACT,IAAI,CAAC,QAAQ;yBACN,IAAI,CAAC,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqC1C;CACc,CAAC;AAElB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,UAAU,CAAC;SACtB;KACF;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;gBAER,IAAI;yBACK,IAAI,CAAC,eAAe;;;;;;;;GAQ1C;CACc,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {type ZMenuDeprecated} from \".\";\nimport \"../z-menu-section-deprecated/index\";\nimport \"./index\";\n\nconst StoryMeta = {\n title: \"Deprecated/ZMenuDeprecated\",\n component: \"z-menu\",\n args: {\n active: false,\n floating: true,\n verticalContext: false,\n },\n} satisfies Meta<ZMenuDeprecated>;\n\nexport default StoryMeta;\n\ntype Story = StoryObj<ZMenuDeprecated>;\n\nexport const FloatingContentLayout = {\n render: (args) => html`\n <z-menu-deprecated\n .active=${args.active}\n .floating=${args.floating}\n .verticalContext=${args.verticalContext}\n >\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 4</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 4.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 5</a\n >\n </z-menu-deprecated>\n `,\n} satisfies Story;\n\nexport const WithHeader = {\n render: (args) => html`\n <z-menu-deprecated\n .active=${args.active}\n .floating=${args.floating}\n .verticalContext=${args.verticalContext}\n >\n <img\n slot=\"header\"\n src=\"https://i.pinimg.com/originals/b9/fc/7e/b9fc7e6b2dd2ca128bcc3412e68994f0.jpg\"\n />\n <h4 slot=\"header\">Menu header</h4>\n <h3>Menu label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <z-menu-section-deprecated slot=\"item\">\n <h3>Item 3</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 3.2</a\n >\n </z-menu-section-deprecated>\n <a\n href=\"\"\n slot=\"item\"\n >Item 4</a\n >\n </z-menu-deprecated>\n `,\n} satisfies Story;\n\nexport const ActiveWithoutItems = {\n parameters: {\n controls: {\n exclude: [\"floating\"],\n },\n },\n render: (args) => html`\n <z-menu-deprecated\n .active=${true}\n .verticalContext=${args.verticalContext}\n >\n <a\n href=\"https://cataas.com/cat/gif\"\n target=\"_blank\"\n >Click me</a\n >\n </z-menu-deprecated>\n `,\n} satisfies Story;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../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AAY,EAAE,CAAC;IACtB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,IAAI,CAAC,IAAI;YAEf,+DACE,KAAK,EAAC,OAAO,kBACC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC1C,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;gBAE/B,6DAAM,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAS;gBAC7D,IAAI,CAAC,UAAU,IAAI,+DAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,GAAI,CACxE;YACR,IAAI,CAAC,IAAI,IAAI,CACZ,4DAAK,KAAK,EAAC,OAAO;gBAChB,6DACE,IAAI,EAAC,MAAM,EACX,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GACpC,CACJ,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, h} from \"@stencil/core\";\n\n/**\n * A component to create submenus inside the ZMenu.\n * @slot - Label of the menu section.\n * @slot item - Single entry of the section. Set the same slot name to different items to put many of them. Add the `active` attribute to a slotted item to highlight it.\n */\n@Component({\n tag: \"z-menu-section-deprecated\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZMenuSectionDeprecated {\n @Element() hostElement: HTMLZMenuSectionDeprecatedElement;\n\n /** Active state */\n @Prop({reflect: true})\n active?: boolean;\n\n @State()\n open: boolean;\n\n @State()\n hasContent: boolean;\n\n /** The section has been opened. */\n @Event()\n opened: EventEmitter;\n\n /** The section has been closed. */\n @Event()\n closed: EventEmitter;\n\n private toggle(): void {\n if (!this.hasContent) {\n return;\n }\n\n this.open = !this.open;\n this.open ? this.opened.emit() : this.closed.emit();\n }\n\n /** Close the list when a click is performed outside of this Element. */\n @Listen(\"click\", {target: \"document\"})\n handleClick(ev: MouseEvent): void {\n if (!this.open || this.hostElement.contains(ev.target as Node)) {\n return;\n }\n\n this.open = false;\n this.closed.emit();\n }\n\n /**\n * Check if some content slot is set.\n */\n private checkContent(): void {\n this.hasContent = this.hostElement.querySelectorAll('[slot=\"item\"]').length > 0;\n }\n\n /**\n * Sets slotted item text as `data-text` attribute value, to let CSS use it through `attr()`.\n * @param ev Slotchange event\n */\n private onLabelSlotChange(ev: Event): void {\n const labelElement = (ev.target as HTMLSlotElement).assignedElements()[0] as HTMLElement;\n labelElement.dataset.text = labelElement?.innerText || null;\n }\n\n componentWillLoad(): void {\n this.checkContent();\n }\n\n render(): HTMLZMenuSectionElement {\n return (\n <Host\n role=\"menu\"\n open={this.open}\n >\n <button\n class=\"label\"\n aria-pressed={this.open ? \"true\" : \"false\"}\n onClick={this.toggle.bind(this)}\n >\n <slot onSlotchange={this.onLabelSlotChange.bind(this)}></slot>\n {this.hasContent && <z-icon name={this.open ? \"chevron-up\" : \"chevron-down\"} />}\n </button>\n {this.open && (\n <div class=\"items\">\n <slot\n name=\"item\"\n onSlotchange={this.checkContent.bind(this)}\n ></slot>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
package/dist/collection/components/deprecated/z-menu-section-deprecated/index.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/deprecated/z-menu-section-deprecated/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,SAAS,CAAC;AAEjB,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,2BAA2B;IACtC,IAAI,EAAE;QACJ,MAAM,EAAE,KAAK;KACd;CACqC,CAAC;AAEzC,eAAe,SAAS,CAAC;AAIzB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;yCACiB,IAAI,CAAC,MAAM;;;;;;;;;;;;;;;;;;;GAmBjD;CACc,CAAC;AAElB,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;yCACiB,IAAI,CAAC,MAAM;;;GAGjD;CACc,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {type ZMenuSectionDeprecated} from \".\";\nimport \"./index\";\n\nconst StoryMeta = {\n title: \"Deprecated/ZMenuSection\",\n component: \"z-menu-section-deprecated\",\n args: {\n active: false,\n },\n} satisfies Meta<ZMenuSectionDeprecated>;\n\nexport default StoryMeta;\n\ntype Story = StoryObj<ZMenuSectionDeprecated>;\n\nexport const WithItems = {\n render: (args) => html`\n <z-menu-section-deprecated .active=${args.active}>\n <h3>Label</h3>\n <a\n href=\"\"\n slot=\"item\"\n >Item 1</a\n >\n <a\n href=\"\"\n slot=\"item\"\n >Item 2</a\n >\n <a\n href=\"\"\n slot=\"item\"\n active\n >Item 3 - active</a\n >\n </z-menu-section-deprecated>\n `,\n} satisfies Story;\n\nexport const WithoutItems = {\n render: (args) => html`\n <z-menu-section-deprecated .active=${args.active}>\n <h3>Label</h3>\n </z-menu-section-deprecated>\n `,\n} satisfies Story;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-dragdrop-area/index.tsx"],"names":[],"mappings":"AAAA,OAAO,E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;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Event, EventEmitter, Prop, h} from \"@stencil/core\";\n\n@Component({\n tag: \"z-dragdrop-area\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZDragdropArea {\n /** drag & drop button label */\n @Prop()\n dragAndDropLabel: string;\n\n /** Emitted when user drop one or more files */\n @Event()\n fileDropped: EventEmitter;\n\n private fileDroppedHandler(files: FileList): void {\n this.fileDropped.emit(files);\n }\n\n private dragDropContainer: HTMLDivElement;\n\n private renderOnDragOverMessage(): HTMLDivElement {\n return (\n <div class=\"dragover-container\">\n <div class=\"dragover-message\">\n <span class=\"body-2-sb\">{this.dragAndDropLabel}</span>\n </div>\n </div>\n );\n }\n\n render(): HTMLDivElement {\n return (\n <div\n tabIndex={0}\n ref={(val) => (this.dragDropContainer = val)}\n class=\"dragdrop\"\n onDragOver={(e) => {\n e.preventDefault();\n this.dragDropContainer.classList.add(\"dragover\");\n }}\n onDragLeave={() => {\n this.dragDropContainer.classList.remove(\"dragover\");\n }}\n onDrop={(e) => {\n e.preventDefault();\n if (e.dataTransfer.files.length) {\n this.dragDropContainer.classList.remove(\"dragover\");\n this.fileDroppedHandler(e.dataTransfer.files);\n }\n }}\n >\n {this.renderOnDragOverMessage()}\n <slot />\n </div>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-file/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AACpG,OAAO,EAAC,eAAe,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAC,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AU,EAAE,EAC7B,eAAe,EAAC,kBAAkB,EAClC,IAAI,EAAE,SAAS,CAAC,OAAO;gBAEvB,6DACE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAqB,CAAC,EACpD,QAAQ,EAAE,CAAC,CAAC,IAEX,IAAI,CAAC,QAAQ,CACT,CACA,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Prop, State, h} from \"@stencil/core\";\nimport {PopoverPosition, ZChipType} from \"../../../beans\";\nimport {Breakpoints} from \"../../../constants/breakpoints\";\n\n@Component({\n tag: \"z-file\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: true,\n})\nexport class ZFile {\n private icon: HTMLElement;\n\n private ellipsis?: HTMLSpanElement;\n\n private chip?: HTMLZChipElement;\n\n /** File chip id */\n @Prop()\n fileNumber: number;\n\n /** File name */\n @Prop()\n fileName: string;\n\n @State()\n allowPopover = false;\n\n @State()\n popoverVisible = false;\n\n @Element() el: HTMLZFileElement;\n\n /** Emitted when a z-file component is removed from the DOM */\n @Event()\n removeFile: EventEmitter;\n\n private removeFileHandler(): void {\n this.removeFile.emit({fileName: this.fileName});\n this.el.remove();\n }\n\n @Listen(\"mouseover\")\n onMouseOver(): void {\n this.popoverVisible = true;\n }\n\n @Listen(\"mouseleave\")\n onMouseLeave(): void {\n this.popoverVisible = false;\n }\n\n @Listen(\"interactiveIconClick\")\n onInteractiveIconClick(): void {\n this.removeFileHandler();\n }\n\n componentDidLoad(): void {\n if (this.elementHasEllipsis() && window.innerWidth > Breakpoints.TABLET) {\n this.allowPopover = true;\n }\n\n this.icon?.focus?.();\n }\n\n private elementHasEllipsis(): boolean {\n return this.ellipsis.offsetWidth < this.ellipsis.scrollWidth;\n }\n\n render(): HTMLZFileElement {\n return (\n <Host>\n {this.allowPopover && (\n <z-popover\n open={this.popoverVisible}\n position={PopoverPosition.AUTO}\n bindTo={this.chip}\n >\n <span class=\"body-5 tooltip-content\">{this.ellipsis.innerText}</span>\n </z-popover>\n )}\n <z-chip\n ref={(el) => (this.chip = el as HTMLZChipElement)}\n id={`chip-${this.fileNumber}`}\n interactiveIcon=\"multiply-circled\"\n type={ZChipType.DEFAULT}\n >\n <span\n ref={(el) => (this.ellipsis = el as HTMLSpanElement)}\n tabIndex={-1}\n >\n {this.fileName}\n </span>\n </z-chip>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-file/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,SAAS,CAAC;AAEjB,eAAe;IACb,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,QAAQ;CACE,CAAC;AAExB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE;QACJ,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,wBAAwB;KACnC;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;qBACa,IAAI,CAAC,UAAU;mBACjB,IAAI,CAAC,QAAQ;eACjB;CACY,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {type ZFile} from \".\";\nimport \"./index\";\n\nexport default {\n title: \"ZFile\",\n component: \"z-file\",\n} satisfies Meta<ZFile>;\n\nexport const Default = {\n args: {\n fileNumber: 1,\n fileName: \"abcdefghilmnopqrst.jpg\",\n },\n render: (args) =>\n html`<z-file\n file-number=\"${args.fileNumber}\"\n file-name=\"${args.fileName}\"\n ></z-file>`,\n}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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, h} from \"@stencil/core\";\nimport {ButtonVariant, Device, DividerSize, ZFileUploadType} from \"../../../beans\";\nimport {getDevice} from \"../../../utils/utils\";\n\n@Component({\n tag: \"z-file-upload\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZFileUpload {\n /** Prop indicating the file upload type - can be default or dragdrop */\n @Prop({reflect: true})\n type: ZFileUploadType = ZFileUploadType.DEFAULT;\n\n /** Prop indicating the button variant*/\n @Prop()\n buttonVariant?: ButtonVariant;\n\n /** Prop indicating the accepted file type: ex \".pdf, .doc, .jpg\" */\n @Prop()\n acceptedFormat?: string;\n\n /** Max file dimension in Megabyte */\n @Prop()\n fileMaxSize?: number;\n\n /** Title */\n @Prop()\n mainTitle?: string;\n\n /** Description */\n @Prop()\n description?: string;\n\n /** Files added by the user */\n @State()\n files: File[] = [];\n\n /** upoload button label */\n @Prop()\n uploadBtnLabel?: string = \"allega\";\n\n /** drag & drop button label */\n @Prop()\n dragAndDropLabel?: string = \"Rilascia i file in questa area per allegarli.\";\n\n /** allowed file message */\n @Prop()\n allowedFilesMessage?: string;\n\n /** upload clickable message */\n @Prop()\n uploadClickableMessage?: string = \"Carica\";\n\n /** upload message */\n @Prop()\n uploadMessage?: string = \"o trascina dal tuo computer\";\n\n /** error modal title */\n @Prop()\n errorModalTitle?: string = \"Errore di caricamento\";\n\n /** error modal message */\n @Prop()\n errorModalMessage?: string;\n\n /** loaded files label */\n @Prop()\n uploadedFilesLabel?: string = \"File appena caricati\";\n\n /** uploaded files history rendering */\n @Prop()\n hasFileSection?: boolean = true;\n\n /** List of files not allowed to be uploaded */\n @State()\n invalidFiles: Map<string, string[]>;\n\n @Element() el: HTMLZFileUploadElement;\n\n private input: HTMLInputElement;\n\n private button: HTMLZButtonElement;\n\n private errorModal: HTMLZModalElement;\n\n private uploadLink: HTMLSpanElement;\n\n private inputAttributes = {\n type: \"file\",\n id: \"file-elem\",\n multiple: true,\n };\n\n /** Listen removeFile event sent from z-file component */\n @Listen(\"removeFile\")\n removeFileListener(e: CustomEvent): void {\n this.removeFileHandler(e.detail);\n }\n\n /** Listen fileDropped event sent from z-dragdrop-area component */\n @Listen(\"fileDropped\")\n fileDroppedListener(e: CustomEvent): void {\n this.input.files = e.detail;\n this.fileInputHandler();\n }\n\n componentDidUpdate(): void {\n this.handleAccessibility();\n this.invalidFiles.size && this.errorModal.focus();\n }\n\n componentWillLoad(): void {\n this.invalidFiles = new Map<string, string[]>();\n }\n\n /** Emitted when user select one or more files */\n @Event()\n fileInput: EventEmitter;\n\n private fileInputHandler(): void {\n if (this.input.files.length) {\n this.invalidFiles = this.checkFiles(Array.from(this.input.files));\n }\n }\n\n /** get array of uploaded files */\n @Method()\n async getFiles(): Promise<File[]> {\n return this.files;\n }\n\n /** remove file from the array */\n @Method()\n async removeFile(fileName: string): Promise<void> {\n this.removeFileHandler(fileName);\n }\n\n private removeFileHandler(fileName: string): void {\n const files = this.files;\n const file = files.find((file) => file.name === fileName);\n if (file) {\n const index = files.indexOf(file);\n if (index >= 0) {\n files.splice(index, 1);\n this.files = [...files];\n }\n }\n }\n\n private getType(): ZFileUploadType {\n if (getDevice() !== Device.DESKTOP && getDevice() !== Device.DESKTOP_WIDE) {\n return ZFileUploadType.DEFAULT;\n }\n\n return this.type;\n }\n\n private handleAccessibility(): void {\n const lastFile = this.el.querySelector(\"z-file:last-child z-chip button\");\n if (this.files.length > 0 && lastFile) {\n (lastFile as HTMLElement).focus();\n } else {\n this.getType() === ZFileUploadType.DEFAULT\n ? this.button.querySelector(\"button\").focus()\n : this.uploadLink.focus();\n }\n }\n\n private checkFiles(files: File[]): Map<string, string[]> {\n const errors = new Map<string, string[]>();\n const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;\n const formatErrorString = \" ha un formato non supportato\";\n files.forEach((file: File) => {\n const fileSize = file.size / 1024 / 1024;\n const fileFormatOk = this.acceptedFormat\n .split(\",\")\n .some((ext: string) => file.name.toLowerCase().endsWith(ext.trim()));\n const fileSizeOk = fileSize <= this.fileMaxSize;\n if (fileSizeOk && fileFormatOk) {\n if (!this.files.find((f) => f.name === file.name)) {\n this.files.push(file);\n this.fileInput.emit(file);\n this.input.value = \"\";\n }\n\n return;\n }\n errors.set(file.name, []);\n if (!fileSizeOk) {\n errors.get(file.name).push(sizeErrorString);\n }\n if (!fileFormatOk) {\n errors.get(file.name).push(formatErrorString);\n }\n });\n\n return errors;\n }\n\n private renderTitle(): HTMLElement {\n return <span id=\"title\">{this.mainTitle}</span>;\n }\n\n private renderDescription(cssClass): HTMLElement {\n return <span class={cssClass}>{this.description}</span>;\n }\n\n private renderAllowedFileExtensions(): HTMLElement {\n let fileFormatString = \"\";\n let fileWeightString = \"\";\n\n if (this.acceptedFormat) {\n const fileFormat = this.acceptedFormat\n .split(\", \")\n .map((string) => string.substring(1).toUpperCase())\n .join(\", \");\n fileFormatString = ` nei formati ${fileFormat}`;\n }\n\n if (this.fileMaxSize) {\n fileWeightString = ` per un massimo di ${this.fileMaxSize}MB di peso`;\n }\n\n const finalString = `Puoi allegare file${fileFormatString}${fileWeightString}.`;\n\n return (\n <span class=\"body-3\">\n {this.allowedFilesMessage\n ? this.allowedFilesMessage\n : fileFormatString || fileWeightString\n ? finalString\n : null}\n </span>\n );\n }\n\n private renderFileSection(): HTMLElement {\n if (!this.hasFileSection) {\n return;\n }\n\n return (\n <section class={`files-container ${!this.files.length ? \"hidden\" : \"\"}`}>\n <span class=\"heading-4-sb\">{this.uploadedFilesLabel}</span>\n <div class=\"files-wrapper\">\n <slot name=\"files\" />\n </div>\n <z-divider size={DividerSize.MEDIUM} />\n </section>\n );\n }\n\n private renderInput(): HTMLInputElement {\n return (\n <input\n {...this.inputAttributes}\n onChange={() => this.fileInputHandler()}\n accept={this.acceptedFormat}\n ref={(val) => (this.input = val)}\n />\n );\n }\n\n private renderUploadButton(): unknown[] {\n return [\n this.renderInput(),\n <z-button\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n id=\"fileSelect\"\n variant={this.buttonVariant}\n icon=\"upload\"\n ref={(val) => (this.button = val)}\n >\n {this.uploadBtnLabel}\n </z-button>,\n ];\n }\n\n private renderUploadLink(): unknown[] {\n return [\n this.renderInput(),\n <span class=\"body-1 upload-link-text\">\n <span\n tabIndex={0}\n class=\"body-1-sb upload-link\"\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n ref={(val) => (this.uploadLink = val)}\n >\n {this.uploadClickableMessage}\n </span>{\" \"}\n {this.uploadMessage}\n </span>,\n ];\n }\n\n private renderDefaultMode(): unknown[] {\n return [\n this.renderDescription(\"body-3-sb\"),\n this.renderAllowedFileExtensions(),\n this.renderFileSection(),\n this.renderUploadButton(),\n ];\n }\n\n private renderDragDropMode(): unknown[] {\n return [\n this.renderFileSection(),\n <z-dragdrop-area drag-and-drop-label={this.dragAndDropLabel}>\n <div class=\"text-container\">\n {this.renderDescription(\"body-1\")}\n {this.renderUploadLink()}\n {this.renderAllowedFileExtensions()}\n </div>\n </z-dragdrop-area>,\n ];\n }\n\n private formatErrorString(key, value): string {\n const bothErrors = value[0] && value[1] ? \" e \" : \"\";\n\n return (\n <span class=\"error-message\">\n Il file <span class=\"file-name\">{key}</span> {value[1] ?? \"\"}\n {bothErrors}\n {value[0] ?? \"\"}.\n </span>\n );\n }\n\n private handleErrorModalContent(): HTMLDivElement {\n return (\n <div slot=\"modalContent\">\n <div class=\"modal-wrapper\">\n <div class=\"files\">\n {this.errorModalMessage ? (\n <span class=\"body-3\">{this.errorModalMessage}</span>\n ) : (\n Array.from(this.invalidFiles).map(([key, value]) => {\n return <span class=\"body-3\">{this.formatErrorString(key, value)}</span>;\n })\n )}\n </div>\n </div>\n </div>\n );\n }\n\n render(): HTMLZFileUploadElement {\n return (\n <Host>\n <div class={`container ${this.getType()}`}>\n {this.mainTitle && this.renderTitle()}\n {this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()}\n </div>\n {!!this.invalidFiles.size && (\n <z-modal\n modalid={`file-upload-${this.type}-error-modal`}\n tabIndex={0}\n ref={(val) => (this.errorModal = val)}\n modaltitle={this.errorModalTitle}\n onModalClose={() => (this.invalidFiles = new Map<string, string[]>())}\n onModalBackgroundClick={() => (this.invalidFiles = new Map<string, string[]>())}\n >\n {this.handleErrorModalContent()}\n </z-modal>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-file-upload/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAO/C,MAAM,OAAO,WAAW;;QA+Ed,oBAAe,GAAG;YACxB,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,WAAW;YACf,QAAQ,EAAE,IAAI;SACf,CAAC;oBAhFsB,eAAe,CAAC,OAAO;;;;;;qBAwB/B,EAAE;8BAIQ,QAAQ;gCAIN,+CAA+C;;sCAQzC,QAAQ;6BAIjB,6BAA6B;+BAI3B,uBAAuB;;kCAQpB,sBAAsB;8BAIzB,IAAI;;;IAsB/B,yDAAyD;IAEzD,kBAAkB,CAAC,CAAc;QAC/B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,m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C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, h} from \"@stencil/core\";\nimport {ButtonVariant, Device, DividerSize, ZFileUploadType} from \"../../../beans\";\nimport {getDevice} from \"../../../utils/utils\";\n\n@Component({\n tag: \"z-file-upload\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZFileUpload {\n /** Prop indicating the file upload type - can be default or dragdrop */\n @Prop({reflect: true})\n type: ZFileUploadType = ZFileUploadType.DEFAULT;\n\n /** Prop indicating the button variant*/\n @Prop()\n buttonVariant?: ButtonVariant;\n\n /** Prop indicating the accepted file type: ex \".pdf, .doc, .jpg\" */\n @Prop()\n acceptedFormat?: string;\n\n /** Max file dimension in Megabyte */\n @Prop()\n fileMaxSize?: number;\n\n /** Title */\n @Prop()\n mainTitle?: string;\n\n /** Description */\n @Prop()\n description?: string;\n\n /** Files added by the user */\n @State()\n files: File[] = [];\n\n /** upoload button label */\n @Prop()\n uploadBtnLabel?: string = \"allega\";\n\n /** drag & drop button label */\n @Prop()\n dragAndDropLabel?: string = \"Rilascia i file in questa area per allegarli.\";\n\n /** allowed file message */\n @Prop()\n allowedFilesMessage?: string;\n\n /** upload clickable message */\n @Prop()\n uploadClickableMessage?: string = \"Carica\";\n\n /** upload message */\n @Prop()\n uploadMessage?: string = \"o trascina dal tuo computer\";\n\n /** error modal title */\n @Prop()\n errorModalTitle?: string = \"Errore di caricamento\";\n\n /** error modal message */\n @Prop()\n errorModalMessage?: string;\n\n /** loaded files label */\n @Prop()\n uploadedFilesLabel?: string = \"File appena caricati\";\n\n /** uploaded files history rendering */\n @Prop()\n hasFileSection?: boolean = true;\n\n /** List of files not allowed to be uploaded */\n @State()\n invalidFiles: Map<string, string[]>;\n\n @Element() el: HTMLZFileUploadElement;\n\n private input: HTMLInputElement;\n\n private button: HTMLZButtonElement;\n\n private errorModal: HTMLZModalElement;\n\n private uploadLink: HTMLSpanElement;\n\n private inputAttributes = {\n type: \"file\",\n id: \"file-elem\",\n multiple: true,\n };\n\n /** Listen removeFile event sent from z-file component */\n @Listen(\"removeFile\")\n removeFileListener(e: CustomEvent): void {\n this.removeFileHandler(e.detail);\n }\n\n /** Listen fileDropped event sent from z-dragdrop-area component */\n @Listen(\"fileDropped\")\n fileDroppedListener(e: CustomEvent): void {\n this.input.files = e.detail;\n this.fileInputHandler();\n }\n\n componentDidUpdate(): void {\n this.handleAccessibility();\n this.invalidFiles.size && this.errorModal.focus();\n }\n\n componentWillLoad(): void {\n this.invalidFiles = new Map<string, string[]>();\n }\n\n /** Emitted when user select one or more files */\n @Event()\n fileInput: EventEmitter;\n\n private fileInputHandler(): void {\n if (this.input.files.length) {\n this.invalidFiles = this.checkFiles(Array.from(this.input.files));\n }\n }\n\n /** get array of uploaded files */\n @Method()\n async getFiles(): Promise<File[]> {\n return this.files;\n }\n\n /** remove file from the array */\n @Method()\n async removeFile(fileName: string): Promise<void> {\n this.removeFileHandler(fileName);\n }\n\n private removeFileHandler(fileName: string): void {\n const files = this.files;\n const file = files.find((file) => file.name === fileName);\n if (file) {\n const index = files.indexOf(file);\n if (index >= 0) {\n files.splice(index, 1);\n this.files = [...files];\n }\n }\n }\n\n private getType(): ZFileUploadType {\n if (getDevice() !== Device.DESKTOP && getDevice() !== Device.DESKTOP_WIDE) {\n return ZFileUploadType.DEFAULT;\n }\n\n return this.type;\n }\n\n private handleAccessibility(): void {\n const lastFile = this.el.querySelector(\"z-file:last-child z-chip button\");\n if (this.files.length > 0 && lastFile) {\n (lastFile as HTMLElement).focus();\n } else {\n this.getType() === ZFileUploadType.DEFAULT\n ? this.button.querySelector(\"button\").focus()\n : this.uploadLink.focus();\n }\n }\n\n private checkFiles(files: File[]): Map<string, string[]> {\n const errors = new Map<string, string[]>();\n const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;\n const formatErrorString = \" ha un formato non supportato\";\n files.forEach((file: File) => {\n const fileSize = file.size / 1024 / 1024;\n const fileFormatOk = this.acceptedFormat\n .split(\",\")\n .some((ext: string) => file.name.toLowerCase().endsWith(ext.trim()));\n const fileSizeOk = fileSize <= this.fileMaxSize;\n if (fileSizeOk && fileFormatOk) {\n if (!this.files.find((f) => f.name === file.name)) {\n this.files.push(file);\n this.fileInput.emit(file);\n this.input.value = \"\";\n }\n\n return;\n }\n errors.set(file.name, []);\n if (!fileSizeOk) {\n errors.get(file.name).push(sizeErrorString);\n }\n if (!fileFormatOk) {\n errors.get(file.name).push(formatErrorString);\n }\n });\n\n return errors;\n }\n\n private renderTitle(): HTMLElement {\n return <span id=\"title\">{this.mainTitle}</span>;\n }\n\n private renderDescription(cssClass): HTMLElement {\n return <span class={cssClass}>{this.description}</span>;\n }\n\n private renderAllowedFileExtensions(): HTMLElement {\n let fileFormatString = \"\";\n let fileWeightString = \"\";\n\n if (this.acceptedFormat) {\n const fileFormat = this.acceptedFormat\n .split(\", \")\n .map((string) => string.substring(1).toUpperCase())\n .join(\", \");\n fileFormatString = ` nei formati ${fileFormat}`;\n }\n\n if (this.fileMaxSize) {\n fileWeightString = ` per un massimo di ${this.fileMaxSize}MB di peso`;\n }\n\n const finalString = `Puoi allegare file${fileFormatString}${fileWeightString}.`;\n\n return (\n <span class=\"body-3\">\n {this.allowedFilesMessage\n ? this.allowedFilesMessage\n : fileFormatString || fileWeightString\n ? finalString\n : null}\n </span>\n );\n }\n\n private renderFileSection(): HTMLElement {\n if (!this.hasFileSection) {\n return;\n }\n\n return (\n <section class={`files-container ${!this.files.length ? \"hidden\" : \"\"}`}>\n <span class=\"heading-4-sb\">{this.uploadedFilesLabel}</span>\n <div class=\"files-wrapper\">\n <slot name=\"files\" />\n </div>\n <z-divider size={DividerSize.MEDIUM} />\n </section>\n );\n }\n\n private renderInput(): HTMLInputElement {\n return (\n <input\n {...this.inputAttributes}\n onChange={() => this.fileInputHandler()}\n accept={this.acceptedFormat}\n ref={(val) => (this.input = val)}\n />\n );\n }\n\n private renderUploadButton(): unknown[] {\n return [\n this.renderInput(),\n <z-button\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n id=\"fileSelect\"\n variant={this.buttonVariant}\n icon=\"upload\"\n ref={(val) => (this.button = val)}\n >\n {this.uploadBtnLabel}\n </z-button>,\n ];\n }\n\n private renderUploadLink(): unknown[] {\n return [\n this.renderInput(),\n <span class=\"body-1 upload-link-text\">\n <span\n tabIndex={0}\n class=\"body-1-sb upload-link\"\n onClick={() => this.input.click()}\n onKeyPress={(e) => {\n if (e.code == \"Space\" || e.code == \"Enter\") {\n e.preventDefault();\n this.input.click();\n }\n }}\n ref={(val) => (this.uploadLink = val)}\n >\n {this.uploadClickableMessage}\n </span>{\" \"}\n {this.uploadMessage}\n </span>,\n ];\n }\n\n private renderDefaultMode(): unknown[] {\n return [\n this.renderDescription(\"body-3-sb\"),\n this.renderAllowedFileExtensions(),\n this.renderFileSection(),\n this.renderUploadButton(),\n ];\n }\n\n private renderDragDropMode(): unknown[] {\n return [\n this.renderFileSection(),\n <z-dragdrop-area drag-and-drop-label={this.dragAndDropLabel}>\n <div class=\"text-container\">\n {this.renderDescription(\"body-1\")}\n {this.renderUploadLink()}\n {this.renderAllowedFileExtensions()}\n </div>\n </z-dragdrop-area>,\n ];\n }\n\n private formatErrorString(key, value): string {\n const bothErrors = value[0] && value[1] ? \" e \" : \"\";\n\n return (\n <span class=\"error-message\">\n Il file <span class=\"file-name\">{key}</span> {value[1] ?? \"\"}\n {bothErrors}\n {value[0] ?? \"\"}.\n </span>\n );\n }\n\n private handleErrorModalContent(): HTMLDivElement {\n return (\n <div slot=\"modalContent\">\n <div class=\"modal-wrapper\">\n <div class=\"files\">\n {this.errorModalMessage ? (\n <span class=\"body-3\">{this.errorModalMessage}</span>\n ) : (\n Array.from(this.invalidFiles).map(([key, value]) => {\n return <span class=\"body-3\">{this.formatErrorString(key, value)}</span>;\n })\n )}\n </div>\n </div>\n </div>\n );\n }\n\n render(): HTMLZFileUploadElement {\n return (\n <Host>\n <div class={`container ${this.getType()}`}>\n {this.mainTitle && this.renderTitle()}\n {this.getType() == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()}\n </div>\n {!!this.invalidFiles.size && (\n <z-modal\n modalid={`file-upload-${this.type}-error-modal`}\n tabIndex={0}\n ref={(val) => (this.errorModal = val)}\n modaltitle={this.errorModalTitle}\n onModalClose={() => (this.invalidFiles = new Map<string, string[]>())}\n onModalBackgroundClick={() => (this.invalidFiles = new Map<string, string[]>())}\n >\n {this.handleErrorModalContent()}\n </z-modal>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.stories.js","sourceRoot":"","sources":["../../../../../src/components/file-upload/z-file-upload/index.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,aAAa,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC9D,OAAO,SAAS,CAAC;AAEjB,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE;QACR,IAAI,EAA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,eAAe,GAAG;IAC7B,IAAI,EAAE;QACJ,SAAS,EAAE,eAAe;QAC1B,WAAW,EAAE,uDAAuD;QACpE,cAAc,EAAE,QAAQ;QACxB,gBAAgB,EAAE,qBAAqB;QACvC,mBAAmB,EAAE,mFAAmF;QACxG,sBAAsB,EAAE,MAAM;QAC9B,aAAa,EAAE,4BAA4B;QAC3C,eAAe,EAAE,eAAe;QAChC,iBAAiB,EAAE,mDAAmD;QACtE,kBAAkB,EAAE,gBAAgB;KACrC;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;;;;;eAMO,eAAe,CAAC,QAAQ;0BACb,IAAI,CAAC,cAAc;uBACtB,IAAI,CAAC,WAAW;uBAChB,IAAI,CAAC,WAAW;0BACb,IAAI,CAAC,cAAc;qBACxB,IAAI,CAAC,SAAS;4BACP,IAAI,CAAC,gBAAgB;+BAClB,IAAI,CAAC,mBAAmB;kCACrB,IAAI,CAAC,sBAAsB;yBACpC,IAAI,CAAC,aAAa;2BAChB,IAAI,CAAC,eAAe;6BAClB,IAAI,CAAC,iBAAiB;8BACrB,IAAI,CAAC,kBAAkB;0BAC3B,IAAI,CAAC,cAAc;;;;;;;;;;;;;gBAa7B;CACC,CAAC","sourcesContent":["import {Meta, StoryObj} from \"@storybook/web-components\";\nimport {html} from \"lit\";\nimport {type ZFileUpload} from \".\";\nimport {ButtonVariant, ZFileUploadType} from \"../../../beans\";\nimport \"./index\";\n\nconst StoryMeta = {\n title: \"ZFileUpload\",\n component: \"z-file-upload\",\n argTypes: {\n type: {\n options: Object.values(ZFileUploadType),\n control: {\n type: \"inline-radio\",\n },\n },\n buttonVariant: {\n options: Object.values(ButtonVariant),\n control: {\n type: \"inline-radio\",\n },\n },\n },\n args: {\n fileMaxSize: 50,\n acceptedFormat: \".pdf, .doc, .tiff, .png, .jpg\",\n mainTitle: \"Allega un file\",\n description: \"Vuoi allegare un file per chiarire meglio la tua richiesta?\",\n uploadBtnLabel: \"allega\",\n hasFileSection: true,\n },\n} satisfies Meta<ZFileUpload>;\n\nexport default StoryMeta;\n\ntype Story = StoryObj<ZFileUpload>;\n\nexport const Default = {\n args: {\n buttonVariant: ButtonVariant.PRIMARY,\n },\n render: (args) =>\n html`<h4 class=\"heading-4\">\n This story embeds a piece of js script to allow the component to work properly. Please refresh the page before\n using it!\n </h4>\n <z-file-upload\n type=${ZFileUploadType.DEFAULT}\n .hasFileSection=${args.hasFileSection}\n description=\"${args.description}\"\n .buttonVariant=${args.buttonVariant}\n .fileMaxSize=${args.fileMaxSize}\n .acceptedFormat=${args.acceptedFormat}\n .mainTitle=${args.mainTitle}\n .uploadBtnLabel=${args.uploadBtnLabel}\n >\n </z-file-upload>\n <script>\n let uploaderDefault = document.querySelector(\"z-file-upload\");\n let fileNumber = 0;\n document.addEventListener(\"fileInput\", (e) => {\n fileNumber++;\n const item = e.detail;\n const chip = document.createElement(\"Z-FILE\");\n chip.setAttribute(\"slot\", \"files\");\n chip.setAttribute(\"file-number\", fileNumber);\n chip.setAttribute(\"file-name\", item.name);\n uploaderDefault.appendChild(chip);\n });\n </script>`,\n} satisfies Story;\n\nexport const Dragdrop = {\n args: {\n dragAndDropLabel: \"Rilascia i file in questa area per allegarli.\",\n },\n render: (args) =>\n html`<h4 class=\"heading-4\">\n This story embeds a piece of js script to allow the component to work properly. Please refresh the page before\n using it!\n </h4>\n <br />\n <z-file-upload\n type=${ZFileUploadType.DRAGDROP}\n .hasFileSection=${args.hasFileSection}\n description=\"${args.description}\"\n .fileMaxSize=${args.fileMaxSize}\n .acceptedFormat=${args.acceptedFormat}\n .mainTitle=${args.mainTitle}\n .dragAndDropLabel=${args.dragAndDropLabel}\n >\n </z-file-upload>\n <script>\n const uploaderDragdrop = document.querySelector(\"z-file-upload\");\n document.addEventListener(\"fileInput\", (e) => {\n const item = e.detail;\n const chip = document.createElement(\"Z-FILE\");\n chip.setAttribute(\"slot\", \"files\");\n chip.setAttribute(\"filetype\", item.type);\n chip.setAttribute(\"file-name\", item.name);\n uploaderDragdrop.appendChild(chip);\n });\n </script>`,\n} satisfies Story;\n\nexport const DragdropEnglish = {\n args: {\n mainTitle: \"Attach a file\",\n description: \"Do you want to attach a file to clarify your request?\",\n uploadBtnLabel: \"Attach\",\n dragAndDropLabel: \"Drop the image here\",\n allowedFilesMessage: \"You can upload files in the format PDF, DOC, TIFF, PNG, JPG for a maximum of 50MB\",\n uploadClickableMessage: \"Load\",\n uploadMessage: \"or drag from your computer\",\n errorModalTitle: \"Loading error\",\n errorModalMessage: \"The file does not respect the allowed parameters.\",\n uploadedFilesLabel: \"Uploaded files\",\n },\n render: (args) =>\n html`<h4 class=\"heading-4\">\n This story embeds a piece of js script to allow the component to work properly. Please refresh the page before\n using it!\n </h4>\n <br />\n <z-file-upload\n type=${ZFileUploadType.DRAGDROP}\n .hasFileSection=${args.hasFileSection}\n description=\"${args.description}\"\n .fileMaxSize=${args.fileMaxSize}\n .acceptedFormat=${args.acceptedFormat}\n .mainTitle=${args.mainTitle}\n .dragAndDropLabel=${args.dragAndDropLabel}\n .allowedFilesMessage=${args.allowedFilesMessage}\n .uploadClickableMessage=${args.uploadClickableMessage}\n .uploadMessage=${args.uploadMessage}\n .errorModalTitle=${args.errorModalTitle}\n .errorModalMessage=${args.errorModalMessage}\n .uploadedFilesLabel=${args.uploadedFilesLabel}\n .uploadBtnLabel=${args.uploadBtnLabel}\n >\n </z-file-upload>\n <script>\n const uploaderDragdrop = document.querySelector(\"z-file-upload\");\n document.addEventListener(\"fileInput\", (e) => {\n const item = e.detail;\n const chip = document.createElement(\"Z-FILE\");\n chip.setAttribute(\"slot\", \"files\");\n chip.setAttribute(\"filetype\", item.type);\n chip.setAttribute(\"file-name\", item.name);\n uploaderDragdrop.appendChild(chip);\n });\n </script>`,\n} satisfies Story;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,mBAAmB;AACnB,EAAE;AACF,oEAAoE;AACpE,iDAAiD;AACjD,EAAE;AACF,gBAAgB;AAChB,EAAE","sourcesContent":["//\n// Temp workaround:\n//\n// Empty file to prevent errors when importing beans in stencil apps\n// Stencil apps with React bindings will not work\n//\n// Must be fixed\n//\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/list/z-list/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAOlD,MAAM,OAAO,KAAK;;oBAOE,QAAQ,CAAC,MAAM;wBAMX,QAAQ,CAAC,IAAI;oBAM5B,MAAM;;IAEL,mBAAmB;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrD,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,uBAAuB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,8DAAQ,CACH,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Host, Prop, h} from \"@stencil/core\";\nimport {ListSize, ListType} from \"../../../beans\";\n\n@Component({\n tag: \"z-list\",\n styleUrl: \"styles.css\",\n shadow: true,\n})\nexport class ZList {\n @Element() host: HTMLZListElement;\n\n /**\n * [optional] Sets size of inside elements.\n */\n @Prop({reflect: true})\n size?: ListSize = ListSize.MEDIUM;\n\n /**\n * [optional] type of the list marker for each element\n */\n @Prop({reflect: true})\n listType?: ListType = ListType.NONE;\n\n /**\n * Sets role of the element.\n */\n @Prop({reflect: true})\n role = \"list\";\n\n private setChildrenSizeType(): void {\n const children = this.host.children;\n for (let i = 0; i < children.length; i++) {\n children[i].setAttribute(\"size\", this.size);\n children[i].setAttribute(\"list-type\", this.listType);\n children[i].setAttribute(\"list-element-position\", (i + 1).toString());\n }\n }\n\n componentDidLoad(): void {\n this.setChildrenSizeType();\n }\n\n render(): HTMLZListElement {\n return (\n <Host>\n <slot />\n </Host>\n );\n }\n}\n"]}
|