@mgdis/mg-components 3.1.0 → 3.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 (225) hide show
  1. package/dist/cjs/css-shim-629916b0.js +6 -0
  2. package/dist/cjs/index-369388eb.js +146 -0
  3. package/dist/cjs/{index-85a4a0b6.js → index-bead7dbd.js} +78 -2
  4. package/dist/cjs/loader.cjs.js +4 -4
  5. package/dist/cjs/mg-badge_21.cjs.entry.js +3313 -0
  6. package/dist/cjs/mg-components.cjs.js +3 -3
  7. package/dist/cjs/mg-modal.cjs.entry.js +111 -0
  8. package/dist/cjs/mg-popover.cjs.entry.js +165 -0
  9. package/dist/cjs/popper-0c3964e7.js +1786 -0
  10. package/dist/cjs/{shadow-css-8940f82d.js → shadow-css-546083ef.js} +1 -1
  11. package/dist/collection/collection-manifest.json +4 -1
  12. package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -1
  13. package/dist/collection/components/atoms/mg-badge/mg-badge.js +11 -7
  14. package/dist/collection/components/atoms/mg-badge/mg-badge.stories.js +3 -0
  15. package/dist/collection/components/atoms/mg-button/mg-button.css +26 -17
  16. package/dist/collection/components/atoms/mg-button/mg-button.js +71 -2
  17. package/dist/collection/components/atoms/mg-button/mg-button.stories.js +5 -0
  18. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +12 -1
  19. package/dist/collection/components/atoms/mg-character-left/mg-character-left.stories.js +8 -0
  20. package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +8 -0
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.css +5 -7
  22. package/dist/collection/components/atoms/mg-icon/mg-icon.js +11 -1
  23. package/dist/collection/components/atoms/mg-input-title/mg-input-title.css +4 -4
  24. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +14 -3
  25. package/dist/collection/components/atoms/mg-tag/mg-tag.js +10 -3
  26. package/dist/collection/components/atoms/mg-tag/mg-tag.stories.js +3 -0
  27. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +9 -0
  28. package/dist/collection/components/molecules/inputs/MgInput.js +20 -14
  29. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +9 -1
  30. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +103 -40
  31. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.stories.js +6 -1
  32. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +27 -0
  33. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +125 -56
  34. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.stories.js +6 -1
  35. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +27 -0
  36. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +144 -68
  37. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.stories.js +6 -1
  38. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +27 -0
  39. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +101 -35
  40. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.stories.js +6 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +9 -1
  42. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +115 -37
  43. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.stories.js +6 -1
  44. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +28 -1
  45. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +132 -51
  46. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.stories.js +14 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +27 -0
  48. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +155 -53
  49. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.stories.js +7 -2
  50. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +27 -0
  51. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +108 -42
  52. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.stories.js +7 -2
  53. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +4 -1
  54. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +60 -31
  55. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.stories.js +6 -1
  56. package/dist/collection/components/molecules/mg-form/mg-form.css +15 -0
  57. package/dist/collection/components/molecules/mg-form/mg-form.js +269 -0
  58. package/dist/collection/components/molecules/mg-form/mg-form.stories.js +58 -0
  59. package/dist/collection/components/molecules/mg-message/mg-message.css +1 -1
  60. package/dist/collection/components/molecules/mg-message/mg-message.js +11 -4
  61. package/dist/collection/components/molecules/mg-message/mg-message.stories.js +5 -1
  62. package/dist/collection/components/molecules/mg-modal/mg-modal.css +54 -0
  63. package/dist/collection/components/molecules/mg-modal/mg-modal.js +233 -0
  64. package/dist/collection/components/molecules/mg-modal/mg-modal.stories.js +51 -0
  65. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +32 -12
  66. package/dist/collection/components/molecules/mg-pagination/mg-pagination.stories.js +1 -0
  67. package/dist/collection/components/molecules/mg-panel/mg-panel.css +42 -0
  68. package/dist/collection/components/molecules/mg-panel/mg-panel.js +255 -0
  69. package/dist/collection/components/molecules/mg-panel/mg-panel.stories.js +31 -0
  70. package/dist/collection/components/molecules/mg-popover/mg-popover.css +2 -2
  71. package/dist/collection/components/molecules/mg-popover/mg-popover.js +19 -4
  72. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +4 -1
  73. package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +14 -3
  74. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +68 -20
  75. package/dist/collection/components/molecules/mg-tabs/mg-tabs.stories.js +10 -1
  76. package/dist/collection/stories/messages.stories.js +1 -1
  77. package/dist/collection/utils/components.utils.js +16 -9
  78. package/dist/collection/utils/locale.utils.js +6 -3
  79. package/dist/collection/utils/test.utils.js +27 -15
  80. package/dist/collection/variables.css +30 -1
  81. package/dist/collection/variables.scss +30 -1
  82. package/dist/components/MgInput.js +20 -14
  83. package/dist/components/components.utils.js +16 -9
  84. package/dist/components/index.d.ts +1 -1
  85. package/dist/components/index2.js +22 -12
  86. package/dist/components/locale.utils.js +6 -3
  87. package/dist/components/mg-badge2.js +9 -5
  88. package/dist/components/mg-button2.js +21 -2
  89. package/dist/components/mg-character-left2.js +12 -1
  90. package/dist/components/mg-form.d.ts +11 -0
  91. package/dist/components/mg-form.js +146 -0
  92. package/dist/components/mg-icon2.js +20 -2
  93. package/dist/components/mg-input-checkbox.js +65 -36
  94. package/dist/components/mg-input-date.js +87 -52
  95. package/dist/components/mg-input-numeric.js +105 -63
  96. package/dist/components/mg-input-password.js +60 -29
  97. package/dist/components/mg-input-radio.js +74 -34
  98. package/dist/components/mg-input-select2.js +89 -46
  99. package/dist/components/mg-input-text.js +1 -237
  100. package/dist/components/mg-input-text2.js +288 -0
  101. package/dist/components/mg-input-textarea.js +67 -36
  102. package/dist/components/mg-input-title2.js +13 -4
  103. package/dist/components/mg-input-toggle.js +30 -22
  104. package/dist/components/mg-message.js +10 -3
  105. package/dist/components/mg-modal.d.ts +11 -0
  106. package/dist/components/mg-modal.js +147 -0
  107. package/dist/components/mg-pagination.js +31 -11
  108. package/dist/components/mg-panel.d.ts +11 -0
  109. package/dist/components/mg-panel.js +210 -0
  110. package/dist/components/mg-popover.js +20 -5
  111. package/dist/components/mg-tabs.js +43 -11
  112. package/dist/components/mg-tag.js +8 -1
  113. package/dist/components/mg-tooltip2.js +9 -0
  114. package/dist/esm/css-shim-0993aa3b.js +4 -0
  115. package/dist/esm/{index-e3e84606.js → index-9e877561.js} +78 -2
  116. package/dist/esm/index-c346f52d.js +139 -0
  117. package/dist/esm/loader.js +4 -4
  118. package/dist/esm/mg-badge_21.entry.js +3289 -0
  119. package/dist/esm/mg-components.js +3 -3
  120. package/dist/esm/mg-modal.entry.js +107 -0
  121. package/dist/esm/mg-popover.entry.js +161 -0
  122. package/dist/esm/polyfills/css-shim.js +1 -1
  123. package/dist/esm/popper-8874fd6c.js +1784 -0
  124. package/dist/esm/{shadow-css-5d2d01ce.js → shadow-css-dfa0587f.js} +1 -1
  125. package/dist/esm-es5/css-shim-0993aa3b.js +1 -0
  126. package/dist/esm-es5/index-9e877561.js +1 -0
  127. package/dist/esm-es5/index-c346f52d.js +1 -0
  128. package/dist/esm-es5/loader.js +1 -1
  129. package/dist/esm-es5/mg-badge_21.entry.js +2 -0
  130. package/dist/esm-es5/mg-components.js +1 -1
  131. package/dist/esm-es5/mg-modal.entry.js +1 -0
  132. package/dist/esm-es5/mg-popover.entry.js +1 -0
  133. package/dist/esm-es5/popper-8874fd6c.js +1 -0
  134. package/dist/esm-es5/{shadow-css-5d2d01ce.js → shadow-css-dfa0587f.js} +0 -0
  135. package/dist/mg-components/mg-components.css +1 -1
  136. package/dist/mg-components/mg-components.esm.js +1 -1
  137. package/dist/mg-components/mg-components.js +2 -2
  138. package/dist/mg-components/p-3633e9e1.system.entry.js +2 -0
  139. package/dist/mg-components/p-3c14153d.js +1 -0
  140. package/dist/mg-components/p-55a22b35.system.js +1 -0
  141. package/dist/mg-components/{p-f6455ab3.js → p-5e796581.js} +0 -0
  142. package/dist/mg-components/p-656b5efb.system.js +1 -0
  143. package/dist/mg-components/p-68d6f104.js +1 -0
  144. package/dist/mg-components/{p-366a224e.js → p-6d49ed95.js} +1 -1
  145. package/dist/mg-components/p-70177194.entry.js +1 -0
  146. package/dist/mg-components/{p-71d57b8b.system.js → p-8b2d8a2a.system.js} +0 -0
  147. package/dist/mg-components/p-8cb61c3f.system.js +1 -0
  148. package/dist/mg-components/p-ace173b1.js +1 -0
  149. package/dist/mg-components/p-c46fbd54.entry.js +1 -0
  150. package/dist/mg-components/p-c90cc4bf.system.js +1 -0
  151. package/dist/mg-components/p-cd2a4acc.system.entry.js +1 -0
  152. package/dist/mg-components/p-de1164fa.system.entry.js +1 -0
  153. package/dist/mg-components/p-dfe25da3.entry.js +1 -0
  154. package/dist/mg-components/p-e4a502b5.system.js +1 -0
  155. package/dist/mg-components/variables.css +30 -1
  156. package/dist/mg-components/variables.scss +30 -1
  157. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +8 -4
  158. package/dist/types/components/atoms/mg-badge/mg-badge.stories.d.ts +5 -0
  159. package/dist/types/components/atoms/mg-button/mg-button.d.ts +22 -2
  160. package/dist/types/components/atoms/mg-button/mg-button.stories.d.ts +5 -0
  161. package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +13 -2
  162. package/dist/types/components/atoms/mg-character-left/mg-character-left.stories.d.ts +9 -0
  163. package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +1 -1
  164. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +11 -1
  165. package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +11 -1
  166. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +10 -3
  167. package/dist/types/components/atoms/mg-tag/mg-tag.stories.d.ts +5 -0
  168. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +11 -2
  169. package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +8 -0
  170. package/dist/types/components/molecules/inputs/MgInput.d.ts +5 -4
  171. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +31 -11
  172. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.stories.d.ts +5 -0
  173. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +39 -14
  174. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.stories.d.ts +5 -0
  175. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +53 -14
  176. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.stories.d.ts +5 -0
  177. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +28 -9
  178. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.stories.d.ts +5 -0
  179. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +1 -1
  180. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +37 -8
  181. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.stories.d.ts +5 -0
  182. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +1 -1
  183. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +30 -7
  184. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.stories.d.ts +14 -0
  185. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +46 -10
  186. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.stories.d.ts +5 -0
  187. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +30 -10
  188. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.stories.d.ts +5 -0
  189. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +1 -1
  190. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +27 -12
  191. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.stories.d.ts +5 -0
  192. package/dist/types/components/molecules/mg-form/mg-form.d.ts +82 -0
  193. package/dist/types/components/molecules/mg-form/mg-form.stories.d.ts +11 -0
  194. package/dist/types/components/molecules/mg-message/mg-message.d.ts +11 -4
  195. package/dist/types/components/molecules/mg-message/mg-message.stories.d.ts +10 -0
  196. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +83 -0
  197. package/dist/types/components/molecules/mg-modal/mg-modal.stories.d.ts +13 -0
  198. package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +23 -7
  199. package/dist/types/components/molecules/mg-pagination/mg-pagination.stories.d.ts +5 -0
  200. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +110 -0
  201. package/dist/types/components/molecules/mg-panel/mg-panel.stories.d.ts +6 -0
  202. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +18 -3
  203. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +5 -0
  204. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +21 -6
  205. package/dist/types/components/molecules/mg-tabs/mg-tabs.stories.d.ts +8 -0
  206. package/dist/types/components.d.ts +365 -78
  207. package/dist/types/locales/index.d.ts +15 -8
  208. package/dist/types/utils/components.utils.d.ts +16 -9
  209. package/dist/types/utils/locale.utils.d.ts +6 -3
  210. package/dist/types/utils/test.utils.d.ts +13 -1
  211. package/package.json +13 -9
  212. package/readme.md +3 -0
  213. package/dist/cjs/css-shim-a22512c4.js +0 -6
  214. package/dist/cjs/mg-badge_20.cjs.entry.js +0 -4661
  215. package/dist/esm/css-shim-7c240feb.js +0 -4
  216. package/dist/esm/mg-badge_20.entry.js +0 -4638
  217. package/dist/esm-es5/css-shim-7c240feb.js +0 -1
  218. package/dist/esm-es5/index-e3e84606.js +0 -1
  219. package/dist/esm-es5/mg-badge_20.entry.js +0 -2
  220. package/dist/mg-components/p-1cd24462.system.js +0 -1
  221. package/dist/mg-components/p-2e2f6b27.system.entry.js +0 -2
  222. package/dist/mg-components/p-422c429b.system.js +0 -1
  223. package/dist/mg-components/p-62fa3797.js +0 -1
  224. package/dist/mg-components/p-9a215712.system.js +0 -1
  225. package/dist/mg-components/p-cbf0464b.entry.js +0 -1
@@ -7,6 +7,11 @@ declare const _default: {
7
7
  control: {
8
8
  type: string;
9
9
  };
10
+ table: {
11
+ defaultValue: {
12
+ summary: string;
13
+ };
14
+ };
10
15
  };
11
16
  value: {
12
17
  control: {
@@ -20,7 +20,7 @@ export declare class MgButton {
20
20
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
21
21
  * If not set, it will be created.
22
22
  */
23
- identifier?: string;
23
+ identifier: string;
24
24
  /**
25
25
  * aria-label
26
26
  * In case button text is not explicit enough
@@ -41,6 +41,19 @@ export declare class MgButton {
41
41
  * Parent component have to remove the attribute 'disabled' when the process ends.
42
42
  */
43
43
  disableOnClick: boolean;
44
+ /**
45
+ * Prop to set aria-expanded on button element
46
+ */
47
+ expanded: boolean;
48
+ /**
49
+ * Prop to set aria-controls on button element
50
+ */
51
+ controls: string;
52
+ /**
53
+ * Option to set aria-haspopup
54
+ * The aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity.
55
+ */
56
+ haspopup: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
44
57
  /**
45
58
  * Define if button is loading, default to false.
46
59
  * Trigger when button is clicked or key-up ['enter', 'space], then value change to true.
@@ -54,14 +67,21 @@ export declare class MgButton {
54
67
  classList: ClassList;
55
68
  /**
56
69
  * Trigger actions onClick event
70
+ *
71
+ * @param {MouseEvent} event click event
72
+ * @returns {void}
57
73
  */
58
74
  private handleClick;
59
75
  /**
60
76
  * Check if props are well configured on init
77
+ *
78
+ * @returns {void}
61
79
  */
62
80
  componentWillLoad(): void;
63
81
  /**
64
82
  * Render component
83
+ *
84
+ * @returns {HTMLElement} html element
65
85
  */
66
- render(): any;
86
+ render(): HTMLElement;
67
87
  }
@@ -7,6 +7,11 @@ declare const _default: {
7
7
  control: {
8
8
  type: string;
9
9
  };
10
+ table: {
11
+ defaultValue: {
12
+ summary: string;
13
+ };
14
+ };
10
15
  };
11
16
  };
12
17
  };
@@ -28,12 +28,23 @@ export declare class MgCharacterLeft {
28
28
  validateMaxlength(newValue: number): void;
29
29
  /**
30
30
  * Calculate number character left
31
- * @returns {string}
31
+ *
32
+ * @returns {string} message
32
33
  */
33
34
  private getMessage;
34
35
  /*************
35
36
  * Lifecycle *
36
37
  *************/
38
+ /**
39
+ * Check if props are well configured on init
40
+ *
41
+ * @returns {void}
42
+ */
37
43
  componentWillLoad(): void;
38
- render(): any;
44
+ /**
45
+ * Render component
46
+ *
47
+ * @returns {HTMLElement} HTML Element
48
+ */
49
+ render(): HTMLElement;
39
50
  }
@@ -1,6 +1,15 @@
1
1
  declare const _default: {
2
2
  component: string;
3
3
  title: string;
4
+ argTypes: {
5
+ template: {
6
+ table: {
7
+ defaultValue: {
8
+ summary: string;
9
+ };
10
+ };
11
+ };
12
+ };
4
13
  };
5
14
  export default _default;
6
15
  export declare const MgCharacterLeft: any;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Icon SVG paths
3
3
  */
4
- export declare const icons: Object;
4
+ export declare const icons: unknown;
5
5
  /**
6
6
  * List of all possibles sizes
7
7
  */
@@ -25,12 +25,22 @@ export declare class MgIcon {
25
25
  * Component classes
26
26
  */
27
27
  classList: ClassList;
28
+ /**
29
+ * getIcon
30
+ *
31
+ * @returns {HTMLElement} icon html
32
+ */
33
+ private getIcon;
28
34
  /**
29
35
  * Check if props are well configured on init
36
+ *
37
+ * @returns {void}
30
38
  */
31
39
  componentWillLoad(): void;
32
40
  /**
33
41
  * Render component
42
+ *
43
+ * @returns {HTMLElement} HTML Element
34
44
  */
35
- render(): any;
45
+ render(): HTMLElement;
36
46
  }
@@ -19,6 +19,16 @@ export declare class MgInputTitle {
19
19
  /*************
20
20
  * Lifecycle *
21
21
  *************/
22
+ /**
23
+ * Init tag name
24
+ *
25
+ * @returns {void}
26
+ */
22
27
  componentWillLoad(): void;
23
- render(): any;
28
+ /**
29
+ * Render
30
+ *
31
+ * @returns {HTMLElement} HTML Element
32
+ */
33
+ render(): HTMLElement;
24
34
  }
@@ -3,23 +3,30 @@ export declare class MgTag {
3
3
  /**
4
4
  * Define button variant
5
5
  */
6
- variant?: string;
6
+ variant: string;
7
7
  validateVariant(newValue: string): void;
8
8
  /**
9
9
  * Define if button is using outline style
10
10
  */
11
- outline?: boolean;
11
+ outline: boolean;
12
12
  validateOutline(newValue: boolean): void;
13
13
  /**
14
14
  * Component classes
15
15
  */
16
16
  classList: ClassList;
17
+ /*************
18
+ * Lifecycle *
19
+ *************/
17
20
  /**
18
21
  * Check if props are well configured on init
22
+ *
23
+ * @returns {void}
19
24
  */
20
25
  componentWillLoad(): void;
21
26
  /**
22
27
  * Render
28
+ *
29
+ * @returns {HTMLElement} HTML Element
23
30
  */
24
- render(): any;
31
+ render(): HTMLElement;
25
32
  }
@@ -7,6 +7,11 @@ declare const _default: {
7
7
  control: {
8
8
  type: string;
9
9
  };
10
+ table: {
11
+ defaultValue: {
12
+ summary: string;
13
+ };
14
+ };
10
15
  };
11
16
  };
12
17
  };
@@ -28,18 +28,20 @@ export declare class MgTooltip {
28
28
  * Display tooltip
29
29
  */
30
30
  display: boolean;
31
- handleDisplay(newVal: any): void;
31
+ handleDisplay(newVal: boolean): void;
32
32
  /**
33
33
  * Disable tooltip
34
34
  */
35
35
  disabled: boolean;
36
36
  /**
37
37
  * Show tooltip
38
+ *
38
39
  * @returns {void}
39
40
  */
40
41
  private show;
41
42
  /**
42
43
  * Hide tooltip
44
+ *
43
45
  * @returns {void}
44
46
  */
45
47
  private hide;
@@ -50,7 +52,14 @@ export declare class MgTooltip {
50
52
  * Get slotted element
51
53
  * Check if it already contain an interactive element, if not we need to add a tabIndex attribute
52
54
  * We need to attach the focused element to the tooltip (aria-describedby)
55
+ *
56
+ * @returns {void}
53
57
  */
54
58
  componentDidLoad(): void;
55
- render(): any;
59
+ /**
60
+ * Render
61
+ *
62
+ * @returns {HTMLElement} HTML Element
63
+ */
64
+ render(): HTMLElement;
56
65
  }
@@ -8,3 +8,11 @@ export declare type Width = 2 | 4 | 16 | 'full';
8
8
  export declare enum InputClass {
9
9
  ERROR = "is-not-valid"
10
10
  }
11
+ /**
12
+ * Possible Input types
13
+ */
14
+ export declare type HTMLMgInputsElement = HTMLMgInputCheckboxElement | HTMLMgInputDateElement | HTMLMgInputNumericElement | HTMLMgInputPasswordElement | HTMLMgInputRadioElement | HTMLMgInputSelectElement | HTMLMgInputTextElement | HTMLMgInputTextareaElement | (HTMLMgInputToggleElement & {
15
+ required: true;
16
+ invalid: false;
17
+ displayError: () => void;
18
+ });
@@ -26,10 +26,11 @@ interface MgInputProps {
26
26
  }
27
27
  /**
28
28
  * Get input template
29
- * @param props MgInput Interface Props
30
- * @param children Represent scoped elements
31
- * @param utils Stencil.js utils
32
- * @returns JSX template
29
+ *
30
+ * @param {MgInputProps} props MgInput Interface Props
31
+ * @param {VNode[]} children Represent scoped elements
32
+ * @param {FunctionalUtilities} utils Stencil.js utils
33
+ * @returns {VNode[]} input template
33
34
  */
34
35
  export declare const MgInput: FunctionalComponent<MgInputProps>;
35
36
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { EventEmitter } from '../../../../stencil-public-runtime';
3
2
  import { ClassList } from '../../../../utils/components.utils';
4
3
  import { CheckboxItem, CheckboxValue } from './mg-input-checkbox.conf';
@@ -17,20 +16,19 @@ export declare class MgInputCheckbox {
17
16
  * Required
18
17
  */
19
18
  value: CheckboxValue[];
20
- validateValue(newValue: any): void;
19
+ validateValue(newValue: CheckboxValue[]): void;
21
20
  /**
22
21
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
23
22
  * If not set, it will be created.
24
23
  */
25
- identifier?: string;
24
+ identifier: string;
26
25
  /**
27
26
  * Input name
28
27
  * If not set the value equals the identifier
29
28
  */
30
- name?: string;
29
+ name: string;
31
30
  /**
32
31
  * Input label
33
- * Required
34
32
  */
35
33
  label: string;
36
34
  /**
@@ -67,11 +65,11 @@ export declare class MgInputCheckbox {
67
65
  */
68
66
  helpText: string;
69
67
  /**
70
- * Force valid component
68
+ * Define input valid state
71
69
  */
72
70
  valid: boolean;
73
71
  /**
74
- * Force invalid component
72
+ * Define input invalid state
75
73
  */
76
74
  invalid: boolean;
77
75
  /**
@@ -90,9 +88,20 @@ export declare class MgInputCheckbox {
90
88
  * Emitted event when value change
91
89
  */
92
90
  valueChange: EventEmitter<CheckboxValue[]>;
91
+ /**
92
+ * Emited event when checking validity
93
+ */
94
+ inputValid: EventEmitter<boolean>;
95
+ /**
96
+ * Public method to display errors
97
+ *
98
+ * @returns {Promise<void>}
99
+ */
100
+ displayError(): Promise<void>;
93
101
  /**
94
102
  * Handle input event
95
- * @param event
103
+ *
104
+ * @param {InputEvent} event input event
96
105
  */
97
106
  private handleInput;
98
107
  /**
@@ -109,12 +118,23 @@ export declare class MgInputCheckbox {
109
118
  private checkError;
110
119
  /**
111
120
  * get invalid element
112
- * @returns element: HTMLInputElement
121
+ *
122
+ * @returns {HTMLInputElement} element
113
123
  */
114
124
  private getInvalidElement;
115
125
  /*************
116
126
  * Lifecycle *
117
127
  *************/
118
- componentWillLoad(): NodeJS.Timeout;
119
- render(): any;
128
+ /**
129
+ * Check if component props are well configured on init
130
+ *
131
+ * @returns {ReturnType<typeof setTimeout>} timeout
132
+ */
133
+ componentWillLoad(): ReturnType<typeof setTimeout>;
134
+ /**
135
+ * Render
136
+ *
137
+ * @returns {HTMLElement} HTML Element
138
+ */
139
+ render(): HTMLElement;
120
140
  }
@@ -1,6 +1,11 @@
1
1
  declare const _default: {
2
2
  component: string;
3
3
  title: string;
4
+ parameters: {
5
+ actions: {
6
+ handles: string[];
7
+ };
8
+ };
4
9
  };
5
10
  export default _default;
6
11
  export declare const MgInputCheckbox: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { EventEmitter } from '../../../../stencil-public-runtime';
3
2
  import { ClassList } from '../../../../utils/components.utils';
4
3
  export declare class MgInputDate {
@@ -14,20 +13,19 @@ export declare class MgInputDate {
14
13
  * Component value
15
14
  */
16
15
  value: string;
17
- validateValue(newValue: any): void;
16
+ validateValue(newValue: string): void;
18
17
  /**
19
18
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
20
19
  * If not set, it will be created.
21
20
  */
22
- identifier?: string;
21
+ identifier: string;
23
22
  /**
24
23
  * Input name
25
24
  * If not set the value equals the identifier
26
25
  */
27
- name?: string;
26
+ name: string;
28
27
  /**
29
28
  * Input label
30
- * Required
31
29
  */
32
30
  label: string;
33
31
  /**
@@ -59,11 +57,11 @@ export declare class MgInputDate {
59
57
  */
60
58
  helpText: string;
61
59
  /**
62
- * Define input pattern to validate
60
+ * Define input valid state
63
61
  */
64
62
  valid: boolean;
65
63
  /**
66
- * Define input pattern error message
64
+ * Define input invalid state
67
65
  */
68
66
  invalid: boolean;
69
67
  /**
@@ -71,13 +69,13 @@ export declare class MgInputDate {
71
69
  * format: yyyy-mm-dd
72
70
  */
73
71
  min: string;
74
- validateMin(newValue: any): void;
72
+ validateMin(newValue: string): void;
75
73
  /**
76
74
  * Define input maximum date
77
75
  * format: yyyy-mm-dd
78
76
  */
79
77
  max: string;
80
- validateMax(newValue: any): void;
78
+ validateMax(newValue: string): void;
81
79
  /**
82
80
  * Component classes
83
81
  */
@@ -87,9 +85,19 @@ export declare class MgInputDate {
87
85
  */
88
86
  errorMessage: string;
89
87
  /**
90
- * Emmited event when value change
88
+ * Emited event when value change
91
89
  */
92
90
  valueChange: EventEmitter<string>;
91
+ /**
92
+ * Emited event when checking validity
93
+ */
94
+ inputValid: EventEmitter<boolean>;
95
+ /**
96
+ * Public method to display errors
97
+ *
98
+ * @returns {Promise<void>}
99
+ */
100
+ displayError(): Promise<void>;
93
101
  /**
94
102
  * Handle input event
95
103
  */
@@ -100,7 +108,9 @@ export declare class MgInputDate {
100
108
  private handleBlur;
101
109
  /**
102
110
  * Date format validation
103
- * @param date
111
+ *
112
+ * @param {string} date date to validate
113
+ * @returns {void}
104
114
  */
105
115
  private validateDateFormat;
106
116
  /**
@@ -109,20 +119,35 @@ export declare class MgInputDate {
109
119
  private checkValidity;
110
120
  /**
111
121
  * get input error code
112
- * @returns {null | InputError}
122
+ *
123
+ * @returns {null | InputError} error code
113
124
  */
114
125
  private getInputError;
115
126
  /**
116
127
  * Set error message
128
+ *
129
+ * @returns {void}
117
130
  */
118
131
  private setErrorMessage;
119
132
  /**
120
133
  * Check input errors
134
+ *
135
+ * @returns {void}
121
136
  */
122
137
  private checkError;
123
138
  /*************
124
139
  * Lifecycle *
125
140
  *************/
126
- componentWillLoad(): NodeJS.Timeout;
127
- render(): any;
141
+ /**
142
+ * Check if component props are well configured on init
143
+ *
144
+ * @returns {ReturnType<typeof setTimeout>} timeout
145
+ */
146
+ componentWillLoad(): ReturnType<typeof setTimeout>;
147
+ /**
148
+ * Render
149
+ *
150
+ * @returns {HTMLElement} HTML Element
151
+ */
152
+ render(): HTMLElement;
128
153
  }
@@ -1,6 +1,11 @@
1
1
  declare const _default: {
2
2
  component: string;
3
3
  title: string;
4
+ parameters: {
5
+ actions: {
6
+ handles: string[];
7
+ };
8
+ };
4
9
  };
5
10
  export default _default;
6
11
  export declare const MgInputDate: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { EventEmitter } from '../../../../stencil-public-runtime';
3
2
  import { Width } from '../MgInput.conf';
4
3
  import { ClassList } from '../../../../utils/components.utils';
@@ -14,6 +13,9 @@ export declare class MgInputNumeric {
14
13
  /**************
15
14
  * Decorators *
16
15
  **************/
16
+ /**
17
+ * Get component DOM element
18
+ */
17
19
  element: HTMLMgInputNumericElement;
18
20
  /**
19
21
  * Component value
@@ -24,15 +26,14 @@ export declare class MgInputNumeric {
24
26
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
25
27
  * If not set, it will be created.
26
28
  */
27
- identifier?: string;
29
+ identifier: string;
28
30
  /**
29
31
  * Input name
30
32
  * If not set the value equals the identifier
31
33
  */
32
- name?: string;
34
+ name: string;
33
35
  /**
34
36
  * Input label
35
- * Required
36
37
  */
37
38
  label: string;
38
39
  /**
@@ -114,60 +115,98 @@ export declare class MgInputNumeric {
114
115
  */
115
116
  errorMessage: string;
116
117
  /**
117
- * Displayed value in input
118
- * Change on focus/blur
118
+ * Define if input has focus
119
119
  */
120
- displayValue: string;
120
+ hasFocus: boolean;
121
121
  /**
122
- * Emmited event when value change
122
+ * Emited event when value change
123
123
  */
124
124
  valueChange: EventEmitter<number>;
125
+ /**
126
+ * Emited event when checking validity
127
+ */
128
+ inputValid: EventEmitter<boolean>;
129
+ /**
130
+ * Public method to display errors
131
+ *
132
+ * @returns {Promise<void>}
133
+ */
134
+ displayError(): Promise<void>;
135
+ /**
136
+ * Displayed value in input
137
+ * Change on focus/blur
138
+ *
139
+ * @returns {string} display value
140
+ */
141
+ private displayValue;
125
142
  /**
126
143
  * Handle input event
144
+ *
145
+ * @returns {void}
127
146
  */
128
147
  private handleInput;
129
148
  /**
130
149
  * Handle focus event
150
+ *
151
+ * @returns {void}
131
152
  */
132
153
  private handleFocus;
133
154
  /**
134
155
  * Handle blur event
156
+ *
157
+ * @returns {void}
135
158
  */
136
159
  private handleBlur;
137
160
  /**
138
161
  * Check if input is valid
162
+ *
163
+ * @returns {void}
139
164
  */
140
165
  private checkValidity;
141
166
  /**
142
167
  * Set error message
168
+ *
169
+ * @returns {void}
143
170
  */
144
171
  private setErrorMessage;
145
172
  /**
146
173
  * Check input errors
174
+ *
175
+ * @returns {void}
147
176
  */
148
177
  private checkError;
149
178
  /**
150
- * get input error code
151
- * @returns {null | InputError}
179
+ * Get input error code
180
+ *
181
+ * @returns {null | InputError} error code
152
182
  */
153
183
  private getInputError;
154
184
  /**
155
185
  * Format value based on type
156
- * @param value {number}
186
+ *
187
+ * @param {number} value value to format
157
188
  * @returns {string} formated local value
158
189
  */
159
190
  private formatValue;
160
191
  /**
161
192
  * Validate append slot
193
+ *
194
+ * @returns {void}
162
195
  */
163
196
  private validateAppendSlot;
164
197
  /*************
165
198
  * Lifecycle *
166
199
  *************/
167
- componentWillLoad(): NodeJS.Timeout;
168
- componentDidLoad(): void;
169
200
  /**
170
201
  * Check if component props are well configured on init
202
+ *
203
+ * @returns {ReturnType<typeof setTimeout>} timeout
204
+ */
205
+ componentWillLoad(): ReturnType<typeof setTimeout>;
206
+ /**
207
+ * Render
208
+ *
209
+ * @returns {HTMLElement} HTML Element
171
210
  */
172
- render(): any;
211
+ render(): HTMLElement;
173
212
  }
@@ -9,6 +9,11 @@ declare const _default: {
9
9
  };
10
10
  };
11
11
  };
12
+ parameters: {
13
+ actions: {
14
+ handles: string[];
15
+ };
16
+ };
12
17
  };
13
18
  export default _default;
14
19
  /**