@mgdis/mg-components 4.1.1 → 4.2.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.
Files changed (130) hide show
  1. package/dist/cjs/{index-dd2c7f7b.js → index-94497267.js} +455 -317
  2. package/dist/cjs/loader.cjs.js +3 -3
  3. package/dist/cjs/{mg-badge_24.cjs.entry.js → mg-badge_23.cjs.entry.js} +219 -2181
  4. package/dist/cjs/mg-components.cjs.js +3 -26
  5. package/dist/cjs/mg-modal.cjs.entry.js +15 -2
  6. package/dist/cjs/mg-popover.cjs.entry.js +171 -0
  7. package/dist/cjs/popper-11d5f714.js +1801 -0
  8. package/dist/collection/collection-manifest.json +2 -2
  9. package/dist/collection/components/atoms/mg-badge/mg-badge.js +118 -99
  10. package/dist/collection/components/atoms/mg-button/mg-button.js +221 -220
  11. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +72 -69
  12. package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +1 -2
  13. package/dist/collection/components/atoms/mg-icon/mg-icon.js +102 -92
  14. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +85 -67
  15. package/dist/collection/components/atoms/mg-tag/mg-tag.js +64 -55
  16. package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +3 -6
  17. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +122 -106
  18. package/dist/collection/components/molecules/inputs/MgInput.js +10 -17
  19. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +323 -318
  20. package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +3 -2
  21. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +356 -361
  22. package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +1 -2
  23. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +463 -457
  24. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +347 -340
  25. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +348 -343
  26. package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +4 -3
  27. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +406 -401
  28. package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +12 -15
  29. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +2 -0
  30. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +476 -473
  31. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +461 -456
  32. package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +2 -8
  33. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +1 -0
  34. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +299 -298
  35. package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +1 -3
  36. package/dist/collection/components/molecules/mg-details/mg-details.js +95 -93
  37. package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +13 -27
  38. package/dist/collection/components/molecules/mg-form/mg-form.js +175 -166
  39. package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +2 -6
  40. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +37 -37
  41. package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +1 -3
  42. package/dist/collection/components/molecules/mg-message/mg-message.js +154 -153
  43. package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +11 -15
  44. package/dist/collection/components/molecules/mg-modal/mg-modal.css +2 -2
  45. package/dist/collection/components/molecules/mg-modal/mg-modal.js +153 -134
  46. package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +5 -6
  47. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +112 -117
  48. package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +1 -8
  49. package/dist/collection/components/molecules/mg-panel/mg-panel.css +2 -2
  50. package/dist/collection/components/molecules/mg-panel/mg-panel.js +194 -189
  51. package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +1 -4
  52. package/dist/collection/components/molecules/mg-popover/mg-popover.css +3 -5
  53. package/dist/collection/components/molecules/mg-popover/mg-popover.js +129 -127
  54. package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +1 -5
  55. package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +1 -0
  56. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +152 -135
  57. package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
  58. package/dist/collection/locales/en/messages.json +50 -0
  59. package/dist/collection/locales/fr/messages.json +50 -0
  60. package/dist/collection/stories/grids.stories.js +1 -44
  61. package/dist/collection/stories/helpers.stories.js +1 -19
  62. package/dist/collection/stories/icons.stories.js +1 -4
  63. package/dist/collection/stories/typography.stories.js +1 -12
  64. package/dist/collection/variables.css +3 -2
  65. package/dist/collection/variables.scss +3 -2
  66. package/dist/components/MgInput.js +8 -3
  67. package/dist/components/mg-badge2.js +9 -0
  68. package/dist/components/mg-button2.js +2 -7
  69. package/dist/components/mg-input-checkbox.js +1 -6
  70. package/dist/components/mg-input-date.js +10 -27
  71. package/dist/components/mg-input-numeric.js +2 -7
  72. package/dist/components/mg-input-password.js +1 -6
  73. package/dist/components/mg-input-radio.js +1 -6
  74. package/dist/components/mg-input-select2.js +1 -6
  75. package/dist/components/mg-input-text2.js +3 -8
  76. package/dist/components/mg-input-textarea.js +2 -7
  77. package/dist/components/mg-input-title2.js +11 -0
  78. package/dist/components/mg-input-toggle.js +2 -7
  79. package/dist/components/mg-modal.js +14 -1
  80. package/dist/components/mg-pagination.js +3 -3
  81. package/dist/components/mg-panel.js +10 -4
  82. package/dist/components/mg-popover.js +1 -1
  83. package/dist/components/mg-tabs.js +10 -1
  84. package/dist/components/mg-tooltip2.js +9 -0
  85. package/dist/components/popper.js +60 -49
  86. package/dist/esm/{index-f58b769f.js → index-aad0184c.js} +456 -317
  87. package/dist/esm/loader.js +3 -3
  88. package/dist/esm/{mg-badge_24.entry.js → mg-badge_23.entry.js} +220 -2181
  89. package/dist/esm/mg-components.js +3 -26
  90. package/dist/esm/mg-modal.entry.js +15 -2
  91. package/dist/esm/mg-popover.entry.js +167 -0
  92. package/dist/esm/polyfills/css-shim.js +1 -1
  93. package/dist/esm/popper-f860750c.js +1799 -0
  94. package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
  95. package/dist/mg-components/locales/en/messages.json +50 -0
  96. package/dist/mg-components/locales/fr/messages.json +50 -0
  97. package/dist/mg-components/mg-components.css +1 -1
  98. package/dist/mg-components/mg-components.esm.js +1 -1
  99. package/dist/mg-components/p-25452f60.entry.js +1 -0
  100. package/dist/mg-components/p-3899d5d2.js +2 -0
  101. package/dist/mg-components/p-a20fc541.entry.js +1 -0
  102. package/dist/mg-components/p-e08bc19a.entry.js +1 -0
  103. package/dist/mg-components/p-ec26fc38.js +1 -0
  104. package/dist/mg-components/variables.css +3 -2
  105. package/dist/mg-components/variables.scss +3 -2
  106. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -0
  107. package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -1
  108. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -0
  109. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +1 -0
  110. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +0 -1
  111. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -10
  112. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +0 -1
  113. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +0 -1
  114. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -1
  115. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -1
  116. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +0 -1
  117. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -1
  118. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +0 -1
  119. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +2 -0
  120. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
  121. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -0
  122. package/dist/types/components.d.ts +29 -29
  123. package/dist/types/stencil-public-runtime.d.ts +15 -4
  124. package/loader/package.json +1 -0
  125. package/package.json +9 -9
  126. package/dist/collection/fonts/Poppins-Bold.ttf +0 -0
  127. package/dist/mg-components/fonts/Poppins-Bold.ttf +0 -0
  128. package/dist/mg-components/p-2a3d8f60.entry.js +0 -1
  129. package/dist/mg-components/p-b6df1cac.js +0 -2
  130. package/dist/mg-components/p-c8779533.entry.js +0 -1
@@ -28,8 +28,8 @@
28
28
  ],
29
29
  "compiler": {
30
30
  "name": "@stencil/core",
31
- "version": "2.17.4",
32
- "typescriptVersion": "4.5.4"
31
+ "version": "2.18.1",
32
+ "typescriptVersion": "4.7.4"
33
33
  },
34
34
  "collections": [],
35
35
  "bundles": []
@@ -1,4 +1,4 @@
1
- import { Component, h, Prop, State, Watch } from '@stencil/core';
1
+ import { h } from '@stencil/core';
2
2
  import { variants } from './mg-badge.conf';
3
3
  import { ClassList } from '../../../utils/components.utils';
4
4
  export class MgBadge {
@@ -22,6 +22,13 @@ export class MgBadge {
22
22
  throw new Error('<mg-badge> prop "value" must be interger or ponctuation character.');
23
23
  }
24
24
  }
25
+ validateLabel(newValue) {
26
+ if (typeof newValue !== 'string' || newValue.trim() === '') {
27
+ // TODO: throw new Error on next major (5.0.0)
28
+ // throw new Error('<mg-badge> prop "label" is required.');
29
+ console.error('<mg-badge> prop "label" is required.');
30
+ }
31
+ }
25
32
  validateVariant(newValue, oldValue) {
26
33
  if (!variants.includes(newValue)) {
27
34
  throw new Error(`<mg-badge> prop "variant" must be one of : ${variants.join(', ')}.`);
@@ -46,6 +53,7 @@ export class MgBadge {
46
53
  */
47
54
  componentWillLoad() {
48
55
  this.validateValue(this.value);
56
+ this.validateLabel(this.label);
49
57
  this.validateVariant(this.variant);
50
58
  this.validateOutline(this.outline);
51
59
  }
@@ -55,110 +63,121 @@ export class MgBadge {
55
63
  * @returns {HTMLElement} HTML Element
56
64
  */
57
65
  render() {
58
- return (h("span", { class: this.classList.join() },
59
- this.value,
60
- h("span", { class: "sr-only" }, this.label)));
66
+ return (h("span", { class: this.classList.join() }, this.value, h("span", { class: "sr-only" }, this.label)));
61
67
  }
62
68
  static get is() { return "mg-badge"; }
63
69
  static get encapsulation() { return "shadow"; }
64
- static get originalStyleUrls() { return {
65
- "$": ["mg-badge.scss"]
66
- }; }
67
- static get styleUrls() { return {
68
- "$": ["mg-badge.css"]
69
- }; }
70
- static get properties() { return {
71
- "value": {
72
- "type": "any",
73
- "mutable": true,
74
- "complexType": {
75
- "original": "BadgeType['value']",
76
- "resolved": "number | string",
77
- "references": {
78
- "BadgeType": {
79
- "location": "import",
80
- "path": "./mg-badge.conf"
70
+ static get originalStyleUrls() {
71
+ return {
72
+ "$": ["mg-badge.scss"]
73
+ };
74
+ }
75
+ static get styleUrls() {
76
+ return {
77
+ "$": ["mg-badge.css"]
78
+ };
79
+ }
80
+ static get properties() {
81
+ return {
82
+ "value": {
83
+ "type": "any",
84
+ "mutable": true,
85
+ "complexType": {
86
+ "original": "BadgeType['value']",
87
+ "resolved": "number | string",
88
+ "references": {
89
+ "BadgeType": {
90
+ "location": "import",
91
+ "path": "./mg-badge.conf"
92
+ }
81
93
  }
82
- }
94
+ },
95
+ "required": true,
96
+ "optional": false,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": "Badge value"
100
+ },
101
+ "attribute": "value",
102
+ "reflect": false
83
103
  },
84
- "required": true,
85
- "optional": false,
86
- "docs": {
87
- "tags": [],
88
- "text": "Badge value"
89
- },
90
- "attribute": "value",
91
- "reflect": false
92
- },
93
- "label": {
94
- "type": "string",
95
- "mutable": false,
96
- "complexType": {
97
- "original": "BadgeType['label']",
98
- "resolved": "string",
99
- "references": {
100
- "BadgeType": {
101
- "location": "import",
102
- "path": "./mg-badge.conf"
104
+ "label": {
105
+ "type": "string",
106
+ "mutable": false,
107
+ "complexType": {
108
+ "original": "BadgeType['label']",
109
+ "resolved": "string",
110
+ "references": {
111
+ "BadgeType": {
112
+ "location": "import",
113
+ "path": "./mg-badge.conf"
114
+ }
103
115
  }
104
- }
105
- },
106
- "required": true,
107
- "optional": false,
108
- "docs": {
109
- "tags": [],
110
- "text": "Badge label. Include short description.\nRequired for accessibility"
111
- },
112
- "attribute": "label",
113
- "reflect": false
114
- },
115
- "variant": {
116
- "type": "string",
117
- "mutable": false,
118
- "complexType": {
119
- "original": "string",
120
- "resolved": "string",
121
- "references": {}
116
+ },
117
+ "required": true,
118
+ "optional": false,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": "Badge label. Include short description.\nRequired for accessibility"
122
+ },
123
+ "attribute": "label",
124
+ "reflect": false
122
125
  },
123
- "required": false,
124
- "optional": false,
125
- "docs": {
126
- "tags": [],
127
- "text": "Define button variant"
126
+ "variant": {
127
+ "type": "string",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "string",
131
+ "resolved": "string",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "Define button variant"
139
+ },
140
+ "attribute": "variant",
141
+ "reflect": false,
142
+ "defaultValue": "variants[0]"
128
143
  },
129
- "attribute": "variant",
130
- "reflect": false,
131
- "defaultValue": "variants[0]"
132
- },
133
- "outline": {
134
- "type": "boolean",
135
- "mutable": false,
136
- "complexType": {
137
- "original": "boolean",
138
- "resolved": "boolean",
139
- "references": {}
140
- },
141
- "required": false,
142
- "optional": false,
143
- "docs": {
144
- "tags": [],
145
- "text": "Define if button is using outline style"
146
- },
147
- "attribute": "outline",
148
- "reflect": false
149
- }
150
- }; }
151
- static get states() { return {
152
- "classList": {}
153
- }; }
154
- static get watchers() { return [{
155
- "propName": "value",
156
- "methodName": "validateValue"
157
- }, {
158
- "propName": "variant",
159
- "methodName": "validateVariant"
160
- }, {
161
- "propName": "outline",
162
- "methodName": "validateOutline"
163
- }]; }
144
+ "outline": {
145
+ "type": "boolean",
146
+ "mutable": false,
147
+ "complexType": {
148
+ "original": "boolean",
149
+ "resolved": "boolean",
150
+ "references": {}
151
+ },
152
+ "required": false,
153
+ "optional": false,
154
+ "docs": {
155
+ "tags": [],
156
+ "text": "Define if button is using outline style"
157
+ },
158
+ "attribute": "outline",
159
+ "reflect": false
160
+ }
161
+ };
162
+ }
163
+ static get states() {
164
+ return {
165
+ "classList": {}
166
+ };
167
+ }
168
+ static get watchers() {
169
+ return [{
170
+ "propName": "value",
171
+ "methodName": "validateValue"
172
+ }, {
173
+ "propName": "label",
174
+ "methodName": "validateLabel"
175
+ }, {
176
+ "propName": "variant",
177
+ "methodName": "validateVariant"
178
+ }, {
179
+ "propName": "outline",
180
+ "methodName": "validateOutline"
181
+ }];
182
+ }
164
183
  }