@mgdis/mg-components 4.1.0 → 4.2.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.
Files changed (123) hide show
  1. package/dist/cjs/{index-88560a66.js → index-64cee0c8.js} +248 -81
  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} +206 -2180
  4. package/dist/cjs/mg-components.cjs.js +3 -3
  5. package/dist/cjs/mg-modal.cjs.entry.js +8 -1
  6. package/dist/cjs/mg-popover.cjs.entry.js +171 -0
  7. package/dist/cjs/popper-71bf3058.js +1790 -0
  8. package/dist/collection/collection-manifest.json +2 -2
  9. package/dist/collection/components/atoms/mg-badge/mg-badge.js +116 -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 +83 -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 +120 -106
  18. package/dist/collection/components/molecules/inputs/MgInput.js +8 -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 +462 -456
  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.js +147 -134
  45. package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +5 -6
  46. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +112 -117
  47. package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +1 -8
  48. package/dist/collection/components/molecules/mg-panel/mg-panel.css +2 -2
  49. package/dist/collection/components/molecules/mg-panel/mg-panel.js +192 -189
  50. package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +1 -4
  51. package/dist/collection/components/molecules/mg-popover/mg-popover.js +129 -127
  52. package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +1 -5
  53. package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +1 -0
  54. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +150 -135
  55. package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
  56. package/dist/collection/locales/en/messages.json +50 -0
  57. package/dist/collection/locales/fr/messages.json +50 -0
  58. package/dist/collection/stories/grids.stories.js +1 -44
  59. package/dist/collection/stories/helpers.stories.js +1 -19
  60. package/dist/collection/stories/icons.stories.js +1 -4
  61. package/dist/collection/stories/typography.stories.js +1 -12
  62. package/dist/collection/variables.css +3 -2
  63. package/dist/collection/variables.scss +3 -2
  64. package/dist/components/MgInput.js +6 -3
  65. package/dist/components/mg-badge2.js +7 -0
  66. package/dist/components/mg-button2.js +2 -7
  67. package/dist/components/mg-input-checkbox.js +1 -6
  68. package/dist/components/mg-input-date.js +10 -27
  69. package/dist/components/mg-input-numeric.js +1 -6
  70. package/dist/components/mg-input-password.js +1 -6
  71. package/dist/components/mg-input-radio.js +1 -6
  72. package/dist/components/mg-input-select2.js +1 -6
  73. package/dist/components/mg-input-text2.js +3 -8
  74. package/dist/components/mg-input-textarea.js +2 -7
  75. package/dist/components/mg-input-title2.js +9 -0
  76. package/dist/components/mg-input-toggle.js +2 -7
  77. package/dist/components/mg-modal.js +7 -0
  78. package/dist/components/mg-pagination.js +3 -3
  79. package/dist/components/mg-panel.js +8 -4
  80. package/dist/components/mg-tabs.js +8 -1
  81. package/dist/components/mg-tooltip2.js +7 -0
  82. package/dist/esm/{index-bca81100.js → index-120f47fd.js} +248 -81
  83. package/dist/esm/loader.js +3 -3
  84. package/dist/esm/{mg-badge_24.entry.js → mg-badge_23.entry.js} +207 -2180
  85. package/dist/esm/mg-components.js +3 -3
  86. package/dist/esm/mg-modal.entry.js +8 -1
  87. package/dist/esm/mg-popover.entry.js +167 -0
  88. package/dist/esm/popper-93ecb064.js +1788 -0
  89. package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
  90. package/dist/mg-components/locales/en/messages.json +50 -0
  91. package/dist/mg-components/locales/fr/messages.json +50 -0
  92. package/dist/mg-components/mg-components.css +1 -1
  93. package/dist/mg-components/mg-components.esm.js +1 -1
  94. package/dist/mg-components/p-21991be8.entry.js +1 -0
  95. package/dist/mg-components/p-36a64f8c.entry.js +1 -0
  96. package/dist/mg-components/p-4c66f794.js +1 -0
  97. package/dist/mg-components/{p-b14a3443.js → p-7bc32a2f.js} +0 -0
  98. package/dist/mg-components/p-b380a0df.entry.js +1 -0
  99. package/dist/mg-components/variables.css +3 -2
  100. package/dist/mg-components/variables.scss +3 -2
  101. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -0
  102. package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -1
  103. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -0
  104. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +1 -0
  105. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +0 -1
  106. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -10
  107. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +0 -1
  108. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +0 -1
  109. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -1
  110. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -1
  111. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +0 -1
  112. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -1
  113. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +0 -1
  114. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -0
  115. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
  116. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -0
  117. package/dist/types/components.d.ts +29 -29
  118. package/loader/package.json +1 -0
  119. package/package.json +8 -8
  120. package/dist/collection/fonts/Poppins-Bold.ttf +0 -0
  121. package/dist/mg-components/fonts/Poppins-Bold.ttf +0 -0
  122. package/dist/mg-components/p-a2883dc7.entry.js +0 -1
  123. package/dist/mg-components/p-cffe0519.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.0",
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,11 @@ 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
+ throw new Error('<mg-badge> prop "label" is required.');
28
+ }
29
+ }
25
30
  validateVariant(newValue, oldValue) {
26
31
  if (!variants.includes(newValue)) {
27
32
  throw new Error(`<mg-badge> prop "variant" must be one of : ${variants.join(', ')}.`);
@@ -46,6 +51,7 @@ export class MgBadge {
46
51
  */
47
52
  componentWillLoad() {
48
53
  this.validateValue(this.value);
54
+ this.validateLabel(this.label);
49
55
  this.validateVariant(this.variant);
50
56
  this.validateOutline(this.outline);
51
57
  }
@@ -55,110 +61,121 @@ export class MgBadge {
55
61
  * @returns {HTMLElement} HTML Element
56
62
  */
57
63
  render() {
58
- return (h("span", { class: this.classList.join() },
59
- this.value,
60
- h("span", { class: "sr-only" }, this.label)));
64
+ return (h("span", { class: this.classList.join() }, this.value, h("span", { class: "sr-only" }, this.label)));
61
65
  }
62
66
  static get is() { return "mg-badge"; }
63
67
  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"
68
+ static get originalStyleUrls() {
69
+ return {
70
+ "$": ["mg-badge.scss"]
71
+ };
72
+ }
73
+ static get styleUrls() {
74
+ return {
75
+ "$": ["mg-badge.css"]
76
+ };
77
+ }
78
+ static get properties() {
79
+ return {
80
+ "value": {
81
+ "type": "any",
82
+ "mutable": true,
83
+ "complexType": {
84
+ "original": "BadgeType['value']",
85
+ "resolved": "number | string",
86
+ "references": {
87
+ "BadgeType": {
88
+ "location": "import",
89
+ "path": "./mg-badge.conf"
90
+ }
81
91
  }
82
- }
92
+ },
93
+ "required": true,
94
+ "optional": false,
95
+ "docs": {
96
+ "tags": [],
97
+ "text": "Badge value"
98
+ },
99
+ "attribute": "value",
100
+ "reflect": false
83
101
  },
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"
102
+ "label": {
103
+ "type": "string",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "BadgeType['label']",
107
+ "resolved": "string",
108
+ "references": {
109
+ "BadgeType": {
110
+ "location": "import",
111
+ "path": "./mg-badge.conf"
112
+ }
103
113
  }
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": {}
114
+ },
115
+ "required": true,
116
+ "optional": false,
117
+ "docs": {
118
+ "tags": [],
119
+ "text": "Badge label. Include short description.\nRequired for accessibility"
120
+ },
121
+ "attribute": "label",
122
+ "reflect": false
122
123
  },
123
- "required": false,
124
- "optional": false,
125
- "docs": {
126
- "tags": [],
127
- "text": "Define button variant"
124
+ "variant": {
125
+ "type": "string",
126
+ "mutable": false,
127
+ "complexType": {
128
+ "original": "string",
129
+ "resolved": "string",
130
+ "references": {}
131
+ },
132
+ "required": false,
133
+ "optional": false,
134
+ "docs": {
135
+ "tags": [],
136
+ "text": "Define button variant"
137
+ },
138
+ "attribute": "variant",
139
+ "reflect": false,
140
+ "defaultValue": "variants[0]"
128
141
  },
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
- }]; }
142
+ "outline": {
143
+ "type": "boolean",
144
+ "mutable": false,
145
+ "complexType": {
146
+ "original": "boolean",
147
+ "resolved": "boolean",
148
+ "references": {}
149
+ },
150
+ "required": false,
151
+ "optional": false,
152
+ "docs": {
153
+ "tags": [],
154
+ "text": "Define if button is using outline style"
155
+ },
156
+ "attribute": "outline",
157
+ "reflect": false
158
+ }
159
+ };
160
+ }
161
+ static get states() {
162
+ return {
163
+ "classList": {}
164
+ };
165
+ }
166
+ static get watchers() {
167
+ return [{
168
+ "propName": "value",
169
+ "methodName": "validateValue"
170
+ }, {
171
+ "propName": "label",
172
+ "methodName": "validateLabel"
173
+ }, {
174
+ "propName": "variant",
175
+ "methodName": "validateVariant"
176
+ }, {
177
+ "propName": "outline",
178
+ "methodName": "validateOutline"
179
+ }];
180
+ }
164
181
  }