@mgdis/mg-components 3.2.0 → 4.0.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/{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 +519 -294
- 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 -10
- 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.conf.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +20 -32
- package/dist/collection/components/atoms/mg-button/mg-button.js +8 -3
- 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 +97 -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 +66 -39
- 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 +10 -4
- 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 +12 -5
- 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} +9 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +13 -4
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +119 -18
- 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 -9
- package/dist/collection/components/molecules/mg-tabs/{mg-tabs.stories.js → doc/mg-tabs.stories.js} +12 -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 +92 -27
- 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 +9 -4
- package/dist/collection/variables.scss +9 -4
- 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 +10 -5
- package/dist/components/mg-character-left2.js +4 -27
- package/dist/components/mg-form.js +6 -4
- package/dist/components/mg-icon2.js +120 -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 +44 -21
- 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 +51 -17
- package/dist/components/mg-popover.js +13 -8
- package/dist/components/mg-tabs.js +80 -22
- 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 +516 -291
- 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 -10
- 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-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-766c918b.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 +9 -4
- package/dist/mg-components/variables.scss +9 -4
- 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/doc/mg-input-textarea.stories.d.ts +19 -0
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +15 -7
- 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/{inputs/mg-input-textarea/mg-input-textarea.stories.d.ts → mg-panel/doc/mg-panel.stories.d.ts} +1 -1
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +29 -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} +5 -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 +49 -0
- package/dist/types/components.d.ts +181 -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 +14 -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-3633e9e1.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-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-c46fbd54.entry.js +0 -1
- package/dist/mg-components/p-c90cc4bf.system.js +0 -1
- package/dist/mg-components/p-cd2a4acc.system.entry.js +0 -1
- package/dist/mg-components/p-de1164fa.system.entry.js +0 -1
- package/dist/mg-components/p-dfe25da3.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-panel/mg-panel.stories.d.ts +0 -6
- 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
|
@@ -2,6 +2,12 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
export default {
|
|
3
3
|
component: 'mg-input-text',
|
|
4
4
|
title: 'Molecules/Inputs/mg-input-text',
|
|
5
|
+
argTypes: {
|
|
6
|
+
mgWidth: {
|
|
7
|
+
options: [2, 4, 16, 'full'],
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
},
|
|
10
|
+
},
|
|
5
11
|
parameters: { actions: { handles: ['value-change', 'input-valid'] } },
|
|
6
12
|
};
|
|
7
13
|
/**
|
|
@@ -21,12 +27,12 @@ const Template = (args) => {
|
|
|
21
27
|
delete args.patternErrorMessage;
|
|
22
28
|
const displayCharacterLeft = args.displayCharacterLeft;
|
|
23
29
|
delete args.displayCharacterLeft;
|
|
24
|
-
const characterLeftTemplate = args.characterLeftTemplate;
|
|
25
|
-
delete args.characterLeftTemplate;
|
|
26
30
|
const helpText = args.helpText;
|
|
27
31
|
delete args.helpText;
|
|
32
|
+
const mgWidth = args.mgWidth;
|
|
33
|
+
delete args.mgWidth;
|
|
28
34
|
// return element
|
|
29
|
-
return (h("mg-input-text", Object.assign({}, args, { "label-on-top": labelOnTop, "label-hide": labelHide, "pattern-error-message": patternErrorMessage, "display-character-left": displayCharacterLeft ? 'true' : 'false', "
|
|
35
|
+
return (h("mg-input-text", Object.assign({}, args, { "label-on-top": labelOnTop, "label-hide": labelHide, "pattern-error-message": patternErrorMessage, "display-character-left": displayCharacterLeft ? 'true' : 'false', "help-text": helpText, "mg-width": mgWidth })));
|
|
30
36
|
};
|
|
31
37
|
/**
|
|
32
38
|
* Global use
|
|
@@ -49,11 +55,11 @@ MgInputText.args = {
|
|
|
49
55
|
readonly: false,
|
|
50
56
|
pattern: undefined,
|
|
51
57
|
patternErrorMessage: undefined,
|
|
58
|
+
mgWidth: 'full',
|
|
52
59
|
// Tooltip
|
|
53
60
|
tooltip: 'This is a tooltip',
|
|
54
61
|
// Nb Char Left
|
|
55
62
|
displayCharacterLeft: true,
|
|
56
|
-
characterLeftTemplate: '{counter} characters left.',
|
|
57
63
|
// Help Text
|
|
58
64
|
helpText: 'Help text with html <strong>bold</strong>, <em>italic</em>.',
|
|
59
65
|
};
|
|
@@ -107,11 +113,9 @@ const SearchTemplate = args => {
|
|
|
107
113
|
delete args.patternErrorMessage;
|
|
108
114
|
const displayCharacterLeft = args.displayCharacterLeft;
|
|
109
115
|
delete args.displayCharacterLeft;
|
|
110
|
-
const characterLeftTemplate = args.characterLeftTemplate;
|
|
111
|
-
delete args.characterLeftTemplate;
|
|
112
116
|
// return element
|
|
113
117
|
return (h("form", { role: "search" },
|
|
114
|
-
h("mg-input-text", Object.assign({}, args, { "label-on-top": labelOnTop, "label-hide": labelHide, "pattern-error-message": patternErrorMessage, "display-character-left": displayCharacterLeft
|
|
118
|
+
h("mg-input-text", Object.assign({}, args, { "label-on-top": labelOnTop, "label-hide": labelHide, "pattern-error-message": patternErrorMessage, "display-character-left": displayCharacterLeft }),
|
|
115
119
|
h("mg-button", { slot: "append-input", label: "search" },
|
|
116
120
|
h("mg-icon", { icon: "magnifying-glass" }),
|
|
117
121
|
" Search"))));
|
|
@@ -11,16 +11,9 @@
|
|
|
11
11
|
min-height: var(--default-size);
|
|
12
12
|
max-width: 100%;
|
|
13
13
|
margin-bottom: var(--mg-inputs-margin-bottom, 0);
|
|
14
|
-
/* Style when input is not valid */
|
|
15
14
|
/* Label */
|
|
16
15
|
/* Label-on-top */
|
|
17
16
|
}
|
|
18
|
-
.mg-input.is-not-valid {
|
|
19
|
-
color: hsl(var(--color-danger));
|
|
20
|
-
}
|
|
21
|
-
.mg-input.is-not-valid .mg-input__box {
|
|
22
|
-
border-color: hsl(var(--color-danger));
|
|
23
|
-
}
|
|
24
17
|
.mg-input mg-input-title {
|
|
25
18
|
flex-shrink: var(--mg-inputs-shrink, 1);
|
|
26
19
|
width: var(--mg-inputs-title-width, auto);
|
|
@@ -74,6 +67,11 @@
|
|
|
74
67
|
.mg-input__input-container mg-icon {
|
|
75
68
|
display: flex;
|
|
76
69
|
}
|
|
70
|
+
.mg-input__input-container .mg-input__help-text,
|
|
71
|
+
.mg-input__input-container .mg-input__error {
|
|
72
|
+
text-align: start;
|
|
73
|
+
font-size: 1.2rem;
|
|
74
|
+
}
|
|
77
75
|
|
|
78
76
|
.mg-input__input {
|
|
79
77
|
display: flex;
|
|
@@ -82,11 +80,22 @@
|
|
|
82
80
|
.mg-input__input mg-tooltip {
|
|
83
81
|
margin-top: calc((var(--default-size) - var(--mg-icon-regular-size)) / 2);
|
|
84
82
|
}
|
|
85
|
-
.mg-input__input
|
|
86
|
-
|
|
83
|
+
.mg-input__input.mg-input__input--has-error .mg-input__box {
|
|
84
|
+
border-color: hsl(var(--color-danger));
|
|
85
|
+
}
|
|
86
|
+
.mg-input__input + .mg-input__help-text, .mg-input__input + .mg-input__error {
|
|
87
87
|
margin-top: 0.5rem;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
.mg-input__error {
|
|
91
|
+
display: inline-block;
|
|
92
|
+
margin-top: 0.2rem;
|
|
93
|
+
padding: 0.3rem 0.8rem;
|
|
94
|
+
border-radius: 0.3rem;
|
|
95
|
+
background: hsl(var(--mg-inputs-error-bg-color));
|
|
96
|
+
color: hsl(var(--color-danger));
|
|
97
|
+
}
|
|
98
|
+
|
|
90
99
|
/**
|
|
91
100
|
* Style for input "box":
|
|
92
101
|
* - input[type="text"]
|
|
@@ -97,7 +106,6 @@
|
|
|
97
106
|
*/
|
|
98
107
|
.mg-input__box {
|
|
99
108
|
padding: calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);
|
|
100
|
-
width: 100%;
|
|
101
109
|
height: var(--default-size);
|
|
102
110
|
box-sizing: border-box;
|
|
103
111
|
border-width: var(--mg-inputs-border-width);
|
|
@@ -108,6 +116,7 @@
|
|
|
108
116
|
font-family: inherit;
|
|
109
117
|
color: hsl(var(--color-dark));
|
|
110
118
|
font-size: var(--font-size);
|
|
119
|
+
text-align: var(--mg-inputs-text-align, left);
|
|
111
120
|
}
|
|
112
121
|
.mg-input__box::placeholder {
|
|
113
122
|
color: var(--mg-inputs-color);
|
|
@@ -155,10 +164,6 @@
|
|
|
155
164
|
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]) {
|
|
156
165
|
--mg-button-border-radius-top-right: 0;
|
|
157
166
|
--mg-button-border-radius-bottom-right: 0;
|
|
158
|
-
--mg-button-border-radius-top-left: 0;
|
|
159
|
-
/* IE FIX */
|
|
160
|
-
--mg-button-border-radius-bottom-left: 0;
|
|
161
|
-
/* IE FIX */
|
|
162
167
|
}
|
|
163
168
|
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)) {
|
|
164
169
|
--mg-button-border-right-width: 0;
|
|
@@ -166,10 +171,6 @@
|
|
|
166
171
|
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type) {
|
|
167
172
|
--mg-button-border-radius-top-right: var(--mg-inputs-border-radius);
|
|
168
173
|
--mg-button-border-radius-bottom-right: var(--mg-inputs-border-radius);
|
|
169
|
-
--mg-button-border-radius-top-left: 0;
|
|
170
|
-
/* IE FIX */
|
|
171
|
-
--mg-button-border-radius-bottom-left: 0;
|
|
172
|
-
/* IE FIX */
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]) {
|
|
@@ -201,13 +202,14 @@
|
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
/**
|
|
204
|
-
*
|
|
205
|
+
* Set mg-character-left with inputs
|
|
205
206
|
*/
|
|
206
207
|
.mg-input mg-character-left {
|
|
207
|
-
|
|
208
|
+
opacity: 0.6;
|
|
209
|
+
font-size: 1.1rem;
|
|
208
210
|
}
|
|
209
|
-
.mg-input.
|
|
210
|
-
|
|
211
|
+
.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 {
|
|
212
|
+
margin-top: 0;
|
|
211
213
|
}
|
|
212
214
|
|
|
213
215
|
/**
|
|
@@ -234,16 +236,37 @@
|
|
|
234
236
|
/**
|
|
235
237
|
* Icon in input
|
|
236
238
|
*/
|
|
237
|
-
.mg-input.mg-input--has-icon .mg-
|
|
238
|
-
position: relative;
|
|
239
|
-
}
|
|
240
|
-
.mg-input.mg-input--has-icon .mg-input__input > mg-icon {
|
|
239
|
+
.mg-input.mg-input--has-icon .mg-input__with-character-left > mg-icon {
|
|
241
240
|
position: absolute;
|
|
242
|
-
top:
|
|
241
|
+
top: 50%;
|
|
243
242
|
left: var(--mg-inputs-spacer);
|
|
244
243
|
color: var(--mg-inputs-color);
|
|
245
244
|
transform: translateY(-50%);
|
|
246
245
|
}
|
|
247
|
-
.mg-input.mg-input--has-icon .mg-
|
|
246
|
+
.mg-input.mg-input--has-icon .mg-input__with-character-left .mg-input__box {
|
|
248
247
|
padding-left: calc(var(--mg-icon-regular-size) + var(--mg-inputs-spacer) * 2);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Character left
|
|
252
|
+
*/
|
|
253
|
+
.mg-input__with-character-left {
|
|
254
|
+
position: relative;
|
|
255
|
+
display: inline-flex;
|
|
256
|
+
width: 100%;
|
|
257
|
+
}
|
|
258
|
+
.mg-input.is-focused .mg-input__with-character-left .mg-input__box {
|
|
259
|
+
padding-right: calc(var(--mg-character-left-message-length) * 1ch + 0.8rem);
|
|
260
|
+
}
|
|
261
|
+
.mg-input__with-character-left mg-character-left {
|
|
262
|
+
position: absolute;
|
|
263
|
+
display: none;
|
|
264
|
+
top: 50%;
|
|
265
|
+
right: 1rem;
|
|
266
|
+
opacity: 0.6;
|
|
267
|
+
transform: translateY(-50%);
|
|
268
|
+
font-size: 1.1rem;
|
|
269
|
+
}
|
|
270
|
+
.mg-input.is-focused .mg-input__with-character-left mg-character-left {
|
|
271
|
+
display: block;
|
|
249
272
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Component, Event, h, Prop, State, Element, Method, Watch } from '@stencil/core';
|
|
2
2
|
import { MgInput } from '../MgInput';
|
|
3
|
-
import { InputClass } from '../MgInput.conf';
|
|
4
3
|
import { createID, ClassList } from '../../../../utils/components.utils';
|
|
5
|
-
import {
|
|
4
|
+
import { initLocales } from '../../../../locales';
|
|
6
5
|
export class MgInputText {
|
|
7
6
|
constructor() {
|
|
8
7
|
/************
|
|
@@ -10,8 +9,10 @@ export class MgInputText {
|
|
|
10
9
|
************/
|
|
11
10
|
// classes
|
|
12
11
|
this.classFocus = 'is-focused';
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
12
|
+
this.classIsInputGroupAppend = 'mg-input--is-input-group-append';
|
|
13
|
+
this.classHasIcon = 'mg-input--has-icon';
|
|
14
|
+
// hasError (triggered by blur event)
|
|
15
|
+
this.hasError = false;
|
|
15
16
|
/**
|
|
16
17
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
17
18
|
* If not set, it will be created.
|
|
@@ -49,7 +50,7 @@ export class MgInputText {
|
|
|
49
50
|
/**
|
|
50
51
|
* Define input width
|
|
51
52
|
*/
|
|
52
|
-
this.
|
|
53
|
+
this.mgWidth = 'full';
|
|
53
54
|
/**
|
|
54
55
|
* Define if component should display character left
|
|
55
56
|
*/
|
|
@@ -65,6 +66,9 @@ export class MgInputText {
|
|
|
65
66
|
*/
|
|
66
67
|
this.handleInput = () => {
|
|
67
68
|
this.checkValidity();
|
|
69
|
+
if (this.hasError) {
|
|
70
|
+
this.checkError();
|
|
71
|
+
}
|
|
68
72
|
this.value = this.input.value;
|
|
69
73
|
};
|
|
70
74
|
/**
|
|
@@ -85,9 +89,8 @@ export class MgInputText {
|
|
|
85
89
|
// Manage focus
|
|
86
90
|
this.classList.delete(this.classFocus);
|
|
87
91
|
this.classList = new ClassList(this.classList.classes);
|
|
88
|
-
//
|
|
89
|
-
this.
|
|
90
|
-
this.checkError();
|
|
92
|
+
// Display Error
|
|
93
|
+
this.displayError();
|
|
91
94
|
};
|
|
92
95
|
/**
|
|
93
96
|
* Check if input is valid
|
|
@@ -118,14 +121,7 @@ export class MgInputText {
|
|
|
118
121
|
}
|
|
119
122
|
// required
|
|
120
123
|
else if (!this.valid && this.input.validity.valueMissing) {
|
|
121
|
-
this.errorMessage = messages.errors.required;
|
|
122
|
-
}
|
|
123
|
-
// Update class
|
|
124
|
-
if (this.valid) {
|
|
125
|
-
this.classList.delete(this.classError);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
this.classList.add(this.classError);
|
|
124
|
+
this.errorMessage = this.messages.errors.required;
|
|
129
125
|
}
|
|
130
126
|
};
|
|
131
127
|
/**
|
|
@@ -149,10 +145,10 @@ export class MgInputText {
|
|
|
149
145
|
this.validateAppendSlot = () => {
|
|
150
146
|
const slotAppendInput = Array.from(this.element.querySelectorAll('[slot="append-input"]'));
|
|
151
147
|
if (slotAppendInput.length === 1) {
|
|
152
|
-
this.classList.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.
|
|
148
|
+
this.classList.add(slotAppendInput[0].nodeName === 'MG-BUTTON' ? this.classIsInputGroupAppend : 'mg-input--is-append-input-slot-content');
|
|
153
149
|
}
|
|
154
150
|
else if (slotAppendInput.filter(slot => slot.nodeName === 'MG-BUTTON').length > 1) {
|
|
155
|
-
this.classList.add(this.
|
|
151
|
+
this.classList.add(this.classIsInputGroupAppend);
|
|
156
152
|
this.classList.add('mg-input--has-buttons-group-append');
|
|
157
153
|
}
|
|
158
154
|
};
|
|
@@ -160,6 +156,14 @@ export class MgInputText {
|
|
|
160
156
|
handleValue(newValue) {
|
|
161
157
|
this.valueChange.emit(newValue);
|
|
162
158
|
}
|
|
159
|
+
validateIcon(newValue) {
|
|
160
|
+
if (newValue !== undefined) {
|
|
161
|
+
this.classList.add(this.classHasIcon);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.classList.delete(this.classHasIcon);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
163
167
|
/**
|
|
164
168
|
* Public method to play input focus
|
|
165
169
|
*
|
|
@@ -176,6 +180,7 @@ export class MgInputText {
|
|
|
176
180
|
async displayError() {
|
|
177
181
|
this.checkValidity();
|
|
178
182
|
this.checkError();
|
|
183
|
+
this.hasError = this.invalid;
|
|
179
184
|
}
|
|
180
185
|
/*************
|
|
181
186
|
* Lifecycle *
|
|
@@ -186,9 +191,11 @@ export class MgInputText {
|
|
|
186
191
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
187
192
|
*/
|
|
188
193
|
componentWillLoad() {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
194
|
+
// Get locales
|
|
195
|
+
this.messages = initLocales(this.element).messages;
|
|
196
|
+
this.characterLeftId = `${this.identifier}-character-left`;
|
|
197
|
+
// Validate
|
|
198
|
+
this.validateIcon(this.icon);
|
|
192
199
|
this.validatePattern();
|
|
193
200
|
this.validateAppendSlot();
|
|
194
201
|
// Check validity when component is ready
|
|
@@ -204,9 +211,15 @@ export class MgInputText {
|
|
|
204
211
|
* @returns {HTMLElement} HTML Element
|
|
205
212
|
*/
|
|
206
213
|
render() {
|
|
207
|
-
return (h(MgInput, { identifier: this.identifier, classList: this.classList, label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, readonly: this.readonly,
|
|
208
|
-
|
|
209
|
-
|
|
214
|
+
return (h(MgInput, { identifier: this.identifier, classList: this.classList, ariaDescribedbyIDs: [this.characterLeftId], 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: undefined, tooltip: this.tooltip, helpText: this.helpText, errorMessage: this.errorMessage, isFieldset: false },
|
|
215
|
+
h("div", { class: "mg-input__with-character-left", style: {
|
|
216
|
+
'--mg-character-left-message-length': (this.displayCharacterLeft
|
|
217
|
+
? (this.maxlength - (this.value || '').length).toString().length + this.maxlength.toString().length + 1
|
|
218
|
+
: 0).toString(),
|
|
219
|
+
} },
|
|
220
|
+
this.icon !== undefined && h("mg-icon", { icon: this.icon }),
|
|
221
|
+
h("input", { type: this.type, class: "mg-input__box", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, maxlength: this.maxlength, disabled: this.disabled, required: this.required, pattern: this.pattern, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: el => (this.input = el) }),
|
|
222
|
+
this.displayCharacterLeft && this.maxlength && (h("mg-character-left", { identifier: this.characterLeftId, characters: this.value, maxlength: this.maxlength }))),
|
|
210
223
|
h("slot", { name: "append-input" })));
|
|
211
224
|
}
|
|
212
225
|
static get is() { return "mg-input-text"; }
|
|
@@ -447,7 +460,7 @@ export class MgInputText {
|
|
|
447
460
|
"reflect": false,
|
|
448
461
|
"defaultValue": "false"
|
|
449
462
|
},
|
|
450
|
-
"
|
|
463
|
+
"mgWidth": {
|
|
451
464
|
"type": "any",
|
|
452
465
|
"mutable": false,
|
|
453
466
|
"complexType": {
|
|
@@ -466,7 +479,7 @@ export class MgInputText {
|
|
|
466
479
|
"tags": [],
|
|
467
480
|
"text": "Define input width"
|
|
468
481
|
},
|
|
469
|
-
"attribute": "width",
|
|
482
|
+
"attribute": "mg-width",
|
|
470
483
|
"reflect": false,
|
|
471
484
|
"defaultValue": "'full'"
|
|
472
485
|
},
|
|
@@ -539,23 +552,6 @@ export class MgInputText {
|
|
|
539
552
|
"reflect": false,
|
|
540
553
|
"defaultValue": "true"
|
|
541
554
|
},
|
|
542
|
-
"characterLeftTemplate": {
|
|
543
|
-
"type": "string",
|
|
544
|
-
"mutable": false,
|
|
545
|
-
"complexType": {
|
|
546
|
-
"original": "string",
|
|
547
|
-
"resolved": "string",
|
|
548
|
-
"references": {}
|
|
549
|
-
},
|
|
550
|
-
"required": false,
|
|
551
|
-
"optional": false,
|
|
552
|
-
"docs": {
|
|
553
|
-
"tags": [],
|
|
554
|
-
"text": "Template to use for characters left sentence"
|
|
555
|
-
},
|
|
556
|
-
"attribute": "character-left-template",
|
|
557
|
-
"reflect": false
|
|
558
|
-
},
|
|
559
555
|
"helpText": {
|
|
560
556
|
"type": "string",
|
|
561
557
|
"mutable": false,
|
|
@@ -687,5 +683,8 @@ export class MgInputText {
|
|
|
687
683
|
static get watchers() { return [{
|
|
688
684
|
"propName": "value",
|
|
689
685
|
"methodName": "handleValue"
|
|
686
|
+
}, {
|
|
687
|
+
"propName": "icon",
|
|
688
|
+
"methodName": "validateIcon"
|
|
690
689
|
}]; }
|
|
691
690
|
}
|
|
@@ -2,6 +2,12 @@ import { h } from '@stencil/core';
|
|
|
2
2
|
export default {
|
|
3
3
|
component: 'mg-input-textarea',
|
|
4
4
|
title: 'Molecules/Inputs/mg-input-textarea',
|
|
5
|
+
argTypes: {
|
|
6
|
+
mgWidth: {
|
|
7
|
+
options: [2, 4, 16, 'full'],
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
},
|
|
10
|
+
},
|
|
5
11
|
parameters: { actions: { handles: ['value-change', 'input-valid'] } },
|
|
6
12
|
};
|
|
7
13
|
/**
|
|
@@ -21,12 +27,12 @@ const Template = (args) => {
|
|
|
21
27
|
delete args.patternErrorMessage;
|
|
22
28
|
const displayCharacterLeft = args.displayCharacterLeft;
|
|
23
29
|
delete args.displayCharacterLeft;
|
|
24
|
-
const characterLeftTemplate = args.characterLeftTemplate;
|
|
25
|
-
delete args.characterLeftTemplate;
|
|
26
30
|
const helpText = args.helpText;
|
|
27
31
|
delete args.helpText;
|
|
32
|
+
const mgWidth = args.mgWidth;
|
|
33
|
+
delete args.mgWidth;
|
|
28
34
|
// return element
|
|
29
|
-
return (h("mg-input-textarea", Object.assign({}, args, { "label-on-top": labelOnTop, "label-hide": labelHide, "pattern-error-message": patternErrorMessage, "display-character-left": displayCharacterLeft ? 'true' : 'false', "
|
|
35
|
+
return (h("mg-input-textarea", Object.assign({}, args, { "label-on-top": labelOnTop, "label-hide": labelHide, "pattern-error-message": patternErrorMessage, "display-character-left": displayCharacterLeft ? 'true' : 'false', "help-text": helpText, "mg-width": mgWidth })));
|
|
30
36
|
};
|
|
31
37
|
export const MgInputTextarea = Template.bind({});
|
|
32
38
|
MgInputTextarea.args = {
|
|
@@ -47,11 +53,11 @@ MgInputTextarea.args = {
|
|
|
47
53
|
pattern: undefined,
|
|
48
54
|
patternErrorMessage: undefined,
|
|
49
55
|
rows: 3,
|
|
56
|
+
mgWidth: 'full',
|
|
50
57
|
// Tooltip
|
|
51
58
|
tooltip: 'This is a tooltip',
|
|
52
59
|
// Nb Char Left
|
|
53
60
|
displayCharacterLeft: true,
|
|
54
|
-
characterLeftTemplate: '{counter} characters left.',
|
|
55
61
|
// Help Text
|
|
56
62
|
helpText: 'Help text with html <strong>bold</strong>, <em>italic</em>.',
|
|
57
63
|
};
|
|
@@ -11,16 +11,9 @@
|
|
|
11
11
|
min-height: var(--default-size);
|
|
12
12
|
max-width: 100%;
|
|
13
13
|
margin-bottom: var(--mg-inputs-margin-bottom, 0);
|
|
14
|
-
/* Style when input is not valid */
|
|
15
14
|
/* Label */
|
|
16
15
|
/* Label-on-top */
|
|
17
16
|
}
|
|
18
|
-
.mg-input.is-not-valid {
|
|
19
|
-
color: hsl(var(--color-danger));
|
|
20
|
-
}
|
|
21
|
-
.mg-input.is-not-valid .mg-input__box {
|
|
22
|
-
border-color: hsl(var(--color-danger));
|
|
23
|
-
}
|
|
24
17
|
.mg-input mg-input-title {
|
|
25
18
|
flex-shrink: var(--mg-inputs-shrink, 1);
|
|
26
19
|
width: var(--mg-inputs-title-width, auto);
|
|
@@ -74,6 +67,11 @@
|
|
|
74
67
|
.mg-input__input-container mg-icon {
|
|
75
68
|
display: flex;
|
|
76
69
|
}
|
|
70
|
+
.mg-input__input-container .mg-input__help-text,
|
|
71
|
+
.mg-input__input-container .mg-input__error {
|
|
72
|
+
text-align: start;
|
|
73
|
+
font-size: 1.2rem;
|
|
74
|
+
}
|
|
77
75
|
|
|
78
76
|
.mg-input__input {
|
|
79
77
|
display: flex;
|
|
@@ -82,11 +80,22 @@
|
|
|
82
80
|
.mg-input__input mg-tooltip {
|
|
83
81
|
margin-top: calc((var(--default-size) - var(--mg-icon-regular-size)) / 2);
|
|
84
82
|
}
|
|
85
|
-
.mg-input__input
|
|
86
|
-
|
|
83
|
+
.mg-input__input.mg-input__input--has-error .mg-input__box {
|
|
84
|
+
border-color: hsl(var(--color-danger));
|
|
85
|
+
}
|
|
86
|
+
.mg-input__input + .mg-input__help-text, .mg-input__input + .mg-input__error {
|
|
87
87
|
margin-top: 0.5rem;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
.mg-input__error {
|
|
91
|
+
display: inline-block;
|
|
92
|
+
margin-top: 0.2rem;
|
|
93
|
+
padding: 0.3rem 0.8rem;
|
|
94
|
+
border-radius: 0.3rem;
|
|
95
|
+
background: hsl(var(--mg-inputs-error-bg-color));
|
|
96
|
+
color: hsl(var(--color-danger));
|
|
97
|
+
}
|
|
98
|
+
|
|
90
99
|
/**
|
|
91
100
|
* Style for input "box":
|
|
92
101
|
* - input[type="text"]
|
|
@@ -97,7 +106,6 @@
|
|
|
97
106
|
*/
|
|
98
107
|
.mg-input__box {
|
|
99
108
|
padding: calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);
|
|
100
|
-
width: 100%;
|
|
101
109
|
height: var(--default-size);
|
|
102
110
|
box-sizing: border-box;
|
|
103
111
|
border-width: var(--mg-inputs-border-width);
|
|
@@ -108,6 +116,7 @@
|
|
|
108
116
|
font-family: inherit;
|
|
109
117
|
color: hsl(var(--color-dark));
|
|
110
118
|
font-size: var(--font-size);
|
|
119
|
+
text-align: var(--mg-inputs-text-align, left);
|
|
111
120
|
}
|
|
112
121
|
.mg-input__box::placeholder {
|
|
113
122
|
color: var(--mg-inputs-color);
|
|
@@ -155,10 +164,6 @@
|
|
|
155
164
|
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]) {
|
|
156
165
|
--mg-button-border-radius-top-right: 0;
|
|
157
166
|
--mg-button-border-radius-bottom-right: 0;
|
|
158
|
-
--mg-button-border-radius-top-left: 0;
|
|
159
|
-
/* IE FIX */
|
|
160
|
-
--mg-button-border-radius-bottom-left: 0;
|
|
161
|
-
/* IE FIX */
|
|
162
167
|
}
|
|
163
168
|
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)) {
|
|
164
169
|
--mg-button-border-right-width: 0;
|
|
@@ -166,10 +171,6 @@
|
|
|
166
171
|
.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type) {
|
|
167
172
|
--mg-button-border-radius-top-right: var(--mg-inputs-border-radius);
|
|
168
173
|
--mg-button-border-radius-bottom-right: var(--mg-inputs-border-radius);
|
|
169
|
-
--mg-button-border-radius-top-left: 0;
|
|
170
|
-
/* IE FIX */
|
|
171
|
-
--mg-button-border-radius-bottom-left: 0;
|
|
172
|
-
/* IE FIX */
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]) {
|
|
@@ -201,13 +202,14 @@
|
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
/**
|
|
204
|
-
*
|
|
205
|
+
* Set mg-character-left with inputs
|
|
205
206
|
*/
|
|
206
207
|
.mg-input mg-character-left {
|
|
207
|
-
|
|
208
|
+
opacity: 0.6;
|
|
209
|
+
font-size: 1.1rem;
|
|
208
210
|
}
|
|
209
|
-
.mg-input.
|
|
210
|
-
|
|
211
|
+
.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 {
|
|
212
|
+
margin-top: 0;
|
|
211
213
|
}
|
|
212
214
|
|
|
213
215
|
/**
|
|
@@ -233,7 +235,34 @@
|
|
|
233
235
|
|
|
234
236
|
/* Component Custom Style */
|
|
235
237
|
.mg-input .mg-input__box {
|
|
238
|
+
display: block;
|
|
236
239
|
height: auto;
|
|
240
|
+
resize: none;
|
|
241
|
+
}
|
|
242
|
+
.mg-input .mg-input__box.mg-input__box--resizable {
|
|
243
|
+
resize: both;
|
|
244
|
+
}
|
|
245
|
+
.mg-input .mg-input__box.mg-input__box--resizable-horizontal {
|
|
246
|
+
resize: horizontal;
|
|
247
|
+
}
|
|
248
|
+
.mg-input .mg-input__box.mg-input__box--resizable-vertical {
|
|
249
|
+
resize: vertical;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Character left
|
|
254
|
+
*/
|
|
255
|
+
.mg-input__with-character-left {
|
|
256
|
+
width: 100%;
|
|
257
|
+
}
|
|
258
|
+
.mg-input__with-character-left mg-character-left {
|
|
259
|
+
display: block;
|
|
260
|
+
visibility: hidden;
|
|
261
|
+
margin-top: 0.2rem;
|
|
262
|
+
text-align: end;
|
|
263
|
+
}
|
|
264
|
+
.mg-input.is-focused .mg-input__with-character-left mg-character-left {
|
|
265
|
+
visibility: visible;
|
|
237
266
|
}
|
|
238
267
|
|
|
239
268
|
/* Firefox selector */
|