@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
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const mgMenu_conf = require('./mg-menu.conf-
|
|
5
|
+
const index = require('./index-c042e24b.js');
|
|
6
|
+
const mgMenu_conf = require('./mg-menu.conf-43aacf30.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Available menu-item positions
|
|
@@ -152,6 +152,12 @@ const getChildWindows = (localWindow, windows = []) => {
|
|
|
152
152
|
}
|
|
153
153
|
return windows;
|
|
154
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* Validate string
|
|
157
|
+
* @param value - value to check
|
|
158
|
+
* @returns if string is valid
|
|
159
|
+
*/
|
|
160
|
+
const isValidString = (value) => typeof value === 'string' && value.trim() !== '';
|
|
155
161
|
|
|
156
162
|
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)}";
|
|
157
163
|
|
|
@@ -221,7 +227,7 @@ const MgActionMore = class {
|
|
|
221
227
|
this.expanded = false;
|
|
222
228
|
customHandler(event);
|
|
223
229
|
};
|
|
224
|
-
this.icon =
|
|
230
|
+
this.icon = undefined;
|
|
225
231
|
this.button = { variant: 'flat', isIcon: true };
|
|
226
232
|
this.items = undefined;
|
|
227
233
|
this.displayChevron = undefined;
|
|
@@ -231,6 +237,9 @@ const MgActionMore = class {
|
|
|
231
237
|
if (newValue && !isMgActionMoreIcon(newValue)) {
|
|
232
238
|
throw new Error(`<${this.name}> prop icon must match MgActionMoreIconType.`);
|
|
233
239
|
}
|
|
240
|
+
else if (!Boolean(newValue === null || newValue === void 0 ? void 0 : newValue.icon) && Boolean(this.button.isIcon)) {
|
|
241
|
+
this.icon = { icon: 'ellipsis' };
|
|
242
|
+
}
|
|
234
243
|
}
|
|
235
244
|
validateButton(newValue) {
|
|
236
245
|
if (newValue && !isMgActionMoreButton(newValue)) {
|
|
@@ -274,7 +283,7 @@ const MgActionMore = class {
|
|
|
274
283
|
'mg-a11y-animation': true,
|
|
275
284
|
} }, index.h("mg-icon", { icon: "chevron-down", size: "small" })));
|
|
276
285
|
}
|
|
277
|
-
return (index.h(index.Host, { "data-mg-popover-guard": this.mgPopoverIdentifier }, index.h("span", { class: "mg-action-more" }, index.h("mg-popover", { identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, index.h("mg-button", { variant: this.button.variant, isIcon: this.button.isIcon, type: "button", label: buttonLabel, onClick: this.handleButton }, index.h("mg-icon", Object.assign({}, this.icon)), !this.button.isIcon && buttonContent), index.h("div", { slot: "content" }, index.h("mg-menu", { direction: mgMenu_conf.Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
|
|
286
|
+
return (index.h(index.Host, { "data-mg-popover-guard": this.mgPopoverIdentifier }, index.h("span", { class: "mg-action-more" }, index.h("mg-popover", { identifier: this.mgPopoverIdentifier, display: this.expanded, "onDisplay-change": this.handleDisplayChange }, index.h("mg-button", { variant: this.button.variant, isIcon: this.button.isIcon, type: "button", label: buttonLabel, onClick: this.handleButton }, this.icon && index.h("mg-icon", Object.assign({}, this.icon)), !this.button.isIcon && buttonContent), index.h("div", { slot: "content" }, index.h("mg-menu", { direction: mgMenu_conf.Direction.VERTICAL, label: this.messages.label }, this.items.map(item => {
|
|
278
287
|
var _a;
|
|
279
288
|
return (
|
|
280
289
|
// eslint-disable-next-line react/jsx-no-bind
|
|
@@ -792,7 +801,7 @@ const MgForm = class {
|
|
|
792
801
|
this.setRequiredMessage();
|
|
793
802
|
}
|
|
794
803
|
/**
|
|
795
|
-
*
|
|
804
|
+
* Display input error if it exists.
|
|
796
805
|
*/
|
|
797
806
|
async displayError() {
|
|
798
807
|
if (!this.readonly) {
|
|
@@ -1000,6 +1009,7 @@ const iconList = [
|
|
|
1000
1009
|
"list",
|
|
1001
1010
|
"loader",
|
|
1002
1011
|
"location",
|
|
1012
|
+
"location-outline",
|
|
1003
1013
|
"lock",
|
|
1004
1014
|
"log-in",
|
|
1005
1015
|
"log-out",
|
|
@@ -1008,10 +1018,13 @@ const iconList = [
|
|
|
1008
1018
|
"mail-outline",
|
|
1009
1019
|
"messages-square",
|
|
1010
1020
|
"messages-square-outline",
|
|
1021
|
+
"mobile",
|
|
1022
|
+
"mobile-outline",
|
|
1011
1023
|
"notes",
|
|
1012
1024
|
"notes-outline",
|
|
1013
1025
|
"paper-plane",
|
|
1014
1026
|
"paper-plane-slash",
|
|
1027
|
+
"paperclip",
|
|
1015
1028
|
"pen",
|
|
1016
1029
|
"pen-circle",
|
|
1017
1030
|
"pen-fancy",
|
|
@@ -1019,6 +1032,7 @@ const iconList = [
|
|
|
1019
1032
|
"pen-fancy-outline",
|
|
1020
1033
|
"pen-outline",
|
|
1021
1034
|
"phone",
|
|
1035
|
+
"phone-outline",
|
|
1022
1036
|
"picture",
|
|
1023
1037
|
"play-circle",
|
|
1024
1038
|
"plus",
|
|
@@ -1179,7 +1193,8 @@ const icons = {
|
|
|
1179
1193
|
'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>',
|
|
1180
1194
|
'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>',
|
|
1181
1195
|
'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>',
|
|
1182
|
-
'location': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="M8 .
|
|
1196
|
+
'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>',
|
|
1197
|
+
'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>',
|
|
1183
1198
|
'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>',
|
|
1184
1199
|
'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>',
|
|
1185
1200
|
'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>',
|
|
@@ -1188,17 +1203,21 @@ const icons = {
|
|
|
1188
1203
|
'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>',
|
|
1189
1204
|
'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>',
|
|
1190
1205
|
'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>',
|
|
1206
|
+
'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>',
|
|
1207
|
+
'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>',
|
|
1191
1208
|
'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>',
|
|
1192
1209
|
'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>',
|
|
1193
1210
|
'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>',
|
|
1194
1211
|
'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>',
|
|
1212
|
+
'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>',
|
|
1195
1213
|
'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>',
|
|
1196
1214
|
'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>',
|
|
1197
1215
|
'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>',
|
|
1198
1216
|
'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>',
|
|
1199
1217
|
'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>',
|
|
1200
1218
|
'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>',
|
|
1201
|
-
'phone': '<svg aria-hidden="true" viewBox="0 0 16 16"><path fill="currentColor" d="
|
|
1219
|
+
'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>',
|
|
1220
|
+
'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>',
|
|
1202
1221
|
'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>',
|
|
1203
1222
|
'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>',
|
|
1204
1223
|
'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>',
|
|
@@ -1577,6 +1596,7 @@ const MgInputCheckbox = class {
|
|
|
1577
1596
|
this.inputValid = index.createEvent(this, "input-valid", 7);
|
|
1578
1597
|
// hasDisplayedError (triggered by blur event)
|
|
1579
1598
|
this.hasDisplayedError = false;
|
|
1599
|
+
this.mode = 'custom';
|
|
1580
1600
|
// style
|
|
1581
1601
|
this.baseClassName = 'mg-input--checkbox';
|
|
1582
1602
|
// "multi" setup
|
|
@@ -1676,10 +1696,7 @@ const MgInputCheckbox = class {
|
|
|
1676
1696
|
* Check if input is valid
|
|
1677
1697
|
*/
|
|
1678
1698
|
this.checkValidity = () => {
|
|
1679
|
-
this.
|
|
1680
|
-
this.invalid = !this.valid;
|
|
1681
|
-
// We need to send valid event even if it is the same value
|
|
1682
|
-
this.inputValid.emit(this.valid);
|
|
1699
|
+
this.setValidity(this.readonly || this.disabled || (this.getInvalidElement() === undefined && this.validateRequired()));
|
|
1683
1700
|
};
|
|
1684
1701
|
/**
|
|
1685
1702
|
* Render button text
|
|
@@ -1697,12 +1714,17 @@ const MgInputCheckbox = class {
|
|
|
1697
1714
|
/**
|
|
1698
1715
|
* Set input error message
|
|
1699
1716
|
* @param displayError - dispay error condition
|
|
1717
|
+
* @param errorMessage - errorMessage override
|
|
1700
1718
|
*/
|
|
1701
|
-
this.setErrorMessage = (displayError = true) => {
|
|
1719
|
+
this.setErrorMessage = (displayError = true, errorMessage) => {
|
|
1702
1720
|
// Set error message
|
|
1703
1721
|
this.errorMessage = undefined;
|
|
1704
|
-
if (displayError && !this.valid
|
|
1705
|
-
|
|
1722
|
+
if (displayError && !this.valid) {
|
|
1723
|
+
if (errorMessage !== undefined)
|
|
1724
|
+
this.errorMessage = errorMessage;
|
|
1725
|
+
else if (!this.validateRequired())
|
|
1726
|
+
this.errorMessage = this.messages.errors.required;
|
|
1727
|
+
}
|
|
1706
1728
|
};
|
|
1707
1729
|
/**
|
|
1708
1730
|
* Method to get mg-popover identifier
|
|
@@ -1715,7 +1737,7 @@ const MgInputCheckbox = class {
|
|
|
1715
1737
|
*/
|
|
1716
1738
|
this.getDisplayItems = () => (this.searchValue.length > 0 ? this.searchResults : this.checkboxItems);
|
|
1717
1739
|
this.value = undefined;
|
|
1718
|
-
this.type =
|
|
1740
|
+
this.type = undefined;
|
|
1719
1741
|
this.identifier = undefined;
|
|
1720
1742
|
this.name = this.identifier;
|
|
1721
1743
|
this.label = undefined;
|
|
@@ -1756,9 +1778,13 @@ const MgInputCheckbox = class {
|
|
|
1756
1778
|
}
|
|
1757
1779
|
}
|
|
1758
1780
|
validateType(newValue) {
|
|
1759
|
-
if (!checkboxTypes.includes(newValue)) {
|
|
1781
|
+
if (newValue !== undefined && !checkboxTypes.includes(newValue)) {
|
|
1760
1782
|
throw new Error('<mg-input-checkbox> prop "type" must be a CheckboxType.');
|
|
1761
1783
|
}
|
|
1784
|
+
else if (newValue === undefined) {
|
|
1785
|
+
this.mode = 'auto';
|
|
1786
|
+
this.type = checkboxTypes[0];
|
|
1787
|
+
}
|
|
1762
1788
|
else {
|
|
1763
1789
|
const className = `${this.baseClassName}-multi`;
|
|
1764
1790
|
if (newValue === 'multi') {
|
|
@@ -1790,9 +1816,9 @@ const MgInputCheckbox = class {
|
|
|
1790
1816
|
this.classCollection.delete(className);
|
|
1791
1817
|
}
|
|
1792
1818
|
validateCheckboxItems(newValue) {
|
|
1793
|
-
if (newValue.length > this.multiStart)
|
|
1819
|
+
if (this.mode === 'auto' && newValue.length > this.multiStart)
|
|
1794
1820
|
this.type = 'multi';
|
|
1795
|
-
if (newValue.length > this.searchStart) {
|
|
1821
|
+
if (this.mode === 'auto' || (this.type === 'multi' && newValue.length > this.searchStart)) {
|
|
1796
1822
|
this.displaySearchInput = this.type === 'multi';
|
|
1797
1823
|
// refresh search values
|
|
1798
1824
|
this.updateSearchResults();
|
|
@@ -1803,13 +1829,44 @@ const MgInputCheckbox = class {
|
|
|
1803
1829
|
this.updateSearchResults();
|
|
1804
1830
|
}
|
|
1805
1831
|
/**
|
|
1806
|
-
*
|
|
1832
|
+
* Display input error if it exists.
|
|
1807
1833
|
*/
|
|
1808
1834
|
async displayError() {
|
|
1809
1835
|
this.checkValidity();
|
|
1810
1836
|
this.setErrorMessage();
|
|
1811
1837
|
this.hasDisplayedError = this.invalid;
|
|
1812
1838
|
}
|
|
1839
|
+
/**
|
|
1840
|
+
* Set an error and display a custom error message.
|
|
1841
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
1842
|
+
* It must be paired with an error message to display for the given context.
|
|
1843
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
1844
|
+
* @param valid - value indicating the validity
|
|
1845
|
+
* @param errorMessage - the error message to display
|
|
1846
|
+
*/
|
|
1847
|
+
async setError(valid, errorMessage) {
|
|
1848
|
+
if (typeof valid !== 'boolean') {
|
|
1849
|
+
throw new Error('<mg-input-checkbox> method "setError()" param "valid" must be a boolean');
|
|
1850
|
+
}
|
|
1851
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
1852
|
+
throw new Error('<mg-input-checkbox> method "setError()" param "errorMessage" must be a string');
|
|
1853
|
+
}
|
|
1854
|
+
else {
|
|
1855
|
+
this.setValidity(valid);
|
|
1856
|
+
this.setErrorMessage(undefined, valid ? undefined : errorMessage);
|
|
1857
|
+
this.hasDisplayedError = this.invalid;
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
/**
|
|
1861
|
+
* Method to set validity values
|
|
1862
|
+
* @param newValue - valid new value
|
|
1863
|
+
*/
|
|
1864
|
+
setValidity(newValue) {
|
|
1865
|
+
this.valid = newValue;
|
|
1866
|
+
this.invalid = !this.valid;
|
|
1867
|
+
// We need to send valid event even if it is the same value
|
|
1868
|
+
this.inputValid.emit(this.valid);
|
|
1869
|
+
}
|
|
1813
1870
|
/**
|
|
1814
1871
|
* Update ckecboxes item
|
|
1815
1872
|
* @param key - property to update
|
|
@@ -2066,10 +2123,7 @@ const MgInputDate = class {
|
|
|
2066
2123
|
*/
|
|
2067
2124
|
this.checkValidity = () => {
|
|
2068
2125
|
var _a;
|
|
2069
|
-
this.
|
|
2070
|
-
this.invalid = !this.valid;
|
|
2071
|
-
// We need to send valid event even if it is the same value
|
|
2072
|
-
this.inputValid.emit(this.valid);
|
|
2126
|
+
this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true));
|
|
2073
2127
|
};
|
|
2074
2128
|
/**
|
|
2075
2129
|
* get input error code
|
|
@@ -2098,15 +2152,19 @@ const MgInputDate = class {
|
|
|
2098
2152
|
};
|
|
2099
2153
|
/**
|
|
2100
2154
|
* Check input errors
|
|
2155
|
+
* @param errorMessage - errorMessage override
|
|
2101
2156
|
*/
|
|
2102
|
-
this.setErrorMessage = () => {
|
|
2157
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2103
2158
|
var _a;
|
|
2104
2159
|
// Set error message
|
|
2105
2160
|
this.errorMessage = undefined;
|
|
2106
2161
|
if (!this.valid) {
|
|
2107
2162
|
const inputError = this.getInputError();
|
|
2163
|
+
if (errorMessage !== undefined) {
|
|
2164
|
+
this.errorMessage = errorMessage;
|
|
2165
|
+
}
|
|
2108
2166
|
// required
|
|
2109
|
-
if (inputError === InputError$1.REQUIRED) {
|
|
2167
|
+
else if (inputError === InputError$1.REQUIRED) {
|
|
2110
2168
|
this.errorMessage = this.messages.errors[inputError];
|
|
2111
2169
|
}
|
|
2112
2170
|
// min, max & minMax
|
|
@@ -2165,13 +2223,44 @@ const MgInputDate = class {
|
|
|
2165
2223
|
}
|
|
2166
2224
|
}
|
|
2167
2225
|
/**
|
|
2168
|
-
*
|
|
2226
|
+
* Display input error if it exists.
|
|
2169
2227
|
*/
|
|
2170
2228
|
async displayError() {
|
|
2171
2229
|
this.checkValidity();
|
|
2172
2230
|
this.setErrorMessage();
|
|
2173
2231
|
this.hasDisplayedError = this.invalid;
|
|
2174
2232
|
}
|
|
2233
|
+
/**
|
|
2234
|
+
* Set an error and display a custom error message.
|
|
2235
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
2236
|
+
* It must be paired with an error message to display for the given context.
|
|
2237
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
2238
|
+
* @param valid - value indicating the validity
|
|
2239
|
+
* @param errorMessage - the error message to display
|
|
2240
|
+
*/
|
|
2241
|
+
async setError(valid, errorMessage) {
|
|
2242
|
+
if (typeof valid !== 'boolean') {
|
|
2243
|
+
throw new Error('<mg-input-date> method "setError()" param "valid" must be a boolean');
|
|
2244
|
+
}
|
|
2245
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
2246
|
+
throw new Error('<mg-input-date> method "setError()" param "errorMessage" must be a string');
|
|
2247
|
+
}
|
|
2248
|
+
else {
|
|
2249
|
+
this.setValidity(valid);
|
|
2250
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
2251
|
+
this.hasDisplayedError = this.invalid;
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
/**
|
|
2255
|
+
* Method to set validity values
|
|
2256
|
+
* @param newValue - valid new value
|
|
2257
|
+
*/
|
|
2258
|
+
setValidity(newValue) {
|
|
2259
|
+
this.valid = newValue;
|
|
2260
|
+
this.invalid = !this.valid;
|
|
2261
|
+
// We need to send valid event even if it is the same value
|
|
2262
|
+
this.inputValid.emit(this.valid);
|
|
2263
|
+
}
|
|
2175
2264
|
/*************
|
|
2176
2265
|
* Lifecycle *
|
|
2177
2266
|
*************/
|
|
@@ -2269,20 +2358,21 @@ const MgInputNumeric = class {
|
|
|
2269
2358
|
* Check if input is valid
|
|
2270
2359
|
*/
|
|
2271
2360
|
this.checkValidity = () => {
|
|
2272
|
-
this.
|
|
2273
|
-
this.invalid = !this.valid;
|
|
2274
|
-
// We need to send valid event even if it is the same value
|
|
2275
|
-
this.inputValid.emit(this.valid);
|
|
2361
|
+
this.setValidity(this.readonly || this.disabled || this.getInputError() === null);
|
|
2276
2362
|
};
|
|
2277
2363
|
/**
|
|
2278
2364
|
* Set input error message
|
|
2365
|
+
* @param errorMessage - errorMessage override
|
|
2279
2366
|
*/
|
|
2280
|
-
this.setErrorMessage = () => {
|
|
2367
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2281
2368
|
// Set error message
|
|
2282
2369
|
this.errorMessage = undefined;
|
|
2283
2370
|
if (!this.valid) {
|
|
2284
2371
|
const inputError = this.getInputError();
|
|
2285
|
-
if (
|
|
2372
|
+
if (errorMessage !== undefined) {
|
|
2373
|
+
this.errorMessage = errorMessage;
|
|
2374
|
+
}
|
|
2375
|
+
else if (inputError === InputError.REQUIRED) {
|
|
2286
2376
|
this.errorMessage = this.messages.errors[inputError];
|
|
2287
2377
|
}
|
|
2288
2378
|
else {
|
|
@@ -2376,36 +2466,6 @@ const MgInputNumeric = class {
|
|
|
2376
2466
|
this.updateValues(newValue);
|
|
2377
2467
|
}
|
|
2378
2468
|
}
|
|
2379
|
-
/**
|
|
2380
|
-
* Checks if the given value is valid according to the defined rules.
|
|
2381
|
-
* @param value - The input value to validate.
|
|
2382
|
-
* @param regex - The regular expression for validation.
|
|
2383
|
-
* @param integer - The integer part of the value.
|
|
2384
|
-
* @param decimal - The decimal part of the value.
|
|
2385
|
-
* @returns Returns true if the value is valid, otherwise false.
|
|
2386
|
-
*/
|
|
2387
|
-
isValidValue(value, regex, integer, decimal) {
|
|
2388
|
-
return ['', '-'].includes(value) || (value.match(regex) && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength));
|
|
2389
|
-
}
|
|
2390
|
-
/**
|
|
2391
|
-
* Handles invalid input values and returns a corrected value.
|
|
2392
|
-
* @returns The corrected value.
|
|
2393
|
-
*/
|
|
2394
|
-
handleInvalidValue() {
|
|
2395
|
-
return this.storedValue !== undefined ? this.storedValue : null;
|
|
2396
|
-
}
|
|
2397
|
-
/**
|
|
2398
|
-
* Updates the component values based on the validated input value.
|
|
2399
|
-
* @param newValue - The validated input value.
|
|
2400
|
-
*/
|
|
2401
|
-
updateValues(newValue) {
|
|
2402
|
-
this.value = newValue;
|
|
2403
|
-
if (this.input !== undefined)
|
|
2404
|
-
this.input.value = this.value;
|
|
2405
|
-
this.numericValue = !['', null].includes(this.value) ? parseFloat(this.value.replace(',', '.')) : null;
|
|
2406
|
-
this.valueChange.emit(this.numericValue);
|
|
2407
|
-
this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';
|
|
2408
|
-
}
|
|
2409
2469
|
handleValidityChange(newValue, _oldValue, prop) {
|
|
2410
2470
|
if (this.input !== undefined) {
|
|
2411
2471
|
this.input[prop] = newValue;
|
|
@@ -2432,13 +2492,74 @@ const MgInputNumeric = class {
|
|
|
2432
2492
|
}
|
|
2433
2493
|
}
|
|
2434
2494
|
/**
|
|
2435
|
-
*
|
|
2495
|
+
* Display input error if it exists.
|
|
2436
2496
|
*/
|
|
2437
2497
|
async displayError() {
|
|
2438
2498
|
this.checkValidity();
|
|
2439
2499
|
this.setErrorMessage();
|
|
2440
2500
|
this.hasDisplayedError = this.invalid;
|
|
2441
2501
|
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Set an error and display a custom error message.
|
|
2504
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
2505
|
+
* It must be paired with an error message to display for the given context.
|
|
2506
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
2507
|
+
* @param valid - value indicating the validity
|
|
2508
|
+
* @param errorMessage - the error message to display
|
|
2509
|
+
*/
|
|
2510
|
+
async setError(valid, errorMessage) {
|
|
2511
|
+
if (typeof valid !== 'boolean') {
|
|
2512
|
+
throw new Error('<mg-input-numeric> method "setError()" param "valid" must be a boolean');
|
|
2513
|
+
}
|
|
2514
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
2515
|
+
throw new Error('<mg-input-numeric> method "setError()" param "errorMessage" must be a string');
|
|
2516
|
+
}
|
|
2517
|
+
else {
|
|
2518
|
+
this.setValidity(valid);
|
|
2519
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
2520
|
+
this.hasDisplayedError = this.invalid;
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
/**
|
|
2524
|
+
* Method to set validity values
|
|
2525
|
+
* @param newValue - valid new value
|
|
2526
|
+
*/
|
|
2527
|
+
setValidity(newValue) {
|
|
2528
|
+
this.valid = newValue;
|
|
2529
|
+
this.invalid = !this.valid;
|
|
2530
|
+
// We need to send valid event even if it is the same value
|
|
2531
|
+
this.inputValid.emit(this.valid);
|
|
2532
|
+
}
|
|
2533
|
+
/**
|
|
2534
|
+
* Checks if the given value is valid according to the defined rules.
|
|
2535
|
+
* @param value - The input value to validate.
|
|
2536
|
+
* @param regex - The regular expression for validation.
|
|
2537
|
+
* @param integer - The integer part of the value.
|
|
2538
|
+
* @param decimal - The decimal part of the value.
|
|
2539
|
+
* @returns Returns true if the value is valid, otherwise false.
|
|
2540
|
+
*/
|
|
2541
|
+
isValidValue(value, regex, integer, decimal) {
|
|
2542
|
+
return ['', '-'].includes(value) || (value.match(regex) && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength));
|
|
2543
|
+
}
|
|
2544
|
+
/**
|
|
2545
|
+
* Handles invalid input values and returns a corrected value.
|
|
2546
|
+
* @returns The corrected value.
|
|
2547
|
+
*/
|
|
2548
|
+
handleInvalidValue() {
|
|
2549
|
+
return this.storedValue !== undefined ? this.storedValue : null;
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Updates the component values based on the validated input value.
|
|
2553
|
+
* @param newValue - The validated input value.
|
|
2554
|
+
*/
|
|
2555
|
+
updateValues(newValue) {
|
|
2556
|
+
this.value = newValue;
|
|
2557
|
+
if (this.input !== undefined)
|
|
2558
|
+
this.input.value = this.value;
|
|
2559
|
+
this.numericValue = !['', null].includes(this.value) ? parseFloat(this.value.replace(',', '.')) : null;
|
|
2560
|
+
this.valueChange.emit(this.numericValue);
|
|
2561
|
+
this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';
|
|
2562
|
+
}
|
|
2442
2563
|
/**
|
|
2443
2564
|
* Displayed value in input
|
|
2444
2565
|
* Change on focus/blur
|
|
@@ -2526,20 +2647,23 @@ const MgInputPassword = class {
|
|
|
2526
2647
|
*/
|
|
2527
2648
|
this.checkValidity = () => {
|
|
2528
2649
|
var _a;
|
|
2529
|
-
this.
|
|
2530
|
-
this.invalid = !this.valid;
|
|
2531
|
-
// We need to send valid event even if it is the same value
|
|
2532
|
-
this.inputValid.emit(this.valid);
|
|
2650
|
+
this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true));
|
|
2533
2651
|
};
|
|
2534
2652
|
/**
|
|
2535
2653
|
* Set input error message
|
|
2654
|
+
* @param errorMessage - errorMessage override
|
|
2536
2655
|
*/
|
|
2537
|
-
this.setErrorMessage = () => {
|
|
2656
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2538
2657
|
// Set error message
|
|
2539
2658
|
this.errorMessage = undefined;
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2659
|
+
if (!this.valid) {
|
|
2660
|
+
if (errorMessage !== undefined) {
|
|
2661
|
+
this.errorMessage = errorMessage;
|
|
2662
|
+
}
|
|
2663
|
+
// required
|
|
2664
|
+
else if (this.input.validity.valueMissing) {
|
|
2665
|
+
this.errorMessage = this.messages.errors.required;
|
|
2666
|
+
}
|
|
2543
2667
|
}
|
|
2544
2668
|
};
|
|
2545
2669
|
this.value = undefined;
|
|
@@ -2574,13 +2698,44 @@ const MgInputPassword = class {
|
|
|
2574
2698
|
}
|
|
2575
2699
|
}
|
|
2576
2700
|
/**
|
|
2577
|
-
*
|
|
2701
|
+
* Display input error if it exists.
|
|
2578
2702
|
*/
|
|
2579
2703
|
async displayError() {
|
|
2580
2704
|
this.checkValidity();
|
|
2581
2705
|
this.setErrorMessage();
|
|
2582
2706
|
this.hasDisplayedError = this.invalid;
|
|
2583
2707
|
}
|
|
2708
|
+
/**
|
|
2709
|
+
* Set an error and display a custom error message.
|
|
2710
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
2711
|
+
* It must be paired with an error message to display for the given context.
|
|
2712
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
2713
|
+
* @param valid - value indicating the validity
|
|
2714
|
+
* @param errorMessage - the error message to display
|
|
2715
|
+
*/
|
|
2716
|
+
async setError(valid, errorMessage) {
|
|
2717
|
+
if (typeof valid !== 'boolean') {
|
|
2718
|
+
throw new Error('<mg-input-password> method "setError()" param "valid" must be a boolean');
|
|
2719
|
+
}
|
|
2720
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
2721
|
+
throw new Error('<mg-input-password> method "setError()" param "errorMessage" must be a string');
|
|
2722
|
+
}
|
|
2723
|
+
else {
|
|
2724
|
+
this.setValidity(valid);
|
|
2725
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
2726
|
+
this.hasDisplayedError = this.invalid;
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
/**
|
|
2730
|
+
* Method to set validity values
|
|
2731
|
+
* @param newValue - valid new value
|
|
2732
|
+
*/
|
|
2733
|
+
setValidity(newValue) {
|
|
2734
|
+
this.valid = newValue;
|
|
2735
|
+
this.invalid = !this.valid;
|
|
2736
|
+
// We need to send valid event even if it is the same value
|
|
2737
|
+
this.inputValid.emit(this.valid);
|
|
2738
|
+
}
|
|
2584
2739
|
/*************
|
|
2585
2740
|
* Lifecycle *
|
|
2586
2741
|
*************/
|
|
@@ -2657,20 +2812,23 @@ const MgInputRadio = class {
|
|
|
2657
2812
|
* Check if input is valid
|
|
2658
2813
|
*/
|
|
2659
2814
|
this.checkValidity = () => {
|
|
2660
|
-
this.
|
|
2661
|
-
this.invalid = !this.valid;
|
|
2662
|
-
// We need to send valid event even if it is the same value
|
|
2663
|
-
this.inputValid.emit(this.valid);
|
|
2815
|
+
this.setValidity(this.readonly || this.disabled || this.getInvalidElement() === undefined);
|
|
2664
2816
|
};
|
|
2665
2817
|
/**
|
|
2666
2818
|
* Set input error message
|
|
2819
|
+
* @param errorMessage - errorMessage override
|
|
2667
2820
|
*/
|
|
2668
|
-
this.setErrorMessage = () => {
|
|
2821
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2669
2822
|
const invalidElement = this.getInvalidElement();
|
|
2670
2823
|
// Set error message
|
|
2671
2824
|
this.errorMessage = undefined;
|
|
2672
|
-
if (!this.valid
|
|
2673
|
-
|
|
2825
|
+
if (!this.valid) {
|
|
2826
|
+
if (errorMessage !== undefined) {
|
|
2827
|
+
this.errorMessage = errorMessage;
|
|
2828
|
+
}
|
|
2829
|
+
else if (invalidElement.validity.valueMissing) {
|
|
2830
|
+
this.errorMessage = this.messages.errors.required;
|
|
2831
|
+
}
|
|
2674
2832
|
}
|
|
2675
2833
|
};
|
|
2676
2834
|
/**
|
|
@@ -2728,13 +2886,44 @@ const MgInputRadio = class {
|
|
|
2728
2886
|
}
|
|
2729
2887
|
}
|
|
2730
2888
|
/**
|
|
2731
|
-
*
|
|
2889
|
+
* Display input error if it exists.
|
|
2732
2890
|
*/
|
|
2733
2891
|
async displayError() {
|
|
2734
2892
|
this.checkValidity();
|
|
2735
2893
|
this.setErrorMessage();
|
|
2736
2894
|
this.hasDisplayedError = this.invalid;
|
|
2737
2895
|
}
|
|
2896
|
+
/**
|
|
2897
|
+
* Set an error and display a custom error message.
|
|
2898
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
2899
|
+
* It must be paired with an error message to display for the given context.
|
|
2900
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
2901
|
+
* @param valid - value indicating the validity
|
|
2902
|
+
* @param errorMessage - the error message to display
|
|
2903
|
+
*/
|
|
2904
|
+
async setError(valid, errorMessage) {
|
|
2905
|
+
if (typeof valid !== 'boolean') {
|
|
2906
|
+
throw new Error('<mg-input-radio> method "setError()" param "valid" must be a boolean');
|
|
2907
|
+
}
|
|
2908
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
2909
|
+
throw new Error('<mg-input-radio> method "setError()" param "errorMessage" must be a string');
|
|
2910
|
+
}
|
|
2911
|
+
else {
|
|
2912
|
+
this.setValidity(valid);
|
|
2913
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
2914
|
+
this.hasDisplayedError = this.invalid;
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
/**
|
|
2918
|
+
* Method to set validity values
|
|
2919
|
+
* @param newValue - valid new value
|
|
2920
|
+
*/
|
|
2921
|
+
setValidity(newValue) {
|
|
2922
|
+
this.valid = newValue;
|
|
2923
|
+
this.invalid = !this.valid;
|
|
2924
|
+
// We need to send valid event even if it is the same value
|
|
2925
|
+
this.inputValid.emit(this.valid);
|
|
2926
|
+
}
|
|
2738
2927
|
/*************
|
|
2739
2928
|
* Lifecycle *
|
|
2740
2929
|
*************/
|
|
@@ -2883,19 +3072,22 @@ const MgInputSelect = class {
|
|
|
2883
3072
|
*/
|
|
2884
3073
|
this.checkValidity = () => {
|
|
2885
3074
|
var _a;
|
|
2886
|
-
this.
|
|
2887
|
-
this.invalid = !this.valid;
|
|
2888
|
-
// We need to send valid event even if it is the same value
|
|
2889
|
-
this.inputValid.emit(this.valid);
|
|
3075
|
+
this.setValidity(!this.isDisabledValue() && (this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true)));
|
|
2890
3076
|
};
|
|
2891
3077
|
/**
|
|
2892
3078
|
* Set input error message
|
|
3079
|
+
* @param errorMessage - errorMessage override
|
|
2893
3080
|
*/
|
|
2894
|
-
this.setErrorMessage = () => {
|
|
3081
|
+
this.setErrorMessage = (errorMessage) => {
|
|
2895
3082
|
// Set error message
|
|
2896
3083
|
this.errorMessage = undefined;
|
|
2897
|
-
if (!this.valid
|
|
2898
|
-
|
|
3084
|
+
if (!this.valid) {
|
|
3085
|
+
if (errorMessage !== undefined) {
|
|
3086
|
+
this.errorMessage = errorMessage;
|
|
3087
|
+
}
|
|
3088
|
+
else if (this.input.validity.valueMissing) {
|
|
3089
|
+
this.errorMessage = this.messages.errors.required;
|
|
3090
|
+
}
|
|
2899
3091
|
}
|
|
2900
3092
|
};
|
|
2901
3093
|
/**
|
|
@@ -2979,13 +3171,44 @@ const MgInputSelect = class {
|
|
|
2979
3171
|
}
|
|
2980
3172
|
}
|
|
2981
3173
|
/**
|
|
2982
|
-
*
|
|
3174
|
+
* Display input error if it exists.
|
|
2983
3175
|
*/
|
|
2984
3176
|
async displayError() {
|
|
2985
3177
|
this.checkValidity();
|
|
2986
3178
|
this.setErrorMessage();
|
|
2987
3179
|
this.hasDisplayedError = this.invalid;
|
|
2988
3180
|
}
|
|
3181
|
+
/**
|
|
3182
|
+
* Set an error and display a custom error message.
|
|
3183
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
3184
|
+
* It must be paired with an error message to display for the given context.
|
|
3185
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
3186
|
+
* @param valid - value indicating the validity
|
|
3187
|
+
* @param errorMessage - the error message to display
|
|
3188
|
+
*/
|
|
3189
|
+
async setError(valid, errorMessage) {
|
|
3190
|
+
if (typeof valid !== 'boolean') {
|
|
3191
|
+
throw new Error('<mg-input-select> method "setError()" param "valid" must be a boolean');
|
|
3192
|
+
}
|
|
3193
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
3194
|
+
throw new Error('<mg-input-select> method "setError()" param "errorMessage" must be a string');
|
|
3195
|
+
}
|
|
3196
|
+
else {
|
|
3197
|
+
this.setValidity(valid);
|
|
3198
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
3199
|
+
this.hasDisplayedError = this.invalid;
|
|
3200
|
+
}
|
|
3201
|
+
}
|
|
3202
|
+
/**
|
|
3203
|
+
* Method to set validity values
|
|
3204
|
+
* @param newValue - valid new value
|
|
3205
|
+
*/
|
|
3206
|
+
setValidity(newValue) {
|
|
3207
|
+
this.valid = newValue;
|
|
3208
|
+
this.invalid = !this.valid;
|
|
3209
|
+
// We need to send valid event even if it is the same value
|
|
3210
|
+
this.inputValid.emit(this.valid);
|
|
3211
|
+
}
|
|
2989
3212
|
/*************
|
|
2990
3213
|
* Lifecycle *
|
|
2991
3214
|
*************/
|
|
@@ -3080,19 +3303,21 @@ const MgInputText = class {
|
|
|
3080
3303
|
*/
|
|
3081
3304
|
this.checkValidity = () => {
|
|
3082
3305
|
var _a;
|
|
3083
|
-
this.
|
|
3084
|
-
this.invalid = !this.valid;
|
|
3085
|
-
// We need to send valid event even if it is the same value
|
|
3086
|
-
this.inputValid.emit(this.valid);
|
|
3306
|
+
this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined ? this.input.checkValidity() : true));
|
|
3087
3307
|
};
|
|
3088
3308
|
/**
|
|
3089
3309
|
* Set input error message
|
|
3310
|
+
* @param errorMessage - errorMessage override
|
|
3090
3311
|
*/
|
|
3091
|
-
this.setErrorMessage = () => {
|
|
3312
|
+
this.setErrorMessage = (errorMessage) => {
|
|
3092
3313
|
// Set error message
|
|
3093
3314
|
this.errorMessage = undefined;
|
|
3315
|
+
// Does have a custom error message
|
|
3316
|
+
if (!this.valid && errorMessage !== undefined) {
|
|
3317
|
+
this.errorMessage = errorMessage;
|
|
3318
|
+
}
|
|
3094
3319
|
// Does not match pattern
|
|
3095
|
-
if (!this.valid && this.input.validity.patternMismatch) {
|
|
3320
|
+
else if (!this.valid && this.input.validity.patternMismatch) {
|
|
3096
3321
|
this.errorMessage = this.patternErrorMessage;
|
|
3097
3322
|
}
|
|
3098
3323
|
// required
|
|
@@ -3100,17 +3325,6 @@ const MgInputText = class {
|
|
|
3100
3325
|
this.errorMessage = this.messages.errors.required;
|
|
3101
3326
|
}
|
|
3102
3327
|
};
|
|
3103
|
-
/**
|
|
3104
|
-
* Validate pattern configuration
|
|
3105
|
-
*/
|
|
3106
|
-
this.validatePattern = () => {
|
|
3107
|
-
if (this.pattern !== undefined &&
|
|
3108
|
-
typeof this.pattern === 'string' &&
|
|
3109
|
-
this.pattern !== '' &&
|
|
3110
|
-
(this.patternErrorMessage === undefined || typeof this.patternErrorMessage !== 'string' || this.patternErrorMessage === '')) {
|
|
3111
|
-
throw new Error('<mg-input-text> prop "pattern" must be paired with the prop "patternErrorMessage"');
|
|
3112
|
-
}
|
|
3113
|
-
};
|
|
3114
3328
|
/**
|
|
3115
3329
|
* Validate append slot
|
|
3116
3330
|
*/
|
|
@@ -3169,6 +3383,11 @@ const MgInputText = class {
|
|
|
3169
3383
|
}
|
|
3170
3384
|
}
|
|
3171
3385
|
}
|
|
3386
|
+
validatePattern(newValue) {
|
|
3387
|
+
if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {
|
|
3388
|
+
throw new Error('<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
|
|
3389
|
+
}
|
|
3390
|
+
}
|
|
3172
3391
|
/**
|
|
3173
3392
|
* Public method to play input focus
|
|
3174
3393
|
*/
|
|
@@ -3176,13 +3395,44 @@ const MgInputText = class {
|
|
|
3176
3395
|
this.input.focus();
|
|
3177
3396
|
}
|
|
3178
3397
|
/**
|
|
3179
|
-
*
|
|
3398
|
+
* Display input error if it exists.
|
|
3180
3399
|
*/
|
|
3181
3400
|
async displayError() {
|
|
3182
3401
|
this.checkValidity();
|
|
3183
3402
|
this.setErrorMessage();
|
|
3184
3403
|
this.hasDisplayedError = this.invalid;
|
|
3185
3404
|
}
|
|
3405
|
+
/**
|
|
3406
|
+
* Set an error and display a custom error message.
|
|
3407
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
3408
|
+
* It must be paired with an error message to display for the given context.
|
|
3409
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
3410
|
+
* @param valid - value indicating the validity
|
|
3411
|
+
* @param errorMessage - the error message to display
|
|
3412
|
+
*/
|
|
3413
|
+
async setError(valid, errorMessage) {
|
|
3414
|
+
if (typeof valid !== 'boolean') {
|
|
3415
|
+
throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean');
|
|
3416
|
+
}
|
|
3417
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
3418
|
+
throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string');
|
|
3419
|
+
}
|
|
3420
|
+
else {
|
|
3421
|
+
this.setValidity(valid);
|
|
3422
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
3423
|
+
this.hasDisplayedError = this.invalid;
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
/**
|
|
3427
|
+
* Method to set validity values
|
|
3428
|
+
* @param newValue - valid new value
|
|
3429
|
+
*/
|
|
3430
|
+
setValidity(newValue) {
|
|
3431
|
+
this.valid = newValue;
|
|
3432
|
+
this.invalid = !this.valid;
|
|
3433
|
+
// We need to send valid event even if it is the same value
|
|
3434
|
+
this.inputValid.emit(this.valid);
|
|
3435
|
+
}
|
|
3186
3436
|
/*************
|
|
3187
3437
|
* Lifecycle *
|
|
3188
3438
|
*************/
|
|
@@ -3196,7 +3446,8 @@ const MgInputText = class {
|
|
|
3196
3446
|
this.characterLeftId = `${this.identifier}-character-left`;
|
|
3197
3447
|
// Validate
|
|
3198
3448
|
this.validateIcon(this.icon);
|
|
3199
|
-
this.validatePattern();
|
|
3449
|
+
this.validatePattern(this.pattern);
|
|
3450
|
+
this.validatePattern(this.patternErrorMessage);
|
|
3200
3451
|
this.validateAppendSlot();
|
|
3201
3452
|
// Check validity when component is ready
|
|
3202
3453
|
// return a promise to process action only in the FIRST render().
|
|
@@ -3225,7 +3476,9 @@ const MgInputText = class {
|
|
|
3225
3476
|
"icon": ["validateIcon"],
|
|
3226
3477
|
"required": ["handleValidityChange"],
|
|
3227
3478
|
"readonly": ["handleValidityChange"],
|
|
3228
|
-
"disabled": ["handleValidityChange"]
|
|
3479
|
+
"disabled": ["handleValidityChange"],
|
|
3480
|
+
"pattern": ["validatePattern"],
|
|
3481
|
+
"patternErrorMessage": ["validatePattern"]
|
|
3229
3482
|
}; }
|
|
3230
3483
|
};
|
|
3231
3484
|
MgInputText.style = mgInputTextCss;
|
|
@@ -3283,35 +3536,27 @@ const MgInputTextarea = class {
|
|
|
3283
3536
|
*/
|
|
3284
3537
|
this.checkValidity = () => {
|
|
3285
3538
|
var _a;
|
|
3286
|
-
this.
|
|
3287
|
-
this.invalid = !this.valid;
|
|
3288
|
-
// We need to send valid event even if it is the same value
|
|
3289
|
-
this.inputValid.emit(this.valid);
|
|
3539
|
+
this.setValidity(this.readonly || this.disabled || (((_a = this.input) === null || _a === void 0 ? void 0 : _a.checkValidity) !== undefined && this.input.checkValidity() && this.getPatternValidity()));
|
|
3290
3540
|
};
|
|
3291
3541
|
/**
|
|
3292
3542
|
* Set input error message
|
|
3543
|
+
* @param errorMessage - errorMessage override
|
|
3293
3544
|
*/
|
|
3294
|
-
this.setErrorMessage = () => {
|
|
3545
|
+
this.setErrorMessage = (errorMessage) => {
|
|
3295
3546
|
// Set error message
|
|
3296
3547
|
this.errorMessage = undefined;
|
|
3297
3548
|
// Does not match pattern
|
|
3298
|
-
if (!this.valid
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
this.validatePattern = () => {
|
|
3310
|
-
if (this.pattern !== undefined &&
|
|
3311
|
-
typeof this.pattern === 'string' &&
|
|
3312
|
-
this.pattern !== '' &&
|
|
3313
|
-
(this.patternErrorMessage === undefined || typeof this.patternErrorMessage !== 'string' || this.patternErrorMessage === '')) {
|
|
3314
|
-
throw new Error('<mg-input-textarea> prop "pattern" must be paired with the prop "patternErrorMessage"');
|
|
3549
|
+
if (!this.valid) {
|
|
3550
|
+
if (errorMessage !== undefined) {
|
|
3551
|
+
this.errorMessage = errorMessage;
|
|
3552
|
+
}
|
|
3553
|
+
else if (!this.getPatternValidity()) {
|
|
3554
|
+
this.errorMessage = this.patternErrorMessage;
|
|
3555
|
+
}
|
|
3556
|
+
// required
|
|
3557
|
+
else if (this.input.validity.valueMissing) {
|
|
3558
|
+
this.errorMessage = this.messages.errors.required;
|
|
3559
|
+
}
|
|
3315
3560
|
}
|
|
3316
3561
|
};
|
|
3317
3562
|
this.value = undefined;
|
|
@@ -3352,6 +3597,11 @@ const MgInputTextarea = class {
|
|
|
3352
3597
|
}
|
|
3353
3598
|
}
|
|
3354
3599
|
}
|
|
3600
|
+
validatePattern(newValue) {
|
|
3601
|
+
if (newValue !== undefined && !(isValidString(this.pattern) && isValidString(this.patternErrorMessage))) {
|
|
3602
|
+
throw new Error('<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3355
3605
|
validateDisplayCharacterLeft(newValue) {
|
|
3356
3606
|
if (newValue) {
|
|
3357
3607
|
this.classCollection.add(this.classHasDisplayCharacterLeft);
|
|
@@ -3361,13 +3611,44 @@ const MgInputTextarea = class {
|
|
|
3361
3611
|
}
|
|
3362
3612
|
}
|
|
3363
3613
|
/**
|
|
3364
|
-
*
|
|
3614
|
+
* Display input error if it exists.
|
|
3365
3615
|
*/
|
|
3366
3616
|
async displayError() {
|
|
3367
3617
|
this.checkValidity();
|
|
3368
3618
|
this.setErrorMessage();
|
|
3369
3619
|
this.hasDisplayedError = this.invalid;
|
|
3370
3620
|
}
|
|
3621
|
+
/**
|
|
3622
|
+
* Set an error and display a custom error message.
|
|
3623
|
+
* This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
|
|
3624
|
+
* It must be paired with an error message to display for the given context.
|
|
3625
|
+
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
3626
|
+
* @param valid - value indicating the validity
|
|
3627
|
+
* @param errorMessage - the error message to display
|
|
3628
|
+
*/
|
|
3629
|
+
async setError(valid, errorMessage) {
|
|
3630
|
+
if (typeof valid !== 'boolean') {
|
|
3631
|
+
throw new Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean');
|
|
3632
|
+
}
|
|
3633
|
+
else if (typeof errorMessage !== 'string' || errorMessage.trim() === '') {
|
|
3634
|
+
throw new Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string');
|
|
3635
|
+
}
|
|
3636
|
+
else {
|
|
3637
|
+
this.setValidity(valid);
|
|
3638
|
+
this.setErrorMessage(valid ? undefined : errorMessage);
|
|
3639
|
+
this.hasDisplayedError = this.invalid;
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
/**
|
|
3643
|
+
* Method to set validity values
|
|
3644
|
+
* @param newValue - valid new value
|
|
3645
|
+
*/
|
|
3646
|
+
setValidity(newValue) {
|
|
3647
|
+
this.valid = newValue;
|
|
3648
|
+
this.invalid = !this.valid;
|
|
3649
|
+
// We need to send valid event even if it is the same value
|
|
3650
|
+
this.inputValid.emit(this.valid);
|
|
3651
|
+
}
|
|
3371
3652
|
/*************
|
|
3372
3653
|
* Lifecycle *
|
|
3373
3654
|
*************/
|
|
@@ -3381,7 +3662,8 @@ const MgInputTextarea = class {
|
|
|
3381
3662
|
this.characterLeftId = `${this.identifier}-character-left`;
|
|
3382
3663
|
// Validate
|
|
3383
3664
|
this.validateDisplayCharacterLeft(this.displayCharacterLeft);
|
|
3384
|
-
this.validatePattern();
|
|
3665
|
+
this.validatePattern(this.pattern);
|
|
3666
|
+
this.validatePattern(this.patternErrorMessage);
|
|
3385
3667
|
// Check validity when component is ready
|
|
3386
3668
|
// return a promise to process action only in the FIRST render().
|
|
3387
3669
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
@@ -3410,6 +3692,8 @@ const MgInputTextarea = class {
|
|
|
3410
3692
|
"required": ["handleValidityChange"],
|
|
3411
3693
|
"readonly": ["handleValidityChange"],
|
|
3412
3694
|
"disabled": ["handleValidityChange"],
|
|
3695
|
+
"pattern": ["validatePattern"],
|
|
3696
|
+
"patternErrorMessage": ["validatePattern"],
|
|
3413
3697
|
"displayCharacterLeft": ["validateDisplayCharacterLeft"]
|
|
3414
3698
|
}; }
|
|
3415
3699
|
};
|
|
@@ -4686,11 +4970,9 @@ const MgPanel = class {
|
|
|
4686
4970
|
throw new Error('<mg-panel> prop "panelTitle" is required.');
|
|
4687
4971
|
this.titleChange.emit(newValue);
|
|
4688
4972
|
}
|
|
4689
|
-
|
|
4973
|
+
validateTitlePattern(newValue) {
|
|
4690
4974
|
if (newValue !== undefined && !this.titleEditable)
|
|
4691
|
-
throw new Error(
|
|
4692
|
-
if (newValue !== undefined && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === ''))
|
|
4693
|
-
throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
|
|
4975
|
+
throw new Error(`<mg-panel> prop "titleEditable" must be set to "true".`);
|
|
4694
4976
|
}
|
|
4695
4977
|
validateTitlePosition(newValue) {
|
|
4696
4978
|
if (!titlePositions.includes(newValue))
|
|
@@ -4715,7 +4997,8 @@ const MgPanel = class {
|
|
|
4715
4997
|
// Get locales
|
|
4716
4998
|
this.messages = mgMenu_conf.initLocales(this.element).messages;
|
|
4717
4999
|
// Validate
|
|
4718
|
-
this.
|
|
5000
|
+
this.validateTitlePattern(this.titlePattern);
|
|
5001
|
+
this.validateTitlePattern(this.titlePatternErrorMessage);
|
|
4719
5002
|
this.validatePanelTitle(this.panelTitle);
|
|
4720
5003
|
this.validateExpandToggleDisplay(this.expandToggleDisplay);
|
|
4721
5004
|
this.validateTitlePosition(this.titlePosition);
|
|
@@ -4739,7 +5022,8 @@ const MgPanel = class {
|
|
|
4739
5022
|
get element() { return index.getElement(this); }
|
|
4740
5023
|
static get watchers() { return {
|
|
4741
5024
|
"panelTitle": ["validatePanelTitle"],
|
|
4742
|
-
"titlePattern": ["
|
|
5025
|
+
"titlePattern": ["validateTitlePattern"],
|
|
5026
|
+
"titlePatternErrorMessage": ["validateTitlePattern"],
|
|
4743
5027
|
"titlePosition": ["validateTitlePosition"],
|
|
4744
5028
|
"expanded": ["handleExpanded"],
|
|
4745
5029
|
"expandToggleDisplay": ["validateExpandToggleDisplay"]
|
|
@@ -6599,21 +6883,27 @@ const MgPopover = class {
|
|
|
6599
6883
|
* Render popover content element
|
|
6600
6884
|
*/
|
|
6601
6885
|
this.renderPopoverContent = () => {
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6886
|
+
const mgPopoverContent = this.element.querySelector('mg-popover-content');
|
|
6887
|
+
if (mgPopoverContent === null) {
|
|
6888
|
+
this.mgPopoverContent = document.createElement('mg-popover-content');
|
|
6889
|
+
this.mgPopoverContent.setAttribute('slot', 'content');
|
|
6890
|
+
this.mgPopoverContent.setAttribute('id', this.identifier);
|
|
6891
|
+
this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);
|
|
6892
|
+
const arrow = document.createElement('div');
|
|
6893
|
+
arrow.setAttribute('slot', 'arrow');
|
|
6894
|
+
arrow.dataset.popperArrow = '';
|
|
6895
|
+
this.mgPopoverContent.appendChild(arrow);
|
|
6896
|
+
// insert elements in DOM
|
|
6897
|
+
['[slot="title"]', '[slot="content"]:not(mg-popover-content)'].forEach(slotType => {
|
|
6898
|
+
Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {
|
|
6899
|
+
this.mgPopoverContent.appendChild(slot);
|
|
6900
|
+
});
|
|
6614
6901
|
});
|
|
6615
|
-
|
|
6616
|
-
|
|
6902
|
+
this.element.appendChild(this.mgPopoverContent);
|
|
6903
|
+
}
|
|
6904
|
+
else {
|
|
6905
|
+
mgPopoverContent.setAttribute('id', this.identifier);
|
|
6906
|
+
}
|
|
6617
6907
|
};
|
|
6618
6908
|
this.identifier = createID('mg-popover');
|
|
6619
6909
|
this.placement = 'bottom';
|
|
@@ -6622,6 +6912,10 @@ const MgPopover = class {
|
|
|
6622
6912
|
this.display = false;
|
|
6623
6913
|
this.disabled = false;
|
|
6624
6914
|
}
|
|
6915
|
+
validateIdentifier() {
|
|
6916
|
+
// use renderPopoverContent to update popover-content id
|
|
6917
|
+
this.renderPopoverContent();
|
|
6918
|
+
}
|
|
6625
6919
|
validateArrowHide(newValue) {
|
|
6626
6920
|
if (newValue)
|
|
6627
6921
|
this.mgPopoverContent.dataset.arrowHide = '';
|
|
@@ -6658,6 +6952,7 @@ const MgPopover = class {
|
|
|
6658
6952
|
// render mg-popover-content slot
|
|
6659
6953
|
this.renderPopoverContent();
|
|
6660
6954
|
this.validateCloseButton(this.closeButton);
|
|
6955
|
+
this.validateIdentifier();
|
|
6661
6956
|
this.validateArrowHide(this.arrowHide);
|
|
6662
6957
|
}
|
|
6663
6958
|
/**
|
|
@@ -6682,6 +6977,12 @@ const MgPopover = class {
|
|
|
6682
6977
|
offset: [0, 0],
|
|
6683
6978
|
},
|
|
6684
6979
|
},
|
|
6980
|
+
{
|
|
6981
|
+
name: 'flip',
|
|
6982
|
+
options: {
|
|
6983
|
+
fallbackPlacements: ['auto'],
|
|
6984
|
+
},
|
|
6985
|
+
},
|
|
6685
6986
|
],
|
|
6686
6987
|
});
|
|
6687
6988
|
// add resize observer
|
|
@@ -6711,6 +7012,7 @@ const MgPopover = class {
|
|
|
6711
7012
|
}
|
|
6712
7013
|
get element() { return index.getElement(this); }
|
|
6713
7014
|
static get watchers() { return {
|
|
7015
|
+
"identifier": ["validateIdentifier"],
|
|
6714
7016
|
"arrowHide": ["validateArrowHide"],
|
|
6715
7017
|
"closeButton": ["validateCloseButton"],
|
|
6716
7018
|
"display": ["handleDisplay"]
|
|
@@ -7293,6 +7595,12 @@ const MgTooltip = class {
|
|
|
7293
7595
|
offset: [0, 8],
|
|
7294
7596
|
},
|
|
7295
7597
|
},
|
|
7598
|
+
{
|
|
7599
|
+
name: 'flip',
|
|
7600
|
+
options: {
|
|
7601
|
+
fallbackPlacements: ['auto'],
|
|
7602
|
+
},
|
|
7603
|
+
},
|
|
7296
7604
|
],
|
|
7297
7605
|
});
|
|
7298
7606
|
// Manage tooltipedElement focus/blur events
|
|
@@ -7330,6 +7638,10 @@ const MgTooltip = class {
|
|
|
7330
7638
|
this.display = false;
|
|
7331
7639
|
this.disabled = false;
|
|
7332
7640
|
}
|
|
7641
|
+
validateIdentifier() {
|
|
7642
|
+
// use renderTooltipContent to update tooltip-content id
|
|
7643
|
+
this.renderTooltipContent();
|
|
7644
|
+
}
|
|
7333
7645
|
validateMessage(newValue) {
|
|
7334
7646
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
7335
7647
|
throw new Error('<mg-tooltip> prop "message" is required.');
|
|
@@ -7355,16 +7667,22 @@ const MgTooltip = class {
|
|
|
7355
7667
|
/**
|
|
7356
7668
|
* Render tooltip content element
|
|
7357
7669
|
*/
|
|
7358
|
-
|
|
7359
|
-
const mgTooltipContent =
|
|
7360
|
-
mgTooltipContent
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7670
|
+
renderTooltipContent() {
|
|
7671
|
+
const mgTooltipContent = this.element.querySelector('mg-tooltip-content');
|
|
7672
|
+
if (mgTooltipContent === null) {
|
|
7673
|
+
const mgTooltipContent = document.createElement('mg-tooltip-content');
|
|
7674
|
+
mgTooltipContent.setAttribute('slot', 'content');
|
|
7675
|
+
mgTooltipContent.setAttribute('id', this.identifier);
|
|
7676
|
+
const arrow = document.createElement('div');
|
|
7677
|
+
arrow.setAttribute('slot', 'arrow');
|
|
7678
|
+
arrow.dataset.popperArrow = '';
|
|
7679
|
+
mgTooltipContent.appendChild(arrow);
|
|
7680
|
+
// append tooltip element to component
|
|
7681
|
+
this.element.appendChild(mgTooltipContent);
|
|
7682
|
+
}
|
|
7683
|
+
else {
|
|
7684
|
+
mgTooltipContent.setAttribute('id', this.identifier);
|
|
7685
|
+
}
|
|
7368
7686
|
}
|
|
7369
7687
|
/*************
|
|
7370
7688
|
* Lifecycle *
|
|
@@ -7376,11 +7694,12 @@ const MgTooltip = class {
|
|
|
7376
7694
|
// Get windows to attach events
|
|
7377
7695
|
this.windows = getWindows(window);
|
|
7378
7696
|
// Get tooltip element
|
|
7379
|
-
this.
|
|
7697
|
+
this.renderTooltipContent();
|
|
7380
7698
|
this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);
|
|
7381
7699
|
//validate properties
|
|
7382
7700
|
this.validateDisabled(this.disabled);
|
|
7383
7701
|
this.validateMessage(this.message);
|
|
7702
|
+
this.validateIdentifier();
|
|
7384
7703
|
}
|
|
7385
7704
|
/**
|
|
7386
7705
|
* Get slotted element
|
|
@@ -7428,6 +7747,7 @@ const MgTooltip = class {
|
|
|
7428
7747
|
}
|
|
7429
7748
|
get element() { return index.getElement(this); }
|
|
7430
7749
|
static get watchers() { return {
|
|
7750
|
+
"identifier": ["validateIdentifier"],
|
|
7431
7751
|
"message": ["validateMessage"],
|
|
7432
7752
|
"display": ["handleDisplay"],
|
|
7433
7753
|
"disabled": ["validateDisabled"]
|
|
@@ -7489,3 +7809,5 @@ exports.mg_tabs = MgTabs;
|
|
|
7489
7809
|
exports.mg_tag = MgTag;
|
|
7490
7810
|
exports.mg_tooltip = MgTooltip;
|
|
7491
7811
|
exports.mg_tooltip_content = MgTooltipContent;
|
|
7812
|
+
|
|
7813
|
+
//# sourceMappingURL=mg-action-more_34.cjs.entry.js.map
|