@mgdis/mg-components 5.16.0 → 5.18.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_34.cjs.entry.js +485 -163
- 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 +4 -2
- 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 +7 -2
- package/dist/collection/collection-manifest.json +37 -37
- 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.js +2 -1
- 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.js +38 -16
- 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 +138 -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 +272 -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.js +109 -27
- 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 +638 -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 +88 -15
- 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 +379 -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 +120 -46
- 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 +456 -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 +92 -16
- 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 +289 -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 +91 -15
- 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 +355 -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 +95 -17
- 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 +399 -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 +104 -27
- 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 +343 -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 +108 -31
- 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 +318 -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 +10 -7
- 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 +19 -13
- 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 +2 -1
- 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 +8 -6
- 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 +11 -7
- 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 +1 -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 +7 -5
- 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 +17 -12
- 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 +213 -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.js +4 -3
- 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.js +40 -18
- 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 +159 -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 +142 -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 +7 -0
- package/dist/collection/utils/components.utils.js.map +1 -0
- package/dist/collection/utils/components.utils.spec.js +128 -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 +2 -1
- 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 +9 -1
- package/dist/components/components.utils.js.map +1 -0
- package/dist/components/index.d.ts +5 -37
- package/dist/components/index.js +3 -36
- 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 +14 -4
- 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 +7 -1
- 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 +7 -2
- 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 +21 -3
- 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 +6 -1
- package/dist/components/mg-input-checkbox-paginated2.js.map +1 -0
- package/dist/components/mg-input-checkbox.js +64 -14
- package/dist/components/mg-input-checkbox.js.map +1 -0
- package/dist/components/mg-input-date.js +51 -9
- package/dist/components/mg-input-date.js.map +1 -0
- package/dist/components/mg-input-numeric.js +82 -39
- package/dist/components/mg-input-numeric.js.map +1 -0
- package/dist/components/mg-input-password.js +53 -11
- package/dist/components/mg-input-password.js.map +1 -0
- package/dist/components/mg-input-radio.js +53 -10
- 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 +53 -10
- 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 +64 -23
- package/dist/components/mg-input-text2.js.map +1 -0
- package/dist/components/mg-input-textarea.js +69 -27
- 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 +11 -1
- package/dist/components/mg-input-toggle.js.map +1 -0
- package/dist/components/mg-item-more.js +7 -1
- 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 +9 -1
- 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 +8 -2
- 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 +6 -1
- package/dist/components/mg-pagination2.js.map +1 -0
- package/dist/components/mg-panel.js +16 -7
- package/dist/components/mg-panel.js.map +1 -0
- package/dist/components/mg-popover-content.js +2 -0
- package/dist/components/mg-popover-content.js.map +1 -0
- package/dist/components/mg-popover-content2.js +3 -1
- 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 +40 -15
- 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.js +2 -0
- package/dist/components/mg-tooltip-content.js.map +1 -0
- package/dist/components/mg-tooltip-content2.js +3 -1
- 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 +37 -12
- 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_34.entry.js +485 -163
- 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 +4 -2
- 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.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-ff3ca349.entry.js +2 -0
- package/dist/mg-components/p-ff3ca349.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.d.ts +2 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +22 -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-date/mg-input-date.d.ts +17 -2
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +35 -20
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +16 -1
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +16 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +16 -1
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +17 -5
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +17 -5
- 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 +1 -1
- 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/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/mg-panel.d.ts +1 -1
- 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.d.ts +1 -0
- package/dist/types/components/molecules/mg-tabs/test/mg-tabs.e2e.playwright.d.ts +1 -0
- package/dist/types/components.d.ts +79 -11
- 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/components.utils.d.ts +6 -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 +5 -5
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/mg-components/p-067080e4.js +0 -1
- package/dist/mg-components/p-3286bc46.entry.js +0 -1
- package/dist/mg-components/p-3bf1e2f0.js +0 -2
- package/dist/mg-components/p-91f4a30d.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-
|
|
2
|
-
import { i as initLocales, D as Direction, l as localeDate, d as dateRegExp, a as localeCurrency, b as localeNumber, s as sizes$2 } from './mg-menu.conf-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-ce01e63b.js';
|
|
2
|
+
import { i as initLocales, D as Direction, l as localeDate, d as dateRegExp, a as localeCurrency, b as localeNumber, s as sizes$2 } from './mg-menu.conf-012fc9b4.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Available menu-item positions
|
|
@@ -148,6 +148,12 @@ const getChildWindows = (localWindow, windows = []) => {
|
|
|
148
148
|
}
|
|
149
149
|
return windows;
|
|
150
150
|
};
|
|
151
|
+
/**
|
|
152
|
+
* Validate string
|
|
153
|
+
* @param value - value to check
|
|
154
|
+
* @returns if string is valid
|
|
155
|
+
*/
|
|
156
|
+
const isValidString = (value) => typeof value === 'string' && value.trim() !== '';
|
|
151
157
|
|
|
152
158
|
const mgActionMoreCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}:host{--mg-popover-padding-vertical:1rem;--mg-popover-padding-horizontal:0;--mg-popover-max-width:unset}.mg-action-more__chevron{transition:200ms}.mg-action-more__chevron--rotate.mg-action-more__chevron{transform:rotate(180deg)}";
|
|
153
159
|
|
|
@@ -217,7 +223,7 @@ const MgActionMore = class {
|
|
|
217
223
|
this.expanded = false;
|
|
218
224
|
customHandler(event);
|
|
219
225
|
};
|
|
220
|
-
this.icon =
|
|
226
|
+
this.icon = undefined;
|
|
221
227
|
this.button = { variant: 'flat', isIcon: true };
|
|
222
228
|
this.items = undefined;
|
|
223
229
|
this.displayChevron = undefined;
|
|
@@ -227,6 +233,9 @@ const MgActionMore = class {
|
|
|
227
233
|
if (newValue && !isMgActionMoreIcon(newValue)) {
|
|
228
234
|
throw new Error(`<${this.name}> prop icon must match MgActionMoreIconType.`);
|
|
229
235
|
}
|
|
236
|
+
else if (!Boolean(newValue === null || newValue === void 0 ? void 0 : newValue.icon) && Boolean(this.button.isIcon)) {
|
|
237
|
+
this.icon = { icon: 'ellipsis' };
|
|
238
|
+
}
|
|
230
239
|
}
|
|
231
240
|
validateButton(newValue) {
|
|
232
241
|
if (newValue && !isMgActionMoreButton(newValue)) {
|
|
@@ -270,7 +279,7 @@ const MgActionMore = class {
|
|
|
270
279
|
'mg-a11y-animation': true,
|
|
271
280
|
} }, h("mg-icon", { icon: "chevron-down", size: "small" })));
|
|
272
281
|
}
|
|
273
|
-
return (h(Host, { "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { class: "mg-action-more" }, h("mg-popover", { identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { variant: this.button.variant, isIcon: this.button.isIcon, type: "button", label: buttonLabel, onClick: this.handleButton }, h("mg-icon", Object.assign({}, this.icon)), !this.button.isIcon && buttonContent), h("div", { slot: "content" }, h("mg-menu", { direction: Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
|
|
282
|
+
return (h(Host, { "data-mg-popover-guard": this.mgPopoverIdentifier }, h("span", { class: "mg-action-more" }, h("mg-popover", { identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, h("mg-button", { variant: this.button.variant, isIcon: this.button.isIcon, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && h("mg-icon", Object.assign({}, this.icon)), !this.button.isIcon && buttonContent), h("div", { slot: "content" }, h("mg-menu", { direction: Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
|
|
274
283
|
var _a;
|
|
275
284
|
return (
|
|
276
285
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -788,7 +797,7 @@ const MgForm = class {
|
|
|
788
797
|
this.setRequiredMessage();
|
|
789
798
|
}
|
|
790
799
|
/**
|
|
791
|
-
*
|
|
800
|
+
* Display input error if it exists.
|
|
792
801
|
*/
|
|
793
802
|
async displayError() {
|
|
794
803
|
if (!this.readonly) {
|
|
@@ -996,6 +1005,7 @@ const iconList = [
|
|
|
996
1005
|
"list",
|
|
997
1006
|
"loader",
|
|
998
1007
|
"location",
|
|
1008
|
+
"location-outline",
|
|
999
1009
|
"lock",
|
|
1000
1010
|
"log-in",
|
|
1001
1011
|
"log-out",
|
|
@@ -1004,10 +1014,13 @@ const iconList = [
|
|
|
1004
1014
|
"mail-outline",
|
|
1005
1015
|
"messages-square",
|
|
1006
1016
|
"messages-square-outline",
|
|
1017
|
+
"mobile",
|
|
1018
|
+
"mobile-outline",
|
|
1007
1019
|
"notes",
|
|
1008
1020
|
"notes-outline",
|
|
1009
1021
|
"paper-plane",
|
|
1010
1022
|
"paper-plane-slash",
|
|
1023
|
+
"paperclip",
|
|
1011
1024
|
"pen",
|
|
1012
1025
|
"pen-circle",
|
|
1013
1026
|
"pen-fancy",
|
|
@@ -1015,6 +1028,7 @@ const iconList = [
|
|
|
1015
1028
|
"pen-fancy-outline",
|
|
1016
1029
|
"pen-outline",
|
|
1017
1030
|
"phone",
|
|
1031
|
+
"phone-outline",
|
|
1018
1032
|
"picture",
|
|
1019
1033
|
"play-circle",
|
|
1020
1034
|
"plus",
|
|
@@ -1175,7 +1189,8 @@ const icons = {
|
|
|
1175
1189
|
'link': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M9.75 6.25a3.748 3.748 0 0 1 0 5.31l-1.66 1.67a3.76 3.76 0 0 1-5.32 0 3.76 3.76 0 0 1 0-5.32l.92-.92c.15-.15.4-.16.56 0 .07.07.11.16.12.26.02.44.1.88.24 1.3.05.14.01.3-.09.41l-.32.32c-.72.67-.76 1.8-.09 2.52s1.8.76 2.52.09c.03-.02.05-.05.07-.07l1.66-1.66a1.775 1.775 0 0 0-.26-2.73.394.394 0 0 1-.17-.31.98.98 0 0 1 .29-.74l.52-.52c.14-.14.35-.15.51-.04.18.13.35.27.51.43Zm3.49-3.48a3.76 3.76 0 0 0-5.32 0L6.26 4.43a3.772 3.772 0 0 0 .52 5.75c.16.11.37.09.51-.04l.52-.52c.2-.19.3-.46.29-.74a.38.38 0 0 0-.17-.31 1.775 1.775 0 0 1-.26-2.73l1.66-1.66c.68-.71 1.81-.74 2.52-.06.71.68.74 1.81.06 2.52-.02.03-.05.05-.07.07l-.32.32c-.11.11-.14.27-.09.41.14.42.22.86.24 1.3 0 .22.19.39.41.38.1 0 .19-.05.26-.12l.92-.92a3.76 3.76 0 0 0 0-5.32Z"/></svg>',
|
|
1176
1190
|
'list': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M1.9 2.68c-.67 0-1.22.56-1.21 1.23 0 .67.56 1.22 1.23 1.21.67 0 1.22-.56 1.21-1.23 0-.32-.13-.63-.36-.86-.23-.23-.54-.36-.87-.35Zm0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46Zm0 4.09a1.23 1.23 0 1 0 0 2.46 1.23 1.23 0 1 0 0-2.46Zm13 .41H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41h-.03Zm0-8.18H5.18c-.23 0-.41.18-.41.41v.81c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41V3.5c0-.23-.18-.41-.41-.41h-.03Zm0 4.09H5.18c-.23 0-.41.18-.41.41v.82c0 .23.18.41.41.41h9.75c.23 0 .41-.18.41-.41v-.82c0-.23-.18-.41-.41-.41h-.03Z"/></svg>',
|
|
1177
1191
|
'loader': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M8 2.67A5.33 5.33 0 1 1 2.67 8 5.33 5.33 0 0 1 8 2.67m0-2A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Z" opacity=".2"/><path fill="currentColor" d="M8 2.67v-2A7.33 7.33 0 0 0 .67 8h2A5.33 5.33 0 0 1 8 2.67Z"/></svg>',
|
|
1178
|
-
'location': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M8 .
|
|
1192
|
+
'location': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M8 14.996c2.5-2.5 5-6.235 5-8.996A5 5 0 0 0 3 6c0 2.761 2.5 6.496 5 8.996Zm0-7.498a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"/></svg>',
|
|
1193
|
+
'location-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M10 6.002a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-1 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/><path fill="currentColor" fill-rule="evenodd" d="M13 6.002c0 2.506-2.06 5.814-4.309 8.273-.229.25-.46.492-.691.723a22.477 22.477 0 0 1-.691-.723C5.059 11.816 3 8.508 3 6.002a5 5 0 0 1 10 0Zm-1 0c0 1.116-.52 2.554-1.424 4.088A21.484 21.484 0 0 1 8 13.55a21.483 21.483 0 0 1-2.576-3.459C4.52 8.556 4 7.118 4 6.002a4 4 0 1 1 8 0Z"/></svg>',
|
|
1179
1194
|
'lock': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M12 5.56h-.67v-1.4C11.37 2.28 9.88.71 8 .67 6.12.71 4.63 2.28 4.67 4.16v1.4H4c-.75.02-1.35.64-1.33 1.39V14c.02.73.6 1.31 1.33 1.33h8c.75-.02 1.35-.64 1.33-1.39V7a1.37 1.37 0 0 0-1.28-1.44H12Zm-4 6.28c-.77.04-1.43-.56-1.47-1.33-.04-.77.56-1.43 1.33-1.47.77-.04 1.43.56 1.47 1.33v.07c.02.75-.57 1.38-1.32 1.4H8Zm2.07-6.28H5.93v-1.4A2.12 2.12 0 0 1 8 2c1.17.03 2.1 1 2.07 2.17v1.39Z"/></svg>',
|
|
1180
1195
|
'log-in': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="m10.97 7.78-4-4a.29.29 0 0 0-.42 0c-.07.06-.12.15-.13.24v2.07c0 .17-.13.3-.3.32H1.97c-.16 0-.29.12-.3.28v2.58c0 .16.12.29.28.3h4.16c.17 0 .3.14.3.31v2.14c0 .16.12.29.28.3.11.01.21-.03.28-.11l4-4c.11-.12.11-.3 0-.42Zm3.37 5.26v1c0 .16-.13.28-.28.28H9.29a.28.28 0 0 1-.28-.28v-1c0-.16.13-.28.28-.28h3.43V3.3H9.3a.29.29 0 0 1-.29-.29V1.97c0-.16.13-.29.29-.29h4.76c.16 0 .29.13.29.29v11.07Z"/></svg>',
|
|
1181
1196
|
'log-out': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="m14.25 7.77-4-4a.31.31 0 0 0-.43 0A.34.34 0 0 0 9.7 4v2.07a.32.32 0 0 1-.3.32H5.23a.3.3 0 0 0-.3.3v2.56a.3.3 0 0 0 .3.3H9.4a.31.31 0 0 1 .3.31V12a.3.3 0 0 0 .3.3.33.33 0 0 0 .23-.09l4-4a.29.29 0 0 0 .02-.44Z"/><path fill="currentColor" d="M6.71 12.72H3.27V3.26h3.42A.31.31 0 0 0 7 3V2a.3.3 0 0 0-.31-.3H2a.29.29 0 0 0-.33.3v12a.27.27 0 0 0 .1.24.32.32 0 0 0 .14.08h4.8A.3.3 0 0 0 7 14v-1a.3.3 0 0 0-.29-.28Z"/></svg>',
|
|
@@ -1184,17 +1199,21 @@ const icons = {
|
|
|
1184
1199
|
'mail-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M1 3.999V12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V3.999A.999.999 0 0 0 14.001 3H2a.999.999 0 0 0-1 .999Zm13 .713-6 4.28-6-4.28V12h12V4.712ZM2.724 4 8 7.764 13.276 4H2.724Z" clip-rule="evenodd"/></svg>',
|
|
1185
1200
|
'messages-square': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M12 10v1.017a1 1 0 0 1-1.006 1L8 12l-4 2v-1.978H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-1Zm1-6H5v1h6a1 1 0 0 1 1 1v3h1V4Zm-3 3H4v1h6V7ZM4 9h3v1H4V9Z" clip-rule="evenodd"/></svg>',
|
|
1186
1201
|
'messages-square-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M4 7h6v1H4V7Zm0 2h3v1H4V9Z"/><path fill="currentColor" fill-rule="evenodd" d="M12 11.017V10h1a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v1H3a1 1 0 0 0-1 1v5.022a1 1 0 0 0 1 1h1V14l4-2 2.994.017a1 1 0 0 0 1.006-1ZM5 4h8v5h-1V6a1 1 0 0 0-1-1H5V4Zm0 8.382 2.767-1.383 3.233.018V6H3v5.022h2v1.36Z" clip-rule="evenodd"/></svg>',
|
|
1202
|
+
'mobile': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M3 2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2Zm4 10a1 1 0 1 1 2 0 1 1 0 0 1-2 0ZM6 3.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5Z"/></svg>',
|
|
1203
|
+
'mobile-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M7 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0ZM6 3.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5Z"/><path fill="currentColor" fill-rule="evenodd" d="M4 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H4Zm8 1H4v12h8V2Z"/></svg>',
|
|
1187
1204
|
'notes': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M12.6 2.76v-.43c0-.75-.53-1.28-1.28-1.28H2.33c-.75 0-1.28.53-1.28 1.28v8.99c0 .75.53 1.28 1.28 1.28h.39V4.05c0-.75.53-1.28 1.28-1.28h8.6Z"/><path fill="currentColor" d="M13.67 3.4H4.68c-.75 0-1.28.53-1.28 1.28v8.99c0 .75.53 1.28 1.28 1.28h6.42V11.1h3.85V4.68c0-.75-.53-1.28-1.28-1.28Zm-4.49 7.06H5.97V9.18h3.21v1.28Zm3.21-2.57H5.97V6.61h6.42v1.28Z"/><path fill="currentColor" d="m11.74 14.42 2.68-2.68h-2.68v2.68z"/></svg>',
|
|
1188
1205
|
'notes-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M13.11 4.74v5.38h-3v3H4.73V4.74h8.38m0-1.2H4.73a1.2 1.2 0 0 0-1.2 1.2v8.38a1.2 1.2 0 0 0 1.2 1.19h6l3.59-3.59v-6a1.2 1.2 0 0 0-1.21-1.18Zm-4.19 6.58h-3V8.93h3Zm3-2.39h-6v-1.2h6ZM3.8 11.19h-1V2.81h8.38v1h1.2v-1a1.2 1.2 0 0 0-1.2-1.2H2.81a1.2 1.2 0 0 0-1.2 1.2v8.38a1.2 1.2 0 0 0 1.2 1.2h1Z"/></svg>',
|
|
1189
1206
|
'paper-plane': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M14 1.69 1.84 7a.28.28 0 0 0-.15.36.29.29 0 0 0 .16.15l3.27 1.82a.57.57 0 0 0 .61-.06l6.45-5.57c.05 0 .15-.1.19-.06s0 .14-.06.18l-5.59 6.29a.52.52 0 0 0 0 .63l2.09 3.44a.28.28 0 0 0 .37.12.3.3 0 0 0 .13-.12l5-12.11a.3.3 0 0 0-.14-.37.28.28 0 0 0-.17-.01Z"/></svg>',
|
|
1190
1207
|
'paper-plane-slash': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="m2.67 1.69 11.59 11.59-1 1-2.79-2.8-1.1 2.67a.3.3 0 0 1-.13.12.28.28 0 0 1-.37-.12l-2.12-3.41a.52.52 0 0 1 0-.63L7.82 8.9l-.76-.76-1.3 1.13a.57.57 0 0 1-.61.06L1.88 7.51a.29.29 0 0 1-.16-.15.28.28 0 0 1 .15-.36l2.81-1.24-3-3Zm11.53 0a.28.28 0 0 0-.22 0L7.53 4.51l1.73 1.73 3-2.54s.15-.1.19-.06 0 .14-.06.18L9.75 6.73l1.88 1.88 2.71-6.54a.3.3 0 0 0-.14-.37Z"/></svg>',
|
|
1208
|
+
'paperclip': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="m6.57 12.358 6.09-6.09a1.035 1.035 0 1 0-1.465-1.463l-5.32 5.32-.733-.731 5.321-5.321A2.07 2.07 0 1 1 13.391 7l-5.339 5.34-.006.006-.744.744A3.106 3.106 0 0 1 2.91 8.698L9.608 2l.732.732L3.642 9.43a2.07 2.07 0 1 0 2.928 2.928Z"/></svg>',
|
|
1191
1209
|
'pen': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M12.295 2.293a1 1 0 0 0-1.414 0L9.467 3.707l2.828 2.829 1.414-1.415a1 1 0 0 0 0-1.414l-1.414-1.414ZM8.756 4.417l2.829 2.829-6.757 6.756L2.003 14 2 11.174l6.756-6.757Z"/></svg>',
|
|
1192
1210
|
'pen-circle': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M8 .44C3.82.44.44 3.82.44 8S3.83 15.56 8 15.56s7.56-3.39 7.56-7.56C15.56 3.82 12.18.44 8 .44M5.47 12.19H3.62v-1.85l5.46-5.45 1.85 1.86-5.45 5.45Zm6.88-6.89-.9.9-1.86-1.85.9-.9c.19-.19.51-.19.7 0l1.16 1.15c.19.19.19.51 0 .7"/></svg>',
|
|
1193
1211
|
'pen-fancy': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M3.63 8.65c-.24.07-.43.26-.5.5l-1.46 4.37.11.12 2.3-2.3v-.19c0-.44.35-.8.79-.81.44 0 .8.35.81.79 0 .44-.35.8-.79.81h-.21l-2.3 2.3.12.11 4.37-1.46c.24-.07.43-.26.5-.5l.82-2.08L5.7 7.83l-2.07.82Zm7.17-6.3L6.27 7.28 8.69 9.7l4.94-4.52c2.1-1.86-.99-4.92-2.83-2.83Z"/></svg>',
|
|
1194
1212
|
'pen-fancy-files-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M12 2H6v10h6V8.946l.023-.058.085-.078.892-.813V12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v.112a2.298 2.298 0 0 0-.974.66L12 2.8V2Zm1 4.643-1 .913-.566.515-1.528-1.524L12 4.275l.767-.832c.075-.085.153-.156.233-.215 1.167-.857 2.796.9 1.555 1.997L13 6.643ZM4 3H3v11.5a.5.5 0 0 0 .5.5H11v-1H4V3Zm4.238 4.41a.466.466 0 0 0-.316.315L7 10.477l.07.076 1.452-1.449v-.12a.51.51 0 0 1 .5-.51.51.51 0 0 1 .511.498.51.51 0 0 1-.499.51h-.133L7.45 10.931l.075.069 2.76-.92a.466.466 0 0 0 .317-.314l.518-1.31-1.573-1.562-1.308.516Z"/></svg>',
|
|
1195
1213
|
'pen-fancy-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M12.24 1.67c-.49 0-1 .21-1.44.7L6.27 7.3l2.42 2.42 4.94-4.52c1.6-1.42.19-3.53-1.39-3.53ZM8.72 8.34 7.66 7.28l3.9-4.24c.22-.24.44-.36.69-.36.41 0 .87.34 1.03.78.14.37.04.7-.32 1.02L8.73 8.36ZM5.7 7.86l-2.08.82c-.24.08-.42.26-.5.5l-1.46 4.37.12.12.56.56.12.12 4.37-1.46c.24-.08.42-.26.5-.5l.81-2.08L5.7 7.87Zm-2.57 4.46L4 9.72c.03-.08.09-.15.17-.18l1.29-.51 1.52 1.52-.5 1.29c-.03.08-.1.15-.19.18l-2.6.87.95-.95c.06.02.12.04.19.04.44 0 .79-.35.79-.79s-.35-.79-.79-.79-.79.35-.79.79c0 .07.02.13.04.19l-.95.95Z"/></svg>',
|
|
1196
1214
|
'pen-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M12.295 2.293a1 1 0 0 0-1.414 0L9.467 3.707l2.828 2.829 1.414-1.415a1 1 0 0 0 0-1.414l-1.414-1.414Z"/><path fill="currentColor" fill-rule="evenodd" d="m2.003 13.999 2.825.003 6.757-6.756-2.829-2.829L2 11.174l.003 2.825ZM3 11.587l5.756-5.755 1.414 1.414-5.755 5.756L3.002 13 3 11.587Z" clip-rule="evenodd"/></svg>',
|
|
1197
|
-
'phone': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1215
|
+
'phone': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="m10 10.53 1.034-1.035a1.01 1.01 0 0 1 1.08-.221l1.259.503A1.006 1.006 0 0 1 14 10.7v2.308a1.002 1.002 0 0 1-1.052.992C4.124 13.45 2.343 5.974 2.006 3.112A1.002 1.002 0 0 1 3.007 2h2.228a.996.996 0 0 1 .923.628l.503 1.26a.997.997 0 0 1-.217 1.08L5.41 6.002s.595 4.029 4.59 4.527Z"/></svg>',
|
|
1216
|
+
'phone-outline': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M12.62 14h-.079C3.472 13.479 2.184 5.826 2.004 3.49A1.384 1.384 0 0 1 3.278 2h2.543a.923.923 0 0 1 .859.582l.701 1.726a.923.923 0 0 1-.203.997l-.983.992a4.325 4.325 0 0 0 3.499 3.508l1.001-.993a.923.923 0 0 1 1.002-.189l1.74.697a.923.923 0 0 1 .567.858v2.437A1.385 1.385 0 0 1 12.62 14ZM3.389 2.923a.462.462 0 0 0-.462.462v.037c.213 2.732 1.574 9.193 9.665 9.655a.46.46 0 0 0 .49-.434v-2.465l-1.74-.696-1.325 1.315-.222-.028c-4.015-.503-4.56-4.518-4.56-4.56l-.028-.221 1.311-1.325-.692-1.74H3.389Z"/></svg>',
|
|
1198
1217
|
'picture': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M14.33 12.93V3.07a1.4 1.4 0 0 0-1.4-1.4H3.07a1.4 1.4 0 0 0-1.4 1.4v9.86a1.4 1.4 0 0 0 1.4 1.4h9.86a1.4 1.4 0 0 0 1.4-1.4ZM5.54 9.06l1.76 2.11L9.76 8l3.17 4.22H3.07Z"/></svg>',
|
|
1199
1218
|
'play-circle': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M8 .67A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Zm3.42 8-5.2 3a.72.72 0 0 1-1-.28.73.73 0 0 1-.09-.35V4.92a.71.71 0 0 1 .71-.71 1.06 1.06 0 0 1 .35.09l5.2 3.17a.71.71 0 0 1 .27 1 .64.64 0 0 1-.24.24Z"/></svg>',
|
|
1200
1219
|
'plus': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M9.41 6.59V1.92a.24.24 0 0 0-.24-.25H6.84a.24.24 0 0 0-.25.24v4.68H1.92a.24.24 0 0 0-.25.24v2.33a.24.24 0 0 0 .24.25h4.68v4.67a.24.24 0 0 0 .24.25h2.33a.24.24 0 0 0 .25-.24V9.41h4.67a.24.24 0 0 0 .25-.24V6.84a.24.24 0 0 0-.24-.25H9.41Z"/></svg>',
|
|
@@ -1573,6 +1592,7 @@ const MgInputCheckbox = class {
|
|
|
1573
1592
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
1574
1593
|
// hasDisplayedError (triggered by blur event)
|
|
1575
1594
|
this.hasDisplayedError = false;
|
|
1595
|
+
this.mode = 'custom';
|
|
1576
1596
|
// style
|
|
1577
1597
|
this.baseClassName = 'mg-input--checkbox';
|
|
1578
1598
|
// "multi" setup
|
|
@@ -1672,10 +1692,7 @@ const MgInputCheckbox = class {
|
|
|
1672
1692
|
* Check if input is valid
|
|
1673
1693
|
*/
|
|
1674
1694
|
this.checkValidity = () => {
|
|
1675
|
-
this.
|
|
1676
|
-
this.invalid = !this.valid;
|
|
1677
|
-
// We need to send valid event even if it is the same value
|
|
1678
|
-
this.inputValid.emit(this.valid);
|
|
1695
|
+
this.setValidity(this.readonly || this.disabled || (this.getInvalidElement() === undefined && this.validateRequired()));
|
|
1679
1696
|
};
|
|
1680
1697
|
/**
|
|
1681
1698
|
* Render button text
|
|
@@ -1693,12 +1710,17 @@ const MgInputCheckbox = class {
|
|
|
1693
1710
|
/**
|
|
1694
1711
|
* Set input error message
|
|
1695
1712
|
* @param displayError - dispay error condition
|
|
1713
|
+
* @param errorMessage - errorMessage override
|
|
1696
1714
|
*/
|
|
1697
|
-
this.setErrorMessage = (displayError = true) => {
|
|
1715
|
+
this.setErrorMessage = (displayError = true, errorMessage) => {
|
|
1698
1716
|
// Set error message
|
|
1699
1717
|
this.errorMessage = undefined;
|
|
1700
|
-
if (displayError && !this.valid
|
|
1701
|
-
|
|
1718
|
+
if (displayError && !this.valid) {
|
|
1719
|
+
if (errorMessage !== undefined)
|
|
1720
|
+
this.errorMessage = errorMessage;
|
|
1721
|
+
else if (!this.validateRequired())
|
|
1722
|
+
this.errorMessage = this.messages.errors.required;
|
|
1723
|
+
}
|
|
1702
1724
|
};
|
|
1703
1725
|
/**
|
|
1704
1726
|
* Method to get mg-popover identifier
|
|
@@ -1711,7 +1733,7 @@ const MgInputCheckbox = class {
|
|
|
1711
1733
|
*/
|
|
1712
1734
|
this.getDisplayItems = () => (this.searchValue.length > 0 ? this.searchResults : this.checkboxItems);
|
|
1713
1735
|
this.value = undefined;
|
|
1714
|
-
this.type =
|
|
1736
|
+
this.type = undefined;
|
|
1715
1737
|
this.identifier = undefined;
|
|
1716
1738
|
this.name = this.identifier;
|
|
1717
1739
|
this.label = undefined;
|
|
@@ -1752,9 +1774,13 @@ const MgInputCheckbox = class {
|
|
|
1752
1774
|
}
|
|
1753
1775
|
}
|
|
1754
1776
|
validateType(newValue) {
|
|
1755
|
-
if (!checkboxTypes.includes(newValue)) {
|
|
1777
|
+
if (newValue !== undefined && !checkboxTypes.includes(newValue)) {
|
|
1756
1778
|
throw new Error('<mg-input-checkbox> prop "type" must be a CheckboxType.');
|
|
1757
1779
|
}
|
|
1780
|
+
else if (newValue === undefined) {
|
|
1781
|
+
this.mode = 'auto';
|
|
1782
|
+
this.type = checkboxTypes[0];
|
|
1783
|
+
}
|
|
1758
1784
|
else {
|
|
1759
1785
|
const className = `${this.baseClassName}-multi`;
|
|
1760
1786
|
if (newValue === 'multi') {
|
|
@@ -1786,9 +1812,9 @@ const MgInputCheckbox = class {
|
|
|
1786
1812
|
this.classCollection.delete(className);
|
|
1787
1813
|
}
|
|
1788
1814
|
validateCheckboxItems(newValue) {
|
|
1789
|
-
if (newValue.length > this.multiStart)
|
|
1815
|
+
if (this.mode === 'auto' && newValue.length > this.multiStart)
|
|
1790
1816
|
this.type = 'multi';
|
|
1791
|
-
if (newValue.length > this.searchStart) {
|
|
1817
|
+
if (this.mode === 'auto' || (this.type === 'multi' && newValue.length > this.searchStart)) {
|
|
1792
1818
|
this.displaySearchInput = this.type === 'multi';
|
|
1793
1819
|
// refresh search values
|
|
1794
1820
|
this.updateSearchResults();
|
|
@@ -1799,13 +1825,44 @@ const MgInputCheckbox = class {
|
|
|
1799
1825
|
this.updateSearchResults();
|
|
1800
1826
|
}
|
|
1801
1827
|
/**
|
|
1802
|
-
*
|
|
1828
|
+
* Display input error if it exists.
|
|
1803
1829
|
*/
|
|
1804
1830
|
async displayError() {
|
|
1805
1831
|
this.checkValidity();
|
|
1806
1832
|
this.setErrorMessage();
|
|
1807
1833
|
this.hasDisplayedError = this.invalid;
|
|
1808
1834
|
}
|
|
1835
|
+
/**
|
|
1836
|
+
* Set an error and display a custom error message.
|
|
1837
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
1838
|
+
* It must be paired with an error message to display for the given context.
|
|
1839
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
1840
|
+
* @param valid - value indicating the validity
|
|
1841
|
+
* @param errorMessage - the error message to display
|
|
1842
|
+
*/
|
|
1843
|
+
async setError(valid, errorMessage) {
|
|
1844
|
+
if (typeof valid !== 'boolean') {
|
|
1845
|
+
throw new Error('<mg-input-checkbox> method "setError()" param "valid" must be a boolean');
|
|
1846
|
+
}
|
|
1847
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
1848
|
+
throw new Error('<mg-input-checkbox> method "setError()" param "errorMessage" must be a string');
|
|
1849
|
+
}
|
|
1850
|
+
else {
|
|
1851
|
+
this.setValidity(valid);
|
|
1852
|
+
this.setErrorMessage(undefined, valid ? undefined : errorMessage);
|
|
1853
|
+
this.hasDisplayedError = this.invalid;
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* Method to set validity values
|
|
1858
|
+
* @param newValue - valid new value
|
|
1859
|
+
*/
|
|
1860
|
+
setValidity(newValue) {
|
|
1861
|
+
this.valid = newValue;
|
|
1862
|
+
this.invalid = !this.valid;
|
|
1863
|
+
// We need to send valid event even if it is the same value
|
|
1864
|
+
this.inputValid.emit(this.valid);
|
|
1865
|
+
}
|
|
1809
1866
|
/**
|
|
1810
1867
|
* Update ckecboxes item
|
|
1811
1868
|
* @param key - property to update
|
|
@@ -2062,10 +2119,7 @@ const MgInputDate = class {
|
|
|
2062
2119
|
*/
|
|
2063
2120
|
this.checkValidity = () => {
|
|
2064
2121
|
var _a;
|
|
2065
|
-
this.
|
|
2066
|
-
this.invalid = !this.valid;
|
|
2067
|
-
// We need to send valid event even if it is the same value
|
|
2068
|
-
this.inputValid.emit(this.valid);
|
|
2122
|
+
this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true));
|
|
2069
2123
|
};
|
|
2070
2124
|
/**
|
|
2071
2125
|
* get input error code
|
|
@@ -2094,15 +2148,19 @@ const MgInputDate = class {
|
|
|
2094
2148
|
};
|
|
2095
2149
|
/**
|
|
2096
2150
|
* Check input errors
|
|
2151
|
+
* @param errorMessage - errorMessage override
|
|
2097
2152
|
*/
|
|
2098
|
-
this.setErrorMessage = () => {
|
|
2153
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2099
2154
|
var _a;
|
|
2100
2155
|
// Set error message
|
|
2101
2156
|
this.errorMessage = undefined;
|
|
2102
2157
|
if (!this.valid) {
|
|
2103
2158
|
const inputError = this.getInputError();
|
|
2159
|
+
if (errorMessage !== undefined) {
|
|
2160
|
+
this.errorMessage = errorMessage;
|
|
2161
|
+
}
|
|
2104
2162
|
// required
|
|
2105
|
-
if (inputError === InputError$1.REQUIRED) {
|
|
2163
|
+
else if (inputError === InputError$1.REQUIRED) {
|
|
2106
2164
|
this.errorMessage = this.messages.errors[inputError];
|
|
2107
2165
|
}
|
|
2108
2166
|
// min, max & minMax
|
|
@@ -2161,13 +2219,44 @@ const MgInputDate = class {
|
|
|
2161
2219
|
}
|
|
2162
2220
|
}
|
|
2163
2221
|
/**
|
|
2164
|
-
*
|
|
2222
|
+
* Display input error if it exists.
|
|
2165
2223
|
*/
|
|
2166
2224
|
async displayError() {
|
|
2167
2225
|
this.checkValidity();
|
|
2168
2226
|
this.setErrorMessage();
|
|
2169
2227
|
this.hasDisplayedError = this.invalid;
|
|
2170
2228
|
}
|
|
2229
|
+
/**
|
|
2230
|
+
* Set an error and display a custom error message.
|
|
2231
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
2232
|
+
* It must be paired with an error message to display for the given context.
|
|
2233
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
2234
|
+
* @param valid - value indicating the validity
|
|
2235
|
+
* @param errorMessage - the error message to display
|
|
2236
|
+
*/
|
|
2237
|
+
async setError(valid, errorMessage) {
|
|
2238
|
+
if (typeof valid !== 'boolean') {
|
|
2239
|
+
throw new Error('<mg-input-date> method "setError()" param "valid" must be a boolean');
|
|
2240
|
+
}
|
|
2241
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
2242
|
+
throw new Error('<mg-input-date> method "setError()" param "errorMessage" must be a string');
|
|
2243
|
+
}
|
|
2244
|
+
else {
|
|
2245
|
+
this.setValidity(valid);
|
|
2246
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
2247
|
+
this.hasDisplayedError = this.invalid;
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
/**
|
|
2251
|
+
* Method to set validity values
|
|
2252
|
+
* @param newValue - valid new value
|
|
2253
|
+
*/
|
|
2254
|
+
setValidity(newValue) {
|
|
2255
|
+
this.valid = newValue;
|
|
2256
|
+
this.invalid = !this.valid;
|
|
2257
|
+
// We need to send valid event even if it is the same value
|
|
2258
|
+
this.inputValid.emit(this.valid);
|
|
2259
|
+
}
|
|
2171
2260
|
/*************
|
|
2172
2261
|
* Lifecycle *
|
|
2173
2262
|
*************/
|
|
@@ -2265,20 +2354,21 @@ const MgInputNumeric = class {
|
|
|
2265
2354
|
* Check if input is valid
|
|
2266
2355
|
*/
|
|
2267
2356
|
this.checkValidity = () => {
|
|
2268
|
-
this.
|
|
2269
|
-
this.invalid = !this.valid;
|
|
2270
|
-
// We need to send valid event even if it is the same value
|
|
2271
|
-
this.inputValid.emit(this.valid);
|
|
2357
|
+
this.setValidity(this.readonly || this.disabled || this.getInputError() === null);
|
|
2272
2358
|
};
|
|
2273
2359
|
/**
|
|
2274
2360
|
* Set input error message
|
|
2361
|
+
* @param errorMessage - errorMessage override
|
|
2275
2362
|
*/
|
|
2276
|
-
this.setErrorMessage = () => {
|
|
2363
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2277
2364
|
// Set error message
|
|
2278
2365
|
this.errorMessage = undefined;
|
|
2279
2366
|
if (!this.valid) {
|
|
2280
2367
|
const inputError = this.getInputError();
|
|
2281
|
-
if (
|
|
2368
|
+
if (errorMessage !== undefined) {
|
|
2369
|
+
this.errorMessage = errorMessage;
|
|
2370
|
+
}
|
|
2371
|
+
else if (inputError === InputError.REQUIRED) {
|
|
2282
2372
|
this.errorMessage = this.messages.errors[inputError];
|
|
2283
2373
|
}
|
|
2284
2374
|
else {
|
|
@@ -2372,36 +2462,6 @@ const MgInputNumeric = class {
|
|
|
2372
2462
|
this.updateValues(newValue);
|
|
2373
2463
|
}
|
|
2374
2464
|
}
|
|
2375
|
-
/**
|
|
2376
|
-
* Checks if the given value is valid according to the defined rules.
|
|
2377
|
-
* @param value - The input value to validate.
|
|
2378
|
-
* @param regex - The regular expression for validation.
|
|
2379
|
-
* @param integer - The integer part of the value.
|
|
2380
|
-
* @param decimal - The decimal part of the value.
|
|
2381
|
-
* @returns Returns true if the value is valid, otherwise false.
|
|
2382
|
-
*/
|
|
2383
|
-
isValidValue(value, regex, integer, decimal) {
|
|
2384
|
-
return ['', '-'].includes(value) || (value.match(regex) && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength));
|
|
2385
|
-
}
|
|
2386
|
-
/**
|
|
2387
|
-
* Handles invalid input values and returns a corrected value.
|
|
2388
|
-
* @returns The corrected value.
|
|
2389
|
-
*/
|
|
2390
|
-
handleInvalidValue() {
|
|
2391
|
-
return this.storedValue !== undefined ? this.storedValue : null;
|
|
2392
|
-
}
|
|
2393
|
-
/**
|
|
2394
|
-
* Updates the component values based on the validated input value.
|
|
2395
|
-
* @param newValue - The validated input value.
|
|
2396
|
-
*/
|
|
2397
|
-
updateValues(newValue) {
|
|
2398
|
-
this.value = newValue;
|
|
2399
|
-
if (this.input !== undefined)
|
|
2400
|
-
this.input.value = this.value;
|
|
2401
|
-
this.numericValue = !['', null].includes(this.value) ? parseFloat(this.value.replace(',', '.')) : null;
|
|
2402
|
-
this.valueChange.emit(this.numericValue);
|
|
2403
|
-
this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';
|
|
2404
|
-
}
|
|
2405
2465
|
handleValidityChange(newValue, _oldValue, prop) {
|
|
2406
2466
|
if (this.input !== undefined) {
|
|
2407
2467
|
this.input[prop] = newValue;
|
|
@@ -2428,13 +2488,74 @@ const MgInputNumeric = class {
|
|
|
2428
2488
|
}
|
|
2429
2489
|
}
|
|
2430
2490
|
/**
|
|
2431
|
-
*
|
|
2491
|
+
* Display input error if it exists.
|
|
2432
2492
|
*/
|
|
2433
2493
|
async displayError() {
|
|
2434
2494
|
this.checkValidity();
|
|
2435
2495
|
this.setErrorMessage();
|
|
2436
2496
|
this.hasDisplayedError = this.invalid;
|
|
2437
2497
|
}
|
|
2498
|
+
/**
|
|
2499
|
+
* Set an error and display a custom error message.
|
|
2500
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
2501
|
+
* It must be paired with an error message to display for the given context.
|
|
2502
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
2503
|
+
* @param valid - value indicating the validity
|
|
2504
|
+
* @param errorMessage - the error message to display
|
|
2505
|
+
*/
|
|
2506
|
+
async setError(valid, errorMessage) {
|
|
2507
|
+
if (typeof valid !== 'boolean') {
|
|
2508
|
+
throw new Error('<mg-input-numeric> method "setError()" param "valid" must be a boolean');
|
|
2509
|
+
}
|
|
2510
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
2511
|
+
throw new Error('<mg-input-numeric> method "setError()" param "errorMessage" must be a string');
|
|
2512
|
+
}
|
|
2513
|
+
else {
|
|
2514
|
+
this.setValidity(valid);
|
|
2515
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
2516
|
+
this.hasDisplayedError = this.invalid;
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
/**
|
|
2520
|
+
* Method to set validity values
|
|
2521
|
+
* @param newValue - valid new value
|
|
2522
|
+
*/
|
|
2523
|
+
setValidity(newValue) {
|
|
2524
|
+
this.valid = newValue;
|
|
2525
|
+
this.invalid = !this.valid;
|
|
2526
|
+
// We need to send valid event even if it is the same value
|
|
2527
|
+
this.inputValid.emit(this.valid);
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* Checks if the given value is valid according to the defined rules.
|
|
2531
|
+
* @param value - The input value to validate.
|
|
2532
|
+
* @param regex - The regular expression for validation.
|
|
2533
|
+
* @param integer - The integer part of the value.
|
|
2534
|
+
* @param decimal - The decimal part of the value.
|
|
2535
|
+
* @returns Returns true if the value is valid, otherwise false.
|
|
2536
|
+
*/
|
|
2537
|
+
isValidValue(value, regex, integer, decimal) {
|
|
2538
|
+
return ['', '-'].includes(value) || (value.match(regex) && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength));
|
|
2539
|
+
}
|
|
2540
|
+
/**
|
|
2541
|
+
* Handles invalid input values and returns a corrected value.
|
|
2542
|
+
* @returns The corrected value.
|
|
2543
|
+
*/
|
|
2544
|
+
handleInvalidValue() {
|
|
2545
|
+
return this.storedValue !== undefined ? this.storedValue : null;
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* Updates the component values based on the validated input value.
|
|
2549
|
+
* @param newValue - The validated input value.
|
|
2550
|
+
*/
|
|
2551
|
+
updateValues(newValue) {
|
|
2552
|
+
this.value = newValue;
|
|
2553
|
+
if (this.input !== undefined)
|
|
2554
|
+
this.input.value = this.value;
|
|
2555
|
+
this.numericValue = !['', null].includes(this.value) ? parseFloat(this.value.replace(',', '.')) : null;
|
|
2556
|
+
this.valueChange.emit(this.numericValue);
|
|
2557
|
+
this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';
|
|
2558
|
+
}
|
|
2438
2559
|
/**
|
|
2439
2560
|
* Displayed value in input
|
|
2440
2561
|
* Change on focus/blur
|
|
@@ -2522,20 +2643,23 @@ const MgInputPassword = class {
|
|
|
2522
2643
|
*/
|
|
2523
2644
|
this.checkValidity = () => {
|
|
2524
2645
|
var _a;
|
|
2525
|
-
this.
|
|
2526
|
-
this.invalid = !this.valid;
|
|
2527
|
-
// We need to send valid event even if it is the same value
|
|
2528
|
-
this.inputValid.emit(this.valid);
|
|
2646
|
+
this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true));
|
|
2529
2647
|
};
|
|
2530
2648
|
/**
|
|
2531
2649
|
* Set input error message
|
|
2650
|
+
* @param errorMessage - errorMessage override
|
|
2532
2651
|
*/
|
|
2533
|
-
this.setErrorMessage = () => {
|
|
2652
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2534
2653
|
// Set error message
|
|
2535
2654
|
this.errorMessage = undefined;
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2655
|
+
if (!this.valid) {
|
|
2656
|
+
if (errorMessage !== undefined) {
|
|
2657
|
+
this.errorMessage = errorMessage;
|
|
2658
|
+
}
|
|
2659
|
+
// required
|
|
2660
|
+
else if (this.input.validity.valueMissing) {
|
|
2661
|
+
this.errorMessage = this.messages.errors.required;
|
|
2662
|
+
}
|
|
2539
2663
|
}
|
|
2540
2664
|
};
|
|
2541
2665
|
this.value = undefined;
|
|
@@ -2570,13 +2694,44 @@ const MgInputPassword = class {
|
|
|
2570
2694
|
}
|
|
2571
2695
|
}
|
|
2572
2696
|
/**
|
|
2573
|
-
*
|
|
2697
|
+
* Display input error if it exists.
|
|
2574
2698
|
*/
|
|
2575
2699
|
async displayError() {
|
|
2576
2700
|
this.checkValidity();
|
|
2577
2701
|
this.setErrorMessage();
|
|
2578
2702
|
this.hasDisplayedError = this.invalid;
|
|
2579
2703
|
}
|
|
2704
|
+
/**
|
|
2705
|
+
* Set an error and display a custom error message.
|
|
2706
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
2707
|
+
* It must be paired with an error message to display for the given context.
|
|
2708
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
2709
|
+
* @param valid - value indicating the validity
|
|
2710
|
+
* @param errorMessage - the error message to display
|
|
2711
|
+
*/
|
|
2712
|
+
async setError(valid, errorMessage) {
|
|
2713
|
+
if (typeof valid !== 'boolean') {
|
|
2714
|
+
throw new Error('<mg-input-password> method "setError()" param "valid" must be a boolean');
|
|
2715
|
+
}
|
|
2716
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
2717
|
+
throw new Error('<mg-input-password> method "setError()" param "errorMessage" must be a string');
|
|
2718
|
+
}
|
|
2719
|
+
else {
|
|
2720
|
+
this.setValidity(valid);
|
|
2721
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
2722
|
+
this.hasDisplayedError = this.invalid;
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
/**
|
|
2726
|
+
* Method to set validity values
|
|
2727
|
+
* @param newValue - valid new value
|
|
2728
|
+
*/
|
|
2729
|
+
setValidity(newValue) {
|
|
2730
|
+
this.valid = newValue;
|
|
2731
|
+
this.invalid = !this.valid;
|
|
2732
|
+
// We need to send valid event even if it is the same value
|
|
2733
|
+
this.inputValid.emit(this.valid);
|
|
2734
|
+
}
|
|
2580
2735
|
/*************
|
|
2581
2736
|
* Lifecycle *
|
|
2582
2737
|
*************/
|
|
@@ -2653,20 +2808,23 @@ const MgInputRadio = class {
|
|
|
2653
2808
|
* Check if input is valid
|
|
2654
2809
|
*/
|
|
2655
2810
|
this.checkValidity = () => {
|
|
2656
|
-
this.
|
|
2657
|
-
this.invalid = !this.valid;
|
|
2658
|
-
// We need to send valid event even if it is the same value
|
|
2659
|
-
this.inputValid.emit(this.valid);
|
|
2811
|
+
this.setValidity(this.readonly || this.disabled || this.getInvalidElement() === undefined);
|
|
2660
2812
|
};
|
|
2661
2813
|
/**
|
|
2662
2814
|
* Set input error message
|
|
2815
|
+
* @param errorMessage - errorMessage override
|
|
2663
2816
|
*/
|
|
2664
|
-
this.setErrorMessage = () => {
|
|
2817
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2665
2818
|
const invalidElement = this.getInvalidElement();
|
|
2666
2819
|
// Set error message
|
|
2667
2820
|
this.errorMessage = undefined;
|
|
2668
|
-
if (!this.valid
|
|
2669
|
-
|
|
2821
|
+
if (!this.valid) {
|
|
2822
|
+
if (errorMessage !== undefined) {
|
|
2823
|
+
this.errorMessage = errorMessage;
|
|
2824
|
+
}
|
|
2825
|
+
else if (invalidElement.validity.valueMissing) {
|
|
2826
|
+
this.errorMessage = this.messages.errors.required;
|
|
2827
|
+
}
|
|
2670
2828
|
}
|
|
2671
2829
|
};
|
|
2672
2830
|
/**
|
|
@@ -2724,13 +2882,44 @@ const MgInputRadio = class {
|
|
|
2724
2882
|
}
|
|
2725
2883
|
}
|
|
2726
2884
|
/**
|
|
2727
|
-
*
|
|
2885
|
+
* Display input error if it exists.
|
|
2728
2886
|
*/
|
|
2729
2887
|
async displayError() {
|
|
2730
2888
|
this.checkValidity();
|
|
2731
2889
|
this.setErrorMessage();
|
|
2732
2890
|
this.hasDisplayedError = this.invalid;
|
|
2733
2891
|
}
|
|
2892
|
+
/**
|
|
2893
|
+
* Set an error and display a custom error message.
|
|
2894
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
2895
|
+
* It must be paired with an error message to display for the given context.
|
|
2896
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
2897
|
+
* @param valid - value indicating the validity
|
|
2898
|
+
* @param errorMessage - the error message to display
|
|
2899
|
+
*/
|
|
2900
|
+
async setError(valid, errorMessage) {
|
|
2901
|
+
if (typeof valid !== 'boolean') {
|
|
2902
|
+
throw new Error('<mg-input-radio> method "setError()" param "valid" must be a boolean');
|
|
2903
|
+
}
|
|
2904
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
2905
|
+
throw new Error('<mg-input-radio> method "setError()" param "errorMessage" must be a string');
|
|
2906
|
+
}
|
|
2907
|
+
else {
|
|
2908
|
+
this.setValidity(valid);
|
|
2909
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
2910
|
+
this.hasDisplayedError = this.invalid;
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
/**
|
|
2914
|
+
* Method to set validity values
|
|
2915
|
+
* @param newValue - valid new value
|
|
2916
|
+
*/
|
|
2917
|
+
setValidity(newValue) {
|
|
2918
|
+
this.valid = newValue;
|
|
2919
|
+
this.invalid = !this.valid;
|
|
2920
|
+
// We need to send valid event even if it is the same value
|
|
2921
|
+
this.inputValid.emit(this.valid);
|
|
2922
|
+
}
|
|
2734
2923
|
/*************
|
|
2735
2924
|
* Lifecycle *
|
|
2736
2925
|
*************/
|
|
@@ -2879,19 +3068,22 @@ const MgInputSelect = class {
|
|
|
2879
3068
|
*/
|
|
2880
3069
|
this.checkValidity = () => {
|
|
2881
3070
|
var _a;
|
|
2882
|
-
this.
|
|
2883
|
-
this.invalid = !this.valid;
|
|
2884
|
-
// We need to send valid event even if it is the same value
|
|
2885
|
-
this.inputValid.emit(this.valid);
|
|
3071
|
+
this.setValidity(!this.isDisabledValue() && (this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true)));
|
|
2886
3072
|
};
|
|
2887
3073
|
/**
|
|
2888
3074
|
* Set input error message
|
|
3075
|
+
* @param errorMessage - errorMessage override
|
|
2889
3076
|
*/
|
|
2890
|
-
this.setErrorMessage = () => {
|
|
3077
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2891
3078
|
// Set error message
|
|
2892
3079
|
this.errorMessage = undefined;
|
|
2893
|
-
if (!this.valid
|
|
2894
|
-
|
|
3080
|
+
if (!this.valid) {
|
|
3081
|
+
if (errorMessage !== undefined) {
|
|
3082
|
+
this.errorMessage = errorMessage;
|
|
3083
|
+
}
|
|
3084
|
+
else if (this.input.validity.valueMissing) {
|
|
3085
|
+
this.errorMessage = this.messages.errors.required;
|
|
3086
|
+
}
|
|
2895
3087
|
}
|
|
2896
3088
|
};
|
|
2897
3089
|
/**
|
|
@@ -2975,13 +3167,44 @@ const MgInputSelect = class {
|
|
|
2975
3167
|
}
|
|
2976
3168
|
}
|
|
2977
3169
|
/**
|
|
2978
|
-
*
|
|
3170
|
+
* Display input error if it exists.
|
|
2979
3171
|
*/
|
|
2980
3172
|
async displayError() {
|
|
2981
3173
|
this.checkValidity();
|
|
2982
3174
|
this.setErrorMessage();
|
|
2983
3175
|
this.hasDisplayedError = this.invalid;
|
|
2984
3176
|
}
|
|
3177
|
+
/**
|
|
3178
|
+
* Set an error and display a custom error message.
|
|
3179
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
3180
|
+
* It must be paired with an error message to display for the given context.
|
|
3181
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
3182
|
+
* @param valid - value indicating the validity
|
|
3183
|
+
* @param errorMessage - the error message to display
|
|
3184
|
+
*/
|
|
3185
|
+
async setError(valid, errorMessage) {
|
|
3186
|
+
if (typeof valid !== 'boolean') {
|
|
3187
|
+
throw new Error('<mg-input-select> method "setError()" param "valid" must be a boolean');
|
|
3188
|
+
}
|
|
3189
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
3190
|
+
throw new Error('<mg-input-select> method "setError()" param "errorMessage" must be a string');
|
|
3191
|
+
}
|
|
3192
|
+
else {
|
|
3193
|
+
this.setValidity(valid);
|
|
3194
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
3195
|
+
this.hasDisplayedError = this.invalid;
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
/**
|
|
3199
|
+
* Method to set validity values
|
|
3200
|
+
* @param newValue - valid new value
|
|
3201
|
+
*/
|
|
3202
|
+
setValidity(newValue) {
|
|
3203
|
+
this.valid = newValue;
|
|
3204
|
+
this.invalid = !this.valid;
|
|
3205
|
+
// We need to send valid event even if it is the same value
|
|
3206
|
+
this.inputValid.emit(this.valid);
|
|
3207
|
+
}
|
|
2985
3208
|
/*************
|
|
2986
3209
|
* Lifecycle *
|
|
2987
3210
|
*************/
|
|
@@ -3076,19 +3299,21 @@ const MgInputText = class {
|
|
|
3076
3299
|
*/
|
|
3077
3300
|
this.checkValidity = () => {
|
|
3078
3301
|
var _a;
|
|
3079
|
-
this.
|
|
3080
|
-
this.invalid = !this.valid;
|
|
3081
|
-
// We need to send valid event even if it is the same value
|
|
3082
|
-
this.inputValid.emit(this.valid);
|
|
3302
|
+
this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true));
|
|
3083
3303
|
};
|
|
3084
3304
|
/**
|
|
3085
3305
|
* Set input error message
|
|
3306
|
+
* @param errorMessage - errorMessage override
|
|
3086
3307
|
*/
|
|
3087
|
-
this.setErrorMessage = () => {
|
|
3308
|
+
this.setErrorMessage = (errorMessage) => {
|
|
3088
3309
|
// Set error message
|
|
3089
3310
|
this.errorMessage = undefined;
|
|
3311
|
+
// Does have a custom error message
|
|
3312
|
+
if (!this.valid && errorMessage !== undefined) {
|
|
3313
|
+
this.errorMessage = errorMessage;
|
|
3314
|
+
}
|
|
3090
3315
|
// Does not match pattern
|
|
3091
|
-
if (!this.valid && this.input.validity.patternMismatch) {
|
|
3316
|
+
else if (!this.valid && this.input.validity.patternMismatch) {
|
|
3092
3317
|
this.errorMessage = this.patternErrorMessage;
|
|
3093
3318
|
}
|
|
3094
3319
|
// required
|
|
@@ -3096,17 +3321,6 @@ const MgInputText = class {
|
|
|
3096
3321
|
this.errorMessage = this.messages.errors.required;
|
|
3097
3322
|
}
|
|
3098
3323
|
};
|
|
3099
|
-
/**
|
|
3100
|
-
* Validate pattern configuration
|
|
3101
|
-
*/
|
|
3102
|
-
this.validatePattern = () => {
|
|
3103
|
-
if (this.pattern !== undefined &&
|
|
3104
|
-
typeof this.pattern === 'string' &&
|
|
3105
|
-
this.pattern !== '' &&
|
|
3106
|
-
(this.patternErrorMessage === undefined || typeof this.patternErrorMessage !== 'string' || this.patternErrorMessage === '')) {
|
|
3107
|
-
throw new Error('<mg-input-text> prop "pattern" must be paired with the prop "patternErrorMessage"');
|
|
3108
|
-
}
|
|
3109
|
-
};
|
|
3110
3324
|
/**
|
|
3111
3325
|
* Validate append slot
|
|
3112
3326
|
*/
|
|
@@ -3165,6 +3379,11 @@ const MgInputText = class {
|
|
|
3165
3379
|
}
|
|
3166
3380
|
}
|
|
3167
3381
|
}
|
|
3382
|
+
validatePattern(newValue) {
|
|
3383
|
+
if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {
|
|
3384
|
+
throw new Error('<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3168
3387
|
/**
|
|
3169
3388
|
* Public method to play input focus
|
|
3170
3389
|
*/
|
|
@@ -3172,13 +3391,44 @@ const MgInputText = class {
|
|
|
3172
3391
|
this.input.focus();
|
|
3173
3392
|
}
|
|
3174
3393
|
/**
|
|
3175
|
-
*
|
|
3394
|
+
* Display input error if it exists.
|
|
3176
3395
|
*/
|
|
3177
3396
|
async displayError() {
|
|
3178
3397
|
this.checkValidity();
|
|
3179
3398
|
this.setErrorMessage();
|
|
3180
3399
|
this.hasDisplayedError = this.invalid;
|
|
3181
3400
|
}
|
|
3401
|
+
/**
|
|
3402
|
+
* Set an error and display a custom error message.
|
|
3403
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
3404
|
+
* It must be paired with an error message to display for the given context.
|
|
3405
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
3406
|
+
* @param valid - value indicating the validity
|
|
3407
|
+
* @param errorMessage - the error message to display
|
|
3408
|
+
*/
|
|
3409
|
+
async setError(valid, errorMessage) {
|
|
3410
|
+
if (typeof valid !== 'boolean') {
|
|
3411
|
+
throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean');
|
|
3412
|
+
}
|
|
3413
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
3414
|
+
throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string');
|
|
3415
|
+
}
|
|
3416
|
+
else {
|
|
3417
|
+
this.setValidity(valid);
|
|
3418
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
3419
|
+
this.hasDisplayedError = this.invalid;
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
/**
|
|
3423
|
+
* Method to set validity values
|
|
3424
|
+
* @param newValue - valid new value
|
|
3425
|
+
*/
|
|
3426
|
+
setValidity(newValue) {
|
|
3427
|
+
this.valid = newValue;
|
|
3428
|
+
this.invalid = !this.valid;
|
|
3429
|
+
// We need to send valid event even if it is the same value
|
|
3430
|
+
this.inputValid.emit(this.valid);
|
|
3431
|
+
}
|
|
3182
3432
|
/*************
|
|
3183
3433
|
* Lifecycle *
|
|
3184
3434
|
*************/
|
|
@@ -3192,7 +3442,8 @@ const MgInputText = class {
|
|
|
3192
3442
|
this.characterLeftId = `${this.identifier}-character-left`;
|
|
3193
3443
|
// Validate
|
|
3194
3444
|
this.validateIcon(this.icon);
|
|
3195
|
-
this.validatePattern();
|
|
3445
|
+
this.validatePattern(this.pattern);
|
|
3446
|
+
this.validatePattern(this.patternErrorMessage);
|
|
3196
3447
|
this.validateAppendSlot();
|
|
3197
3448
|
// Check validity when component is ready
|
|
3198
3449
|
// return a promise to process action only in the FIRST render().
|
|
@@ -3221,7 +3472,9 @@ const MgInputText = class {
|
|
|
3221
3472
|
"icon": ["validateIcon"],
|
|
3222
3473
|
"required": ["handleValidityChange"],
|
|
3223
3474
|
"readonly": ["handleValidityChange"],
|
|
3224
|
-
"disabled": ["handleValidityChange"]
|
|
3475
|
+
"disabled": ["handleValidityChange"],
|
|
3476
|
+
"pattern": ["validatePattern"],
|
|
3477
|
+
"patternErrorMessage": ["validatePattern"]
|
|
3225
3478
|
}; }
|
|
3226
3479
|
};
|
|
3227
3480
|
MgInputText.style = mgInputTextCss;
|
|
@@ -3279,35 +3532,27 @@ const MgInputTextarea = class {
|
|
|
3279
3532
|
*/
|
|
3280
3533
|
this.checkValidity = () => {
|
|
3281
3534
|
var _a;
|
|
3282
|
-
this.
|
|
3283
|
-
this.invalid = !this.valid;
|
|
3284
|
-
// We need to send valid event even if it is the same value
|
|
3285
|
-
this.inputValid.emit(this.valid);
|
|
3535
|
+
this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined && this.input.checkValidity() && this.getPatternValidity()));
|
|
3286
3536
|
};
|
|
3287
3537
|
/**
|
|
3288
3538
|
* Set input error message
|
|
3539
|
+
* @param errorMessage - errorMessage override
|
|
3289
3540
|
*/
|
|
3290
|
-
this.setErrorMessage = () => {
|
|
3541
|
+
this.setErrorMessage = (errorMessage) => {
|
|
3291
3542
|
// Set error message
|
|
3292
3543
|
this.errorMessage = undefined;
|
|
3293
3544
|
// Does not match pattern
|
|
3294
|
-
if (!this.valid
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
this.validatePattern = () => {
|
|
3306
|
-
if (this.pattern !== undefined &&
|
|
3307
|
-
typeof this.pattern === 'string' &&
|
|
3308
|
-
this.pattern !== '' &&
|
|
3309
|
-
(this.patternErrorMessage === undefined || typeof this.patternErrorMessage !== 'string' || this.patternErrorMessage === '')) {
|
|
3310
|
-
throw new Error('<mg-input-textarea> prop "pattern" must be paired with the prop "patternErrorMessage"');
|
|
3545
|
+
if (!this.valid) {
|
|
3546
|
+
if (errorMessage !== undefined) {
|
|
3547
|
+
this.errorMessage = errorMessage;
|
|
3548
|
+
}
|
|
3549
|
+
else if (!this.getPatternValidity()) {
|
|
3550
|
+
this.errorMessage = this.patternErrorMessage;
|
|
3551
|
+
}
|
|
3552
|
+
// required
|
|
3553
|
+
else if (this.input.validity.valueMissing) {
|
|
3554
|
+
this.errorMessage = this.messages.errors.required;
|
|
3555
|
+
}
|
|
3311
3556
|
}
|
|
3312
3557
|
};
|
|
3313
3558
|
this.value = undefined;
|
|
@@ -3348,6 +3593,11 @@ const MgInputTextarea = class {
|
|
|
3348
3593
|
}
|
|
3349
3594
|
}
|
|
3350
3595
|
}
|
|
3596
|
+
validatePattern(newValue) {
|
|
3597
|
+
if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {
|
|
3598
|
+
throw new Error('<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3351
3601
|
validateDisplayCharacterLeft(newValue) {
|
|
3352
3602
|
if (newValue) {
|
|
3353
3603
|
this.classCollection.add(this.classHasDisplayCharacterLeft);
|
|
@@ -3357,13 +3607,44 @@ const MgInputTextarea = class {
|
|
|
3357
3607
|
}
|
|
3358
3608
|
}
|
|
3359
3609
|
/**
|
|
3360
|
-
*
|
|
3610
|
+
* Display input error if it exists.
|
|
3361
3611
|
*/
|
|
3362
3612
|
async displayError() {
|
|
3363
3613
|
this.checkValidity();
|
|
3364
3614
|
this.setErrorMessage();
|
|
3365
3615
|
this.hasDisplayedError = this.invalid;
|
|
3366
3616
|
}
|
|
3617
|
+
/**
|
|
3618
|
+
* Set an error and display a custom error message.
|
|
3619
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
3620
|
+
* It must be paired with an error message to display for the given context.
|
|
3621
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
3622
|
+
* @param valid - value indicating the validity
|
|
3623
|
+
* @param errorMessage - the error message to display
|
|
3624
|
+
*/
|
|
3625
|
+
async setError(valid, errorMessage) {
|
|
3626
|
+
if (typeof valid !== 'boolean') {
|
|
3627
|
+
throw new Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean');
|
|
3628
|
+
}
|
|
3629
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
3630
|
+
throw new Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string');
|
|
3631
|
+
}
|
|
3632
|
+
else {
|
|
3633
|
+
this.setValidity(valid);
|
|
3634
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
3635
|
+
this.hasDisplayedError = this.invalid;
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
/**
|
|
3639
|
+
* Method to set validity values
|
|
3640
|
+
* @param newValue - valid new value
|
|
3641
|
+
*/
|
|
3642
|
+
setValidity(newValue) {
|
|
3643
|
+
this.valid = newValue;
|
|
3644
|
+
this.invalid = !this.valid;
|
|
3645
|
+
// We need to send valid event even if it is the same value
|
|
3646
|
+
this.inputValid.emit(this.valid);
|
|
3647
|
+
}
|
|
3367
3648
|
/*************
|
|
3368
3649
|
* Lifecycle *
|
|
3369
3650
|
*************/
|
|
@@ -3377,7 +3658,8 @@ const MgInputTextarea = class {
|
|
|
3377
3658
|
this.characterLeftId = `${this.identifier}-character-left`;
|
|
3378
3659
|
// Validate
|
|
3379
3660
|
this.validateDisplayCharacterLeft(this.displayCharacterLeft);
|
|
3380
|
-
this.validatePattern();
|
|
3661
|
+
this.validatePattern(this.pattern);
|
|
3662
|
+
this.validatePattern(this.patternErrorMessage);
|
|
3381
3663
|
// Check validity when component is ready
|
|
3382
3664
|
// return a promise to process action only in the FIRST render().
|
|
3383
3665
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
@@ -3406,6 +3688,8 @@ const MgInputTextarea = class {
|
|
|
3406
3688
|
"required": ["handleValidityChange"],
|
|
3407
3689
|
"readonly": ["handleValidityChange"],
|
|
3408
3690
|
"disabled": ["handleValidityChange"],
|
|
3691
|
+
"pattern": ["validatePattern"],
|
|
3692
|
+
"patternErrorMessage": ["validatePattern"],
|
|
3409
3693
|
"displayCharacterLeft": ["validateDisplayCharacterLeft"]
|
|
3410
3694
|
}; }
|
|
3411
3695
|
};
|
|
@@ -4682,11 +4966,9 @@ const MgPanel = class {
|
|
|
4682
4966
|
throw new Error('<mg-panel> prop "panelTitle" is required.');
|
|
4683
4967
|
this.titleChange.emit(newValue);
|
|
4684
4968
|
}
|
|
4685
|
-
|
|
4969
|
+
validateTitlePattern(newValue) {
|
|
4686
4970
|
if (newValue !== undefined && !this.titleEditable)
|
|
4687
|
-
throw new Error(
|
|
4688
|
-
if (newValue !== undefined && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === ''))
|
|
4689
|
-
throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
|
|
4971
|
+
throw new Error(`<mg-panel> prop "titleEditable" must be set to "true".`);
|
|
4690
4972
|
}
|
|
4691
4973
|
validateTitlePosition(newValue) {
|
|
4692
4974
|
if (!titlePositions.includes(newValue))
|
|
@@ -4711,7 +4993,8 @@ const MgPanel = class {
|
|
|
4711
4993
|
// Get locales
|
|
4712
4994
|
this.messages = initLocales(this.element).messages;
|
|
4713
4995
|
// Validate
|
|
4714
|
-
this.
|
|
4996
|
+
this.validateTitlePattern(this.titlePattern);
|
|
4997
|
+
this.validateTitlePattern(this.titlePatternErrorMessage);
|
|
4715
4998
|
this.validatePanelTitle(this.panelTitle);
|
|
4716
4999
|
this.validateExpandToggleDisplay(this.expandToggleDisplay);
|
|
4717
5000
|
this.validateTitlePosition(this.titlePosition);
|
|
@@ -4735,7 +5018,8 @@ const MgPanel = class {
|
|
|
4735
5018
|
get element() { return getElement(this); }
|
|
4736
5019
|
static get watchers() { return {
|
|
4737
5020
|
"panelTitle": ["validatePanelTitle"],
|
|
4738
|
-
"titlePattern": ["
|
|
5021
|
+
"titlePattern": ["validateTitlePattern"],
|
|
5022
|
+
"titlePatternErrorMessage": ["validateTitlePattern"],
|
|
4739
5023
|
"titlePosition": ["validateTitlePosition"],
|
|
4740
5024
|
"expanded": ["handleExpanded"],
|
|
4741
5025
|
"expandToggleDisplay": ["validateExpandToggleDisplay"]
|
|
@@ -6595,21 +6879,27 @@ const MgPopover = class {
|
|
|
6595
6879
|
* Render popover content element
|
|
6596
6880
|
*/
|
|
6597
6881
|
this.renderPopoverContent = () => {
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6882
|
+
const mgPopoverContent = this.element.querySelector('mg-popover-content');
|
|
6883
|
+
if (mgPopoverContent === null) {
|
|
6884
|
+
this.mgPopoverContent = document.createElement('mg-popover-content');
|
|
6885
|
+
this.mgPopoverContent.setAttribute('slot', 'content');
|
|
6886
|
+
this.mgPopoverContent.setAttribute('id', this.identifier);
|
|
6887
|
+
this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);
|
|
6888
|
+
const arrow = document.createElement('div');
|
|
6889
|
+
arrow.setAttribute('slot', 'arrow');
|
|
6890
|
+
arrow.dataset.popperArrow = '';
|
|
6891
|
+
this.mgPopoverContent.appendChild(arrow);
|
|
6892
|
+
// insert elements in DOM
|
|
6893
|
+
['[slot="title"]', '[slot="content"]:not(mg-popover-content)'].forEach(slotType => {
|
|
6894
|
+
Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {
|
|
6895
|
+
this.mgPopoverContent.appendChild(slot);
|
|
6896
|
+
});
|
|
6610
6897
|
});
|
|
6611
|
-
|
|
6612
|
-
|
|
6898
|
+
this.element.appendChild(this.mgPopoverContent);
|
|
6899
|
+
}
|
|
6900
|
+
else {
|
|
6901
|
+
mgPopoverContent.setAttribute('id', this.identifier);
|
|
6902
|
+
}
|
|
6613
6903
|
};
|
|
6614
6904
|
this.identifier = createID('mg-popover');
|
|
6615
6905
|
this.placement = 'bottom';
|
|
@@ -6618,6 +6908,10 @@ const MgPopover = class {
|
|
|
6618
6908
|
this.display = false;
|
|
6619
6909
|
this.disabled = false;
|
|
6620
6910
|
}
|
|
6911
|
+
validateIdentifier() {
|
|
6912
|
+
// use renderPopoverContent to update popover-content id
|
|
6913
|
+
this.renderPopoverContent();
|
|
6914
|
+
}
|
|
6621
6915
|
validateArrowHide(newValue) {
|
|
6622
6916
|
if (newValue)
|
|
6623
6917
|
this.mgPopoverContent.dataset.arrowHide = '';
|
|
@@ -6654,6 +6948,7 @@ const MgPopover = class {
|
|
|
6654
6948
|
// render mg-popover-content slot
|
|
6655
6949
|
this.renderPopoverContent();
|
|
6656
6950
|
this.validateCloseButton(this.closeButton);
|
|
6951
|
+
this.validateIdentifier();
|
|
6657
6952
|
this.validateArrowHide(this.arrowHide);
|
|
6658
6953
|
}
|
|
6659
6954
|
/**
|
|
@@ -6678,6 +6973,12 @@ const MgPopover = class {
|
|
|
6678
6973
|
offset: [0, 0],
|
|
6679
6974
|
},
|
|
6680
6975
|
},
|
|
6976
|
+
{
|
|
6977
|
+
name: 'flip',
|
|
6978
|
+
options: {
|
|
6979
|
+
fallbackPlacements: ['auto'],
|
|
6980
|
+
},
|
|
6981
|
+
},
|
|
6681
6982
|
],
|
|
6682
6983
|
});
|
|
6683
6984
|
// add resize observer
|
|
@@ -6707,6 +7008,7 @@ const MgPopover = class {
|
|
|
6707
7008
|
}
|
|
6708
7009
|
get element() { return getElement(this); }
|
|
6709
7010
|
static get watchers() { return {
|
|
7011
|
+
"identifier": ["validateIdentifier"],
|
|
6710
7012
|
"arrowHide": ["validateArrowHide"],
|
|
6711
7013
|
"closeButton": ["validateCloseButton"],
|
|
6712
7014
|
"display": ["handleDisplay"]
|
|
@@ -7289,6 +7591,12 @@ const MgTooltip = class {
|
|
|
7289
7591
|
offset: [0, 8],
|
|
7290
7592
|
},
|
|
7291
7593
|
},
|
|
7594
|
+
{
|
|
7595
|
+
name: 'flip',
|
|
7596
|
+
options: {
|
|
7597
|
+
fallbackPlacements: ['auto'],
|
|
7598
|
+
},
|
|
7599
|
+
},
|
|
7292
7600
|
],
|
|
7293
7601
|
});
|
|
7294
7602
|
// Manage tooltipedElement focus/blur events
|
|
@@ -7326,6 +7634,10 @@ const MgTooltip = class {
|
|
|
7326
7634
|
this.display = false;
|
|
7327
7635
|
this.disabled = false;
|
|
7328
7636
|
}
|
|
7637
|
+
validateIdentifier() {
|
|
7638
|
+
// use renderTooltipContent to update tooltip-content id
|
|
7639
|
+
this.renderTooltipContent();
|
|
7640
|
+
}
|
|
7329
7641
|
validateMessage(newValue) {
|
|
7330
7642
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
7331
7643
|
throw new Error('<mg-tooltip> prop "message" is required.');
|
|
@@ -7351,16 +7663,22 @@ const MgTooltip = class {
|
|
|
7351
7663
|
/**
|
|
7352
7664
|
* Render tooltip content element
|
|
7353
7665
|
*/
|
|
7354
|
-
|
|
7355
|
-
const mgTooltipContent =
|
|
7356
|
-
mgTooltipContent
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7666
|
+
renderTooltipContent() {
|
|
7667
|
+
const mgTooltipContent = this.element.querySelector('mg-tooltip-content');
|
|
7668
|
+
if (mgTooltipContent === null) {
|
|
7669
|
+
const mgTooltipContent = document.createElement('mg-tooltip-content');
|
|
7670
|
+
mgTooltipContent.setAttribute('slot', 'content');
|
|
7671
|
+
mgTooltipContent.setAttribute('id', this.identifier);
|
|
7672
|
+
const arrow = document.createElement('div');
|
|
7673
|
+
arrow.setAttribute('slot', 'arrow');
|
|
7674
|
+
arrow.dataset.popperArrow = '';
|
|
7675
|
+
mgTooltipContent.appendChild(arrow);
|
|
7676
|
+
// append tooltip element to component
|
|
7677
|
+
this.element.appendChild(mgTooltipContent);
|
|
7678
|
+
}
|
|
7679
|
+
else {
|
|
7680
|
+
mgTooltipContent.setAttribute('id', this.identifier);
|
|
7681
|
+
}
|
|
7364
7682
|
}
|
|
7365
7683
|
/*************
|
|
7366
7684
|
* Lifecycle *
|
|
@@ -7372,11 +7690,12 @@ const MgTooltip = class {
|
|
|
7372
7690
|
// Get windows to attach events
|
|
7373
7691
|
this.windows = getWindows(window);
|
|
7374
7692
|
// Get tooltip element
|
|
7375
|
-
this.
|
|
7693
|
+
this.renderTooltipContent();
|
|
7376
7694
|
this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);
|
|
7377
7695
|
//validate properties
|
|
7378
7696
|
this.validateDisabled(this.disabled);
|
|
7379
7697
|
this.validateMessage(this.message);
|
|
7698
|
+
this.validateIdentifier();
|
|
7380
7699
|
}
|
|
7381
7700
|
/**
|
|
7382
7701
|
* Get slotted element
|
|
@@ -7424,6 +7743,7 @@ const MgTooltip = class {
|
|
|
7424
7743
|
}
|
|
7425
7744
|
get element() { return getElement(this); }
|
|
7426
7745
|
static get watchers() { return {
|
|
7746
|
+
"identifier": ["validateIdentifier"],
|
|
7427
7747
|
"message": ["validateMessage"],
|
|
7428
7748
|
"display": ["handleDisplay"],
|
|
7429
7749
|
"disabled": ["validateDisabled"]
|
|
@@ -7452,3 +7772,5 @@ const MgTooltipContent = class {
|
|
|
7452
7772
|
MgTooltipContent.style = mgTooltipContentCss;
|
|
7453
7773
|
|
|
7454
7774
|
export { MgActionMore as mg_action_more, MgBadge as mg_badge, MgButton as mg_button, MgCard as mg_card, MgCharacterLeft as mg_character_left, MgDetails as mg_details, MgDivider as mg_divider, MgForm as mg_form, MgIcon as mg_icon, MgIllustratedMessage as mg_illustrated_message, MgInputCheckbox as mg_input_checkbox, MgInputCheckboxPaginated as mg_input_checkbox_paginated, MgInputDate as mg_input_date, MgInputNumeric as mg_input_numeric, MgInputPassword as mg_input_password, MgInputRadio as mg_input_radio, MgInputSelect as mg_input_select, MgInputText as mg_input_text, MgInputTextarea as mg_input_textarea, MgInputTitle as mg_input_title, MgInputToggle as mg_input_toggle, MgMenu as mg_menu, MgMenuItem as mg_menu_item, MgMessage as mg_message, MgModal as mg_modal, MgPagination as mg_pagination, MgPanel as mg_panel, MgPopover as mg_popover, MgPopoverContent as mg_popover_content, MgSkipLinks as mg_skip_links, MgTabs as mg_tabs, MgTag as mg_tag, MgTooltip as mg_tooltip, MgTooltipContent as mg_tooltip_content };
|
|
7775
|
+
|
|
7776
|
+
//# sourceMappingURL=mg-action-more_34.entry.js.map
|