@mgdis/mg-components 5.18.0 → 5.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{mg-menu.conf-43aacf30.js → components.utils-dc9c8a53.js} +160 -7
- package/dist/cjs/components.utils-dc9c8a53.js.map +1 -0
- package/dist/cjs/index-c042e24b.js +18 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_34.cjs.entry.js +381 -465
- package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +7 -6
- package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +10 -10
- package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js +5 -5
- package/dist/collection/components/atoms/mg-badge/test/mg-badge.spec.js.map +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +13 -12
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js +4 -4
- package/dist/collection/components/atoms/mg-button/test/mg-button.e2e.js.map +1 -1
- package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js +3 -3
- package/dist/collection/components/atoms/mg-button/test/mg-button.spec.js.map +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.js +13 -13
- package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +3 -3
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +4 -4
- package/dist/collection/components/atoms/mg-divider/mg-divider.js.map +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +15 -17
- package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js +4 -4
- package/dist/collection/components/atoms/mg-icon/test/mg-icon.spec.js.map +1 -1
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +24 -5
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js +12 -0
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.js.map +1 -0
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js +1 -5
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.spec.js.map +1 -1
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +9 -9
- package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js +23 -0
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.playwright.js.map +1 -0
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js +5 -5
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.spec.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +2 -2
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +7 -7
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +1 -1
- package/dist/collection/components/molecules/inputs/MgInput.js +14 -13
- package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +7 -4
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +20 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +25 -27
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js +21 -27
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.e2e.playwright.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +9 -7
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +6 -6
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +11 -10
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +6 -6
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +6 -6
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.e2e.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +8 -8
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js +6 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +52 -14
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js +147 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +12 -2
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +12 -12
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +86 -10
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js +108 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js +46 -2
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.spec.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +3 -3
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/test/{mg-menu.e2e.js → mg-menu.e2e.playwright.js} +67 -96
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +8 -9
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js +100 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js.map +1 -1
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +7 -7
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +5 -4
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js +1 -1
- package/dist/collection/components/molecules/mg-details/test/mg-details.spec.js.map +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +6 -5
- package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
- package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js +4 -4
- package/dist/collection/components/molecules/mg-form/test/mg-form.spec.js.map +1 -1
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +7 -7
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +5 -4
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +8 -8
- package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
- package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js +11 -11
- package/dist/collection/components/molecules/mg-message/test/mg-message.spec.js.map +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -8
- package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js +7 -7
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.e2e.playwright.js.map +1 -1
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js +3 -3
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.firefox.e2e.playwright.js.map +1 -1
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js +1 -1
- package/dist/collection/components/molecules/mg-modal/test/mg-modal.spec.js.map +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +3 -3
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +9 -9
- package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +2 -2
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +1 -1
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +8 -8
- package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +4 -4
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/test/{mg-popover.e2e.js → mg-popover.e2e.playwright.js} +46 -65
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.playwright.js.map +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +5 -6
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +34 -34
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js +13 -13
- package/dist/collection/components/molecules/mg-tabs/test/mg-tabs.spec.js.map +1 -1
- package/dist/collection/locales/en/messages.json +3 -3
- package/dist/collection/locales/fr/messages.json +3 -3
- package/dist/collection/utils/behaviors.utils.js +2 -1
- package/dist/collection/utils/behaviors.utils.js.map +1 -1
- package/dist/collection/utils/components.utils.js +10 -0
- package/dist/collection/utils/components.utils.js.map +1 -1
- package/dist/collection/utils/components.utils.spec.js +14 -1
- package/dist/collection/utils/components.utils.spec.js.map +1 -1
- package/dist/collection/utils/playwright.e2e.test.utils.js +3 -3
- package/dist/collection/utils/playwright.e2e.test.utils.js.map +1 -1
- package/dist/collection/utils/unit.test.utils.js +0 -3
- package/dist/collection/utils/unit.test.utils.js.map +1 -1
- package/dist/collection/variables.css +1 -275
- package/dist/components/MgInput.js +19 -18
- package/dist/components/MgInput.js.map +1 -1
- package/dist/components/components.utils.js +11 -1
- package/dist/components/components.utils.js.map +1 -1
- package/dist/components/index2.js +6 -6
- package/dist/components/mg-action-more.js +6 -6
- package/dist/components/mg-action-more.js.map +1 -1
- package/dist/components/mg-badge2.js +9 -9
- package/dist/components/mg-badge2.js.map +1 -1
- package/dist/components/mg-button2.js +12 -11
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-card2.js +12 -12
- package/dist/components/mg-card2.js.map +1 -1
- package/dist/components/mg-character-left2.js +1 -1
- package/dist/components/mg-character-left2.js.map +1 -1
- package/dist/components/mg-details.js +4 -3
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-divider.js +3 -3
- package/dist/components/mg-divider.js.map +1 -1
- package/dist/components/mg-form.js +5 -4
- package/dist/components/mg-form.js.map +1 -1
- package/dist/components/mg-icon2.js +14 -16
- package/dist/components/mg-icon2.js.map +1 -1
- package/dist/components/mg-illustrated-message.js +7 -7
- package/dist/components/mg-illustrated-message.js.map +1 -1
- package/dist/components/mg-input-checkbox-paginated2.js +13 -8
- package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
- package/dist/components/mg-input-checkbox.js +24 -26
- package/dist/components/mg-input-checkbox.js.map +1 -1
- package/dist/components/mg-input-date.js +5 -5
- package/dist/components/mg-input-date.js.map +1 -1
- package/dist/components/mg-input-numeric.js +10 -9
- package/dist/components/mg-input-numeric.js.map +1 -1
- package/dist/components/mg-input-password.js +5 -5
- package/dist/components/mg-input-password.js.map +1 -1
- package/dist/components/mg-input-radio.js +5 -5
- package/dist/components/mg-input-radio.js.map +1 -1
- package/dist/components/mg-input-select2.js +7 -7
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text2.js +29 -12
- package/dist/components/mg-input-text2.js.map +1 -1
- package/dist/components/mg-input-textarea.js +12 -12
- package/dist/components/mg-input-textarea.js.map +1 -1
- package/dist/components/mg-input-title2.js +7 -4
- package/dist/components/mg-input-title2.js.map +1 -1
- package/dist/components/mg-input-toggle.js +48 -10
- package/dist/components/mg-input-toggle.js.map +1 -1
- package/dist/components/mg-item-more.js +6 -4
- package/dist/components/mg-item-more.js.map +1 -1
- package/dist/components/mg-menu-item2.js +7 -8
- package/dist/components/mg-menu-item2.js.map +1 -1
- package/dist/components/mg-menu2.js +2 -2
- package/dist/components/mg-menu2.js.map +1 -1
- package/dist/components/mg-message.js +7 -7
- package/dist/components/mg-message.js.map +1 -1
- package/dist/components/mg-modal.js +7 -7
- package/dist/components/mg-modal.js.map +1 -1
- package/dist/components/mg-pagination2.js +2 -2
- package/dist/components/mg-pagination2.js.map +1 -1
- package/dist/components/mg-panel.js +8 -8
- package/dist/components/mg-panel.js.map +1 -1
- package/dist/components/mg-popover-content2.js +4 -4
- package/dist/components/mg-popover-content2.js.map +1 -1
- package/dist/components/mg-popover2.js.map +1 -1
- package/dist/components/mg-skip-links.js +4 -5
- package/dist/components/mg-skip-links.js.map +1 -1
- package/dist/components/mg-tabs.js +33 -33
- package/dist/components/mg-tabs.js.map +1 -1
- package/dist/components/mg-tag.js +8 -8
- package/dist/components/mg-tag.js.map +1 -1
- package/dist/components/mg-tooltip-content2.js +1 -1
- package/dist/components/mg-tooltip-content2.js.map +1 -1
- package/dist/components/mg-tooltip2.js +5 -5
- package/dist/components/mg-tooltip2.js.map +1 -1
- package/dist/esm/{mg-menu.conf-012fc9b4.js → components.utils-0f76010d.js} +153 -8
- package/dist/esm/components.utils-0f76010d.js.map +1 -0
- package/dist/esm/index-ce01e63b.js +18 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_34.entry.js +315 -399
- package/dist/esm/mg-action-more_34.entry.js.map +1 -1
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-item-more.entry.js +6 -5
- package/dist/esm/mg-item-more.entry.js.map +1 -1
- package/dist/mg-components/locales/en/messages.json +3 -3
- package/dist/mg-components/locales/fr/messages.json +3 -3
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-components.esm.js.map +1 -1
- package/dist/mg-components/p-01ebc95a.entry.js +2 -0
- package/dist/mg-components/p-01ebc95a.entry.js.map +1 -0
- package/dist/mg-components/p-71a5a848.entry.js +2 -0
- package/dist/mg-components/p-71a5a848.entry.js.map +1 -0
- package/dist/mg-components/p-c9e2c669.js +2 -0
- package/dist/mg-components/p-c9e2c669.js.map +1 -0
- package/dist/mg-components/variables.css +1 -275
- package/dist/types/components/atoms/mg-card/mg-card.d.ts +1 -1
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +5 -1
- package/dist/types/components/atoms/mg-tag/test/mg-tag.e2e.playwright.d.ts +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +5 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +5 -8
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +9 -0
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +13 -1
- package/dist/types/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +22 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/menu/mg-menu/test/mg-menu.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +1 -3
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +2 -1
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +2 -2
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +1 -1
- package/dist/types/components/molecules/mg-popover/test/mg-popover.e2e.playwright.d.ts +1 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +6 -5
- package/dist/types/components.d.ts +34 -2
- package/dist/types/utils/components.utils.d.ts +6 -0
- package/package.json +21 -22
- package/readme.md +0 -31
- package/dist/cjs/mg-menu.conf-43aacf30.js.map +0 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +0 -116
- package/dist/collection/components/atoms/mg-button/mg-button.css +0 -182
- package/dist/collection/components/atoms/mg-card/mg-card.css +0 -75
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.css +0 -3
- package/dist/collection/components/atoms/mg-divider/mg-divider.css +0 -9
- package/dist/collection/components/atoms/mg-icon/mg-icon.css +0 -138
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.css +0 -12
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.js +0 -18
- package/dist/collection/components/atoms/mg-input-title/test/mg-input-title.e2e.js.map +0 -1
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +0 -131
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.js +0 -37
- package/dist/collection/components/atoms/mg-tag/test/mg-tag.e2e.js.map +0 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.css +0 -43
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +0 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +0 -268
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +0 -211
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +0 -257
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +0 -254
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +0 -179
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +0 -264
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +0 -304
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.js +0 -171
- package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.js.map +0 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +0 -303
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +0 -233
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.js +0 -125
- package/dist/collection/components/molecules/inputs/mg-input-toggle/test/mg-input-toggle.e2e.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.css +0 -37
- package/dist/collection/components/molecules/menu/mg-menu/test/mg-menu.e2e.js.map +0 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +0 -377
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.js +0 -119
- package/dist/collection/components/molecules/menu/mg-menu-item/test/mg-menu-item.e2e.js.map +0 -1
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.css +0 -39
- package/dist/collection/components/molecules/mg-details/mg-details.css +0 -64
- package/dist/collection/components/molecules/mg-form/mg-form.css +0 -19
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.css +0 -45
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.css +0 -30
- package/dist/collection/components/molecules/mg-message/mg-message.css +0 -82
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +0 -67
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +0 -47
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +0 -64
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.css +0 -135
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +0 -11
- package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.js.map +0 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.css +0 -28
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +0 -99
- package/dist/collection/styles/a11y.scss +0 -36
- package/dist/collection/styles/fonts.scss +0 -21
- package/dist/collection/styles/form.scss +0 -3
- package/dist/collection/styles/global.scss +0 -80
- package/dist/collection/styles/layout.scss +0 -29
- package/dist/collection/styles/main.scss +0 -23
- package/dist/collection/styles/mg-icon-animation.scss +0 -6
- package/dist/collection/styles/navigation-button.scss +0 -77
- package/dist/collection/styles/reset-mg-card-slotted-variables.scss +0 -11
- package/dist/collection/styles/typography.scss +0 -82
- package/dist/collection/styles/utilities.scss +0 -21
- package/dist/collection/test/typography.e2e.playwright.js +0 -12
- package/dist/collection/test/typography.e2e.playwright.js.map +0 -1
- package/dist/esm/mg-menu.conf-012fc9b4.js.map +0 -1
- package/dist/mg-components/p-1d7d6fa0.js +0 -2
- package/dist/mg-components/p-1d7d6fa0.js.map +0 -1
- package/dist/mg-components/p-9257e8f1.entry.js +0 -2
- package/dist/mg-components/p-9257e8f1.entry.js.map +0 -1
- package/dist/mg-components/p-ff3ca349.entry.js +0 -2
- package/dist/mg-components/p-ff3ca349.entry.js.map +0 -1
- package/dist/mg-components/styles/a11y.scss +0 -36
- package/dist/mg-components/styles/fonts.scss +0 -21
- package/dist/mg-components/styles/form.scss +0 -3
- package/dist/mg-components/styles/global.scss +0 -80
- package/dist/mg-components/styles/layout.scss +0 -29
- package/dist/mg-components/styles/main.scss +0 -23
- package/dist/mg-components/styles/mg-icon-animation.scss +0 -6
- package/dist/mg-components/styles/navigation-button.scss +0 -77
- package/dist/mg-components/styles/reset-mg-card-slotted-variables.scss +0 -11
- package/dist/mg-components/styles/typography.scss +0 -82
- package/dist/mg-components/styles/utilities.scss +0 -21
- /package/dist/types/{test/typography.e2e.playwright.d.ts → components/atoms/mg-input-title/test/mg-input-title.e2e.playwright.d.ts} +0 -0
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common style for MGDIS inputs
|
|
3
|
-
*/
|
|
4
|
-
:host {
|
|
5
|
-
display: block;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.mg-input {
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: flex-start;
|
|
11
|
-
min-height: var(--default-size);
|
|
12
|
-
max-width: 100%;
|
|
13
|
-
margin-bottom: var(--mg-inputs-margin-bottom, 0);
|
|
14
|
-
/* Label */
|
|
15
|
-
/* Label-on-top */
|
|
16
|
-
}
|
|
17
|
-
.mg-input mg-input-title {
|
|
18
|
-
flex-shrink: var(--mg-inputs-shrink, 1);
|
|
19
|
-
width: var(--mg-inputs-title-width, auto);
|
|
20
|
-
margin-top: calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);
|
|
21
|
-
margin-right: var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));
|
|
22
|
-
text-align: right;
|
|
23
|
-
}
|
|
24
|
-
.mg-input.mg-input--label-on-top {
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
}
|
|
27
|
-
.mg-input.mg-input--label-on-top .mg-input__input-container {
|
|
28
|
-
width: 100%;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Label-on-top */
|
|
32
|
-
.mg-input__title {
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: baseline;
|
|
35
|
-
margin-bottom: 0.3rem;
|
|
36
|
-
}
|
|
37
|
-
.mg-input__title mg-input-title {
|
|
38
|
-
flex-shrink: 1;
|
|
39
|
-
width: auto;
|
|
40
|
-
margin-top: 0;
|
|
41
|
-
margin-right: var(--mg-inputs-spacer);
|
|
42
|
-
text-align: left;
|
|
43
|
-
}
|
|
44
|
-
.mg-input__title mg-tooltip {
|
|
45
|
-
margin-top: 0;
|
|
46
|
-
}
|
|
47
|
-
.mg-input__title mg-icon {
|
|
48
|
-
display: inline-flex;
|
|
49
|
-
vertical-align: text-bottom;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.mg-input__input-container {
|
|
53
|
-
min-height: var(--default-size);
|
|
54
|
-
/* Readonly */
|
|
55
|
-
}
|
|
56
|
-
.mg-input__input-container > strong {
|
|
57
|
-
display: inline-block;
|
|
58
|
-
margin-top: calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);
|
|
59
|
-
min-height: var(--font-size);
|
|
60
|
-
}
|
|
61
|
-
.mg-input__input-container mg-tooltip {
|
|
62
|
-
display: inline-flex;
|
|
63
|
-
width: var(--mg-icon-regular-size);
|
|
64
|
-
height: var(--mg-icon-regular-size);
|
|
65
|
-
margin-left: var(--mg-inputs-spacer);
|
|
66
|
-
}
|
|
67
|
-
.mg-input__input-container .mg-input__help-text,
|
|
68
|
-
.mg-input__input-container .mg-input__error {
|
|
69
|
-
text-align: start;
|
|
70
|
-
font-size: 1.2rem;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.mg-input__input {
|
|
74
|
-
display: flex;
|
|
75
|
-
/* Manage space between input and first message */
|
|
76
|
-
/* Set custom opacity on disabled input */
|
|
77
|
-
}
|
|
78
|
-
.mg-input__input mg-tooltip {
|
|
79
|
-
margin-top: calc((var(--default-size) - var(--mg-icon-regular-size)) / 2);
|
|
80
|
-
}
|
|
81
|
-
.mg-input__input.mg-input__input--has-error .mg-input__box {
|
|
82
|
-
border-color: hsl(var(--color-danger));
|
|
83
|
-
}
|
|
84
|
-
.mg-input__input + .mg-input__help-text, .mg-input__input + .mg-input__error {
|
|
85
|
-
margin-top: 0.5rem;
|
|
86
|
-
}
|
|
87
|
-
.mg-input__input .mg-input__box:disabled, .mg-input__input-group--disabled label, .mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle, .mg-input.mg-input--checkbox-multi-disabled .mg-input__input strong {
|
|
88
|
-
opacity: var(--mg-disabled-opacity);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.mg-input__error {
|
|
92
|
-
display: inline-block;
|
|
93
|
-
margin-top: 0.2rem;
|
|
94
|
-
padding: 0.3rem 0.8rem;
|
|
95
|
-
border-radius: 0.3rem;
|
|
96
|
-
background: hsl(var(--mg-inputs-error-bg-color));
|
|
97
|
-
color: hsl(var(--color-danger));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.mg-input__input mg-icon, .mg-input__error mg-icon {
|
|
101
|
-
display: flex;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Style for input "box":
|
|
106
|
-
* - input[type="text"]
|
|
107
|
-
* - input[type="date"]
|
|
108
|
-
* - input[type="password"]
|
|
109
|
-
* - textarea
|
|
110
|
-
* - select
|
|
111
|
-
*/
|
|
112
|
-
.mg-input__box {
|
|
113
|
-
padding: calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);
|
|
114
|
-
height: var(--default-size);
|
|
115
|
-
box-sizing: border-box;
|
|
116
|
-
border-width: var(--mg-inputs-border-width);
|
|
117
|
-
border-style: solid;
|
|
118
|
-
border-color: var(--mg-inputs-color);
|
|
119
|
-
border-radius: var(--mg-inputs-border-radius);
|
|
120
|
-
background-color: hsl(var(--color-light));
|
|
121
|
-
font-family: inherit;
|
|
122
|
-
color: hsl(var(--color-dark));
|
|
123
|
-
font-size: var(--font-size);
|
|
124
|
-
text-align: var(--mg-inputs-text-align, left);
|
|
125
|
-
}
|
|
126
|
-
.mg-input__box::placeholder {
|
|
127
|
-
color: var(--mg-inputs-color);
|
|
128
|
-
font-style: italic;
|
|
129
|
-
}
|
|
130
|
-
.mg-input__box:focus {
|
|
131
|
-
box-shadow: 0 0 0.6rem hsl(var(--mg-inputs-color-shadow-focus-hsl), 0.5);
|
|
132
|
-
}
|
|
133
|
-
.mg-input__box:disabled {
|
|
134
|
-
opacity: 0.3;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Variations
|
|
139
|
-
*/
|
|
140
|
-
.mg-input.mg-input--is-input-group-append {
|
|
141
|
-
--mg-button-border-radius-top-left: 0;
|
|
142
|
-
--mg-button-border-radius-bottom-left: 0;
|
|
143
|
-
/**
|
|
144
|
-
* Append input slot
|
|
145
|
-
*/
|
|
146
|
-
/**
|
|
147
|
-
* Readonly variation
|
|
148
|
-
*/
|
|
149
|
-
}
|
|
150
|
-
.mg-input.mg-input--is-input-group-append .mg-input__box {
|
|
151
|
-
margin-right: -0.1rem;
|
|
152
|
-
border-top-right-radius: 0;
|
|
153
|
-
border-bottom-right-radius: 0;
|
|
154
|
-
}
|
|
155
|
-
.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible {
|
|
156
|
-
outline-style: solid;
|
|
157
|
-
outline-offset: -0.2rem;
|
|
158
|
-
outline-width: 0.2rem;
|
|
159
|
-
}
|
|
160
|
-
.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input] {
|
|
161
|
-
display: none;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.mg-input.mg-input--label-on-top .mg-input__box {
|
|
165
|
-
width: auto;
|
|
166
|
-
max-width: 100%;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]) {
|
|
170
|
-
--mg-button-border-radius-top-right: 0;
|
|
171
|
-
--mg-button-border-radius-bottom-right: 0;
|
|
172
|
-
}
|
|
173
|
-
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)) {
|
|
174
|
-
--mg-button-border-right-width: 0;
|
|
175
|
-
}
|
|
176
|
-
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type) {
|
|
177
|
-
--mg-button-border-radius-top-right: var(--mg-inputs-border-radius);
|
|
178
|
-
--mg-button-border-radius-bottom-right: var(--mg-inputs-border-radius);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]) {
|
|
182
|
-
padding-top: calc((var(--default-size) - var(--mg-icon-regular-size)) / 2);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Used to define width input
|
|
187
|
-
* Kept it nested for coming widths
|
|
188
|
-
*/
|
|
189
|
-
.mg-input.mg-input--width-full:not(.mg-input--label-on-top) {
|
|
190
|
-
justify-content: space-between;
|
|
191
|
-
}
|
|
192
|
-
.mg-input.mg-input--width-full.mg-input--label-on-top .mg-input__box {
|
|
193
|
-
width: 100%;
|
|
194
|
-
}
|
|
195
|
-
.mg-input.mg-input--width-full .mg-input__input-container {
|
|
196
|
-
flex: auto;
|
|
197
|
-
width: 100%;
|
|
198
|
-
}
|
|
199
|
-
.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box {
|
|
200
|
-
max-width: 100%;
|
|
201
|
-
}
|
|
202
|
-
.mg-input:not(.mg-input--label-on-top) .mg-input__box {
|
|
203
|
-
width: 100%;
|
|
204
|
-
max-width: calc(17.7rem + var(--mg-inputs-spacer) * 2);
|
|
205
|
-
min-width: 5rem;
|
|
206
|
-
}
|
|
207
|
-
.mg-input.mg-input--width-16 .mg-input__input-container {
|
|
208
|
-
width: 100%;
|
|
209
|
-
}
|
|
210
|
-
.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__input {
|
|
211
|
-
width: 100%;
|
|
212
|
-
max-width: 21rem;
|
|
213
|
-
}
|
|
214
|
-
.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__with-character-left {
|
|
215
|
-
width: 100%;
|
|
216
|
-
}
|
|
217
|
-
.mg-input.mg-input--width-16 .mg-input__input-container .mg-input__box {
|
|
218
|
-
max-width: 21rem;
|
|
219
|
-
min-width: 100%;
|
|
220
|
-
}
|
|
221
|
-
.mg-input.mg-input--width-4 .mg-input__input-container .mg-input__box {
|
|
222
|
-
max-width: 7rem;
|
|
223
|
-
}
|
|
224
|
-
.mg-input.mg-input--width-2 .mg-input__input-container .mg-input__box {
|
|
225
|
-
max-width: 5rem;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Set mg-character-left with inputs
|
|
230
|
-
*/
|
|
231
|
-
.mg-input mg-character-left {
|
|
232
|
-
opacity: 0.6;
|
|
233
|
-
font-size: 1.1rem;
|
|
234
|
-
}
|
|
235
|
-
.mg-input.mg-input--has-display-character-left .mg-input__input + .mg-input__help-text, .mg-input.mg-input--has-display-character-left .mg-input__input + .mg-input__error {
|
|
236
|
-
margin-top: 0;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* A11Y
|
|
241
|
-
*/
|
|
242
|
-
.sr-only {
|
|
243
|
-
border: 0 !important;
|
|
244
|
-
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
245
|
-
-webkit-clip-path: inset(50%) !important;
|
|
246
|
-
clip-path: inset(50%) !important;
|
|
247
|
-
height: 1px !important;
|
|
248
|
-
margin: -1px !important;
|
|
249
|
-
overflow: hidden !important;
|
|
250
|
-
padding: 0 !important;
|
|
251
|
-
position: absolute !important;
|
|
252
|
-
width: 1px !important;
|
|
253
|
-
white-space: nowrap !important;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
*:focus:not(:focus-visible) {
|
|
257
|
-
outline: none;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
@media (prefers-reduced-motion) {
|
|
261
|
-
.mg-a11y-animation {
|
|
262
|
-
animation: none !important;
|
|
263
|
-
transition: none !important;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Icon in input
|
|
268
|
-
*/
|
|
269
|
-
.mg-input.mg-input--has-icon .mg-input__with-character-left > mg-icon {
|
|
270
|
-
position: absolute;
|
|
271
|
-
top: 50%;
|
|
272
|
-
left: var(--mg-inputs-spacer);
|
|
273
|
-
color: var(--mg-inputs-color);
|
|
274
|
-
transform: translateY(-50%);
|
|
275
|
-
}
|
|
276
|
-
.mg-input.mg-input--has-icon .mg-input__with-character-left .mg-input__box {
|
|
277
|
-
padding-left: calc(var(--mg-icon-regular-size) + var(--mg-inputs-spacer) * 2);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Character left
|
|
282
|
-
*/
|
|
283
|
-
.mg-input__with-character-left {
|
|
284
|
-
position: relative;
|
|
285
|
-
display: inline-flex;
|
|
286
|
-
}
|
|
287
|
-
.mg-input--width-full .mg-input__with-character-left {
|
|
288
|
-
width: 100%;
|
|
289
|
-
}
|
|
290
|
-
.mg-input.is-focused .mg-input__with-character-left .mg-input__box {
|
|
291
|
-
padding-right: calc(var(--mg-character-left-message-length) * 1ch + 0.8rem);
|
|
292
|
-
}
|
|
293
|
-
.mg-input__with-character-left mg-character-left {
|
|
294
|
-
position: absolute;
|
|
295
|
-
display: none;
|
|
296
|
-
top: 50%;
|
|
297
|
-
right: 1rem;
|
|
298
|
-
opacity: 0.6;
|
|
299
|
-
transform: translateY(-50%);
|
|
300
|
-
font-size: 1.1rem;
|
|
301
|
-
}
|
|
302
|
-
.mg-input.is-focused .mg-input__with-character-left mg-character-left {
|
|
303
|
-
display: block;
|
|
304
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { createPage } from "../../../../../utils/stencil.e2e.test.utils";
|
|
2
|
-
describe('mg-input-text', () => {
|
|
3
|
-
describe.each([
|
|
4
|
-
`<mg-input-text identifier="identifier" label="label"></mg-input-text>`,
|
|
5
|
-
`<mg-input-text identifier="identifier" label="label" label-on-top></mg-input-text>`,
|
|
6
|
-
`<mg-input-text identifier="identifier" label="label" label-hide></mg-input-text>`,
|
|
7
|
-
`<mg-input-text identifier="identifier" label="label" placeholder="placeholder" help-text="HelpText Message"></mg-input-text>`,
|
|
8
|
-
])('without tooltip', html => {
|
|
9
|
-
test('render', async () => {
|
|
10
|
-
const page = await createPage(html);
|
|
11
|
-
const element = await page.find('mg-input-text');
|
|
12
|
-
const input = await page.find('mg-input-text >>> input');
|
|
13
|
-
// Hide caret for screenshots
|
|
14
|
-
await page.$eval('mg-input-text', elm => {
|
|
15
|
-
const input = elm.shadowRoot.querySelector('input');
|
|
16
|
-
input.style.caretColor = 'transparent';
|
|
17
|
-
});
|
|
18
|
-
expect(element).toHaveClass('hydrated');
|
|
19
|
-
const screenshot = await page.screenshot();
|
|
20
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
21
|
-
await page.keyboard.down('Tab');
|
|
22
|
-
await page.waitForChanges();
|
|
23
|
-
const screenshotFocus = await page.screenshot();
|
|
24
|
-
expect(screenshotFocus).toMatchImageSnapshot();
|
|
25
|
-
await input.press('KeyB');
|
|
26
|
-
await input.press('KeyL');
|
|
27
|
-
await input.press('KeyU');
|
|
28
|
-
await page.waitForChanges();
|
|
29
|
-
const screenshotType = await page.screenshot();
|
|
30
|
-
expect(screenshotType).toMatchImageSnapshot();
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
test.each([true, false])('render with tooltip, case label-on-top %s', async (labelOnTop) => {
|
|
34
|
-
const page = await createPage(`<mg-input-text identifier="identifier" label="label" tooltip="Tooltip message" label-on-top="${labelOnTop}"></mg-input-text>`);
|
|
35
|
-
const element = await page.find('mg-input-text');
|
|
36
|
-
expect(element).toHaveClass('hydrated');
|
|
37
|
-
const screenshot = await page.screenshot();
|
|
38
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
39
|
-
await page.keyboard.down('Tab');
|
|
40
|
-
if (!labelOnTop) {
|
|
41
|
-
// Ensure to display tooltip
|
|
42
|
-
await page.setViewport({ width: 600, height: 65 });
|
|
43
|
-
// when label on top tooltip is on fist tab (next to label)
|
|
44
|
-
await page.keyboard.down('Tab');
|
|
45
|
-
}
|
|
46
|
-
await page.waitForChanges();
|
|
47
|
-
const screenshotTooltip = await page.screenshot();
|
|
48
|
-
expect(screenshotTooltip).toMatchImageSnapshot();
|
|
49
|
-
});
|
|
50
|
-
describe.each([
|
|
51
|
-
`<mg-input-text identifier="identifier" label="label" readonly></mg-input-text>`,
|
|
52
|
-
`<mg-input-text identifier="identifier" label="label" value="blu"></mg-input-text>`,
|
|
53
|
-
`<mg-input-text identifier="identifier" label="label" value="blu" readonly></mg-input-text>`,
|
|
54
|
-
`<mg-input-text identifier="identifier" label="label" value="blu" readonly label-on-top></mg-input-text>`,
|
|
55
|
-
`<mg-input-text identifier="identifier" label="label" disabled></mg-input-text>`,
|
|
56
|
-
`<mg-input-text identifier="identifier" label="label" value="blu" disabled></mg-input-text>`,
|
|
57
|
-
`<mg-input-text identifier="identifier" label="label" value="batman" help-text='<mg-icon icon="user" size="small"></mg-icon> Welcome batman'></mg-input-text>`,
|
|
58
|
-
`<mg-input-text identifier="identifier" label="label" value="blu" help-text="HelpText Message" required></mg-input-text>`,
|
|
59
|
-
`<mg-input-text identifier="identifier" label="label" value="blu" help-text="HelpText Message" required readonly></mg-input-text>`,
|
|
60
|
-
`<mg-input-text identifier="identifier" label="label" value="blu" help-text="HelpText Message" required disabled></mg-input-text>`,
|
|
61
|
-
])('Should render with template', html => {
|
|
62
|
-
test('render', async () => {
|
|
63
|
-
const page = await createPage(html);
|
|
64
|
-
const element = await page.find('mg-input-text');
|
|
65
|
-
expect(element).toHaveClass('hydrated');
|
|
66
|
-
const screenshot = await page.screenshot();
|
|
67
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
describe.each([
|
|
71
|
-
`<mg-input-text identifier="identifier" label="label" required></mg-input-text>`,
|
|
72
|
-
`<mg-input-text identifier="identifier" label="label" required lang="fr"></mg-input-text>`,
|
|
73
|
-
])('%s', html => {
|
|
74
|
-
test('Should render error when leaving an empty required input', async () => {
|
|
75
|
-
const page = await createPage(html);
|
|
76
|
-
const element = await page.find('mg-input-text');
|
|
77
|
-
expect(element).toHaveClass('hydrated');
|
|
78
|
-
await page.keyboard.down('Tab');
|
|
79
|
-
await page.keyboard.down('Tab');
|
|
80
|
-
await page.waitForChanges();
|
|
81
|
-
const screenshot = await page.screenshot();
|
|
82
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
describe.each([16, 'full'])('Should render error when leaving input with a non matching pattern value, mg-width: %s', mgWidth => {
|
|
86
|
-
test('render', async () => {
|
|
87
|
-
const page = await createPage(`<mg-input-text identifier="identifier" mg-width="${mgWidth}" label="label" pattern="[a-z]*" pattern-error-message="Vous ne pouvez saisir que des lettres minuscules."></mg-input-text>`);
|
|
88
|
-
const element = await page.find('mg-input-text');
|
|
89
|
-
const input = await page.find('mg-input-text >>> input');
|
|
90
|
-
expect(element).toHaveClass('hydrated');
|
|
91
|
-
await page.keyboard.down('Tab');
|
|
92
|
-
await input.press('KeyB');
|
|
93
|
-
await input.press('KeyL');
|
|
94
|
-
await input.press('KeyU');
|
|
95
|
-
await input.press('1');
|
|
96
|
-
await page.keyboard.down('Tab');
|
|
97
|
-
await page.waitForChanges();
|
|
98
|
-
const screenshot = await page.screenshot();
|
|
99
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
100
|
-
await page.keyboard.down('Tab');
|
|
101
|
-
await page.waitForChanges();
|
|
102
|
-
const screenshotReFocus = await page.screenshot();
|
|
103
|
-
expect(screenshotReFocus).toMatchImageSnapshot();
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
describe.each([
|
|
107
|
-
'<mg-input-text identifier="identifier" label="long label long label long label long label long label long label long label long label long label long label long label" tooltip="tooltip message"></mg-input-text>',
|
|
108
|
-
'<mg-input-text identifier="identifier" label="long label long label long label long label long label long label long label long label long label long label long label" tooltip="tooltip message" label-on-top></mg-input-text>',
|
|
109
|
-
])('inside a div.mg-form-group', html => {
|
|
110
|
-
test('render', async () => {
|
|
111
|
-
const page = await createPage(`<div class="mg-form-group">${html}</div>`);
|
|
112
|
-
const element = await page.find('mg-input-text');
|
|
113
|
-
expect(element).toHaveClass('hydrated');
|
|
114
|
-
const screenshot = await page.screenshot();
|
|
115
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
describe.each([true, false])('using append-input slot, case readonly %s', readonly => {
|
|
119
|
-
test.each([
|
|
120
|
-
{
|
|
121
|
-
type: 'search',
|
|
122
|
-
slot: `<mg-button slot="append-input" label="search">
|
|
123
|
-
<mg-icon icon="magnifying-glass"></mg-icon> Search
|
|
124
|
-
</mg-button>`,
|
|
125
|
-
icon: 'magnifying-glass',
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
type: 'text',
|
|
129
|
-
slot: '<span slot="append-input">@dc.comics</span>',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
type: 'text',
|
|
133
|
-
slot: `<mg-button is-icon slot="append-input" label="cancel" variant="secondary">
|
|
134
|
-
<mg-icon icon="cross"></mg-icon>
|
|
135
|
-
</mg-button>
|
|
136
|
-
<mg-button is-icon slot="append-input" label="validate" variant="secondary">
|
|
137
|
-
<mg-icon icon="check"></mg-icon>
|
|
138
|
-
</mg-button>
|
|
139
|
-
`,
|
|
140
|
-
},
|
|
141
|
-
])('render', async ({ type, slot, icon }) => {
|
|
142
|
-
const page = await createPage(`
|
|
143
|
-
<mg-input-text identifier="identifier" label="label" ${icon && 'icon="' + icon + '"'} placeholder="placeholder" type="${type}" readonly="${readonly}" value="bruce">
|
|
144
|
-
${slot}
|
|
145
|
-
</mg-input-text>
|
|
146
|
-
`);
|
|
147
|
-
const element = await page.find('mg-input-text');
|
|
148
|
-
expect(element).toHaveClass('hydrated');
|
|
149
|
-
const screenshot = await page.screenshot();
|
|
150
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
describe.each([16, 4, 2])('with custom width: %s', width => {
|
|
154
|
-
test.each([false, true])('with label on top: %s', async (labelOnTop) => {
|
|
155
|
-
const page = await createPage(`<mg-input-text identifier="identifier" label="label" mg-width="${width}" label-on-top="${labelOnTop}"></mg-input-text>`);
|
|
156
|
-
const element = await page.find('mg-input-text');
|
|
157
|
-
expect(element).toHaveClass('hydrated');
|
|
158
|
-
const screenshot = await page.screenshot();
|
|
159
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
test.each([false, true])('Ensure component fit in width 200px with label-on-top: %s', async (labelOnTop) => {
|
|
163
|
-
const page = await createPage(`<mg-input-text identifier="identifier" label="label" label-on-top="${labelOnTop}"></mg-input-text>`);
|
|
164
|
-
const element = await page.find('mg-input-text');
|
|
165
|
-
expect(element).toHaveClass('hydrated');
|
|
166
|
-
await page.setViewport({ width: 200, height: 100 });
|
|
167
|
-
const screenshot = await page.screenshot();
|
|
168
|
-
expect(screenshot).toMatchImageSnapshot();
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
//# sourceMappingURL=mg-input-text.e2e.js.map
|
package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mg-input-text.e2e.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/inputs/mg-input-text/test/mg-input-text.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;EAC7B,QAAQ,CAAC,IAAI,CAAC;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AAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAEpD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,EAAE,CAAC;EAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { createPage } from '../../../../../utils/stencil.e2e.test.utils';\n\ndescribe('mg-input-text', () => {\n describe.each([\n `<mg-input-text identifier=\"identifier\" label=\"label\"></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" label-on-top></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" label-hide></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" placeholder=\"placeholder\" help-text=\"HelpText Message\"></mg-input-text>`,\n ])('without tooltip', html => {\n test('render', async () => {\n const page = await createPage(html);\n\n const element = await page.find('mg-input-text');\n const input = await page.find('mg-input-text >>> input');\n\n // Hide caret for screenshots\n await page.$eval('mg-input-text', elm => {\n const input = elm.shadowRoot.querySelector('input');\n input.style.caretColor = 'transparent';\n });\n\n expect(element).toHaveClass('hydrated');\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n\n await page.keyboard.down('Tab');\n\n await page.waitForChanges();\n\n const screenshotFocus = await page.screenshot();\n expect(screenshotFocus).toMatchImageSnapshot();\n\n await input.press('KeyB');\n await input.press('KeyL');\n await input.press('KeyU');\n\n await page.waitForChanges();\n\n const screenshotType = await page.screenshot();\n expect(screenshotType).toMatchImageSnapshot();\n });\n });\n\n test.each([true, false])('render with tooltip, case label-on-top %s', async labelOnTop => {\n const page = await createPage(`<mg-input-text identifier=\"identifier\" label=\"label\" tooltip=\"Tooltip message\" label-on-top=\"${labelOnTop}\"></mg-input-text>`);\n\n const element = await page.find('mg-input-text');\n\n expect(element).toHaveClass('hydrated');\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n\n await page.keyboard.down('Tab');\n if (!labelOnTop) {\n // Ensure to display tooltip\n await page.setViewport({ width: 600, height: 65 });\n // when label on top tooltip is on fist tab (next to label)\n await page.keyboard.down('Tab');\n }\n\n await page.waitForChanges();\n\n const screenshotTooltip = await page.screenshot();\n expect(screenshotTooltip).toMatchImageSnapshot();\n });\n\n describe.each([\n `<mg-input-text identifier=\"identifier\" label=\"label\" readonly></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" value=\"blu\"></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" value=\"blu\" readonly></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" value=\"blu\" readonly label-on-top></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" disabled></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" value=\"blu\" disabled></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" value=\"batman\" help-text='<mg-icon icon=\"user\" size=\"small\"></mg-icon> Welcome batman'></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" value=\"blu\" help-text=\"HelpText Message\" required></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" value=\"blu\" help-text=\"HelpText Message\" required readonly></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" value=\"blu\" help-text=\"HelpText Message\" required disabled></mg-input-text>`,\n ])('Should render with template', html => {\n test('render', async () => {\n const page = await createPage(html);\n\n const element = await page.find('mg-input-text');\n\n expect(element).toHaveClass('hydrated');\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n });\n\n describe.each([\n `<mg-input-text identifier=\"identifier\" label=\"label\" required></mg-input-text>`,\n `<mg-input-text identifier=\"identifier\" label=\"label\" required lang=\"fr\"></mg-input-text>`,\n ])('%s', html => {\n test('Should render error when leaving an empty required input', async () => {\n const page = await createPage(html);\n\n const element = await page.find('mg-input-text');\n\n expect(element).toHaveClass('hydrated');\n\n await page.keyboard.down('Tab');\n await page.keyboard.down('Tab');\n\n await page.waitForChanges();\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n });\n\n describe.each([16, 'full'])('Should render error when leaving input with a non matching pattern value, mg-width: %s', mgWidth => {\n test('render', async () => {\n const page = await createPage(\n `<mg-input-text identifier=\"identifier\" mg-width=\"${mgWidth}\" label=\"label\" pattern=\"[a-z]*\" pattern-error-message=\"Vous ne pouvez saisir que des lettres minuscules.\"></mg-input-text>`,\n );\n\n const element = await page.find('mg-input-text');\n const input = await page.find('mg-input-text >>> input');\n\n expect(element).toHaveClass('hydrated');\n\n await page.keyboard.down('Tab');\n\n await input.press('KeyB');\n await input.press('KeyL');\n await input.press('KeyU');\n await input.press('1');\n\n await page.keyboard.down('Tab');\n\n await page.waitForChanges();\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n\n await page.keyboard.down('Tab');\n\n await page.waitForChanges();\n\n const screenshotReFocus = await page.screenshot();\n expect(screenshotReFocus).toMatchImageSnapshot();\n });\n });\n\n describe.each([\n '<mg-input-text identifier=\"identifier\" label=\"long label long label long label long label long label long label long label long label long label long label long label\" tooltip=\"tooltip message\"></mg-input-text>',\n '<mg-input-text identifier=\"identifier\" label=\"long label long label long label long label long label long label long label long label long label long label long label\" tooltip=\"tooltip message\" label-on-top></mg-input-text>',\n ])('inside a div.mg-form-group', html => {\n test('render', async () => {\n const page = await createPage(`<div class=\"mg-form-group\">${html}</div>`);\n\n const element = await page.find('mg-input-text');\n\n expect(element).toHaveClass('hydrated');\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n });\n\n describe.each([true, false])('using append-input slot, case readonly %s', readonly => {\n test.each([\n {\n type: 'search',\n slot: `<mg-button slot=\"append-input\" label=\"search\">\n <mg-icon icon=\"magnifying-glass\"></mg-icon> Search\n </mg-button>`,\n icon: 'magnifying-glass',\n },\n {\n type: 'text',\n slot: '<span slot=\"append-input\">@dc.comics</span>',\n },\n {\n type: 'text',\n slot: `<mg-button is-icon slot=\"append-input\" label=\"cancel\" variant=\"secondary\">\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n <mg-button is-icon slot=\"append-input\" label=\"validate\" variant=\"secondary\">\n <mg-icon icon=\"check\"></mg-icon>\n </mg-button>\n `,\n },\n ])('render', async ({ type, slot, icon }) => {\n const page = await createPage(`\n <mg-input-text identifier=\"identifier\" label=\"label\" ${icon && 'icon=\"' + icon + '\"'} placeholder=\"placeholder\" type=\"${type}\" readonly=\"${readonly}\" value=\"bruce\">\n ${slot}\n </mg-input-text>\n `);\n\n const element = await page.find('mg-input-text');\n\n expect(element).toHaveClass('hydrated');\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n });\n\n describe.each([16, 4, 2])('with custom width: %s', width => {\n test.each([false, true])('with label on top: %s', async labelOnTop => {\n const page = await createPage(`<mg-input-text identifier=\"identifier\" label=\"label\" mg-width=\"${width}\" label-on-top=\"${labelOnTop}\"></mg-input-text>`);\n\n const element = await page.find('mg-input-text');\n\n expect(element).toHaveClass('hydrated');\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n });\n\n test.each([false, true])('Ensure component fit in width 200px with label-on-top: %s', async labelOnTop => {\n const page = await createPage(`<mg-input-text identifier=\"identifier\" label=\"label\" label-on-top=\"${labelOnTop}\"></mg-input-text>`);\n\n const element = await page.find('mg-input-text');\n\n expect(element).toHaveClass('hydrated');\n\n await page.setViewport({ width: 200, height: 100 });\n\n const screenshot = await page.screenshot();\n expect(screenshot).toMatchImageSnapshot();\n });\n});\n"]}
|