@mgdis/mg-components 5.17.0 → 5.18.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 (111) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mg-action-more_34.cjs.entry.js +464 -157
  3. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  4. package/dist/cjs/mg-components.cjs.js +1 -1
  5. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +31 -11
  6. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  7. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +6 -0
  8. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +1 -1
  9. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +8 -0
  10. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +1 -1
  11. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +92 -16
  12. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  13. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +58 -1
  14. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +1 -1
  15. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +79 -8
  16. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  17. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +55 -0
  18. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +1 -1
  19. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +109 -38
  20. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +55 -0
  22. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +83 -10
  24. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +55 -0
  26. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +82 -9
  28. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +60 -0
  30. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +82 -9
  32. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  33. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +55 -0
  34. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +1 -1
  35. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +94 -21
  36. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +68 -5
  38. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +100 -26
  40. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +67 -4
  42. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +1 -1
  43. package/dist/collection/components/molecules/mg-form/mg-form.js +2 -2
  44. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  45. package/dist/collection/components/molecules/mg-panel/mg-panel.js +8 -6
  46. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  47. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +1 -1
  48. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +1 -1
  49. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +3 -13
  50. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +1 -1
  51. package/dist/collection/components/molecules/mg-popover/mg-popover.js +34 -14
  52. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  53. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.js +13 -2
  54. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.js.map +1 -1
  55. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +12 -0
  56. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +1 -1
  57. package/dist/collection/utils/components.utils.js +6 -0
  58. package/dist/collection/utils/components.utils.js.map +1 -1
  59. package/dist/collection/utils/components.utils.spec.js +9 -1
  60. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  61. package/dist/components/components.utils.js +7 -1
  62. package/dist/components/components.utils.js.map +1 -1
  63. package/dist/components/mg-form.js +1 -1
  64. package/dist/components/mg-form.js.map +1 -1
  65. package/dist/components/mg-input-checkbox.js +52 -13
  66. package/dist/components/mg-input-checkbox.js.map +1 -1
  67. package/dist/components/mg-input-date.js +41 -8
  68. package/dist/components/mg-input-date.js.map +1 -1
  69. package/dist/components/mg-input-numeric.js +71 -38
  70. package/dist/components/mg-input-numeric.js.map +1 -1
  71. package/dist/components/mg-input-password.js +45 -10
  72. package/dist/components/mg-input-password.js.map +1 -1
  73. package/dist/components/mg-input-radio.js +44 -9
  74. package/dist/components/mg-input-radio.js.map +1 -1
  75. package/dist/components/mg-input-select2.js +44 -9
  76. package/dist/components/mg-input-select2.js.map +1 -1
  77. package/dist/components/mg-input-text2.js +56 -23
  78. package/dist/components/mg-input-text2.js.map +1 -1
  79. package/dist/components/mg-input-textarea.js +60 -26
  80. package/dist/components/mg-input-textarea.js.map +1 -1
  81. package/dist/components/mg-panel.js +8 -7
  82. package/dist/components/mg-panel.js.map +1 -1
  83. package/dist/components/mg-popover2.js +33 -14
  84. package/dist/components/mg-popover2.js.map +1 -1
  85. package/dist/components/mg-tooltip2.js +30 -11
  86. package/dist/components/mg-tooltip2.js.map +1 -1
  87. package/dist/esm/loader.js +1 -1
  88. package/dist/esm/mg-action-more_34.entry.js +464 -157
  89. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  90. package/dist/esm/mg-components.js +1 -1
  91. package/dist/mg-components/mg-components.esm.js +1 -1
  92. package/dist/mg-components/mg-components.esm.js.map +1 -1
  93. package/dist/mg-components/p-ff3ca349.entry.js +2 -0
  94. package/dist/mg-components/p-ff3ca349.entry.js.map +1 -0
  95. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +2 -1
  96. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +22 -1
  97. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +17 -2
  98. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +35 -20
  99. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +16 -1
  100. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +16 -1
  101. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +16 -1
  102. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +17 -5
  103. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +17 -5
  104. package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
  105. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
  106. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +1 -0
  107. package/dist/types/components.d.ts +59 -11
  108. package/dist/types/utils/components.utils.d.ts +6 -0
  109. package/package.json +1 -1
  110. package/dist/mg-components/p-caafc9cf.entry.js +0 -2
  111. package/dist/mg-components/p-caafc9cf.entry.js.map +0 -1
@@ -21,6 +21,7 @@ export declare class MgTooltip {
21
21
  * Needed by the input for accessibility `aria-decribedby`.
22
22
  */
23
23
  identifier: string;
24
+ validateIdentifier(): void;
24
25
  /**
25
26
  * Displayed message in the tooltip
26
27
  */
@@ -89,7 +90,7 @@ export declare class MgTooltip {
89
90
  /**
90
91
  * Render tooltip content element
91
92
  */
92
- private renderTooltip;
93
+ private renderTooltipContent;
93
94
  /*************
94
95
  * Lifecycle *
95
96
  *************/
@@ -9,6 +9,7 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
9
9
  private searchInput;
10
10
  private messages;
11
11
  private hasDisplayedError;
12
+ private mode;
12
13
  private readonly baseClassName;
13
14
  private readonly multiStart;
14
15
  private readonly searchStart;
@@ -27,6 +28,11 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
27
28
  validateValue(newValue: MgInputCheckbox['value']): void;
28
29
  /**
29
30
  * Define checkbox type
31
+ * When it's undefined the type is dynamic:
32
+ * - With 0-5 items type is 'checkbox'
33
+ * - With 5-10 items type is 'multi'
34
+ * When it set the type is locked to the defined value.
35
+ * When type is dynamic OR with 'multi' type AND Over 10 items "search" feature is enabled
30
36
  */
31
37
  type: CheckboxType;
32
38
  validateType(newValue: MgInputCheckbox['type']): void;
@@ -125,9 +131,23 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
125
131
  */
126
132
  inputValid: EventEmitter<MgInputCheckbox['valid']>;
127
133
  /**
128
- * Public method to display errors
134
+ * Display input error if it exists.
129
135
  */
130
136
  displayError(): Promise<void>;
137
+ /**
138
+ * Set an error and display a custom error message.
139
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
140
+ * It must be paired with an error message to display for the given context.
141
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
142
+ * @param valid - value indicating the validity
143
+ * @param errorMessage - the error message to display
144
+ */
145
+ setError(valid: MgInputCheckbox['valid'], errorMessage: string): Promise<void>;
146
+ /**
147
+ * Method to set validity values
148
+ * @param newValue - valid new value
149
+ */
150
+ private setValidity;
131
151
  /**
132
152
  * Handle input event
133
153
  * @param event - input event
@@ -195,6 +215,7 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
195
215
  /**
196
216
  * Set input error message
197
217
  * @param displayError - dispay error condition
218
+ * @param errorMessage - errorMessage override
198
219
  */
199
220
  private setErrorMessage;
200
221
  /**
@@ -19,7 +19,7 @@ export declare class MgInputDate {
19
19
  * Component value
20
20
  */
21
21
  value: string;
22
- validateValue(newValue: string): void;
22
+ validateValue(newValue: MgInputDate['value']): void;
23
23
  /**
24
24
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
25
25
  */
@@ -98,9 +98,23 @@ export declare class MgInputDate {
98
98
  */
99
99
  inputValid: EventEmitter<boolean>;
100
100
  /**
101
- * Public method to display errors
101
+ * Display input error if it exists.
102
102
  */
103
103
  displayError(): Promise<void>;
104
+ /**
105
+ * Set an error and display a custom error message.
106
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
107
+ * It must be paired with an error message to display for the given context.
108
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
109
+ * @param valid - value indicating the validity
110
+ * @param errorMessage - the error message to display
111
+ */
112
+ setError(valid: MgInputDate['valid'], errorMessage: string): Promise<void>;
113
+ /**
114
+ * Method to set validity values
115
+ * @param newValue - valid new value
116
+ */
117
+ private setValidity;
104
118
  /**
105
119
  * Handle input event
106
120
  */
@@ -120,6 +134,7 @@ export declare class MgInputDate {
120
134
  private getInputError;
121
135
  /**
122
136
  * Check input errors
137
+ * @param errorMessage - errorMessage override
123
138
  */
124
139
  private setErrorMessage;
125
140
  /*************
@@ -24,25 +24,6 @@ export declare class MgInputNumeric {
24
24
  */
25
25
  value: string;
26
26
  validateValue(newValue: MgInputNumeric['value']): void;
27
- /**
28
- * Checks if the given value is valid according to the defined rules.
29
- * @param value - The input value to validate.
30
- * @param regex - The regular expression for validation.
31
- * @param integer - The integer part of the value.
32
- * @param decimal - The decimal part of the value.
33
- * @returns Returns true if the value is valid, otherwise false.
34
- */
35
- private isValidValue;
36
- /**
37
- * Handles invalid input values and returns a corrected value.
38
- * @returns The corrected value.
39
- */
40
- private handleInvalidValue;
41
- /**
42
- * Updates the component values based on the validated input value.
43
- * @param newValue - The validated input value.
44
- */
45
- private updateValues;
46
27
  /**
47
28
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
48
29
  */
@@ -152,9 +133,42 @@ export declare class MgInputNumeric {
152
133
  */
153
134
  inputValid: EventEmitter<boolean>;
154
135
  /**
155
- * Public method to display errors
136
+ * Display input error if it exists.
156
137
  */
157
138
  displayError(): Promise<void>;
139
+ /**
140
+ * Set an error and display a custom error message.
141
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
142
+ * It must be paired with an error message to display for the given context.
143
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
144
+ * @param valid - value indicating the validity
145
+ * @param errorMessage - the error message to display
146
+ */
147
+ setError(valid: MgInputNumeric['valid'], errorMessage: string): Promise<void>;
148
+ /**
149
+ * Method to set validity values
150
+ * @param newValue - valid new value
151
+ */
152
+ private setValidity;
153
+ /**
154
+ * Checks if the given value is valid according to the defined rules.
155
+ * @param value - The input value to validate.
156
+ * @param regex - The regular expression for validation.
157
+ * @param integer - The integer part of the value.
158
+ * @param decimal - The decimal part of the value.
159
+ * @returns Returns true if the value is valid, otherwise false.
160
+ */
161
+ private isValidValue;
162
+ /**
163
+ * Handles invalid input values and returns a corrected value.
164
+ * @returns The corrected value.
165
+ */
166
+ private handleInvalidValue;
167
+ /**
168
+ * Updates the component values based on the validated input value.
169
+ * @param newValue - The validated input value.
170
+ */
171
+ private updateValues;
158
172
  /**
159
173
  * Displayed value in input
160
174
  * Change on focus/blur
@@ -179,6 +193,7 @@ export declare class MgInputNumeric {
179
193
  private checkValidity;
180
194
  /**
181
195
  * Set input error message
196
+ * @param errorMessage - errorMessage override
182
197
  */
183
198
  private setErrorMessage;
184
199
  /**
@@ -96,9 +96,23 @@ export declare class MgInputPassword {
96
96
  */
97
97
  inputValid: EventEmitter<boolean>;
98
98
  /**
99
- * Public method to display errors
99
+ * Display input error if it exists.
100
100
  */
101
101
  displayError(): Promise<void>;
102
+ /**
103
+ * Set an error and display a custom error message.
104
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
105
+ * It must be paired with an error message to display for the given context.
106
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
107
+ * @param valid - value indicating the validity
108
+ * @param errorMessage - the error message to display
109
+ */
110
+ setError(valid: MgInputPassword['valid'], errorMessage: string): Promise<void>;
111
+ /**
112
+ * Method to set validity values
113
+ * @param newValue - valid new value
114
+ */
115
+ private setValidity;
102
116
  /**
103
117
  * Handle input event
104
118
  */
@@ -113,6 +127,7 @@ export declare class MgInputPassword {
113
127
  private checkValidity;
114
128
  /**
115
129
  * Set input error message
130
+ * @param errorMessage - errorMessage override
116
131
  */
117
132
  private setErrorMessage;
118
133
  /*************
@@ -100,9 +100,23 @@ export declare class MgInputRadio {
100
100
  */
101
101
  inputValid: EventEmitter<boolean>;
102
102
  /**
103
- * Public method to display errors
103
+ * Display input error if it exists.
104
104
  */
105
105
  displayError(): Promise<void>;
106
+ /**
107
+ * Set an error and display a custom error message.
108
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
109
+ * It must be paired with an error message to display for the given context.
110
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
111
+ * @param valid - value indicating the validity
112
+ * @param errorMessage - the error message to display
113
+ */
114
+ setError(valid: MgInputRadio['valid'], errorMessage: string): Promise<void>;
115
+ /**
116
+ * Method to set validity values
117
+ * @param newValue - valid new value
118
+ */
119
+ private setValidity;
106
120
  /**
107
121
  * Handle input event
108
122
  * @param event - input event
@@ -118,6 +132,7 @@ export declare class MgInputRadio {
118
132
  private checkValidity;
119
133
  /**
120
134
  * Set input error message
135
+ * @param errorMessage - errorMessage override
121
136
  */
122
137
  private setErrorMessage;
123
138
  /**
@@ -122,9 +122,23 @@ export declare class MgInputSelect {
122
122
  */
123
123
  inputValid: EventEmitter<boolean>;
124
124
  /**
125
- * Public method to display errors
125
+ * Display input error if it exists.
126
126
  */
127
127
  displayError(): Promise<void>;
128
+ /**
129
+ * Set an error and display a custom error message.
130
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
131
+ * It must be paired with an error message to display for the given context.
132
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
133
+ * @param valid - value indicating the validity
134
+ * @param errorMessage - the error message to display
135
+ */
136
+ setError(valid: MgInputSelect['valid'], errorMessage: string): Promise<void>;
137
+ /**
138
+ * Method to set validity values
139
+ * @param newValue - valid new value
140
+ */
141
+ private setValidity;
128
142
  /**
129
143
  * Handle input event
130
144
  */
@@ -159,6 +173,7 @@ export declare class MgInputSelect {
159
173
  private checkValidity;
160
174
  /**
161
175
  * Set input error message
176
+ * @param errorMessage - errorMessage override
162
177
  */
163
178
  private setErrorMessage;
164
179
  /*************
@@ -88,6 +88,7 @@ export declare class MgInputText {
88
88
  * Define input pattern error message
89
89
  */
90
90
  patternErrorMessage: string;
91
+ validatePattern(newValue: string): void;
91
92
  /**
92
93
  * Add a tooltip message next to the input
93
94
  */
@@ -129,9 +130,23 @@ export declare class MgInputText {
129
130
  */
130
131
  setFocus(): Promise<void>;
131
132
  /**
132
- * Public method to display errors
133
+ * Display input error if it exists.
133
134
  */
134
135
  displayError(): Promise<void>;
136
+ /**
137
+ * Set an error and display a custom error message.
138
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
139
+ * It must be paired with an error message to display for the given context.
140
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
141
+ * @param valid - value indicating the validity
142
+ * @param errorMessage - the error message to display
143
+ */
144
+ setError(valid: MgInputText['valid'], errorMessage: string): Promise<void>;
145
+ /**
146
+ * Method to set validity values
147
+ * @param newValue - valid new value
148
+ */
149
+ private setValidity;
135
150
  /**
136
151
  * Handle input event
137
152
  */
@@ -150,12 +165,9 @@ export declare class MgInputText {
150
165
  private checkValidity;
151
166
  /**
152
167
  * Set input error message
168
+ * @param errorMessage - errorMessage override
153
169
  */
154
170
  private setErrorMessage;
155
- /**
156
- * Validate pattern configuration
157
- */
158
- private validatePattern;
159
171
  /**
160
172
  * Validate append slot
161
173
  */
@@ -78,6 +78,7 @@ export declare class MgInputTextarea {
78
78
  * Define input pattern error message
79
79
  */
80
80
  patternErrorMessage: string;
81
+ validatePattern(newValue: string): void;
81
82
  /**
82
83
  * Define the number of visible text lines for the control
83
84
  */
@@ -124,9 +125,23 @@ export declare class MgInputTextarea {
124
125
  */
125
126
  inputValid: EventEmitter<boolean>;
126
127
  /**
127
- * Public method to display errors
128
+ * Display input error if it exists.
128
129
  */
129
130
  displayError(): Promise<void>;
131
+ /**
132
+ * Set an error and display a custom error message.
133
+ * This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.
134
+ * It must be paired with an error message to display for the given context.
135
+ * When used to set validity to `false`, you should use this method again to reset the validity to `true`.
136
+ * @param valid - value indicating the validity
137
+ * @param errorMessage - the error message to display
138
+ */
139
+ setError(valid: MgInputTextarea['valid'], errorMessage: string): Promise<void>;
140
+ /**
141
+ * Method to set validity values
142
+ * @param newValue - valid new value
143
+ */
144
+ private setValidity;
130
145
  /**
131
146
  * Handle input event
132
147
  */
@@ -151,12 +166,9 @@ export declare class MgInputTextarea {
151
166
  private checkValidity;
152
167
  /**
153
168
  * Set input error message
169
+ * @param errorMessage - errorMessage override
154
170
  */
155
171
  private setErrorMessage;
156
- /**
157
- * Validate pattern configuration
158
- */
159
- private validatePattern;
160
172
  /*************
161
173
  * Lifecycle *
162
174
  *************/
@@ -61,7 +61,7 @@ export declare class MgForm {
61
61
  */
62
62
  formSubmit: EventEmitter<boolean>;
63
63
  /**
64
- * Public method to display errors
64
+ * Display input error if it exists.
65
65
  */
66
66
  displayError(): Promise<void>;
67
67
  /**
@@ -28,11 +28,11 @@ export declare class MgPanel {
28
28
  * Panel title pattern
29
29
  */
30
30
  titlePattern: string;
31
- validatetitlePattern(newValue: string): void;
32
31
  /**
33
32
  * Panel title pattern error message
34
33
  */
35
34
  titlePatternErrorMessage: string;
35
+ validateTitlePattern(newValue: string): void;
36
36
  /**
37
37
  * Define if panel title is editable
38
38
  */
@@ -20,6 +20,7 @@ export declare class MgPopover {
20
20
  * Needed by the input for accessibility `aria-decribedby`.
21
21
  */
22
22
  identifier: string;
23
+ validateIdentifier(): void;
23
24
  /**
24
25
  * Popover placement
25
26
  */
@@ -174,7 +174,7 @@ export namespace Components {
174
174
  */
175
175
  "disabled": boolean;
176
176
  /**
177
- * Public method to display errors
177
+ * Display input error if it exists.
178
178
  */
179
179
  "displayError": () => Promise<void>;
180
180
  /**
@@ -236,7 +236,7 @@ export namespace Components {
236
236
  */
237
237
  "disabled": boolean;
238
238
  /**
239
- * Public method to display errors
239
+ * Display input error if it exists.
240
240
  */
241
241
  "displayError": () => Promise<void>;
242
242
  /**
@@ -283,12 +283,18 @@ export namespace Components {
283
283
  * Define if mg-input-checkbox is required
284
284
  */
285
285
  "required": boolean;
286
+ /**
287
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
288
+ * @param valid - value indicating the validity
289
+ * @param errorMessage - the error message to display
290
+ */
291
+ "setError": (valid: MgInputCheckbox['valid'], errorMessage: string) => Promise<void>;
286
292
  /**
287
293
  * Add a tooltip message next to the input
288
294
  */
289
295
  "tooltip": string;
290
296
  /**
291
- * Define checkbox type
297
+ * Define checkbox type When it's undefined the type is dynamic: - With 0-5 items type is 'checkbox' - With 5-10 items type is 'multi' When it set the type is locked to the defined value. When type is dynamic OR with 'multi' type AND Over 10 items "search" feature is enabled
292
298
  */
293
299
  "type": CheckboxType;
294
300
  /**
@@ -335,7 +341,7 @@ export namespace Components {
335
341
  */
336
342
  "disabled": boolean;
337
343
  /**
338
- * Public method to display errors
344
+ * Display input error if it exists.
339
345
  */
340
346
  "displayError": () => Promise<void>;
341
347
  /**
@@ -382,6 +388,12 @@ export namespace Components {
382
388
  * Define if input is required
383
389
  */
384
390
  "required": boolean;
391
+ /**
392
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
393
+ * @param valid - value indicating the validity
394
+ * @param errorMessage - the error message to display
395
+ */
396
+ "setError": (valid: MgInputDate['valid'], errorMessage: string) => Promise<void>;
385
397
  /**
386
398
  * Add a tooltip message next to the input
387
399
  */
@@ -409,7 +421,7 @@ export namespace Components {
409
421
  */
410
422
  "disabled": boolean;
411
423
  /**
412
- * Public method to display errors
424
+ * Display input error if it exists.
413
425
  */
414
426
  "displayError": () => Promise<void>;
415
427
  /**
@@ -468,6 +480,12 @@ export namespace Components {
468
480
  * Define if input is required
469
481
  */
470
482
  "required": boolean;
483
+ /**
484
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
485
+ * @param valid - value indicating the validity
486
+ * @param errorMessage - the error message to display
487
+ */
488
+ "setError": (valid: MgInputNumeric['valid'], errorMessage: string) => Promise<void>;
471
489
  /**
472
490
  * Add a tooltip message next to the input
473
491
  */
@@ -491,7 +509,7 @@ export namespace Components {
491
509
  */
492
510
  "disabled": boolean;
493
511
  /**
494
- * Public method to display errors
512
+ * Display input error if it exists.
495
513
  */
496
514
  "displayError": () => Promise<void>;
497
515
  /**
@@ -538,6 +556,12 @@ export namespace Components {
538
556
  * Define if input is required
539
557
  */
540
558
  "required": boolean;
559
+ /**
560
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
561
+ * @param valid - value indicating the validity
562
+ * @param errorMessage - the error message to display
563
+ */
564
+ "setError": (valid: MgInputPassword['valid'], errorMessage: string) => Promise<void>;
541
565
  /**
542
566
  * Add a tooltip message next to the input
543
567
  */
@@ -557,7 +581,7 @@ export namespace Components {
557
581
  */
558
582
  "disabled": boolean;
559
583
  /**
560
- * Public method to display errors
584
+ * Display input error if it exists.
561
585
  */
562
586
  "displayError": () => Promise<void>;
563
587
  /**
@@ -604,6 +628,12 @@ export namespace Components {
604
628
  * Define if input is required
605
629
  */
606
630
  "required": boolean;
631
+ /**
632
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
633
+ * @param valid - value indicating the validity
634
+ * @param errorMessage - the error message to display
635
+ */
636
+ "setError": (valid: MgInputRadio['valid'], errorMessage: string) => Promise<void>;
607
637
  /**
608
638
  * Add a tooltip message next to the input
609
639
  */
@@ -623,7 +653,7 @@ export namespace Components {
623
653
  */
624
654
  "disabled": boolean;
625
655
  /**
626
- * Public method to display errors
656
+ * Display input error if it exists.
627
657
  */
628
658
  "displayError": () => Promise<void>;
629
659
  /**
@@ -682,6 +712,12 @@ export namespace Components {
682
712
  * Define if input is required
683
713
  */
684
714
  "required": boolean;
715
+ /**
716
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
717
+ * @param valid - value indicating the validity
718
+ * @param errorMessage - the error message to display
719
+ */
720
+ "setError": (valid: MgInputSelect['valid'], errorMessage: string) => Promise<void>;
685
721
  /**
686
722
  * Add a tooltip message next to the input
687
723
  */
@@ -705,7 +741,7 @@ export namespace Components {
705
741
  */
706
742
  "displayCharacterLeft": boolean;
707
743
  /**
708
- * Public method to display errors
744
+ * Display input error if it exists.
709
745
  */
710
746
  "displayError": () => Promise<void>;
711
747
  /**
@@ -768,6 +804,12 @@ export namespace Components {
768
804
  * Define if input is required
769
805
  */
770
806
  "required": boolean;
807
+ /**
808
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
809
+ * @param valid - value indicating the validity
810
+ * @param errorMessage - the error message to display
811
+ */
812
+ "setError": (valid: MgInputText['valid'], errorMessage: string) => Promise<void>;
771
813
  /**
772
814
  * Public method to play input focus
773
815
  */
@@ -799,7 +841,7 @@ export namespace Components {
799
841
  */
800
842
  "displayCharacterLeft": boolean;
801
843
  /**
802
- * Public method to display errors
844
+ * Display input error if it exists.
803
845
  */
804
846
  "displayError": () => Promise<void>;
805
847
  /**
@@ -866,6 +908,12 @@ export namespace Components {
866
908
  * Define the number of visible text lines for the control
867
909
  */
868
910
  "rows": number;
911
+ /**
912
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
913
+ * @param valid - value indicating the validity
914
+ * @param errorMessage - the error message to display
915
+ */
916
+ "setError": (valid: MgInputTextarea['valid'], errorMessage: string) => Promise<void>;
869
917
  /**
870
918
  * Add a tooltip message next to the input
871
919
  */
@@ -1807,7 +1855,7 @@ declare namespace LocalJSX {
1807
1855
  */
1808
1856
  "tooltip"?: string;
1809
1857
  /**
1810
- * Define checkbox type
1858
+ * Define checkbox type When it's undefined the type is dynamic: - With 0-5 items type is 'checkbox' - With 5-10 items type is 'multi' When it set the type is locked to the defined value. When type is dynamic OR with 'multi' type AND Over 10 items "search" feature is enabled
1811
1859
  */
1812
1860
  "type"?: CheckboxType;
1813
1861
  /**
@@ -67,3 +67,9 @@ export declare const getWindows: (localWindow: Window) => Window[];
67
67
  * @returns The list of windows found
68
68
  */
69
69
  export declare const getParentWindows: (localWindow: Window, windows?: Window[]) => Window[];
70
+ /**
71
+ * Validate string
72
+ * @param value - value to check
73
+ * @returns if string is valid
74
+ */
75
+ export declare const isValidString: (value: unknown) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgdis/mg-components",
3
- "version": "5.17.0",
3
+ "version": "5.18.0",
4
4
  "description": "MG Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",