@mgdis/mg-components 5.15.0 → 5.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-fede8ee2.js → index-c042e24b.js} +321 -68
- package/dist/cjs/index-c042e24b.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +5 -12
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/{mg-action-more_32.cjs.entry.js → mg-action-more_34.cjs.entry.js} +341 -112
- package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -0
- package/dist/cjs/mg-components.cjs.js +5 -3
- package/dist/cjs/mg-components.cjs.js.map +1 -0
- package/dist/cjs/mg-item-more.cjs.entry.js +8 -4
- package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -0
- package/dist/cjs/{mg-menu.conf-f9d0ddec.js → mg-menu.conf-43aacf30.js} +2 -0
- package/dist/cjs/mg-menu.conf-43aacf30.js.map +1 -0
- package/dist/collection/assets/icons/index.js +184 -0
- package/dist/collection/collection-manifest.json +37 -35
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js.map +1 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +6 -4
- package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -0
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js +33 -0
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.e2e.playwright.js.map +1 -0
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +70 -0
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +1 -0
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -0
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js.map +1 -0
- package/dist/collection/components/atoms/mg-button/mg-button.js +10 -6
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -0
- package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +91 -0
- package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +1 -0
- package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +142 -0
- package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +1 -0
- package/dist/collection/components/atoms/mg-card/mg-card.conf.js +1 -0
- package/dist/collection/components/atoms/mg-card/mg-card.conf.js.map +1 -0
- package/dist/collection/components/atoms/mg-card/mg-card.js +8 -5
- package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -0
- package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js +36 -0
- package/dist/collection/components/atoms/mg-card/test/mg-card.e2e.js.map +1 -0
- package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js +43 -0
- package/dist/collection/components/atoms/mg-card/test/mg-card.spec.js.map +1 -0
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +3 -2
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -0
- package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js +15 -0
- package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.e2e.js.map +1 -0
- package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js +42 -0
- package/dist/collection/components/atoms/mg-character-left/test/mg-character-left.spec.js.map +1 -0
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +2 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -0
- package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js +11 -0
- package/dist/collection/components/atoms/mg-divider/test/mg-divider.e2e.js.map +1 -0
- package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js +14 -0
- package/dist/collection/components/atoms/mg-divider/test/mg-divider.spec.js.map +1 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +1 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js.map +1 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +11 -7
- package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -0
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js +55 -0
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.e2e.js.map +1 -0
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +84 -0
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +1 -0
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +2 -1
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -0
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.js +18 -0
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.js.map +1 -0
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +27 -0
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +1 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.conf.js +1 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.conf.js.map +1 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +6 -4
- package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -0
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.js +37 -0
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.js.map +1 -0
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +71 -0
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +1 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.css +43 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +50 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +1 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +0 -43
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +64 -17
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -0
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +132 -0
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +1 -0
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +264 -0
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/MgInput.conf.js.map +1 -0
- package/dist/collection/components/molecules/inputs/MgInput.js +3 -2
- package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +12 -7
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +18 -12
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +243 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +581 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +10 -8
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js +123 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.e2e.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +324 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +46 -23
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js +212 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.e2e.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +401 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +10 -7
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js +115 -0
- package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.e2e.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +234 -0
- package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +10 -7
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +154 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +295 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +14 -9
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js +194 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.e2e.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +344 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +12 -8
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.js +171 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +280 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +10 -7
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js +129 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.e2e.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +255 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +6 -4
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.js +125 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +203 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +1 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +9 -5
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.js +268 -0
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js +175 -0
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.spec.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +1 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +12 -9
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.js +119 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js +295 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js +1 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +27 -14
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -0
- package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js +128 -0
- package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js +187 -0
- package/dist/collection/components/molecules/mg-action-more/test/mg-action-more.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-details/mg-details.js +3 -2
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -0
- package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js +30 -0
- package/dist/collection/components/molecules/mg-details/test/mg-details.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +42 -0
- package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +17 -7
- package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -0
- package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js +169 -0
- package/dist/collection/components/molecules/mg-form/test/mg-form.e2e.js.map +1 -0
- package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +277 -0
- package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +3 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -0
- package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js +39 -0
- package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.e2e.js.map +1 -0
- package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js +36 -0
- package/dist/collection/components/molecules/mg-illustrated-message/test/mg-illustrated-message.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.conf.js +1 -0
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +15 -9
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -0
- package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js +85 -0
- package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js +106 -0
- package/dist/collection/components/molecules/mg-item-more/test/mg-item-more.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-message/mg-message.conf.js +1 -0
- package/dist/collection/components/molecules/mg-message/mg-message.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +7 -5
- package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -0
- package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js +64 -0
- package/dist/collection/components/molecules/mg-message/test/mg-message.e2e.js.map +1 -0
- package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +109 -0
- package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-modal/mg-modal.conf.js +5 -0
- package/dist/collection/components/molecules/mg-modal/mg-modal.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +42 -8
- package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -0
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +62 -0
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js +40 -0
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.template.js.map +1 -0
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +26 -0
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +122 -0
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +1 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +5 -4
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -0
- package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js +57 -0
- package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js +121 -0
- package/dist/collection/components/molecules/mg-pagination/test/mg-pagination.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.conf.js +1 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +10 -7
- package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -0
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +106 -0
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +223 -0
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.css +135 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +101 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +0 -111
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +47 -46
- package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -0
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.js +148 -0
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.js.map +1 -0
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +130 -0
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +5 -3
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -0
- package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js +55 -0
- package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.e2e.js.map +1 -0
- package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js +55 -0
- package/dist/collection/components/molecules/mg-skip-links/test/mg-skip-links.spec.js.map +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +8 -5
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -0
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js +76 -0
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +332 -0
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/locales/index.js +4 -3
- package/dist/collection/locales/index.js.map +1 -0
- package/dist/collection/locales/index.spec.js +27 -0
- package/dist/collection/locales/index.spec.js.map +1 -0
- package/dist/collection/stories/icon-gallery.js +4 -3
- package/dist/collection/stories/icon-gallery.js.map +1 -0
- package/dist/collection/test/typography.e2e.playwright.js +12 -0
- package/dist/collection/test/typography.e2e.playwright.js.map +1 -0
- package/dist/collection/utils/behaviors.utils.js +1 -0
- package/dist/collection/utils/behaviors.utils.js.map +1 -0
- package/dist/collection/utils/behaviors.utils.spec.js +57 -0
- package/dist/collection/utils/behaviors.utils.spec.js.map +1 -0
- package/dist/collection/utils/components.utils.js +9 -7
- package/dist/collection/utils/components.utils.js.map +1 -0
- package/dist/collection/utils/components.utils.spec.js +120 -0
- package/dist/collection/utils/components.utils.spec.js.map +1 -0
- package/dist/collection/utils/e2e.test.utils.js +46 -0
- package/dist/collection/utils/e2e.test.utils.js.map +1 -0
- package/dist/collection/utils/locale.utils.js +1 -0
- package/dist/collection/utils/locale.utils.js.map +1 -0
- package/dist/collection/utils/locale.utils.spec.js +52 -0
- package/dist/collection/utils/locale.utils.spec.js.map +1 -0
- package/dist/collection/utils/playwright.e2e.test.utils.js +100 -0
- package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -0
- package/dist/collection/utils/stencil.e2e.test.utils.js +33 -0
- package/dist/collection/utils/stencil.e2e.test.utils.js.map +1 -0
- package/dist/collection/utils/unit.test.utils.js +8 -6
- package/dist/collection/utils/unit.test.utils.js.map +1 -0
- package/dist/components/MgInput.js +2 -0
- package/dist/components/MgInput.js.map +1 -0
- package/dist/components/components.utils.js +10 -7
- package/dist/components/components.utils.js.map +1 -0
- package/dist/components/index.d.ts +5 -35
- package/dist/components/index.js +3 -34
- package/dist/components/index.js.map +1 -0
- package/dist/components/index2.js +2 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/mg-action-more.js +42 -19
- package/dist/components/mg-action-more.js.map +1 -0
- package/dist/components/mg-badge.js +2 -0
- package/dist/components/mg-badge.js.map +1 -0
- package/dist/components/mg-badge2.js +8 -1
- package/dist/components/mg-badge2.js.map +1 -0
- package/dist/components/mg-button.js +2 -0
- package/dist/components/mg-button.js.map +1 -0
- package/dist/components/mg-button2.js +8 -1
- package/dist/components/mg-button2.js.map +1 -0
- package/dist/components/mg-card.js +2 -0
- package/dist/components/mg-card.js.map +1 -0
- package/dist/components/mg-card2.js +6 -1
- package/dist/components/mg-card2.js.map +1 -0
- package/dist/components/mg-character-left.js +2 -0
- package/dist/components/mg-character-left.js.map +1 -0
- package/dist/components/mg-character-left2.js +5 -1
- package/dist/components/mg-character-left2.js.map +1 -0
- package/dist/components/mg-details.js +8 -2
- package/dist/components/mg-details.js.map +1 -0
- package/dist/components/mg-divider.js +3 -1
- package/dist/components/mg-divider.js.map +1 -0
- package/dist/components/mg-form.js +17 -4
- package/dist/components/mg-form.js.map +1 -0
- package/dist/components/mg-icon.js +2 -0
- package/dist/components/mg-icon.js.map +1 -0
- package/dist/components/mg-icon2.js +87 -17
- package/dist/components/mg-icon2.js.map +1 -0
- package/dist/components/mg-illustrated-message.js +3 -1
- package/dist/components/mg-illustrated-message.js.map +1 -0
- package/dist/components/mg-input-checkbox-paginated.js +2 -0
- package/dist/components/mg-input-checkbox-paginated.js.map +1 -0
- package/dist/components/mg-input-checkbox-paginated2.js +24 -13
- package/dist/components/mg-input-checkbox-paginated2.js.map +1 -0
- package/dist/components/mg-input-checkbox.js +48 -25
- package/dist/components/mg-input-checkbox.js.map +1 -0
- package/dist/components/mg-input-date.js +23 -8
- package/dist/components/mg-input-date.js.map +1 -0
- package/dist/components/mg-input-numeric.js +58 -22
- package/dist/components/mg-input-numeric.js.map +1 -0
- package/dist/components/mg-input-password.js +21 -8
- package/dist/components/mg-input-password.js.map +1 -0
- package/dist/components/mg-input-radio.js +22 -8
- package/dist/components/mg-input-radio.js.map +1 -0
- package/dist/components/mg-input-select.js +2 -0
- package/dist/components/mg-input-select.js.map +1 -0
- package/dist/components/mg-input-select2.js +22 -8
- package/dist/components/mg-input-select2.js.map +1 -0
- package/dist/components/mg-input-text.js +2 -0
- package/dist/components/mg-input-text.js.map +1 -0
- package/dist/components/mg-input-text2.js +24 -10
- package/dist/components/mg-input-text2.js.map +1 -0
- package/dist/components/mg-input-textarea.js +24 -10
- package/dist/components/mg-input-textarea.js.map +1 -0
- package/dist/components/mg-input-title.js +2 -0
- package/dist/components/mg-input-title.js.map +1 -0
- package/dist/components/mg-input-title2.js +6 -1
- package/dist/components/mg-input-title2.js.map +1 -0
- package/dist/components/mg-input-toggle.js +23 -7
- package/dist/components/mg-input-toggle.js.map +1 -0
- package/dist/components/mg-item-more.js +31 -17
- package/dist/components/mg-item-more.js.map +1 -0
- package/dist/components/mg-menu-item.js +2 -0
- package/dist/components/mg-menu-item.js.map +1 -0
- package/dist/components/mg-menu-item2.js +27 -13
- package/dist/components/mg-menu-item2.js.map +1 -0
- package/dist/components/mg-menu.conf.js +2 -0
- package/dist/components/mg-menu.conf.js.map +1 -0
- package/dist/components/mg-menu.js +2 -0
- package/dist/components/mg-menu.js.map +1 -0
- package/dist/components/mg-menu2.js +8 -1
- package/dist/components/mg-menu2.js.map +1 -0
- package/dist/components/mg-message.js +8 -1
- package/dist/components/mg-message.js.map +1 -0
- package/dist/components/mg-modal.js +24 -5
- package/dist/components/mg-modal.js.map +1 -0
- package/dist/components/mg-pagination.js +2 -0
- package/dist/components/mg-pagination.js.map +1 -0
- package/dist/components/mg-pagination2.js +22 -11
- package/dist/components/mg-pagination2.js.map +1 -0
- package/dist/components/mg-panel.js +30 -16
- package/dist/components/mg-panel.js.map +1 -0
- package/dist/components/mg-popover-content.d.ts +11 -0
- package/dist/components/mg-popover-content.js +8 -0
- package/dist/components/mg-popover-content.js.map +1 -0
- package/dist/components/mg-popover-content2.js +90 -0
- package/dist/components/mg-popover-content2.js.map +1 -0
- package/dist/components/mg-popover.js +2 -0
- package/dist/components/mg-popover.js.map +1 -0
- package/dist/components/mg-popover2.js +61 -48
- package/dist/components/mg-popover2.js.map +1 -0
- package/dist/components/mg-skip-links.js +5 -1
- package/dist/components/mg-skip-links.js.map +1 -0
- package/dist/components/mg-tabs.js +8 -1
- package/dist/components/mg-tabs.js.map +1 -0
- package/dist/components/mg-tag.js +7 -1
- package/dist/components/mg-tag.js.map +1 -0
- package/dist/components/mg-tooltip-content.d.ts +11 -0
- package/dist/components/mg-tooltip-content.js +8 -0
- package/dist/components/mg-tooltip-content.js.map +1 -0
- package/dist/components/mg-tooltip-content2.js +43 -0
- package/dist/components/mg-tooltip-content2.js.map +1 -0
- package/dist/components/mg-tooltip.js +2 -0
- package/dist/components/mg-tooltip.js.map +1 -0
- package/dist/components/mg-tooltip2.js +71 -16
- package/dist/components/mg-tooltip2.js.map +1 -0
- package/dist/components/popper.js +2 -0
- package/dist/components/popper.js.map +1 -0
- package/dist/esm/{index-1d40b052.js → index-ce01e63b.js} +321 -68
- package/dist/esm/index-ce01e63b.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +6 -13
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/{mg-action-more_32.entry.js → mg-action-more_34.entry.js} +340 -113
- package/dist/esm/mg-action-more_34.entry.js.map +1 -0
- package/dist/esm/mg-components.js +6 -4
- package/dist/esm/mg-components.js.map +1 -0
- package/dist/esm/mg-item-more.entry.js +8 -4
- package/dist/esm/mg-item-more.entry.js.map +1 -0
- package/dist/esm/{mg-menu.conf-2cc079ae.js → mg-menu.conf-012fc9b4.js} +2 -0
- package/dist/esm/mg-menu.conf-012fc9b4.js.map +1 -0
- package/dist/mg-components/index.esm.js +2 -0
- package/dist/mg-components/index.esm.js.map +1 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +2 -1
- package/dist/mg-components/mg-components.esm.js.map +1 -0
- package/dist/mg-components/p-1aa89acf.js +3 -0
- package/dist/mg-components/p-1aa89acf.js.map +1 -0
- package/dist/mg-components/p-1d7d6fa0.js +2 -0
- package/dist/mg-components/p-1d7d6fa0.js.map +1 -0
- package/dist/mg-components/p-9257e8f1.entry.js +2 -0
- package/dist/mg-components/p-9257e8f1.entry.js.map +1 -0
- package/dist/mg-components/p-caafc9cf.entry.js +2 -0
- package/dist/mg-components/p-caafc9cf.entry.js.map +1 -0
- package/dist/types/components/atoms/mg-badge/test/mg-badge.e2e.playwright.d.ts +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.d.ts +14 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +7 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +19 -0
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +6 -1
- package/dist/types/components/molecules/mg-action-more/test/mg-action-more.e2e.playwright.d.ts +2 -0
- package/dist/types/components/molecules/mg-details/test/mg-details.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +8 -0
- package/dist/types/components/molecules/mg-item-more/test/mg-item-more.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/mg-modal/mg-modal.conf.d.ts +8 -0
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +8 -2
- package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/mg-modal/test/mg-modal.e2e.template.d.ts +12 -0
- package/dist/types/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/mg-pagination/test/mg-pagination.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/mg-panel/test/mg-panel.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +47 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +8 -11
- package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +1 -0
- package/dist/types/components.d.ts +79 -0
- package/dist/types/stencil-public-runtime.d.ts +43 -17
- package/dist/types/test/typography.e2e.playwright.d.ts +1 -0
- package/dist/types/utils/e2e.test.utils.d.ts +22 -0
- package/dist/types/utils/stencil.e2e.test.utils.d.ts +14 -0
- package/loader/index.d.ts +2 -2
- package/package.json +7 -7
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/mg-components/p-067080e4.js +0 -1
- package/dist/mg-components/p-3bf1e2f0.js +0 -2
- package/dist/mg-components/p-4ae1130f.entry.js +0 -1
- package/dist/mg-components/p-6672f590.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-icon.spec.js","sourceRoot":"","sources":["../../../../../src/components/atoms/mg-icon/test/mg-icon.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,QAAQ,MAAM,kCAAkC,CAAC;AAExD,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CACrB,WAAW,CAAC;EACV,UAAU,EAAE,CAAC,MAAM,CAAC;EACpB,QAAQ,EA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ecPage } from '@stencil/core/testing';\nimport { MgIcon } from '../mg-icon';\nimport { sizes, variantStyles, variants } from '../mg-icon.conf';\nimport iconList from '@mgdis/img/dist/icons/index.json';\n\nconst getPage = args =>\n newSpecPage({\n components: [MgIcon],\n template: () => <mg-icon {...args}></mg-icon>,\n });\n\ndescribe('mg-icon', () => {\n afterEach(() => {\n jest.clearAllMocks();\n });\n\n describe.each(iconList)('Should render %s icon', icon => {\n test.each(sizes)('in %s size', async size => {\n const { root } = await getPage({ icon, size });\n expect(root).toMatchSnapshot();\n });\n\n test.each(variants)('using %s variant', async variant => {\n const { root } = await getPage({ icon, variant });\n expect(root).toMatchSnapshot();\n });\n\n test.each(variants.flatMap(variant => variantStyles.map(variantStyle => ({ variant, variantStyle }))))('using %s variant', async ({ variant, variantStyle }) => {\n const { root } = await getPage({ icon, variant, variantStyle });\n expect(root).toMatchSnapshot();\n });\n });\n\n test('Should render a spin icon', async () => {\n const { root } = await getPage({ icon: 'check-circle', spin: true });\n expect(root).toMatchSnapshot();\n });\n\n test.each([\n { initialProps: { icon: 'chevron-up' }, initialClass: ['.mg-icon--chevron-up'], nextProps: { icon: 'chevron-down' }, nextClass: ['.mg-icon--chevron-down'] },\n { initialProps: { icon: 'chevron-up' }, initialClass: ['.mg-icon--size-regular'], nextProps: { size: 'large' }, nextClass: ['.mg-icon--size-large'] },\n {\n initialProps: { icon: 'chevron-up', variant: 'success', variantStyle: 'icon' },\n initialClass: ['.mg-icon--variant-success', '.mg-icon--variant-style-icon'],\n nextProps: { variant: 'danger', variantStyle: 'background' },\n nextClass: ['.mg-icon--variant-danger', '.mg-icon--variant-style-background'],\n },\n ])('Should replace classes on icon changes', async ({ initialProps, initialClass, nextProps, nextClass }) => {\n const page = await getPage(initialProps);\n const element = page.doc.querySelector('mg-icon');\n\n // validate inital state\n initialClass.forEach(className => {\n expect(element.shadowRoot.querySelector(className)).not.toBeNull();\n });\n\n nextClass.forEach(className => {\n expect(element.shadowRoot.querySelector(className)).toBeNull();\n });\n\n // update props\n Object.keys(nextProps).forEach(key => {\n element[key] = nextProps[key];\n });\n\n await page.waitForChanges();\n\n // validate next state\n initialClass.forEach(className => {\n expect(element.shadowRoot.querySelector(className)).toBeNull();\n });\n\n nextClass.forEach(className => {\n expect(element.shadowRoot.querySelector(className)).not.toBeNull();\n });\n expect(page.root).toMatchSnapshot();\n });\n\n describe('errors', () => {\n const iconError = ['', 'blu', undefined].map(icon => ({ props: { icon }, error: `<mg-icon> prop \"icon\" must be one of: ${iconList.join(', ')}` }));\n const sizeError = ['', 'blu'].map(size => ({ props: { icon: 'check-circle', size }, error: `<mg-icon> prop \"size\" must be one of: ${sizes.join(', ')}` }));\n const variantError = { props: { icon: 'check-circle', variant: 'blu' }, error: `<mg-icon> prop \"variant\" must be one of: ${variants.join(', ')}` };\n const variantStyleError = {\n props: { icon: 'check-circle', variantStyle: 'blu' },\n error: `<mg-icon> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}`,\n };\n\n test.each([...iconError, ...sizeError, variantError, variantStyleError])('Should throw error with invalid icon property: %s', async ({ props, error }) => {\n expect.assertions(1);\n try {\n await getPage(props);\n } catch (err) {\n expect(err.message).toMatch(error);\n }\n });\n });\n});\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
2
|
export class MgInputTitle {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.identifier = undefined;
|
|
@@ -116,3 +116,4 @@ export class MgInputTitle {
|
|
|
116
116
|
}];
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
+
//# sourceMappingURL=mg-input-title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-input-title.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-input-title/mg-input-title.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOjE,MAAM,OAAO,YAAY;;;;oBAoBJ,KAAK;mBASL,OAAO;;EAvB1B,kBAAkB,CAAC,QAAgB;IACjC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;MAC1D,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;KACpE;EACH,CAAC;EAYD,gBAAgB,CAAC,QAAkC;IACjD,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;EAC/C,CAAC;EAOD;;iBAEe;EAEf;;KAEG;EACH,iBAAiB;IACf,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;EACvC,CAAC;EAED;;;KAGG;EACH,MAAM;IACJ,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC7B,4BAA4B;IAC5B,OAAO,CACL,EAAC,OAAO,IAAC,KAAK,EAAC,gBAAgB,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU;MAClF,eAAa;MACZ,IAAI,CAAC,QAAQ,IAAI,CAChB,YAAM,KAAK,EAAC,0BAA0B;;QAC9B,YAAM,KAAK,EAAC,aAAa,QAAS,CACnC,CACR,CACO,CACX,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'mg-input-title',\n styleUrl: 'mg-input-title.scss',\n scoped: true,\n})\nexport class MgInputTitle {\n /**\n * Label input id\n */\n @Prop() identifier!: string;\n @Watch('identifier')\n validateIdentifier(newValue: string): void {\n if (typeof newValue !== 'string' || newValue.trim() === '') {\n throw new Error('<mg-input-title> prop \"identifier\" is required.');\n }\n }\n\n /**\n * If input is required an asterisk is added at the end of the label\n */\n @Prop() required: boolean;\n\n /**\n * Switch from label to fieldset sementic\n */\n @Prop() isLegend = false;\n @Watch('isLegend')\n validateIsLegend(newValue: MgInputTitle['isLegend']) {\n this.tagName = newValue ? 'legend' : 'label';\n }\n\n /**\n * Component parent tagname\n */\n @State() tagName = 'label';\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Init tag name\n */\n componentWillLoad(): void {\n this.validateIdentifier(this.identifier);\n this.validateIsLegend(this.isLegend);\n }\n\n /**\n * Render\n * @returns HTML element\n */\n render(): HTMLElement {\n const TagName = this.tagName;\n // \\u00A0 represent a \n return (\n <TagName class=\"mg-input-title\" htmlFor={this.isLegend ? undefined : this.identifier}>\n <slot></slot>\n {this.required && (\n <span class=\"mg-input-title__required\">\n <span class=\"is-asterisk\">*</span>\n </span>\n )}\n </TagName>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createPage } from "../../../../utils/stencil.e2e.test.utils";
|
|
2
|
+
describe('mg-input-title', () => {
|
|
3
|
+
test('Should render', async () => {
|
|
4
|
+
const props = [
|
|
5
|
+
{ isLegend: false, required: false },
|
|
6
|
+
{ isLegend: false, required: true },
|
|
7
|
+
{ isLegend: true, required: false },
|
|
8
|
+
{ isLegend: true, required: true },
|
|
9
|
+
];
|
|
10
|
+
const html = props
|
|
11
|
+
.map(({ isLegend, required }) => `<div><mg-input-title identifier="identifier" is-legend="${isLegend}" required=${required}>Label</mg-input-title></div>`)
|
|
12
|
+
.join('');
|
|
13
|
+
const page = await createPage(html, { width: 50, height: 75 });
|
|
14
|
+
const screenshot = await page.screenshot();
|
|
15
|
+
expect(screenshot).toMatchImageSnapshot();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=mg-input-title.e2e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-input-title.e2e.js","sourceRoot":"","sources":["../../../../../src/components/atoms/mg-input-title/test/mg-input-title.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;EAC9B,IAAI,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;IAC/B,MAAM,KAAK,GAAG;MACZ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;MACpC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE;MACnC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;MACnC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;KACnC,CAAC;IACF,MAAM,IAAI,GAAG,KAAK;OACf,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,2DAA2D,QAAQ,cAAc,QAAQ,+BAA+B,CAAC;OACzJ,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAE/D,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,EAAE,CAAC;EAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { createPage } from '../../../../utils/stencil.e2e.test.utils';\n\ndescribe('mg-input-title', () => {\n test('Should render', async () => {\n const props = [\n { isLegend: false, required: false },\n { isLegend: false, required: true },\n { isLegend: true, required: false },\n { isLegend: true, required: true },\n ];\n const html = props\n .map(({ isLegend, required }) => `<div><mg-input-title identifier=\"identifier\" is-legend=\"${isLegend}\" required=${required}>Label</mg-input-title></div>`)\n .join('');\n const page = await createPage(html, { width: 50, height: 75 });\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n});\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
3
|
+
import { MgInputTitle } from "../mg-input-title";
|
|
4
|
+
const getPage = args => newSpecPage({
|
|
5
|
+
components: [MgInputTitle],
|
|
6
|
+
template: () => h("mg-input-title", Object.assign({}, args), "mg-input-title"),
|
|
7
|
+
});
|
|
8
|
+
describe('mg-input-title', () => {
|
|
9
|
+
test.each([
|
|
10
|
+
{ required: false, identifier: 'identifier' },
|
|
11
|
+
{ required: true, identifier: 'identifier' },
|
|
12
|
+
{ isLegend: true, identifier: 'identifier' },
|
|
13
|
+
])('Should render label with args %s', async (args) => {
|
|
14
|
+
const { root } = await getPage(args);
|
|
15
|
+
expect(root).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
test.each(['', ' ', undefined])('Should throw error, case invalid identifier prop', async (identifier) => {
|
|
18
|
+
expect.assertions(1);
|
|
19
|
+
try {
|
|
20
|
+
await getPage({ identifier });
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
expect(err.message).toContain('<mg-input-title> prop "identifier" is required.');
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=mg-input-title.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-input-title.spec.js","sourceRoot":"","sources":["../../../../../src/components/atoms/mg-input-title/test/mg-input-title.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CACrB,WAAW,CAAC;EACV,UAAU,EAAE,CAAC,YAAY,CAAC;EAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,sCAAoB,IAAI,oBAAiC;CAC1E,CAAC,CAAC;AAEL,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;EAC9B,IAAI,CAAC,IAAI,CAAC;IACR,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE;IAC7C,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE;IAC5C,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE;GAC7C,CAAC,CAAC,kCAAkC,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE;IAClD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;EACjC,CAAC,CAAC,CAAC;EAEH,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,kDAAkD,EAAE,KAAK,EAAC,UAAU,EAAC,EAAE;IACrG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrB,IAAI;MACF,MAAM,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;KAC/B;IAAC,OAAO,GAAG,EAAE;MACZ,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,iDAAiD,CAAC,CAAC;KAClF;EACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { MgInputTitle } from '../mg-input-title';\n\nconst getPage = args =>\n newSpecPage({\n components: [MgInputTitle],\n template: () => <mg-input-title {...args}>mg-input-title</mg-input-title>,\n });\n\ndescribe('mg-input-title', () => {\n test.each([\n { required: false, identifier: 'identifier' },\n { required: true, identifier: 'identifier' },\n { isLegend: true, identifier: 'identifier' },\n ])('Should render label with args %s', async args => {\n const { root } = await getPage(args);\n expect(root).toMatchSnapshot();\n });\n\n test.each(['', ' ', undefined])('Should throw error, case invalid identifier prop', async identifier => {\n expect.assertions(1);\n try {\n await getPage({ identifier });\n } catch (err) {\n expect(err.message).toContain('<mg-input-title> prop \"identifier\" is required.');\n }\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-tag.conf.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-tag/mg-tag.conf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC","sourcesContent":["/**\n * List of all possibles variants\n */\nexport const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'] as const;\n\n/**\n * TagVariantType type from tag variants\n */\nexport type TagVariantType = (typeof variants)[number];\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h } from
|
|
2
|
-
import { variants } from
|
|
3
|
-
import { ClassList } from
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { variants } from "./mg-tag.conf";
|
|
3
|
+
import { ClassList } from "../../../utils/components.utils";
|
|
4
4
|
export class MgTag {
|
|
5
5
|
constructor() {
|
|
6
6
|
/************
|
|
@@ -94,7 +94,8 @@ export class MgTag {
|
|
|
94
94
|
"references": {
|
|
95
95
|
"TagVariantType": {
|
|
96
96
|
"location": "import",
|
|
97
|
-
"path": "./mg-tag.conf"
|
|
97
|
+
"path": "./mg-tag.conf",
|
|
98
|
+
"id": "src/components/atoms/mg-tag/mg-tag.conf.ts::TagVariantType"
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
},
|
|
@@ -163,3 +164,4 @@ export class MgTag {
|
|
|
163
164
|
}];
|
|
164
165
|
}
|
|
165
166
|
}
|
|
167
|
+
//# sourceMappingURL=mg-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-tag.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-tag/mg-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAkB,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAM5D,MAAM,OAAO,KAAK;;IAChB;;kBAEc;IAEd,UAAU;IACO,iBAAY,GAAG,iBAAiB,CAAC;IACjC,cAAS,GAAG,cAAc,CAAC;mBAcV,QAAQ,CAAC,CAAC,CAAC;;;2BAwCP,IAAI,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;;EAtC/D,eAAe,CAAC,QAA0B,EAAE,QAA2B;IACrE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;MAChC,MAAM,IAAI,KAAK,CAAC,2CAA2C,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACpF;SAAM;MACL,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC1B,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,WAAW,QAAQ,EAAE,CAAC,CAAC;OACpD;MACD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,WAAW,QAAQ,EAAE,CAAC,CAAC;KACjD;EACH,CAAC;EAOD,eAAe,CAAC,QAA0B;IACxC,IAAI,QAAQ;MAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;;MACrD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;EACtD,CAAC;EAOD,YAAY,CAAC,QAAuB;IAClC,mBAAmB;IACnB,IAAI,QAAQ,IAAI,IAAI,CAAC,OAAO;MAAE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAE3G,cAAc;IACd,IAAI,QAAQ;MAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;MAClD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;EACnD,CAAC;EAOD;;iBAEe;EAEf;;;KAGG;EACK,mBAAmB,CAAC,WAAmB;IAC7C,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE;MAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;EAClI,CAAC;EAED;;iBAEe;EAEf;;KAEG;EACH,iBAAiB;IACf,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;EACrD,CAAC;EAED;;;KAGG;EACH,MAAM;IACJ,OAAO,CACL,YAAM,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;MACtC,eAAa,CACR,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, State, Watch, Element } from '@stencil/core';\nimport { TagVariantType, variants } from './mg-tag.conf';\nimport { ClassList } from '../../../utils/components.utils';\n@Component({\n tag: 'mg-tag',\n styleUrl: 'mg-tag.scss',\n shadow: true,\n})\nexport class MgTag {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classOutline = 'mg-tag--outline';\n private readonly classSoft = 'mg-tag--soft';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTagElement;\n\n /**\n * Define tag variant\n */\n @Prop() variant: TagVariantType = variants[0]; // primary\n @Watch('variant')\n validateVariant(newValue: MgTag['variant'], oldValue?: MgTag['variant']): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-tag> prop \"variant\" must be one of: ${variants.join(', ')}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-tag--${oldValue}`);\n }\n this.classCollection.add(`mg-tag--${newValue}`);\n }\n }\n\n /**\n * Define if tag is using outline style\n */\n @Prop() outline: boolean;\n @Watch('outline')\n validateOutline(newValue: MgTag['outline']): void {\n if (newValue) this.classCollection.add(this.classOutline);\n else this.classCollection.delete(this.classOutline);\n }\n\n /**\n * Define if tag is using soft style\n */\n @Prop() soft: boolean;\n @Watch('soft')\n validateSoft(newValue: MgTag['soft']): void {\n // usage validation\n if (newValue && this.outline) throw new Error('<mg-tag> prop \"soft\" can NOT be used with prop \"outline\".');\n\n // apply class\n if (newValue) this.classCollection.add(this.classSoft);\n else this.classCollection.delete(this.classSoft);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-tag']);\n\n /*************\n * Methods *\n *************/\n\n /**\n * Validate the given textContent\n * @param textContent - html element textContent property\n */\n private validateTextContent(textContent: string): void {\n if (typeof textContent !== 'string' || textContent.trim() === '') throw new Error('<mg-tag> slot must contain a text content.');\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n this.validateVariant(this.variant);\n this.validateOutline(this.outline);\n this.validateSoft(this.soft);\n this.validateTextContent(this.element.textContent);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <span class={this.classCollection.join()}>\n <slot></slot>\n </span>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createPage } from "../../../../utils/stencil.e2e.test.utils";
|
|
2
|
+
import { darkBackground } from "../../../../utils/e2e.test.utils";
|
|
3
|
+
import { variants } from "../mg-tag.conf";
|
|
4
|
+
describe('mg-tag', () => {
|
|
5
|
+
test('Should render', async () => {
|
|
6
|
+
const html = variants
|
|
7
|
+
.map(variant => {
|
|
8
|
+
const template = [true, false]
|
|
9
|
+
.map(icon => [
|
|
10
|
+
{ outline: false, soft: false },
|
|
11
|
+
{ outline: true, soft: false },
|
|
12
|
+
{ outline: false, soft: true },
|
|
13
|
+
]
|
|
14
|
+
.map(({ outline, soft }) => darkBackground(variant === 'secondary', `<mg-tag style="margin: 0.2rem;" variant="${variant}" outline="${outline}" soft="${soft}">${icon ? '<mg-icon icon="user"></mg-icon>' : ''}${variant}</mg-tag>`))
|
|
15
|
+
.join(''))
|
|
16
|
+
.join('');
|
|
17
|
+
return `<h2>${variant}<h2/><div>${template}<div>`;
|
|
18
|
+
})
|
|
19
|
+
.join('');
|
|
20
|
+
const page = await createPage(html);
|
|
21
|
+
const element = await page.find('mg-tag');
|
|
22
|
+
expect(element).toHaveClass('hydrated');
|
|
23
|
+
const screenshot = await page.screenshot();
|
|
24
|
+
expect(screenshot).toMatchImageSnapshot();
|
|
25
|
+
});
|
|
26
|
+
test('Should render a 2 lines tag', async () => {
|
|
27
|
+
const page = await createPage(`<mg-tag>Tag with a<br> two lines text</mg-tag>`);
|
|
28
|
+
const screenshot = await page.screenshot();
|
|
29
|
+
expect(screenshot).toMatchImageSnapshot();
|
|
30
|
+
});
|
|
31
|
+
test('Should render a tag in a paragraph', async () => {
|
|
32
|
+
const page = await createPage(`<p>This is a <mg-tag>tag</mg-tag> in a paragraph.</p>`);
|
|
33
|
+
const screenshot = await page.screenshot();
|
|
34
|
+
expect(screenshot).toMatchImageSnapshot();
|
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GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAExC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,EAAE,CAAC;EAC5C,CAAC,CAAC,CAAC;EAEH,IAAI,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;IAC7C,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,gDAAgD,CAAC,CAAC;IAEhF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,EAAE,CAAC;EAC5C,CAAC,CAAC,CAAC;EAEH,IAAI,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;IACpD,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,uDAAuD,CAAC,CAAC;IAEvF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,EAAE,CAAC;EAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { createPage } from '../../../../utils/stencil.e2e.test.utils';\nimport { darkBackground } from '../../../../utils/e2e.test.utils';\nimport { variants } from '../mg-tag.conf';\n\ndescribe('mg-tag', () => {\n test('Should render', async () => {\n const html = variants\n .map(variant => {\n const template = [true, false]\n .map(icon =>\n [\n { outline: false, soft: false },\n { outline: true, soft: false },\n { outline: false, soft: true },\n ]\n .map(({ outline, soft }) =>\n darkBackground(\n variant === 'secondary',\n `<mg-tag style=\"margin: 0.2rem;\" variant=\"${variant}\" outline=\"${outline}\" soft=\"${soft}\">${icon ? '<mg-icon icon=\"user\"></mg-icon>' : ''}${variant}</mg-tag>`,\n ),\n )\n .join(''),\n )\n .join('');\n return `<h2>${variant}<h2/><div>${template}<div>`;\n })\n .join('');\n\n const page = await createPage(html);\n\n const element = await page.find('mg-tag');\n expect(element).toHaveClass('hydrated');\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n\n test('Should render a 2 lines tag', async () => {\n const page = await createPage(`<mg-tag>Tag with a<br> two lines text</mg-tag>`);\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n\n test('Should render a tag in a paragraph', async () => {\n const page = await createPage(`<p>This is a <mg-tag>tag</mg-tag> in a paragraph.</p>`);\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n});\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
3
|
+
import { MgTag } from "../mg-tag";
|
|
4
|
+
import { variants } from "../mg-tag.conf";
|
|
5
|
+
const getPage = (args, slot) => newSpecPage({
|
|
6
|
+
components: [MgTag],
|
|
7
|
+
template: () => h("mg-tag", Object.assign({}, args), slot),
|
|
8
|
+
});
|
|
9
|
+
describe('mg-tag', () => {
|
|
10
|
+
describe.each(variants)('variant %s', variant => {
|
|
11
|
+
test.each([true, false])('outline %s', async (outline) => {
|
|
12
|
+
const { root } = await getPage({ variant, outline }, variant);
|
|
13
|
+
expect(root).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
test.each([true, false])('soft %s', async (soft) => {
|
|
16
|
+
const { root } = await getPage({ variant, soft }, variant);
|
|
17
|
+
expect(root).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
test('Should replace classes on variant/ouline changes', async () => {
|
|
21
|
+
const page = await getPage({}, 'Blu');
|
|
22
|
+
const element = page.doc.querySelector('mg-tag');
|
|
23
|
+
let classPrimary = element.shadowRoot.querySelector('.mg-tag--primary');
|
|
24
|
+
let classOutline = element.shadowRoot.querySelector('.mg-tag--outline');
|
|
25
|
+
expect(classPrimary).not.toBeNull();
|
|
26
|
+
expect(classOutline).toBeNull();
|
|
27
|
+
// Change variant
|
|
28
|
+
element.variant = 'danger';
|
|
29
|
+
await page.waitForChanges();
|
|
30
|
+
classPrimary = element.shadowRoot.querySelector('.mg-tag--primary');
|
|
31
|
+
const classDanger = element.shadowRoot.querySelector('.mg-tag--danger');
|
|
32
|
+
expect(classPrimary).toBeNull();
|
|
33
|
+
expect(classDanger).not.toBeNull();
|
|
34
|
+
// Change outline
|
|
35
|
+
element.outline = true;
|
|
36
|
+
await page.waitForChanges();
|
|
37
|
+
classOutline = element.shadowRoot.querySelector('.mg-tag--outline');
|
|
38
|
+
expect(classOutline).not.toBeNull();
|
|
39
|
+
});
|
|
40
|
+
describe('errors', () => {
|
|
41
|
+
test.each(['', 'blu'])('Should throw error, case wrong variant', async (variant) => {
|
|
42
|
+
expect.assertions(1);
|
|
43
|
+
try {
|
|
44
|
+
await getPage({ variant }, 'wrong variant');
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
expect(err.message).toContain('<mg-tag> prop "variant" must be one of: ');
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
test.each([undefined, ' '])('Should throw error, case empty slot', async (slot) => {
|
|
51
|
+
expect.assertions(1);
|
|
52
|
+
try {
|
|
53
|
+
await getPage({ variant: variants[0] }, slot);
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
expect(err.message).toBe('<mg-tag> slot must contain a text content.');
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
test('Should throw error, case empty slot', async () => {
|
|
60
|
+
const variant = variants[0];
|
|
61
|
+
expect.assertions(1);
|
|
62
|
+
try {
|
|
63
|
+
await getPage({ variant, outline: true, soft: true }, variant);
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
expect(err.message).toBe('<mg-tag> prop "soft" can NOT be used with prop "outline".');
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=mg-tag.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-tag.spec.js","sourceRoot":"","sources":["../../../../../src/components/atoms/mg-tag/test/mg-tag.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAC7B,WAAW,CAAC;EACV,UAAU,EAAE,CAAC,KAAK,CAAC;EACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,8BAAY,IAAI,GAAG,IAAI,CAAU;CAClD,CAAC,CAAC;AAEL,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;EACtB,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE;IAC9C,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,YAAY,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;MACrD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;MAC9D,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE;MAC/C,MAAM,EAAE,IAAI,EAAE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AAE;QACZ,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;OACvF;IACH,CAAC,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { MgTag } from '../mg-tag';\nimport { variants } from '../mg-tag.conf';\n\nconst getPage = (args, slot) =>\n newSpecPage({\n components: [MgTag],\n template: () => <mg-tag {...args}>{slot}</mg-tag>,\n });\n\ndescribe('mg-tag', () => {\n describe.each(variants)('variant %s', variant => {\n test.each([true, false])('outline %s', async outline => {\n const { root } = await getPage({ variant, outline }, variant);\n expect(root).toMatchSnapshot();\n });\n\n test.each([true, false])('soft %s', async soft => {\n const { root } = await getPage({ variant, soft }, variant);\n expect(root).toMatchSnapshot();\n });\n });\n\n test('Should replace classes on variant/ouline changes', async () => {\n const page = await getPage({}, 'Blu');\n const element = page.doc.querySelector('mg-tag');\n let classPrimary = element.shadowRoot.querySelector('.mg-tag--primary');\n let classOutline = element.shadowRoot.querySelector('.mg-tag--outline');\n\n expect(classPrimary).not.toBeNull();\n expect(classOutline).toBeNull();\n\n // Change variant\n element.variant = 'danger';\n await page.waitForChanges();\n\n classPrimary = element.shadowRoot.querySelector('.mg-tag--primary');\n const classDanger = element.shadowRoot.querySelector('.mg-tag--danger');\n\n expect(classPrimary).toBeNull();\n expect(classDanger).not.toBeNull();\n\n // Change outline\n element.outline = true;\n await page.waitForChanges();\n\n classOutline = element.shadowRoot.querySelector('.mg-tag--outline');\n expect(classOutline).not.toBeNull();\n });\n\n describe('errors', () => {\n test.each(['', 'blu'])('Should throw error, case wrong variant', async variant => {\n expect.assertions(1);\n try {\n await getPage({ variant }, 'wrong variant');\n } catch (err) {\n expect(err.message).toContain('<mg-tag> prop \"variant\" must be one of: ');\n }\n });\n test.each([undefined, ' '])('Should throw error, case empty slot', async slot => {\n expect.assertions(1);\n try {\n await getPage({ variant: variants[0] }, slot);\n } catch (err) {\n expect(err.message).toBe('<mg-tag> slot must contain a text content.');\n }\n });\n test('Should throw error, case empty slot', async () => {\n const variant = variants[0];\n expect.assertions(1);\n try {\n await getPage({ variant, outline: true, soft: true }, variant);\n } catch (err) {\n expect(err.message).toBe('<mg-tag> prop \"soft\" can NOT be used with prop \"outline\".');\n }\n });\n });\n});\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: none;
|
|
3
|
+
padding: 0.5rem 0.8rem;
|
|
4
|
+
z-index: 1000;
|
|
5
|
+
border-radius: var(--mg-tooltip-border-radius);
|
|
6
|
+
background-color: hsl(var(--mg-tooltip-background-color));
|
|
7
|
+
color: hsl(var(--mg-tooltip-font-color));
|
|
8
|
+
text-align: start;
|
|
9
|
+
max-width: 40rem;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([data-show]) {
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
::slotted([slot=arrow]) {
|
|
18
|
+
visibility: hidden;
|
|
19
|
+
}
|
|
20
|
+
::slotted([slot=arrow])::before {
|
|
21
|
+
visibility: visible;
|
|
22
|
+
content: "";
|
|
23
|
+
transform: rotate(45deg);
|
|
24
|
+
}
|
|
25
|
+
::slotted([slot=arrow]), ::slotted([slot=arrow])::before {
|
|
26
|
+
position: absolute;
|
|
27
|
+
width: 0.8rem;
|
|
28
|
+
height: 0.8rem;
|
|
29
|
+
z-index: 9999;
|
|
30
|
+
background-color: hsl(var(--mg-tooltip-background-color));
|
|
31
|
+
}
|
|
32
|
+
:host([data-popper-placement^=top]) > ::slotted([slot=arrow]) {
|
|
33
|
+
bottom: -4px;
|
|
34
|
+
}
|
|
35
|
+
:host([data-popper-placement^=bottom]) > ::slotted([slot=arrow]) {
|
|
36
|
+
top: -4px;
|
|
37
|
+
}
|
|
38
|
+
:host([data-popper-placement^=left]) > ::slotted([slot=arrow]) {
|
|
39
|
+
right: -4px;
|
|
40
|
+
}
|
|
41
|
+
:host([data-popper-placement^=right]) > ::slotted([slot=arrow]) {
|
|
42
|
+
left: -4px;
|
|
43
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class MgTooltipContent {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.message = undefined;
|
|
5
|
+
}
|
|
6
|
+
/*************
|
|
7
|
+
* Lifecycle *
|
|
8
|
+
*************/
|
|
9
|
+
/**
|
|
10
|
+
* Render
|
|
11
|
+
* @returns HTML Element
|
|
12
|
+
*/
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, { role: "tooltip" }, h("span", { innerHTML: this.message, class: "mg-tooltip-content__message" }), h("slot", { name: "arrow" })));
|
|
15
|
+
}
|
|
16
|
+
static get is() { return "mg-tooltip-content"; }
|
|
17
|
+
static get encapsulation() { return "shadow"; }
|
|
18
|
+
static get originalStyleUrls() {
|
|
19
|
+
return {
|
|
20
|
+
"$": ["mg-tooltip-content.scss"]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get styleUrls() {
|
|
24
|
+
return {
|
|
25
|
+
"$": ["mg-tooltip-content.css"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static get properties() {
|
|
29
|
+
return {
|
|
30
|
+
"message": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"mutable": false,
|
|
33
|
+
"complexType": {
|
|
34
|
+
"original": "string",
|
|
35
|
+
"resolved": "string",
|
|
36
|
+
"references": {}
|
|
37
|
+
},
|
|
38
|
+
"required": true,
|
|
39
|
+
"optional": false,
|
|
40
|
+
"docs": {
|
|
41
|
+
"tags": [],
|
|
42
|
+
"text": "Displayed message in the tooltip"
|
|
43
|
+
},
|
|
44
|
+
"attribute": "message",
|
|
45
|
+
"reflect": false
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=mg-tooltip-content.js.map
|
package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-tooltip-content.js","sourceRoot":"","sources":["../../../../../src/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,gBAAgB;;;;EAM3B;;iBAEe;EAEf;;;KAGG;EACH,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,IAAC,IAAI,EAAC,SAAS;MAClB,YAAM,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,6BAA6B,GAAQ;MAC1E,YAAM,IAAI,EAAC,OAAO,GAAQ,CACrB,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core';\n\n@Component({\n tag: 'mg-tooltip-content',\n styleUrl: 'mg-tooltip-content.scss',\n shadow: true,\n})\nexport class MgTooltipContent {\n /**\n * Displayed message in the tooltip\n */\n @Prop() message!: string;\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role=\"tooltip\">\n <span innerHTML={this.message} class=\"mg-tooltip-content__message\"></span>\n <slot name=\"arrow\"></slot>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mg-tooltip.conf.js","sourceRoot":"","sources":["../../../../src/components/atoms/mg-tooltip/mg-tooltip.conf.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,KAIX;AAJD,WAAY,KAAK;EACf,wBAAe,CAAA;EACf,oDAA2C,CAAA;EAC3C,wDAA+C,CAAA;AACjD,CAAC,EAJW,KAAK,KAAL,KAAK,QAIhB","sourcesContent":["export enum Guard {\n FOCUS = 'focus',\n HOVER_TOOLTIP_ELEMENT = 'hoverTooltipGuard',\n HOVER_TOOLTIPED_ELEMENT = 'hoverTooltipedGuard',\n}\n"]}
|
|
@@ -1,46 +1,3 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: inline-block;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.mg-tooltip {
|
|
6
|
-
display: none;
|
|
7
|
-
padding: 0.5rem 0.8rem;
|
|
8
|
-
z-index: 1000;
|
|
9
|
-
border-radius: var(--mg-tooltip-border-radius);
|
|
10
|
-
background-color: hsl(var(--mg-tooltip-background-color));
|
|
11
|
-
color: hsl(var(--mg-tooltip-font-color));
|
|
12
|
-
text-align: start;
|
|
13
|
-
max-width: 40rem;
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
}
|
|
16
|
-
.mg-tooltip[data-show] {
|
|
17
|
-
display: block;
|
|
18
|
-
}
|
|
19
|
-
.mg-tooltip .mg-tooltip__arrow,
|
|
20
|
-
.mg-tooltip .mg-tooltip__arrow::before {
|
|
21
|
-
position: absolute;
|
|
22
|
-
width: 0.8rem;
|
|
23
|
-
height: 0.8rem;
|
|
24
|
-
z-index: 9999;
|
|
25
|
-
background: inherit;
|
|
26
|
-
}
|
|
27
|
-
.mg-tooltip .mg-tooltip__arrow {
|
|
28
|
-
visibility: hidden;
|
|
29
|
-
}
|
|
30
|
-
.mg-tooltip .mg-tooltip__arrow::before {
|
|
31
|
-
visibility: visible;
|
|
32
|
-
content: "";
|
|
33
|
-
transform: rotate(45deg);
|
|
34
|
-
}
|
|
35
|
-
.mg-tooltip[data-popper-placement^=top] > .mg-tooltip__arrow {
|
|
36
|
-
bottom: -4px;
|
|
37
|
-
}
|
|
38
|
-
.mg-tooltip[data-popper-placement^=bottom] > .mg-tooltip__arrow {
|
|
39
|
-
top: -4px;
|
|
40
|
-
}
|
|
41
|
-
.mg-tooltip[data-popper-placement^=left] > .mg-tooltip__arrow {
|
|
42
|
-
right: -4px;
|
|
43
|
-
}
|
|
44
|
-
.mg-tooltip[data-popper-placement^=right] > .mg-tooltip__arrow {
|
|
45
|
-
left: -4px;
|
|
46
3
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { h, Host } from
|
|
2
|
-
import { createID, focusableElements, getWindows } from
|
|
3
|
-
import { createPopper } from
|
|
4
|
-
import { Guard } from
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { createID, focusableElements, getWindows } from "../../../utils/components.utils";
|
|
3
|
+
import { createPopper } from "@popperjs/core";
|
|
4
|
+
import { Guard } from "./mg-tooltip.conf";
|
|
5
|
+
/**
|
|
6
|
+
* HTMLMgButtonElement type guard
|
|
7
|
+
* @param element - element to check
|
|
8
|
+
* @returns return true if type is HTMLMgButtonElement
|
|
9
|
+
*/
|
|
10
|
+
const isButton = (element) => typeof element === 'object' && ['MG-BUTTON', 'BUTTON'].includes(element.tagName);
|
|
5
11
|
export class MgTooltip {
|
|
6
12
|
constructor() {
|
|
7
13
|
/**
|
|
@@ -9,7 +15,7 @@ export class MgTooltip {
|
|
|
9
15
|
*/
|
|
10
16
|
this.show = () => {
|
|
11
17
|
// Make the tooltip visible
|
|
12
|
-
this.
|
|
18
|
+
this.mgTooltipContent.dataset.show = '';
|
|
13
19
|
// Enable the event listeners
|
|
14
20
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
15
21
|
// hide when click outside
|
|
@@ -26,7 +32,7 @@ export class MgTooltip {
|
|
|
26
32
|
*/
|
|
27
33
|
this.hide = () => {
|
|
28
34
|
// Hide the tooltip
|
|
29
|
-
this.
|
|
35
|
+
this.mgTooltipContent.removeAttribute('data-show');
|
|
30
36
|
// Disable the event listeners
|
|
31
37
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
|
|
32
38
|
// Remove event listener
|
|
@@ -113,8 +119,12 @@ export class MgTooltip {
|
|
|
113
119
|
*/
|
|
114
120
|
this.initTooltip = (slotElement, interactiveElement) => {
|
|
115
121
|
// Add tabindex to slotted element if we can't find any interactive element
|
|
116
|
-
if (
|
|
122
|
+
if (!this.disabled && !Boolean(interactiveElement)) {
|
|
123
|
+
this.hasCustomTabIndex = true;
|
|
117
124
|
slotElement.tabIndex = 0;
|
|
125
|
+
// Add role on non-interactive element to work with "aria-describedby" for screen readers
|
|
126
|
+
slotElement.setAttribute('role', 'button');
|
|
127
|
+
}
|
|
118
128
|
// Set aria-describedby
|
|
119
129
|
const ariaDescribedby = slotElement.getAttribute('aria-describedby');
|
|
120
130
|
if (ariaDescribedby === null) {
|
|
@@ -125,7 +135,7 @@ export class MgTooltip {
|
|
|
125
135
|
slotElement.setAttribute('aria-describedby', `${[...new Set([...ariaDescribedby.split(' '), this.identifier])].join(' ')}`);
|
|
126
136
|
}
|
|
127
137
|
// Create popperjs tooltip
|
|
128
|
-
this.popper = createPopper(this.tooltipedElement, this.
|
|
138
|
+
this.popper = createPopper(this.tooltipedElement, this.mgTooltipContent, {
|
|
129
139
|
placement: this.placement,
|
|
130
140
|
strategy: 'fixed',
|
|
131
141
|
modifiers: [
|
|
@@ -142,6 +152,12 @@ export class MgTooltip {
|
|
|
142
152
|
this.guard = Guard.FOCUS;
|
|
143
153
|
this.setDisplay(true);
|
|
144
154
|
});
|
|
155
|
+
// as `click` event is the composition of `mousedown` and `mouseup` event,
|
|
156
|
+
// and `click` event trigger `focus` event after a success `mousedown` wich set the `guard` to `Guard.FOCUS`
|
|
157
|
+
// we reset the guard on `mouseup` event to unlock tooltip
|
|
158
|
+
this.tooltipedElement.addEventListener('mouseup', () => {
|
|
159
|
+
this.resetGuard();
|
|
160
|
+
});
|
|
145
161
|
this.tooltipedElement.addEventListener('blur', () => {
|
|
146
162
|
this.resetGuard();
|
|
147
163
|
this.setDisplay(false);
|
|
@@ -151,7 +167,7 @@ export class MgTooltip {
|
|
|
151
167
|
['mouseenter', 'mouseleave'].forEach(eventType => {
|
|
152
168
|
const isMouseenter = eventType === 'mouseenter';
|
|
153
169
|
[
|
|
154
|
-
{ element: this.
|
|
170
|
+
{ element: this.mgTooltipContent, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIPED_ELEMENT) },
|
|
155
171
|
{ element: this.tooltipedElement, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIP_ELEMENT) },
|
|
156
172
|
].forEach(({ element, action }) => {
|
|
157
173
|
element.addEventListener(eventType, () => {
|
|
@@ -170,6 +186,7 @@ export class MgTooltip {
|
|
|
170
186
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
171
187
|
throw new Error('<mg-tooltip> prop "message" is required.');
|
|
172
188
|
}
|
|
189
|
+
this.mgTooltipContent.message = newValue;
|
|
173
190
|
}
|
|
174
191
|
handleDisplay(newValue) {
|
|
175
192
|
if (newValue) {
|
|
@@ -179,6 +196,28 @@ export class MgTooltip {
|
|
|
179
196
|
this.hide();
|
|
180
197
|
}
|
|
181
198
|
}
|
|
199
|
+
validateDisabled(newValue) {
|
|
200
|
+
if (this.hasCustomTabIndex) {
|
|
201
|
+
if (newValue)
|
|
202
|
+
this.tooltipedElement.removeAttribute('tabindex');
|
|
203
|
+
else if (this.tooltipedElement.getAttribute('tabindex') === null)
|
|
204
|
+
this.tooltipedElement.setAttribute('tabindex', '0');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Render tooltip content element
|
|
209
|
+
*/
|
|
210
|
+
renderTooltip() {
|
|
211
|
+
const mgTooltipContent = document.createElement('mg-tooltip-content');
|
|
212
|
+
mgTooltipContent.setAttribute('slot', 'content');
|
|
213
|
+
mgTooltipContent.setAttribute('id', this.identifier);
|
|
214
|
+
const arrow = document.createElement('div');
|
|
215
|
+
arrow.setAttribute('slot', 'arrow');
|
|
216
|
+
arrow.dataset.popperArrow = '';
|
|
217
|
+
mgTooltipContent.appendChild(arrow);
|
|
218
|
+
// append tooltip element to component
|
|
219
|
+
this.element.appendChild(mgTooltipContent);
|
|
220
|
+
}
|
|
182
221
|
/*************
|
|
183
222
|
* Lifecycle *
|
|
184
223
|
*************/
|
|
@@ -188,6 +227,12 @@ export class MgTooltip {
|
|
|
188
227
|
componentWillLoad() {
|
|
189
228
|
// Get windows to attach events
|
|
190
229
|
this.windows = getWindows(window);
|
|
230
|
+
// Get tooltip element
|
|
231
|
+
this.renderTooltip();
|
|
232
|
+
this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);
|
|
233
|
+
//validate properties
|
|
234
|
+
this.validateDisabled(this.disabled);
|
|
235
|
+
this.validateMessage(this.message);
|
|
191
236
|
}
|
|
192
237
|
/**
|
|
193
238
|
* Get slotted element
|
|
@@ -196,17 +241,15 @@ export class MgTooltip {
|
|
|
196
241
|
*/
|
|
197
242
|
componentDidLoad() {
|
|
198
243
|
var _a;
|
|
199
|
-
//
|
|
200
|
-
|
|
201
|
-
// get slotted element
|
|
202
|
-
const slotElement = this.element.firstElementChild;
|
|
244
|
+
// get slotted element wich is not the tooltip
|
|
245
|
+
const slotElement = this.element.querySelector(`*:not(#${this.identifier})`);
|
|
203
246
|
// Get interactive element
|
|
204
247
|
const interactiveElement = slotElement.matches(focusableElements) ? slotElement : (_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(focusableElements);
|
|
205
248
|
// define selected element to become tooltip selector
|
|
206
249
|
this.tooltipedElement = interactiveElement || slotElement;
|
|
207
250
|
// Check if slotted element is a disabled mg-button
|
|
208
251
|
// In this case we wrap the mg-button into a div to enable the tooltip
|
|
209
|
-
if (
|
|
252
|
+
if (isButton(slotElement)) {
|
|
210
253
|
new MutationObserver(mutationList => {
|
|
211
254
|
if (mutationList.some(mutation => ['aria-disabled', 'disabled'].includes(mutation.attributeName))) {
|
|
212
255
|
this.setMgButtonWrapper(slotElement);
|
|
@@ -221,7 +264,6 @@ export class MgTooltip {
|
|
|
221
264
|
// Init Tooltip
|
|
222
265
|
this.initTooltip(slotElement, interactiveElement);
|
|
223
266
|
this.handleDisplay(this.display);
|
|
224
|
-
this.validateMessage(this.message);
|
|
225
267
|
}
|
|
226
268
|
/**
|
|
227
269
|
* update popper position after props change on component did update hook to benefit from render ended
|
|
@@ -234,7 +276,7 @@ export class MgTooltip {
|
|
|
234
276
|
* @returns HTML Element
|
|
235
277
|
*/
|
|
236
278
|
render() {
|
|
237
|
-
return (h(Host, null, h("slot", null), h("
|
|
279
|
+
return (h(Host, null, h("slot", null), h("slot", { name: "content" })));
|
|
238
280
|
}
|
|
239
281
|
static get is() { return "mg-tooltip"; }
|
|
240
282
|
static get encapsulation() { return "shadow"; }
|
|
@@ -294,7 +336,8 @@ export class MgTooltip {
|
|
|
294
336
|
"references": {
|
|
295
337
|
"Placement": {
|
|
296
338
|
"location": "import",
|
|
297
|
-
"path": "@popperjs/core"
|
|
339
|
+
"path": "@popperjs/core",
|
|
340
|
+
"id": "../../node_modules/.pnpm/@popperjs+core@2.11.7/node_modules/@popperjs/core/index.d.ts::Placement"
|
|
298
341
|
}
|
|
299
342
|
}
|
|
300
343
|
},
|
|
@@ -354,6 +397,10 @@ export class MgTooltip {
|
|
|
354
397
|
}, {
|
|
355
398
|
"propName": "display",
|
|
356
399
|
"methodName": "handleDisplay"
|
|
400
|
+
}, {
|
|
401
|
+
"propName": "disabled",
|
|
402
|
+
"methodName": "validateDisabled"
|
|
357
403
|
}];
|
|
358
404
|
}
|
|
359
405
|
}
|
|
406
|
+
//# sourceMappingURL=mg-tooltip.js.map
|