@zanichelli/albe-web-components 17.0.0 → 17.0.2
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 +9 -0
- package/dist/cjs/{index-a42ab7c9.js → index-2a9a328d.js} +2 -2
- package/dist/cjs/{index-a42ab7c9.js.map → index-2a9a328d.js.map} +1 -1
- package/dist/cjs/{index-4b1d6599.js → index-4e2d222e.js} +2 -2
- package/dist/cjs/{index-4b1d6599.js.map → index-4e2d222e.js.map} +1 -1
- package/dist/cjs/{index-816614ee.js → index-7191c0cc.js} +2 -2
- package/dist/cjs/{index-816614ee.js.map → index-7191c0cc.js.map} +1 -1
- package/dist/cjs/{index-3b95f98f.js → index-a6593d82.js} +2 -2
- package/dist/cjs/{index-3b95f98f.js.map → index-a6593d82.js.map} +1 -1
- package/dist/cjs/{index-e2718c94.js → index-aa56c709.js} +4 -4
- package/dist/cjs/{index-e2718c94.js.map → index-aa56c709.js.map} +1 -1
- package/dist/cjs/{index-141d598e.js → index-b2f35532.js} +2 -2
- package/dist/cjs/{index-141d598e.js.map → index-b2f35532.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-accordion.cjs.entry.js +2 -2
- package/dist/cjs/z-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/z-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-anchor-navigation.cjs.entry.js +2 -2
- package/dist/cjs/z-anchor-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/z-app-header-deprecated.cjs.entry.js +1 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js +13 -13
- package/dist/cjs/z-aria-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-avatar.cjs.entry.js +2 -2
- package/dist/cjs/z-book-card-app.cjs.entry.js +1 -1
- package/dist/cjs/z-book-card-deprecated.cjs.entry.js +1 -1
- package/dist/cjs/z-book-card.cjs.entry.js +2 -2
- package/dist/cjs/z-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/z-button-sort.cjs.entry.js +1 -1
- package/dist/cjs/z-chip.cjs.entry.js +2 -2
- package/dist/cjs/z-combobox.cjs.entry.js +1 -1
- package/dist/cjs/z-cover-hero.cjs.entry.js +2 -2
- package/dist/cjs/z-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +16 -20
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +1 -1
- package/dist/cjs/z-file-upload.cjs.entry.js +77 -101
- package/dist/cjs/z-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/z-file.cjs.entry.js +1 -1
- package/dist/cjs/z-ghost-loading.cjs.entry.js +1 -1
- package/dist/cjs/z-info-box.cjs.entry.js +1 -1
- package/dist/cjs/z-info-reveal.cjs.entry.js +1 -1
- package/dist/cjs/z-logo.cjs.entry.js +1 -1
- package/dist/cjs/z-menu-deprecated.cjs.entry.js +2 -2
- package/dist/cjs/z-menu-deprecated.cjs.entry.js.map +1 -1
- package/dist/cjs/z-menu-section-deprecated.cjs.entry.js +2 -2
- package/dist/cjs/z-menu-section-deprecated.cjs.entry.js.map +1 -1
- package/dist/cjs/z-menu-section.cjs.entry.js +2 -2
- package/dist/cjs/z-menu-section.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-myz-card-alert.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-footer.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-icon.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js +2 -2
- package/dist/cjs/z-myz-card-info.cjs.entry.js.map +1 -1
- package/dist/cjs/z-myz-card-list.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-card_4.cjs.entry.js +4 -4
- package/dist/cjs/z-myz-list-item.cjs.entry.js +1 -1
- package/dist/cjs/z-myz-list.cjs.entry.js +1 -1
- package/dist/cjs/z-navigation-tabs.cjs.entry.js +3 -3
- package/dist/cjs/z-navigation-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/z-notification.cjs.entry.js +1 -1
- package/dist/cjs/z-otp.cjs.entry.js +2 -2
- package/dist/cjs/z-panel-elem.cjs.entry.js +2 -2
- package/dist/cjs/z-popover.cjs.entry.js +1 -1
- package/dist/cjs/z-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/z-section-title.cjs.entry.js +1 -1
- package/dist/cjs/z-select.cjs.entry.js +1 -1
- package/dist/cjs/z-skip-to-content.cjs.entry.js +1 -1
- package/dist/cjs/z-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/z-stepper.cjs.entry.js +1 -1
- package/dist/cjs/z-table.cjs.entry.js +7 -7
- package/dist/cjs/z-tbody.cjs.entry.js +1 -1
- package/dist/cjs/z-td.cjs.entry.js +1 -1
- package/dist/cjs/z-tfoot.cjs.entry.js +1 -1
- package/dist/cjs/z-th.cjs.entry.js +1 -1
- package/dist/cjs/z-thead.cjs.entry.js +1 -1
- package/dist/cjs/z-toast-notification-list.cjs.entry.js +1 -1
- package/dist/cjs/z-toast-notification.cjs.entry.js +1 -1
- package/dist/cjs/z-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/z-toggle-switch.cjs.entry.js +3 -3
- package/dist/cjs/z-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/z-tr.cjs.entry.js +3 -3
- package/dist/cjs/z-visually-hidden.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/book-card/z-book-card/index.js +2 -2
- package/dist/collection/components/book-card/z-book-card-app/index.js +1 -1
- package/dist/collection/components/date-picker/z-date-picker/index.js +1 -1
- package/dist/collection/components/date-picker/z-range-picker/index.js +3 -3
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.js +1 -1
- package/dist/collection/components/deprecated/z-book-card-deprecated/index.js +1 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.js +1 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/styles.css +2 -2
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.js +1 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/styles.css +3 -3
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js +17 -16
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js.map +1 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/styles.css +55 -29
- package/dist/collection/components/file-upload/z-file/index.js +1 -1
- package/dist/collection/components/file-upload/z-file-upload/index.js +146 -107
- 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 +11 -13
- package/dist/collection/components/file-upload/z-file-upload/index.stories.js.map +1 -1
- package/dist/collection/components/file-upload/z-file-upload/styles.css +18 -52
- package/dist/collection/components/list/z-list/index.js +1 -1
- package/dist/collection/components/list/z-list-element/index.js +1 -1
- package/dist/collection/components/list/z-list-group/index.js +2 -2
- package/dist/collection/components/table/cells/z-td/index.js +1 -1
- package/dist/collection/components/table/cells/z-th/index.js +1 -1
- package/dist/collection/components/table/z-table/index.js +1 -1
- package/dist/collection/components/table/z-tbody/index.js +1 -1
- package/dist/collection/components/table/z-tfoot/index.js +1 -1
- package/dist/collection/components/table/z-thead/index.js +1 -1
- package/dist/collection/components/table/z-tr/index.js +1 -1
- package/dist/collection/components/z-accordion/index.js +1 -1
- package/dist/collection/components/z-accordion/styles.css +6 -1
- package/dist/collection/components/z-anchor-navigation/index.js +1 -1
- package/dist/collection/components/z-anchor-navigation/styles.css +4 -2
- package/dist/collection/components/z-app-header/index.js +1 -1
- package/dist/collection/components/z-aria-alert/index.js +1 -1
- package/dist/collection/components/z-avatar/index.js +2 -2
- package/dist/collection/components/z-breadcrumb/index.js +2 -2
- package/dist/collection/components/z-button-sort/index.js +1 -1
- package/dist/collection/components/z-chip/index.js +2 -2
- package/dist/collection/components/z-combobox/index.js +1 -1
- package/dist/collection/components/z-cover-hero/index.js +2 -2
- package/dist/collection/components/z-divider/index.js +1 -1
- package/dist/collection/components/z-ghost-loading/index.js +1 -1
- package/dist/collection/components/z-icon/index.js +1 -1
- package/dist/collection/components/z-info-box/index.js +1 -1
- package/dist/collection/components/z-info-reveal/index.js +1 -1
- package/dist/collection/components/z-input/index.js +1 -1
- package/dist/collection/components/z-input-message/index.js +1 -1
- package/dist/collection/components/z-logo/index.js +1 -1
- package/dist/collection/components/z-menu/styles.css +3 -3
- package/dist/collection/components/z-menu-section/index.js +1 -1
- package/dist/collection/components/z-menu-section/styles.css +3 -3
- package/dist/collection/components/z-modal/index.js +4 -4
- package/dist/collection/components/z-navigation-tabs/index.js +2 -2
- package/dist/collection/components/z-navigation-tabs/styles.css +2 -2
- package/dist/collection/components/z-notification/index.js +1 -1
- package/dist/collection/components/z-offcanvas/index.js +1 -1
- package/dist/collection/components/z-panel-elem/index.js +2 -2
- package/dist/collection/components/z-popover/index.js +1 -1
- package/dist/collection/components/z-searchbar/index.js +1 -1
- package/dist/collection/components/z-section-title/index.js +1 -1
- package/dist/collection/components/z-select/index.js +1 -1
- package/dist/collection/components/z-skip-to-content/index.js +1 -1
- package/dist/collection/components/z-stepper/index.js +1 -1
- package/dist/collection/components/z-stepper-item/index.js +1 -1
- package/dist/collection/components/z-tag/index.js +2 -2
- package/dist/collection/components/z-toast-notification/index.js +1 -1
- package/dist/collection/components/z-toast-notification-list/index.js +1 -1
- package/dist/collection/components/z-toggle-button/index.js +2 -2
- package/dist/collection/components/z-toggle-switch/index.js +3 -3
- package/dist/collection/components/z-tooltip/index.js +1 -1
- package/dist/collection/components/z-visually-hidden/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/styles.css +1 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +1 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js +1 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js +2 -2
- package/dist/components/index10.js +1 -1
- package/dist/components/index11.js +1 -1
- package/dist/components/index12.js +1 -1
- package/dist/components/index13.js +1 -1
- package/dist/components/index14.js +1 -1
- package/dist/components/index15.js +2 -2
- package/dist/components/index16.js +4 -4
- package/dist/components/index17.js +1 -1
- package/dist/components/index18.js +1 -1
- package/dist/components/index19.js +1 -1
- package/dist/components/index20.js +1 -1
- package/dist/components/index21.js +1 -1
- package/dist/components/index22.js +1 -1
- package/dist/components/index23.js +1 -1
- package/dist/components/index24.js +1 -1
- package/dist/components/index25.js +2 -2
- package/dist/components/index3.js +1 -1
- package/dist/components/index5.js +2 -2
- package/dist/components/index6.js +1 -1
- package/dist/components/index7.js +28 -19
- package/dist/components/index7.js.map +1 -1
- package/dist/components/index8.js +1 -1
- package/dist/components/index9.js +1 -1
- package/dist/components/z-accordion.js +2 -2
- package/dist/components/z-accordion.js.map +1 -1
- package/dist/components/z-anchor-navigation.js +2 -2
- package/dist/components/z-anchor-navigation.js.map +1 -1
- package/dist/components/z-app-header-deprecated.js +1 -1
- package/dist/components/z-app-header.js +1 -1
- package/dist/components/z-aria-alert.js +1 -1
- package/dist/components/z-avatar.js +2 -2
- package/dist/components/z-book-card-app.js +1 -1
- package/dist/components/z-book-card-deprecated.js +1 -1
- package/dist/components/z-book-card.js +2 -2
- package/dist/components/z-breadcrumb.js +2 -2
- package/dist/components/z-button-sort.js +1 -1
- package/dist/components/z-combobox.js +1 -1
- package/dist/components/z-cover-hero.js +2 -2
- package/dist/components/z-date-picker.js +1 -1
- package/dist/components/z-file-upload.js +85 -112
- package/dist/components/z-file-upload.js.map +1 -1
- package/dist/components/z-file.js +1 -1
- package/dist/components/z-info-box.js +1 -1
- package/dist/components/z-logo.js +1 -1
- package/dist/components/z-menu-deprecated.js +2 -2
- package/dist/components/z-menu-deprecated.js.map +1 -1
- package/dist/components/z-menu-section-deprecated.js +2 -2
- package/dist/components/z-menu-section-deprecated.js.map +1 -1
- package/dist/components/z-menu-section.js +2 -2
- package/dist/components/z-menu-section.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-myz-card-alert.js +1 -1
- package/dist/components/z-myz-card-dictionary.js +1 -1
- package/dist/components/z-myz-card-footer-sections.js +1 -1
- package/dist/components/z-myz-card-footer.js +1 -1
- package/dist/components/z-myz-card-icon.js +1 -1
- package/dist/components/z-myz-card-info.js +2 -2
- package/dist/components/z-myz-card-info.js.map +1 -1
- package/dist/components/z-myz-card-list.js +1 -1
- package/dist/components/z-myz-list.js +1 -1
- package/dist/components/z-navigation-tabs.js +3 -3
- package/dist/components/z-navigation-tabs.js.map +1 -1
- package/dist/components/z-notification.js +1 -1
- package/dist/components/z-otp.js +2 -2
- package/dist/components/z-panel-elem.js +2 -2
- package/dist/components/z-range-picker.js +3 -3
- package/dist/components/z-section-title.js +1 -1
- package/dist/components/z-select.js +1 -1
- package/dist/components/z-skip-to-content.js +1 -1
- package/dist/components/z-stepper-item.js +1 -1
- package/dist/components/z-stepper.js +1 -1
- package/dist/components/z-table.js +1 -1
- package/dist/components/z-tbody.js +1 -1
- package/dist/components/z-td.js +1 -1
- package/dist/components/z-tfoot.js +1 -1
- package/dist/components/z-th.js +1 -1
- package/dist/components/z-thead.js +1 -1
- package/dist/components/z-toast-notification-list.js +1 -1
- package/dist/components/z-toast-notification.js +1 -1
- package/dist/components/z-toggle-button.js +2 -2
- package/dist/components/z-toggle-switch.js +3 -3
- package/dist/components/z-tooltip.js +1 -1
- package/dist/components/z-tr.js +1 -1
- package/dist/components/z-visually-hidden.js +1 -1
- package/dist/esm/{index-daf6dc52.js → index-04335eea.js} +2 -2
- package/dist/esm/{index-daf6dc52.js.map → index-04335eea.js.map} +1 -1
- package/dist/esm/{index-bcd128c9.js → index-5dff449e.js} +2 -2
- package/dist/esm/{index-bcd128c9.js.map → index-5dff449e.js.map} +1 -1
- package/dist/esm/{index-bf3d3447.js → index-735d4f23.js} +2 -2
- package/dist/esm/{index-bf3d3447.js.map → index-735d4f23.js.map} +1 -1
- package/dist/esm/{index-03fd6621.js → index-8df19678.js} +4 -4
- package/dist/esm/{index-03fd6621.js.map → index-8df19678.js.map} +1 -1
- package/dist/esm/{index-2e00cecb.js → index-90f624c1.js} +2 -2
- package/dist/esm/{index-2e00cecb.js.map → index-90f624c1.js.map} +1 -1
- package/dist/esm/{index-358dea59.js → index-9adfcd0d.js} +2 -2
- package/dist/esm/{index-358dea59.js.map → index-9adfcd0d.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/web-components-library.js +1 -1
- package/dist/esm/z-accordion.entry.js +2 -2
- package/dist/esm/z-accordion.entry.js.map +1 -1
- package/dist/esm/z-alert.entry.js +1 -1
- package/dist/esm/z-anchor-navigation.entry.js +2 -2
- package/dist/esm/z-anchor-navigation.entry.js.map +1 -1
- package/dist/esm/z-app-header-deprecated.entry.js +1 -1
- package/dist/esm/z-app-header_12.entry.js +13 -13
- package/dist/esm/z-aria-alert.entry.js +1 -1
- package/dist/esm/z-avatar.entry.js +2 -2
- package/dist/esm/z-book-card-app.entry.js +1 -1
- package/dist/esm/z-book-card-deprecated.entry.js +1 -1
- package/dist/esm/z-book-card.entry.js +2 -2
- package/dist/esm/z-breadcrumb.entry.js +2 -2
- package/dist/esm/z-button-sort.entry.js +1 -1
- package/dist/esm/z-chip.entry.js +2 -2
- package/dist/esm/z-combobox.entry.js +1 -1
- package/dist/esm/z-cover-hero.entry.js +2 -2
- package/dist/esm/z-date-picker.entry.js +1 -1
- package/dist/esm/z-dragdrop-area_2.entry.js +17 -21
- package/dist/esm/z-dragdrop-area_2.entry.js.map +1 -1
- package/dist/esm/z-file-upload.entry.js +78 -102
- package/dist/esm/z-file-upload.entry.js.map +1 -1
- package/dist/esm/z-file.entry.js +1 -1
- package/dist/esm/z-ghost-loading.entry.js +1 -1
- package/dist/esm/z-info-box.entry.js +1 -1
- package/dist/esm/z-info-reveal.entry.js +1 -1
- package/dist/esm/z-logo.entry.js +1 -1
- package/dist/esm/z-menu-deprecated.entry.js +2 -2
- package/dist/esm/z-menu-deprecated.entry.js.map +1 -1
- package/dist/esm/z-menu-section-deprecated.entry.js +2 -2
- package/dist/esm/z-menu-section-deprecated.entry.js.map +1 -1
- package/dist/esm/z-menu-section.entry.js +2 -2
- package/dist/esm/z-menu-section.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-myz-card-alert.entry.js +1 -1
- package/dist/esm/z-myz-card-dictionary.entry.js +1 -1
- package/dist/esm/z-myz-card-footer-sections.entry.js +1 -1
- package/dist/esm/z-myz-card-footer.entry.js +1 -1
- package/dist/esm/z-myz-card-icon.entry.js +1 -1
- package/dist/esm/z-myz-card-info.entry.js +2 -2
- package/dist/esm/z-myz-card-info.entry.js.map +1 -1
- package/dist/esm/z-myz-card-list.entry.js +1 -1
- package/dist/esm/z-myz-card_4.entry.js +4 -4
- package/dist/esm/z-myz-list-item.entry.js +1 -1
- package/dist/esm/z-myz-list.entry.js +1 -1
- package/dist/esm/z-navigation-tabs.entry.js +3 -3
- package/dist/esm/z-navigation-tabs.entry.js.map +1 -1
- package/dist/esm/z-notification.entry.js +1 -1
- package/dist/esm/z-otp.entry.js +2 -2
- package/dist/esm/z-panel-elem.entry.js +2 -2
- package/dist/esm/z-popover.entry.js +1 -1
- package/dist/esm/z-range-picker.entry.js +3 -3
- package/dist/esm/z-section-title.entry.js +1 -1
- package/dist/esm/z-select.entry.js +1 -1
- package/dist/esm/z-skip-to-content.entry.js +1 -1
- package/dist/esm/z-stepper-item.entry.js +1 -1
- package/dist/esm/z-stepper.entry.js +1 -1
- package/dist/esm/z-table.entry.js +7 -7
- package/dist/esm/z-tbody.entry.js +1 -1
- package/dist/esm/z-td.entry.js +1 -1
- package/dist/esm/z-tfoot.entry.js +1 -1
- package/dist/esm/z-th.entry.js +1 -1
- package/dist/esm/z-thead.entry.js +1 -1
- package/dist/esm/z-toast-notification-list.entry.js +1 -1
- package/dist/esm/z-toast-notification.entry.js +1 -1
- package/dist/esm/z-toggle-button.entry.js +2 -2
- package/dist/esm/z-toggle-switch.entry.js +3 -3
- package/dist/esm/z-tooltip.entry.js +1 -1
- package/dist/esm/z-tr.entry.js +3 -3
- package/dist/esm/z-visually-hidden.entry.js +1 -1
- package/dist/types/components/file-upload/z-dragdrop-area/index.d.ts +4 -4
- package/dist/types/components/file-upload/z-file-upload/index.d.ts +39 -25
- package/dist/types/components/file-upload/z-file-upload/index.stories.d.ts +1 -0
- package/dist/types/components.d.ts +27 -4
- package/{www/build/p-a707640a.entry.js → dist/web-components-library/p-015621c8.entry.js} +2 -2
- package/dist/web-components-library/p-035807e3.entry.js +2 -0
- package/{www/build/p-cd55204b.js → dist/web-components-library/p-037c59b3.js} +2 -2
- package/dist/web-components-library/{p-479b13ae.entry.js → p-0565f1b2.entry.js} +2 -2
- package/dist/web-components-library/p-08d8f935.entry.js +2 -0
- package/{www/build/p-95795174.entry.js → dist/web-components-library/p-0df6b405.entry.js} +2 -2
- package/dist/web-components-library/p-11216ee8.entry.js +2 -0
- package/{www/build/p-5ccbdfbe.entry.js.map → dist/web-components-library/p-11216ee8.entry.js.map} +1 -1
- package/dist/web-components-library/p-115fab3e.entry.js +2 -0
- package/dist/web-components-library/p-115fab3e.entry.js.map +1 -0
- package/dist/web-components-library/{p-914e20e9.entry.js → p-11629dd3.entry.js} +2 -2
- package/dist/web-components-library/{p-90d54c40.js → p-123739cb.js} +2 -2
- package/{www/build/p-7c6dad4b.js → dist/web-components-library/p-14e61df6.js} +2 -2
- package/dist/web-components-library/{p-2e48ff6b.entry.js → p-18d63f0c.entry.js} +2 -2
- package/{www/build/p-8b627bff.entry.js → dist/web-components-library/p-20b628e7.entry.js} +2 -2
- package/dist/web-components-library/{p-cc87d814.entry.js → p-22d56699.entry.js} +2 -2
- package/dist/web-components-library/p-2798c0b2.entry.js +2 -0
- package/dist/web-components-library/{p-83cd8d7c.entry.js → p-2a0d8ebe.entry.js} +2 -2
- package/dist/web-components-library/p-2aeb2a94.entry.js +2 -0
- package/dist/web-components-library/{p-34d82be5.entry.js → p-2c450113.entry.js} +2 -2
- package/dist/web-components-library/{p-c57bb632.entry.js → p-2dcf53b3.entry.js} +2 -2
- package/dist/web-components-library/p-30170218.entry.js +2 -0
- package/dist/web-components-library/{p-e9149664.entry.js → p-34f4f441.entry.js} +2 -2
- package/dist/web-components-library/{p-73d089fe.entry.js → p-384baa02.entry.js} +2 -2
- package/dist/web-components-library/{p-46ce378d.entry.js → p-395b261e.entry.js} +2 -2
- package/dist/web-components-library/p-3bf02cab.entry.js +2 -0
- package/dist/web-components-library/p-3bf02cab.entry.js.map +1 -0
- package/dist/web-components-library/{p-4a058a26.entry.js → p-42559870.entry.js} +2 -2
- package/dist/web-components-library/{p-92da97fb.entry.js → p-4374d3f3.entry.js} +2 -2
- package/dist/web-components-library/{p-ec4d7f60.js → p-4c462e7f.js} +2 -2
- package/dist/web-components-library/{p-c0588dbe.entry.js → p-4fedcbc2.entry.js} +2 -2
- package/{www/build/p-7db32c12.entry.js → dist/web-components-library/p-50bf57b4.entry.js} +2 -2
- package/{www/build/p-8f47b574.entry.js → dist/web-components-library/p-52be7378.entry.js} +2 -2
- package/{www/build/p-9e183204.entry.js → dist/web-components-library/p-54a70792.entry.js} +2 -2
- package/{www/build/p-c9913f1e.entry.js → dist/web-components-library/p-5f04d9eb.entry.js} +2 -2
- package/dist/web-components-library/p-605f6780.entry.js +2 -0
- package/dist/web-components-library/p-605f6780.entry.js.map +1 -0
- package/dist/web-components-library/{p-7d844bac.entry.js → p-60a9cb8b.entry.js} +2 -2
- package/{www/build/p-ddae9016.entry.js → dist/web-components-library/p-6230c432.entry.js} +2 -2
- package/dist/web-components-library/p-6e1ba2f0.entry.js +2 -0
- package/dist/web-components-library/{p-3ce0d28c.entry.js → p-7095262b.entry.js} +2 -2
- package/dist/web-components-library/{p-af4b759a.entry.js → p-72dae90b.entry.js} +2 -2
- package/dist/web-components-library/p-73d686e0.entry.js +2 -0
- package/dist/web-components-library/p-73d686e0.entry.js.map +1 -0
- package/dist/web-components-library/p-75808b47.entry.js +2 -0
- package/dist/web-components-library/p-75808b47.entry.js.map +1 -0
- package/dist/web-components-library/{p-0d1dbe04.entry.js → p-8c952964.entry.js} +2 -2
- package/dist/web-components-library/{p-18fbbf63.entry.js → p-9187ce36.entry.js} +2 -2
- package/dist/web-components-library/{p-08691c77.entry.js → p-9218da42.entry.js} +2 -2
- package/dist/web-components-library/{p-2cc8c5a5.entry.js → p-972098a5.entry.js} +2 -2
- package/dist/web-components-library/{p-ecaca2df.entry.js → p-9f0a3d88.entry.js} +2 -2
- package/dist/web-components-library/p-a90027c2.entry.js +2 -0
- package/dist/web-components-library/p-a90027c2.entry.js.map +1 -0
- package/dist/web-components-library/p-aa0b3e7a.entry.js +2 -0
- package/dist/web-components-library/p-aa0b3e7a.entry.js.map +1 -0
- package/{www/build/p-65c59027.entry.js → dist/web-components-library/p-aa42f01d.entry.js} +2 -2
- package/dist/web-components-library/p-ad825740.entry.js +2 -0
- package/dist/web-components-library/{p-76d8d404.entry.js → p-b309bd71.entry.js} +2 -2
- package/dist/web-components-library/p-b38be247.entry.js +2 -0
- package/{www/build/p-ac03a6cc.entry.js → dist/web-components-library/p-bbd492d3.entry.js} +2 -2
- package/dist/web-components-library/p-c13ef624.js +2 -0
- package/dist/web-components-library/p-c2af9a71.entry.js +2 -0
- package/dist/web-components-library/p-c2af9a71.entry.js.map +1 -0
- package/dist/web-components-library/p-c7df6a63.entry.js +2 -0
- package/dist/web-components-library/p-c7df6a63.entry.js.map +1 -0
- package/dist/web-components-library/{p-0eab0213.entry.js → p-caccf490.entry.js} +2 -2
- package/dist/web-components-library/p-cb8aec27.entry.js +2 -0
- package/dist/web-components-library/p-cc8186a9.entry.js +2 -0
- package/{www/build/p-d972d6aa.entry.js.map → dist/web-components-library/p-cc8186a9.entry.js.map} +1 -1
- package/dist/web-components-library/p-d65aba93.entry.js +2 -0
- package/dist/web-components-library/{p-386e385c.entry.js.map → p-d65aba93.entry.js.map} +1 -1
- package/dist/web-components-library/p-db0a5f51.entry.js +2 -0
- package/dist/web-components-library/p-db0a5f51.entry.js.map +1 -0
- package/dist/web-components-library/p-deb86b5c.entry.js +2 -0
- package/dist/web-components-library/{p-efe1de34.entry.js → p-ea36d666.entry.js} +2 -2
- package/dist/web-components-library/{p-9078dfd7.entry.js → p-f06bd257.entry.js} +2 -2
- package/dist/web-components-library/{p-2f486acc.entry.js → p-f075ec62.entry.js} +2 -2
- package/dist/web-components-library/{p-27a59513.entry.js → p-f8915e2e.entry.js} +2 -2
- package/dist/web-components-library/{p-068b15fc.entry.js → p-fb06a5d8.entry.js} +2 -2
- package/dist/web-components-library/p-feb84d36.js +2 -0
- 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/{dist/web-components-library/p-a707640a.entry.js → www/build/p-015621c8.entry.js} +2 -2
- package/www/build/p-035807e3.entry.js +2 -0
- package/{dist/web-components-library/p-cd55204b.js → www/build/p-037c59b3.js} +2 -2
- package/www/build/{p-479b13ae.entry.js → p-0565f1b2.entry.js} +2 -2
- package/www/build/p-08d8f935.entry.js +2 -0
- package/{dist/web-components-library/p-95795174.entry.js → www/build/p-0df6b405.entry.js} +2 -2
- package/www/build/p-11216ee8.entry.js +2 -0
- package/{dist/web-components-library/p-5ccbdfbe.entry.js.map → www/build/p-11216ee8.entry.js.map} +1 -1
- package/www/build/p-115fab3e.entry.js +2 -0
- package/www/build/p-115fab3e.entry.js.map +1 -0
- package/www/build/{p-914e20e9.entry.js → p-11629dd3.entry.js} +2 -2
- package/www/build/{p-90d54c40.js → p-123739cb.js} +2 -2
- package/{dist/web-components-library/p-7c6dad4b.js → www/build/p-14e61df6.js} +2 -2
- package/www/build/{p-2e48ff6b.entry.js → p-18d63f0c.entry.js} +2 -2
- package/{dist/web-components-library/p-8b627bff.entry.js → www/build/p-20b628e7.entry.js} +2 -2
- package/www/build/{p-cc87d814.entry.js → p-22d56699.entry.js} +2 -2
- package/www/build/p-2798c0b2.entry.js +2 -0
- package/www/build/{p-83cd8d7c.entry.js → p-2a0d8ebe.entry.js} +2 -2
- package/www/build/p-2aeb2a94.entry.js +2 -0
- package/www/build/{p-34d82be5.entry.js → p-2c450113.entry.js} +2 -2
- package/www/build/{p-c57bb632.entry.js → p-2dcf53b3.entry.js} +2 -2
- package/www/build/p-30170218.entry.js +2 -0
- package/www/build/{p-e9149664.entry.js → p-34f4f441.entry.js} +2 -2
- package/www/build/{p-73d089fe.entry.js → p-384baa02.entry.js} +2 -2
- package/www/build/{p-46ce378d.entry.js → p-395b261e.entry.js} +2 -2
- package/www/build/p-3bf02cab.entry.js +2 -0
- package/www/build/p-3bf02cab.entry.js.map +1 -0
- package/www/build/{p-4a058a26.entry.js → p-42559870.entry.js} +2 -2
- package/www/build/{p-92da97fb.entry.js → p-4374d3f3.entry.js} +2 -2
- package/www/build/p-45f04bb4.js +2 -0
- package/www/build/{p-ec4d7f60.js → p-4c462e7f.js} +2 -2
- package/www/build/{p-c0588dbe.entry.js → p-4fedcbc2.entry.js} +2 -2
- package/{dist/web-components-library/p-7db32c12.entry.js → www/build/p-50bf57b4.entry.js} +2 -2
- package/{dist/web-components-library/p-8f47b574.entry.js → www/build/p-52be7378.entry.js} +2 -2
- package/{dist/web-components-library/p-9e183204.entry.js → www/build/p-54a70792.entry.js} +2 -2
- package/{dist/web-components-library/p-c9913f1e.entry.js → www/build/p-5f04d9eb.entry.js} +2 -2
- package/www/build/p-605f6780.entry.js +2 -0
- package/www/build/p-605f6780.entry.js.map +1 -0
- package/www/build/{p-7d844bac.entry.js → p-60a9cb8b.entry.js} +2 -2
- package/{dist/web-components-library/p-ddae9016.entry.js → www/build/p-6230c432.entry.js} +2 -2
- package/www/build/p-6e1ba2f0.entry.js +2 -0
- package/www/build/{p-3ce0d28c.entry.js → p-7095262b.entry.js} +2 -2
- package/www/build/{p-af4b759a.entry.js → p-72dae90b.entry.js} +2 -2
- package/www/build/p-73d686e0.entry.js +2 -0
- package/www/build/p-73d686e0.entry.js.map +1 -0
- package/www/build/p-75808b47.entry.js +2 -0
- package/www/build/p-75808b47.entry.js.map +1 -0
- package/www/build/{p-0d1dbe04.entry.js → p-8c952964.entry.js} +2 -2
- package/www/build/{p-18fbbf63.entry.js → p-9187ce36.entry.js} +2 -2
- package/www/build/{p-08691c77.entry.js → p-9218da42.entry.js} +2 -2
- package/www/build/{p-2cc8c5a5.entry.js → p-972098a5.entry.js} +2 -2
- package/www/build/{p-ecaca2df.entry.js → p-9f0a3d88.entry.js} +2 -2
- package/www/build/p-a90027c2.entry.js +2 -0
- package/www/build/p-a90027c2.entry.js.map +1 -0
- package/www/build/p-aa0b3e7a.entry.js +2 -0
- package/www/build/p-aa0b3e7a.entry.js.map +1 -0
- package/{dist/web-components-library/p-65c59027.entry.js → www/build/p-aa42f01d.entry.js} +2 -2
- package/www/build/p-ad825740.entry.js +2 -0
- package/www/build/{p-76d8d404.entry.js → p-b309bd71.entry.js} +2 -2
- package/www/build/p-b38be247.entry.js +2 -0
- package/{dist/web-components-library/p-ac03a6cc.entry.js → www/build/p-bbd492d3.entry.js} +2 -2
- package/www/build/p-c13ef624.js +2 -0
- package/www/build/p-c2af9a71.entry.js +2 -0
- package/www/build/p-c2af9a71.entry.js.map +1 -0
- package/www/build/p-c7df6a63.entry.js +2 -0
- package/www/build/p-c7df6a63.entry.js.map +1 -0
- package/www/build/{p-0eab0213.entry.js → p-caccf490.entry.js} +2 -2
- package/www/build/p-cb8aec27.entry.js +2 -0
- package/www/build/p-cc8186a9.entry.js +2 -0
- package/{dist/web-components-library/p-d972d6aa.entry.js.map → www/build/p-cc8186a9.entry.js.map} +1 -1
- package/www/build/p-d65aba93.entry.js +2 -0
- package/www/build/{p-386e385c.entry.js.map → p-d65aba93.entry.js.map} +1 -1
- package/www/build/p-db0a5f51.entry.js +2 -0
- package/www/build/p-db0a5f51.entry.js.map +1 -0
- package/www/build/p-deb86b5c.entry.js +2 -0
- package/www/build/{p-efe1de34.entry.js → p-ea36d666.entry.js} +2 -2
- package/www/build/{p-9078dfd7.entry.js → p-f06bd257.entry.js} +2 -2
- package/www/build/{p-2f486acc.entry.js → p-f075ec62.entry.js} +2 -2
- package/www/build/{p-27a59513.entry.js → p-f8915e2e.entry.js} +2 -2
- package/www/build/{p-068b15fc.entry.js → p-fb06a5d8.entry.js} +2 -2
- package/www/build/p-feb84d36.js +2 -0
- 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/web-components-library/p-2c6519dc.entry.js +0 -2
- package/dist/web-components-library/p-2dbbc58f.entry.js +0 -2
- package/dist/web-components-library/p-2dbbc58f.entry.js.map +0 -1
- package/dist/web-components-library/p-2f3732d9.entry.js +0 -2
- package/dist/web-components-library/p-382e2939.entry.js +0 -2
- package/dist/web-components-library/p-386e385c.entry.js +0 -2
- package/dist/web-components-library/p-3f8725c1.entry.js +0 -2
- package/dist/web-components-library/p-40280990.entry.js +0 -2
- package/dist/web-components-library/p-4629a66a.entry.js +0 -2
- package/dist/web-components-library/p-4629a66a.entry.js.map +0 -1
- package/dist/web-components-library/p-563e86c0.entry.js +0 -2
- package/dist/web-components-library/p-563e86c0.entry.js.map +0 -1
- package/dist/web-components-library/p-5ccbdfbe.entry.js +0 -2
- package/dist/web-components-library/p-612da2d0.entry.js +0 -2
- package/dist/web-components-library/p-612da2d0.entry.js.map +0 -1
- package/dist/web-components-library/p-65f993a4.entry.js +0 -2
- package/dist/web-components-library/p-6f69c2b6.js +0 -2
- package/dist/web-components-library/p-72618fde.entry.js +0 -2
- package/dist/web-components-library/p-72618fde.entry.js.map +0 -1
- package/dist/web-components-library/p-8d79971b.entry.js +0 -2
- package/dist/web-components-library/p-8d79971b.entry.js.map +0 -1
- package/dist/web-components-library/p-93069a90.entry.js +0 -2
- package/dist/web-components-library/p-a7bcb93d.entry.js +0 -2
- package/dist/web-components-library/p-a7bcb93d.entry.js.map +0 -1
- package/dist/web-components-library/p-add2b5e8.entry.js +0 -2
- package/dist/web-components-library/p-b896dcf7.entry.js +0 -2
- package/dist/web-components-library/p-cc6406ab.entry.js +0 -2
- package/dist/web-components-library/p-d34a177a.entry.js +0 -2
- package/dist/web-components-library/p-d34a177a.entry.js.map +0 -1
- package/dist/web-components-library/p-d972d6aa.entry.js +0 -2
- package/dist/web-components-library/p-e4e0d271.entry.js +0 -2
- package/dist/web-components-library/p-e4e0d271.entry.js.map +0 -1
- package/dist/web-components-library/p-f400cf1b.js +0 -2
- package/dist/web-components-library/p-f413c03c.entry.js +0 -2
- package/dist/web-components-library/p-f413c03c.entry.js.map +0 -1
- package/www/build/p-2c6519dc.entry.js +0 -2
- package/www/build/p-2dbbc58f.entry.js +0 -2
- package/www/build/p-2dbbc58f.entry.js.map +0 -1
- package/www/build/p-2f3732d9.entry.js +0 -2
- package/www/build/p-382e2939.entry.js +0 -2
- package/www/build/p-386e385c.entry.js +0 -2
- package/www/build/p-3f8725c1.entry.js +0 -2
- package/www/build/p-40280990.entry.js +0 -2
- package/www/build/p-4629a66a.entry.js +0 -2
- package/www/build/p-4629a66a.entry.js.map +0 -1
- package/www/build/p-563e86c0.entry.js +0 -2
- package/www/build/p-563e86c0.entry.js.map +0 -1
- package/www/build/p-5ccbdfbe.entry.js +0 -2
- package/www/build/p-612da2d0.entry.js +0 -2
- package/www/build/p-612da2d0.entry.js.map +0 -1
- package/www/build/p-65f993a4.entry.js +0 -2
- package/www/build/p-6f69c2b6.js +0 -2
- package/www/build/p-72618fde.entry.js +0 -2
- package/www/build/p-72618fde.entry.js.map +0 -1
- package/www/build/p-8d79971b.entry.js +0 -2
- package/www/build/p-8d79971b.entry.js.map +0 -1
- package/www/build/p-93069a90.entry.js +0 -2
- package/www/build/p-a7bcb93d.entry.js +0 -2
- package/www/build/p-a7bcb93d.entry.js.map +0 -1
- package/www/build/p-add2b5e8.entry.js +0 -2
- package/www/build/p-b896dcf7.entry.js +0 -2
- package/www/build/p-c9e50d51.js +0 -2
- package/www/build/p-cc6406ab.entry.js +0 -2
- package/www/build/p-d34a177a.entry.js +0 -2
- package/www/build/p-d34a177a.entry.js.map +0 -1
- package/www/build/p-d972d6aa.entry.js +0 -2
- package/www/build/p-e4e0d271.entry.js +0 -2
- package/www/build/p-e4e0d271.entry.js.map +0 -1
- package/www/build/p-f400cf1b.js +0 -2
- package/www/build/p-f413c03c.entry.js +0 -2
- package/www/build/p-f413c03c.entry.js.map +0 -1
- /package/dist/web-components-library/{p-a707640a.entry.js.map → p-015621c8.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-93069a90.entry.js.map → p-035807e3.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-cd55204b.js.map → p-037c59b3.js.map} +0 -0
- /package/dist/web-components-library/{p-479b13ae.entry.js.map → p-0565f1b2.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-65f993a4.entry.js.map → p-08d8f935.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-95795174.entry.js.map → p-0df6b405.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-914e20e9.entry.js.map → p-11629dd3.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-90d54c40.js.map → p-123739cb.js.map} +0 -0
- /package/dist/web-components-library/{p-7c6dad4b.js.map → p-14e61df6.js.map} +0 -0
- /package/dist/web-components-library/{p-2e48ff6b.entry.js.map → p-18d63f0c.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-8b627bff.entry.js.map → p-20b628e7.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-cc87d814.entry.js.map → p-22d56699.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-2c6519dc.entry.js.map → p-2798c0b2.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-83cd8d7c.entry.js.map → p-2a0d8ebe.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-2f3732d9.entry.js.map → p-2aeb2a94.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-34d82be5.entry.js.map → p-2c450113.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-c57bb632.entry.js.map → p-2dcf53b3.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-40280990.entry.js.map → p-30170218.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-e9149664.entry.js.map → p-34f4f441.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-73d089fe.entry.js.map → p-384baa02.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-46ce378d.entry.js.map → p-395b261e.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-4a058a26.entry.js.map → p-42559870.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-92da97fb.entry.js.map → p-4374d3f3.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-ec4d7f60.js.map → p-4c462e7f.js.map} +0 -0
- /package/dist/web-components-library/{p-c0588dbe.entry.js.map → p-4fedcbc2.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-7db32c12.entry.js.map → p-50bf57b4.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-8f47b574.entry.js.map → p-52be7378.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-9e183204.entry.js.map → p-54a70792.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-c9913f1e.entry.js.map → p-5f04d9eb.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-7d844bac.entry.js.map → p-60a9cb8b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-ddae9016.entry.js.map → p-6230c432.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-382e2939.entry.js.map → p-6e1ba2f0.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-3ce0d28c.entry.js.map → p-7095262b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-af4b759a.entry.js.map → p-72dae90b.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-0d1dbe04.entry.js.map → p-8c952964.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-18fbbf63.entry.js.map → p-9187ce36.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-08691c77.entry.js.map → p-9218da42.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-2cc8c5a5.entry.js.map → p-972098a5.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-ecaca2df.entry.js.map → p-9f0a3d88.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-65c59027.entry.js.map → p-aa42f01d.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-add2b5e8.entry.js.map → p-ad825740.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-76d8d404.entry.js.map → p-b309bd71.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-b896dcf7.entry.js.map → p-b38be247.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-ac03a6cc.entry.js.map → p-bbd492d3.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-6f69c2b6.js.map → p-c13ef624.js.map} +0 -0
- /package/dist/web-components-library/{p-0eab0213.entry.js.map → p-caccf490.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-3f8725c1.entry.js.map → p-cb8aec27.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-cc6406ab.entry.js.map → p-deb86b5c.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-efe1de34.entry.js.map → p-ea36d666.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-9078dfd7.entry.js.map → p-f06bd257.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-2f486acc.entry.js.map → p-f075ec62.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-27a59513.entry.js.map → p-f8915e2e.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-068b15fc.entry.js.map → p-fb06a5d8.entry.js.map} +0 -0
- /package/dist/web-components-library/{p-f400cf1b.js.map → p-feb84d36.js.map} +0 -0
- /package/www/build/{p-a707640a.entry.js.map → p-015621c8.entry.js.map} +0 -0
- /package/www/build/{p-93069a90.entry.js.map → p-035807e3.entry.js.map} +0 -0
- /package/www/build/{p-cd55204b.js.map → p-037c59b3.js.map} +0 -0
- /package/www/build/{p-479b13ae.entry.js.map → p-0565f1b2.entry.js.map} +0 -0
- /package/www/build/{p-65f993a4.entry.js.map → p-08d8f935.entry.js.map} +0 -0
- /package/www/build/{p-95795174.entry.js.map → p-0df6b405.entry.js.map} +0 -0
- /package/www/build/{p-914e20e9.entry.js.map → p-11629dd3.entry.js.map} +0 -0
- /package/www/build/{p-90d54c40.js.map → p-123739cb.js.map} +0 -0
- /package/www/build/{p-7c6dad4b.js.map → p-14e61df6.js.map} +0 -0
- /package/www/build/{p-2e48ff6b.entry.js.map → p-18d63f0c.entry.js.map} +0 -0
- /package/www/build/{p-8b627bff.entry.js.map → p-20b628e7.entry.js.map} +0 -0
- /package/www/build/{p-cc87d814.entry.js.map → p-22d56699.entry.js.map} +0 -0
- /package/www/build/{p-2c6519dc.entry.js.map → p-2798c0b2.entry.js.map} +0 -0
- /package/www/build/{p-83cd8d7c.entry.js.map → p-2a0d8ebe.entry.js.map} +0 -0
- /package/www/build/{p-2f3732d9.entry.js.map → p-2aeb2a94.entry.js.map} +0 -0
- /package/www/build/{p-34d82be5.entry.js.map → p-2c450113.entry.js.map} +0 -0
- /package/www/build/{p-c57bb632.entry.js.map → p-2dcf53b3.entry.js.map} +0 -0
- /package/www/build/{p-40280990.entry.js.map → p-30170218.entry.js.map} +0 -0
- /package/www/build/{p-e9149664.entry.js.map → p-34f4f441.entry.js.map} +0 -0
- /package/www/build/{p-73d089fe.entry.js.map → p-384baa02.entry.js.map} +0 -0
- /package/www/build/{p-46ce378d.entry.js.map → p-395b261e.entry.js.map} +0 -0
- /package/www/build/{p-4a058a26.entry.js.map → p-42559870.entry.js.map} +0 -0
- /package/www/build/{p-92da97fb.entry.js.map → p-4374d3f3.entry.js.map} +0 -0
- /package/www/build/{p-ec4d7f60.js.map → p-4c462e7f.js.map} +0 -0
- /package/www/build/{p-c0588dbe.entry.js.map → p-4fedcbc2.entry.js.map} +0 -0
- /package/www/build/{p-7db32c12.entry.js.map → p-50bf57b4.entry.js.map} +0 -0
- /package/www/build/{p-8f47b574.entry.js.map → p-52be7378.entry.js.map} +0 -0
- /package/www/build/{p-9e183204.entry.js.map → p-54a70792.entry.js.map} +0 -0
- /package/www/build/{p-c9913f1e.entry.js.map → p-5f04d9eb.entry.js.map} +0 -0
- /package/www/build/{p-7d844bac.entry.js.map → p-60a9cb8b.entry.js.map} +0 -0
- /package/www/build/{p-ddae9016.entry.js.map → p-6230c432.entry.js.map} +0 -0
- /package/www/build/{p-382e2939.entry.js.map → p-6e1ba2f0.entry.js.map} +0 -0
- /package/www/build/{p-3ce0d28c.entry.js.map → p-7095262b.entry.js.map} +0 -0
- /package/www/build/{p-af4b759a.entry.js.map → p-72dae90b.entry.js.map} +0 -0
- /package/www/build/{p-0d1dbe04.entry.js.map → p-8c952964.entry.js.map} +0 -0
- /package/www/build/{p-18fbbf63.entry.js.map → p-9187ce36.entry.js.map} +0 -0
- /package/www/build/{p-08691c77.entry.js.map → p-9218da42.entry.js.map} +0 -0
- /package/www/build/{p-2cc8c5a5.entry.js.map → p-972098a5.entry.js.map} +0 -0
- /package/www/build/{p-ecaca2df.entry.js.map → p-9f0a3d88.entry.js.map} +0 -0
- /package/www/build/{p-65c59027.entry.js.map → p-aa42f01d.entry.js.map} +0 -0
- /package/www/build/{p-add2b5e8.entry.js.map → p-ad825740.entry.js.map} +0 -0
- /package/www/build/{p-76d8d404.entry.js.map → p-b309bd71.entry.js.map} +0 -0
- /package/www/build/{p-b896dcf7.entry.js.map → p-b38be247.entry.js.map} +0 -0
- /package/www/build/{p-ac03a6cc.entry.js.map → p-bbd492d3.entry.js.map} +0 -0
- /package/www/build/{p-6f69c2b6.js.map → p-c13ef624.js.map} +0 -0
- /package/www/build/{p-0eab0213.entry.js.map → p-caccf490.entry.js.map} +0 -0
- /package/www/build/{p-3f8725c1.entry.js.map → p-cb8aec27.entry.js.map} +0 -0
- /package/www/build/{p-cc6406ab.entry.js.map → p-deb86b5c.entry.js.map} +0 -0
- /package/www/build/{p-efe1de34.entry.js.map → p-ea36d666.entry.js.map} +0 -0
- /package/www/build/{p-9078dfd7.entry.js.map → p-f06bd257.entry.js.map} +0 -0
- /package/www/build/{p-2f486acc.entry.js.map → p-f075ec62.entry.js.map} +0 -0
- /package/www/build/{p-27a59513.entry.js.map → p-f8915e2e.entry.js.map} +0 -0
- /package/www/build/{p-068b15fc.entry.js.map → p-fb06a5d8.entry.js.map} +0 -0
- /package/www/build/{p-f400cf1b.js.map → p-feb84d36.js.map} +0 -0
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import {
|
|
3
|
-
import { getDevice } from "../../../utils/utils";
|
|
2
|
+
import { ZFileUploadType } from "../../../beans";
|
|
4
3
|
export class ZFileUpload {
|
|
5
4
|
constructor() {
|
|
6
|
-
this.inputAttributes = {
|
|
7
|
-
type: "file",
|
|
8
|
-
id: "file-elem",
|
|
9
|
-
multiple: true,
|
|
10
|
-
};
|
|
11
5
|
this.type = ZFileUploadType.DEFAULT;
|
|
12
6
|
this.buttonVariant = undefined;
|
|
13
7
|
this.acceptedFormat = undefined;
|
|
14
8
|
this.fileMaxSize = undefined;
|
|
15
9
|
this.mainTitle = undefined;
|
|
16
10
|
this.description = undefined;
|
|
17
|
-
this.files = [];
|
|
18
11
|
this.uploadBtnLabel = "allega";
|
|
19
12
|
this.dragAndDropLabel = "Rilascia i file in questa area per allegarli.";
|
|
20
13
|
this.allowedFilesMessage = undefined;
|
|
@@ -24,100 +17,88 @@ export class ZFileUpload {
|
|
|
24
17
|
this.errorModalMessage = undefined;
|
|
25
18
|
this.uploadedFilesLabel = "File appena caricati";
|
|
26
19
|
this.hasFileSection = true;
|
|
27
|
-
this.
|
|
20
|
+
this.inputName = "z-file-upload";
|
|
21
|
+
this.showErrors = true;
|
|
22
|
+
this._type = this.type;
|
|
23
|
+
this.files = [];
|
|
24
|
+
this.invalidFiles = new Map();
|
|
28
25
|
}
|
|
29
|
-
/** Listen removeFile event sent from z-file component */
|
|
30
|
-
|
|
31
|
-
this.
|
|
26
|
+
/** Listen `removeFile` event sent from z-file component */
|
|
27
|
+
onFileRemoved(e) {
|
|
28
|
+
this.removeFile(e.detail);
|
|
32
29
|
}
|
|
33
30
|
/** Listen fileDropped event sent from z-dragdrop-area component */
|
|
34
31
|
fileDroppedListener(e) {
|
|
35
32
|
this.input.files = e.detail;
|
|
36
|
-
this.
|
|
37
|
-
}
|
|
38
|
-
componentDidUpdate() {
|
|
39
|
-
this.handleAccessibility();
|
|
40
|
-
this.invalidFiles.size && this.errorModal.focus();
|
|
41
|
-
}
|
|
42
|
-
componentWillLoad() {
|
|
43
|
-
this.invalidFiles = new Map();
|
|
44
|
-
}
|
|
45
|
-
fileInputHandler() {
|
|
46
|
-
if (this.input.files.length) {
|
|
47
|
-
this.invalidFiles = this.checkFiles(Array.from(this.input.files));
|
|
48
|
-
}
|
|
33
|
+
this.checkFilesValidity(this.input.files);
|
|
49
34
|
}
|
|
50
|
-
/**
|
|
35
|
+
/** Get the list of uploaded files */
|
|
51
36
|
async getFiles() {
|
|
52
37
|
return this.files;
|
|
53
38
|
}
|
|
54
|
-
/**
|
|
39
|
+
/** Remove a previously uploaded file */
|
|
55
40
|
async removeFile(fileName) {
|
|
56
|
-
this.removeFileHandler(fileName);
|
|
57
|
-
}
|
|
58
|
-
removeFileHandler(fileName) {
|
|
59
41
|
const files = this.files;
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
files.splice(index, 1);
|
|
65
|
-
this.files = [...files];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
getType() {
|
|
70
|
-
if (getDevice() !== Device.DESKTOP && getDevice() !== Device.DESKTOP_WIDE) {
|
|
71
|
-
return ZFileUploadType.DEFAULT;
|
|
42
|
+
const index = files.findIndex((file) => file.name === fileName);
|
|
43
|
+
if (index >= 0) {
|
|
44
|
+
files.splice(index, 1);
|
|
45
|
+
this.files = [...files];
|
|
72
46
|
}
|
|
73
|
-
return this.type;
|
|
74
47
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
lastFile.focus();
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
this.getType() === ZFileUploadType.DEFAULT
|
|
82
|
-
? this.button.querySelector("button").focus()
|
|
83
|
-
: this.uploadLink.focus();
|
|
48
|
+
checkFilesValidity(files) {
|
|
49
|
+
if (!files.length) {
|
|
50
|
+
return;
|
|
84
51
|
}
|
|
85
|
-
|
|
86
|
-
checkFiles(files) {
|
|
87
|
-
const errors = new Map();
|
|
88
|
-
const sizeErrorString = `supera il limite di ${this.fileMaxSize}MB`;
|
|
89
|
-
const formatErrorString = " ha un formato non supportato";
|
|
90
|
-
files.forEach((file) => {
|
|
52
|
+
Array.from(files).forEach((file) => {
|
|
91
53
|
const fileSize = file.size / 1024 / 1024;
|
|
92
54
|
const fileFormatOk = this.acceptedFormat
|
|
93
55
|
.split(",")
|
|
94
56
|
.some((ext) => file.name.toLowerCase().endsWith(ext.trim()));
|
|
95
57
|
const fileSizeOk = fileSize <= this.fileMaxSize;
|
|
96
|
-
if (fileSizeOk && fileFormatOk) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this.input.value = "";
|
|
101
|
-
}
|
|
58
|
+
if (fileSizeOk && fileFormatOk && !this.files.find((f) => f.name === file.name)) {
|
|
59
|
+
this.files = [...this.files, file];
|
|
60
|
+
this.fileInput.emit(file);
|
|
61
|
+
this.input.value = "";
|
|
102
62
|
return;
|
|
103
63
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
64
|
+
const sizeError = `Il file ${file.name} supera il limite di ${this.fileMaxSize}MB`;
|
|
65
|
+
const formatError = `Il file ${file.name} ha un formato non supportato`;
|
|
66
|
+
const errors = [
|
|
67
|
+
!fileSizeOk && { cause: "size", message: sizeError },
|
|
68
|
+
!fileFormatOk && { cause: "format", message: formatError },
|
|
69
|
+
].filter(Boolean);
|
|
70
|
+
this.invalidFiles.set(file.name, errors);
|
|
71
|
+
this.invalidFiles = new Map(this.invalidFiles); // trigger state update
|
|
72
|
+
this.fileError.emit({ file: file.name, errors });
|
|
111
73
|
});
|
|
112
|
-
return errors;
|
|
113
74
|
}
|
|
114
|
-
|
|
115
|
-
|
|
75
|
+
resetErrors() {
|
|
76
|
+
this.invalidFiles = new Map();
|
|
77
|
+
}
|
|
78
|
+
onFilesChange(e) {
|
|
79
|
+
this.checkFilesValidity(e.target.files);
|
|
80
|
+
}
|
|
81
|
+
componentWillLoad() {
|
|
82
|
+
// force default type on mobile and tablet viewport
|
|
83
|
+
const mql = window.matchMedia("(max-width: 1151px)");
|
|
84
|
+
this._type = mql.matches ? ZFileUploadType.DEFAULT : this.type;
|
|
85
|
+
mql.addEventListener("change", (e) => {
|
|
86
|
+
this._type = e.matches ? ZFileUploadType.DEFAULT : this.type;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
componentDidUpdate() {
|
|
90
|
+
if (!this.showErrors || !this.invalidFiles.size) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.errorModal.open();
|
|
116
94
|
}
|
|
117
95
|
renderDescription(cssClass) {
|
|
118
|
-
|
|
96
|
+
if (!this.description) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
return (h("span", { id: "description", class: cssClass }, this.description));
|
|
119
100
|
}
|
|
120
|
-
|
|
101
|
+
renderAllowedFilesMessage() {
|
|
121
102
|
let fileFormatString = "";
|
|
122
103
|
let fileWeightString = "";
|
|
123
104
|
if (this.acceptedFormat) {
|
|
@@ -130,31 +111,30 @@ export class ZFileUpload {
|
|
|
130
111
|
if (this.fileMaxSize) {
|
|
131
112
|
fileWeightString = ` per un massimo di ${this.fileMaxSize}MB di peso`;
|
|
132
113
|
}
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
: null));
|
|
114
|
+
const defaultMessage = fileFormatString || fileWeightString ? `Puoi allegare file${fileFormatString}${fileWeightString}.` : undefined;
|
|
115
|
+
if (!this.allowedFilesMessage && !defaultMessage) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
return h("span", { class: "allowed-files-message body-3" }, this.allowedFilesMessage || defaultMessage);
|
|
139
119
|
}
|
|
140
120
|
renderFileSection() {
|
|
141
121
|
if (!this.hasFileSection) {
|
|
142
122
|
return;
|
|
143
123
|
}
|
|
144
|
-
return (h("section", { class:
|
|
124
|
+
return (h("section", { class: { "files-container": true, "hidden": !this.files.length } }, h("div", { class: "uploaded-files-label heading-3-sb" }, this.uploadedFilesLabel), h("div", { class: "files-wrapper" }, h("slot", { name: "files" }))));
|
|
145
125
|
}
|
|
146
126
|
renderInput() {
|
|
147
|
-
return (h("input",
|
|
127
|
+
return (h("input", { type: "file", name: this.inputName, multiple: true, onChange: (e) => this.onFilesChange(e), accept: this.acceptedFormat, ref: (val) => (this.input = val) }));
|
|
148
128
|
}
|
|
149
129
|
renderUploadButton() {
|
|
150
130
|
return [
|
|
151
|
-
this.renderInput(),
|
|
152
131
|
h("z-button", { onClick: () => this.input.click(), onKeyPress: (e) => {
|
|
153
132
|
if (e.code == "Space" || e.code == "Enter") {
|
|
154
133
|
e.preventDefault();
|
|
155
134
|
this.input.click();
|
|
156
135
|
}
|
|
157
|
-
}, id: "fileSelect", variant: this.buttonVariant, icon: "upload"
|
|
136
|
+
}, id: "fileSelect", variant: this.buttonVariant, icon: "upload" }, this.uploadBtnLabel),
|
|
137
|
+
this.renderInput(),
|
|
158
138
|
];
|
|
159
139
|
}
|
|
160
140
|
renderUploadLink() {
|
|
@@ -165,13 +145,13 @@ export class ZFileUpload {
|
|
|
165
145
|
e.preventDefault();
|
|
166
146
|
this.input.click();
|
|
167
147
|
}
|
|
168
|
-
}
|
|
148
|
+
} }, this.uploadClickableMessage), " ", this.uploadMessage),
|
|
169
149
|
];
|
|
170
150
|
}
|
|
171
151
|
renderDefaultMode() {
|
|
172
152
|
return [
|
|
173
153
|
this.renderDescription("body-3-sb"),
|
|
174
|
-
this.
|
|
154
|
+
this.renderAllowedFilesMessage(),
|
|
175
155
|
this.renderFileSection(),
|
|
176
156
|
this.renderUploadButton(),
|
|
177
157
|
];
|
|
@@ -179,24 +159,20 @@ export class ZFileUpload {
|
|
|
179
159
|
renderDragDropMode() {
|
|
180
160
|
return [
|
|
181
161
|
this.renderFileSection(),
|
|
182
|
-
h("z-dragdrop-area", { "drag-and-drop-label": this.dragAndDropLabel }, h("div", { class: "text-container" }, this.renderDescription("body-1"), this.renderUploadLink(), this.
|
|
162
|
+
h("z-dragdrop-area", { "drag-and-drop-label": this.dragAndDropLabel }, h("div", { class: "text-container" }, this.renderDescription("body-1"), this.renderUploadLink(), this.renderAllowedFilesMessage())),
|
|
183
163
|
];
|
|
184
164
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
handleErrorModalContent() {
|
|
191
|
-
return (h("div", { slot: "modalContent" }, h("div", { class: "modal-wrapper" }, h("div", { class: "files" }, this.errorModalMessage ? (h("span", { class: "body-3" }, this.errorModalMessage)) : (Array.from(this.invalidFiles).map(([key, value]) => {
|
|
192
|
-
return h("span", { class: "body-3" }, this.formatErrorString(key, value));
|
|
193
|
-
}))))));
|
|
165
|
+
renderFileErrors() {
|
|
166
|
+
return Array.from(this.invalidFiles).map(([fileName, errors]) => {
|
|
167
|
+
const prefix = `Il file ${fileName}`;
|
|
168
|
+
return (h("span", { class: "error-message" }, "Il file ", h("span", { class: "body-3-sb" }, fileName), errors.map(({ message }) => message.replace(prefix, "")).join(" e "), "."));
|
|
169
|
+
});
|
|
194
170
|
}
|
|
195
171
|
render() {
|
|
196
|
-
return (h(Host, { key: '
|
|
172
|
+
return (h(Host, { key: 'ea57cc0462e4358d04bfc8f5709b61be50947e7a' }, this.mainTitle && (h("div", { key: '59e23f66172333b963922832782a8ac89611acb9', id: "title", class: "heading-3-sb" }, this.mainTitle)), this._type == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode(), !!this.invalidFiles.size && this.showErrors && (h("z-modal", { key: '64cb55a1c0fb491a9dd5b414a309b284e4f2d24e', modalid: `file-upload-${this.type}-error-modal`, ref: (val) => (this.errorModal = val), modaltitle: this.errorModalTitle, onModalClose: () => this.resetErrors(), onModalBackgroundClick: () => this.resetErrors() }, h("div", { key: '255cf2140f1ca881f90df6952965abc8f364f4d0', slot: "modalContent" }, h("div", { key: '03638b6b970c72c73ac7014f0c7848a032029963', class: "modal-wrapper body-3" }, this.errorModalMessage ? this.errorModalMessage : this.renderFileErrors()))))));
|
|
197
173
|
}
|
|
198
174
|
static get is() { return "z-file-upload"; }
|
|
199
|
-
static get encapsulation() { return "
|
|
175
|
+
static get encapsulation() { return "scoped"; }
|
|
200
176
|
static get originalStyleUrls() {
|
|
201
177
|
return {
|
|
202
178
|
"$": ["styles.css"]
|
|
@@ -483,11 +459,48 @@ export class ZFileUpload {
|
|
|
483
459
|
"attribute": "has-file-section",
|
|
484
460
|
"reflect": false,
|
|
485
461
|
"defaultValue": "true"
|
|
462
|
+
},
|
|
463
|
+
"inputName": {
|
|
464
|
+
"type": "string",
|
|
465
|
+
"mutable": false,
|
|
466
|
+
"complexType": {
|
|
467
|
+
"original": "string",
|
|
468
|
+
"resolved": "string",
|
|
469
|
+
"references": {}
|
|
470
|
+
},
|
|
471
|
+
"required": false,
|
|
472
|
+
"optional": true,
|
|
473
|
+
"docs": {
|
|
474
|
+
"tags": [],
|
|
475
|
+
"text": "Value to set on the file input's `name` attribute (for use with forms)"
|
|
476
|
+
},
|
|
477
|
+
"attribute": "input-name",
|
|
478
|
+
"reflect": false,
|
|
479
|
+
"defaultValue": "\"z-file-upload\""
|
|
480
|
+
},
|
|
481
|
+
"showErrors": {
|
|
482
|
+
"type": "boolean",
|
|
483
|
+
"mutable": false,
|
|
484
|
+
"complexType": {
|
|
485
|
+
"original": "boolean",
|
|
486
|
+
"resolved": "boolean",
|
|
487
|
+
"references": {}
|
|
488
|
+
},
|
|
489
|
+
"required": false,
|
|
490
|
+
"optional": false,
|
|
491
|
+
"docs": {
|
|
492
|
+
"tags": [],
|
|
493
|
+
"text": "Whether to show errors in the internal modal or leave the handling to the app.\nErrors will still be emitted."
|
|
494
|
+
},
|
|
495
|
+
"attribute": "show-errors",
|
|
496
|
+
"reflect": false,
|
|
497
|
+
"defaultValue": "true"
|
|
486
498
|
}
|
|
487
499
|
};
|
|
488
500
|
}
|
|
489
501
|
static get states() {
|
|
490
502
|
return {
|
|
503
|
+
"_type": {},
|
|
491
504
|
"files": {},
|
|
492
505
|
"invalidFiles": {}
|
|
493
506
|
};
|
|
@@ -504,9 +517,35 @@ export class ZFileUpload {
|
|
|
504
517
|
"text": "Emitted when user select one or more files"
|
|
505
518
|
},
|
|
506
519
|
"complexType": {
|
|
507
|
-
"original": "
|
|
508
|
-
"resolved": "
|
|
509
|
-
"references": {
|
|
520
|
+
"original": "File",
|
|
521
|
+
"resolved": "File",
|
|
522
|
+
"references": {
|
|
523
|
+
"File": {
|
|
524
|
+
"location": "global",
|
|
525
|
+
"id": "global::File"
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}, {
|
|
530
|
+
"method": "fileError",
|
|
531
|
+
"name": "fileError",
|
|
532
|
+
"bubbles": true,
|
|
533
|
+
"cancelable": true,
|
|
534
|
+
"composed": true,
|
|
535
|
+
"docs": {
|
|
536
|
+
"tags": [],
|
|
537
|
+
"text": "Emits an array of error messages related to one or more files not allowed.\nEmitted when some file is dropped or selected."
|
|
538
|
+
},
|
|
539
|
+
"complexType": {
|
|
540
|
+
"original": "{file: string; errors: ZFileUploadError[]}",
|
|
541
|
+
"resolved": "{ file: string; errors: ZFileUploadError[]; }",
|
|
542
|
+
"references": {
|
|
543
|
+
"ZFileUploadError": {
|
|
544
|
+
"location": "local",
|
|
545
|
+
"path": "/home/runner/work/design-system/design-system/src/components/file-upload/z-file-upload/index.tsx",
|
|
546
|
+
"id": "src/components/file-upload/z-file-upload/index.tsx::ZFileUploadError"
|
|
547
|
+
}
|
|
548
|
+
}
|
|
510
549
|
}
|
|
511
550
|
}];
|
|
512
551
|
}
|
|
@@ -529,7 +568,7 @@ export class ZFileUpload {
|
|
|
529
568
|
"return": "Promise<File[]>"
|
|
530
569
|
},
|
|
531
570
|
"docs": {
|
|
532
|
-
"text": "
|
|
571
|
+
"text": "Get the list of uploaded files",
|
|
533
572
|
"tags": []
|
|
534
573
|
}
|
|
535
574
|
},
|
|
@@ -550,17 +589,17 @@ export class ZFileUpload {
|
|
|
550
589
|
"return": "Promise<void>"
|
|
551
590
|
},
|
|
552
591
|
"docs": {
|
|
553
|
-
"text": "
|
|
592
|
+
"text": "Remove a previously uploaded file",
|
|
554
593
|
"tags": []
|
|
555
594
|
}
|
|
556
595
|
}
|
|
557
596
|
};
|
|
558
597
|
}
|
|
559
|
-
static get elementRef() { return "
|
|
598
|
+
static get elementRef() { return "host"; }
|
|
560
599
|
static get listeners() {
|
|
561
600
|
return [{
|
|
562
601
|
"name": "removeFile",
|
|
563
|
-
"method": "
|
|
602
|
+
"method": "onFileRemoved",
|
|
564
603
|
"target": undefined,
|
|
565
604
|
"capture": false,
|
|
566
605
|
"passive": false
|
|
@@ -1 +1 @@
|
|
|
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,mEAAmE;IAEnE,mBAAmB,CAAC,CAAc;QAChC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,gBAAgB,EAAE,CAA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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,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAU9D,MAAM,OAAO,WAAW;;oBAGE,eAAe,CAAC,OAAO;;;;;;8BAwBrB,QAAQ;gCAIN,+CAA+C;;sCAQzC,QAAQ;6BAIjB,6BAA6B;+BAI3B,uBAAuB;;kCAQpB,sBAAsB;8BAIzB,IAAI;yBAIlB,eAAe;0BAOf,IAAI;qBAIgB,IAAI,CAAC,IAAI;qBAI1B,EAAE;4BAI8B,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ploadType} from \"../../../beans\";\n\nexport type ZFileUploadError = {cause: \"format\" | \"size\"; message: string};\n\n@Component({\n tag: \"z-file-upload\",\n styleUrl: \"styles.css\",\n shadow: false,\n scoped: 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 /** 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 /** Value to set on the file input's `name` attribute (for use with forms) */\n @Prop()\n inputName? = \"z-file-upload\";\n\n /**\n * Whether to show errors in the internal modal or leave the handling to the app.\n * Errors will still be emitted.\n */\n @Prop()\n showErrors = true;\n\n /** Internal store of the component type. It will change when viewport goes from desktop to tablet/mobile and vice versa */\n @State()\n private _type: ZFileUploadType = this.type;\n\n /** Files added by the user */\n @State()\n files: File[] = [];\n\n /** Map of files whose upload caused an error and the relative errors, with the cause and a message */\n @State()\n invalidFiles: Map<string, ZFileUploadError[]> = new Map<string, ZFileUploadError[]>();\n\n /** Emitted when user select one or more files */\n @Event()\n fileInput: EventEmitter<File>;\n\n /**\n * Emits an array of error messages related to one or more files not allowed.\n * Emitted when some file is dropped or selected.\n */\n @Event()\n fileError: EventEmitter<{file: string; errors: ZFileUploadError[]}>;\n\n @Element() host: HTMLZFileUploadElement;\n\n private input: HTMLInputElement;\n\n private errorModal: HTMLZModalElement;\n\n /** Listen `removeFile` event sent from z-file component */\n @Listen(\"removeFile\")\n onFileRemoved(e: CustomEvent): void {\n this.removeFile(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.checkFilesValidity(this.input.files);\n }\n\n /** Get the list of uploaded files */\n @Method()\n async getFiles(): Promise<File[]> {\n return this.files;\n }\n\n /** Remove a previously uploaded file */\n @Method()\n async removeFile(fileName: string): Promise<void> {\n const files = this.files;\n const index = files.findIndex((file) => file.name === fileName);\n if (index >= 0) {\n files.splice(index, 1);\n this.files = [...files];\n }\n }\n\n private checkFilesValidity(files: FileList): Map<string, string[]> {\n if (!files.length) {\n return;\n }\n\n Array.from(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 && !this.files.find((f) => f.name === file.name)) {\n this.files = [...this.files, file];\n this.fileInput.emit(file);\n this.input.value = \"\";\n\n return;\n }\n\n const sizeError = `Il file ${file.name} supera il limite di ${this.fileMaxSize}MB`;\n const formatError = `Il file ${file.name} ha un formato non supportato`;\n const errors = [\n !fileSizeOk && {cause: \"size\" as const, message: sizeError},\n !fileFormatOk && {cause: \"format\" as const, message: formatError},\n ].filter(Boolean);\n this.invalidFiles.set(file.name, errors);\n this.invalidFiles = new Map(this.invalidFiles); // trigger state update\n this.fileError.emit({file: file.name, errors});\n });\n }\n\n private resetErrors(): void {\n this.invalidFiles = new Map<string, ZFileUploadError[]>();\n }\n\n private onFilesChange(e: Event): void {\n this.checkFilesValidity((e.target as HTMLInputElement).files);\n }\n\n componentWillLoad(): void {\n // force default type on mobile and tablet viewport\n const mql = window.matchMedia(\"(max-width: 1151px)\");\n this._type = mql.matches ? ZFileUploadType.DEFAULT : this.type;\n mql.addEventListener(\"change\", (e) => {\n this._type = e.matches ? ZFileUploadType.DEFAULT : this.type;\n });\n }\n\n componentDidUpdate(): void {\n if (!this.showErrors || !this.invalidFiles.size) {\n return;\n }\n\n this.errorModal.open();\n }\n\n private renderDescription(cssClass): HTMLElement | undefined {\n if (!this.description) {\n return;\n }\n\n return (\n <span\n id=\"description\"\n class={cssClass}\n >\n {this.description}\n </span>\n );\n }\n\n private renderAllowedFilesMessage(): 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 defaultMessage =\n fileFormatString || fileWeightString ? `Puoi allegare file${fileFormatString}${fileWeightString}.` : undefined;\n\n if (!this.allowedFilesMessage && !defaultMessage) {\n return;\n }\n\n return <span class=\"allowed-files-message body-3\">{this.allowedFilesMessage || defaultMessage}</span>;\n }\n\n private renderFileSection(): HTMLElement {\n if (!this.hasFileSection) {\n return;\n }\n\n return (\n <section class={{\"files-container\": true, \"hidden\": !this.files.length}}>\n <div class=\"uploaded-files-label heading-3-sb\">{this.uploadedFilesLabel}</div>\n <div class=\"files-wrapper\">\n <slot name=\"files\" />\n </div>\n </section>\n );\n }\n\n private renderInput(): HTMLInputElement {\n return (\n <input\n type=\"file\"\n name={this.inputName}\n multiple\n onChange={(e) => this.onFilesChange(e)}\n accept={this.acceptedFormat}\n ref={(val) => (this.input = val)}\n />\n );\n }\n\n private renderUploadButton(): unknown[] {\n return [\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 >\n {this.uploadBtnLabel}\n </z-button>,\n this.renderInput(),\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 >\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.renderAllowedFilesMessage(),\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.renderAllowedFilesMessage()}\n </div>\n </z-dragdrop-area>,\n ];\n }\n\n private renderFileErrors(): HTMLElement[] {\n return Array.from(this.invalidFiles).map(([fileName, errors]) => {\n const prefix = `Il file ${fileName}`;\n\n return (\n <span class=\"error-message\">\n Il file <span class=\"body-3-sb\">{fileName}</span>\n {errors.map(({message}) => message.replace(prefix, \"\")).join(\" e \")}.\n </span>\n );\n });\n }\n\n render(): HTMLZFileUploadElement {\n return (\n <Host>\n {this.mainTitle && (\n <div\n id=\"title\"\n class=\"heading-3-sb\"\n >\n {this.mainTitle}\n </div>\n )}\n {this._type == ZFileUploadType.DEFAULT ? this.renderDefaultMode() : this.renderDragDropMode()}\n {!!this.invalidFiles.size && this.showErrors && (\n <z-modal\n modalid={`file-upload-${this.type}-error-modal`}\n ref={(val) => (this.errorModal = val)}\n modaltitle={this.errorModalTitle}\n onModalClose={() => this.resetErrors()}\n onModalBackgroundClick={() => this.resetErrors()}\n >\n <div slot=\"modalContent\">\n <div class=\"modal-wrapper body-3\">\n {this.errorModalMessage ? this.errorModalMessage : this.renderFileErrors()}\n </div>\n </div>\n </z-modal>\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -25,6 +25,7 @@ const StoryMeta = {
|
|
|
25
25
|
description: "Vuoi allegare un file per chiarire meglio la tua richiesta?",
|
|
26
26
|
uploadBtnLabel: "allega",
|
|
27
27
|
hasFileSection: true,
|
|
28
|
+
showErrors: true,
|
|
28
29
|
},
|
|
29
30
|
};
|
|
30
31
|
export default StoryMeta;
|
|
@@ -38,6 +39,7 @@ export const Default = {
|
|
|
38
39
|
</h4>
|
|
39
40
|
<z-file-upload
|
|
40
41
|
type=${ZFileUploadType.DEFAULT}
|
|
42
|
+
.showErrors=${args.showErrors}
|
|
41
43
|
.hasFileSection=${args.hasFileSection}
|
|
42
44
|
description="${args.description}"
|
|
43
45
|
.buttonVariant=${args.buttonVariant}
|
|
@@ -45,11 +47,9 @@ export const Default = {
|
|
|
45
47
|
.acceptedFormat=${args.acceptedFormat}
|
|
46
48
|
.mainTitle=${args.mainTitle}
|
|
47
49
|
.uploadBtnLabel=${args.uploadBtnLabel}
|
|
48
|
-
|
|
49
|
-
</z-file-upload>
|
|
50
|
+
/>
|
|
50
51
|
<script>
|
|
51
|
-
|
|
52
|
-
let fileNumber = 0;
|
|
52
|
+
fileNumber = 0;
|
|
53
53
|
document.addEventListener("fileInput", (e) => {
|
|
54
54
|
fileNumber++;
|
|
55
55
|
const item = e.detail;
|
|
@@ -57,7 +57,7 @@ export const Default = {
|
|
|
57
57
|
chip.setAttribute("slot", "files");
|
|
58
58
|
chip.setAttribute("file-number", fileNumber);
|
|
59
59
|
chip.setAttribute("file-name", item.name);
|
|
60
|
-
|
|
60
|
+
document.querySelector("z-file-upload")?.appendChild(chip);
|
|
61
61
|
});
|
|
62
62
|
</script>`,
|
|
63
63
|
};
|
|
@@ -72,23 +72,22 @@ export const Dragdrop = {
|
|
|
72
72
|
<br />
|
|
73
73
|
<z-file-upload
|
|
74
74
|
type=${ZFileUploadType.DRAGDROP}
|
|
75
|
+
.showErrors=${args.showErrors}
|
|
75
76
|
.hasFileSection=${args.hasFileSection}
|
|
76
77
|
description="${args.description}"
|
|
77
78
|
.fileMaxSize=${args.fileMaxSize}
|
|
78
79
|
.acceptedFormat=${args.acceptedFormat}
|
|
79
80
|
.mainTitle=${args.mainTitle}
|
|
80
81
|
.dragAndDropLabel=${args.dragAndDropLabel}
|
|
81
|
-
|
|
82
|
-
</z-file-upload>
|
|
82
|
+
/>
|
|
83
83
|
<script>
|
|
84
|
-
const uploaderDragdrop = document.querySelector("z-file-upload");
|
|
85
84
|
document.addEventListener("fileInput", (e) => {
|
|
86
85
|
const item = e.detail;
|
|
87
86
|
const chip = document.createElement("Z-FILE");
|
|
88
87
|
chip.setAttribute("slot", "files");
|
|
89
88
|
chip.setAttribute("filetype", item.type);
|
|
90
89
|
chip.setAttribute("file-name", item.name);
|
|
91
|
-
|
|
90
|
+
document.querySelector("z-file-upload")?.appendChild(chip);
|
|
92
91
|
});
|
|
93
92
|
</script>`,
|
|
94
93
|
};
|
|
@@ -112,6 +111,7 @@ export const DragdropEnglish = {
|
|
|
112
111
|
<br />
|
|
113
112
|
<z-file-upload
|
|
114
113
|
type=${ZFileUploadType.DRAGDROP}
|
|
114
|
+
.showErrors=${args.showErrors}
|
|
115
115
|
.hasFileSection=${args.hasFileSection}
|
|
116
116
|
description="${args.description}"
|
|
117
117
|
.fileMaxSize=${args.fileMaxSize}
|
|
@@ -125,17 +125,15 @@ export const DragdropEnglish = {
|
|
|
125
125
|
.errorModalMessage=${args.errorModalMessage}
|
|
126
126
|
.uploadedFilesLabel=${args.uploadedFilesLabel}
|
|
127
127
|
.uploadBtnLabel=${args.uploadBtnLabel}
|
|
128
|
-
|
|
129
|
-
</z-file-upload>
|
|
128
|
+
/>
|
|
130
129
|
<script>
|
|
131
|
-
const uploaderDragdrop = document.querySelector("z-file-upload");
|
|
132
130
|
document.addEventListener("fileInput", (e) => {
|
|
133
131
|
const item = e.detail;
|
|
134
132
|
const chip = document.createElement("Z-FILE");
|
|
135
133
|
chip.setAttribute("slot", "files");
|
|
136
134
|
chip.setAttribute("filetype", item.type);
|
|
137
135
|
chip.setAttribute("file-name", item.name);
|
|
138
|
-
|
|
136
|
+
document.querySelector("z-file-upload")?.appendChild(chip);
|
|
139
137
|
});
|
|
140
138
|
</script>`,
|
|
141
139
|
};
|
|
@@ -1 +1 @@
|
|
|
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,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;YACvC,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;SACF;QACD,aAAa,EAAE;YACb,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;YACrC,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;SACF;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,+BAA+B;QAC/C,SAAS,EAAE,gBAAgB;QAC3B,WAAW,EAAE,6DAA6D;QAC1E,cAAc,EAAE,QAAQ;QACxB,cAAc,EAAE,IAAI;
|
|
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,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;YACvC,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;SACF;QACD,aAAa,EAAE;YACb,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;YACrC,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;aACrB;SACF;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,+BAA+B;QAC/C,SAAS,EAAE,gBAAgB;QAC3B,WAAW,EAAE,6DAA6D;QAC1E,cAAc,EAAE,QAAQ;QACxB,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE,IAAI;KACjB;CAC0B,CAAC;AAE9B,eAAe,SAAS,CAAC;AAIzB,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE;QACJ,aAAa,EAAE,aAAa,CAAC,OAAO;KACrC;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,IAAI,CAAA;;;;;eAKO,eAAe,CAAC,OAAO;sBAChB,IAAI,CAAC,UAAU;0BACX,IAAI,CAAC,cAAc;uBACtB,IAAI,CAAC,WAAW;yBACd,IAAI,CAAC,aAAa;uBACpB,IAAI,CAAC,WAAW;0BACb,IAAI,CAAC,cAAc;qBACxB,IAAI,CAAC,SAAS;0BACT,IAAI,CAAC,cAAc;;;;;;;;;;;;;gBAa7B;CACC,CAAC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@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 showErrors: 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 .showErrors=${args.showErrors}\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 <script>\n 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 document.querySelector(\"z-file-upload\")?.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 .showErrors=${args.showErrors}\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 <script>\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 document.querySelector(\"z-file-upload\")?.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 .showErrors=${args.showErrors}\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 <script>\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 document.querySelector(\"z-file-upload\")?.appendChild(chip);\n });\n </script>`,\n} satisfies Story;\n"]}
|