@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,15 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-88560a66.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v2.
|
|
6
|
+
Stencil Client Patch Browser v2.17.1 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
const patchBrowser = () => {
|
|
9
|
-
{
|
|
10
|
-
// shim css vars
|
|
11
|
-
index.plt.$cssShim$ = index.win.__cssshim;
|
|
12
|
-
}
|
|
13
9
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mg-components.cjs.js', document.baseURI).href));
|
|
14
10
|
const opts = {};
|
|
15
11
|
if (importMeta !== '') {
|
|
@@ -19,5 +15,5 @@ const patchBrowser = () => {
|
|
|
19
15
|
};
|
|
20
16
|
|
|
21
17
|
patchBrowser().then(options => {
|
|
22
|
-
return index.bootstrapLazy([["mg-badge_21.cjs",[[1,"mg-
|
|
18
|
+
return index.bootstrapLazy([["mg-badge_21.cjs",[[1,"mg-panel",{"identifier":[1],"panelTitle":[1025,"panel-title"],"titlePattern":[1025,"title-pattern"],"titlePatternErrorMessage":[1025,"title-pattern-error-message"],"expanded":[1028],"expandToggleDisabled":[1028,"expand-toggle-disabled"],"titleEditable":[4,"title-editable"],"classList":[32],"isEditing":[32],"updatedPanelTitle":[32]}],[1,"mg-pagination",{"identifier":[1],"label":[1025],"totalPages":[2,"total-pages"],"currentPage":[1538,"current-page"]}],[1,"mg-input-textarea",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"maxlength":[2],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"pattern":[1],"patternErrorMessage":[1,"pattern-error-message"],"rows":[2],"tooltip":[1],"displayCharacterLeft":[4,"display-character-left"],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"resizable":[1],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-checkbox",{"value":[1040],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"inputVerticalList":[4,"input-vertical-list"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"checkboxItems":[32],"displayError":[64]}],[1,"mg-input-date",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"min":[1],"max":[1],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-numeric",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"type":[1],"currency":[1],"max":[2],"min":[2],"integerLength":[2,"integer-length"],"decimalLength":[2,"decimal-length"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"hasFocus":[32],"displayError":[64]}],[1,"mg-input-password",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-radio",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"inputVerticalList":[4,"input-vertical-list"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"options":[32],"displayError":[64]}],[1,"mg-input-toggle",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"isOnOff":[4,"is-on-off"],"isIcon":[4,"is-icon"],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"classList":[32],"options":[32],"checked":[32]}],[1,"mg-message",{"identifier":[1],"delay":[2],"variant":[1],"closeButton":[1028,"close-button"],"hide":[1028],"classList":[32],"hasActions":[32]}],[4,"mg-tabs",{"identifier":[1],"label":[1],"size":[1],"items":[16],"activeTab":[1538,"active-tab"],"tabs":[32],"classList":[32]}],[1,"mg-form",{"identifier":[1],"name":[1],"readonly":[4],"disabled":[4],"valid":[1028],"invalid":[1028],"classList":[32],"displayError":[64]}],[1,"mg-tag",{"variant":[1],"outline":[4],"classList":[32]}],[1,"mg-input-text",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"type":[1],"icon":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"maxlength":[2],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"pattern":[1],"patternErrorMessage":[1,"pattern-error-message"],"tooltip":[1],"displayCharacterLeft":[4,"display-character-left"],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"setFocus":[64],"displayError":[64]}],[1,"mg-input-select",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1025],"placeholderHide":[4,"placeholder-hide"],"placeholderDisabled":[4,"placeholder-disabled"],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"options":[32],"valueExist":[32],"readonlyValue":[32],"displayError":[64]}],[1,"mg-badge",{"value":[1032],"label":[1],"variant":[1],"outline":[4],"classList":[32]}],[2,"mg-character-left",{"identifier":[1],"characters":[1],"maxlength":[2]}],[6,"mg-button",{"variant":[1],"identifier":[1],"label":[1],"disabled":[1028],"isIcon":[4,"is-icon"],"disableOnClick":[4,"disable-on-click"],"expanded":[4],"controls":[1],"haspopup":[8],"loading":[32],"classList":[32]}],[6,"mg-input-title",{"identifier":[1],"required":[4],"isLegend":[4,"is-legend"],"tagName":[32]}],[6,"mg-tooltip",{"identifier":[1],"message":[1],"placement":[1],"display":[1028],"disabled":[1028]}],[1,"mg-icon",{"icon":[1],"size":[1],"variant":[1],"spin":[4],"classList":[32]}]]],["mg-modal.cjs",[[1,"mg-modal",{"identifier":[1],"modalTitle":[1,"modal-title"],"closeButton":[1028,"close-button"],"hide":[1028],"hasActions":[32],"hasContent":[32],"classList":[32]},[[8,"keydown","handleKeyDown"]]]]],["mg-popover.cjs",[[6,"mg-popover",{"identifier":[1],"placement":[1],"closeButton":[4,"close-button"],"display":[1028],"disabled":[1028]}]]]], options);
|
|
23
19
|
});
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const index$1 = require('./index-
|
|
5
|
+
const index = require('./index-88560a66.js');
|
|
6
|
+
const index$1 = require('./index-a39c5567.js');
|
|
7
7
|
|
|
8
|
-
const mgModalCss = ".mg-modal{display
|
|
8
|
+
const mgModalCss = ".mg-modal{display:flex;justify-content:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;padding:2rem 0;background-color:hsla(var(--color-light), 85%)}.mg-modal__dialog{display:flex;flex-direction:column;align-self:center;row-gap:3rem;padding:1.5rem 2.5rem;width:60rem;height:fit-content;max-width:100%;max-height:100%;box-sizing:border-box;background-color:hsl(var(--color-light));box-shadow:var(--box-shadow);border-radius:var(--mg-modal-border-radius)}.mg-modal__header{margin-bottom:0.5rem}.mg-modal__title{margin:0;font-family:var(--font-family-heading);font-size:var(--mg-modal-title-font-size);font-weight:600}.mg-modal__close-button{float:right;height:var(--mg-modal-title-font-size);margin-top:calc((var(--default-size) - var(--mg-modal-title-font-size) * var(--line-height)) / 2 * -1);margin-right:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2 * -1)}.mg-modal .mg-modal__content{overflow-y:auto}.mg-modal .mg-modal__content::slotted(*){font-size:var(--mg-modal-content-font-size)}.mg-modal.mg-modal--hide{display:none}";
|
|
9
9
|
|
|
10
10
|
const MgModal = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -15,6 +15,9 @@ const MgModal = class {
|
|
|
15
15
|
/************
|
|
16
16
|
* Internal *
|
|
17
17
|
************/
|
|
18
|
+
// Classes
|
|
19
|
+
this.classHide = 'mg-modal--hide';
|
|
20
|
+
// IDs
|
|
18
21
|
this.closeButtonId = '';
|
|
19
22
|
this.titleId = '';
|
|
20
23
|
/**
|
|
@@ -57,11 +60,11 @@ const MgModal = class {
|
|
|
57
60
|
validateHide(newValue) {
|
|
58
61
|
if (newValue) {
|
|
59
62
|
this.componentHide.emit();
|
|
60
|
-
this.classList.add(
|
|
63
|
+
this.classList.add(this.classHide);
|
|
61
64
|
}
|
|
62
65
|
else {
|
|
63
66
|
this.componentShow.emit();
|
|
64
|
-
this.classList.delete(
|
|
67
|
+
this.classList.delete(this.classHide);
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
/**
|
|
@@ -85,6 +88,9 @@ const MgModal = class {
|
|
|
85
88
|
* @returns {void}
|
|
86
89
|
*/
|
|
87
90
|
componentWillLoad() {
|
|
91
|
+
// Get locales
|
|
92
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
93
|
+
// Validate
|
|
88
94
|
this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
|
|
89
95
|
this.hasContent = this.element.querySelector('[slot="content"]') !== null;
|
|
90
96
|
if (this.closeButton) {
|
|
@@ -99,7 +105,7 @@ const MgModal = class {
|
|
|
99
105
|
* @returns {HTMLElement} HTML Element
|
|
100
106
|
*/
|
|
101
107
|
render() {
|
|
102
|
-
return (index.h("section", { role: "dialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, index.h("article", { class: "mg-modal__dialog" }, index.h("header", { class: "mg-modal__header" }, this.closeButton && (index.h("span", { class: "mg-modal__close-button" }, index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label:
|
|
108
|
+
return (index.h("section", { role: "dialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, index.h("article", { class: "mg-modal__dialog" }, index.h("header", { class: "mg-modal__header" }, this.closeButton && (index.h("span", { class: "mg-modal__close-button" }, index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, index.h("mg-icon", { icon: "cross" })))), index.h("h1", { class: "mg-modal__title", id: this.titleId }, this.modalTitle)), this.hasContent && (index.h("article", { class: "mg-modal__content" }, index.h("slot", { name: "content" }))), this.hasActions && (index.h("footer", { class: "mg-modal__footer" }, index.h("slot", { name: "actions" }))))));
|
|
103
109
|
}
|
|
104
110
|
get element() { return index.getElement(this); }
|
|
105
111
|
static get watchers() { return {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const index$1 = require('./index-
|
|
7
|
-
const popper = require('./popper-
|
|
5
|
+
const index = require('./index-88560a66.js');
|
|
6
|
+
const index$1 = require('./index-a39c5567.js');
|
|
7
|
+
const popper = require('./popper-71bf3058.js');
|
|
8
8
|
|
|
9
|
-
const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color))
|
|
9
|
+
const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color));box-shadow:var(--box-shadow);color:hsl(var(--mg-popover-font-color))}.mg-popover[data-show].sc-mg-popover{display:block}.mg-popover.sc-mg-popover mg-button.sc-mg-popover{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover,.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{position:absolute;width:2rem;height:2rem;z-index:-1;background:inherit}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover{visibility:hidden}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-popover[data-popper-placement^=top].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{bottom:-6px}.mg-popover[data-popper-placement^=bottom].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{top:-6px}.mg-popover[data-popper-placement^=left].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{right:-6px}.mg-popover[data-popper-placement^=right].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{left:-6px}.mg-popover__title.sc-mg-popover-s>*,.mg-popover__title .sc-mg-popover-s>*{margin:0 0 1rem;font-size:var(--mg-popover-title-font-size);font-weight:600}";
|
|
10
10
|
|
|
11
11
|
const MgPopover = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -73,7 +73,7 @@ const MgPopover = class {
|
|
|
73
73
|
this.popover.removeAttribute('data-show');
|
|
74
74
|
// Disable the event listeners
|
|
75
75
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
|
|
76
|
-
// Remove
|
|
76
|
+
// Remove event listener
|
|
77
77
|
document.removeEventListener('click', this.clickOutside, false);
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
@@ -96,6 +96,15 @@ const MgPopover = class {
|
|
|
96
96
|
/*************
|
|
97
97
|
* Lifecycle *
|
|
98
98
|
*************/
|
|
99
|
+
/**
|
|
100
|
+
* Check if component props are well configured on init
|
|
101
|
+
*
|
|
102
|
+
* @returns {void} timeout
|
|
103
|
+
*/
|
|
104
|
+
componentWillLoad() {
|
|
105
|
+
// Get locales
|
|
106
|
+
this.messages = index$1.initLocales(this.element).messages;
|
|
107
|
+
}
|
|
99
108
|
/**
|
|
100
109
|
* Check if component props are well configured on init
|
|
101
110
|
*
|
|
@@ -149,7 +158,7 @@ const MgPopover = class {
|
|
|
149
158
|
* @returns {HTMLElement} HTML Element
|
|
150
159
|
*/
|
|
151
160
|
render() {
|
|
152
|
-
return (index.h(index.Host, null, index.h("slot", null), index.h("div", { id: this.identifier, class: "mg-popover" }, !this.disabled && this.closeButton && (index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label:
|
|
161
|
+
return (index.h(index.Host, null, index.h("slot", null), index.h("div", { id: this.identifier, class: "mg-popover" }, !this.disabled && this.closeButton && (index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, index.h("mg-icon", { icon: "cross" }))), index.h("div", { class: "mg-popover__title" }, index.h("slot", { name: "title" })), index.h("slot", { name: "content" }), index.h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
|
|
153
162
|
}
|
|
154
163
|
get element() { return index.getElement(this); }
|
|
155
164
|
static get watchers() { return {
|
|
@@ -300,6 +300,10 @@ function getContainingBlock(element) {
|
|
|
300
300
|
|
|
301
301
|
var currentNode = getParentNode(element);
|
|
302
302
|
|
|
303
|
+
if (isShadowRoot(currentNode)) {
|
|
304
|
+
currentNode = currentNode.host;
|
|
305
|
+
}
|
|
306
|
+
|
|
303
307
|
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
304
308
|
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
305
309
|
// create a containing block.
|
|
@@ -523,7 +527,7 @@ function mapToStyles(_ref2) {
|
|
|
523
527
|
|
|
524
528
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
525
529
|
sideY = bottom;
|
|
526
|
-
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
530
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
527
531
|
offsetParent[heightProp];
|
|
528
532
|
y -= offsetY - popperRect.height;
|
|
529
533
|
y *= gpuAcceleration ? 1 : -1;
|
|
@@ -531,7 +535,7 @@ function mapToStyles(_ref2) {
|
|
|
531
535
|
|
|
532
536
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
533
537
|
sideX = right;
|
|
534
|
-
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
538
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
535
539
|
offsetParent[widthProp];
|
|
536
540
|
x -= offsetX - popperRect.width;
|
|
537
541
|
x *= gpuAcceleration ? 1 : -1;
|
|
@@ -3,6 +3,11 @@ import { variants } from './mg-badge.conf';
|
|
|
3
3
|
import { ClassList } from '../../../utils/components.utils';
|
|
4
4
|
export class MgBadge {
|
|
5
5
|
constructor() {
|
|
6
|
+
/************
|
|
7
|
+
* Internal *
|
|
8
|
+
************/
|
|
9
|
+
// classes
|
|
10
|
+
this.classOutline = `mg-badge--outline`;
|
|
6
11
|
/**
|
|
7
12
|
* Define button variant
|
|
8
13
|
*/
|
|
@@ -17,15 +22,22 @@ export class MgBadge {
|
|
|
17
22
|
throw new Error('<mg-badge> prop "value" must be interger or ponctuation character.');
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
|
-
validateVariant(newValue) {
|
|
25
|
+
validateVariant(newValue, oldValue) {
|
|
21
26
|
if (!variants.includes(newValue)) {
|
|
22
27
|
throw new Error(`<mg-badge> prop "variant" must be one of : ${variants.join(', ')}.`);
|
|
23
28
|
}
|
|
24
|
-
|
|
29
|
+
else {
|
|
30
|
+
if (oldValue !== undefined) {
|
|
31
|
+
this.classList.delete(`mg-badge--${oldValue}`);
|
|
32
|
+
}
|
|
33
|
+
this.classList.add(`mg-badge--${newValue}`);
|
|
34
|
+
}
|
|
25
35
|
}
|
|
26
36
|
validateOutline(newValue) {
|
|
27
37
|
if (newValue)
|
|
28
|
-
this.classList.add(
|
|
38
|
+
this.classList.add(this.classOutline);
|
|
39
|
+
else
|
|
40
|
+
this.classList.delete(this.classOutline);
|
|
29
41
|
}
|
|
30
42
|
/**
|
|
31
43
|
* Check if props are well configured on init
|
package/dist/collection/components/atoms/mg-button/{mg-button.stories.js → doc/mg-button.stories.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
|
-
import { variants } from '
|
|
3
|
-
import { icons } from '
|
|
2
|
+
import { variants } from '../mg-button.conf';
|
|
3
|
+
import { icons } from '../../mg-icon/mg-icon.conf';
|
|
4
4
|
export default {
|
|
5
5
|
component: 'mg-button',
|
|
6
6
|
title: 'Atoms/mg-button',
|
|
@@ -43,72 +43,48 @@
|
|
|
43
43
|
line-height: var(--font-size);
|
|
44
44
|
}
|
|
45
45
|
.mg-button.mg-button--primary {
|
|
46
|
-
border-color: hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l));
|
|
47
|
-
/* IE FIX */
|
|
48
|
-
border-color: hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - 10%));
|
|
46
|
+
border-color: hsl(var(--mg-button-primary-border-color, var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-border-variation) * 10%)));
|
|
49
47
|
color: hsl(var(--mg-button-primary-font-color));
|
|
50
|
-
background: hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l));
|
|
51
|
-
/* IE FIX */
|
|
52
48
|
background: linear-gradient(to bottom, hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l)), hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%)));
|
|
53
49
|
}
|
|
54
50
|
.mg-button.mg-button--primary:hover:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--primary:focus:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--primary:active:not([disabled], [aria-disabled=true], .disabled) {
|
|
55
51
|
background: hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l));
|
|
56
52
|
}
|
|
57
53
|
.mg-button.mg-button--secondary {
|
|
58
|
-
border-color: hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l));
|
|
59
|
-
/* IE FIX */
|
|
60
|
-
border-color: hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - 10%));
|
|
54
|
+
border-color: hsl(var(--mg-button-secondary-border-color, var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-border-variation) * 10%)));
|
|
61
55
|
color: hsl(var(--mg-button-secondary-font-color));
|
|
62
|
-
background: hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l));
|
|
63
|
-
/* IE FIX */
|
|
64
56
|
background: linear-gradient(to bottom, hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l)), hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%)));
|
|
65
57
|
}
|
|
66
58
|
.mg-button.mg-button--secondary:hover:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--secondary:focus:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--secondary:active:not([disabled], [aria-disabled=true], .disabled) {
|
|
67
59
|
background: hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l));
|
|
68
60
|
}
|
|
69
61
|
.mg-button.mg-button--danger {
|
|
70
|
-
border-color: hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l));
|
|
71
|
-
/* IE FIX */
|
|
72
|
-
border-color: hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - 10%));
|
|
62
|
+
border-color: hsl(var(--mg-button-danger-border-color, var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-border-variation) * 10%)));
|
|
73
63
|
color: hsl(var(--color-neutral));
|
|
74
|
-
background: hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l));
|
|
75
|
-
/* IE FIX */
|
|
76
64
|
background: linear-gradient(to bottom, hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l)), hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%)));
|
|
77
65
|
}
|
|
78
66
|
.mg-button.mg-button--danger:hover:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--danger:focus:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--danger:active:not([disabled], [aria-disabled=true], .disabled) {
|
|
79
67
|
background: hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l));
|
|
80
68
|
}
|
|
81
69
|
.mg-button.mg-button--danger-alt {
|
|
82
|
-
border-color: hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l));
|
|
83
|
-
/* IE FIX */
|
|
84
|
-
border-color: hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - 10%));
|
|
70
|
+
border-color: hsl(var(--mg-button-danger-alt-border-color, var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-border-variation) * 10%)));
|
|
85
71
|
color: hsl(var(--color-danger));
|
|
86
|
-
background: hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l));
|
|
87
|
-
/* IE FIX */
|
|
88
72
|
background: linear-gradient(to bottom, hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l)), hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%)));
|
|
89
73
|
}
|
|
90
74
|
.mg-button.mg-button--danger-alt:hover:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--danger-alt:focus:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--danger-alt:active:not([disabled], [aria-disabled=true], .disabled) {
|
|
91
75
|
background: hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l));
|
|
92
76
|
}
|
|
93
77
|
.mg-button.mg-button--info {
|
|
94
|
-
border-color: hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l));
|
|
95
|
-
/* IE FIX */
|
|
96
|
-
border-color: hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - 10%));
|
|
78
|
+
border-color: hsl(var(--mg-button-info-border-color, var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-border-variation) * 10%)));
|
|
97
79
|
color: hsl(var(--color-neutral));
|
|
98
|
-
background: hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l));
|
|
99
|
-
/* IE FIX */
|
|
100
80
|
background: linear-gradient(to bottom, hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l)), hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%)));
|
|
101
81
|
}
|
|
102
82
|
.mg-button.mg-button--info:hover:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--info:focus:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--info:active:not([disabled], [aria-disabled=true], .disabled) {
|
|
103
83
|
background: hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l));
|
|
104
84
|
}
|
|
105
85
|
.mg-button.mg-button--success {
|
|
106
|
-
border-color: hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l));
|
|
107
|
-
/* IE FIX */
|
|
108
|
-
border-color: hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - 10%));
|
|
86
|
+
border-color: hsl(var(--mg-button-success-border-color, var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-border-variation) * 10%)));
|
|
109
87
|
color: hsl(var(--color-dark));
|
|
110
|
-
background: hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l));
|
|
111
|
-
/* IE FIX */
|
|
112
88
|
background: linear-gradient(to bottom, hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l)), hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-gradient) * 10%)));
|
|
113
89
|
}
|
|
114
90
|
.mg-button.mg-button--success:hover:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--success:focus:not([disabled], [aria-disabled=true], .disabled), .mg-button.mg-button--success:active:not([disabled], [aria-disabled=true], .disabled) {
|
|
@@ -65,11 +65,16 @@ export class MgButton {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
validateVariant(newValue) {
|
|
68
|
+
validateVariant(newValue, oldValue) {
|
|
69
69
|
if (!variants.includes(newValue)) {
|
|
70
70
|
throw new Error(`<mg-button> prop "variant" must be one of : ${variants.join(', ')}`);
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
else {
|
|
73
|
+
if (oldValue !== undefined) {
|
|
74
|
+
this.classList.delete(`mg-button--${oldValue}`);
|
|
75
|
+
}
|
|
76
|
+
this.classList.add(`mg-button--${newValue}`);
|
|
77
|
+
}
|
|
73
78
|
}
|
|
74
79
|
disabledHandler(isDisabled) {
|
|
75
80
|
// Remove loading when enable
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import { Component, h, Prop, Watch } from '@stencil/core';
|
|
2
|
-
import {
|
|
1
|
+
import { Component, Element, h, Prop, Watch } from '@stencil/core';
|
|
2
|
+
import { initLocales } from '../../../locales';
|
|
3
3
|
export class MgCharacterLeft {
|
|
4
4
|
constructor() {
|
|
5
|
-
/************
|
|
6
|
-
* Internal *
|
|
7
|
-
************/
|
|
8
|
-
this.mustacheCounter = '{counter}';
|
|
9
|
-
/**
|
|
10
|
-
* Template to display remaining characters.
|
|
11
|
-
* Must have {counter} inside
|
|
12
|
-
*/
|
|
13
|
-
this.template = messages.nbCharLeft;
|
|
14
5
|
/**
|
|
15
6
|
* Sets the characters to count
|
|
16
7
|
*/
|
|
17
8
|
this.characters = '';
|
|
18
|
-
/**
|
|
19
|
-
* Calculate number character left
|
|
20
|
-
*
|
|
21
|
-
* @returns {string} message
|
|
22
|
-
*/
|
|
23
|
-
this.getMessage = () => {
|
|
24
|
-
return this.template.replace(this.mustacheCounter, `<strong>${this.maxlength - this.characters.length}</strong>`);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
validateTemplate(newValue) {
|
|
28
|
-
if (typeof newValue !== 'string' || newValue === '' || newValue.indexOf(this.mustacheCounter) === -1) {
|
|
29
|
-
throw new Error(`<mg-character-left> prop "template" must contain "${this.mustacheCounter}".`);
|
|
30
|
-
}
|
|
31
9
|
}
|
|
32
10
|
validateMaxlength(newValue) {
|
|
33
11
|
if (typeof newValue !== 'number') {
|
|
@@ -43,8 +21,8 @@ export class MgCharacterLeft {
|
|
|
43
21
|
* @returns {void}
|
|
44
22
|
*/
|
|
45
23
|
componentWillLoad() {
|
|
46
|
-
this.validateTemplate(this.template);
|
|
47
24
|
this.validateMaxlength(this.maxlength);
|
|
25
|
+
this.messages = initLocales(this.element).messages;
|
|
48
26
|
}
|
|
49
27
|
/**
|
|
50
28
|
* Render component
|
|
@@ -52,7 +30,12 @@ export class MgCharacterLeft {
|
|
|
52
30
|
* @returns {HTMLElement} HTML Element
|
|
53
31
|
*/
|
|
54
32
|
render() {
|
|
55
|
-
return h("span", { id: this.identifier,
|
|
33
|
+
return (h("span", { id: this.identifier, "aria-live": "polite" },
|
|
34
|
+
h("span", { "aria-hidden": "true" },
|
|
35
|
+
this.maxlength - this.characters.length,
|
|
36
|
+
"/",
|
|
37
|
+
this.maxlength),
|
|
38
|
+
h("span", { class: "sr-only" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
|
|
56
39
|
}
|
|
57
40
|
static get is() { return "mg-character-left"; }
|
|
58
41
|
static get encapsulation() { return "scoped"; }
|
|
@@ -80,24 +63,6 @@ export class MgCharacterLeft {
|
|
|
80
63
|
"attribute": "identifier",
|
|
81
64
|
"reflect": false
|
|
82
65
|
},
|
|
83
|
-
"template": {
|
|
84
|
-
"type": "string",
|
|
85
|
-
"mutable": false,
|
|
86
|
-
"complexType": {
|
|
87
|
-
"original": "string",
|
|
88
|
-
"resolved": "string",
|
|
89
|
-
"references": {}
|
|
90
|
-
},
|
|
91
|
-
"required": false,
|
|
92
|
-
"optional": false,
|
|
93
|
-
"docs": {
|
|
94
|
-
"tags": [],
|
|
95
|
-
"text": "Template to display remaining characters.\nMust have {counter} inside"
|
|
96
|
-
},
|
|
97
|
-
"attribute": "template",
|
|
98
|
-
"reflect": false,
|
|
99
|
-
"defaultValue": "messages.nbCharLeft"
|
|
100
|
-
},
|
|
101
66
|
"characters": {
|
|
102
67
|
"type": "string",
|
|
103
68
|
"mutable": false,
|
|
@@ -134,10 +99,8 @@ export class MgCharacterLeft {
|
|
|
134
99
|
"reflect": false
|
|
135
100
|
}
|
|
136
101
|
}; }
|
|
102
|
+
static get elementRef() { return "element"; }
|
|
137
103
|
static get watchers() { return [{
|
|
138
|
-
"propName": "template",
|
|
139
|
-
"methodName": "validateTemplate"
|
|
140
|
-
}, {
|
|
141
104
|
"propName": "maxlength",
|
|
142
105
|
"methodName": "validateMaxlength"
|
|
143
106
|
}]; }
|