@mgdis/mg-components 6.26.0 → 6.28.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 (106) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mg-action-more_36.cjs.entry.js +506 -161
  3. package/dist/cjs/mg-components.cjs.js +1 -1
  4. package/dist/cjs/mg-illustration.cjs.entry.js +1 -1
  5. package/dist/cjs/mg-input-combobox.cjs.entry.js +60 -8
  6. package/dist/cjs/mg-input-file.cjs.entry.js +26 -3
  7. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +2304 -1131
  8. package/dist/cjs/mg-loader.cjs.entry.js +1 -1
  9. package/dist/cjs/mg-progress.cjs.entry.js +1 -1
  10. package/dist/collection/assets/illustrations/index.js +1 -1
  11. package/dist/collection/assets/jodit/jodit.css +14 -1
  12. package/dist/collection/components/atoms/mg-button/mg-button.js +86 -13
  13. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +103 -55
  14. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +25 -4
  15. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +59 -7
  16. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +25 -9
  17. package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +25 -2
  18. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +24 -6
  19. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +24 -5
  20. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +64 -16
  21. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +32 -10
  22. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +24 -5
  23. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +24 -6
  24. package/dist/collection/components/molecules/mg-details/mg-details.js +5 -1
  25. package/dist/collection/components/molecules/mg-form/mg-form.js +83 -9
  26. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  27. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  28. package/dist/collection/components/molecules/mg-message/mg-message.js +3 -3
  29. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  30. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  31. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  32. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  33. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  34. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  35. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
  36. package/dist/components/mg-button2.js +1 -1
  37. package/dist/components/mg-details.js +1 -1
  38. package/dist/components/mg-form.js +1 -1
  39. package/dist/components/mg-illustrated-message.js +1 -1
  40. package/dist/components/mg-illustration.js +1 -1
  41. package/dist/components/mg-input-checkbox.js +1 -1
  42. package/dist/components/mg-input-combobox.js +1 -1
  43. package/dist/components/mg-input-date.js +1 -1
  44. package/dist/components/mg-input-file.js +1 -1
  45. package/dist/components/mg-input-numeric.js +1 -1
  46. package/dist/components/mg-input-password.js +1 -1
  47. package/dist/components/mg-input-radio.js +1 -1
  48. package/dist/components/mg-input-rich-text-editor.js +285 -285
  49. package/dist/components/mg-input-select2.js +1 -1
  50. package/dist/components/mg-input-text2.js +1 -1
  51. package/dist/components/mg-input-textarea.js +1 -1
  52. package/dist/components/mg-input-toggle.js +1 -1
  53. package/dist/components/mg-input2.js +1 -1
  54. package/dist/components/mg-loader2.js +1 -1
  55. package/dist/components/mg-menu-item2.js +1 -1
  56. package/dist/components/mg-message2.js +1 -1
  57. package/dist/components/mg-modal.js +1 -1
  58. package/dist/components/mg-panel.js +1 -1
  59. package/dist/components/mg-popover-content2.js +1 -1
  60. package/dist/components/mg-popover2.js +1 -1
  61. package/dist/components/mg-progress.js +1 -1
  62. package/dist/components/mg-skip-links.js +1 -1
  63. package/dist/components/mg-tabs2.js +1 -1
  64. package/dist/components/mg-tooltip2.js +1 -1
  65. package/dist/custom-elements.json +12 -2
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/mg-action-more_36.entry.js +507 -162
  68. package/dist/esm/mg-components.js +1 -1
  69. package/dist/esm/mg-illustration.entry.js +1 -1
  70. package/dist/esm/mg-input-combobox.entry.js +60 -8
  71. package/dist/esm/mg-input-file.entry.js +26 -3
  72. package/dist/esm/mg-input-rich-text-editor.entry.js +2304 -1131
  73. package/dist/esm/mg-loader.entry.js +1 -1
  74. package/dist/esm/mg-progress.entry.js +1 -1
  75. package/dist/mg-components/mg-components.esm.js +1 -1
  76. package/dist/mg-components/p-2198f145.entry.js +1 -0
  77. package/dist/mg-components/p-85ebacd6.entry.js +1 -0
  78. package/dist/mg-components/{p-96fc508e.entry.js → p-c2beff2c.entry.js} +1 -1
  79. package/dist/mg-components/p-d4a4eb78.entry.js +1 -0
  80. package/dist/mg-components/p-e8b5e8d8.entry.js +1667 -0
  81. package/dist/mg-components/p-f308e2e4.entry.js +1 -0
  82. package/dist/mg-components/p-fdcce8d5.entry.js +1 -0
  83. package/dist/types/components/atoms/mg-button/mg-button.d.ts +41 -2
  84. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +33 -6
  85. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +1 -0
  86. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +9 -0
  87. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +21 -1
  88. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +9 -0
  89. package/dist/types/components/molecules/inputs/mg-input-file/mg-input-file.d.ts +9 -0
  90. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +9 -0
  91. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +9 -0
  92. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +29 -2
  93. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +10 -1
  94. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +9 -0
  95. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +9 -0
  96. package/dist/types/components/molecules/mg-form/mg-form.d.ts +22 -0
  97. package/dist/types/components.d.ts +10 -2
  98. package/ide/intellij/web-types.json +4 -4
  99. package/ide/vscode/html-custom-data.json +3 -3
  100. package/package.json +19 -19
  101. package/dist/mg-components/p-206505b5.entry.js +0 -1667
  102. package/dist/mg-components/p-3ad7441c.entry.js +0 -1
  103. package/dist/mg-components/p-5dff879a.entry.js +0 -1
  104. package/dist/mg-components/p-b20f3698.entry.js +0 -1
  105. package/dist/mg-components/p-bf2252c9.entry.js +0 -1
  106. package/dist/mg-components/p-f8e58181.entry.js +0 -1
@@ -44,8 +44,10 @@ export declare class MgButton {
44
44
  fullWidth: boolean;
45
45
  validateFullWidth(newValue: MgButton['fullWidth']): void;
46
46
  /**
47
- * Define form id to attach button with.
48
- * If this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.
47
+ * Id of the form to associate the button with, following the native `form` attribute semantics:
48
+ * it must match the `identifier` of a `mg-form`, or the `id` of a `<form>`, in the same document,
49
+ * and it overrides the ancestor form.
50
+ * If this attribute is not set, the button is associated with its ancestor form.
49
51
  */
50
52
  form?: string;
51
53
  /**
@@ -102,6 +104,43 @@ export declare class MgButton {
102
104
  * Check if props are well configured on init
103
105
  */
104
106
  componentWillLoad(): void;
107
+ /**
108
+ * Submit a native form the way a native submit button does
109
+ * @param form - the form to submit
110
+ */
111
+ private dispatchSubmit;
112
+ /**
113
+ * Wrap a `mg-form` in the actions its public API offers, so nothing reaches into its shadow DOM
114
+ * @param mgForm - the owning mg-form
115
+ * @returns its submit and reset actions
116
+ */
117
+ private mgFormActions;
118
+ /**
119
+ * Wrap a native form in the same actions
120
+ * @param form - the owning form
121
+ * @returns its submit and reset actions
122
+ */
123
+ private nativeFormActions;
124
+ /**
125
+ * Resolve the form the `form` id points to. An id reference does not cross a shadow boundary, so
126
+ * it resolves in the tree the button belongs to — the document, or the shadow tree it sits in —
127
+ * the way a native form owner does. The ancestor wins when it is the one pointed at: two forms
128
+ * can share an identifier, and a tree-wide lookup would retain the first one.
129
+ * @returns the actions of the form holding that id, or null when none does
130
+ */
131
+ private resolveOwnerById;
132
+ /**
133
+ * Resolve the form owning this button: an explicit `form` id overrides the ancestor form, and an
134
+ * id matching nothing logs then falls back on it, so a button never loses an association it had.
135
+ * @returns the owning form actions, or null when the button has no form owner
136
+ */
137
+ private resolveFormOwner;
138
+ /**
139
+ * Act on the owning form. The owner is resolved here rather than on load because a native form
140
+ * owner is re-resolved on every submission, never captured once: the button follows a `form`
141
+ * changed after render, and no longer races the target form hydration.
142
+ */
143
+ private handleFormClick;
105
144
  /**
106
145
  * Add listners
107
146
  */
@@ -43,7 +43,12 @@ export declare class MgTooltip {
43
43
  * Disable tooltip
44
44
  */
45
45
  disabled: boolean;
46
- watchDisabled(newValue: MgTooltip['disabled']): void;
46
+ watchDisabled(): void;
47
+ /**
48
+ * Toggle the popper scroll and resize listeners, only needed while the tooltip is visible
49
+ * @param enabled - listeners state to apply
50
+ */
51
+ private setPopperEventListeners;
47
52
  /**
48
53
  * Show tooltip
49
54
  */
@@ -79,14 +84,35 @@ export declare class MgTooltip {
79
84
  * Method to reset guard value
80
85
  */
81
86
  private resetGuard;
87
+ /**
88
+ * Display tooltip when the tooltiped element takes focus
89
+ */
90
+ private handleTooltipedElementFocus;
91
+ /**
92
+ * Hide tooltip when the tooltiped element loses focus
93
+ */
94
+ private handleTooltipedElementBlur;
95
+ /**
96
+ * Display tooltip when the tooltiped element is hovered
97
+ */
98
+ private handleTooltipedElementMouseenter;
99
+ /**
100
+ * Hide tooltip when the tooltiped element is not hovered anymore
101
+ */
102
+ private handleTooltipedElementMouseleave;
103
+ /**
104
+ * Manage all tooltiped element listeners
105
+ * @param element - element to bind or unbind
106
+ * @param action - process to apply on element listeners
107
+ */
108
+ private manageTooltipedElementListeners;
82
109
  /**
83
110
  * Update slot content when it is a mg-button
84
111
  * @param mgButton - slotted mg-button
85
112
  */
86
113
  private setMgButtonWrapper;
87
114
  /**
88
- * Set popper instance
89
- * @param strategy - popper strategy to apply on instance
115
+ * Set popper instance on the current tooltiped element
90
116
  */
91
117
  private setPopper;
92
118
  /**
@@ -100,10 +126,11 @@ export declare class MgTooltip {
100
126
  */
101
127
  private setMgButtonMutationObserver;
102
128
  /**
103
- * Set tooltiped element aria-describedby
104
- * @param element - element to update
129
+ * Reconcile the tooltiped element a11y: the tooltip is restituted — `aria-describedby` exposed, and a
130
+ * non-interactive element made focusable (`tabindex` + `role`) — unless it is disabled and not displayed.
131
+ * Pre-existing `aria-describedby` ids are preserved.
105
132
  */
106
- private setAriaDescribedby;
133
+ private updateTooltipedElementA11y;
107
134
  /**
108
135
  * Render tooltip content element and init listeners
109
136
  */
@@ -23,6 +23,7 @@ interface InputBaseMethods {
23
23
  readonly: boolean;
24
24
  displayError: () => Promise<void>;
25
25
  reset: () => Promise<void>;
26
+ setFocus: () => Promise<void>;
26
27
  }
27
28
  /**
28
29
  * Possible Input types
@@ -10,6 +10,7 @@ export declare class MgInputCheckbox implements Omit<IMgInputCheckboxListProps,
10
10
  private searchInput;
11
11
  private messages;
12
12
  private hasDisplayedError;
13
+ private validityCheckPending;
13
14
  private customErrorMessage;
14
15
  private mode;
15
16
  private readonly baseClassName;
@@ -301,6 +302,14 @@ export declare class MgInputCheckbox implements Omit<IMgInputCheckboxListProps,
301
302
  * @returns timeout
302
303
  */
303
304
  componentWillLoad(): ReturnType<typeof setTimeout>;
305
+ /**
306
+ * Recompute validity once the DOM is in sync with `value`.
307
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
308
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
309
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
310
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
311
+ */
312
+ componentDidUpdate(): void;
304
313
  /**
305
314
  * add listeners and DOM attributed
306
315
  */
@@ -13,6 +13,7 @@ export declare class MgInputCombobox {
13
13
  private popoverId;
14
14
  private messages;
15
15
  private hasDisplayedError;
16
+ private validityCheckPending;
16
17
  private customErrorMessage;
17
18
  private handlerInProgress;
18
19
  private loadingAction;
@@ -34,7 +35,7 @@ export declare class MgInputCombobox {
34
35
  * Define components items
35
36
  */
36
37
  items: (string | Option)[];
37
- watchItems(newValue: MgInputCombobox['items']): void;
38
+ watchItems(newValue: MgInputCombobox['items'], oldValue?: MgInputCombobox['items']): void;
38
39
  /**
39
40
  * Define items label
40
41
  * Include short description. Required for accessibility.
@@ -308,6 +309,17 @@ export declare class MgInputCombobox {
308
309
  * @param fromSetErrorContext - context come from `setError` method
309
310
  */
310
311
  private setErrorMessage;
312
+ /**
313
+ * Check if an option matches the current filter
314
+ * @param option - option to match
315
+ * @returns true if the option matches the filter
316
+ */
317
+ private matchFilter;
318
+ /**
319
+ * Get all the options matching the current filter
320
+ * @returns filtered options
321
+ */
322
+ private getFilteredOptions;
311
323
  /**
312
324
  * Get first page with filter applied
313
325
  * @returns first page with filter applied
@@ -343,6 +355,14 @@ export declare class MgInputCombobox {
343
355
  * @returns timeout
344
356
  */
345
357
  componentWillLoad(): ReturnType<typeof setTimeout>;
358
+ /**
359
+ * Recompute validity once the DOM is in sync with `value`.
360
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
361
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
362
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
363
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
364
+ */
365
+ componentDidUpdate(): void;
346
366
  /**
347
367
  * Render
348
368
  * @returns HTML Element
@@ -10,6 +10,7 @@ export declare class MgInputDate {
10
10
  private locale;
11
11
  private systemLocale;
12
12
  private hasDisplayedError;
13
+ private validityCheckPending;
13
14
  private handlerInProgress;
14
15
  private customErrorMessage;
15
16
  /**************
@@ -186,6 +187,14 @@ export declare class MgInputDate {
186
187
  * @returns timeout
187
188
  */
188
189
  componentWillLoad(): ReturnType<typeof setTimeout>;
190
+ /**
191
+ * Recompute validity once the DOM is in sync with `value`.
192
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
193
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
194
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
195
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
196
+ */
197
+ componentDidUpdate(): void;
189
198
  /**
190
199
  * Render pattern
191
200
  * @returns translated html pattern
@@ -10,6 +10,7 @@ export declare class MgInputFile {
10
10
  private locale;
11
11
  private messages;
12
12
  private hasDisplayedError;
13
+ private validityCheckPending;
13
14
  private customErrorMessage;
14
15
  private handlerInProgress;
15
16
  /**************
@@ -197,6 +198,14 @@ export declare class MgInputFile {
197
198
  * @returns timeout
198
199
  */
199
200
  componentWillLoad(): ReturnType<typeof setTimeout>;
201
+ /**
202
+ * Recompute validity once the DOM is in sync with `value`.
203
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
204
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
205
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
206
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
207
+ */
208
+ componentDidUpdate(): void;
200
209
  /**
201
210
  * Render files
202
211
  * @returns formated files.
@@ -17,6 +17,7 @@ export declare class MgInputNumeric {
17
17
  private locale;
18
18
  private messages;
19
19
  private hasDisplayedError;
20
+ private validityCheckPending;
20
21
  private handlerInProgress;
21
22
  private customErrorMessage;
22
23
  /**************
@@ -263,6 +264,14 @@ export declare class MgInputNumeric {
263
264
  * @returns timeout
264
265
  */
265
266
  componentWillLoad(): ReturnType<typeof setTimeout>;
267
+ /**
268
+ * Recompute validity once the DOM is in sync with `value`.
269
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
270
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
271
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
272
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
273
+ */
274
+ componentDidUpdate(): void;
266
275
  /**
267
276
  * Renders the readonly content of the input component.
268
277
  * @returns The readonly content element.
@@ -10,6 +10,7 @@ export declare class MgInputPassword {
10
10
  private hasDisplayedError;
11
11
  private handlerInProgress;
12
12
  private customErrorMessage;
13
+ private validityCheckPending;
13
14
  /**************
14
15
  * Decorators *
15
16
  **************/
@@ -168,6 +169,14 @@ export declare class MgInputPassword {
168
169
  * @returns timeout
169
170
  */
170
171
  componentWillLoad(): ReturnType<typeof setTimeout>;
172
+ /**
173
+ * Recompute validity once the DOM is in sync with `value`.
174
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
175
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
176
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
177
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
178
+ */
179
+ componentDidUpdate(): void;
171
180
  /**
172
181
  * Render
173
182
  * @returns HTML Element
@@ -6,10 +6,10 @@ export declare class MgInputRadio {
6
6
  /************
7
7
  * Internal *
8
8
  ************/
9
- private inputs;
10
9
  private readonly classVerticalList;
11
10
  private messages;
12
11
  private hasDisplayedError;
12
+ private validityCheckPending;
13
13
  private handlerInProgress;
14
14
  private customErrorMessage;
15
15
  /**************
@@ -28,7 +28,7 @@ export declare class MgInputRadio {
28
28
  * Items are the possible options to select
29
29
  */
30
30
  items: string[] | RadioOption[];
31
- validateItems(newValue: string[] | RadioOption[]): void;
31
+ validateItems(newValue: string[] | RadioOption[], oldValue?: string[] | RadioOption[]): void;
32
32
  /**
33
33
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
34
34
  */
@@ -150,6 +150,13 @@ export declare class MgInputRadio {
150
150
  * Handle blur event
151
151
  */
152
152
  private handleBlur;
153
+ /**
154
+ * Check if the required constraint is fulfilled
155
+ * The native group validity cannot answer it: a browser keeps the checked member a group had, even
156
+ * once that input is removed from the DOM. Options that cannot be selected are ignored.
157
+ * @returns required constraint is fulfilled
158
+ */
159
+ private validateRequired;
153
160
  /**
154
161
  * Check if input is valid
155
162
  */
@@ -164,6 +171,18 @@ export declare class MgInputRadio {
164
171
  * @returns element
165
172
  */
166
173
  private getInvalidElement;
174
+ /**
175
+ * Get the rendered radio inputs
176
+ * Read from the DOM: references kept from a render would outlive the inputs they point to.
177
+ * @returns rendered radio inputs
178
+ */
179
+ private getInputs;
180
+ /**
181
+ * Check if a value is the selected one
182
+ * @param optionValue - option value to compare to the component value
183
+ * @returns option value is the selected one
184
+ */
185
+ private isSelectedValue;
167
186
  /*************
168
187
  * Lifecycle *
169
188
  *************/
@@ -172,6 +191,14 @@ export declare class MgInputRadio {
172
191
  * @returns timeout
173
192
  */
174
193
  componentWillLoad(): ReturnType<typeof setTimeout>;
194
+ /**
195
+ * Recompute validity once the DOM is in sync with `value`.
196
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
197
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
198
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
199
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
200
+ */
201
+ componentDidUpdate(): void;
175
202
  /**
176
203
  * Render
177
204
  * @returns HTML Element
@@ -9,6 +9,7 @@ export declare class MgInputSelect {
9
9
  private input;
10
10
  private messages;
11
11
  private hasDisplayedError;
12
+ private validityCheckPending;
12
13
  private handlerInProgress;
13
14
  private customErrorMessage;
14
15
  /**************
@@ -27,7 +28,7 @@ export declare class MgInputSelect {
27
28
  * Items are the possible options to select
28
29
  */
29
30
  items: (string | SelectOption)[];
30
- validateItems(newValue: MgInputSelect['items']): void;
31
+ validateItems(newValue: MgInputSelect['items'], oldValue?: MgInputSelect['items']): void;
31
32
  /**
32
33
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
33
34
  */
@@ -199,6 +200,14 @@ export declare class MgInputSelect {
199
200
  * @returns timeout
200
201
  */
201
202
  componentWillLoad(): ReturnType<typeof setTimeout>;
203
+ /**
204
+ * Recompute validity once the DOM is in sync with `value`.
205
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
206
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
207
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
208
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
209
+ */
210
+ componentDidUpdate(): void;
202
211
  /**
203
212
  * Render option
204
213
  * @param option - to render
@@ -22,6 +22,7 @@ export declare class MgInputText {
22
22
  private hasDisplayedError;
23
23
  private customErrorMessage;
24
24
  private handlerInProgress;
25
+ private validityCheckPending;
25
26
  /**************
26
27
  * Decorators *
27
28
  **************/
@@ -216,6 +217,14 @@ export declare class MgInputText {
216
217
  * @returns timeout
217
218
  */
218
219
  componentWillLoad(): ReturnType<typeof setTimeout>;
220
+ /**
221
+ * Recompute validity once the DOM is in sync with `value`.
222
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
223
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
224
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
225
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
226
+ */
227
+ componentDidUpdate(): void;
219
228
  /**
220
229
  * Renders the readonly content of the input component.
221
230
  * @returns The readonly content element.
@@ -9,6 +9,7 @@ export declare class MgInputTextarea {
9
9
  private input;
10
10
  private messages;
11
11
  private hasDisplayedError;
12
+ private validityCheckPending;
12
13
  private handlerInProgress;
13
14
  private customErrorMessage;
14
15
  /**************
@@ -190,6 +191,14 @@ export declare class MgInputTextarea {
190
191
  * @returns timeout
191
192
  */
192
193
  componentWillLoad(): ReturnType<typeof setTimeout>;
194
+ /**
195
+ * Recompute validity once the DOM is in sync with `value`.
196
+ * `@Watch('value')` fires before Stencil re-renders, so the rendered control still holds the
197
+ * previous value at that point (visible with a programmatic value change, e.g. a `v-model`
198
+ * default value). The watcher therefore only raises a flag, and the check runs here, after the
199
+ * render. Renders unrelated to `value` leave the flag down and recompute nothing.
200
+ */
201
+ componentDidUpdate(): void;
193
202
  /**
194
203
  * Render
195
204
  * @returns HTML Element
@@ -78,6 +78,10 @@ export declare class MgForm {
78
78
  * Required message
79
79
  */
80
80
  requiredMessageText: string;
81
+ /**
82
+ * Whether the form has slotted actions
83
+ */
84
+ hasActions: boolean;
81
85
  /**
82
86
  * Emitted event on form validity check
83
87
  * Tells if form is valid or not
@@ -99,6 +103,24 @@ export declare class MgForm {
99
103
  * Reset form inputs values, validity and error state
100
104
  */
101
105
  reset(): Promise<void>;
106
+ /**
107
+ * Request the form submission: emit `form-submit`, whatever the inputs validity.
108
+ * This is what a `mg-button` associated with this form goes through, so that reaching the form
109
+ * needs no access to its shadow DOM. Unlike the native `requestSubmit()`, it runs no constraint
110
+ * validation: validity is the consumer's call here, as it is on submission from a nested button.
111
+ * Read `invalid`, or call `displayError()` / `focusFirstInvalidInput()`.
112
+ * Unlike `reset()`, a readonly form still submits: readonly fields do not block a native
113
+ * submission either, and a nested button has always submitted such a form.
114
+ */
115
+ requestSubmit(): Promise<void>;
116
+ /**
117
+ * **Experimental.** The signature may still change in a minor release.
118
+ *
119
+ * Display errors, then focus and scroll to the first invalid input. Focusing is what
120
+ * carries the information for assistive technologies, a scroll announces nothing.
121
+ * Read the `invalid` property to know whether the form had an invalid input.
122
+ */
123
+ focusFirstInvalidInput(): Promise<void>;
102
124
  /**
103
125
  * Define required message based on mg-inputs required elements
104
126
  */
@@ -156,7 +156,7 @@ export namespace Components {
156
156
  */
157
157
  "disabled"?: boolean;
158
158
  /**
159
- * Define form id to attach button with. If this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.
159
+ * Id of the form to associate the button with, following the native `form` attribute semantics: it must match the `identifier` of a `mg-form`, or the `id` of a `<form>`, in the same document, and it overrides the ancestor form. If this attribute is not set, the button is associated with its ancestor form.
160
160
  */
161
161
  "form"?: string;
162
162
  /**
@@ -317,6 +317,10 @@ export namespace Components {
317
317
  * Display inputs/fieldsets errors if it exists.
318
318
  */
319
319
  "displayError": () => Promise<void>;
320
+ /**
321
+ * **Experimental.** The signature may still change in a minor release. Display errors, then focus and scroll to the first invalid input. Focusing is what carries the information for assistive technologies, a scroll announces nothing. Read the `invalid` property to know whether the form had an invalid input.
322
+ */
323
+ "focusFirstInvalidInput": () => Promise<void>;
320
324
  /**
321
325
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js) If not set, it will be created.
322
326
  * @default createID('mg-form')
@@ -341,6 +345,10 @@ export namespace Components {
341
345
  * @default false
342
346
  */
343
347
  "readonly": boolean;
348
+ /**
349
+ * Request the form submission: emit `form-submit`, whatever the inputs validity. This is what a `mg-button` associated with this form goes through, so that reaching the form needs no access to its shadow DOM. Unlike the native `requestSubmit()`, it runs no constraint validation: validity is the consumer's call here, as it is on submission from a nested button. Read `invalid`, or call `displayError()` / `focusFirstInvalidInput()`. Unlike `reset()`, a readonly form still submits: readonly fields do not block a native submission either, and a nested button has always submitted such a form.
350
+ */
351
+ "requestSubmit": () => Promise<void>;
344
352
  /**
345
353
  * Define when required message is display. When it is unset, component use it internal logic to manage "required message" help text display. When you set the prop to `default`, you override the component internal logique to torce it display "required message" help text. When you set the prop to `hide`, it will prevent the rendering of the message in the component's DOM. As **this element is an accessibility requirement in the view**, you **MUST*** re-implement this message on your own and display it when your form contains required inputs.
346
354
  */
@@ -2981,7 +2989,7 @@ declare namespace LocalJSX {
2981
2989
  */
2982
2990
  "disabled"?: boolean;
2983
2991
  /**
2984
- * Define form id to attach button with. If this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.
2992
+ * Id of the form to associate the button with, following the native `form` attribute semantics: it must match the `identifier` of a `mg-form`, or the `id` of a `<form>`, in the same document, and it overrides the ancestor form. If this attribute is not set, the button is associated with its ancestor form.
2985
2993
  */
2986
2994
  "form"?: string;
2987
2995
  /**
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@mgdis/mg-components",
4
- "version": "6.26.0",
4
+ "version": "6.28.0",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -220,7 +220,7 @@
220
220
  },
221
221
  {
222
222
  "name": "mg-button",
223
- "description": "Attributes:\n- `disable-on-click`: Option to set input disable on click, in order to prevent multi-click.\nParent component have to remove the attribute 'disabled' when the process ends.\n- `disabled`: Disable button\n- `form`: Define form id to attach button with.\nIf this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.\n- `full-width`: Set button to full-width\n- `is-icon`: Define if button is round.\nUsed for icon button.\n- `label`: aria-label\nIn case button text is not explicit enough\n- `size`: Define button size\n- `type`: Define button type\n- `variant`: Define button variant\n\nEvents:\n- `disabled-change`: Emmited event when disabled change\n\nSlots:\n- default: Button content\n\n",
223
+ "description": "Attributes:\n- `disable-on-click`: Option to set input disable on click, in order to prevent multi-click.\nParent component have to remove the attribute 'disabled' when the process ends.\n- `disabled`: Disable button\n- `form`: Id of the form to associate the button with, following the native `form` attribute semantics:\nit must match the `identifier` of a `mg-form`, or the `id` of a `<form>`, in the same document,\nand it overrides the ancestor form.\nIf this attribute is not set, the button is associated with its ancestor form.\n- `full-width`: Set button to full-width\n- `is-icon`: Define if button is round.\nUsed for icon button.\n- `label`: aria-label\nIn case button text is not explicit enough\n- `size`: Define button size\n- `type`: Define button type\n- `variant`: Define button variant\n\nEvents:\n- `disabled-change`: Emmited event when disabled change\n\nSlots:\n- default: Button content\n\n",
224
224
  "doc-url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/atoms-mg-button--docs",
225
225
  "attributes": [
226
226
  {
@@ -244,7 +244,7 @@
244
244
  },
245
245
  {
246
246
  "name": "form",
247
- "description": "Define form id to attach button with.\nIf this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.\n\nType: `string`",
247
+ "description": "Id of the form to associate the button with, following the native `form` attribute semantics:\nit must match the `identifier` of a `mg-form`, or the `id` of a `<form>`, in the same document,\nand it overrides the ancestor form.\nIf this attribute is not set, the button is associated with its ancestor form.\n\nType: `string`",
248
248
  "doc-url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/atoms-mg-button--docs",
249
249
  "value": {
250
250
  "type": "string",
@@ -795,7 +795,7 @@
795
795
  },
796
796
  {
797
797
  "name": "mg-form",
798
- "description": "Attributes:\n- `aria-role`: Define `<form/>` element aria role\nsee more about aria roles use case: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles\n- `disabled`: Define if form is disabled\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created.\n- `invalid`: Define form invalid state\n- `label-on-top`: Define if slotted mg-component's label are displayed on top\n- `name`: Input name\nIf not set the value equals the identifier\n- `readonly`: Define if form is readonly\n- `required-message`: Define when required message is display.\nWhen it is unset, component use it internal logic to manage \"required message\" help text display.\nWhen you set the prop to `default`, you override the component internal logique to torce it display \"required message\" help text.\nWhen you set the prop to `hide`, it will prevent the rendering of the message in the component's DOM.\nAs **this element is an accessibility requirement in the view**,\nyou **MUST*** re-implement this message on your own and display it when your form contains required inputs.\n- `valid`: Define form valid state\n\nMethods:\n- `displayError`: Display inputs/fieldsets errors if it exists.\n- `reset`: Reset form inputs values, validity and error state\n\nEvents:\n- `form-reset`: Emitted event on form reset\n- `form-submit`: Emitted event on form submit\n- `form-valid`: Emitted event on form validity check\nTells if form is valid or not\n\nSlots:\n- default: Form content\n- `actions`: Actions content\n\n",
798
+ "description": "Attributes:\n- `aria-role`: Define `<form/>` element aria role\nsee more about aria roles use case: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles\n- `disabled`: Define if form is disabled\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created.\n- `invalid`: Define form invalid state\n- `label-on-top`: Define if slotted mg-component's label are displayed on top\n- `name`: Input name\nIf not set the value equals the identifier\n- `readonly`: Define if form is readonly\n- `required-message`: Define when required message is display.\nWhen it is unset, component use it internal logic to manage \"required message\" help text display.\nWhen you set the prop to `default`, you override the component internal logique to torce it display \"required message\" help text.\nWhen you set the prop to `hide`, it will prevent the rendering of the message in the component's DOM.\nAs **this element is an accessibility requirement in the view**,\nyou **MUST*** re-implement this message on your own and display it when your form contains required inputs.\n- `valid`: Define form valid state\n\nMethods:\n- `displayError`: Display inputs/fieldsets errors if it exists.\n- `focusFirstInvalidInput`: **Experimental.** The signature may still change in a minor release.\n\nDisplay errors, then focus and scroll to the first invalid input. Focusing is what\ncarries the information for assistive technologies, a scroll announces nothing.\nRead the `invalid` property to know whether the form had an invalid input.\n- `requestSubmit`: Request the form submission: emit `form-submit`, whatever the inputs validity.\nThis is what a `mg-button` associated with this form goes through, so that reaching the form\nneeds no access to its shadow DOM. Unlike the native `requestSubmit()`, it runs no constraint\nvalidation: validity is the consumer's call here, as it is on submission from a nested button.\nRead `invalid`, or call `displayError()` / `focusFirstInvalidInput()`.\nUnlike `reset()`, a readonly form still submits: readonly fields do not block a native\nsubmission either, and a nested button has always submitted such a form.\n- `reset`: Reset form inputs values, validity and error state\n\nEvents:\n- `form-reset`: Emitted event on form reset\n- `form-submit`: Emitted event on form submit\n- `form-valid`: Emitted event on form validity check\nTells if form is valid or not\n\nSlots:\n- default: Form content\n- `actions`: Actions content\n\n",
799
799
  "doc-url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-mg-form--docs",
800
800
  "attributes": [
801
801
  {
@@ -237,7 +237,7 @@
237
237
  },
238
238
  {
239
239
  "name": "mg-button",
240
- "description": "Attributes:\n- `disable-on-click`: Option to set input disable on click, in order to prevent multi-click.\nParent component have to remove the attribute 'disabled' when the process ends.\n- `disabled`: Disable button\n- `form`: Define form id to attach button with.\nIf this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.\n- `full-width`: Set button to full-width\n- `is-icon`: Define if button is round.\nUsed for icon button.\n- `label`: aria-label\nIn case button text is not explicit enough\n- `size`: Define button size\n- `type`: Define button type\n- `variant`: Define button variant\n\nEvents:\n- `disabled-change`: Emmited event when disabled change\n\nSlots:\n- default: Button content\n\n",
240
+ "description": "Attributes:\n- `disable-on-click`: Option to set input disable on click, in order to prevent multi-click.\nParent component have to remove the attribute 'disabled' when the process ends.\n- `disabled`: Disable button\n- `form`: Id of the form to associate the button with, following the native `form` attribute semantics:\nit must match the `identifier` of a `mg-form`, or the `id` of a `<form>`, in the same document,\nand it overrides the ancestor form.\nIf this attribute is not set, the button is associated with its ancestor form.\n- `full-width`: Set button to full-width\n- `is-icon`: Define if button is round.\nUsed for icon button.\n- `label`: aria-label\nIn case button text is not explicit enough\n- `size`: Define button size\n- `type`: Define button type\n- `variant`: Define button variant\n\nEvents:\n- `disabled-change`: Emmited event when disabled change\n\nSlots:\n- default: Button content\n\n",
241
241
  "attributes": [
242
242
  {
243
243
  "name": "disable-on-click",
@@ -269,7 +269,7 @@
269
269
  },
270
270
  {
271
271
  "name": "form",
272
- "description": "Define form id to attach button with.\nIf this attribute is not set, the `<button>` is associated with its ancestor `<form>` element.\n\nType: `string`",
272
+ "description": "Id of the form to associate the button with, following the native `form` attribute semantics:\nit must match the `identifier` of a `mg-form`, or the `id` of a `<form>`, in the same document,\nand it overrides the ancestor form.\nIf this attribute is not set, the button is associated with its ancestor form.\n\nType: `string`",
273
273
  "references": [
274
274
  {
275
275
  "name": "Storybook",
@@ -779,7 +779,7 @@
779
779
  },
780
780
  {
781
781
  "name": "mg-form",
782
- "description": "Attributes:\n- `aria-role`: Define `<form/>` element aria role\nsee more about aria roles use case: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles\n- `disabled`: Define if form is disabled\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created.\n- `invalid`: Define form invalid state\n- `label-on-top`: Define if slotted mg-component's label are displayed on top\n- `name`: Input name\nIf not set the value equals the identifier\n- `readonly`: Define if form is readonly\n- `required-message`: Define when required message is display.\nWhen it is unset, component use it internal logic to manage \"required message\" help text display.\nWhen you set the prop to `default`, you override the component internal logique to torce it display \"required message\" help text.\nWhen you set the prop to `hide`, it will prevent the rendering of the message in the component's DOM.\nAs **this element is an accessibility requirement in the view**,\nyou **MUST*** re-implement this message on your own and display it when your form contains required inputs.\n- `valid`: Define form valid state\n\nMethods:\n- `displayError`: Display inputs/fieldsets errors if it exists.\n- `reset`: Reset form inputs values, validity and error state\n\nEvents:\n- `form-reset`: Emitted event on form reset\n- `form-submit`: Emitted event on form submit\n- `form-valid`: Emitted event on form validity check\nTells if form is valid or not\n\nSlots:\n- default: Form content\n- `actions`: Actions content\n\n",
782
+ "description": "Attributes:\n- `aria-role`: Define `<form/>` element aria role\nsee more about aria roles use case: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles\n- `disabled`: Define if form is disabled\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created.\n- `invalid`: Define form invalid state\n- `label-on-top`: Define if slotted mg-component's label are displayed on top\n- `name`: Input name\nIf not set the value equals the identifier\n- `readonly`: Define if form is readonly\n- `required-message`: Define when required message is display.\nWhen it is unset, component use it internal logic to manage \"required message\" help text display.\nWhen you set the prop to `default`, you override the component internal logique to torce it display \"required message\" help text.\nWhen you set the prop to `hide`, it will prevent the rendering of the message in the component's DOM.\nAs **this element is an accessibility requirement in the view**,\nyou **MUST*** re-implement this message on your own and display it when your form contains required inputs.\n- `valid`: Define form valid state\n\nMethods:\n- `displayError`: Display inputs/fieldsets errors if it exists.\n- `focusFirstInvalidInput`: **Experimental.** The signature may still change in a minor release.\n\nDisplay errors, then focus and scroll to the first invalid input. Focusing is what\ncarries the information for assistive technologies, a scroll announces nothing.\nRead the `invalid` property to know whether the form had an invalid input.\n- `requestSubmit`: Request the form submission: emit `form-submit`, whatever the inputs validity.\nThis is what a `mg-button` associated with this form goes through, so that reaching the form\nneeds no access to its shadow DOM. Unlike the native `requestSubmit()`, it runs no constraint\nvalidation: validity is the consumer's call here, as it is on submission from a nested button.\nRead `invalid`, or call `displayError()` / `focusFirstInvalidInput()`.\nUnlike `reset()`, a readonly form still submits: readonly fields do not block a native\nsubmission either, and a nested button has always submitted such a form.\n- `reset`: Reset form inputs values, validity and error state\n\nEvents:\n- `form-reset`: Emitted event on form reset\n- `form-submit`: Emitted event on form submit\n- `form-valid`: Emitted event on form validity check\nTells if form is valid or not\n\nSlots:\n- default: Form content\n- `actions`: Actions content\n\n",
783
783
  "attributes": [
784
784
  {
785
785
  "name": "aria-role",