@spw-ds/spw-stencil-library 0.0.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/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/index-55fbdb28.js +1956 -0
- package/dist/cjs/index-55fbdb28.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +17 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/spw-accordion_58.cjs.entry.js +5955 -0
- package/dist/cjs/spw-accordion_58.cjs.entry.js.map +1 -0
- package/dist/cjs/spw-stencil-library.cjs.js +27 -0
- package/dist/cjs/spw-stencil-library.cjs.js.map +1 -0
- package/dist/collection/assets/images/logo.svg +3 -0
- package/dist/collection/collection-manifest.json +69 -0
- package/dist/collection/components/spw-accordion/spw-accordion-content/spw-accordion-content.css +2 -0
- package/dist/collection/components/spw-accordion/spw-accordion-content/spw-accordion-content.js +91 -0
- package/dist/collection/components/spw-accordion/spw-accordion-content/spw-accordion-content.js.map +1 -0
- package/dist/collection/components/spw-accordion/spw-accordion-item/spw-accordion-item.css +2 -0
- package/dist/collection/components/spw-accordion/spw-accordion-item/spw-accordion-item.js +146 -0
- package/dist/collection/components/spw-accordion/spw-accordion-item/spw-accordion-item.js.map +1 -0
- package/dist/collection/components/spw-accordion/spw-accordion-title/spw-accordion-title.css +2 -0
- package/dist/collection/components/spw-accordion/spw-accordion-title/spw-accordion-title.js +64 -0
- package/dist/collection/components/spw-accordion/spw-accordion-title/spw-accordion-title.js.map +1 -0
- package/dist/collection/components/spw-accordion/spw-accordion.css +2 -0
- package/dist/collection/components/spw-accordion/spw-accordion.js +19 -0
- package/dist/collection/components/spw-accordion/spw-accordion.js.map +1 -0
- package/dist/collection/components/spw-breadcrumb/spw-breadcrumb-item/spw-breadcrumb-item.css +2 -0
- package/dist/collection/components/spw-breadcrumb/spw-breadcrumb-item/spw-breadcrumb-item.js +83 -0
- package/dist/collection/components/spw-breadcrumb/spw-breadcrumb-item/spw-breadcrumb-item.js.map +1 -0
- package/dist/collection/components/spw-breadcrumb/spw-breadcrumb.css +2 -0
- package/dist/collection/components/spw-breadcrumb/spw-breadcrumb.js +97 -0
- package/dist/collection/components/spw-breadcrumb/spw-breadcrumb.js.map +1 -0
- package/dist/collection/components/spw-button/spw-button.css +2 -0
- package/dist/collection/components/spw-button/spw-button.js +444 -0
- package/dist/collection/components/spw-button/spw-button.js.map +1 -0
- package/dist/collection/components/spw-card/spw-card-content/spw-card-content.css +2 -0
- package/dist/collection/components/spw-card/spw-card-content/spw-card-content.js +69 -0
- package/dist/collection/components/spw-card/spw-card-content/spw-card-content.js.map +1 -0
- package/dist/collection/components/spw-card/spw-card-excerpt/spw-card-excerpt.css +2 -0
- package/dist/collection/components/spw-card/spw-card-excerpt/spw-card-excerpt.js +52 -0
- package/dist/collection/components/spw-card/spw-card-excerpt/spw-card-excerpt.js.map +1 -0
- package/dist/collection/components/spw-card/spw-card-image/spw-card-image.css +2 -0
- package/dist/collection/components/spw-card/spw-card-image/spw-card-image.js +62 -0
- package/dist/collection/components/spw-card/spw-card-image/spw-card-image.js.map +1 -0
- package/dist/collection/components/spw-card/spw-card-subtag-item/spw-card-subtag-item.css +2 -0
- package/dist/collection/components/spw-card/spw-card-subtag-item/spw-card-subtag-item.js +54 -0
- package/dist/collection/components/spw-card/spw-card-subtag-item/spw-card-subtag-item.js.map +1 -0
- package/dist/collection/components/spw-card/spw-card-subtags/spw-card-subtags.css +2 -0
- package/dist/collection/components/spw-card/spw-card-subtags/spw-card-subtags.js +62 -0
- package/dist/collection/components/spw-card/spw-card-subtags/spw-card-subtags.js.map +1 -0
- package/dist/collection/components/spw-card/spw-card-title/spw-card-title.css +2 -0
- package/dist/collection/components/spw-card/spw-card-title/spw-card-title.js +19 -0
- package/dist/collection/components/spw-card/spw-card-title/spw-card-title.js.map +1 -0
- package/dist/collection/components/spw-card/spw-card.css +2 -0
- package/dist/collection/components/spw-card/spw-card.js +314 -0
- package/dist/collection/components/spw-card/spw-card.js.map +1 -0
- package/dist/collection/components/spw-checkbox/spw-checkbox.css +2 -0
- package/dist/collection/components/spw-checkbox/spw-checkbox.js +238 -0
- package/dist/collection/components/spw-checkbox/spw-checkbox.js.map +1 -0
- package/dist/collection/components/spw-cookies/spw-cookies.css +2 -0
- package/dist/collection/components/spw-cookies/spw-cookies.js +166 -0
- package/dist/collection/components/spw-cookies/spw-cookies.js.map +1 -0
- package/dist/collection/components/spw-custom-select/spw-custom-select.css +2 -0
- package/dist/collection/components/spw-custom-select/spw-custom-select.js +680 -0
- package/dist/collection/components/spw-custom-select/spw-custom-select.js.map +1 -0
- package/dist/collection/components/spw-field-label/spw-field-label.css +2 -0
- package/dist/collection/components/spw-field-label/spw-field-label.js +89 -0
- package/dist/collection/components/spw-field-label/spw-field-label.js.map +1 -0
- package/dist/collection/components/spw-field-message/spw-field-message.css +2 -0
- package/dist/collection/components/spw-field-message/spw-field-message.js +80 -0
- package/dist/collection/components/spw-field-message/spw-field-message.js.map +1 -0
- package/dist/collection/components/spw-file-upload/spw-file-upload.css +2 -0
- package/dist/collection/components/spw-file-upload/spw-file-upload.js +411 -0
- package/dist/collection/components/spw-file-upload/spw-file-upload.js.map +1 -0
- package/dist/collection/components/spw-footer/spw-footer-bottom/spw-footer-bottom.css +2 -0
- package/dist/collection/components/spw-footer/spw-footer-bottom/spw-footer-bottom.js +44 -0
- package/dist/collection/components/spw-footer/spw-footer-bottom/spw-footer-bottom.js.map +1 -0
- package/dist/collection/components/spw-footer/spw-footer-content/spw-footer-content.css +2 -0
- package/dist/collection/components/spw-footer/spw-footer-content/spw-footer-content.js +32 -0
- package/dist/collection/components/spw-footer/spw-footer-content/spw-footer-content.js.map +1 -0
- package/dist/collection/components/spw-footer/spw-footer-content-col/spw-footer-content-col.css +2 -0
- package/dist/collection/components/spw-footer/spw-footer-content-col/spw-footer-content-col.js +43 -0
- package/dist/collection/components/spw-footer/spw-footer-content-col/spw-footer-content-col.js.map +1 -0
- package/dist/collection/components/spw-footer/spw-footer-link/spw-footer-link.css +2 -0
- package/dist/collection/components/spw-footer/spw-footer-link/spw-footer-link.js +62 -0
- package/dist/collection/components/spw-footer/spw-footer-link/spw-footer-link.js.map +1 -0
- package/dist/collection/components/spw-footer/spw-footer-socials/spw-footer-socials.css +2 -0
- package/dist/collection/components/spw-footer/spw-footer-socials/spw-footer-socials.js +19 -0
- package/dist/collection/components/spw-footer/spw-footer-socials/spw-footer-socials.js.map +1 -0
- package/dist/collection/components/spw-footer/spw-footer.css +2 -0
- package/dist/collection/components/spw-footer/spw-footer.js +113 -0
- package/dist/collection/components/spw-footer/spw-footer.js.map +1 -0
- package/dist/collection/components/spw-group/spw-group.css +2 -0
- package/dist/collection/components/spw-group/spw-group.js +181 -0
- package/dist/collection/components/spw-group/spw-group.js.map +1 -0
- package/dist/collection/components/spw-header/spw-header-lang/spw-header-lang.css +2 -0
- package/dist/collection/components/spw-header/spw-header-lang/spw-header-lang.js +46 -0
- package/dist/collection/components/spw-header/spw-header-lang/spw-header-lang.js.map +1 -0
- package/dist/collection/components/spw-header/spw-header-lang-item/spw-header-lang-item.css +2 -0
- package/dist/collection/components/spw-header/spw-header-lang-item/spw-header-lang-item.js +44 -0
- package/dist/collection/components/spw-header/spw-header-lang-item/spw-header-lang-item.js.map +1 -0
- package/dist/collection/components/spw-header/spw-header-navigation/spw-header-navigation.css +2 -0
- package/dist/collection/components/spw-header/spw-header-navigation/spw-header-navigation.js +70 -0
- package/dist/collection/components/spw-header/spw-header-navigation/spw-header-navigation.js.map +1 -0
- package/dist/collection/components/spw-header/spw-header-navigation-dropdown/spw-header-navigation-dropdown.css +2 -0
- package/dist/collection/components/spw-header/spw-header-navigation-dropdown/spw-header-navigation-dropdown.js +19 -0
- package/dist/collection/components/spw-header/spw-header-navigation-dropdown/spw-header-navigation-dropdown.js.map +1 -0
- package/dist/collection/components/spw-header/spw-header-navigation-item/spw-header-navigation-item.css +2 -0
- package/dist/collection/components/spw-header/spw-header-navigation-item/spw-header-navigation-item.js +193 -0
- package/dist/collection/components/spw-header/spw-header-navigation-item/spw-header-navigation-item.js.map +1 -0
- package/dist/collection/components/spw-header/spw-header-persona/spw-header-persona.css +2 -0
- package/dist/collection/components/spw-header/spw-header-persona/spw-header-persona.js +51 -0
- package/dist/collection/components/spw-header/spw-header-persona/spw-header-persona.js.map +1 -0
- package/dist/collection/components/spw-header/spw-header-persona-item/spw-header-persona-item.css +2 -0
- package/dist/collection/components/spw-header/spw-header-persona-item/spw-header-persona-item.js +44 -0
- package/dist/collection/components/spw-header/spw-header-persona-item/spw-header-persona-item.js.map +1 -0
- package/dist/collection/components/spw-header/spw-header.css +2 -0
- package/dist/collection/components/spw-header/spw-header.js +36 -0
- package/dist/collection/components/spw-header/spw-header.js.map +1 -0
- package/dist/collection/components/spw-icon/assets/LICENSE.txt +165 -0
- package/dist/collection/components/spw-icon/assets/all.css +7913 -0
- package/dist/collection/components/spw-icon/assets/all.min.css +9 -0
- package/dist/collection/components/spw-icon/assets/brands.css +1609 -0
- package/dist/collection/components/spw-icon/assets/brands.min.css +6 -0
- package/dist/collection/components/spw-icon/assets/fa-brands-400.ttf +0 -0
- package/dist/collection/components/spw-icon/assets/fa-brands-400.woff2 +0 -0
- package/dist/collection/components/spw-icon/assets/fa-regular-400.ttf +0 -0
- package/dist/collection/components/spw-icon/assets/fa-regular-400.woff2 +0 -0
- package/dist/collection/components/spw-icon/assets/fa-solid-900.ttf +0 -0
- package/dist/collection/components/spw-icon/assets/fa-solid-900.woff2 +0 -0
- package/dist/collection/components/spw-icon/assets/fa-v4compatibility.ttf +0 -0
- package/dist/collection/components/spw-icon/assets/fa-v4compatibility.woff2 +0 -0
- package/dist/collection/components/spw-icon/assets/fontawesome.css +6243 -0
- package/dist/collection/components/spw-icon/assets/fontawesome.min.css +9 -0
- package/dist/collection/components/spw-icon/assets/regular.css +19 -0
- package/dist/collection/components/spw-icon/assets/regular.min.css +6 -0
- package/dist/collection/components/spw-icon/assets/solid.css +19 -0
- package/dist/collection/components/spw-icon/assets/solid.min.css +6 -0
- package/dist/collection/components/spw-icon/assets/svg-with-js.css +461 -0
- package/dist/collection/components/spw-icon/assets/svg-with-js.min.css +6 -0
- package/dist/collection/components/spw-icon/assets/v4-font-face.css +26 -0
- package/dist/collection/components/spw-icon/assets/v4-font-face.min.css +6 -0
- package/dist/collection/components/spw-icon/assets/v4-shims.css +2194 -0
- package/dist/collection/components/spw-icon/assets/v4-shims.min.css +6 -0
- package/dist/collection/components/spw-icon/assets/v5-font-face.css +22 -0
- package/dist/collection/components/spw-icon/assets/v5-font-face.min.css +6 -0
- package/dist/collection/components/spw-icon/spw-icon.css +10 -0
- package/dist/collection/components/spw-icon/spw-icon.js +64 -0
- package/dist/collection/components/spw-icon/spw-icon.js.map +1 -0
- package/dist/collection/components/spw-iodda/spw-iodda.css +2 -0
- package/dist/collection/components/spw-iodda/spw-iodda.js +113 -0
- package/dist/collection/components/spw-iodda/spw-iodda.js.map +1 -0
- package/dist/collection/components/spw-iodda/spw-iodda.service.js +19 -0
- package/dist/collection/components/spw-iodda/spw-iodda.service.js.map +1 -0
- package/dist/collection/components/spw-link/spw-link.css +2 -0
- package/dist/collection/components/spw-link/spw-link.js +220 -0
- package/dist/collection/components/spw-link/spw-link.js.map +1 -0
- package/dist/collection/components/spw-loading/spw-loading.css +2 -0
- package/dist/collection/components/spw-loading/spw-loading.js +44 -0
- package/dist/collection/components/spw-loading/spw-loading.js.map +1 -0
- package/dist/collection/components/spw-message/spw-message.css +2 -0
- package/dist/collection/components/spw-message/spw-message.js +141 -0
- package/dist/collection/components/spw-message/spw-message.js.map +1 -0
- package/dist/collection/components/spw-message/utils.js +27 -0
- package/dist/collection/components/spw-modal/spw-modal.css +2 -0
- package/dist/collection/components/spw-modal/spw-modal.js +361 -0
- package/dist/collection/components/spw-modal/spw-modal.js.map +1 -0
- package/dist/collection/components/spw-mosaic/spw-mosaic-item/spw-mosaic-item.css +2 -0
- package/dist/collection/components/spw-mosaic/spw-mosaic-item/spw-mosaic-item.js +40 -0
- package/dist/collection/components/spw-mosaic/spw-mosaic-item/spw-mosaic-item.js.map +1 -0
- package/dist/collection/components/spw-mosaic/spw-mosaic.css +2 -0
- package/dist/collection/components/spw-mosaic/spw-mosaic.js +301 -0
- package/dist/collection/components/spw-mosaic/spw-mosaic.js.map +1 -0
- package/dist/collection/components/spw-pagination/spw-pagination.css +2 -0
- package/dist/collection/components/spw-pagination/spw-pagination.js +305 -0
- package/dist/collection/components/spw-pagination/spw-pagination.js.map +1 -0
- package/dist/collection/components/spw-radio/spw-radio.css +2 -0
- package/dist/collection/components/spw-radio/spw-radio.js +248 -0
- package/dist/collection/components/spw-radio/spw-radio.js.map +1 -0
- package/dist/collection/components/spw-search-field/spw-search-field.css +2 -0
- package/dist/collection/components/spw-search-field/spw-search-field.js +287 -0
- package/dist/collection/components/spw-search-field/spw-search-field.js.map +1 -0
- package/dist/collection/components/spw-select/spw-select.css +2 -0
- package/dist/collection/components/spw-select/spw-select.js +374 -0
- package/dist/collection/components/spw-select/spw-select.js.map +1 -0
- package/dist/collection/components/spw-separator/spw-separator.css +2 -0
- package/dist/collection/components/spw-separator/spw-separator.js +134 -0
- package/dist/collection/components/spw-separator/spw-separator.js.map +1 -0
- package/dist/collection/components/spw-table/spw-table-body/spw-table-body.css +2 -0
- package/dist/collection/components/spw-table/spw-table-body/spw-table-body.js +19 -0
- package/dist/collection/components/spw-table/spw-table-body/spw-table-body.js.map +1 -0
- package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.css +2 -0
- package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.js +159 -0
- package/dist/collection/components/spw-table/spw-table-cell/spw-table-cell.js.map +1 -0
- package/dist/collection/components/spw-table/spw-table-head/spw-table-head.css +2 -0
- package/dist/collection/components/spw-table/spw-table-head/spw-table-head.js +19 -0
- package/dist/collection/components/spw-table/spw-table-head/spw-table-head.js.map +1 -0
- package/dist/collection/components/spw-table/spw-table-header/spw-table-header.css +2 -0
- package/dist/collection/components/spw-table/spw-table-header/spw-table-header.js +158 -0
- package/dist/collection/components/spw-table/spw-table-header/spw-table-header.js.map +1 -0
- package/dist/collection/components/spw-table/spw-table-row/spw-table-row.css +2 -0
- package/dist/collection/components/spw-table/spw-table-row/spw-table-row.js +19 -0
- package/dist/collection/components/spw-table/spw-table-row/spw-table-row.js.map +1 -0
- package/dist/collection/components/spw-table/spw-table.css +2 -0
- package/dist/collection/components/spw-table/spw-table.js +115 -0
- package/dist/collection/components/spw-table/spw-table.js.map +1 -0
- package/dist/collection/components/spw-text-field/spw-text-field.css +2 -0
- package/dist/collection/components/spw-text-field/spw-text-field.js +480 -0
- package/dist/collection/components/spw-text-field/spw-text-field.js.map +1 -0
- package/dist/collection/components/spw-textarea/spw-textarea.css +2 -0
- package/dist/collection/components/spw-textarea/spw-textarea.js +450 -0
- package/dist/collection/components/spw-textarea/spw-textarea.js.map +1 -0
- package/dist/collection/components/spw-theme-provider/spw-theme-provider.js +59 -0
- package/dist/collection/components/spw-theme-provider/spw-theme-provider.js.map +1 -0
- package/dist/collection/components/spw-tooltip/spw-tooltip.css +2 -0
- package/dist/collection/components/spw-tooltip/spw-tooltip.js +100 -0
- package/dist/collection/components/spw-tooltip/spw-tooltip.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/stories/assets/accessibility.svg +5 -0
- package/dist/collection/stories/assets/discord.svg +15 -0
- package/dist/collection/stories/assets/github.svg +3 -0
- package/dist/collection/stories/assets/logo.svg +18 -0
- package/dist/collection/stories/assets/tutorials.svg +12 -0
- package/dist/collection/stories/assets/youtube.svg +4 -0
- package/dist/collection/stories/components/spw-accordion/spw-accordion.stories.js +72 -0
- package/dist/collection/stories/components/spw-accordion/spw-accordion.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-breadcrumb/spw-breadcrumb.stories.js +66 -0
- package/dist/collection/stories/components/spw-breadcrumb/spw-breadcrumb.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-button/spw-button.stories.js +74 -0
- package/dist/collection/stories/components/spw-button/spw-button.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-card/spw-card.stories.js +183 -0
- package/dist/collection/stories/components/spw-card/spw-card.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-checkbox/spw-checkbox.stories.js +61 -0
- package/dist/collection/stories/components/spw-checkbox/spw-checkbox.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-cookies/spw-cookies.stories.js +56 -0
- package/dist/collection/stories/components/spw-cookies/spw-cookies.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-field-message/spw-field-message.stories.js +67 -0
- package/dist/collection/stories/components/spw-field-message/spw-field-message.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-file-upload/spw-file-upload.stories.js +53 -0
- package/dist/collection/stories/components/spw-file-upload/spw-file-upload.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-footer/spw-footer.stories.js +126 -0
- package/dist/collection/stories/components/spw-footer/spw-footer.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-group/spw-group.stories.js +81 -0
- package/dist/collection/stories/components/spw-group/spw-group.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-header/spw-header.stories.js +135 -0
- package/dist/collection/stories/components/spw-header/spw-header.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-icon/spw-icon.stories.js +54 -0
- package/dist/collection/stories/components/spw-icon/spw-icon.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-link/spw-link.stories.js +66 -0
- package/dist/collection/stories/components/spw-link/spw-link.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-loading/spw-loading.stories.js +58 -0
- package/dist/collection/stories/components/spw-loading/spw-loading.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-message/spw-message.stories.js +67 -0
- package/dist/collection/stories/components/spw-message/spw-message.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-modal/spw-modal.stories.js +111 -0
- package/dist/collection/stories/components/spw-modal/spw-modal.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-mosaic/spw-mosaic.stories.js +146 -0
- package/dist/collection/stories/components/spw-mosaic/spw-mosaic.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-pagination/spw-pagination.stories.js +93 -0
- package/dist/collection/stories/components/spw-pagination/spw-pagination.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-radio/spw-radio.stories.js +62 -0
- package/dist/collection/stories/components/spw-radio/spw-radio.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-search-field/spw-search-field.stories.js +60 -0
- package/dist/collection/stories/components/spw-search-field/spw-search-field.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-select/spw-select.stories.js +65 -0
- package/dist/collection/stories/components/spw-select/spw-select.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-separator/spw-separator.stories.js +63 -0
- package/dist/collection/stories/components/spw-separator/spw-separator.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-table/spw-table.stories.js +103 -0
- package/dist/collection/stories/components/spw-table/spw-table.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-text-field/spw-text-field.stories.js +61 -0
- package/dist/collection/stories/components/spw-text-field/spw-text-field.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-textarea/spw-textarea.stories.js +61 -0
- package/dist/collection/stories/components/spw-textarea/spw-textarea.stories.js.map +1 -0
- package/dist/collection/stories/components/spw-tooltip/spw-tooltip.stories.js +58 -0
- package/dist/collection/stories/components/spw-tooltip/spw-tooltip.stories.js.map +1 -0
- package/dist/collection/themes/themes.js +23 -0
- package/dist/collection/themes/themes.js.map +1 -0
- package/dist/collection/utils/animation.js +23 -0
- package/dist/collection/utils/animation.js.map +1 -0
- package/dist/collection/utils/focus-trap.js +113 -0
- package/dist/collection/utils/focus-trap.js.map +1 -0
- package/dist/collection/utils/utils.js +224 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/p-0e197bb5.js +231 -0
- package/dist/components/p-0e197bb5.js.map +1 -0
- package/dist/components/p-1808c8c6.js +81 -0
- package/dist/components/p-1808c8c6.js.map +1 -0
- package/dist/components/p-3706b88e.js +1816 -0
- package/dist/components/p-3706b88e.js.map +1 -0
- package/dist/components/p-70d767cd.js +19 -0
- package/dist/components/p-70d767cd.js.map +1 -0
- package/dist/components/p-72ca702e.js +40 -0
- package/dist/components/p-72ca702e.js.map +1 -0
- package/dist/components/p-89cf5afe.js +138 -0
- package/dist/components/p-89cf5afe.js.map +1 -0
- package/dist/components/p-987e354f.js +123 -0
- package/dist/components/p-987e354f.js.map +1 -0
- package/dist/components/p-a9181b0a.js +46 -0
- package/dist/components/p-a9181b0a.js.map +1 -0
- package/dist/components/p-b3b66a09.js +48 -0
- package/dist/components/p-b3b66a09.js.map +1 -0
- package/dist/components/p-cb0eb249.js +36 -0
- package/dist/components/p-cb0eb249.js.map +1 -0
- package/dist/components/p-cb99b731.js +153 -0
- package/dist/components/p-cb99b731.js.map +1 -0
- package/dist/components/p-def4fee9.js +33 -0
- package/dist/components/p-def4fee9.js.map +1 -0
- package/dist/components/p-e37034cf.js +143 -0
- package/dist/components/p-e37034cf.js.map +1 -0
- package/dist/components/p-e70f2b83.js +62 -0
- package/dist/components/p-e70f2b83.js.map +1 -0
- package/dist/components/p-f48f06ae.js +91 -0
- package/dist/components/p-f48f06ae.js.map +1 -0
- package/dist/components/spw-accordion-content.d.ts +11 -0
- package/dist/components/spw-accordion-content.js +8 -0
- package/dist/components/spw-accordion-content.js.map +1 -0
- package/dist/components/spw-accordion-item.d.ts +11 -0
- package/dist/components/spw-accordion-item.js +8 -0
- package/dist/components/spw-accordion-item.js.map +1 -0
- package/dist/components/spw-accordion-title.d.ts +11 -0
- package/dist/components/spw-accordion-title.js +8 -0
- package/dist/components/spw-accordion-title.js.map +1 -0
- package/dist/components/spw-accordion.d.ts +11 -0
- package/dist/components/spw-accordion.js +8 -0
- package/dist/components/spw-accordion.js.map +1 -0
- package/dist/components/spw-breadcrumb-item.d.ts +11 -0
- package/dist/components/spw-breadcrumb-item.js +85 -0
- package/dist/components/spw-breadcrumb-item.js.map +1 -0
- package/dist/components/spw-breadcrumb.d.ts +11 -0
- package/dist/components/spw-breadcrumb.js +75 -0
- package/dist/components/spw-breadcrumb.js.map +1 -0
- package/dist/components/spw-button.d.ts +11 -0
- package/dist/components/spw-button.js +8 -0
- package/dist/components/spw-button.js.map +1 -0
- package/dist/components/spw-card-content.d.ts +11 -0
- package/dist/components/spw-card-content.js +45 -0
- package/dist/components/spw-card-content.js.map +1 -0
- package/dist/components/spw-card-excerpt.d.ts +11 -0
- package/dist/components/spw-card-excerpt.js +47 -0
- package/dist/components/spw-card-excerpt.js.map +1 -0
- package/dist/components/spw-card-image.d.ts +11 -0
- package/dist/components/spw-card-image.js +64 -0
- package/dist/components/spw-card-image.js.map +1 -0
- package/dist/components/spw-card-subtag-item.d.ts +11 -0
- package/dist/components/spw-card-subtag-item.js +50 -0
- package/dist/components/spw-card-subtag-item.js.map +1 -0
- package/dist/components/spw-card-subtags.d.ts +11 -0
- package/dist/components/spw-card-subtags.js +57 -0
- package/dist/components/spw-card-subtags.js.map +1 -0
- package/dist/components/spw-card-title.d.ts +11 -0
- package/dist/components/spw-card-title.js +36 -0
- package/dist/components/spw-card-title.js.map +1 -0
- package/dist/components/spw-card.d.ts +11 -0
- package/dist/components/spw-card.js +136 -0
- package/dist/components/spw-card.js.map +1 -0
- package/dist/components/spw-checkbox.d.ts +11 -0
- package/dist/components/spw-checkbox.js +8 -0
- package/dist/components/spw-checkbox.js.map +1 -0
- package/dist/components/spw-cookies.d.ts +11 -0
- package/dist/components/spw-cookies.js +148 -0
- package/dist/components/spw-cookies.js.map +1 -0
- package/dist/components/spw-custom-select.d.ts +11 -0
- package/dist/components/spw-custom-select.js +407 -0
- package/dist/components/spw-custom-select.js.map +1 -0
- package/dist/components/spw-field-label.d.ts +11 -0
- package/dist/components/spw-field-label.js +8 -0
- package/dist/components/spw-field-label.js.map +1 -0
- package/dist/components/spw-field-message.d.ts +11 -0
- package/dist/components/spw-field-message.js +8 -0
- package/dist/components/spw-field-message.js.map +1 -0
- package/dist/components/spw-file-upload.d.ts +11 -0
- package/dist/components/spw-file-upload.js +238 -0
- package/dist/components/spw-file-upload.js.map +1 -0
- package/dist/components/spw-footer-bottom.d.ts +11 -0
- package/dist/components/spw-footer-bottom.js +39 -0
- package/dist/components/spw-footer-bottom.js.map +1 -0
- package/dist/components/spw-footer-content-col.d.ts +11 -0
- package/dist/components/spw-footer-content-col.js +39 -0
- package/dist/components/spw-footer-content-col.js.map +1 -0
- package/dist/components/spw-footer-content.d.ts +11 -0
- package/dist/components/spw-footer-content.js +49 -0
- package/dist/components/spw-footer-content.js.map +1 -0
- package/dist/components/spw-footer-link.d.ts +11 -0
- package/dist/components/spw-footer-link.js +41 -0
- package/dist/components/spw-footer-link.js.map +1 -0
- package/dist/components/spw-footer-socials.d.ts +11 -0
- package/dist/components/spw-footer-socials.js +36 -0
- package/dist/components/spw-footer-socials.js.map +1 -0
- package/dist/components/spw-footer.d.ts +11 -0
- package/dist/components/spw-footer.js +71 -0
- package/dist/components/spw-footer.js.map +1 -0
- package/dist/components/spw-group.d.ts +11 -0
- package/dist/components/spw-group.js +82 -0
- package/dist/components/spw-group.js.map +1 -0
- package/dist/components/spw-header-lang-item.d.ts +11 -0
- package/dist/components/spw-header-lang-item.js +39 -0
- package/dist/components/spw-header-lang-item.js.map +1 -0
- package/dist/components/spw-header-lang.d.ts +11 -0
- package/dist/components/spw-header-lang.js +70 -0
- package/dist/components/spw-header-lang.js.map +1 -0
- package/dist/components/spw-header-navigation-dropdown.d.ts +11 -0
- package/dist/components/spw-header-navigation-dropdown.js +36 -0
- package/dist/components/spw-header-navigation-dropdown.js.map +1 -0
- package/dist/components/spw-header-navigation-item.d.ts +11 -0
- package/dist/components/spw-header-navigation-item.js +168 -0
- package/dist/components/spw-header-navigation-item.js.map +1 -0
- package/dist/components/spw-header-navigation.d.ts +11 -0
- package/dist/components/spw-header-navigation.js +79 -0
- package/dist/components/spw-header-navigation.js.map +1 -0
- package/dist/components/spw-header-persona-item.d.ts +11 -0
- package/dist/components/spw-header-persona-item.js +39 -0
- package/dist/components/spw-header-persona-item.js.map +1 -0
- package/dist/components/spw-header-persona.d.ts +11 -0
- package/dist/components/spw-header-persona.js +69 -0
- package/dist/components/spw-header-persona.js.map +1 -0
- package/dist/components/spw-header.d.ts +11 -0
- package/dist/components/spw-header.js +60 -0
- package/dist/components/spw-header.js.map +1 -0
- package/dist/components/spw-icon.d.ts +11 -0
- package/dist/components/spw-icon.js +8 -0
- package/dist/components/spw-icon.js.map +1 -0
- package/dist/components/spw-iodda.d.ts +11 -0
- package/dist/components/spw-iodda.js +179 -0
- package/dist/components/spw-iodda.js.map +1 -0
- package/dist/components/spw-link.d.ts +11 -0
- package/dist/components/spw-link.js +8 -0
- package/dist/components/spw-link.js.map +1 -0
- package/dist/components/spw-loading.d.ts +11 -0
- package/dist/components/spw-loading.js +8 -0
- package/dist/components/spw-loading.js.map +1 -0
- package/dist/components/spw-message.d.ts +11 -0
- package/dist/components/spw-message.js +104 -0
- package/dist/components/spw-message.js.map +1 -0
- package/dist/components/spw-modal.d.ts +11 -0
- package/dist/components/spw-modal.js +324 -0
- package/dist/components/spw-modal.js.map +1 -0
- package/dist/components/spw-mosaic-item.d.ts +11 -0
- package/dist/components/spw-mosaic-item.js +52 -0
- package/dist/components/spw-mosaic-item.js.map +1 -0
- package/dist/components/spw-mosaic.d.ts +11 -0
- package/dist/components/spw-mosaic.js +2507 -0
- package/dist/components/spw-mosaic.js.map +1 -0
- package/dist/components/spw-pagination.d.ts +11 -0
- package/dist/components/spw-pagination.js +8 -0
- package/dist/components/spw-pagination.js.map +1 -0
- package/dist/components/spw-radio.d.ts +11 -0
- package/dist/components/spw-radio.js +131 -0
- package/dist/components/spw-radio.js.map +1 -0
- package/dist/components/spw-search-field.d.ts +11 -0
- package/dist/components/spw-search-field.js +203 -0
- package/dist/components/spw-search-field.js.map +1 -0
- package/dist/components/spw-select.d.ts +11 -0
- package/dist/components/spw-select.js +149 -0
- package/dist/components/spw-select.js.map +1 -0
- package/dist/components/spw-separator.d.ts +11 -0
- package/dist/components/spw-separator.js +61 -0
- package/dist/components/spw-separator.js.map +1 -0
- package/dist/components/spw-table-body.d.ts +11 -0
- package/dist/components/spw-table-body.js +36 -0
- package/dist/components/spw-table-body.js.map +1 -0
- package/dist/components/spw-table-cell.d.ts +11 -0
- package/dist/components/spw-table-cell.js +57 -0
- package/dist/components/spw-table-cell.js.map +1 -0
- package/dist/components/spw-table-head.d.ts +11 -0
- package/dist/components/spw-table-head.js +36 -0
- package/dist/components/spw-table-head.js.map +1 -0
- package/dist/components/spw-table-header.d.ts +11 -0
- package/dist/components/spw-table-header.js +56 -0
- package/dist/components/spw-table-header.js.map +1 -0
- package/dist/components/spw-table-row.d.ts +11 -0
- package/dist/components/spw-table-row.js +36 -0
- package/dist/components/spw-table-row.js.map +1 -0
- package/dist/components/spw-table.d.ts +11 -0
- package/dist/components/spw-table.js +61 -0
- package/dist/components/spw-table.js.map +1 -0
- package/dist/components/spw-text-field.d.ts +11 -0
- package/dist/components/spw-text-field.js +8 -0
- package/dist/components/spw-text-field.js.map +1 -0
- package/dist/components/spw-textarea.d.ts +11 -0
- package/dist/components/spw-textarea.js +143 -0
- package/dist/components/spw-textarea.js.map +1 -0
- package/dist/components/spw-theme-provider.d.ts +11 -0
- package/dist/components/spw-theme-provider.js +96 -0
- package/dist/components/spw-theme-provider.js.map +1 -0
- package/dist/components/spw-tooltip.d.ts +11 -0
- package/dist/components/spw-tooltip.js +57 -0
- package/dist/components/spw-tooltip.js.map +1 -0
- package/dist/components_json.d.ts +435 -0
- package/dist/components_json.json +7153 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/index-080912e4.js +1926 -0
- package/dist/esm/index-080912e4.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +13 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/spw-accordion_58.entry.js +5894 -0
- package/dist/esm/spw-accordion_58.entry.js.map +1 -0
- package/dist/esm/spw-stencil-library.js +22 -0
- package/dist/esm/spw-stencil-library.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/spw-stencil-library/assets/LICENSE.txt +165 -0
- package/dist/spw-stencil-library/assets/all.css +7913 -0
- package/dist/spw-stencil-library/assets/all.min.css +9 -0
- package/dist/spw-stencil-library/assets/brands.css +1609 -0
- package/dist/spw-stencil-library/assets/brands.min.css +6 -0
- package/dist/spw-stencil-library/assets/fa-brands-400.ttf +0 -0
- package/dist/spw-stencil-library/assets/fa-brands-400.woff2 +0 -0
- package/dist/spw-stencil-library/assets/fa-regular-400.ttf +0 -0
- package/dist/spw-stencil-library/assets/fa-regular-400.woff2 +0 -0
- package/dist/spw-stencil-library/assets/fa-solid-900.ttf +0 -0
- package/dist/spw-stencil-library/assets/fa-solid-900.woff2 +0 -0
- package/dist/spw-stencil-library/assets/fa-v4compatibility.ttf +0 -0
- package/dist/spw-stencil-library/assets/fa-v4compatibility.woff2 +0 -0
- package/dist/spw-stencil-library/assets/fontawesome.css +6243 -0
- package/dist/spw-stencil-library/assets/fontawesome.min.css +9 -0
- package/dist/spw-stencil-library/assets/regular.css +19 -0
- package/dist/spw-stencil-library/assets/regular.min.css +6 -0
- package/dist/spw-stencil-library/assets/solid.css +19 -0
- package/dist/spw-stencil-library/assets/solid.min.css +6 -0
- package/dist/spw-stencil-library/assets/svg-with-js.css +461 -0
- package/dist/spw-stencil-library/assets/svg-with-js.min.css +6 -0
- package/dist/spw-stencil-library/assets/v4-font-face.css +26 -0
- package/dist/spw-stencil-library/assets/v4-font-face.min.css +6 -0
- package/dist/spw-stencil-library/assets/v4-shims.css +2194 -0
- package/dist/spw-stencil-library/assets/v4-shims.min.css +6 -0
- package/dist/spw-stencil-library/assets/v5-font-face.css +22 -0
- package/dist/spw-stencil-library/assets/v5-font-face.min.css +6 -0
- package/dist/spw-stencil-library/index.esm.js +2 -0
- package/dist/spw-stencil-library/index.esm.js.map +1 -0
- package/dist/spw-stencil-library/p-205fd6a4.js +3 -0
- package/dist/spw-stencil-library/p-205fd6a4.js.map +1 -0
- package/dist/spw-stencil-library/p-d3d3de91.entry.js +19 -0
- package/dist/spw-stencil-library/p-d3d3de91.entry.js.map +1 -0
- package/dist/spw-stencil-library/p-e1255160.js +2 -0
- package/dist/spw-stencil-library/p-e1255160.js.map +1 -0
- package/dist/spw-stencil-library/spw-stencil-library.css +1 -0
- package/dist/spw-stencil-library/spw-stencil-library.esm.js +2 -0
- package/dist/spw-stencil-library/spw-stencil-library.esm.js.map +1 -0
- package/dist/stats.json +19725 -0
- package/dist/types/components/spw-accordion/spw-accordion-content/spw-accordion-content.d.ts +16 -0
- package/dist/types/components/spw-accordion/spw-accordion-item/spw-accordion-item.d.ts +25 -0
- package/dist/types/components/spw-accordion/spw-accordion-title/spw-accordion-title.d.ts +7 -0
- package/dist/types/components/spw-accordion/spw-accordion.d.ts +3 -0
- package/dist/types/components/spw-breadcrumb/spw-breadcrumb-item/spw-breadcrumb-item.d.ts +11 -0
- package/dist/types/components/spw-breadcrumb/spw-breadcrumb.d.ts +13 -0
- package/dist/types/components/spw-button/spw-button.d.ts +48 -0
- package/dist/types/components/spw-card/spw-card-content/spw-card-content.d.ts +9 -0
- package/dist/types/components/spw-card/spw-card-excerpt/spw-card-excerpt.d.ts +6 -0
- package/dist/types/components/spw-card/spw-card-image/spw-card-image.d.ts +8 -0
- package/dist/types/components/spw-card/spw-card-subtag-item/spw-card-subtag-item.d.ts +7 -0
- package/dist/types/components/spw-card/spw-card-subtags/spw-card-subtags.d.ts +9 -0
- package/dist/types/components/spw-card/spw-card-title/spw-card-title.d.ts +3 -0
- package/dist/types/components/spw-card/spw-card.d.ts +34 -0
- package/dist/types/components/spw-checkbox/spw-checkbox.d.ts +30 -0
- package/dist/types/components/spw-cookies/spw-cookies.d.ts +21 -0
- package/dist/types/components/spw-custom-select/spw-custom-select.d.ts +79 -0
- package/dist/types/components/spw-field-label/spw-field-label.d.ts +11 -0
- package/dist/types/components/spw-field-message/spw-field-message.d.ts +9 -0
- package/dist/types/components/spw-file-upload/spw-file-upload.d.ts +53 -0
- package/dist/types/components/spw-footer/spw-footer-bottom/spw-footer-bottom.d.ts +5 -0
- package/dist/types/components/spw-footer/spw-footer-content/spw-footer-content.d.ts +7 -0
- package/dist/types/components/spw-footer/spw-footer-content-col/spw-footer-content-col.d.ts +5 -0
- package/dist/types/components/spw-footer/spw-footer-link/spw-footer-link.d.ts +7 -0
- package/dist/types/components/spw-footer/spw-footer-socials/spw-footer-socials.d.ts +3 -0
- package/dist/types/components/spw-footer/spw-footer.d.ts +13 -0
- package/dist/types/components/spw-group/spw-group.d.ts +22 -0
- package/dist/types/components/spw-header/spw-header-lang/spw-header-lang.d.ts +8 -0
- package/dist/types/components/spw-header/spw-header-lang-item/spw-header-lang-item.d.ts +4 -0
- package/dist/types/components/spw-header/spw-header-navigation/spw-header-navigation.d.ts +12 -0
- package/dist/types/components/spw-header/spw-header-navigation-dropdown/spw-header-navigation-dropdown.d.ts +3 -0
- package/dist/types/components/spw-header/spw-header-navigation-item/spw-header-navigation-item.d.ts +26 -0
- package/dist/types/components/spw-header/spw-header-persona/spw-header-persona.d.ts +10 -0
- package/dist/types/components/spw-header/spw-header-persona-item/spw-header-persona-item.d.ts +4 -0
- package/dist/types/components/spw-header/spw-header.d.ts +6 -0
- package/dist/types/components/spw-icon/spw-icon.d.ts +7 -0
- package/dist/types/components/spw-iodda/spw-iodda.d.ts +19 -0
- package/dist/types/components/spw-iodda/spw-iodda.service.d.ts +1 -0
- package/dist/types/components/spw-link/spw-link.d.ts +25 -0
- package/dist/types/components/spw-loading/spw-loading.d.ts +5 -0
- package/dist/types/components/spw-message/spw-message.d.ts +18 -0
- package/dist/types/components/spw-modal/spw-modal.d.ts +53 -0
- package/dist/types/components/spw-mosaic/spw-mosaic-item/spw-mosaic-item.d.ts +8 -0
- package/dist/types/components/spw-mosaic/spw-mosaic.d.ts +31 -0
- package/dist/types/components/spw-pagination/spw-pagination.d.ts +30 -0
- package/dist/types/components/spw-radio/spw-radio.d.ts +35 -0
- package/dist/types/components/spw-search-field/spw-search-field.d.ts +39 -0
- package/dist/types/components/spw-select/spw-select.d.ts +48 -0
- package/dist/types/components/spw-separator/spw-separator.d.ts +15 -0
- package/dist/types/components/spw-table/spw-table-body/spw-table-body.d.ts +3 -0
- package/dist/types/components/spw-table/spw-table-cell/spw-table-cell.d.ts +16 -0
- package/dist/types/components/spw-table/spw-table-head/spw-table-head.d.ts +3 -0
- package/dist/types/components/spw-table/spw-table-header/spw-table-header.d.ts +16 -0
- package/dist/types/components/spw-table/spw-table-row/spw-table-row.d.ts +3 -0
- package/dist/types/components/spw-table/spw-table.d.ts +23 -0
- package/dist/types/components/spw-text-field/spw-text-field.d.ts +57 -0
- package/dist/types/components/spw-textarea/spw-textarea.d.ts +53 -0
- package/dist/types/components/spw-theme-provider/spw-theme-provider.d.ts +10 -0
- package/dist/types/components/spw-tooltip/spw-tooltip.d.ts +13 -0
- package/dist/types/components.d.ts +2793 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1678 -0
- package/dist/types/stories/components/spw-accordion/spw-accordion.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-breadcrumb/spw-breadcrumb.stories.d.ts +5 -0
- package/dist/types/stories/components/spw-button/spw-button.stories.d.ts +7 -0
- package/dist/types/stories/components/spw-card/spw-card.stories.d.ts +10 -0
- package/dist/types/stories/components/spw-checkbox/spw-checkbox.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-cookies/spw-cookies.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-field-message/spw-field-message.stories.d.ts +6 -0
- package/dist/types/stories/components/spw-file-upload/spw-file-upload.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-footer/spw-footer.stories.d.ts +5 -0
- package/dist/types/stories/components/spw-group/spw-group.stories.d.ts +6 -0
- package/dist/types/stories/components/spw-header/spw-header.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-icon/spw-icon.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-link/spw-link.stories.d.ts +5 -0
- package/dist/types/stories/components/spw-loading/spw-loading.stories.d.ts +5 -0
- package/dist/types/stories/components/spw-message/spw-message.stories.d.ts +8 -0
- package/dist/types/stories/components/spw-modal/spw-modal.stories.d.ts +8 -0
- package/dist/types/stories/components/spw-mosaic/spw-mosaic.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-pagination/spw-pagination.stories.d.ts +22 -0
- package/dist/types/stories/components/spw-radio/spw-radio.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-search-field/spw-search-field.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-select/spw-select.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-separator/spw-separator.stories.d.ts +5 -0
- package/dist/types/stories/components/spw-table/spw-table.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-text-field/spw-text-field.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-textarea/spw-textarea.stories.d.ts +4 -0
- package/dist/types/stories/components/spw-tooltip/spw-tooltip.stories.d.ts +4 -0
- package/dist/types/themes/themes.d.ts +13 -0
- package/dist/types/utils/animation.d.ts +13 -0
- package/dist/types/utils/focus-trap.d.ts +33 -0
- package/dist/types/utils/utils.d.ts +11 -0
- package/hydrate/index.d.ts +242 -0
- package/hydrate/index.js +24773 -0
- package/hydrate/index.mjs +24765 -0
- package/hydrate/package.json +12 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +88 -0
|
@@ -0,0 +1,2507 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, c as Host } from './p-3706b88e.js';
|
|
2
|
+
|
|
3
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
|
+
|
|
5
|
+
var masonry = {exports: {}};
|
|
6
|
+
|
|
7
|
+
var outlayer = {exports: {}};
|
|
8
|
+
|
|
9
|
+
var evEmitter = {exports: {}};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* EvEmitter v1.1.0
|
|
13
|
+
* Lil' event emitter
|
|
14
|
+
* MIT License
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
(function (module) {
|
|
18
|
+
/* jshint unused: true, undef: true, strict: true */
|
|
19
|
+
|
|
20
|
+
( function( global, factory ) {
|
|
21
|
+
// universal module definition
|
|
22
|
+
/* jshint strict: false */ /* globals define, module, window */
|
|
23
|
+
if ( module.exports ) {
|
|
24
|
+
// CommonJS - Browserify, Webpack
|
|
25
|
+
module.exports = factory();
|
|
26
|
+
} else {
|
|
27
|
+
// Browser globals
|
|
28
|
+
global.EvEmitter = factory();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}( typeof window != 'undefined' ? window : commonjsGlobal, function() {
|
|
32
|
+
|
|
33
|
+
function EvEmitter() {}
|
|
34
|
+
|
|
35
|
+
var proto = EvEmitter.prototype;
|
|
36
|
+
|
|
37
|
+
proto.on = function( eventName, listener ) {
|
|
38
|
+
if ( !eventName || !listener ) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// set events hash
|
|
42
|
+
var events = this._events = this._events || {};
|
|
43
|
+
// set listeners array
|
|
44
|
+
var listeners = events[ eventName ] = events[ eventName ] || [];
|
|
45
|
+
// only add once
|
|
46
|
+
if ( listeners.indexOf( listener ) == -1 ) {
|
|
47
|
+
listeners.push( listener );
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return this;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
proto.once = function( eventName, listener ) {
|
|
54
|
+
if ( !eventName || !listener ) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// add event
|
|
58
|
+
this.on( eventName, listener );
|
|
59
|
+
// set once flag
|
|
60
|
+
// set onceEvents hash
|
|
61
|
+
var onceEvents = this._onceEvents = this._onceEvents || {};
|
|
62
|
+
// set onceListeners object
|
|
63
|
+
var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
|
|
64
|
+
// set flag
|
|
65
|
+
onceListeners[ listener ] = true;
|
|
66
|
+
|
|
67
|
+
return this;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
proto.off = function( eventName, listener ) {
|
|
71
|
+
var listeners = this._events && this._events[ eventName ];
|
|
72
|
+
if ( !listeners || !listeners.length ) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
var index = listeners.indexOf( listener );
|
|
76
|
+
if ( index != -1 ) {
|
|
77
|
+
listeners.splice( index, 1 );
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return this;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
proto.emitEvent = function( eventName, args ) {
|
|
84
|
+
var listeners = this._events && this._events[ eventName ];
|
|
85
|
+
if ( !listeners || !listeners.length ) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
// copy over to avoid interference if .off() in listener
|
|
89
|
+
listeners = listeners.slice(0);
|
|
90
|
+
args = args || [];
|
|
91
|
+
// once stuff
|
|
92
|
+
var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
|
|
93
|
+
|
|
94
|
+
for ( var i=0; i < listeners.length; i++ ) {
|
|
95
|
+
var listener = listeners[i];
|
|
96
|
+
var isOnce = onceListeners && onceListeners[ listener ];
|
|
97
|
+
if ( isOnce ) {
|
|
98
|
+
// remove listener
|
|
99
|
+
// remove before trigger to prevent recursion
|
|
100
|
+
this.off( eventName, listener );
|
|
101
|
+
// unset once flag
|
|
102
|
+
delete onceListeners[ listener ];
|
|
103
|
+
}
|
|
104
|
+
// trigger listener
|
|
105
|
+
listener.apply( this, args );
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return this;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
proto.allOff = function() {
|
|
112
|
+
delete this._events;
|
|
113
|
+
delete this._onceEvents;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return EvEmitter;
|
|
117
|
+
|
|
118
|
+
}));
|
|
119
|
+
}(evEmitter));
|
|
120
|
+
|
|
121
|
+
var getSize = {exports: {}};
|
|
122
|
+
|
|
123
|
+
/*!
|
|
124
|
+
* getSize v2.0.3
|
|
125
|
+
* measure size of elements
|
|
126
|
+
* MIT license
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
(function (module) {
|
|
130
|
+
/* jshint browser: true, strict: true, undef: true, unused: true */
|
|
131
|
+
/* globals console: false */
|
|
132
|
+
|
|
133
|
+
( function( window, factory ) {
|
|
134
|
+
/* jshint strict: false */ /* globals define, module */
|
|
135
|
+
if ( module.exports ) {
|
|
136
|
+
// CommonJS
|
|
137
|
+
module.exports = factory();
|
|
138
|
+
} else {
|
|
139
|
+
// browser global
|
|
140
|
+
window.getSize = factory();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
})( window, function factory() {
|
|
144
|
+
|
|
145
|
+
// -------------------------- helpers -------------------------- //
|
|
146
|
+
|
|
147
|
+
// get a number from a string, not a percentage
|
|
148
|
+
function getStyleSize( value ) {
|
|
149
|
+
var num = parseFloat( value );
|
|
150
|
+
// not a percent like '100%', and a number
|
|
151
|
+
var isValid = value.indexOf('%') == -1 && !isNaN( num );
|
|
152
|
+
return isValid && num;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function noop() {}
|
|
156
|
+
|
|
157
|
+
var logError = typeof console == 'undefined' ? noop :
|
|
158
|
+
function( message ) {
|
|
159
|
+
console.error( message );
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// -------------------------- measurements -------------------------- //
|
|
163
|
+
|
|
164
|
+
var measurements = [
|
|
165
|
+
'paddingLeft',
|
|
166
|
+
'paddingRight',
|
|
167
|
+
'paddingTop',
|
|
168
|
+
'paddingBottom',
|
|
169
|
+
'marginLeft',
|
|
170
|
+
'marginRight',
|
|
171
|
+
'marginTop',
|
|
172
|
+
'marginBottom',
|
|
173
|
+
'borderLeftWidth',
|
|
174
|
+
'borderRightWidth',
|
|
175
|
+
'borderTopWidth',
|
|
176
|
+
'borderBottomWidth'
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
var measurementsLength = measurements.length;
|
|
180
|
+
|
|
181
|
+
function getZeroSize() {
|
|
182
|
+
var size = {
|
|
183
|
+
width: 0,
|
|
184
|
+
height: 0,
|
|
185
|
+
innerWidth: 0,
|
|
186
|
+
innerHeight: 0,
|
|
187
|
+
outerWidth: 0,
|
|
188
|
+
outerHeight: 0
|
|
189
|
+
};
|
|
190
|
+
for ( var i=0; i < measurementsLength; i++ ) {
|
|
191
|
+
var measurement = measurements[i];
|
|
192
|
+
size[ measurement ] = 0;
|
|
193
|
+
}
|
|
194
|
+
return size;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// -------------------------- getStyle -------------------------- //
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* getStyle, get style of element, check for Firefox bug
|
|
201
|
+
* https://bugzilla.mozilla.org/show_bug.cgi?id=548397
|
|
202
|
+
*/
|
|
203
|
+
function getStyle( elem ) {
|
|
204
|
+
var style = getComputedStyle( elem );
|
|
205
|
+
if ( !style ) {
|
|
206
|
+
logError( 'Style returned ' + style +
|
|
207
|
+
'. Are you running this code in a hidden iframe on Firefox? ' +
|
|
208
|
+
'See https://bit.ly/getsizebug1' );
|
|
209
|
+
}
|
|
210
|
+
return style;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// -------------------------- setup -------------------------- //
|
|
214
|
+
|
|
215
|
+
var isSetup = false;
|
|
216
|
+
|
|
217
|
+
var isBoxSizeOuter;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* setup
|
|
221
|
+
* check isBoxSizerOuter
|
|
222
|
+
* do on first getSize() rather than on page load for Firefox bug
|
|
223
|
+
*/
|
|
224
|
+
function setup() {
|
|
225
|
+
// setup once
|
|
226
|
+
if ( isSetup ) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
isSetup = true;
|
|
230
|
+
|
|
231
|
+
// -------------------------- box sizing -------------------------- //
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Chrome & Safari measure the outer-width on style.width on border-box elems
|
|
235
|
+
* IE11 & Firefox<29 measures the inner-width
|
|
236
|
+
*/
|
|
237
|
+
var div = document.createElement('div');
|
|
238
|
+
div.style.width = '200px';
|
|
239
|
+
div.style.padding = '1px 2px 3px 4px';
|
|
240
|
+
div.style.borderStyle = 'solid';
|
|
241
|
+
div.style.borderWidth = '1px 2px 3px 4px';
|
|
242
|
+
div.style.boxSizing = 'border-box';
|
|
243
|
+
|
|
244
|
+
var body = document.body || document.documentElement;
|
|
245
|
+
body.appendChild( div );
|
|
246
|
+
var style = getStyle( div );
|
|
247
|
+
// round value for browser zoom. desandro/masonry#928
|
|
248
|
+
isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;
|
|
249
|
+
getSize.isBoxSizeOuter = isBoxSizeOuter;
|
|
250
|
+
|
|
251
|
+
body.removeChild( div );
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// -------------------------- getSize -------------------------- //
|
|
255
|
+
|
|
256
|
+
function getSize( elem ) {
|
|
257
|
+
setup();
|
|
258
|
+
|
|
259
|
+
// use querySeletor if elem is string
|
|
260
|
+
if ( typeof elem == 'string' ) {
|
|
261
|
+
elem = document.querySelector( elem );
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// do not proceed on non-objects
|
|
265
|
+
if ( !elem || typeof elem != 'object' || !elem.nodeType ) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
var style = getStyle( elem );
|
|
270
|
+
|
|
271
|
+
// if hidden, everything is 0
|
|
272
|
+
if ( style.display == 'none' ) {
|
|
273
|
+
return getZeroSize();
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
var size = {};
|
|
277
|
+
size.width = elem.offsetWidth;
|
|
278
|
+
size.height = elem.offsetHeight;
|
|
279
|
+
|
|
280
|
+
var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';
|
|
281
|
+
|
|
282
|
+
// get all measurements
|
|
283
|
+
for ( var i=0; i < measurementsLength; i++ ) {
|
|
284
|
+
var measurement = measurements[i];
|
|
285
|
+
var value = style[ measurement ];
|
|
286
|
+
var num = parseFloat( value );
|
|
287
|
+
// any 'auto', 'medium' value will be 0
|
|
288
|
+
size[ measurement ] = !isNaN( num ) ? num : 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
var paddingWidth = size.paddingLeft + size.paddingRight;
|
|
292
|
+
var paddingHeight = size.paddingTop + size.paddingBottom;
|
|
293
|
+
var marginWidth = size.marginLeft + size.marginRight;
|
|
294
|
+
var marginHeight = size.marginTop + size.marginBottom;
|
|
295
|
+
var borderWidth = size.borderLeftWidth + size.borderRightWidth;
|
|
296
|
+
var borderHeight = size.borderTopWidth + size.borderBottomWidth;
|
|
297
|
+
|
|
298
|
+
var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
|
|
299
|
+
|
|
300
|
+
// overwrite width and height if we can get it from style
|
|
301
|
+
var styleWidth = getStyleSize( style.width );
|
|
302
|
+
if ( styleWidth !== false ) {
|
|
303
|
+
size.width = styleWidth +
|
|
304
|
+
// add padding and border unless it's already including it
|
|
305
|
+
( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
var styleHeight = getStyleSize( style.height );
|
|
309
|
+
if ( styleHeight !== false ) {
|
|
310
|
+
size.height = styleHeight +
|
|
311
|
+
// add padding and border unless it's already including it
|
|
312
|
+
( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
size.innerWidth = size.width - ( paddingWidth + borderWidth );
|
|
316
|
+
size.innerHeight = size.height - ( paddingHeight + borderHeight );
|
|
317
|
+
|
|
318
|
+
size.outerWidth = size.width + marginWidth;
|
|
319
|
+
size.outerHeight = size.height + marginHeight;
|
|
320
|
+
|
|
321
|
+
return size;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return getSize;
|
|
325
|
+
|
|
326
|
+
});
|
|
327
|
+
}(getSize));
|
|
328
|
+
|
|
329
|
+
var utils = {exports: {}};
|
|
330
|
+
|
|
331
|
+
var matchesSelector = {exports: {}};
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* matchesSelector v2.0.2
|
|
335
|
+
* matchesSelector( element, '.selector' )
|
|
336
|
+
* MIT license
|
|
337
|
+
*/
|
|
338
|
+
|
|
339
|
+
(function (module) {
|
|
340
|
+
/*jshint browser: true, strict: true, undef: true, unused: true */
|
|
341
|
+
|
|
342
|
+
( function( window, factory ) {
|
|
343
|
+
// universal module definition
|
|
344
|
+
if ( module.exports ) {
|
|
345
|
+
// CommonJS
|
|
346
|
+
module.exports = factory();
|
|
347
|
+
} else {
|
|
348
|
+
// browser global
|
|
349
|
+
window.matchesSelector = factory();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
}( window, function factory() {
|
|
353
|
+
|
|
354
|
+
var matchesMethod = ( function() {
|
|
355
|
+
var ElemProto = window.Element.prototype;
|
|
356
|
+
// check for the standard method name first
|
|
357
|
+
if ( ElemProto.matches ) {
|
|
358
|
+
return 'matches';
|
|
359
|
+
}
|
|
360
|
+
// check un-prefixed
|
|
361
|
+
if ( ElemProto.matchesSelector ) {
|
|
362
|
+
return 'matchesSelector';
|
|
363
|
+
}
|
|
364
|
+
// check vendor prefixes
|
|
365
|
+
var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
|
|
366
|
+
|
|
367
|
+
for ( var i=0; i < prefixes.length; i++ ) {
|
|
368
|
+
var prefix = prefixes[i];
|
|
369
|
+
var method = prefix + 'MatchesSelector';
|
|
370
|
+
if ( ElemProto[ method ] ) {
|
|
371
|
+
return method;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
})();
|
|
375
|
+
|
|
376
|
+
return function matchesSelector( elem, selector ) {
|
|
377
|
+
return elem[ matchesMethod ]( selector );
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
}));
|
|
381
|
+
}(matchesSelector));
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Fizzy UI utils v2.0.7
|
|
385
|
+
* MIT license
|
|
386
|
+
*/
|
|
387
|
+
|
|
388
|
+
(function (module) {
|
|
389
|
+
/*jshint browser: true, undef: true, unused: true, strict: true */
|
|
390
|
+
|
|
391
|
+
( function( window, factory ) {
|
|
392
|
+
// universal module definition
|
|
393
|
+
/*jshint strict: false */ /*globals define, module, require */
|
|
394
|
+
|
|
395
|
+
if ( module.exports ) {
|
|
396
|
+
// CommonJS
|
|
397
|
+
module.exports = factory(
|
|
398
|
+
window,
|
|
399
|
+
matchesSelector.exports
|
|
400
|
+
);
|
|
401
|
+
} else {
|
|
402
|
+
// browser global
|
|
403
|
+
window.fizzyUIUtils = factory(
|
|
404
|
+
window,
|
|
405
|
+
window.matchesSelector
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
}( window, function factory( window, matchesSelector ) {
|
|
410
|
+
|
|
411
|
+
var utils = {};
|
|
412
|
+
|
|
413
|
+
// ----- extend ----- //
|
|
414
|
+
|
|
415
|
+
// extends objects
|
|
416
|
+
utils.extend = function( a, b ) {
|
|
417
|
+
for ( var prop in b ) {
|
|
418
|
+
a[ prop ] = b[ prop ];
|
|
419
|
+
}
|
|
420
|
+
return a;
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
// ----- modulo ----- //
|
|
424
|
+
|
|
425
|
+
utils.modulo = function( num, div ) {
|
|
426
|
+
return ( ( num % div ) + div ) % div;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
// ----- makeArray ----- //
|
|
430
|
+
|
|
431
|
+
var arraySlice = Array.prototype.slice;
|
|
432
|
+
|
|
433
|
+
// turn element or nodeList into an array
|
|
434
|
+
utils.makeArray = function( obj ) {
|
|
435
|
+
if ( Array.isArray( obj ) ) {
|
|
436
|
+
// use object if already an array
|
|
437
|
+
return obj;
|
|
438
|
+
}
|
|
439
|
+
// return empty array if undefined or null. #6
|
|
440
|
+
if ( obj === null || obj === undefined ) {
|
|
441
|
+
return [];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
|
|
445
|
+
if ( isArrayLike ) {
|
|
446
|
+
// convert nodeList to array
|
|
447
|
+
return arraySlice.call( obj );
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// array of single index
|
|
451
|
+
return [ obj ];
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
// ----- removeFrom ----- //
|
|
455
|
+
|
|
456
|
+
utils.removeFrom = function( ary, obj ) {
|
|
457
|
+
var index = ary.indexOf( obj );
|
|
458
|
+
if ( index != -1 ) {
|
|
459
|
+
ary.splice( index, 1 );
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
// ----- getParent ----- //
|
|
464
|
+
|
|
465
|
+
utils.getParent = function( elem, selector ) {
|
|
466
|
+
while ( elem.parentNode && elem != document.body ) {
|
|
467
|
+
elem = elem.parentNode;
|
|
468
|
+
if ( matchesSelector( elem, selector ) ) {
|
|
469
|
+
return elem;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
// ----- getQueryElement ----- //
|
|
475
|
+
|
|
476
|
+
// use element as selector string
|
|
477
|
+
utils.getQueryElement = function( elem ) {
|
|
478
|
+
if ( typeof elem == 'string' ) {
|
|
479
|
+
return document.querySelector( elem );
|
|
480
|
+
}
|
|
481
|
+
return elem;
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
// ----- handleEvent ----- //
|
|
485
|
+
|
|
486
|
+
// enable .ontype to trigger from .addEventListener( elem, 'type' )
|
|
487
|
+
utils.handleEvent = function( event ) {
|
|
488
|
+
var method = 'on' + event.type;
|
|
489
|
+
if ( this[ method ] ) {
|
|
490
|
+
this[ method ]( event );
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
// ----- filterFindElements ----- //
|
|
495
|
+
|
|
496
|
+
utils.filterFindElements = function( elems, selector ) {
|
|
497
|
+
// make array of elems
|
|
498
|
+
elems = utils.makeArray( elems );
|
|
499
|
+
var ffElems = [];
|
|
500
|
+
|
|
501
|
+
elems.forEach( function( elem ) {
|
|
502
|
+
// check that elem is an actual element
|
|
503
|
+
if ( !( elem instanceof HTMLElement ) ) {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
// add elem if no selector
|
|
507
|
+
if ( !selector ) {
|
|
508
|
+
ffElems.push( elem );
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
// filter & find items if we have a selector
|
|
512
|
+
// filter
|
|
513
|
+
if ( matchesSelector( elem, selector ) ) {
|
|
514
|
+
ffElems.push( elem );
|
|
515
|
+
}
|
|
516
|
+
// find children
|
|
517
|
+
var childElems = elem.querySelectorAll( selector );
|
|
518
|
+
// concat childElems to filterFound array
|
|
519
|
+
for ( var i=0; i < childElems.length; i++ ) {
|
|
520
|
+
ffElems.push( childElems[i] );
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
return ffElems;
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
// ----- debounceMethod ----- //
|
|
528
|
+
|
|
529
|
+
utils.debounceMethod = function( _class, methodName, threshold ) {
|
|
530
|
+
threshold = threshold || 100;
|
|
531
|
+
// original method
|
|
532
|
+
var method = _class.prototype[ methodName ];
|
|
533
|
+
var timeoutName = methodName + 'Timeout';
|
|
534
|
+
|
|
535
|
+
_class.prototype[ methodName ] = function() {
|
|
536
|
+
var timeout = this[ timeoutName ];
|
|
537
|
+
clearTimeout( timeout );
|
|
538
|
+
|
|
539
|
+
var args = arguments;
|
|
540
|
+
var _this = this;
|
|
541
|
+
this[ timeoutName ] = setTimeout( function() {
|
|
542
|
+
method.apply( _this, args );
|
|
543
|
+
delete _this[ timeoutName ];
|
|
544
|
+
}, threshold );
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
// ----- docReady ----- //
|
|
549
|
+
|
|
550
|
+
utils.docReady = function( callback ) {
|
|
551
|
+
var readyState = document.readyState;
|
|
552
|
+
if ( readyState == 'complete' || readyState == 'interactive' ) {
|
|
553
|
+
// do async to allow for other scripts to run. metafizzy/flickity#441
|
|
554
|
+
setTimeout( callback );
|
|
555
|
+
} else {
|
|
556
|
+
document.addEventListener( 'DOMContentLoaded', callback );
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
// ----- htmlInit ----- //
|
|
561
|
+
|
|
562
|
+
// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
|
|
563
|
+
utils.toDashed = function( str ) {
|
|
564
|
+
return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
|
|
565
|
+
return $1 + '-' + $2;
|
|
566
|
+
}).toLowerCase();
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
var console = window.console;
|
|
570
|
+
/**
|
|
571
|
+
* allow user to initialize classes via [data-namespace] or .js-namespace class
|
|
572
|
+
* htmlInit( Widget, 'widgetName' )
|
|
573
|
+
* options are parsed from data-namespace-options
|
|
574
|
+
*/
|
|
575
|
+
utils.htmlInit = function( WidgetClass, namespace ) {
|
|
576
|
+
utils.docReady( function() {
|
|
577
|
+
var dashedNamespace = utils.toDashed( namespace );
|
|
578
|
+
var dataAttr = 'data-' + dashedNamespace;
|
|
579
|
+
var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
|
|
580
|
+
var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
|
|
581
|
+
var elems = utils.makeArray( dataAttrElems )
|
|
582
|
+
.concat( utils.makeArray( jsDashElems ) );
|
|
583
|
+
var dataOptionsAttr = dataAttr + '-options';
|
|
584
|
+
var jQuery = window.jQuery;
|
|
585
|
+
|
|
586
|
+
elems.forEach( function( elem ) {
|
|
587
|
+
var attr = elem.getAttribute( dataAttr ) ||
|
|
588
|
+
elem.getAttribute( dataOptionsAttr );
|
|
589
|
+
var options;
|
|
590
|
+
try {
|
|
591
|
+
options = attr && JSON.parse( attr );
|
|
592
|
+
} catch ( error ) {
|
|
593
|
+
// log error, do not initialize
|
|
594
|
+
if ( console ) {
|
|
595
|
+
console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
|
|
596
|
+
': ' + error );
|
|
597
|
+
}
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
// initialize
|
|
601
|
+
var instance = new WidgetClass( elem, options );
|
|
602
|
+
// make available via $().data('namespace')
|
|
603
|
+
if ( jQuery ) {
|
|
604
|
+
jQuery.data( elem, namespace, instance );
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
});
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
// ----- ----- //
|
|
612
|
+
|
|
613
|
+
return utils;
|
|
614
|
+
|
|
615
|
+
}));
|
|
616
|
+
}(utils));
|
|
617
|
+
|
|
618
|
+
var item = {exports: {}};
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Outlayer Item
|
|
622
|
+
*/
|
|
623
|
+
|
|
624
|
+
(function (module) {
|
|
625
|
+
( function( window, factory ) {
|
|
626
|
+
// universal module definition
|
|
627
|
+
/* jshint strict: false */ /* globals define, module, require */
|
|
628
|
+
if ( module.exports ) {
|
|
629
|
+
// CommonJS - Browserify, Webpack
|
|
630
|
+
module.exports = factory(
|
|
631
|
+
evEmitter.exports,
|
|
632
|
+
getSize.exports
|
|
633
|
+
);
|
|
634
|
+
} else {
|
|
635
|
+
// browser global
|
|
636
|
+
window.Outlayer = {};
|
|
637
|
+
window.Outlayer.Item = factory(
|
|
638
|
+
window.EvEmitter,
|
|
639
|
+
window.getSize
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
}( window, function factory( EvEmitter, getSize ) {
|
|
644
|
+
|
|
645
|
+
// ----- helpers ----- //
|
|
646
|
+
|
|
647
|
+
function isEmptyObj( obj ) {
|
|
648
|
+
for ( var prop in obj ) {
|
|
649
|
+
return false;
|
|
650
|
+
}
|
|
651
|
+
prop = null;
|
|
652
|
+
return true;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// -------------------------- CSS3 support -------------------------- //
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
var docElemStyle = document.documentElement.style;
|
|
659
|
+
|
|
660
|
+
var transitionProperty = typeof docElemStyle.transition == 'string' ?
|
|
661
|
+
'transition' : 'WebkitTransition';
|
|
662
|
+
var transformProperty = typeof docElemStyle.transform == 'string' ?
|
|
663
|
+
'transform' : 'WebkitTransform';
|
|
664
|
+
|
|
665
|
+
var transitionEndEvent = {
|
|
666
|
+
WebkitTransition: 'webkitTransitionEnd',
|
|
667
|
+
transition: 'transitionend'
|
|
668
|
+
}[ transitionProperty ];
|
|
669
|
+
|
|
670
|
+
// cache all vendor properties that could have vendor prefix
|
|
671
|
+
var vendorProperties = {
|
|
672
|
+
transform: transformProperty,
|
|
673
|
+
transition: transitionProperty,
|
|
674
|
+
transitionDuration: transitionProperty + 'Duration',
|
|
675
|
+
transitionProperty: transitionProperty + 'Property',
|
|
676
|
+
transitionDelay: transitionProperty + 'Delay'
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
// -------------------------- Item -------------------------- //
|
|
680
|
+
|
|
681
|
+
function Item( element, layout ) {
|
|
682
|
+
if ( !element ) {
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
this.element = element;
|
|
687
|
+
// parent layout class, i.e. Masonry, Isotope, or Packery
|
|
688
|
+
this.layout = layout;
|
|
689
|
+
this.position = {
|
|
690
|
+
x: 0,
|
|
691
|
+
y: 0
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
this._create();
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// inherit EvEmitter
|
|
698
|
+
var proto = Item.prototype = Object.create( EvEmitter.prototype );
|
|
699
|
+
proto.constructor = Item;
|
|
700
|
+
|
|
701
|
+
proto._create = function() {
|
|
702
|
+
// transition objects
|
|
703
|
+
this._transn = {
|
|
704
|
+
ingProperties: {},
|
|
705
|
+
clean: {},
|
|
706
|
+
onEnd: {}
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
this.css({
|
|
710
|
+
position: 'absolute'
|
|
711
|
+
});
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
// trigger specified handler for event type
|
|
715
|
+
proto.handleEvent = function( event ) {
|
|
716
|
+
var method = 'on' + event.type;
|
|
717
|
+
if ( this[ method ] ) {
|
|
718
|
+
this[ method ]( event );
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
proto.getSize = function() {
|
|
723
|
+
this.size = getSize( this.element );
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* apply CSS styles to element
|
|
728
|
+
* @param {Object} style
|
|
729
|
+
*/
|
|
730
|
+
proto.css = function( style ) {
|
|
731
|
+
var elemStyle = this.element.style;
|
|
732
|
+
|
|
733
|
+
for ( var prop in style ) {
|
|
734
|
+
// use vendor property if available
|
|
735
|
+
var supportedProp = vendorProperties[ prop ] || prop;
|
|
736
|
+
elemStyle[ supportedProp ] = style[ prop ];
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
// measure position, and sets it
|
|
741
|
+
proto.getPosition = function() {
|
|
742
|
+
var style = getComputedStyle( this.element );
|
|
743
|
+
var isOriginLeft = this.layout._getOption('originLeft');
|
|
744
|
+
var isOriginTop = this.layout._getOption('originTop');
|
|
745
|
+
var xValue = style[ isOriginLeft ? 'left' : 'right' ];
|
|
746
|
+
var yValue = style[ isOriginTop ? 'top' : 'bottom' ];
|
|
747
|
+
var x = parseFloat( xValue );
|
|
748
|
+
var y = parseFloat( yValue );
|
|
749
|
+
// convert percent to pixels
|
|
750
|
+
var layoutSize = this.layout.size;
|
|
751
|
+
if ( xValue.indexOf('%') != -1 ) {
|
|
752
|
+
x = ( x / 100 ) * layoutSize.width;
|
|
753
|
+
}
|
|
754
|
+
if ( yValue.indexOf('%') != -1 ) {
|
|
755
|
+
y = ( y / 100 ) * layoutSize.height;
|
|
756
|
+
}
|
|
757
|
+
// clean up 'auto' or other non-integer values
|
|
758
|
+
x = isNaN( x ) ? 0 : x;
|
|
759
|
+
y = isNaN( y ) ? 0 : y;
|
|
760
|
+
// remove padding from measurement
|
|
761
|
+
x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight;
|
|
762
|
+
y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom;
|
|
763
|
+
|
|
764
|
+
this.position.x = x;
|
|
765
|
+
this.position.y = y;
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
// set settled position, apply padding
|
|
769
|
+
proto.layoutPosition = function() {
|
|
770
|
+
var layoutSize = this.layout.size;
|
|
771
|
+
var style = {};
|
|
772
|
+
var isOriginLeft = this.layout._getOption('originLeft');
|
|
773
|
+
var isOriginTop = this.layout._getOption('originTop');
|
|
774
|
+
|
|
775
|
+
// x
|
|
776
|
+
var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight';
|
|
777
|
+
var xProperty = isOriginLeft ? 'left' : 'right';
|
|
778
|
+
var xResetProperty = isOriginLeft ? 'right' : 'left';
|
|
779
|
+
|
|
780
|
+
var x = this.position.x + layoutSize[ xPadding ];
|
|
781
|
+
// set in percentage or pixels
|
|
782
|
+
style[ xProperty ] = this.getXValue( x );
|
|
783
|
+
// reset other property
|
|
784
|
+
style[ xResetProperty ] = '';
|
|
785
|
+
|
|
786
|
+
// y
|
|
787
|
+
var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom';
|
|
788
|
+
var yProperty = isOriginTop ? 'top' : 'bottom';
|
|
789
|
+
var yResetProperty = isOriginTop ? 'bottom' : 'top';
|
|
790
|
+
|
|
791
|
+
var y = this.position.y + layoutSize[ yPadding ];
|
|
792
|
+
// set in percentage or pixels
|
|
793
|
+
style[ yProperty ] = this.getYValue( y );
|
|
794
|
+
// reset other property
|
|
795
|
+
style[ yResetProperty ] = '';
|
|
796
|
+
|
|
797
|
+
this.css( style );
|
|
798
|
+
this.emitEvent( 'layout', [ this ] );
|
|
799
|
+
};
|
|
800
|
+
|
|
801
|
+
proto.getXValue = function( x ) {
|
|
802
|
+
var isHorizontal = this.layout._getOption('horizontal');
|
|
803
|
+
return this.layout.options.percentPosition && !isHorizontal ?
|
|
804
|
+
( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px';
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
proto.getYValue = function( y ) {
|
|
808
|
+
var isHorizontal = this.layout._getOption('horizontal');
|
|
809
|
+
return this.layout.options.percentPosition && isHorizontal ?
|
|
810
|
+
( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px';
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
proto._transitionTo = function( x, y ) {
|
|
814
|
+
this.getPosition();
|
|
815
|
+
// get current x & y from top/left
|
|
816
|
+
var curX = this.position.x;
|
|
817
|
+
var curY = this.position.y;
|
|
818
|
+
|
|
819
|
+
var didNotMove = x == this.position.x && y == this.position.y;
|
|
820
|
+
|
|
821
|
+
// save end position
|
|
822
|
+
this.setPosition( x, y );
|
|
823
|
+
|
|
824
|
+
// if did not move and not transitioning, just go to layout
|
|
825
|
+
if ( didNotMove && !this.isTransitioning ) {
|
|
826
|
+
this.layoutPosition();
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
var transX = x - curX;
|
|
831
|
+
var transY = y - curY;
|
|
832
|
+
var transitionStyle = {};
|
|
833
|
+
transitionStyle.transform = this.getTranslate( transX, transY );
|
|
834
|
+
|
|
835
|
+
this.transition({
|
|
836
|
+
to: transitionStyle,
|
|
837
|
+
onTransitionEnd: {
|
|
838
|
+
transform: this.layoutPosition
|
|
839
|
+
},
|
|
840
|
+
isCleaning: true
|
|
841
|
+
});
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
proto.getTranslate = function( x, y ) {
|
|
845
|
+
// flip cooridinates if origin on right or bottom
|
|
846
|
+
var isOriginLeft = this.layout._getOption('originLeft');
|
|
847
|
+
var isOriginTop = this.layout._getOption('originTop');
|
|
848
|
+
x = isOriginLeft ? x : -x;
|
|
849
|
+
y = isOriginTop ? y : -y;
|
|
850
|
+
return 'translate3d(' + x + 'px, ' + y + 'px, 0)';
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
// non transition + transform support
|
|
854
|
+
proto.goTo = function( x, y ) {
|
|
855
|
+
this.setPosition( x, y );
|
|
856
|
+
this.layoutPosition();
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
proto.moveTo = proto._transitionTo;
|
|
860
|
+
|
|
861
|
+
proto.setPosition = function( x, y ) {
|
|
862
|
+
this.position.x = parseFloat( x );
|
|
863
|
+
this.position.y = parseFloat( y );
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
// ----- transition ----- //
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* @param {Object} style - CSS
|
|
870
|
+
* @param {Function} onTransitionEnd
|
|
871
|
+
*/
|
|
872
|
+
|
|
873
|
+
// non transition, just trigger callback
|
|
874
|
+
proto._nonTransition = function( args ) {
|
|
875
|
+
this.css( args.to );
|
|
876
|
+
if ( args.isCleaning ) {
|
|
877
|
+
this._removeStyles( args.to );
|
|
878
|
+
}
|
|
879
|
+
for ( var prop in args.onTransitionEnd ) {
|
|
880
|
+
args.onTransitionEnd[ prop ].call( this );
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* proper transition
|
|
886
|
+
* @param {Object} args - arguments
|
|
887
|
+
* @param {Object} to - style to transition to
|
|
888
|
+
* @param {Object} from - style to start transition from
|
|
889
|
+
* @param {Boolean} isCleaning - removes transition styles after transition
|
|
890
|
+
* @param {Function} onTransitionEnd - callback
|
|
891
|
+
*/
|
|
892
|
+
proto.transition = function( args ) {
|
|
893
|
+
// redirect to nonTransition if no transition duration
|
|
894
|
+
if ( !parseFloat( this.layout.options.transitionDuration ) ) {
|
|
895
|
+
this._nonTransition( args );
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
var _transition = this._transn;
|
|
900
|
+
// keep track of onTransitionEnd callback by css property
|
|
901
|
+
for ( var prop in args.onTransitionEnd ) {
|
|
902
|
+
_transition.onEnd[ prop ] = args.onTransitionEnd[ prop ];
|
|
903
|
+
}
|
|
904
|
+
// keep track of properties that are transitioning
|
|
905
|
+
for ( prop in args.to ) {
|
|
906
|
+
_transition.ingProperties[ prop ] = true;
|
|
907
|
+
// keep track of properties to clean up when transition is done
|
|
908
|
+
if ( args.isCleaning ) {
|
|
909
|
+
_transition.clean[ prop ] = true;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
// set from styles
|
|
914
|
+
if ( args.from ) {
|
|
915
|
+
this.css( args.from );
|
|
916
|
+
}
|
|
917
|
+
// enable transition
|
|
918
|
+
this.enableTransition( args.to );
|
|
919
|
+
// set styles that are transitioning
|
|
920
|
+
this.css( args.to );
|
|
921
|
+
|
|
922
|
+
this.isTransitioning = true;
|
|
923
|
+
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
// dash before all cap letters, including first for
|
|
927
|
+
// WebkitTransform => -webkit-transform
|
|
928
|
+
function toDashedAll( str ) {
|
|
929
|
+
return str.replace( /([A-Z])/g, function( $1 ) {
|
|
930
|
+
return '-' + $1.toLowerCase();
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
var transitionProps = 'opacity,' + toDashedAll( transformProperty );
|
|
935
|
+
|
|
936
|
+
proto.enableTransition = function(/* style */) {
|
|
937
|
+
// HACK changing transitionProperty during a transition
|
|
938
|
+
// will cause transition to jump
|
|
939
|
+
if ( this.isTransitioning ) {
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
// make `transition: foo, bar, baz` from style object
|
|
944
|
+
// HACK un-comment this when enableTransition can work
|
|
945
|
+
// while a transition is happening
|
|
946
|
+
// var transitionValues = [];
|
|
947
|
+
// for ( var prop in style ) {
|
|
948
|
+
// // dash-ify camelCased properties like WebkitTransition
|
|
949
|
+
// prop = vendorProperties[ prop ] || prop;
|
|
950
|
+
// transitionValues.push( toDashedAll( prop ) );
|
|
951
|
+
// }
|
|
952
|
+
// munge number to millisecond, to match stagger
|
|
953
|
+
var duration = this.layout.options.transitionDuration;
|
|
954
|
+
duration = typeof duration == 'number' ? duration + 'ms' : duration;
|
|
955
|
+
// enable transition styles
|
|
956
|
+
this.css({
|
|
957
|
+
transitionProperty: transitionProps,
|
|
958
|
+
transitionDuration: duration,
|
|
959
|
+
transitionDelay: this.staggerDelay || 0
|
|
960
|
+
});
|
|
961
|
+
// listen for transition end event
|
|
962
|
+
this.element.addEventListener( transitionEndEvent, this, false );
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
// ----- events ----- //
|
|
966
|
+
|
|
967
|
+
proto.onwebkitTransitionEnd = function( event ) {
|
|
968
|
+
this.ontransitionend( event );
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
proto.onotransitionend = function( event ) {
|
|
972
|
+
this.ontransitionend( event );
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
// properties that I munge to make my life easier
|
|
976
|
+
var dashedVendorProperties = {
|
|
977
|
+
'-webkit-transform': 'transform'
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
proto.ontransitionend = function( event ) {
|
|
981
|
+
// disregard bubbled events from children
|
|
982
|
+
if ( event.target !== this.element ) {
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
var _transition = this._transn;
|
|
986
|
+
// get property name of transitioned property, convert to prefix-free
|
|
987
|
+
var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName;
|
|
988
|
+
|
|
989
|
+
// remove property that has completed transitioning
|
|
990
|
+
delete _transition.ingProperties[ propertyName ];
|
|
991
|
+
// check if any properties are still transitioning
|
|
992
|
+
if ( isEmptyObj( _transition.ingProperties ) ) {
|
|
993
|
+
// all properties have completed transitioning
|
|
994
|
+
this.disableTransition();
|
|
995
|
+
}
|
|
996
|
+
// clean style
|
|
997
|
+
if ( propertyName in _transition.clean ) {
|
|
998
|
+
// clean up style
|
|
999
|
+
this.element.style[ event.propertyName ] = '';
|
|
1000
|
+
delete _transition.clean[ propertyName ];
|
|
1001
|
+
}
|
|
1002
|
+
// trigger onTransitionEnd callback
|
|
1003
|
+
if ( propertyName in _transition.onEnd ) {
|
|
1004
|
+
var onTransitionEnd = _transition.onEnd[ propertyName ];
|
|
1005
|
+
onTransitionEnd.call( this );
|
|
1006
|
+
delete _transition.onEnd[ propertyName ];
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
this.emitEvent( 'transitionEnd', [ this ] );
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
proto.disableTransition = function() {
|
|
1013
|
+
this.removeTransitionStyles();
|
|
1014
|
+
this.element.removeEventListener( transitionEndEvent, this, false );
|
|
1015
|
+
this.isTransitioning = false;
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* removes style property from element
|
|
1020
|
+
* @param {Object} style
|
|
1021
|
+
**/
|
|
1022
|
+
proto._removeStyles = function( style ) {
|
|
1023
|
+
// clean up transition styles
|
|
1024
|
+
var cleanStyle = {};
|
|
1025
|
+
for ( var prop in style ) {
|
|
1026
|
+
cleanStyle[ prop ] = '';
|
|
1027
|
+
}
|
|
1028
|
+
this.css( cleanStyle );
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
var cleanTransitionStyle = {
|
|
1032
|
+
transitionProperty: '',
|
|
1033
|
+
transitionDuration: '',
|
|
1034
|
+
transitionDelay: ''
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
proto.removeTransitionStyles = function() {
|
|
1038
|
+
// remove transition
|
|
1039
|
+
this.css( cleanTransitionStyle );
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
// ----- stagger ----- //
|
|
1043
|
+
|
|
1044
|
+
proto.stagger = function( delay ) {
|
|
1045
|
+
delay = isNaN( delay ) ? 0 : delay;
|
|
1046
|
+
this.staggerDelay = delay + 'ms';
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
// ----- show/hide/remove ----- //
|
|
1050
|
+
|
|
1051
|
+
// remove element from DOM
|
|
1052
|
+
proto.removeElem = function() {
|
|
1053
|
+
this.element.parentNode.removeChild( this.element );
|
|
1054
|
+
// remove display: none
|
|
1055
|
+
this.css({ display: '' });
|
|
1056
|
+
this.emitEvent( 'remove', [ this ] );
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
proto.remove = function() {
|
|
1060
|
+
// just remove element if no transition support or no transition
|
|
1061
|
+
if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) {
|
|
1062
|
+
this.removeElem();
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// start transition
|
|
1067
|
+
this.once( 'transitionEnd', function() {
|
|
1068
|
+
this.removeElem();
|
|
1069
|
+
});
|
|
1070
|
+
this.hide();
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
proto.reveal = function() {
|
|
1074
|
+
delete this.isHidden;
|
|
1075
|
+
// remove display: none
|
|
1076
|
+
this.css({ display: '' });
|
|
1077
|
+
|
|
1078
|
+
var options = this.layout.options;
|
|
1079
|
+
|
|
1080
|
+
var onTransitionEnd = {};
|
|
1081
|
+
var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle');
|
|
1082
|
+
onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd;
|
|
1083
|
+
|
|
1084
|
+
this.transition({
|
|
1085
|
+
from: options.hiddenStyle,
|
|
1086
|
+
to: options.visibleStyle,
|
|
1087
|
+
isCleaning: true,
|
|
1088
|
+
onTransitionEnd: onTransitionEnd
|
|
1089
|
+
});
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
proto.onRevealTransitionEnd = function() {
|
|
1093
|
+
// check if still visible
|
|
1094
|
+
// during transition, item may have been hidden
|
|
1095
|
+
if ( !this.isHidden ) {
|
|
1096
|
+
this.emitEvent('reveal');
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* get style property use for hide/reveal transition end
|
|
1102
|
+
* @param {String} styleProperty - hiddenStyle/visibleStyle
|
|
1103
|
+
* @returns {String}
|
|
1104
|
+
*/
|
|
1105
|
+
proto.getHideRevealTransitionEndProperty = function( styleProperty ) {
|
|
1106
|
+
var optionStyle = this.layout.options[ styleProperty ];
|
|
1107
|
+
// use opacity
|
|
1108
|
+
if ( optionStyle.opacity ) {
|
|
1109
|
+
return 'opacity';
|
|
1110
|
+
}
|
|
1111
|
+
// get first property
|
|
1112
|
+
for ( var prop in optionStyle ) {
|
|
1113
|
+
return prop;
|
|
1114
|
+
}
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
proto.hide = function() {
|
|
1118
|
+
// set flag
|
|
1119
|
+
this.isHidden = true;
|
|
1120
|
+
// remove display: none
|
|
1121
|
+
this.css({ display: '' });
|
|
1122
|
+
|
|
1123
|
+
var options = this.layout.options;
|
|
1124
|
+
|
|
1125
|
+
var onTransitionEnd = {};
|
|
1126
|
+
var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle');
|
|
1127
|
+
onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd;
|
|
1128
|
+
|
|
1129
|
+
this.transition({
|
|
1130
|
+
from: options.visibleStyle,
|
|
1131
|
+
to: options.hiddenStyle,
|
|
1132
|
+
// keep hidden stuff hidden
|
|
1133
|
+
isCleaning: true,
|
|
1134
|
+
onTransitionEnd: onTransitionEnd
|
|
1135
|
+
});
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
proto.onHideTransitionEnd = function() {
|
|
1139
|
+
// check if still hidden
|
|
1140
|
+
// during transition, item may have been un-hidden
|
|
1141
|
+
if ( this.isHidden ) {
|
|
1142
|
+
this.css({ display: 'none' });
|
|
1143
|
+
this.emitEvent('hide');
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
proto.destroy = function() {
|
|
1148
|
+
this.css({
|
|
1149
|
+
position: '',
|
|
1150
|
+
left: '',
|
|
1151
|
+
right: '',
|
|
1152
|
+
top: '',
|
|
1153
|
+
bottom: '',
|
|
1154
|
+
transition: '',
|
|
1155
|
+
transform: ''
|
|
1156
|
+
});
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
return Item;
|
|
1160
|
+
|
|
1161
|
+
}));
|
|
1162
|
+
}(item));
|
|
1163
|
+
|
|
1164
|
+
/*!
|
|
1165
|
+
* Outlayer v2.1.1
|
|
1166
|
+
* the brains and guts of a layout library
|
|
1167
|
+
* MIT license
|
|
1168
|
+
*/
|
|
1169
|
+
|
|
1170
|
+
(function (module) {
|
|
1171
|
+
( function( window, factory ) {
|
|
1172
|
+
// universal module definition
|
|
1173
|
+
/* jshint strict: false */ /* globals define, module, require */
|
|
1174
|
+
if ( module.exports ) {
|
|
1175
|
+
// CommonJS - Browserify, Webpack
|
|
1176
|
+
module.exports = factory(
|
|
1177
|
+
window,
|
|
1178
|
+
evEmitter.exports,
|
|
1179
|
+
getSize.exports,
|
|
1180
|
+
utils.exports,
|
|
1181
|
+
item.exports
|
|
1182
|
+
);
|
|
1183
|
+
} else {
|
|
1184
|
+
// browser global
|
|
1185
|
+
window.Outlayer = factory(
|
|
1186
|
+
window,
|
|
1187
|
+
window.EvEmitter,
|
|
1188
|
+
window.getSize,
|
|
1189
|
+
window.fizzyUIUtils,
|
|
1190
|
+
window.Outlayer.Item
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
}( window, function factory( window, EvEmitter, getSize, utils, Item ) {
|
|
1195
|
+
|
|
1196
|
+
// ----- vars ----- //
|
|
1197
|
+
|
|
1198
|
+
var console = window.console;
|
|
1199
|
+
var jQuery = window.jQuery;
|
|
1200
|
+
var noop = function() {};
|
|
1201
|
+
|
|
1202
|
+
// -------------------------- Outlayer -------------------------- //
|
|
1203
|
+
|
|
1204
|
+
// globally unique identifiers
|
|
1205
|
+
var GUID = 0;
|
|
1206
|
+
// internal store of all Outlayer intances
|
|
1207
|
+
var instances = {};
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* @param {Element, String} element
|
|
1212
|
+
* @param {Object} options
|
|
1213
|
+
* @constructor
|
|
1214
|
+
*/
|
|
1215
|
+
function Outlayer( element, options ) {
|
|
1216
|
+
var queryElement = utils.getQueryElement( element );
|
|
1217
|
+
if ( !queryElement ) {
|
|
1218
|
+
if ( console ) {
|
|
1219
|
+
console.error( 'Bad element for ' + this.constructor.namespace +
|
|
1220
|
+
': ' + ( queryElement || element ) );
|
|
1221
|
+
}
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
this.element = queryElement;
|
|
1225
|
+
// add jQuery
|
|
1226
|
+
if ( jQuery ) {
|
|
1227
|
+
this.$element = jQuery( this.element );
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
// options
|
|
1231
|
+
this.options = utils.extend( {}, this.constructor.defaults );
|
|
1232
|
+
this.option( options );
|
|
1233
|
+
|
|
1234
|
+
// add id for Outlayer.getFromElement
|
|
1235
|
+
var id = ++GUID;
|
|
1236
|
+
this.element.outlayerGUID = id; // expando
|
|
1237
|
+
instances[ id ] = this; // associate via id
|
|
1238
|
+
|
|
1239
|
+
// kick it off
|
|
1240
|
+
this._create();
|
|
1241
|
+
|
|
1242
|
+
var isInitLayout = this._getOption('initLayout');
|
|
1243
|
+
if ( isInitLayout ) {
|
|
1244
|
+
this.layout();
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
// settings are for internal use only
|
|
1249
|
+
Outlayer.namespace = 'outlayer';
|
|
1250
|
+
Outlayer.Item = Item;
|
|
1251
|
+
|
|
1252
|
+
// default options
|
|
1253
|
+
Outlayer.defaults = {
|
|
1254
|
+
containerStyle: {
|
|
1255
|
+
position: 'relative'
|
|
1256
|
+
},
|
|
1257
|
+
initLayout: true,
|
|
1258
|
+
originLeft: true,
|
|
1259
|
+
originTop: true,
|
|
1260
|
+
resize: true,
|
|
1261
|
+
resizeContainer: true,
|
|
1262
|
+
// item options
|
|
1263
|
+
transitionDuration: '0.4s',
|
|
1264
|
+
hiddenStyle: {
|
|
1265
|
+
opacity: 0,
|
|
1266
|
+
transform: 'scale(0.001)'
|
|
1267
|
+
},
|
|
1268
|
+
visibleStyle: {
|
|
1269
|
+
opacity: 1,
|
|
1270
|
+
transform: 'scale(1)'
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1274
|
+
var proto = Outlayer.prototype;
|
|
1275
|
+
// inherit EvEmitter
|
|
1276
|
+
utils.extend( proto, EvEmitter.prototype );
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* set options
|
|
1280
|
+
* @param {Object} opts
|
|
1281
|
+
*/
|
|
1282
|
+
proto.option = function( opts ) {
|
|
1283
|
+
utils.extend( this.options, opts );
|
|
1284
|
+
};
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* get backwards compatible option value, check old name
|
|
1288
|
+
*/
|
|
1289
|
+
proto._getOption = function( option ) {
|
|
1290
|
+
var oldOption = this.constructor.compatOptions[ option ];
|
|
1291
|
+
return oldOption && this.options[ oldOption ] !== undefined ?
|
|
1292
|
+
this.options[ oldOption ] : this.options[ option ];
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
Outlayer.compatOptions = {
|
|
1296
|
+
// currentName: oldName
|
|
1297
|
+
initLayout: 'isInitLayout',
|
|
1298
|
+
horizontal: 'isHorizontal',
|
|
1299
|
+
layoutInstant: 'isLayoutInstant',
|
|
1300
|
+
originLeft: 'isOriginLeft',
|
|
1301
|
+
originTop: 'isOriginTop',
|
|
1302
|
+
resize: 'isResizeBound',
|
|
1303
|
+
resizeContainer: 'isResizingContainer'
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1306
|
+
proto._create = function() {
|
|
1307
|
+
// get items from children
|
|
1308
|
+
this.reloadItems();
|
|
1309
|
+
// elements that affect layout, but are not laid out
|
|
1310
|
+
this.stamps = [];
|
|
1311
|
+
this.stamp( this.options.stamp );
|
|
1312
|
+
// set container style
|
|
1313
|
+
utils.extend( this.element.style, this.options.containerStyle );
|
|
1314
|
+
|
|
1315
|
+
// bind resize method
|
|
1316
|
+
var canBindResize = this._getOption('resize');
|
|
1317
|
+
if ( canBindResize ) {
|
|
1318
|
+
this.bindResize();
|
|
1319
|
+
}
|
|
1320
|
+
};
|
|
1321
|
+
|
|
1322
|
+
// goes through all children again and gets bricks in proper order
|
|
1323
|
+
proto.reloadItems = function() {
|
|
1324
|
+
// collection of item elements
|
|
1325
|
+
this.items = this._itemize( this.element.children );
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* turn elements into Outlayer.Items to be used in layout
|
|
1331
|
+
* @param {Array or NodeList or HTMLElement} elems
|
|
1332
|
+
* @returns {Array} items - collection of new Outlayer Items
|
|
1333
|
+
*/
|
|
1334
|
+
proto._itemize = function( elems ) {
|
|
1335
|
+
|
|
1336
|
+
var itemElems = this._filterFindItemElements( elems );
|
|
1337
|
+
var Item = this.constructor.Item;
|
|
1338
|
+
|
|
1339
|
+
// create new Outlayer Items for collection
|
|
1340
|
+
var items = [];
|
|
1341
|
+
for ( var i=0; i < itemElems.length; i++ ) {
|
|
1342
|
+
var elem = itemElems[i];
|
|
1343
|
+
var item = new Item( elem, this );
|
|
1344
|
+
items.push( item );
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
return items;
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* get item elements to be used in layout
|
|
1352
|
+
* @param {Array or NodeList or HTMLElement} elems
|
|
1353
|
+
* @returns {Array} items - item elements
|
|
1354
|
+
*/
|
|
1355
|
+
proto._filterFindItemElements = function( elems ) {
|
|
1356
|
+
return utils.filterFindElements( elems, this.options.itemSelector );
|
|
1357
|
+
};
|
|
1358
|
+
|
|
1359
|
+
/**
|
|
1360
|
+
* getter method for getting item elements
|
|
1361
|
+
* @returns {Array} elems - collection of item elements
|
|
1362
|
+
*/
|
|
1363
|
+
proto.getItemElements = function() {
|
|
1364
|
+
return this.items.map( function( item ) {
|
|
1365
|
+
return item.element;
|
|
1366
|
+
});
|
|
1367
|
+
};
|
|
1368
|
+
|
|
1369
|
+
// ----- init & layout ----- //
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* lays out all items
|
|
1373
|
+
*/
|
|
1374
|
+
proto.layout = function() {
|
|
1375
|
+
this._resetLayout();
|
|
1376
|
+
this._manageStamps();
|
|
1377
|
+
|
|
1378
|
+
// don't animate first layout
|
|
1379
|
+
var layoutInstant = this._getOption('layoutInstant');
|
|
1380
|
+
var isInstant = layoutInstant !== undefined ?
|
|
1381
|
+
layoutInstant : !this._isLayoutInited;
|
|
1382
|
+
this.layoutItems( this.items, isInstant );
|
|
1383
|
+
|
|
1384
|
+
// flag for initalized
|
|
1385
|
+
this._isLayoutInited = true;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
// _init is alias for layout
|
|
1389
|
+
proto._init = proto.layout;
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* logic before any new layout
|
|
1393
|
+
*/
|
|
1394
|
+
proto._resetLayout = function() {
|
|
1395
|
+
this.getSize();
|
|
1396
|
+
};
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
proto.getSize = function() {
|
|
1400
|
+
this.size = getSize( this.element );
|
|
1401
|
+
};
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* get measurement from option, for columnWidth, rowHeight, gutter
|
|
1405
|
+
* if option is String -> get element from selector string, & get size of element
|
|
1406
|
+
* if option is Element -> get size of element
|
|
1407
|
+
* else use option as a number
|
|
1408
|
+
*
|
|
1409
|
+
* @param {String} measurement
|
|
1410
|
+
* @param {String} size - width or height
|
|
1411
|
+
* @private
|
|
1412
|
+
*/
|
|
1413
|
+
proto._getMeasurement = function( measurement, size ) {
|
|
1414
|
+
var option = this.options[ measurement ];
|
|
1415
|
+
var elem;
|
|
1416
|
+
if ( !option ) {
|
|
1417
|
+
// default to 0
|
|
1418
|
+
this[ measurement ] = 0;
|
|
1419
|
+
} else {
|
|
1420
|
+
// use option as an element
|
|
1421
|
+
if ( typeof option == 'string' ) {
|
|
1422
|
+
elem = this.element.querySelector( option );
|
|
1423
|
+
} else if ( option instanceof HTMLElement ) {
|
|
1424
|
+
elem = option;
|
|
1425
|
+
}
|
|
1426
|
+
// use size of element, if element
|
|
1427
|
+
this[ measurement ] = elem ? getSize( elem )[ size ] : option;
|
|
1428
|
+
}
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* layout a collection of item elements
|
|
1433
|
+
* @api public
|
|
1434
|
+
*/
|
|
1435
|
+
proto.layoutItems = function( items, isInstant ) {
|
|
1436
|
+
items = this._getItemsForLayout( items );
|
|
1437
|
+
|
|
1438
|
+
this._layoutItems( items, isInstant );
|
|
1439
|
+
|
|
1440
|
+
this._postLayout();
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1443
|
+
/**
|
|
1444
|
+
* get the items to be laid out
|
|
1445
|
+
* you may want to skip over some items
|
|
1446
|
+
* @param {Array} items
|
|
1447
|
+
* @returns {Array} items
|
|
1448
|
+
*/
|
|
1449
|
+
proto._getItemsForLayout = function( items ) {
|
|
1450
|
+
return items.filter( function( item ) {
|
|
1451
|
+
return !item.isIgnored;
|
|
1452
|
+
});
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* layout items
|
|
1457
|
+
* @param {Array} items
|
|
1458
|
+
* @param {Boolean} isInstant
|
|
1459
|
+
*/
|
|
1460
|
+
proto._layoutItems = function( items, isInstant ) {
|
|
1461
|
+
this._emitCompleteOnItems( 'layout', items );
|
|
1462
|
+
|
|
1463
|
+
if ( !items || !items.length ) {
|
|
1464
|
+
// no items, emit event with empty array
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
var queue = [];
|
|
1469
|
+
|
|
1470
|
+
items.forEach( function( item ) {
|
|
1471
|
+
// get x/y object from method
|
|
1472
|
+
var position = this._getItemLayoutPosition( item );
|
|
1473
|
+
// enqueue
|
|
1474
|
+
position.item = item;
|
|
1475
|
+
position.isInstant = isInstant || item.isLayoutInstant;
|
|
1476
|
+
queue.push( position );
|
|
1477
|
+
}, this );
|
|
1478
|
+
|
|
1479
|
+
this._processLayoutQueue( queue );
|
|
1480
|
+
};
|
|
1481
|
+
|
|
1482
|
+
/**
|
|
1483
|
+
* get item layout position
|
|
1484
|
+
* @param {Outlayer.Item} item
|
|
1485
|
+
* @returns {Object} x and y position
|
|
1486
|
+
*/
|
|
1487
|
+
proto._getItemLayoutPosition = function( /* item */ ) {
|
|
1488
|
+
return {
|
|
1489
|
+
x: 0,
|
|
1490
|
+
y: 0
|
|
1491
|
+
};
|
|
1492
|
+
};
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* iterate over array and position each item
|
|
1496
|
+
* Reason being - separating this logic prevents 'layout invalidation'
|
|
1497
|
+
* thx @paul_irish
|
|
1498
|
+
* @param {Array} queue
|
|
1499
|
+
*/
|
|
1500
|
+
proto._processLayoutQueue = function( queue ) {
|
|
1501
|
+
this.updateStagger();
|
|
1502
|
+
queue.forEach( function( obj, i ) {
|
|
1503
|
+
this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i );
|
|
1504
|
+
}, this );
|
|
1505
|
+
};
|
|
1506
|
+
|
|
1507
|
+
// set stagger from option in milliseconds number
|
|
1508
|
+
proto.updateStagger = function() {
|
|
1509
|
+
var stagger = this.options.stagger;
|
|
1510
|
+
if ( stagger === null || stagger === undefined ) {
|
|
1511
|
+
this.stagger = 0;
|
|
1512
|
+
return;
|
|
1513
|
+
}
|
|
1514
|
+
this.stagger = getMilliseconds( stagger );
|
|
1515
|
+
return this.stagger;
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* Sets position of item in DOM
|
|
1520
|
+
* @param {Outlayer.Item} item
|
|
1521
|
+
* @param {Number} x - horizontal position
|
|
1522
|
+
* @param {Number} y - vertical position
|
|
1523
|
+
* @param {Boolean} isInstant - disables transitions
|
|
1524
|
+
*/
|
|
1525
|
+
proto._positionItem = function( item, x, y, isInstant, i ) {
|
|
1526
|
+
if ( isInstant ) {
|
|
1527
|
+
// if not transition, just set CSS
|
|
1528
|
+
item.goTo( x, y );
|
|
1529
|
+
} else {
|
|
1530
|
+
item.stagger( i * this.stagger );
|
|
1531
|
+
item.moveTo( x, y );
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* Any logic you want to do after each layout,
|
|
1537
|
+
* i.e. size the container
|
|
1538
|
+
*/
|
|
1539
|
+
proto._postLayout = function() {
|
|
1540
|
+
this.resizeContainer();
|
|
1541
|
+
};
|
|
1542
|
+
|
|
1543
|
+
proto.resizeContainer = function() {
|
|
1544
|
+
var isResizingContainer = this._getOption('resizeContainer');
|
|
1545
|
+
if ( !isResizingContainer ) {
|
|
1546
|
+
return;
|
|
1547
|
+
}
|
|
1548
|
+
var size = this._getContainerSize();
|
|
1549
|
+
if ( size ) {
|
|
1550
|
+
this._setContainerMeasure( size.width, true );
|
|
1551
|
+
this._setContainerMeasure( size.height, false );
|
|
1552
|
+
}
|
|
1553
|
+
};
|
|
1554
|
+
|
|
1555
|
+
/**
|
|
1556
|
+
* Sets width or height of container if returned
|
|
1557
|
+
* @returns {Object} size
|
|
1558
|
+
* @param {Number} width
|
|
1559
|
+
* @param {Number} height
|
|
1560
|
+
*/
|
|
1561
|
+
proto._getContainerSize = noop;
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* @param {Number} measure - size of width or height
|
|
1565
|
+
* @param {Boolean} isWidth
|
|
1566
|
+
*/
|
|
1567
|
+
proto._setContainerMeasure = function( measure, isWidth ) {
|
|
1568
|
+
if ( measure === undefined ) {
|
|
1569
|
+
return;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
var elemSize = this.size;
|
|
1573
|
+
// add padding and border width if border box
|
|
1574
|
+
if ( elemSize.isBorderBox ) {
|
|
1575
|
+
measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight +
|
|
1576
|
+
elemSize.borderLeftWidth + elemSize.borderRightWidth :
|
|
1577
|
+
elemSize.paddingBottom + elemSize.paddingTop +
|
|
1578
|
+
elemSize.borderTopWidth + elemSize.borderBottomWidth;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
measure = Math.max( measure, 0 );
|
|
1582
|
+
this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px';
|
|
1583
|
+
};
|
|
1584
|
+
|
|
1585
|
+
/**
|
|
1586
|
+
* emit eventComplete on a collection of items events
|
|
1587
|
+
* @param {String} eventName
|
|
1588
|
+
* @param {Array} items - Outlayer.Items
|
|
1589
|
+
*/
|
|
1590
|
+
proto._emitCompleteOnItems = function( eventName, items ) {
|
|
1591
|
+
var _this = this;
|
|
1592
|
+
function onComplete() {
|
|
1593
|
+
_this.dispatchEvent( eventName + 'Complete', null, [ items ] );
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
var count = items.length;
|
|
1597
|
+
if ( !items || !count ) {
|
|
1598
|
+
onComplete();
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
var doneCount = 0;
|
|
1603
|
+
function tick() {
|
|
1604
|
+
doneCount++;
|
|
1605
|
+
if ( doneCount == count ) {
|
|
1606
|
+
onComplete();
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
// bind callback
|
|
1611
|
+
items.forEach( function( item ) {
|
|
1612
|
+
item.once( eventName, tick );
|
|
1613
|
+
});
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* emits events via EvEmitter and jQuery events
|
|
1618
|
+
* @param {String} type - name of event
|
|
1619
|
+
* @param {Event} event - original event
|
|
1620
|
+
* @param {Array} args - extra arguments
|
|
1621
|
+
*/
|
|
1622
|
+
proto.dispatchEvent = function( type, event, args ) {
|
|
1623
|
+
// add original event to arguments
|
|
1624
|
+
var emitArgs = event ? [ event ].concat( args ) : args;
|
|
1625
|
+
this.emitEvent( type, emitArgs );
|
|
1626
|
+
|
|
1627
|
+
if ( jQuery ) {
|
|
1628
|
+
// set this.$element
|
|
1629
|
+
this.$element = this.$element || jQuery( this.element );
|
|
1630
|
+
if ( event ) {
|
|
1631
|
+
// create jQuery event
|
|
1632
|
+
var $event = jQuery.Event( event );
|
|
1633
|
+
$event.type = type;
|
|
1634
|
+
this.$element.trigger( $event, args );
|
|
1635
|
+
} else {
|
|
1636
|
+
// just trigger with type if no event available
|
|
1637
|
+
this.$element.trigger( type, args );
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
};
|
|
1641
|
+
|
|
1642
|
+
// -------------------------- ignore & stamps -------------------------- //
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* keep item in collection, but do not lay it out
|
|
1647
|
+
* ignored items do not get skipped in layout
|
|
1648
|
+
* @param {Element} elem
|
|
1649
|
+
*/
|
|
1650
|
+
proto.ignore = function( elem ) {
|
|
1651
|
+
var item = this.getItem( elem );
|
|
1652
|
+
if ( item ) {
|
|
1653
|
+
item.isIgnored = true;
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
/**
|
|
1658
|
+
* return item to layout collection
|
|
1659
|
+
* @param {Element} elem
|
|
1660
|
+
*/
|
|
1661
|
+
proto.unignore = function( elem ) {
|
|
1662
|
+
var item = this.getItem( elem );
|
|
1663
|
+
if ( item ) {
|
|
1664
|
+
delete item.isIgnored;
|
|
1665
|
+
}
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* adds elements to stamps
|
|
1670
|
+
* @param {NodeList, Array, Element, or String} elems
|
|
1671
|
+
*/
|
|
1672
|
+
proto.stamp = function( elems ) {
|
|
1673
|
+
elems = this._find( elems );
|
|
1674
|
+
if ( !elems ) {
|
|
1675
|
+
return;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
this.stamps = this.stamps.concat( elems );
|
|
1679
|
+
// ignore
|
|
1680
|
+
elems.forEach( this.ignore, this );
|
|
1681
|
+
};
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* removes elements to stamps
|
|
1685
|
+
* @param {NodeList, Array, or Element} elems
|
|
1686
|
+
*/
|
|
1687
|
+
proto.unstamp = function( elems ) {
|
|
1688
|
+
elems = this._find( elems );
|
|
1689
|
+
if ( !elems ){
|
|
1690
|
+
return;
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
elems.forEach( function( elem ) {
|
|
1694
|
+
// filter out removed stamp elements
|
|
1695
|
+
utils.removeFrom( this.stamps, elem );
|
|
1696
|
+
this.unignore( elem );
|
|
1697
|
+
}, this );
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
/**
|
|
1701
|
+
* finds child elements
|
|
1702
|
+
* @param {NodeList, Array, Element, or String} elems
|
|
1703
|
+
* @returns {Array} elems
|
|
1704
|
+
*/
|
|
1705
|
+
proto._find = function( elems ) {
|
|
1706
|
+
if ( !elems ) {
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
// if string, use argument as selector string
|
|
1710
|
+
if ( typeof elems == 'string' ) {
|
|
1711
|
+
elems = this.element.querySelectorAll( elems );
|
|
1712
|
+
}
|
|
1713
|
+
elems = utils.makeArray( elems );
|
|
1714
|
+
return elems;
|
|
1715
|
+
};
|
|
1716
|
+
|
|
1717
|
+
proto._manageStamps = function() {
|
|
1718
|
+
if ( !this.stamps || !this.stamps.length ) {
|
|
1719
|
+
return;
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
this._getBoundingRect();
|
|
1723
|
+
|
|
1724
|
+
this.stamps.forEach( this._manageStamp, this );
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
// update boundingLeft / Top
|
|
1728
|
+
proto._getBoundingRect = function() {
|
|
1729
|
+
// get bounding rect for container element
|
|
1730
|
+
var boundingRect = this.element.getBoundingClientRect();
|
|
1731
|
+
var size = this.size;
|
|
1732
|
+
this._boundingRect = {
|
|
1733
|
+
left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,
|
|
1734
|
+
top: boundingRect.top + size.paddingTop + size.borderTopWidth,
|
|
1735
|
+
right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ),
|
|
1736
|
+
bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth )
|
|
1737
|
+
};
|
|
1738
|
+
};
|
|
1739
|
+
|
|
1740
|
+
/**
|
|
1741
|
+
* @param {Element} stamp
|
|
1742
|
+
**/
|
|
1743
|
+
proto._manageStamp = noop;
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* get x/y position of element relative to container element
|
|
1747
|
+
* @param {Element} elem
|
|
1748
|
+
* @returns {Object} offset - has left, top, right, bottom
|
|
1749
|
+
*/
|
|
1750
|
+
proto._getElementOffset = function( elem ) {
|
|
1751
|
+
var boundingRect = elem.getBoundingClientRect();
|
|
1752
|
+
var thisRect = this._boundingRect;
|
|
1753
|
+
var size = getSize( elem );
|
|
1754
|
+
var offset = {
|
|
1755
|
+
left: boundingRect.left - thisRect.left - size.marginLeft,
|
|
1756
|
+
top: boundingRect.top - thisRect.top - size.marginTop,
|
|
1757
|
+
right: thisRect.right - boundingRect.right - size.marginRight,
|
|
1758
|
+
bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom
|
|
1759
|
+
};
|
|
1760
|
+
return offset;
|
|
1761
|
+
};
|
|
1762
|
+
|
|
1763
|
+
// -------------------------- resize -------------------------- //
|
|
1764
|
+
|
|
1765
|
+
// enable event handlers for listeners
|
|
1766
|
+
// i.e. resize -> onresize
|
|
1767
|
+
proto.handleEvent = utils.handleEvent;
|
|
1768
|
+
|
|
1769
|
+
/**
|
|
1770
|
+
* Bind layout to window resizing
|
|
1771
|
+
*/
|
|
1772
|
+
proto.bindResize = function() {
|
|
1773
|
+
window.addEventListener( 'resize', this );
|
|
1774
|
+
this.isResizeBound = true;
|
|
1775
|
+
};
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* Unbind layout to window resizing
|
|
1779
|
+
*/
|
|
1780
|
+
proto.unbindResize = function() {
|
|
1781
|
+
window.removeEventListener( 'resize', this );
|
|
1782
|
+
this.isResizeBound = false;
|
|
1783
|
+
};
|
|
1784
|
+
|
|
1785
|
+
proto.onresize = function() {
|
|
1786
|
+
this.resize();
|
|
1787
|
+
};
|
|
1788
|
+
|
|
1789
|
+
utils.debounceMethod( Outlayer, 'onresize', 100 );
|
|
1790
|
+
|
|
1791
|
+
proto.resize = function() {
|
|
1792
|
+
// don't trigger if size did not change
|
|
1793
|
+
// or if resize was unbound. See #9
|
|
1794
|
+
if ( !this.isResizeBound || !this.needsResizeLayout() ) {
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
this.layout();
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1801
|
+
/**
|
|
1802
|
+
* check if layout is needed post layout
|
|
1803
|
+
* @returns Boolean
|
|
1804
|
+
*/
|
|
1805
|
+
proto.needsResizeLayout = function() {
|
|
1806
|
+
var size = getSize( this.element );
|
|
1807
|
+
// check that this.size and size are there
|
|
1808
|
+
// IE8 triggers resize on body size change, so they might not be
|
|
1809
|
+
var hasSizes = this.size && size;
|
|
1810
|
+
return hasSizes && size.innerWidth !== this.size.innerWidth;
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
// -------------------------- methods -------------------------- //
|
|
1814
|
+
|
|
1815
|
+
/**
|
|
1816
|
+
* add items to Outlayer instance
|
|
1817
|
+
* @param {Array or NodeList or Element} elems
|
|
1818
|
+
* @returns {Array} items - Outlayer.Items
|
|
1819
|
+
**/
|
|
1820
|
+
proto.addItems = function( elems ) {
|
|
1821
|
+
var items = this._itemize( elems );
|
|
1822
|
+
// add items to collection
|
|
1823
|
+
if ( items.length ) {
|
|
1824
|
+
this.items = this.items.concat( items );
|
|
1825
|
+
}
|
|
1826
|
+
return items;
|
|
1827
|
+
};
|
|
1828
|
+
|
|
1829
|
+
/**
|
|
1830
|
+
* Layout newly-appended item elements
|
|
1831
|
+
* @param {Array or NodeList or Element} elems
|
|
1832
|
+
*/
|
|
1833
|
+
proto.appended = function( elems ) {
|
|
1834
|
+
var items = this.addItems( elems );
|
|
1835
|
+
if ( !items.length ) {
|
|
1836
|
+
return;
|
|
1837
|
+
}
|
|
1838
|
+
// layout and reveal just the new items
|
|
1839
|
+
this.layoutItems( items, true );
|
|
1840
|
+
this.reveal( items );
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* Layout prepended elements
|
|
1845
|
+
* @param {Array or NodeList or Element} elems
|
|
1846
|
+
*/
|
|
1847
|
+
proto.prepended = function( elems ) {
|
|
1848
|
+
var items = this._itemize( elems );
|
|
1849
|
+
if ( !items.length ) {
|
|
1850
|
+
return;
|
|
1851
|
+
}
|
|
1852
|
+
// add items to beginning of collection
|
|
1853
|
+
var previousItems = this.items.slice(0);
|
|
1854
|
+
this.items = items.concat( previousItems );
|
|
1855
|
+
// start new layout
|
|
1856
|
+
this._resetLayout();
|
|
1857
|
+
this._manageStamps();
|
|
1858
|
+
// layout new stuff without transition
|
|
1859
|
+
this.layoutItems( items, true );
|
|
1860
|
+
this.reveal( items );
|
|
1861
|
+
// layout previous items
|
|
1862
|
+
this.layoutItems( previousItems );
|
|
1863
|
+
};
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
* reveal a collection of items
|
|
1867
|
+
* @param {Array of Outlayer.Items} items
|
|
1868
|
+
*/
|
|
1869
|
+
proto.reveal = function( items ) {
|
|
1870
|
+
this._emitCompleteOnItems( 'reveal', items );
|
|
1871
|
+
if ( !items || !items.length ) {
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1874
|
+
var stagger = this.updateStagger();
|
|
1875
|
+
items.forEach( function( item, i ) {
|
|
1876
|
+
item.stagger( i * stagger );
|
|
1877
|
+
item.reveal();
|
|
1878
|
+
});
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* hide a collection of items
|
|
1883
|
+
* @param {Array of Outlayer.Items} items
|
|
1884
|
+
*/
|
|
1885
|
+
proto.hide = function( items ) {
|
|
1886
|
+
this._emitCompleteOnItems( 'hide', items );
|
|
1887
|
+
if ( !items || !items.length ) {
|
|
1888
|
+
return;
|
|
1889
|
+
}
|
|
1890
|
+
var stagger = this.updateStagger();
|
|
1891
|
+
items.forEach( function( item, i ) {
|
|
1892
|
+
item.stagger( i * stagger );
|
|
1893
|
+
item.hide();
|
|
1894
|
+
});
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* reveal item elements
|
|
1899
|
+
* @param {Array}, {Element}, {NodeList} items
|
|
1900
|
+
*/
|
|
1901
|
+
proto.revealItemElements = function( elems ) {
|
|
1902
|
+
var items = this.getItems( elems );
|
|
1903
|
+
this.reveal( items );
|
|
1904
|
+
};
|
|
1905
|
+
|
|
1906
|
+
/**
|
|
1907
|
+
* hide item elements
|
|
1908
|
+
* @param {Array}, {Element}, {NodeList} items
|
|
1909
|
+
*/
|
|
1910
|
+
proto.hideItemElements = function( elems ) {
|
|
1911
|
+
var items = this.getItems( elems );
|
|
1912
|
+
this.hide( items );
|
|
1913
|
+
};
|
|
1914
|
+
|
|
1915
|
+
/**
|
|
1916
|
+
* get Outlayer.Item, given an Element
|
|
1917
|
+
* @param {Element} elem
|
|
1918
|
+
* @param {Function} callback
|
|
1919
|
+
* @returns {Outlayer.Item} item
|
|
1920
|
+
*/
|
|
1921
|
+
proto.getItem = function( elem ) {
|
|
1922
|
+
// loop through items to get the one that matches
|
|
1923
|
+
for ( var i=0; i < this.items.length; i++ ) {
|
|
1924
|
+
var item = this.items[i];
|
|
1925
|
+
if ( item.element == elem ) {
|
|
1926
|
+
// return item
|
|
1927
|
+
return item;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
};
|
|
1931
|
+
|
|
1932
|
+
/**
|
|
1933
|
+
* get collection of Outlayer.Items, given Elements
|
|
1934
|
+
* @param {Array} elems
|
|
1935
|
+
* @returns {Array} items - Outlayer.Items
|
|
1936
|
+
*/
|
|
1937
|
+
proto.getItems = function( elems ) {
|
|
1938
|
+
elems = utils.makeArray( elems );
|
|
1939
|
+
var items = [];
|
|
1940
|
+
elems.forEach( function( elem ) {
|
|
1941
|
+
var item = this.getItem( elem );
|
|
1942
|
+
if ( item ) {
|
|
1943
|
+
items.push( item );
|
|
1944
|
+
}
|
|
1945
|
+
}, this );
|
|
1946
|
+
|
|
1947
|
+
return items;
|
|
1948
|
+
};
|
|
1949
|
+
|
|
1950
|
+
/**
|
|
1951
|
+
* remove element(s) from instance and DOM
|
|
1952
|
+
* @param {Array or NodeList or Element} elems
|
|
1953
|
+
*/
|
|
1954
|
+
proto.remove = function( elems ) {
|
|
1955
|
+
var removeItems = this.getItems( elems );
|
|
1956
|
+
|
|
1957
|
+
this._emitCompleteOnItems( 'remove', removeItems );
|
|
1958
|
+
|
|
1959
|
+
// bail if no items to remove
|
|
1960
|
+
if ( !removeItems || !removeItems.length ) {
|
|
1961
|
+
return;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
removeItems.forEach( function( item ) {
|
|
1965
|
+
item.remove();
|
|
1966
|
+
// remove item from collection
|
|
1967
|
+
utils.removeFrom( this.items, item );
|
|
1968
|
+
}, this );
|
|
1969
|
+
};
|
|
1970
|
+
|
|
1971
|
+
// ----- destroy ----- //
|
|
1972
|
+
|
|
1973
|
+
// remove and disable Outlayer instance
|
|
1974
|
+
proto.destroy = function() {
|
|
1975
|
+
// clean up dynamic styles
|
|
1976
|
+
var style = this.element.style;
|
|
1977
|
+
style.height = '';
|
|
1978
|
+
style.position = '';
|
|
1979
|
+
style.width = '';
|
|
1980
|
+
// destroy items
|
|
1981
|
+
this.items.forEach( function( item ) {
|
|
1982
|
+
item.destroy();
|
|
1983
|
+
});
|
|
1984
|
+
|
|
1985
|
+
this.unbindResize();
|
|
1986
|
+
|
|
1987
|
+
var id = this.element.outlayerGUID;
|
|
1988
|
+
delete instances[ id ]; // remove reference to instance by id
|
|
1989
|
+
delete this.element.outlayerGUID;
|
|
1990
|
+
// remove data for jQuery
|
|
1991
|
+
if ( jQuery ) {
|
|
1992
|
+
jQuery.removeData( this.element, this.constructor.namespace );
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
};
|
|
1996
|
+
|
|
1997
|
+
// -------------------------- data -------------------------- //
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* get Outlayer instance from element
|
|
2001
|
+
* @param {Element} elem
|
|
2002
|
+
* @returns {Outlayer}
|
|
2003
|
+
*/
|
|
2004
|
+
Outlayer.data = function( elem ) {
|
|
2005
|
+
elem = utils.getQueryElement( elem );
|
|
2006
|
+
var id = elem && elem.outlayerGUID;
|
|
2007
|
+
return id && instances[ id ];
|
|
2008
|
+
};
|
|
2009
|
+
|
|
2010
|
+
|
|
2011
|
+
// -------------------------- create Outlayer class -------------------------- //
|
|
2012
|
+
|
|
2013
|
+
/**
|
|
2014
|
+
* create a layout class
|
|
2015
|
+
* @param {String} namespace
|
|
2016
|
+
*/
|
|
2017
|
+
Outlayer.create = function( namespace, options ) {
|
|
2018
|
+
// sub-class Outlayer
|
|
2019
|
+
var Layout = subclass( Outlayer );
|
|
2020
|
+
// apply new options and compatOptions
|
|
2021
|
+
Layout.defaults = utils.extend( {}, Outlayer.defaults );
|
|
2022
|
+
utils.extend( Layout.defaults, options );
|
|
2023
|
+
Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions );
|
|
2024
|
+
|
|
2025
|
+
Layout.namespace = namespace;
|
|
2026
|
+
|
|
2027
|
+
Layout.data = Outlayer.data;
|
|
2028
|
+
|
|
2029
|
+
// sub-class Item
|
|
2030
|
+
Layout.Item = subclass( Item );
|
|
2031
|
+
|
|
2032
|
+
// -------------------------- declarative -------------------------- //
|
|
2033
|
+
|
|
2034
|
+
utils.htmlInit( Layout, namespace );
|
|
2035
|
+
|
|
2036
|
+
// -------------------------- jQuery bridge -------------------------- //
|
|
2037
|
+
|
|
2038
|
+
// make into jQuery plugin
|
|
2039
|
+
if ( jQuery && jQuery.bridget ) {
|
|
2040
|
+
jQuery.bridget( namespace, Layout );
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
return Layout;
|
|
2044
|
+
};
|
|
2045
|
+
|
|
2046
|
+
function subclass( Parent ) {
|
|
2047
|
+
function SubClass() {
|
|
2048
|
+
Parent.apply( this, arguments );
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
SubClass.prototype = Object.create( Parent.prototype );
|
|
2052
|
+
SubClass.prototype.constructor = SubClass;
|
|
2053
|
+
|
|
2054
|
+
return SubClass;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
// ----- helpers ----- //
|
|
2058
|
+
|
|
2059
|
+
// how many milliseconds are in each unit
|
|
2060
|
+
var msUnits = {
|
|
2061
|
+
ms: 1,
|
|
2062
|
+
s: 1000
|
|
2063
|
+
};
|
|
2064
|
+
|
|
2065
|
+
// munge time-like parameter into millisecond number
|
|
2066
|
+
// '0.4s' -> 40
|
|
2067
|
+
function getMilliseconds( time ) {
|
|
2068
|
+
if ( typeof time == 'number' ) {
|
|
2069
|
+
return time;
|
|
2070
|
+
}
|
|
2071
|
+
var matches = time.match( /(^\d*\.?\d*)(\w*)/ );
|
|
2072
|
+
var num = matches && matches[1];
|
|
2073
|
+
var unit = matches && matches[2];
|
|
2074
|
+
if ( !num.length ) {
|
|
2075
|
+
return 0;
|
|
2076
|
+
}
|
|
2077
|
+
num = parseFloat( num );
|
|
2078
|
+
var mult = msUnits[ unit ] || 1;
|
|
2079
|
+
return num * mult;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
// ----- fin ----- //
|
|
2083
|
+
|
|
2084
|
+
// back in global
|
|
2085
|
+
Outlayer.Item = Item;
|
|
2086
|
+
|
|
2087
|
+
return Outlayer;
|
|
2088
|
+
|
|
2089
|
+
}));
|
|
2090
|
+
}(outlayer));
|
|
2091
|
+
|
|
2092
|
+
/*!
|
|
2093
|
+
* Masonry v4.2.2
|
|
2094
|
+
* Cascading grid layout library
|
|
2095
|
+
* https://masonry.desandro.com
|
|
2096
|
+
* MIT License
|
|
2097
|
+
* by David DeSandro
|
|
2098
|
+
*/
|
|
2099
|
+
|
|
2100
|
+
(function (module) {
|
|
2101
|
+
( function( window, factory ) {
|
|
2102
|
+
// universal module definition
|
|
2103
|
+
/* jshint strict: false */ /*globals define, module, require */
|
|
2104
|
+
if ( module.exports ) {
|
|
2105
|
+
// CommonJS
|
|
2106
|
+
module.exports = factory(
|
|
2107
|
+
outlayer.exports,
|
|
2108
|
+
getSize.exports
|
|
2109
|
+
);
|
|
2110
|
+
} else {
|
|
2111
|
+
// browser global
|
|
2112
|
+
window.Masonry = factory(
|
|
2113
|
+
window.Outlayer,
|
|
2114
|
+
window.getSize
|
|
2115
|
+
);
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
}( window, function factory( Outlayer, getSize ) {
|
|
2119
|
+
|
|
2120
|
+
// -------------------------- masonryDefinition -------------------------- //
|
|
2121
|
+
|
|
2122
|
+
// create an Outlayer layout class
|
|
2123
|
+
var Masonry = Outlayer.create('masonry');
|
|
2124
|
+
// isFitWidth -> fitWidth
|
|
2125
|
+
Masonry.compatOptions.fitWidth = 'isFitWidth';
|
|
2126
|
+
|
|
2127
|
+
var proto = Masonry.prototype;
|
|
2128
|
+
|
|
2129
|
+
proto._resetLayout = function() {
|
|
2130
|
+
this.getSize();
|
|
2131
|
+
this._getMeasurement( 'columnWidth', 'outerWidth' );
|
|
2132
|
+
this._getMeasurement( 'gutter', 'outerWidth' );
|
|
2133
|
+
this.measureColumns();
|
|
2134
|
+
|
|
2135
|
+
// reset column Y
|
|
2136
|
+
this.colYs = [];
|
|
2137
|
+
for ( var i=0; i < this.cols; i++ ) {
|
|
2138
|
+
this.colYs.push( 0 );
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
this.maxY = 0;
|
|
2142
|
+
this.horizontalColIndex = 0;
|
|
2143
|
+
};
|
|
2144
|
+
|
|
2145
|
+
proto.measureColumns = function() {
|
|
2146
|
+
this.getContainerWidth();
|
|
2147
|
+
// if columnWidth is 0, default to outerWidth of first item
|
|
2148
|
+
if ( !this.columnWidth ) {
|
|
2149
|
+
var firstItem = this.items[0];
|
|
2150
|
+
var firstItemElem = firstItem && firstItem.element;
|
|
2151
|
+
// columnWidth fall back to item of first element
|
|
2152
|
+
this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth ||
|
|
2153
|
+
// if first elem has no width, default to size of container
|
|
2154
|
+
this.containerWidth;
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
var columnWidth = this.columnWidth += this.gutter;
|
|
2158
|
+
|
|
2159
|
+
// calculate columns
|
|
2160
|
+
var containerWidth = this.containerWidth + this.gutter;
|
|
2161
|
+
var cols = containerWidth / columnWidth;
|
|
2162
|
+
// fix rounding errors, typically with gutters
|
|
2163
|
+
var excess = columnWidth - containerWidth % columnWidth;
|
|
2164
|
+
// if overshoot is less than a pixel, round up, otherwise floor it
|
|
2165
|
+
var mathMethod = excess && excess < 1 ? 'round' : 'floor';
|
|
2166
|
+
cols = Math[ mathMethod ]( cols );
|
|
2167
|
+
this.cols = Math.max( cols, 1 );
|
|
2168
|
+
};
|
|
2169
|
+
|
|
2170
|
+
proto.getContainerWidth = function() {
|
|
2171
|
+
// container is parent if fit width
|
|
2172
|
+
var isFitWidth = this._getOption('fitWidth');
|
|
2173
|
+
var container = isFitWidth ? this.element.parentNode : this.element;
|
|
2174
|
+
// check that this.size and size are there
|
|
2175
|
+
// IE8 triggers resize on body size change, so they might not be
|
|
2176
|
+
var size = getSize( container );
|
|
2177
|
+
this.containerWidth = size && size.innerWidth;
|
|
2178
|
+
};
|
|
2179
|
+
|
|
2180
|
+
proto._getItemLayoutPosition = function( item ) {
|
|
2181
|
+
item.getSize();
|
|
2182
|
+
// how many columns does this brick span
|
|
2183
|
+
var remainder = item.size.outerWidth % this.columnWidth;
|
|
2184
|
+
var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil';
|
|
2185
|
+
// round if off by 1 pixel, otherwise use ceil
|
|
2186
|
+
var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth );
|
|
2187
|
+
colSpan = Math.min( colSpan, this.cols );
|
|
2188
|
+
// use horizontal or top column position
|
|
2189
|
+
var colPosMethod = this.options.horizontalOrder ?
|
|
2190
|
+
'_getHorizontalColPosition' : '_getTopColPosition';
|
|
2191
|
+
var colPosition = this[ colPosMethod ]( colSpan, item );
|
|
2192
|
+
// position the brick
|
|
2193
|
+
var position = {
|
|
2194
|
+
x: this.columnWidth * colPosition.col,
|
|
2195
|
+
y: colPosition.y
|
|
2196
|
+
};
|
|
2197
|
+
// apply setHeight to necessary columns
|
|
2198
|
+
var setHeight = colPosition.y + item.size.outerHeight;
|
|
2199
|
+
var setMax = colSpan + colPosition.col;
|
|
2200
|
+
for ( var i = colPosition.col; i < setMax; i++ ) {
|
|
2201
|
+
this.colYs[i] = setHeight;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
return position;
|
|
2205
|
+
};
|
|
2206
|
+
|
|
2207
|
+
proto._getTopColPosition = function( colSpan ) {
|
|
2208
|
+
var colGroup = this._getTopColGroup( colSpan );
|
|
2209
|
+
// get the minimum Y value from the columns
|
|
2210
|
+
var minimumY = Math.min.apply( Math, colGroup );
|
|
2211
|
+
|
|
2212
|
+
return {
|
|
2213
|
+
col: colGroup.indexOf( minimumY ),
|
|
2214
|
+
y: minimumY,
|
|
2215
|
+
};
|
|
2216
|
+
};
|
|
2217
|
+
|
|
2218
|
+
/**
|
|
2219
|
+
* @param {Number} colSpan - number of columns the element spans
|
|
2220
|
+
* @returns {Array} colGroup
|
|
2221
|
+
*/
|
|
2222
|
+
proto._getTopColGroup = function( colSpan ) {
|
|
2223
|
+
if ( colSpan < 2 ) {
|
|
2224
|
+
// if brick spans only one column, use all the column Ys
|
|
2225
|
+
return this.colYs;
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
var colGroup = [];
|
|
2229
|
+
// how many different places could this brick fit horizontally
|
|
2230
|
+
var groupCount = this.cols + 1 - colSpan;
|
|
2231
|
+
// for each group potential horizontal position
|
|
2232
|
+
for ( var i = 0; i < groupCount; i++ ) {
|
|
2233
|
+
colGroup[i] = this._getColGroupY( i, colSpan );
|
|
2234
|
+
}
|
|
2235
|
+
return colGroup;
|
|
2236
|
+
};
|
|
2237
|
+
|
|
2238
|
+
proto._getColGroupY = function( col, colSpan ) {
|
|
2239
|
+
if ( colSpan < 2 ) {
|
|
2240
|
+
return this.colYs[ col ];
|
|
2241
|
+
}
|
|
2242
|
+
// make an array of colY values for that one group
|
|
2243
|
+
var groupColYs = this.colYs.slice( col, col + colSpan );
|
|
2244
|
+
// and get the max value of the array
|
|
2245
|
+
return Math.max.apply( Math, groupColYs );
|
|
2246
|
+
};
|
|
2247
|
+
|
|
2248
|
+
// get column position based on horizontal index. #873
|
|
2249
|
+
proto._getHorizontalColPosition = function( colSpan, item ) {
|
|
2250
|
+
var col = this.horizontalColIndex % this.cols;
|
|
2251
|
+
var isOver = colSpan > 1 && col + colSpan > this.cols;
|
|
2252
|
+
// shift to next row if item can't fit on current row
|
|
2253
|
+
col = isOver ? 0 : col;
|
|
2254
|
+
// don't let zero-size items take up space
|
|
2255
|
+
var hasSize = item.size.outerWidth && item.size.outerHeight;
|
|
2256
|
+
this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex;
|
|
2257
|
+
|
|
2258
|
+
return {
|
|
2259
|
+
col: col,
|
|
2260
|
+
y: this._getColGroupY( col, colSpan ),
|
|
2261
|
+
};
|
|
2262
|
+
};
|
|
2263
|
+
|
|
2264
|
+
proto._manageStamp = function( stamp ) {
|
|
2265
|
+
var stampSize = getSize( stamp );
|
|
2266
|
+
var offset = this._getElementOffset( stamp );
|
|
2267
|
+
// get the columns that this stamp affects
|
|
2268
|
+
var isOriginLeft = this._getOption('originLeft');
|
|
2269
|
+
var firstX = isOriginLeft ? offset.left : offset.right;
|
|
2270
|
+
var lastX = firstX + stampSize.outerWidth;
|
|
2271
|
+
var firstCol = Math.floor( firstX / this.columnWidth );
|
|
2272
|
+
firstCol = Math.max( 0, firstCol );
|
|
2273
|
+
var lastCol = Math.floor( lastX / this.columnWidth );
|
|
2274
|
+
// lastCol should not go over if multiple of columnWidth #425
|
|
2275
|
+
lastCol -= lastX % this.columnWidth ? 0 : 1;
|
|
2276
|
+
lastCol = Math.min( this.cols - 1, lastCol );
|
|
2277
|
+
// set colYs to bottom of the stamp
|
|
2278
|
+
|
|
2279
|
+
var isOriginTop = this._getOption('originTop');
|
|
2280
|
+
var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) +
|
|
2281
|
+
stampSize.outerHeight;
|
|
2282
|
+
for ( var i = firstCol; i <= lastCol; i++ ) {
|
|
2283
|
+
this.colYs[i] = Math.max( stampMaxY, this.colYs[i] );
|
|
2284
|
+
}
|
|
2285
|
+
};
|
|
2286
|
+
|
|
2287
|
+
proto._getContainerSize = function() {
|
|
2288
|
+
this.maxY = Math.max.apply( Math, this.colYs );
|
|
2289
|
+
var size = {
|
|
2290
|
+
height: this.maxY
|
|
2291
|
+
};
|
|
2292
|
+
|
|
2293
|
+
if ( this._getOption('fitWidth') ) {
|
|
2294
|
+
size.width = this._getContainerFitWidth();
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
return size;
|
|
2298
|
+
};
|
|
2299
|
+
|
|
2300
|
+
proto._getContainerFitWidth = function() {
|
|
2301
|
+
var unusedCols = 0;
|
|
2302
|
+
// count unused columns
|
|
2303
|
+
var i = this.cols;
|
|
2304
|
+
while ( --i ) {
|
|
2305
|
+
if ( this.colYs[i] !== 0 ) {
|
|
2306
|
+
break;
|
|
2307
|
+
}
|
|
2308
|
+
unusedCols++;
|
|
2309
|
+
}
|
|
2310
|
+
// fit container to columns that have been used
|
|
2311
|
+
return ( this.cols - unusedCols ) * this.columnWidth - this.gutter;
|
|
2312
|
+
};
|
|
2313
|
+
|
|
2314
|
+
proto.needsResizeLayout = function() {
|
|
2315
|
+
var previousWidth = this.containerWidth;
|
|
2316
|
+
this.getContainerWidth();
|
|
2317
|
+
return previousWidth != this.containerWidth;
|
|
2318
|
+
};
|
|
2319
|
+
|
|
2320
|
+
return Masonry;
|
|
2321
|
+
|
|
2322
|
+
}));
|
|
2323
|
+
}(masonry));
|
|
2324
|
+
|
|
2325
|
+
const Masonry = masonry.exports;
|
|
2326
|
+
|
|
2327
|
+
const spwMosaicCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{-webkit-text-size-adjust:100%;line-height:1.3}h1,h2,h3,h4,h5,h6,li,p,ul{margin:0;padding:0}ul{list-style:none}:host{-webkit-text-size-adjust:100%;box-sizing:border-box;display:block;font-size:100%;line-height:1.3;margin-left:-.75rem;margin-right:-.75rem}:host *,:host :after,:host :before{box-sizing:inherit;font-family:Nunito Sans}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--spw-ds-container-xl:1220px;--spw-ds-container-lg:1024px;--spw-ds-container-md:768px;--spw-ds-container-sm:640px}.spw-ds-container{width:100%}@media (min-width:460px){.spw-ds-container{max-width:var(--spw-ds-container-sm)}}@media (min-width:768px){.spw-ds-container{max-width:var(--spw-ds-container-md)}}@media (min-width:1024px){.spw-ds-container{max-width:var(--spw-ds-container-lg)}}@media (min-width:1350px){.spw-ds-container{max-width:var(--spw-ds-container-xl)}}.spw-mosaic--no-masonry{display:flex;flex-wrap:wrap}";
|
|
2328
|
+
const SpwMosaicStyle0 = spwMosaicCss;
|
|
2329
|
+
|
|
2330
|
+
const SpwMosaic$1 = /*@__PURE__*/ proxyCustomElement(class SpwMosaic extends H {
|
|
2331
|
+
constructor() {
|
|
2332
|
+
super();
|
|
2333
|
+
this.__registerHost();
|
|
2334
|
+
this.__attachShadow();
|
|
2335
|
+
this.items = undefined;
|
|
2336
|
+
this.isMasonry = false;
|
|
2337
|
+
this.colsMobile = 1;
|
|
2338
|
+
this.colsTablet = 2;
|
|
2339
|
+
this.colsDesktop = 3;
|
|
2340
|
+
this.initialized = false;
|
|
2341
|
+
}
|
|
2342
|
+
itemsChanged(newValue, oldValue) {
|
|
2343
|
+
if (newValue !== oldValue && this.isMasonry) {
|
|
2344
|
+
this.refreshMasonryLayout();
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
isMasonryChanged(newValue) {
|
|
2348
|
+
if (newValue) {
|
|
2349
|
+
this.initializeMasonry();
|
|
2350
|
+
}
|
|
2351
|
+
else {
|
|
2352
|
+
this.destroyMasonry();
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
async waitForImages() {
|
|
2356
|
+
const images = this.el.shadowRoot.querySelectorAll('img');
|
|
2357
|
+
const loadPromises = Array.from(images).map(image => {
|
|
2358
|
+
return new Promise(resolve => {
|
|
2359
|
+
if (image.complete) {
|
|
2360
|
+
resolve();
|
|
2361
|
+
}
|
|
2362
|
+
else {
|
|
2363
|
+
image.addEventListener('load', () => resolve(), { once: true });
|
|
2364
|
+
}
|
|
2365
|
+
});
|
|
2366
|
+
});
|
|
2367
|
+
await Promise.all(loadPromises);
|
|
2368
|
+
}
|
|
2369
|
+
emitConfigurationChanged() {
|
|
2370
|
+
const event = new CustomEvent('mosaicConfigurationChanged', {
|
|
2371
|
+
detail: {
|
|
2372
|
+
colsMobile: this.colsMobile,
|
|
2373
|
+
colsTablet: this.colsTablet,
|
|
2374
|
+
colsDesktop: this.colsDesktop,
|
|
2375
|
+
},
|
|
2376
|
+
bubbles: true,
|
|
2377
|
+
composed: true,
|
|
2378
|
+
});
|
|
2379
|
+
this.el.dispatchEvent(event);
|
|
2380
|
+
}
|
|
2381
|
+
configurationChanged() {
|
|
2382
|
+
this.emitConfigurationChanged();
|
|
2383
|
+
}
|
|
2384
|
+
async refreshMasonryLayout() {
|
|
2385
|
+
if (!this.isMasonry)
|
|
2386
|
+
return;
|
|
2387
|
+
await this.waitForImages();
|
|
2388
|
+
this.initializeMasonry();
|
|
2389
|
+
}
|
|
2390
|
+
componentDidLoad() {
|
|
2391
|
+
if (this.isMasonry) {
|
|
2392
|
+
this.initializeMasonry();
|
|
2393
|
+
}
|
|
2394
|
+
this.observeSlotChanges();
|
|
2395
|
+
this.emitConfigurationChanged();
|
|
2396
|
+
}
|
|
2397
|
+
componentDidUpdate() {
|
|
2398
|
+
if (this.isMasonry) {
|
|
2399
|
+
this.refreshMasonryLayout();
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
disconnectedCallback() {
|
|
2403
|
+
this.destroyMasonry();
|
|
2404
|
+
if (this.observer) {
|
|
2405
|
+
this.observer.disconnect();
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
async initializeMasonry() {
|
|
2409
|
+
if (!this.isMasonry)
|
|
2410
|
+
return;
|
|
2411
|
+
requestAnimationFrame(() => {
|
|
2412
|
+
const slot = this.el.shadowRoot.querySelector('slot');
|
|
2413
|
+
const masonryItems = slot.assignedElements({ flatten: true });
|
|
2414
|
+
if (masonryItems.length > 0) {
|
|
2415
|
+
this.masonry = new Masonry(this.el, {
|
|
2416
|
+
itemSelector: 'spw-mosaic-item',
|
|
2417
|
+
columnWidth: 'spw-mosaic-item',
|
|
2418
|
+
percentPosition: true,
|
|
2419
|
+
});
|
|
2420
|
+
this.initialized = true;
|
|
2421
|
+
masonryItems.forEach(item => {
|
|
2422
|
+
const images = item.querySelectorAll('img');
|
|
2423
|
+
images.forEach(image => {
|
|
2424
|
+
if (!image.complete) {
|
|
2425
|
+
image.addEventListener('load', this.updateMasonryLayout.bind(this), { once: true });
|
|
2426
|
+
}
|
|
2427
|
+
});
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
});
|
|
2431
|
+
}
|
|
2432
|
+
updateMasonryLayout() {
|
|
2433
|
+
if (this.masonry && this.initialized && this.isMasonry) {
|
|
2434
|
+
this.masonry.layout();
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
destroyMasonry() {
|
|
2438
|
+
if (this.masonry) {
|
|
2439
|
+
this.masonry.destroy();
|
|
2440
|
+
this.masonry = null;
|
|
2441
|
+
this.initialized = false;
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
observeSlotChanges() {
|
|
2445
|
+
const slot = this.el.shadowRoot.querySelector('slot');
|
|
2446
|
+
this.observer = new MutationObserver(mutations => {
|
|
2447
|
+
for (const mutation of mutations) {
|
|
2448
|
+
if (mutation.type === 'childList' && this.initialized && this.isMasonry) {
|
|
2449
|
+
this.initializeMasonry();
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
});
|
|
2453
|
+
this.observer.observe(slot, { childList: true });
|
|
2454
|
+
}
|
|
2455
|
+
get elementClass() {
|
|
2456
|
+
return {
|
|
2457
|
+
'spw-mosaic--no-masonry': !this.isMasonry,
|
|
2458
|
+
};
|
|
2459
|
+
}
|
|
2460
|
+
render() {
|
|
2461
|
+
return (h(Host, { key: '1437ea42434276d63459b3aa137916123de1c8e9' }, h("div", { key: 'c024eb5ed7580382d42559746c79c031d7f25bf6', class: this.elementClass }, h("slot", { key: '65290a9d3d8bf83f365e2c4881ba55172f2b1499' }))));
|
|
2462
|
+
}
|
|
2463
|
+
get el() { return this; }
|
|
2464
|
+
static get watchers() { return {
|
|
2465
|
+
"items": ["itemsChanged"],
|
|
2466
|
+
"isMasonry": ["isMasonryChanged"],
|
|
2467
|
+
"colsMobile": ["configurationChanged"],
|
|
2468
|
+
"colsTablet": ["configurationChanged"],
|
|
2469
|
+
"colsDesktop": ["configurationChanged"]
|
|
2470
|
+
}; }
|
|
2471
|
+
static get style() { return SpwMosaicStyle0; }
|
|
2472
|
+
}, [1, "spw-mosaic", {
|
|
2473
|
+
"items": [8],
|
|
2474
|
+
"isMasonry": [4, "is-masonry"],
|
|
2475
|
+
"colsMobile": [2, "cols-mobile"],
|
|
2476
|
+
"colsTablet": [2, "cols-tablet"],
|
|
2477
|
+
"colsDesktop": [2, "cols-desktop"],
|
|
2478
|
+
"initialized": [32],
|
|
2479
|
+
"waitForImages": [64],
|
|
2480
|
+
"initializeMasonry": [64]
|
|
2481
|
+
}, undefined, {
|
|
2482
|
+
"items": ["itemsChanged"],
|
|
2483
|
+
"isMasonry": ["isMasonryChanged"],
|
|
2484
|
+
"colsMobile": ["configurationChanged"],
|
|
2485
|
+
"colsTablet": ["configurationChanged"],
|
|
2486
|
+
"colsDesktop": ["configurationChanged"]
|
|
2487
|
+
}]);
|
|
2488
|
+
function defineCustomElement$1() {
|
|
2489
|
+
if (typeof customElements === "undefined") {
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2492
|
+
const components = ["spw-mosaic"];
|
|
2493
|
+
components.forEach(tagName => { switch (tagName) {
|
|
2494
|
+
case "spw-mosaic":
|
|
2495
|
+
if (!customElements.get(tagName)) {
|
|
2496
|
+
customElements.define(tagName, SpwMosaic$1);
|
|
2497
|
+
}
|
|
2498
|
+
break;
|
|
2499
|
+
} });
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
const SpwMosaic = SpwMosaic$1;
|
|
2503
|
+
const defineCustomElement = defineCustomElement$1;
|
|
2504
|
+
|
|
2505
|
+
export { SpwMosaic, defineCustomElement };
|
|
2506
|
+
|
|
2507
|
+
//# sourceMappingURL=spw-mosaic.js.map
|