@mgdis/mg-components 3.1.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/LICENSE +29 -0
- package/dist/cjs/css-shim-a22512c4.js +6 -0
- package/dist/cjs/index-85a4a0b6.js +1674 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +35 -0
- package/dist/cjs/mg-badge_20.cjs.entry.js +4661 -0
- package/dist/cjs/mg-components.cjs.js +23 -0
- package/dist/cjs/shadow-css-8940f82d.js +390 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +4 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +99 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +148 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.stories.js +27 -0
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +4 -0
- package/dist/collection/components/atoms/mg-button/mg-button.css +134 -0
- package/dist/collection/components/atoms/mg-button/mg-button.js +236 -0
- package/dist/collection/components/atoms/mg-button/mg-button.stories.js +38 -0
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.css +3 -0
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +133 -0
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.stories.js +15 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +54 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.css +57 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +155 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.stories.js +34 -0
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.css +12 -0
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +95 -0
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.stories.js +21 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.conf.js +4 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +73 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +94 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.stories.js +25 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +44 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +225 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.stories.js +26 -0
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +7 -0
- package/dist/collection/components/molecules/inputs/MgInput.js +130 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +156 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +444 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.stories.js +57 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +7 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +171 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +467 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.stories.js +46 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +11 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +199 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +633 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.stories.js +68 -0
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +195 -0
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +401 -0
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.stories.js +43 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +156 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +443 -0
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.stories.js +65 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +201 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +532 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.stories.js +70 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +222 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +589 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.stories.js +115 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +217 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +553 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.stories.js +52 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +213 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +457 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.stories.js +73 -0
- package/dist/collection/components/molecules/mg-message/mg-message.conf.js +4 -0
- package/dist/collection/components/molecules/mg-message/mg-message.css +94 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +285 -0
- package/dist/collection/components/molecules/mg-message/mg-message.stories.js +43 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.conf.js +5 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +39 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +218 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.stories.js +23 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +59 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +249 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.stories.js +36 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +30 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +212 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.stories.js +40 -0
- package/dist/collection/fonts/OpenSans-Regular.ttf +0 -0
- package/dist/collection/fonts/OpenSans-SemiBold.ttf +0 -0
- package/dist/collection/fonts/Poppins-Bold.ttf +0 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/locales/index.js +4 -0
- package/dist/collection/stories/buttons.stories.js +43 -0
- package/dist/collection/stories/grids.stories.js +50 -0
- package/dist/collection/stories/icons.stories.js +20 -0
- package/dist/collection/stories/messages.stories.js +44 -0
- package/dist/collection/stories/tags.stories.js +13 -0
- package/dist/collection/stories/typography.stories.js +28 -0
- package/dist/collection/utils/components.utils.js +67 -0
- package/dist/collection/utils/locale.utils.js +32 -0
- package/dist/collection/utils/test.utils.js +26 -0
- package/dist/collection/variables.css +177 -0
- package/dist/collection/variables.scss +177 -0
- package/dist/components/MgInput.js +140 -0
- package/dist/components/components.utils.js +69 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +54 -0
- package/dist/components/locale.utils.js +35 -0
- package/dist/components/mg-badge.d.ts +11 -0
- package/dist/components/mg-badge.js +6 -0
- package/dist/components/mg-badge2.js +82 -0
- package/dist/components/mg-button.d.ts +11 -0
- package/dist/components/mg-button.js +6 -0
- package/dist/components/mg-button2.js +148 -0
- package/dist/components/mg-character-left.d.ts +11 -0
- package/dist/components/mg-character-left.js +6 -0
- package/dist/components/mg-character-left2.js +77 -0
- package/dist/components/mg-icon.d.ts +11 -0
- package/dist/components/mg-icon.js +6 -0
- package/dist/components/mg-icon2.js +147 -0
- package/dist/components/mg-input-checkbox.d.ts +11 -0
- package/dist/components/mg-input-checkbox.js +222 -0
- package/dist/components/mg-input-date.d.ts +11 -0
- package/dist/components/mg-input-date.js +245 -0
- package/dist/components/mg-input-numeric.d.ts +11 -0
- package/dist/components/mg-input-numeric.js +324 -0
- package/dist/components/mg-input-password.d.ts +11 -0
- package/dist/components/mg-input-password.js +171 -0
- package/dist/components/mg-input-radio.d.ts +11 -0
- package/dist/components/mg-input-radio.js +211 -0
- package/dist/components/mg-input-select.d.ts +11 -0
- package/dist/components/mg-input-select.js +6 -0
- package/dist/components/mg-input-select2.js +243 -0
- package/dist/components/mg-input-text.d.ts +11 -0
- package/dist/components/mg-input-text.js +242 -0
- package/dist/components/mg-input-textarea.d.ts +11 -0
- package/dist/components/mg-input-textarea.js +224 -0
- package/dist/components/mg-input-title.d.ts +11 -0
- package/dist/components/mg-input-title.js +6 -0
- package/dist/components/mg-input-title2.js +55 -0
- package/dist/components/mg-input-toggle.d.ts +11 -0
- package/dist/components/mg-input-toggle.js +247 -0
- package/dist/components/mg-message.d.ts +11 -0
- package/dist/components/mg-message.js +183 -0
- package/dist/components/mg-pagination.d.ts +11 -0
- package/dist/components/mg-pagination.js +175 -0
- package/dist/components/mg-popover.d.ts +11 -0
- package/dist/components/mg-popover.js +183 -0
- package/dist/components/mg-tabs.d.ts +11 -0
- package/dist/components/mg-tabs.js +160 -0
- package/dist/components/mg-tag.d.ts +11 -0
- package/dist/components/mg-tag.js +76 -0
- package/dist/components/mg-tooltip.d.ts +11 -0
- package/dist/components/mg-tooltip.js +6 -0
- package/dist/components/mg-tooltip2.js +150 -0
- package/dist/components/popper.js +1784 -0
- package/dist/esm/css-shim-7c240feb.js +4 -0
- package/dist/esm/index-e3e84606.js +1643 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +31 -0
- package/dist/esm/mg-badge_20.entry.js +4638 -0
- package/dist/esm/mg-components.js +21 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/shadow-css-5d2d01ce.js +388 -0
- package/dist/esm-es5/css-shim-7c240feb.js +1 -0
- package/dist/esm-es5/index-e3e84606.js +1 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/mg-badge_20.entry.js +2 -0
- package/dist/esm-es5/mg-components.js +1 -0
- package/dist/esm-es5/shadow-css-5d2d01ce.js +12 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/mg-components/fonts/OpenSans-Regular.ttf +0 -0
- package/dist/mg-components/fonts/OpenSans-SemiBold.ttf +0 -0
- package/dist/mg-components/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/index.esm.js +0 -0
- package/dist/mg-components/mg-components.css +1 -0
- package/dist/mg-components/mg-components.esm.js +1 -0
- package/dist/mg-components/mg-components.js +132 -0
- package/dist/mg-components/p-1cd24462.system.js +1 -0
- package/dist/mg-components/p-2e2f6b27.system.entry.js +2 -0
- package/dist/mg-components/p-366a224e.js +1 -0
- package/dist/mg-components/p-422c429b.system.js +1 -0
- package/dist/mg-components/p-50ea2036.system.js +1 -0
- package/dist/mg-components/p-62fa3797.js +1 -0
- package/dist/mg-components/p-71d57b8b.system.js +13 -0
- package/dist/mg-components/p-9a215712.system.js +1 -0
- package/dist/mg-components/p-cbf0464b.entry.js +1 -0
- package/dist/mg-components/p-f6455ab3.js +12 -0
- package/dist/mg-components/variables.css +177 -0
- package/dist/mg-components/variables.scss +177 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +8 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +36 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.stories.d.ts +19 -0
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +4 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +67 -0
- package/dist/types/components/atoms/mg-button/mg-button.stories.d.ts +16 -0
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +39 -0
- package/dist/types/components/atoms/mg-character-left/mg-character-left.stories.d.ts +7 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +12 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +36 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.stories.d.ts +26 -0
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +24 -0
- package/dist/types/components/atoms/mg-input-title/mg-input-title.stories.d.ts +6 -0
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +4 -0
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +25 -0
- package/dist/types/components/atoms/mg-tag/mg-tag.stories.d.ts +14 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +56 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.stories.d.ts +11 -0
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +10 -0
- package/dist/types/components/molecules/inputs/MgInput.d.ts +35 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +19 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +120 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.stories.d.ts +6 -0
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +6 -0
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +128 -0
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.stories.d.ts +7 -0
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +10 -0
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +173 -0
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.stories.d.ts +21 -0
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +111 -0
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.stories.d.ts +9 -0
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +9 -0
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +121 -0
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.stories.d.ts +15 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +18 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +133 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.stories.d.ts +14 -0
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +160 -0
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.stories.d.ts +26 -0
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +150 -0
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.stories.d.ts +6 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +8 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +117 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.stories.d.ts +7 -0
- package/dist/types/components/molecules/mg-message/mg-message.conf.d.ts +4 -0
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +76 -0
- package/dist/types/components/molecules/mg-message/mg-message.stories.d.ts +16 -0
- package/dist/types/components/molecules/mg-pagination/mg-pagination.conf.d.ts +4 -0
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +53 -0
- package/dist/types/components/molecules/mg-pagination/mg-pagination.stories.d.ts +6 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +62 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.stories.d.ts +12 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +10 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +63 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.stories.d.ts +7 -0
- package/dist/types/components.d.ts +1987 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/locales/index.d.ts +44 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/stories/buttons.stories.d.ts +13 -0
- package/dist/types/stories/grids.stories.d.ts +5 -0
- package/dist/types/stories/icons.stories.d.ts +13 -0
- package/dist/types/stories/messages.stories.d.ts +13 -0
- package/dist/types/stories/tags.stories.d.ts +5 -0
- package/dist/types/stories/typography.stories.d.ts +5 -0
- package/dist/types/utils/components.utils.d.ts +43 -0
- package/dist/types/utils/locale.utils.d.ts +22 -0
- package/dist/types/utils/test.utils.d.ts +5 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +86 -0
- package/readme.md +159 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Component, h, Prop, State, Watch } from '@stencil/core';
|
|
2
|
+
import { variants } from './mg-tag.conf';
|
|
3
|
+
import { ClassList } from '../../../utils/components.utils';
|
|
4
|
+
export class MgTag {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Define button variant
|
|
8
|
+
*/
|
|
9
|
+
this.variant = variants[0];
|
|
10
|
+
/**
|
|
11
|
+
* Component classes
|
|
12
|
+
*/
|
|
13
|
+
this.classList = new ClassList(['mg-tag']);
|
|
14
|
+
}
|
|
15
|
+
validateVariant(newValue) {
|
|
16
|
+
if (!variants.includes(newValue)) {
|
|
17
|
+
throw new Error(`<mg-tag> prop "variant" must be one of : ${variants.join(', ')}.`);
|
|
18
|
+
}
|
|
19
|
+
this.classList.add(`mg-tag--${this.variant}`);
|
|
20
|
+
}
|
|
21
|
+
validateOutline(newValue) {
|
|
22
|
+
if (newValue)
|
|
23
|
+
this.classList.add(`mg-tag--outline`);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if props are well configured on init
|
|
27
|
+
*/
|
|
28
|
+
componentWillLoad() {
|
|
29
|
+
this.validateVariant(this.variant);
|
|
30
|
+
this.validateOutline(this.outline);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Render
|
|
34
|
+
*/
|
|
35
|
+
render() {
|
|
36
|
+
return (h("span", { class: this.classList.join() },
|
|
37
|
+
h("slot", null)));
|
|
38
|
+
}
|
|
39
|
+
static get is() { return "mg-tag"; }
|
|
40
|
+
static get encapsulation() { return "shadow"; }
|
|
41
|
+
static get originalStyleUrls() { return {
|
|
42
|
+
"$": ["mg-tag.scss"]
|
|
43
|
+
}; }
|
|
44
|
+
static get styleUrls() { return {
|
|
45
|
+
"$": ["mg-tag.css"]
|
|
46
|
+
}; }
|
|
47
|
+
static get properties() { return {
|
|
48
|
+
"variant": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"mutable": false,
|
|
51
|
+
"complexType": {
|
|
52
|
+
"original": "string",
|
|
53
|
+
"resolved": "string",
|
|
54
|
+
"references": {}
|
|
55
|
+
},
|
|
56
|
+
"required": false,
|
|
57
|
+
"optional": true,
|
|
58
|
+
"docs": {
|
|
59
|
+
"tags": [],
|
|
60
|
+
"text": "Define button variant"
|
|
61
|
+
},
|
|
62
|
+
"attribute": "variant",
|
|
63
|
+
"reflect": false,
|
|
64
|
+
"defaultValue": "variants[0]"
|
|
65
|
+
},
|
|
66
|
+
"outline": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "boolean",
|
|
71
|
+
"resolved": "boolean",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": true,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": "Define if button is using outline style"
|
|
79
|
+
},
|
|
80
|
+
"attribute": "outline",
|
|
81
|
+
"reflect": false
|
|
82
|
+
}
|
|
83
|
+
}; }
|
|
84
|
+
static get states() { return {
|
|
85
|
+
"classList": {}
|
|
86
|
+
}; }
|
|
87
|
+
static get watchers() { return [{
|
|
88
|
+
"propName": "variant",
|
|
89
|
+
"methodName": "validateVariant"
|
|
90
|
+
}, {
|
|
91
|
+
"propName": "outline",
|
|
92
|
+
"methodName": "validateOutline"
|
|
93
|
+
}]; }
|
|
94
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { variants } from './mg-tag.conf';
|
|
3
|
+
export default {
|
|
4
|
+
component: 'mg-tag',
|
|
5
|
+
title: 'Atoms/mg-tag',
|
|
6
|
+
argTypes: {
|
|
7
|
+
variant: {
|
|
8
|
+
options: variants,
|
|
9
|
+
control: { type: 'select' },
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
const Template = args => {
|
|
14
|
+
// Extract slot so it won't be render as an attribute
|
|
15
|
+
const slot = args.slot;
|
|
16
|
+
delete args.slot;
|
|
17
|
+
// return element
|
|
18
|
+
return h("mg-tag", Object.assign({}, args), slot);
|
|
19
|
+
};
|
|
20
|
+
export const MgTag = Template.bind({});
|
|
21
|
+
MgTag.args = {
|
|
22
|
+
slot: 'Label',
|
|
23
|
+
variant: variants[0],
|
|
24
|
+
outline: false,
|
|
25
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.mg-tooltip {
|
|
6
|
+
display: none;
|
|
7
|
+
padding: 0.5rem 0.8rem;
|
|
8
|
+
z-index: 9999;
|
|
9
|
+
border-radius: var(--mg-tooltip-border-radius);
|
|
10
|
+
background-color: hsl(var(--mg-tooltip-background-color));
|
|
11
|
+
color: hsl(var(--mg-tooltip-font-color));
|
|
12
|
+
text-align: start;
|
|
13
|
+
}
|
|
14
|
+
.mg-tooltip[data-show] {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
.mg-tooltip .mg-tooltip__arrow,
|
|
18
|
+
.mg-tooltip .mg-tooltip__arrow::before {
|
|
19
|
+
position: absolute;
|
|
20
|
+
width: 0.8rem;
|
|
21
|
+
height: 0.8rem;
|
|
22
|
+
z-index: 9999;
|
|
23
|
+
background: inherit;
|
|
24
|
+
}
|
|
25
|
+
.mg-tooltip .mg-tooltip__arrow {
|
|
26
|
+
visibility: hidden;
|
|
27
|
+
}
|
|
28
|
+
.mg-tooltip .mg-tooltip__arrow::before {
|
|
29
|
+
visibility: visible;
|
|
30
|
+
content: "";
|
|
31
|
+
transform: rotate(45deg);
|
|
32
|
+
}
|
|
33
|
+
.mg-tooltip[data-popper-placement^=top] > .mg-tooltip__arrow {
|
|
34
|
+
bottom: -4px;
|
|
35
|
+
}
|
|
36
|
+
.mg-tooltip[data-popper-placement^=bottom] > .mg-tooltip__arrow {
|
|
37
|
+
top: -4px;
|
|
38
|
+
}
|
|
39
|
+
.mg-tooltip[data-popper-placement^=left] > .mg-tooltip__arrow {
|
|
40
|
+
right: -4px;
|
|
41
|
+
}
|
|
42
|
+
.mg-tooltip[data-popper-placement^=right] > .mg-tooltip__arrow {
|
|
43
|
+
left: -4px;
|
|
44
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';
|
|
2
|
+
import { createID } from '../../../utils/components.utils';
|
|
3
|
+
import { createPopper } from '@popperjs/core';
|
|
4
|
+
export class MgTooltip {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Sets an `id` attribute.
|
|
8
|
+
* Needed by the input for accessibility `aria-decribedby`.
|
|
9
|
+
*/
|
|
10
|
+
this.identifier = createID('mg-tooltip');
|
|
11
|
+
/**
|
|
12
|
+
* Tooltip placement
|
|
13
|
+
*/
|
|
14
|
+
this.placement = 'bottom';
|
|
15
|
+
/**
|
|
16
|
+
* Display tooltip
|
|
17
|
+
*/
|
|
18
|
+
this.display = false;
|
|
19
|
+
/**
|
|
20
|
+
* Disable tooltip
|
|
21
|
+
*/
|
|
22
|
+
this.disabled = false;
|
|
23
|
+
/**
|
|
24
|
+
* Show tooltip
|
|
25
|
+
* @returns {void}
|
|
26
|
+
*/
|
|
27
|
+
this.show = () => {
|
|
28
|
+
// Make the tooltip visible
|
|
29
|
+
this.tooltip.setAttribute('data-show', '');
|
|
30
|
+
// Enable the event listeners
|
|
31
|
+
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
32
|
+
// Update its position
|
|
33
|
+
this.popper.update();
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Hide tooltip
|
|
37
|
+
* @returns {void}
|
|
38
|
+
*/
|
|
39
|
+
this.hide = () => {
|
|
40
|
+
// Hide the tooltip
|
|
41
|
+
this.tooltip.removeAttribute('data-show');
|
|
42
|
+
// Disable the event listeners
|
|
43
|
+
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
handleDisplay(newVal) {
|
|
47
|
+
if (newVal) {
|
|
48
|
+
this.show();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.hide();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/*************
|
|
55
|
+
* Lifecycle *
|
|
56
|
+
*************/
|
|
57
|
+
/**
|
|
58
|
+
* Get slotted element
|
|
59
|
+
* Check if it already contain an interactive element, if not we need to add a tabIndex attribute
|
|
60
|
+
* We need to attach the focused element to the tooltip (aria-describedby)
|
|
61
|
+
*/
|
|
62
|
+
componentDidLoad() {
|
|
63
|
+
var _a;
|
|
64
|
+
// Get tooltip element
|
|
65
|
+
this.tooltip = this.element.querySelector(`#${this.identifier}`);
|
|
66
|
+
// get slotted element
|
|
67
|
+
const slotElement = this.element.firstElementChild;
|
|
68
|
+
// Get interactive element
|
|
69
|
+
const interactiveElements = ['a', 'button', 'input', 'textarea', 'select']; //! Might needs updates
|
|
70
|
+
const interactiveElement = this.element.querySelector(interactiveElements.join(',')) || ((_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(interactiveElements.join(',')));
|
|
71
|
+
// define selected element to become tooltip selector
|
|
72
|
+
const tooltipedElement = interactiveElement || slotElement;
|
|
73
|
+
// Add tabindex to slotted element if we can't find any interactive element
|
|
74
|
+
if (interactiveElement === null || interactiveElement === undefined)
|
|
75
|
+
slotElement.tabIndex = 0;
|
|
76
|
+
// Set aria-describedby
|
|
77
|
+
const ariaDescribedby = slotElement.getAttribute('aria-describedby');
|
|
78
|
+
if (ariaDescribedby === null) {
|
|
79
|
+
tooltipedElement.setAttribute('aria-describedby', this.identifier);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
slotElement.setAttribute('aria-describedby', `${ariaDescribedby} ${this.identifier}`);
|
|
83
|
+
}
|
|
84
|
+
// Create popperjs tooltip
|
|
85
|
+
this.popper = createPopper(tooltipedElement, this.tooltip, {
|
|
86
|
+
placement: this.placement,
|
|
87
|
+
modifiers: [
|
|
88
|
+
{
|
|
89
|
+
name: 'offset',
|
|
90
|
+
options: {
|
|
91
|
+
offset: [0, 8],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
// Add events
|
|
97
|
+
['mouseenter', 'focus'].forEach(event => {
|
|
98
|
+
tooltipedElement.addEventListener(event, () => {
|
|
99
|
+
if (!this.disabled)
|
|
100
|
+
this.display = true;
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
['mouseleave', 'blur', 'keydown'].forEach(event => {
|
|
104
|
+
tooltipedElement.addEventListener(event, (e) => {
|
|
105
|
+
// we continue to process ONLY for KeyboardEvents 'Escape'
|
|
106
|
+
if (e.type === 'keydown' && e.code !== 'Escape') {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (!this.disabled)
|
|
110
|
+
this.display = false;
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
this.handleDisplay(this.display);
|
|
114
|
+
}
|
|
115
|
+
render() {
|
|
116
|
+
return (h(Host, null,
|
|
117
|
+
h("slot", null),
|
|
118
|
+
h("div", { role: "tooltip", id: this.identifier, class: "mg-tooltip", innerHTML: this.message },
|
|
119
|
+
h("div", { class: "mg-tooltip__arrow", "data-popper-arrow": true }))));
|
|
120
|
+
}
|
|
121
|
+
static get is() { return "mg-tooltip"; }
|
|
122
|
+
static get encapsulation() { return "scoped"; }
|
|
123
|
+
static get originalStyleUrls() { return {
|
|
124
|
+
"$": ["mg-tooltip.scss"]
|
|
125
|
+
}; }
|
|
126
|
+
static get styleUrls() { return {
|
|
127
|
+
"$": ["mg-tooltip.css"]
|
|
128
|
+
}; }
|
|
129
|
+
static get properties() { return {
|
|
130
|
+
"identifier": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "string",
|
|
135
|
+
"resolved": "string",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": "Sets an `id` attribute.\nNeeded by the input for accessibility `aria-decribedby`."
|
|
143
|
+
},
|
|
144
|
+
"attribute": "identifier",
|
|
145
|
+
"reflect": false,
|
|
146
|
+
"defaultValue": "createID('mg-tooltip')"
|
|
147
|
+
},
|
|
148
|
+
"message": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"mutable": false,
|
|
151
|
+
"complexType": {
|
|
152
|
+
"original": "string",
|
|
153
|
+
"resolved": "string",
|
|
154
|
+
"references": {}
|
|
155
|
+
},
|
|
156
|
+
"required": true,
|
|
157
|
+
"optional": false,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": "Displayed message in the tooltip"
|
|
161
|
+
},
|
|
162
|
+
"attribute": "message",
|
|
163
|
+
"reflect": false
|
|
164
|
+
},
|
|
165
|
+
"placement": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "| 'auto'\n | 'auto-start'\n | 'auto-end'\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end'",
|
|
170
|
+
"resolved": "\"auto\" | \"auto-end\" | \"auto-start\" | \"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
171
|
+
"references": {}
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"optional": false,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": "Tooltip placement"
|
|
178
|
+
},
|
|
179
|
+
"attribute": "placement",
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"defaultValue": "'bottom'"
|
|
182
|
+
},
|
|
183
|
+
"display": {
|
|
184
|
+
"type": "boolean",
|
|
185
|
+
"mutable": true,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "boolean",
|
|
188
|
+
"resolved": "boolean",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": false,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "Display tooltip"
|
|
196
|
+
},
|
|
197
|
+
"attribute": "display",
|
|
198
|
+
"reflect": false,
|
|
199
|
+
"defaultValue": "false"
|
|
200
|
+
},
|
|
201
|
+
"disabled": {
|
|
202
|
+
"type": "boolean",
|
|
203
|
+
"mutable": true,
|
|
204
|
+
"complexType": {
|
|
205
|
+
"original": "boolean",
|
|
206
|
+
"resolved": "boolean",
|
|
207
|
+
"references": {}
|
|
208
|
+
},
|
|
209
|
+
"required": false,
|
|
210
|
+
"optional": false,
|
|
211
|
+
"docs": {
|
|
212
|
+
"tags": [],
|
|
213
|
+
"text": "Disable tooltip"
|
|
214
|
+
},
|
|
215
|
+
"attribute": "disabled",
|
|
216
|
+
"reflect": false,
|
|
217
|
+
"defaultValue": "false"
|
|
218
|
+
}
|
|
219
|
+
}; }
|
|
220
|
+
static get elementRef() { return "element"; }
|
|
221
|
+
static get watchers() { return [{
|
|
222
|
+
"propName": "display",
|
|
223
|
+
"methodName": "handleDisplay"
|
|
224
|
+
}]; }
|
|
225
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
export default {
|
|
3
|
+
component: 'mg-tooltip',
|
|
4
|
+
title: 'Atoms/mg-tooltip',
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: 'centered',
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
const Template = args => (h("mg-tooltip", Object.assign({}, args),
|
|
10
|
+
h("mg-icon", { icon: "info-circle" })));
|
|
11
|
+
export const MgTooltip = Template.bind({});
|
|
12
|
+
MgTooltip.args = {
|
|
13
|
+
identifier: 'identifier',
|
|
14
|
+
message: 'This is a tooltip message',
|
|
15
|
+
placement: 'bottom',
|
|
16
|
+
display: false,
|
|
17
|
+
disabled: false,
|
|
18
|
+
};
|
|
19
|
+
const TemplateButton = args => (h("mg-tooltip", Object.assign({}, args),
|
|
20
|
+
h("mg-button", null, "Action")));
|
|
21
|
+
export const MgTooltipOnButton = TemplateButton.bind({});
|
|
22
|
+
MgTooltipOnButton.args = Object.assign({}, MgTooltip.args);
|
|
23
|
+
const TemplateSpan = args => (h("mg-tooltip", Object.assign({}, args),
|
|
24
|
+
h("span", null, "any text")));
|
|
25
|
+
export const MgTooltipOnSpan = TemplateSpan.bind({});
|
|
26
|
+
MgTooltipOnSpan.args = Object.assign({}, MgTooltip.args);
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { InputClass } from './MgInput.conf';
|
|
3
|
+
/**
|
|
4
|
+
* Apply in all input child node the aria-describedby attribute
|
|
5
|
+
* @param children
|
|
6
|
+
* @param ariaDescribedbyIDs
|
|
7
|
+
* @param utils
|
|
8
|
+
* @returns {VNode[]}
|
|
9
|
+
*/
|
|
10
|
+
const applyAriadescribedBy = (children, ariaDescribedbyIDs, utils) => utils.map(children, child => {
|
|
11
|
+
if (['input', 'select', 'textarea'].includes(child.vtag)) {
|
|
12
|
+
return Object.assign(Object.assign({}, child), { vattrs: Object.assign(Object.assign({}, child.vattrs), { 'aria-describedby': [...ariaDescribedbyIDs].join(' ') }) });
|
|
13
|
+
}
|
|
14
|
+
// we recursively apply ariadescribedBy attributes to child input nodes if exists
|
|
15
|
+
if (child.vchildren === null)
|
|
16
|
+
return Object.assign({}, child);
|
|
17
|
+
return Object.assign(Object.assign({}, child), { vchildren: applyAriadescribedBy(child.vchildren, ariaDescribedbyIDs, utils) });
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Add classes based on props
|
|
21
|
+
* @param props
|
|
22
|
+
*/
|
|
23
|
+
const manageClasses = (props) => {
|
|
24
|
+
props.classList.add('mg-input');
|
|
25
|
+
if (props.labelOnTop)
|
|
26
|
+
props.classList.add('mg-input--label-on-top');
|
|
27
|
+
if (props.readonly)
|
|
28
|
+
props.classList.add('mg-input--readonly');
|
|
29
|
+
if (props.width !== undefined)
|
|
30
|
+
props.classList.add(`mg-input--width-${props.width}`);
|
|
31
|
+
if (props.readonly || props.disabled) {
|
|
32
|
+
props.classList.delete(InputClass.ERROR);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Define tagname based on props
|
|
37
|
+
* @param isFieldset
|
|
38
|
+
* @returns {string} tag name
|
|
39
|
+
*/
|
|
40
|
+
const getTagName = (isFieldset) => (isFieldset ? 'fieldset' : 'div');
|
|
41
|
+
/**
|
|
42
|
+
* Get input template
|
|
43
|
+
* @param props MgInput Interface Props
|
|
44
|
+
* @param children Represent scoped elements
|
|
45
|
+
* @param utils Stencil.js utils
|
|
46
|
+
* @returns JSX template
|
|
47
|
+
*/
|
|
48
|
+
export const MgInput = (props, children, utils) => {
|
|
49
|
+
/**
|
|
50
|
+
* Check required properties
|
|
51
|
+
*/
|
|
52
|
+
if (typeof props.label !== 'string' || props.label === '') {
|
|
53
|
+
throw new Error('<mg-input> prop "label" is required');
|
|
54
|
+
}
|
|
55
|
+
if (props.labelOnTop && props.labelHide) {
|
|
56
|
+
throw new Error('<mg-input> prop "labelOnTop" must not be paired with the prop "labelHide"');
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Component classes
|
|
60
|
+
*/
|
|
61
|
+
manageClasses(props);
|
|
62
|
+
/**
|
|
63
|
+
* a11y IDs
|
|
64
|
+
*/
|
|
65
|
+
const ariaDescribedbyIDs = new Set();
|
|
66
|
+
// Character Left
|
|
67
|
+
const characterLeftId = `${props.identifier}-character-left`;
|
|
68
|
+
if (props.classList.has('is-focused') && props.displayCharacterLeft) {
|
|
69
|
+
ariaDescribedbyIDs.add(characterLeftId);
|
|
70
|
+
}
|
|
71
|
+
// Help text
|
|
72
|
+
const helpTextId = `${props.identifier}-help-text`;
|
|
73
|
+
if (typeof props.helpText === 'string' && props.helpText !== '') {
|
|
74
|
+
ariaDescribedbyIDs.add(helpTextId);
|
|
75
|
+
}
|
|
76
|
+
// Error Message
|
|
77
|
+
const helpTextErrorId = `${props.identifier}-error`;
|
|
78
|
+
if (typeof props.errorMessage === 'string' && props.errorMessage !== '') {
|
|
79
|
+
ariaDescribedbyIDs.add(helpTextErrorId);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Update input(s) in children
|
|
83
|
+
*/
|
|
84
|
+
if (props.readonly) {
|
|
85
|
+
children = children.filter(child => child.$name$ === 'append-input');
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
children = applyAriadescribedBy(children, ariaDescribedbyIDs, utils);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Return template
|
|
92
|
+
*
|
|
93
|
+
* +--------+--------------+---------+
|
|
94
|
+
* | label | input | tooltip |
|
|
95
|
+
* | +--------------+---------+
|
|
96
|
+
* | | nb Char Left |
|
|
97
|
+
* | +------------------------+
|
|
98
|
+
* | | Help Text |
|
|
99
|
+
* | +------------------------+
|
|
100
|
+
* | | Error |
|
|
101
|
+
* +--------+------------------------+
|
|
102
|
+
*
|
|
103
|
+
* Error message is based on this aria method: https://www.w3.org/WAI/tutorials/forms/notifications/#on-focus-change
|
|
104
|
+
*/
|
|
105
|
+
const TagName = getTagName(props.isFieldset);
|
|
106
|
+
/**
|
|
107
|
+
* Get tooltip node
|
|
108
|
+
* @returns mg-tooltip
|
|
109
|
+
*/
|
|
110
|
+
const getTooltip = () => (h("mg-tooltip", { identifier: `${props.identifier}-tooltip`, message: props.tooltip },
|
|
111
|
+
h("mg-icon", { icon: "info-circle" })));
|
|
112
|
+
/**
|
|
113
|
+
* Get input title (label) node
|
|
114
|
+
* @returns mg-input-title
|
|
115
|
+
*/
|
|
116
|
+
const getInputTitle = () => (h("mg-input-title", { identifier: props.identifier, class: props.labelHide ? 'sr-only' : undefined, required: props.required, "is-legend": props.isFieldset }, props.label));
|
|
117
|
+
return (h(TagName, { class: props.classList.join() },
|
|
118
|
+
props.labelOnTop ? (h("div", { class: "mg-input__title" },
|
|
119
|
+
getInputTitle(),
|
|
120
|
+
!props.readonly && props.tooltip && getTooltip())) : (getInputTitle()),
|
|
121
|
+
props.readonly ? (h("div", { class: "mg-input__input-container" },
|
|
122
|
+
h("strong", null, props.readonlyValue || props.value),
|
|
123
|
+
children)) : (h("div", { class: "mg-input__input-container" },
|
|
124
|
+
h("div", { class: "mg-input__input" },
|
|
125
|
+
children,
|
|
126
|
+
!props.labelOnTop && props.tooltip && getTooltip()),
|
|
127
|
+
props.displayCharacterLeft && props.maxlength && props.classList.has('is-focused') && (h("mg-character-left", { identifier: characterLeftId, characters: props.value, maxlength: props.maxlength, template: props.characterLeftTemplate })),
|
|
128
|
+
props.helpText && h("div", { id: helpTextId, class: "mg-input__help-text", innerHTML: props.helpText }),
|
|
129
|
+
props.errorMessage && h("div", { id: helpTextErrorId, class: "mg-input__error", innerHTML: props.errorMessage, "aria-live": "assertive" })))));
|
|
130
|
+
};
|
package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|