@mgdis/mg-components 3.3.0 → 4.0.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-bead7dbd.js → index-88560a66.js} +47 -48
- package/dist/cjs/{index-369388eb.js → index-a39c5567.js} +97 -10
- package/dist/cjs/loader.cjs.js +3 -17
- package/dist/cjs/mg-badge_21.cjs.entry.js +461 -281
- package/dist/cjs/mg-components.cjs.js +3 -7
- package/dist/cjs/mg-modal.cjs.entry.js +12 -6
- package/dist/cjs/mg-popover.cjs.entry.js +15 -6
- package/dist/cjs/{popper-0c3964e7.js → popper-71bf3058.js} +6 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/mg-badge/{mg-badge.stories.js → doc/mg-badge.stories.js} +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +0 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +15 -3
- package/dist/collection/components/atoms/mg-button/{mg-button.stories.js → doc/mg-button.stories.js} +2 -2
- package/dist/collection/components/atoms/mg-button/mg-button.css +6 -30
- package/dist/collection/components/atoms/mg-button/mg-button.js +7 -2
- package/dist/collection/components/atoms/mg-character-left/{mg-character-left.stories.js → doc/mg-character-left.stories.js} +1 -1
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +10 -47
- package/dist/collection/components/atoms/mg-icon/{mg-icon.stories.js → doc/mg-icon.stories.js} +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +86 -10
- package/dist/collection/components/atoms/mg-icon/mg-icon.css +4 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +22 -6
- package/dist/collection/components/atoms/mg-input-title/{mg-input-title.stories.js → doc/mg-input-title.stories.js} +0 -0
- package/dist/collection/components/atoms/mg-tag/{mg-tag.stories.js → doc/mg-tag.stories.js} +1 -1
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +19 -4
- package/dist/collection/components/atoms/mg-tooltip/{mg-tooltip.stories.js → doc/mg-tooltip.stories.js} +14 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +20 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +7 -2
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +1 -7
- package/dist/collection/components/molecules/inputs/MgInput.js +5 -15
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.js → doc/mg-input-checkbox.stories.js} +0 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +19 -13
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +8 -21
- package/dist/collection/components/molecules/inputs/mg-input-date/{mg-input-date.stories.js → doc/mg-input-date.stories.js} +0 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +19 -18
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +19 -18
- package/dist/collection/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.js → doc/mg-input-numeric.stories.js} +9 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +20 -19
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +43 -19
- package/dist/collection/components/molecules/inputs/mg-input-password/{mg-input-password.stories.js → doc/mg-input-password.stories.js} +10 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +19 -18
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -22
- package/dist/collection/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.js → doc/mg-input-radio.stories.js} +0 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +19 -13
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +8 -15
- package/dist/collection/components/molecules/inputs/mg-input-select/{mg-input-select.stories.js → doc/mg-input-select.stories.js} +10 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +20 -18
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +24 -31
- package/dist/collection/components/molecules/inputs/mg-input-text/{mg-input-text.stories.js → doc/mg-input-text.stories.js} +11 -7
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +51 -28
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +42 -43
- package/dist/collection/components/molecules/inputs/mg-input-textarea/{mg-input-textarea.stories.js → doc/mg-input-textarea.stories.js} +10 -4
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +51 -22
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +64 -37
- package/dist/collection/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.js → doc/mg-input-toggle.stories.js} +0 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +18 -9
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +9 -3
- package/dist/collection/components/molecules/mg-form/{mg-form.stories.js → doc/mg-form.stories.js} +0 -0
- package/dist/collection/components/molecules/mg-form/mg-form.css +4 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +5 -3
- package/dist/collection/components/molecules/mg-message/{mg-message.stories.js → doc/mg-message.stories.js} +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +15 -7
- package/dist/collection/components/molecules/mg-modal/{mg-modal.stories.js → doc/mg-modal.stories.js} +0 -0
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +5 -7
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +10 -4
- package/dist/collection/components/molecules/mg-pagination/{mg-pagination.stories.js → doc/mg-pagination.stories.js} +0 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +17 -18
- package/dist/collection/components/molecules/mg-panel/{mg-panel.stories.js → doc/mg-panel.stories.js} +0 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +5 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +10 -9
- package/dist/collection/components/molecules/mg-popover/{mg-popover.stories.js → doc/mg-popover.stories.js} +10 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +20 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +19 -5
- package/dist/collection/components/molecules/mg-tabs/{mg-tabs.stories.js → doc/mg-tabs.stories.js} +11 -5
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +7 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +3 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +72 -26
- package/dist/collection/locales/index.js +33 -4
- package/dist/collection/stories/helpers.stories.js +33 -0
- package/dist/collection/utils/locale.utils.js +7 -4
- package/dist/collection/variables.css +10 -5
- package/dist/collection/variables.scss +10 -5
- package/dist/components/MgInput.js +6 -23
- package/dist/components/index.d.ts +23 -5
- package/dist/components/index.js +23 -0
- package/dist/components/index2.js +97 -8
- package/dist/components/locale.utils.js +7 -5
- package/dist/components/mg-badge2.js +16 -4
- package/dist/components/mg-button2.js +8 -3
- package/dist/components/mg-character-left2.js +4 -27
- package/dist/components/mg-form.js +6 -4
- package/dist/components/mg-icon2.js +109 -17
- package/dist/components/mg-input-checkbox.js +11 -27
- package/dist/components/mg-input-date.js +21 -25
- package/dist/components/mg-input-numeric.js +28 -26
- package/dist/components/mg-input-password.js +18 -28
- package/dist/components/mg-input-radio.js +10 -22
- package/dist/components/mg-input-select2.js +24 -35
- package/dist/components/mg-input-text2.js +38 -26
- package/dist/components/mg-input-textarea.js +43 -20
- package/dist/components/mg-input-toggle.js +11 -11
- package/dist/components/mg-message.js +16 -8
- package/dist/components/mg-modal.js +11 -5
- package/dist/components/mg-pagination.js +16 -22
- package/dist/components/mg-panel.js +8 -7
- package/dist/components/mg-popover.js +13 -4
- package/dist/components/mg-tabs.js +75 -21
- package/dist/components/mg-tag.js +20 -5
- package/dist/components/mg-tooltip2.js +1 -1
- package/dist/components/popper.js +6 -2
- package/dist/esm/{index-9e877561.js → index-bca81100.js} +48 -46
- package/dist/esm/{index-c346f52d.js → index-e51ae032.js} +97 -8
- package/dist/esm/loader.js +3 -17
- package/dist/esm/mg-badge_21.entry.js +458 -278
- package/dist/esm/mg-components.js +3 -7
- package/dist/esm/mg-modal.entry.js +12 -6
- package/dist/esm/mg-popover.entry.js +15 -6
- package/dist/esm/{popper-8874fd6c.js → popper-93ecb064.js} +6 -2
- package/dist/index.js +1 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-003a1344.entry.js +1 -0
- package/dist/mg-components/p-462d648a.entry.js +1 -0
- package/dist/mg-components/p-4c66f794.js +1 -0
- package/dist/mg-components/p-5126ab10.entry.js +1 -0
- package/dist/mg-components/p-780bd52d.js +1 -0
- package/dist/mg-components/p-b14a3443.js +2 -0
- package/dist/mg-components/variables.css +10 -5
- package/dist/mg-components/variables.scss +10 -5
- package/dist/types/components/atoms/mg-badge/{mg-badge.stories.d.ts → doc/mg-badge.stories.d.ts} +0 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +8 -1
- package/dist/types/components/atoms/mg-button/{mg-button.stories.d.ts → doc/mg-button.stories.d.ts} +0 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +1 -1
- package/dist/types/components/atoms/mg-character-left/{mg-character-left.stories.d.ts → doc/mg-character-left.stories.d.ts} +0 -0
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +5 -13
- package/dist/types/components/atoms/mg-icon/{mg-icon.stories.d.ts → doc/mg-icon.stories.d.ts} +0 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +3 -3
- package/dist/types/components/atoms/mg-input-title/{mg-input-title.stories.d.ts → doc/mg-input-title.stories.d.ts} +0 -0
- package/dist/types/components/atoms/mg-tag/{mg-tag.stories.d.ts → doc/mg-tag.stories.d.ts} +0 -0
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +8 -1
- package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +29 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +8 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +2 -1
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +0 -6
- package/dist/types/components/molecules/inputs/MgInput.d.ts +2 -4
- package/dist/types/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.d.ts → doc/mg-input-checkbox.stories.d.ts} +0 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +5 -2
- package/dist/types/components/molecules/inputs/mg-input-date/{mg-input-date.stories.d.ts → doc/mg-input-date.stories.d.ts} +0 -0
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +7 -1
- package/dist/types/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.d.ts → doc/mg-input-numeric.stories.d.ts} +6 -0
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +8 -2
- package/dist/types/components/molecules/inputs/mg-input-password/{mg-input-password.stories.d.ts → doc/mg-input-password.stories.d.ts} +8 -0
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +7 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.d.ts → doc/mg-input-radio.stories.d.ts} +0 -0
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -1
- package/dist/types/components/molecules/inputs/mg-input-select/{mg-input-select.stories.d.ts → doc/mg-input-select.stories.d.ts} +11 -5
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +7 -2
- package/dist/types/components/molecules/inputs/mg-input-text/{mg-input-text.stories.d.ts → doc/mg-input-text.stories.d.ts} +8 -0
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +7 -7
- package/dist/types/components/molecules/inputs/mg-input-textarea/{mg-input-textarea.stories.d.ts → doc/mg-input-textarea.stories.d.ts} +8 -0
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +14 -6
- package/dist/types/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.d.ts → doc/mg-input-toggle.stories.d.ts} +0 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -0
- package/dist/types/components/molecules/mg-form/{mg-form.stories.d.ts → doc/mg-form.stories.d.ts} +0 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -0
- package/dist/types/components/molecules/mg-message/{mg-message.stories.d.ts → doc/mg-message.stories.d.ts} +0 -0
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +2 -0
- package/dist/types/components/molecules/mg-modal/{mg-modal.stories.d.ts → doc/mg-modal.stories.d.ts} +0 -0
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +2 -0
- package/dist/types/components/molecules/mg-pagination/{mg-pagination.stories.d.ts → doc/mg-pagination.stories.d.ts} +0 -0
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +8 -0
- package/dist/types/components/molecules/mg-panel/{mg-panel.stories.d.ts → doc/mg-panel.stories.d.ts} +0 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +5 -0
- package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +25 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +8 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +9 -1
- package/dist/types/components/molecules/mg-tabs/{mg-tabs.stories.d.ts → doc/mg-tabs.stories.d.ts} +0 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +7 -1
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +44 -0
- package/dist/types/components.d.ts +149 -151
- package/dist/types/locales/index.d.ts +109 -46
- package/dist/types/stories/{buttons.stories.d.ts → helpers.stories.d.ts} +1 -1
- package/dist/types/utils/locale.utils.d.ts +7 -3
- package/loader/index.js +1 -1
- package/package.json +41 -14
- package/readme.md +6 -35
- package/dist/cjs/css-shim-629916b0.js +0 -6
- package/dist/cjs/shadow-css-546083ef.js +0 -390
- package/dist/collection/stories/buttons.stories.js +0 -43
- package/dist/collection/stories/messages.stories.js +0 -44
- package/dist/collection/stories/tags.stories.js +0 -13
- package/dist/esm/css-shim-0993aa3b.js +0 -4
- package/dist/esm/shadow-css-dfa0587f.js +0 -388
- package/dist/esm-es5/css-shim-0993aa3b.js +0 -1
- package/dist/esm-es5/index-9e877561.js +0 -1
- package/dist/esm-es5/index-c346f52d.js +0 -1
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +0 -1
- package/dist/esm-es5/mg-badge_21.entry.js +0 -2
- package/dist/esm-es5/mg-components.js +0 -1
- package/dist/esm-es5/mg-modal.entry.js +0 -1
- package/dist/esm-es5/mg-popover.entry.js +0 -1
- package/dist/esm-es5/popper-8874fd6c.js +0 -1
- package/dist/esm-es5/shadow-css-dfa0587f.js +0 -12
- package/dist/mg-components/mg-components.js +0 -132
- package/dist/mg-components/p-136c8d6f.system.entry.js +0 -2
- package/dist/mg-components/p-3c14153d.js +0 -1
- package/dist/mg-components/p-50ea2036.system.js +0 -1
- package/dist/mg-components/p-55a22b35.system.js +0 -1
- package/dist/mg-components/p-5e796581.js +0 -12
- package/dist/mg-components/p-656b5efb.system.js +0 -1
- package/dist/mg-components/p-68d6f104.js +0 -1
- package/dist/mg-components/p-6d49ed95.js +0 -1
- package/dist/mg-components/p-6f173f62.system.entry.js +0 -1
- package/dist/mg-components/p-70177194.entry.js +0 -1
- package/dist/mg-components/p-8b2d8a2a.system.js +0 -13
- package/dist/mg-components/p-8cb61c3f.system.js +0 -1
- package/dist/mg-components/p-ace173b1.js +0 -1
- package/dist/mg-components/p-b7488a4c.entry.js +0 -1
- package/dist/mg-components/p-c1ffb2e1.entry.js +0 -1
- package/dist/mg-components/p-c90cc4bf.system.js +0 -1
- package/dist/mg-components/p-de1164fa.system.entry.js +0 -1
- package/dist/mg-components/p-e4a502b5.system.js +0 -1
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-popover/mg-popover.stories.d.ts +0 -12
- package/dist/types/stories/messages.stories.d.ts +0 -13
- package/dist/types/stories/tags.stories.d.ts +0 -5
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { M as MgInput } from './MgInput.js';
|
|
3
3
|
import { c as createID, C as ClassList } from './components.utils.js';
|
|
4
|
-
import {
|
|
4
|
+
import { i as initLocales } from './index2.js';
|
|
5
5
|
import { a as localeCurrency, b as localeNumber } from './locale.utils.js';
|
|
6
|
-
import { d as defineCustomElement$5 } from './mg-character-left2.js';
|
|
7
6
|
import { d as defineCustomElement$4 } from './mg-icon2.js';
|
|
8
7
|
import { d as defineCustomElement$3 } from './mg-input-title2.js';
|
|
9
8
|
import { d as defineCustomElement$2 } from './mg-tooltip2.js';
|
|
@@ -20,7 +19,7 @@ var InputError;
|
|
|
20
19
|
InputError["REQUIRED"] = "required";
|
|
21
20
|
})(InputError || (InputError = {}));
|
|
22
21
|
|
|
23
|
-
const mgInputNumericCss = ":host{display:block}.mg-input{display
|
|
22
|
+
const mgInputNumericCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.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}.mg-input .mg-input__box{text-align:var(--mg-inputs-text-align, right)}";
|
|
24
23
|
|
|
25
24
|
const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
26
25
|
constructor() {
|
|
@@ -29,8 +28,8 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
29
28
|
this.__attachShadow();
|
|
30
29
|
this.valueChange = createEvent(this, "value-change", 7);
|
|
31
30
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
32
|
-
//
|
|
33
|
-
this.
|
|
31
|
+
// hasError (triggered by blur event)
|
|
32
|
+
this.hasError = false;
|
|
34
33
|
/**
|
|
35
34
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
36
35
|
* If not set, it will be created.
|
|
@@ -61,6 +60,10 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
61
60
|
* Define numeric type
|
|
62
61
|
*/
|
|
63
62
|
this.type = types[0];
|
|
63
|
+
/**
|
|
64
|
+
* Define currency
|
|
65
|
+
*/
|
|
66
|
+
this.currency = 'USD';
|
|
64
67
|
/**
|
|
65
68
|
* Override integer length
|
|
66
69
|
* integer is the number before the decimal point
|
|
@@ -87,6 +90,9 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
87
90
|
this.handleInput = () => {
|
|
88
91
|
// Check validity
|
|
89
92
|
this.checkValidity();
|
|
93
|
+
if (this.hasError) {
|
|
94
|
+
this.checkError();
|
|
95
|
+
}
|
|
90
96
|
this.value = this.input.value;
|
|
91
97
|
};
|
|
92
98
|
/**
|
|
@@ -103,9 +109,8 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
103
109
|
* @returns {void}
|
|
104
110
|
*/
|
|
105
111
|
this.handleBlur = () => {
|
|
106
|
-
//
|
|
107
|
-
this.
|
|
108
|
-
this.checkError();
|
|
112
|
+
// Display Error
|
|
113
|
+
this.displayError();
|
|
109
114
|
this.hasFocus = false;
|
|
110
115
|
};
|
|
111
116
|
/**
|
|
@@ -131,10 +136,10 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
131
136
|
this.setErrorMessage = () => {
|
|
132
137
|
const inputError = this.getInputError();
|
|
133
138
|
if (inputError === InputError.REQUIRED) {
|
|
134
|
-
this.errorMessage = messages.errors[inputError];
|
|
139
|
+
this.errorMessage = this.messages.errors[inputError];
|
|
135
140
|
}
|
|
136
141
|
else {
|
|
137
|
-
this.errorMessage = messages.errors.numeric[inputError].replace('{min}', `${this.formatValue(this.min)}`).replace('{max}', `${this.formatValue(this.max)}`);
|
|
142
|
+
this.errorMessage = this.messages.errors.numeric[inputError].replace('{min}', `${this.formatValue(this.min)}`).replace('{max}', `${this.formatValue(this.max)}`);
|
|
138
143
|
}
|
|
139
144
|
};
|
|
140
145
|
/**
|
|
@@ -148,10 +153,6 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
148
153
|
// Update class
|
|
149
154
|
if (!this.valid) {
|
|
150
155
|
this.setErrorMessage();
|
|
151
|
-
this.classList.add(this.classError);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
this.classList.delete(this.classError);
|
|
155
156
|
}
|
|
156
157
|
};
|
|
157
158
|
/**
|
|
@@ -188,7 +189,7 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
188
189
|
* @param {number} value value to format
|
|
189
190
|
* @returns {string} formated local value
|
|
190
191
|
*/
|
|
191
|
-
this.formatValue = (value) => (this.type === 'currency' ? localeCurrency(value) : localeNumber(value));
|
|
192
|
+
this.formatValue = (value) => (this.type === 'currency' ? localeCurrency(value, this.locale, this.currency) : localeNumber(value, this.locale));
|
|
192
193
|
/**
|
|
193
194
|
* Validate append slot
|
|
194
195
|
*
|
|
@@ -224,7 +225,7 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
224
225
|
// emit numeric value
|
|
225
226
|
this.numericValue = this.value !== '' && this.value !== null ? parseFloat(this.value.replace(',', '.')) : null;
|
|
226
227
|
this.valueChange.emit(this.numericValue);
|
|
227
|
-
// Set
|
|
228
|
+
// Set readonlyValue
|
|
228
229
|
this.readonlyValue = this.numericValue !== null ? this.formatValue(this.numericValue) : '';
|
|
229
230
|
}
|
|
230
231
|
}
|
|
@@ -232,7 +233,6 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
232
233
|
if (!types.includes(newValue)) {
|
|
233
234
|
throw new Error(`<mg-input-numeric> prop "type" must be one of : ${types.join(', ')}`);
|
|
234
235
|
}
|
|
235
|
-
this.classList.add(`mg-input--numeric--${this.type}`);
|
|
236
236
|
}
|
|
237
237
|
validateIntegerLength(newValue) {
|
|
238
238
|
if (newValue < 1) {
|
|
@@ -252,6 +252,7 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
252
252
|
async displayError() {
|
|
253
253
|
this.checkValidity();
|
|
254
254
|
this.checkError();
|
|
255
|
+
this.hasError = this.invalid;
|
|
255
256
|
}
|
|
256
257
|
/**
|
|
257
258
|
* Displayed value in input
|
|
@@ -271,6 +272,11 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
271
272
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
272
273
|
*/
|
|
273
274
|
componentWillLoad() {
|
|
275
|
+
// Get locales
|
|
276
|
+
const locales = initLocales(this.element);
|
|
277
|
+
this.locale = locales.locale;
|
|
278
|
+
this.messages = locales.messages;
|
|
279
|
+
// Validate
|
|
274
280
|
this.validateValue(this.value);
|
|
275
281
|
this.validateType(this.type);
|
|
276
282
|
this.validateIntegerLength(this.integerLength);
|
|
@@ -289,7 +295,7 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
289
295
|
* @returns {HTMLElement} HTML Element
|
|
290
296
|
*/
|
|
291
297
|
render() {
|
|
292
|
-
return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly,
|
|
298
|
+
return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "text", class: "mg-input__box", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: el => (this.input = el) }), h("slot", { name: "append-input" })));
|
|
293
299
|
}
|
|
294
300
|
get element() { return this; }
|
|
295
301
|
static get watchers() { return {
|
|
@@ -310,10 +316,11 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
310
316
|
"required": [4],
|
|
311
317
|
"readonly": [4],
|
|
312
318
|
"disabled": [4],
|
|
313
|
-
"
|
|
319
|
+
"mgWidth": [8, "mg-width"],
|
|
314
320
|
"tooltip": [1],
|
|
315
321
|
"helpText": [1, "help-text"],
|
|
316
322
|
"type": [1],
|
|
323
|
+
"currency": [1],
|
|
317
324
|
"max": [2],
|
|
318
325
|
"min": [2],
|
|
319
326
|
"integerLength": [2, "integer-length"],
|
|
@@ -329,18 +336,13 @@ function defineCustomElement$1() {
|
|
|
329
336
|
if (typeof customElements === "undefined") {
|
|
330
337
|
return;
|
|
331
338
|
}
|
|
332
|
-
const components = ["mg-input-numeric", "mg-
|
|
339
|
+
const components = ["mg-input-numeric", "mg-icon", "mg-input-title", "mg-tooltip"];
|
|
333
340
|
components.forEach(tagName => { switch (tagName) {
|
|
334
341
|
case "mg-input-numeric":
|
|
335
342
|
if (!customElements.get(tagName)) {
|
|
336
343
|
customElements.define(tagName, MgInputNumeric$1);
|
|
337
344
|
}
|
|
338
345
|
break;
|
|
339
|
-
case "mg-character-left":
|
|
340
|
-
if (!customElements.get(tagName)) {
|
|
341
|
-
defineCustomElement$5();
|
|
342
|
-
}
|
|
343
|
-
break;
|
|
344
346
|
case "mg-icon":
|
|
345
347
|
if (!customElements.get(tagName)) {
|
|
346
348
|
defineCustomElement$4();
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { M as MgInput } from './MgInput.js';
|
|
3
3
|
import { c as createID, C as ClassList } from './components.utils.js';
|
|
4
|
-
import {
|
|
5
|
-
import { d as defineCustomElement$5 } from './mg-character-left2.js';
|
|
4
|
+
import { i as initLocales } from './index2.js';
|
|
6
5
|
import { d as defineCustomElement$4 } from './mg-icon2.js';
|
|
7
6
|
import { d as defineCustomElement$3 } from './mg-input-title2.js';
|
|
8
7
|
import { d as defineCustomElement$2 } from './mg-tooltip2.js';
|
|
9
8
|
|
|
10
|
-
const mgInputPasswordCss = ":host{display:block}.mg-input{display
|
|
9
|
+
const mgInputPasswordCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.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}";
|
|
11
10
|
|
|
12
11
|
const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
13
12
|
constructor() {
|
|
@@ -16,11 +15,8 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
16
15
|
this.__attachShadow();
|
|
17
16
|
this.valueChange = createEvent(this, "value-change", 7);
|
|
18
17
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
************/
|
|
22
|
-
// classes
|
|
23
|
-
this.classError = InputClass.ERROR;
|
|
18
|
+
// hasError (triggered by blur event)
|
|
19
|
+
this.hasError = false;
|
|
24
20
|
/**
|
|
25
21
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
26
22
|
* If not set, it will be created.
|
|
@@ -50,7 +46,7 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
50
46
|
/**
|
|
51
47
|
* Define input width
|
|
52
48
|
*/
|
|
53
|
-
this.
|
|
49
|
+
this.mgWidth = 'full';
|
|
54
50
|
/**
|
|
55
51
|
* Component classes
|
|
56
52
|
*/
|
|
@@ -60,14 +56,16 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
60
56
|
*/
|
|
61
57
|
this.handleInput = () => {
|
|
62
58
|
this.checkValidity();
|
|
59
|
+
if (this.hasError) {
|
|
60
|
+
this.checkError();
|
|
61
|
+
}
|
|
63
62
|
this.value = this.input.value;
|
|
64
63
|
};
|
|
65
64
|
/**
|
|
66
65
|
* Handle blur event
|
|
67
66
|
*/
|
|
68
67
|
this.handleBlur = () => {
|
|
69
|
-
this.
|
|
70
|
-
this.checkError();
|
|
68
|
+
this.displayError();
|
|
71
69
|
};
|
|
72
70
|
/**
|
|
73
71
|
* Check if input is valid
|
|
@@ -90,14 +88,7 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
90
88
|
this.errorMessage = undefined;
|
|
91
89
|
// required
|
|
92
90
|
if (!this.valid && this.input.validity.valueMissing) {
|
|
93
|
-
this.errorMessage = messages.errors.required;
|
|
94
|
-
}
|
|
95
|
-
// Update class
|
|
96
|
-
if (this.valid) {
|
|
97
|
-
this.classList.delete(this.classError);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
this.classList.add(this.classError);
|
|
91
|
+
this.errorMessage = this.messages.errors.required;
|
|
101
92
|
}
|
|
102
93
|
};
|
|
103
94
|
}
|
|
@@ -112,6 +103,7 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
112
103
|
async displayError() {
|
|
113
104
|
this.checkValidity();
|
|
114
105
|
this.checkError();
|
|
106
|
+
this.hasError = this.invalid;
|
|
115
107
|
}
|
|
116
108
|
/*************
|
|
117
109
|
* Lifecycle *
|
|
@@ -122,6 +114,8 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
122
114
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
123
115
|
*/
|
|
124
116
|
componentWillLoad() {
|
|
117
|
+
// Get locales
|
|
118
|
+
this.messages = initLocales(this.element).messages;
|
|
125
119
|
// Check validity when component is ready
|
|
126
120
|
// return a promise to process action only in the FIRST render().
|
|
127
121
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
@@ -135,8 +129,9 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
135
129
|
* @returns {HTMLElement} HTML Element
|
|
136
130
|
*/
|
|
137
131
|
render() {
|
|
138
|
-
return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly,
|
|
132
|
+
return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.value !== undefined ? '•'.repeat(this.value.length) : undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("input", { type: "password", class: "mg-input__box", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => (this.input = el) })));
|
|
139
133
|
}
|
|
134
|
+
get element() { return this; }
|
|
140
135
|
static get watchers() { return {
|
|
141
136
|
"value": ["handleValue"]
|
|
142
137
|
}; }
|
|
@@ -152,7 +147,7 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
152
147
|
"required": [4],
|
|
153
148
|
"readonly": [4],
|
|
154
149
|
"disabled": [4],
|
|
155
|
-
"
|
|
150
|
+
"mgWidth": [8, "mg-width"],
|
|
156
151
|
"tooltip": [1],
|
|
157
152
|
"helpText": [1, "help-text"],
|
|
158
153
|
"valid": [1028],
|
|
@@ -165,18 +160,13 @@ function defineCustomElement$1() {
|
|
|
165
160
|
if (typeof customElements === "undefined") {
|
|
166
161
|
return;
|
|
167
162
|
}
|
|
168
|
-
const components = ["mg-input-password", "mg-
|
|
163
|
+
const components = ["mg-input-password", "mg-icon", "mg-input-title", "mg-tooltip"];
|
|
169
164
|
components.forEach(tagName => { switch (tagName) {
|
|
170
165
|
case "mg-input-password":
|
|
171
166
|
if (!customElements.get(tagName)) {
|
|
172
167
|
customElements.define(tagName, MgInputPassword$1);
|
|
173
168
|
}
|
|
174
169
|
break;
|
|
175
|
-
case "mg-character-left":
|
|
176
|
-
if (!customElements.get(tagName)) {
|
|
177
|
-
defineCustomElement$5();
|
|
178
|
-
}
|
|
179
|
-
break;
|
|
180
170
|
case "mg-icon":
|
|
181
171
|
if (!customElements.get(tagName)) {
|
|
182
172
|
defineCustomElement$4();
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { M as MgInput } from './MgInput.js';
|
|
3
3
|
import { c as createID, C as ClassList, a as allItemsAreString } from './components.utils.js';
|
|
4
|
-
import {
|
|
5
|
-
import { d as defineCustomElement$5 } from './mg-character-left2.js';
|
|
4
|
+
import { i as initLocales } from './index2.js';
|
|
6
5
|
import { d as defineCustomElement$4 } from './mg-icon2.js';
|
|
7
6
|
import { d as defineCustomElement$3 } from './mg-input-title2.js';
|
|
8
7
|
import { d as defineCustomElement$2 } from './mg-tooltip2.js';
|
|
9
8
|
|
|
10
|
-
const mgInputRadioCss = ":host{display:block}.mg-input{display
|
|
9
|
+
const mgInputRadioCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.mg-input__input-group.mg-input__input-group--disabled label{opacity:0.3}.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}";
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* type Option validation function
|
|
@@ -26,8 +25,6 @@ const MgInputRadio$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
26
25
|
/************
|
|
27
26
|
* Internal *
|
|
28
27
|
************/
|
|
29
|
-
// classes
|
|
30
|
-
this.classError = InputClass.ERROR;
|
|
31
28
|
// HTML selector
|
|
32
29
|
this.inputs = [];
|
|
33
30
|
/**
|
|
@@ -112,14 +109,7 @@ const MgInputRadio$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
112
109
|
// Set error message
|
|
113
110
|
this.errorMessage = undefined;
|
|
114
111
|
if (!this.valid && invalidElement.validity.valueMissing) {
|
|
115
|
-
this.errorMessage = messages.errors.required;
|
|
116
|
-
}
|
|
117
|
-
// Update class
|
|
118
|
-
if (this.valid) {
|
|
119
|
-
this.classList.delete(this.classError);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
this.classList.add(this.classError);
|
|
112
|
+
this.errorMessage = this.messages.errors.required;
|
|
123
113
|
}
|
|
124
114
|
};
|
|
125
115
|
/**
|
|
@@ -167,7 +157,9 @@ const MgInputRadio$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
167
157
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
168
158
|
*/
|
|
169
159
|
componentWillLoad() {
|
|
170
|
-
//
|
|
160
|
+
// Get locales
|
|
161
|
+
this.messages = initLocales(this.element).messages;
|
|
162
|
+
// Validate
|
|
171
163
|
this.validateItems(this.items);
|
|
172
164
|
// Check validity when component is ready
|
|
173
165
|
// return a promise to process action only in the FIRST render().
|
|
@@ -182,8 +174,9 @@ const MgInputRadio$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
182
174
|
* @returns {HTMLElement} HTML Element
|
|
183
175
|
*/
|
|
184
176
|
render() {
|
|
185
|
-
return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly,
|
|
177
|
+
return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, disabled: this.disabled, readonly: this.readonly, mgWidth: undefined, value: this.value, readonlyValue: this.value, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: true }, h("ul", { class: { 'mg-input__input-group-container': true, 'mg-input__input-group-container--vertical': this.inputVerticalList } }, this.options.map((input, index) => (h("li", { class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: el => this.inputs.push(el) }), h("label", { htmlFor: this.identifier + '_' + index }, input.title)))))));
|
|
186
178
|
}
|
|
179
|
+
get element() { return this; }
|
|
187
180
|
static get watchers() { return {
|
|
188
181
|
"value": ["handleValue"],
|
|
189
182
|
"items": ["validateItems"]
|
|
@@ -214,18 +207,13 @@ function defineCustomElement$1() {
|
|
|
214
207
|
if (typeof customElements === "undefined") {
|
|
215
208
|
return;
|
|
216
209
|
}
|
|
217
|
-
const components = ["mg-input-radio", "mg-
|
|
210
|
+
const components = ["mg-input-radio", "mg-icon", "mg-input-title", "mg-tooltip"];
|
|
218
211
|
components.forEach(tagName => { switch (tagName) {
|
|
219
212
|
case "mg-input-radio":
|
|
220
213
|
if (!customElements.get(tagName)) {
|
|
221
214
|
customElements.define(tagName, MgInputRadio$1);
|
|
222
215
|
}
|
|
223
216
|
break;
|
|
224
|
-
case "mg-character-left":
|
|
225
|
-
if (!customElements.get(tagName)) {
|
|
226
|
-
defineCustomElement$5();
|
|
227
|
-
}
|
|
228
|
-
break;
|
|
229
217
|
case "mg-icon":
|
|
230
218
|
if (!customElements.get(tagName)) {
|
|
231
219
|
defineCustomElement$4();
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { M as MgInput } from './MgInput.js';
|
|
3
3
|
import { c as createID, C as ClassList, a as allItemsAreString } from './components.utils.js';
|
|
4
|
-
import {
|
|
5
|
-
import { d as defineCustomElement$4 } from './mg-character-left2.js';
|
|
4
|
+
import { i as initLocales } from './index2.js';
|
|
6
5
|
import { d as defineCustomElement$3 } from './mg-icon2.js';
|
|
7
6
|
import { d as defineCustomElement$2 } from './mg-input-title2.js';
|
|
8
7
|
import { d as defineCustomElement$1 } from './mg-tooltip2.js';
|
|
9
8
|
|
|
10
|
-
const mgInputSelectCss = ":host{display:block}.mg-input{display
|
|
9
|
+
const mgInputSelectCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container mg-icon{display:flex}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.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}.mg-input__box{width:100%;padding-top:0;padding-bottom:0;padding-right:1rem}";
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Check if item is a well configured option
|
|
@@ -15,7 +14,7 @@ const mgInputSelectCss = ":host{display:block}.mg-input{display:-ms-flexbox;disp
|
|
|
15
14
|
* @param {SelectOption} option select option
|
|
16
15
|
* @returns {boolean} select option type is valid
|
|
17
16
|
*/
|
|
18
|
-
const isOption = (option) => typeof option === 'object' && typeof option.title === 'string'
|
|
17
|
+
const isOption = (option) => typeof option === 'object' && typeof option.title === 'string';
|
|
19
18
|
/**
|
|
20
19
|
* Group options
|
|
21
20
|
*
|
|
@@ -52,11 +51,8 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
52
51
|
this.__attachShadow();
|
|
53
52
|
this.valueChange = createEvent(this, "value-change", 7);
|
|
54
53
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
************/
|
|
58
|
-
// classes
|
|
59
|
-
this.classError = InputClass.ERROR;
|
|
54
|
+
// hasError (triggered by blur event)
|
|
55
|
+
this.hasError = false;
|
|
60
56
|
/**
|
|
61
57
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
62
58
|
* If not set, it will be created.
|
|
@@ -71,11 +67,6 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
71
67
|
* Define if label is visible
|
|
72
68
|
*/
|
|
73
69
|
this.labelHide = false;
|
|
74
|
-
/**
|
|
75
|
-
* Input placeholder.
|
|
76
|
-
* It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.
|
|
77
|
-
*/
|
|
78
|
-
this.placeholder = messages.input.select.placeholder;
|
|
79
70
|
/**
|
|
80
71
|
* Option to remove placeholder
|
|
81
72
|
*/
|
|
@@ -105,6 +96,9 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
105
96
|
*/
|
|
106
97
|
this.handleInput = () => {
|
|
107
98
|
this.checkValidity();
|
|
99
|
+
if (this.hasError) {
|
|
100
|
+
this.checkError();
|
|
101
|
+
}
|
|
108
102
|
if (this.input.value !== '') {
|
|
109
103
|
this.value = allItemsAreString(this.items) ? this.input.value : this.items.find(item => item.title === this.input.value).value;
|
|
110
104
|
}
|
|
@@ -116,8 +110,7 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
116
110
|
* Handle blur event
|
|
117
111
|
*/
|
|
118
112
|
this.handleBlur = () => {
|
|
119
|
-
this.
|
|
120
|
-
this.checkError();
|
|
113
|
+
this.displayError();
|
|
121
114
|
};
|
|
122
115
|
/**
|
|
123
116
|
* Check if input is valid
|
|
@@ -139,14 +132,7 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
139
132
|
// Set error message
|
|
140
133
|
this.errorMessage = undefined;
|
|
141
134
|
if (!this.valid && this.input.validity.valueMissing) {
|
|
142
|
-
this.errorMessage = messages.errors.required;
|
|
143
|
-
}
|
|
144
|
-
// Update class
|
|
145
|
-
if (this.valid) {
|
|
146
|
-
this.classList.delete(this.classError);
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
this.classList.add(this.classError);
|
|
135
|
+
this.errorMessage = this.messages.errors.required;
|
|
150
136
|
}
|
|
151
137
|
};
|
|
152
138
|
}
|
|
@@ -189,6 +175,7 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
189
175
|
async displayError() {
|
|
190
176
|
this.checkValidity();
|
|
191
177
|
this.checkError();
|
|
178
|
+
this.hasError = this.invalid;
|
|
192
179
|
}
|
|
193
180
|
/*************
|
|
194
181
|
* Lifecycle *
|
|
@@ -199,8 +186,14 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
199
186
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
200
187
|
*/
|
|
201
188
|
componentWillLoad() {
|
|
202
|
-
//
|
|
189
|
+
// Get locales
|
|
190
|
+
this.messages = initLocales(this.element).messages;
|
|
191
|
+
// Validate
|
|
203
192
|
this.validateItems(this.items);
|
|
193
|
+
// Set default placeholder
|
|
194
|
+
if (this.placeholder === undefined || this.placeholder === '') {
|
|
195
|
+
this.placeholder = this.messages.input.select.placeholder;
|
|
196
|
+
}
|
|
204
197
|
// Check validity when component is ready
|
|
205
198
|
// return a promise to process action only in the FIRST render().
|
|
206
199
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
@@ -214,9 +207,10 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
214
207
|
* @returns {HTMLElement} HTML Element
|
|
215
208
|
*/
|
|
216
209
|
render() {
|
|
217
|
-
return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly,
|
|
210
|
+
return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly, mgWidth: this.mgWidth, disabled: this.disabled, value: this.value, readonlyValue: this.readonlyValue, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false }, h("select", { class: "mg-input__box", id: this.identifier, name: this.name, title: this.placeholder, disabled: this.disabled, required: this.required, onInput: this.handleInput, onBlur: this.handleBlur, ref: el => (this.input = el) }, (!this.placeholderHide || !this.valueExist) && ( // In case passed value does not match any option we display the placeholder
|
|
218
211
|
h("option", { value: "", disabled: this.placeholderDisabled && this.valueExist }, this.placeholder)), this.options.map(option => option.group !== undefined ? (h("optgroup", { label: option.group }, option.options.map(optgroup => (h("option", { value: optgroup.title, selected: JSON.stringify(this.value) === JSON.stringify(optgroup.value), disabled: optgroup.disabled }, optgroup.title))))) : (h("option", { value: option.title, selected: JSON.stringify(this.value) === JSON.stringify(option.value), disabled: option.disabled }, option.title))))));
|
|
219
212
|
}
|
|
213
|
+
get element() { return this; }
|
|
220
214
|
static get watchers() { return {
|
|
221
215
|
"value": ["handleValue"],
|
|
222
216
|
"items": ["validateItems"]
|
|
@@ -230,13 +224,13 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
230
224
|
"label": [1],
|
|
231
225
|
"labelOnTop": [4, "label-on-top"],
|
|
232
226
|
"labelHide": [4, "label-hide"],
|
|
233
|
-
"placeholder": [
|
|
227
|
+
"placeholder": [1025],
|
|
234
228
|
"placeholderHide": [4, "placeholder-hide"],
|
|
235
229
|
"placeholderDisabled": [4, "placeholder-disabled"],
|
|
236
230
|
"required": [4],
|
|
237
231
|
"readonly": [4],
|
|
238
232
|
"disabled": [4],
|
|
239
|
-
"
|
|
233
|
+
"mgWidth": [8, "mg-width"],
|
|
240
234
|
"tooltip": [1],
|
|
241
235
|
"helpText": [1, "help-text"],
|
|
242
236
|
"valid": [1028],
|
|
@@ -252,18 +246,13 @@ function defineCustomElement() {
|
|
|
252
246
|
if (typeof customElements === "undefined") {
|
|
253
247
|
return;
|
|
254
248
|
}
|
|
255
|
-
const components = ["mg-input-select", "mg-
|
|
249
|
+
const components = ["mg-input-select", "mg-icon", "mg-input-title", "mg-tooltip"];
|
|
256
250
|
components.forEach(tagName => { switch (tagName) {
|
|
257
251
|
case "mg-input-select":
|
|
258
252
|
if (!customElements.get(tagName)) {
|
|
259
253
|
customElements.define(tagName, MgInputSelect);
|
|
260
254
|
}
|
|
261
255
|
break;
|
|
262
|
-
case "mg-character-left":
|
|
263
|
-
if (!customElements.get(tagName)) {
|
|
264
|
-
defineCustomElement$4();
|
|
265
|
-
}
|
|
266
|
-
break;
|
|
267
256
|
case "mg-icon":
|
|
268
257
|
if (!customElements.get(tagName)) {
|
|
269
258
|
defineCustomElement$3();
|