@mgdis/mg-components 5.9.1 → 5.10.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.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_31.cjs.entry.js +31 -225
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +1 -16
- package/dist/cjs/{mg-menu.conf-9afe6571.js → mg-menu.conf-1942ac70.js} +0 -5
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -3
- package/dist/collection/components/atoms/mg-button/mg-button.js +2 -7
- package/dist/collection/components/atoms/mg-card/mg-card.js +13 -4
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +0 -2
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +0 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +10 -5
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +0 -2
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +0 -3
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -13
- package/dist/collection/components/molecules/inputs/MgInput.js +0 -6
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +0 -6
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +0 -5
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +0 -12
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +0 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +0 -9
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +0 -13
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +1 -12
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -5
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +0 -5
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +0 -11
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +0 -18
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +0 -8
- package/dist/collection/components/molecules/mg-details/mg-details.js +0 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js +0 -8
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +0 -2
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +0 -5
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -7
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +1 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +0 -6
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +5 -15
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -8
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +0 -12
- package/dist/collection/locales/index.js +0 -1
- package/dist/collection/utils/behaviors.utils.js +0 -10
- package/dist/collection/utils/components.utils.js +1 -10
- package/dist/collection/utils/locale.utils.js +0 -4
- package/dist/collection/utils/unit.test.utils.js +0 -5
- package/dist/components/MgInput.js +0 -6
- package/dist/components/components.utils.js +1 -10
- package/dist/components/index2.js +0 -5
- package/dist/components/mg-action-more.js +0 -8
- package/dist/components/mg-badge2.js +1 -3
- package/dist/components/mg-button2.js +2 -7
- package/dist/components/mg-card2.js +13 -4
- package/dist/components/mg-character-left2.js +0 -2
- package/dist/components/mg-details.js +0 -3
- package/dist/components/mg-divider.js +0 -1
- package/dist/components/mg-form.js +0 -8
- package/dist/components/mg-icon2.js +10 -5
- package/dist/components/mg-illustrated-message.js +0 -2
- package/dist/components/mg-input-checkbox.js +0 -6
- package/dist/components/mg-input-date.js +0 -5
- package/dist/components/mg-input-numeric.js +0 -12
- package/dist/components/mg-input-password.js +0 -3
- package/dist/components/mg-input-radio.js +0 -9
- package/dist/components/mg-input-select2.js +0 -13
- package/dist/components/mg-input-text2.js +1 -12
- package/dist/components/mg-input-textarea.js +1 -5
- package/dist/components/mg-input-title2.js +0 -2
- package/dist/components/mg-input-toggle.js +0 -5
- package/dist/components/mg-item-more.js +0 -15
- package/dist/components/mg-menu-item2.js +0 -18
- package/dist/components/mg-menu2.js +0 -11
- package/dist/components/mg-message.js +2 -7
- package/dist/components/mg-modal.js +1 -6
- package/dist/components/mg-pagination.js +0 -6
- package/dist/components/mg-panel.js +5 -15
- package/dist/components/mg-popover2.js +1 -8
- package/dist/components/mg-skip-links.js +1 -4
- package/dist/components/mg-tabs.js +0 -12
- package/dist/components/mg-tag.js +0 -3
- package/dist/components/mg-tooltip2.js +1 -13
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_31.entry.js +31 -225
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-item-more.entry.js +1 -16
- package/dist/esm/{mg-menu.conf-881fbd82.js → mg-menu.conf-2cc1bb67.js} +0 -5
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-67ce7cb8.entry.js → p-a56a3157.entry.js} +1 -1
- package/dist/mg-components/{p-9a93b7af.entry.js → p-eb32bb18.entry.js} +1 -1
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +0 -2
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -5
- package/dist/types/components/atoms/mg-card/mg-card.d.ts +10 -3
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +0 -2
- package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +0 -1
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +6 -3
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +0 -2
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +0 -3
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +0 -12
- package/dist/types/components/molecules/inputs/MgInput.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +0 -5
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +0 -5
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +0 -12
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +0 -3
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -8
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -9
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +0 -11
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -4
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +0 -5
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +0 -11
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +0 -18
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +0 -5
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +0 -3
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +0 -8
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +0 -2
- package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +0 -5
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +1 -6
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +0 -5
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +0 -5
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +0 -10
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +0 -7
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +0 -3
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +0 -11
- package/dist/types/locales/index.d.ts +0 -1
- package/dist/types/utils/behaviors.utils.d.ts +0 -9
- package/dist/types/utils/components.utils.d.ts +1 -9
- package/dist/types/utils/locale.utils.d.ts +0 -4
- package/dist/types/utils/unit.test.utils.d.ts +0 -7
- package/package.json +11 -12
- /package/dist/mg-components/{p-367f92d2.js → p-73156ac9.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-3249671d.js';
|
|
2
|
-
import { i as initLocales, D as Direction, l as localeDate, d as dateRegExp, a as localeCurrency, b as localeNumber, s as sizes$2 } from './mg-menu.conf-
|
|
2
|
+
import { i as initLocales, D as Direction, l as localeDate, d as dateRegExp, a as localeCurrency, b as localeNumber, s as sizes$2 } from './mg-menu.conf-2cc1bb67.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Available menu-item positions
|
|
@@ -22,7 +22,6 @@ var Status$1;
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Create random ID
|
|
25
|
-
*
|
|
26
25
|
* @param {string} prefix add prefix to created ID
|
|
27
26
|
* @param {number} length ID length
|
|
28
27
|
* @returns {string} ID
|
|
@@ -44,7 +43,6 @@ class ClassList {
|
|
|
44
43
|
constructor(classlist = []) {
|
|
45
44
|
/**
|
|
46
45
|
* Add class
|
|
47
|
-
*
|
|
48
46
|
* @param {string} className class name to add
|
|
49
47
|
* @returns {void}
|
|
50
48
|
*/
|
|
@@ -55,7 +53,6 @@ class ClassList {
|
|
|
55
53
|
};
|
|
56
54
|
/**
|
|
57
55
|
* Delete class
|
|
58
|
-
*
|
|
59
56
|
* @param {string} className class name to delete
|
|
60
57
|
* @returns {void}
|
|
61
58
|
*/
|
|
@@ -67,7 +64,6 @@ class ClassList {
|
|
|
67
64
|
};
|
|
68
65
|
/**
|
|
69
66
|
* Check if class exist in list
|
|
70
|
-
*
|
|
71
67
|
* @param {string} className class name to check
|
|
72
68
|
* @returns {boolean} class name is in the list
|
|
73
69
|
*/
|
|
@@ -76,7 +72,6 @@ class ClassList {
|
|
|
76
72
|
};
|
|
77
73
|
/**
|
|
78
74
|
* Join classes seperated by spaces
|
|
79
|
-
*
|
|
80
75
|
* @returns {string} joined values
|
|
81
76
|
*/
|
|
82
77
|
this.join = () => {
|
|
@@ -87,14 +82,12 @@ class ClassList {
|
|
|
87
82
|
}
|
|
88
83
|
/**
|
|
89
84
|
* Check if all items are string
|
|
90
|
-
*
|
|
91
85
|
* @param {unknown} items items to check
|
|
92
86
|
* @returns {boolean} all items are string
|
|
93
87
|
*/
|
|
94
88
|
const allItemsAreString = (items) => Array.isArray(items) && items.every(item => typeof item === 'string');
|
|
95
89
|
/**
|
|
96
90
|
* Check if element is a heading
|
|
97
|
-
*
|
|
98
91
|
* @param {Element} element slotted element
|
|
99
92
|
* @param {string[]} tagNames allowed tag names list
|
|
100
93
|
* @returns {boolean} element is a heading
|
|
@@ -107,7 +100,7 @@ const isTagName = (element, tagNames) => {
|
|
|
107
100
|
*/
|
|
108
101
|
const focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier]';
|
|
109
102
|
/**
|
|
110
|
-
*
|
|
103
|
+
* Get windows
|
|
111
104
|
* @param {Window} localWindow the window we are lookink for other windows
|
|
112
105
|
* @returns {Window[]} The list of windows found
|
|
113
106
|
*/
|
|
@@ -118,7 +111,6 @@ const getWindows = (localWindow) => {
|
|
|
118
111
|
};
|
|
119
112
|
/**
|
|
120
113
|
* Get parent windows
|
|
121
|
-
*
|
|
122
114
|
* @param {Window} localWindow the window we are lookink for parents
|
|
123
115
|
* @param {Window[]} windows The list of allready found windows
|
|
124
116
|
* @returns {Window[]} The list of windows found
|
|
@@ -141,7 +133,6 @@ const getParentWindows = (localWindow, windows = []) => {
|
|
|
141
133
|
};
|
|
142
134
|
/**
|
|
143
135
|
* Get child windows
|
|
144
|
-
*
|
|
145
136
|
* @param {Window} localWindow the window we are lookink for children
|
|
146
137
|
* @param {Window[]} windows The list of allready found windows
|
|
147
138
|
* @returns {Window[]} The list of windows found
|
|
@@ -163,7 +154,6 @@ const mgActionMoreCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1
|
|
|
163
154
|
|
|
164
155
|
/**
|
|
165
156
|
* MgActionMore['items'] type guard
|
|
166
|
-
*
|
|
167
157
|
* @param {unknown} prop commponent items prop
|
|
168
158
|
* @returns {boolean} return true if type is valid
|
|
169
159
|
*/
|
|
@@ -173,7 +163,6 @@ const isMgActionMoreItems = (prop) => {
|
|
|
173
163
|
};
|
|
174
164
|
/**
|
|
175
165
|
* MgActionMore['button'] type guard
|
|
176
|
-
*
|
|
177
166
|
* @param {unknown} prop commponent button prop
|
|
178
167
|
* @returns {boolean} return true if type is valid
|
|
179
168
|
*/
|
|
@@ -183,7 +172,6 @@ const isMgActionMoreButton = (prop) => {
|
|
|
183
172
|
};
|
|
184
173
|
/**
|
|
185
174
|
* MgActionMore['icon'] type guard
|
|
186
|
-
*
|
|
187
175
|
* @param {unknown} prop commponent icon prop
|
|
188
176
|
* @returns {boolean} return true if type is valid
|
|
189
177
|
*/
|
|
@@ -204,7 +192,6 @@ const MgActionMore = class {
|
|
|
204
192
|
***********/
|
|
205
193
|
/**
|
|
206
194
|
* Toogle expanded props
|
|
207
|
-
*
|
|
208
195
|
* @returns {void}
|
|
209
196
|
*/
|
|
210
197
|
this.toggleExpanded = () => {
|
|
@@ -212,7 +199,6 @@ const MgActionMore = class {
|
|
|
212
199
|
};
|
|
213
200
|
/**
|
|
214
201
|
* Button click handler
|
|
215
|
-
*
|
|
216
202
|
* @returns {void}
|
|
217
203
|
*/
|
|
218
204
|
this.handleButton = () => {
|
|
@@ -220,7 +206,6 @@ const MgActionMore = class {
|
|
|
220
206
|
};
|
|
221
207
|
/**
|
|
222
208
|
* Item click handler
|
|
223
|
-
*
|
|
224
209
|
* @param {MouseEvent} event click event
|
|
225
210
|
* @param {MgActionMoreItemType['mouseEventHandler']} customHandler item['mouseEventHandler']
|
|
226
211
|
* @returns {void}
|
|
@@ -260,7 +245,6 @@ const MgActionMore = class {
|
|
|
260
245
|
*************/
|
|
261
246
|
/**
|
|
262
247
|
* Validate props
|
|
263
|
-
*
|
|
264
248
|
* @returns {void}
|
|
265
249
|
*/
|
|
266
250
|
componentWillLoad() {
|
|
@@ -272,7 +256,6 @@ const MgActionMore = class {
|
|
|
272
256
|
}
|
|
273
257
|
/**
|
|
274
258
|
* Render
|
|
275
|
-
*
|
|
276
259
|
* @returns {HTMLElement} HTML Element
|
|
277
260
|
*/
|
|
278
261
|
render() {
|
|
@@ -352,7 +335,6 @@ const MgBadge = class {
|
|
|
352
335
|
}
|
|
353
336
|
/**
|
|
354
337
|
* Check if props are well configured on init
|
|
355
|
-
*
|
|
356
338
|
* @returns {void}
|
|
357
339
|
*/
|
|
358
340
|
componentWillLoad() {
|
|
@@ -363,7 +345,6 @@ const MgBadge = class {
|
|
|
363
345
|
}
|
|
364
346
|
/**
|
|
365
347
|
* Render
|
|
366
|
-
*
|
|
367
348
|
* @returns {HTMLElement} HTML Element
|
|
368
349
|
*/
|
|
369
350
|
render() {
|
|
@@ -398,7 +379,6 @@ const MgButton = class {
|
|
|
398
379
|
this.classFullWidth = 'mg-button--full-width';
|
|
399
380
|
/**
|
|
400
381
|
* Trigger actions onClick event
|
|
401
|
-
*
|
|
402
382
|
* @param {MouseEvent} event click event
|
|
403
383
|
* @returns {void}
|
|
404
384
|
*/
|
|
@@ -413,7 +393,6 @@ const MgButton = class {
|
|
|
413
393
|
};
|
|
414
394
|
/**
|
|
415
395
|
* Handle onKeydown event
|
|
416
|
-
*
|
|
417
396
|
* @param {KeyboardEvent} event keyboard event
|
|
418
397
|
* @returns {void}
|
|
419
398
|
*/
|
|
@@ -428,7 +407,6 @@ const MgButton = class {
|
|
|
428
407
|
};
|
|
429
408
|
/**
|
|
430
409
|
* Handle onKeyup event
|
|
431
|
-
*
|
|
432
410
|
* @param {KeyboardEvent} event keyboard event
|
|
433
411
|
* @returns {void}
|
|
434
412
|
*/
|
|
@@ -501,7 +479,6 @@ const MgButton = class {
|
|
|
501
479
|
}
|
|
502
480
|
/**
|
|
503
481
|
* Check if props are well configured on init
|
|
504
|
-
*
|
|
505
482
|
* @returns {void}
|
|
506
483
|
*/
|
|
507
484
|
componentWillLoad() {
|
|
@@ -519,7 +496,6 @@ const MgButton = class {
|
|
|
519
496
|
}
|
|
520
497
|
/**
|
|
521
498
|
* Render component
|
|
522
|
-
*
|
|
523
499
|
* @returns {HTMLElement} html element
|
|
524
500
|
*/
|
|
525
501
|
render() {
|
|
@@ -554,6 +530,15 @@ const MgCard = class {
|
|
|
554
530
|
*************/
|
|
555
531
|
this.name = 'mg-card';
|
|
556
532
|
this.baseClass = this.name;
|
|
533
|
+
/**
|
|
534
|
+
* Methode to set default varianStyle props
|
|
535
|
+
* needeed has stencil doesn't know that props is mutated when updated in prop watcher
|
|
536
|
+
* @returns {void}
|
|
537
|
+
*/
|
|
538
|
+
this.setDefaultVariantStyle = () => {
|
|
539
|
+
if (this.variantStyle === undefined)
|
|
540
|
+
this.variantStyle = 'bar-left';
|
|
541
|
+
};
|
|
557
542
|
this.variant = undefined;
|
|
558
543
|
this.variantStyle = undefined;
|
|
559
544
|
this.classList = new ClassList([this.baseClass]);
|
|
@@ -562,8 +547,7 @@ const MgCard = class {
|
|
|
562
547
|
if (newValue && !variants$3.includes(newValue))
|
|
563
548
|
throw new Error(`<${this.name}> prop "variant" must match VariantType type.`);
|
|
564
549
|
if (Boolean(newValue)) {
|
|
565
|
-
|
|
566
|
-
this.variantStyle = 'bar-left';
|
|
550
|
+
this.setDefaultVariantStyle();
|
|
567
551
|
this.classList.add(`${this.baseClass}--${newValue}`);
|
|
568
552
|
}
|
|
569
553
|
if (Boolean(oldValue))
|
|
@@ -579,9 +563,11 @@ const MgCard = class {
|
|
|
579
563
|
if (Boolean(oldValue))
|
|
580
564
|
this.classList.delete(`${this.baseClass}--${oldValue}`);
|
|
581
565
|
}
|
|
566
|
+
/*************
|
|
567
|
+
* Lifecycle *
|
|
568
|
+
*************/
|
|
582
569
|
/**
|
|
583
570
|
* Check if props are well configured on init
|
|
584
|
-
*
|
|
585
571
|
* @returns {void}
|
|
586
572
|
*/
|
|
587
573
|
componentWillLoad() {
|
|
@@ -590,7 +576,6 @@ const MgCard = class {
|
|
|
590
576
|
}
|
|
591
577
|
/**
|
|
592
578
|
* Render
|
|
593
|
-
*
|
|
594
579
|
* @returns {HTMLElement} HTML Element
|
|
595
580
|
*/
|
|
596
581
|
render() {
|
|
@@ -623,7 +608,6 @@ const MgCharacterLeft = class {
|
|
|
623
608
|
*************/
|
|
624
609
|
/**
|
|
625
610
|
* Check if props are well configured on init
|
|
626
|
-
*
|
|
627
611
|
* @returns {void}
|
|
628
612
|
*/
|
|
629
613
|
componentWillLoad() {
|
|
@@ -632,7 +616,6 @@ const MgCharacterLeft = class {
|
|
|
632
616
|
}
|
|
633
617
|
/**
|
|
634
618
|
* Render component
|
|
635
|
-
*
|
|
636
619
|
* @returns {HTMLElement} HTML Element
|
|
637
620
|
*/
|
|
638
621
|
render() {
|
|
@@ -653,7 +636,6 @@ const MgDetails = class {
|
|
|
653
636
|
this.expandedChange = createEvent(this, "expanded-change", 7);
|
|
654
637
|
/**
|
|
655
638
|
* Handle details toggle
|
|
656
|
-
*
|
|
657
639
|
* @returns {void}
|
|
658
640
|
*/
|
|
659
641
|
this.handleToggle = () => {
|
|
@@ -677,7 +659,6 @@ const MgDetails = class {
|
|
|
677
659
|
*************/
|
|
678
660
|
/**
|
|
679
661
|
* Check if component props are well configured on init
|
|
680
|
-
*
|
|
681
662
|
* @returns {void}
|
|
682
663
|
*/
|
|
683
664
|
componentWillLoad() {
|
|
@@ -686,7 +667,6 @@ const MgDetails = class {
|
|
|
686
667
|
}
|
|
687
668
|
/**
|
|
688
669
|
* Render
|
|
689
|
-
*
|
|
690
670
|
* @returns {HTMLElement} HTML Element
|
|
691
671
|
*/
|
|
692
672
|
render() {
|
|
@@ -709,7 +689,6 @@ const MgDivider = class {
|
|
|
709
689
|
}
|
|
710
690
|
/**
|
|
711
691
|
* Render
|
|
712
|
-
*
|
|
713
692
|
* @returns {HTMLElement} HTML Element
|
|
714
693
|
*/
|
|
715
694
|
render() {
|
|
@@ -733,7 +712,6 @@ const MgForm = class {
|
|
|
733
712
|
/**
|
|
734
713
|
* Define required message based on mg-inputs required elements
|
|
735
714
|
* Also
|
|
736
|
-
*
|
|
737
715
|
* @returns {void}
|
|
738
716
|
*/
|
|
739
717
|
this.setRequiredMessage = () => {
|
|
@@ -759,7 +737,6 @@ const MgForm = class {
|
|
|
759
737
|
};
|
|
760
738
|
/**
|
|
761
739
|
* Check if form is valid
|
|
762
|
-
*
|
|
763
740
|
* @returns {void}
|
|
764
741
|
*/
|
|
765
742
|
this.checkValidity = () => {
|
|
@@ -772,7 +749,6 @@ const MgForm = class {
|
|
|
772
749
|
};
|
|
773
750
|
/**
|
|
774
751
|
* Handle Form Submit
|
|
775
|
-
*
|
|
776
752
|
* @param {SubmitEvent} event submit event
|
|
777
753
|
* @returns {void}
|
|
778
754
|
*/
|
|
@@ -782,7 +758,6 @@ const MgForm = class {
|
|
|
782
758
|
};
|
|
783
759
|
/**
|
|
784
760
|
* Set mgInputs
|
|
785
|
-
*
|
|
786
761
|
* @returns {void}
|
|
787
762
|
*/
|
|
788
763
|
this.setMgInputs = () => {
|
|
@@ -814,7 +789,6 @@ const MgForm = class {
|
|
|
814
789
|
}
|
|
815
790
|
/**
|
|
816
791
|
* Public method to display errors
|
|
817
|
-
*
|
|
818
792
|
* @returns {Promise<void>}
|
|
819
793
|
*/
|
|
820
794
|
async displayError() {
|
|
@@ -830,7 +804,6 @@ const MgForm = class {
|
|
|
830
804
|
*************/
|
|
831
805
|
/**
|
|
832
806
|
* Check if component props are well configured on init
|
|
833
|
-
*
|
|
834
807
|
* @returns {void}
|
|
835
808
|
*/
|
|
836
809
|
componentWillLoad() {
|
|
@@ -858,7 +831,6 @@ const MgForm = class {
|
|
|
858
831
|
}
|
|
859
832
|
/**
|
|
860
833
|
* Add slot listeners
|
|
861
|
-
*
|
|
862
834
|
* @returns {void}
|
|
863
835
|
*/
|
|
864
836
|
componentDidLoad() {
|
|
@@ -877,7 +849,6 @@ const MgForm = class {
|
|
|
877
849
|
}
|
|
878
850
|
/**
|
|
879
851
|
* Render
|
|
880
|
-
*
|
|
881
852
|
* @returns {HTMLElement} HTML Element
|
|
882
853
|
*/
|
|
883
854
|
render() {
|
|
@@ -1128,10 +1099,18 @@ const MgIcon = class {
|
|
|
1128
1099
|
registerInstance(this, hostRef);
|
|
1129
1100
|
/**
|
|
1130
1101
|
* getIcon
|
|
1131
|
-
*
|
|
1132
1102
|
* @returns {HTMLElement} icon html
|
|
1133
1103
|
*/
|
|
1134
1104
|
this.getIcon = () => icons[this.icon]();
|
|
1105
|
+
/**
|
|
1106
|
+
* Method to set default varianStyle props
|
|
1107
|
+
* needeed has stencil doesn't know that props is mutated when updated in prop watcher
|
|
1108
|
+
* @returns {void}
|
|
1109
|
+
*/
|
|
1110
|
+
this.setDefaultVariantStyle = () => {
|
|
1111
|
+
if (this.variantStyle === undefined)
|
|
1112
|
+
this.variantStyle = 'background';
|
|
1113
|
+
};
|
|
1135
1114
|
this.icon = undefined;
|
|
1136
1115
|
this.size = 'regular';
|
|
1137
1116
|
this.variant = undefined;
|
|
@@ -1162,8 +1141,7 @@ const MgIcon = class {
|
|
|
1162
1141
|
if (!variants$2.includes(newValue))
|
|
1163
1142
|
throw new Error(`<mg-icon> prop "variant" must be one of: ${variants$2.join(', ')}`);
|
|
1164
1143
|
else {
|
|
1165
|
-
|
|
1166
|
-
this.variantStyle = 'background';
|
|
1144
|
+
this.setDefaultVariantStyle();
|
|
1167
1145
|
if (oldValue !== undefined)
|
|
1168
1146
|
this.classList.delete(`mg-icon--variant-${oldValue}`);
|
|
1169
1147
|
this.classList.add(`mg-icon--variant-${newValue}`);
|
|
@@ -1193,7 +1171,6 @@ const MgIcon = class {
|
|
|
1193
1171
|
}
|
|
1194
1172
|
/**
|
|
1195
1173
|
* Check if props are well configured on init
|
|
1196
|
-
*
|
|
1197
1174
|
* @returns {void}
|
|
1198
1175
|
*/
|
|
1199
1176
|
componentWillLoad() {
|
|
@@ -1205,7 +1182,6 @@ const MgIcon = class {
|
|
|
1205
1182
|
}
|
|
1206
1183
|
/**
|
|
1207
1184
|
* Render component
|
|
1208
|
-
*
|
|
1209
1185
|
* @returns {HTMLElement} HTML Element
|
|
1210
1186
|
*/
|
|
1211
1187
|
render() {
|
|
@@ -1234,7 +1210,6 @@ const MgIllustratedMessage = class {
|
|
|
1234
1210
|
*************/
|
|
1235
1211
|
/**
|
|
1236
1212
|
* Check if component props are well configured on init
|
|
1237
|
-
*
|
|
1238
1213
|
* @returns {void}
|
|
1239
1214
|
*/
|
|
1240
1215
|
componentDidLoad() {
|
|
@@ -1250,7 +1225,6 @@ const MgIllustratedMessage = class {
|
|
|
1250
1225
|
}
|
|
1251
1226
|
/**
|
|
1252
1227
|
* Render
|
|
1253
|
-
*
|
|
1254
1228
|
* @returns {HTMLElement} HTML Element
|
|
1255
1229
|
*/
|
|
1256
1230
|
render() {
|
|
@@ -1268,7 +1242,6 @@ MgIllustratedMessage.style = mgIllustratedMessageCss;
|
|
|
1268
1242
|
|
|
1269
1243
|
/**
|
|
1270
1244
|
* Apply in all input child node the aria-describedby attribute
|
|
1271
|
-
*
|
|
1272
1245
|
* @param {VNode[]} children Represent scoped elements
|
|
1273
1246
|
* @param {Set<string>} ariaDescribedbyIDs List of IDs
|
|
1274
1247
|
* @param {FunctionalUtilities} utils Stencil.js utils
|
|
@@ -1285,7 +1258,6 @@ const applyAriadescribedBy = (children, ariaDescribedbyIDs, utils) => utils.map(
|
|
|
1285
1258
|
});
|
|
1286
1259
|
/**
|
|
1287
1260
|
* Add classes based on props
|
|
1288
|
-
*
|
|
1289
1261
|
* @param {MgInputProps} props MgInput Interface Props
|
|
1290
1262
|
*/
|
|
1291
1263
|
const manageClasses = (props) => {
|
|
@@ -1299,14 +1271,12 @@ const manageClasses = (props) => {
|
|
|
1299
1271
|
};
|
|
1300
1272
|
/**
|
|
1301
1273
|
* Get tagname
|
|
1302
|
-
*
|
|
1303
1274
|
* @param {boolean} isFieldset is fieldset
|
|
1304
1275
|
* @returns {string} tag name
|
|
1305
1276
|
*/
|
|
1306
1277
|
const getTagName = (isFieldset) => (isFieldset ? 'fieldset' : 'div');
|
|
1307
1278
|
/**
|
|
1308
1279
|
* Get input template
|
|
1309
|
-
*
|
|
1310
1280
|
* @param {MgInputProps} props MgInput Interface Props
|
|
1311
1281
|
* @param {VNode[]} children Represent scoped elements
|
|
1312
1282
|
* @param {FunctionalUtilities} utils Stencil.js utils
|
|
@@ -1366,7 +1336,6 @@ const MgInput = (props, children, utils) => {
|
|
|
1366
1336
|
const TagName = getTagName(props.isFieldset);
|
|
1367
1337
|
/**
|
|
1368
1338
|
* Get tooltip node
|
|
1369
|
-
*
|
|
1370
1339
|
* @returns {VNode[]} mg-tooltip
|
|
1371
1340
|
*/
|
|
1372
1341
|
const getTooltip = () => (h("mg-tooltip", { identifier: `${props.identifier}-tooltip`, message: props.tooltip },
|
|
@@ -1374,7 +1343,6 @@ const MgInput = (props, children, utils) => {
|
|
|
1374
1343
|
/**
|
|
1375
1344
|
* Get input title (label) node
|
|
1376
1345
|
* Display asterisk only if not disabled and not readonly
|
|
1377
|
-
*
|
|
1378
1346
|
* @returns {VNode[]} mg-input-title
|
|
1379
1347
|
*/
|
|
1380
1348
|
const getInputTitle = () => (h("mg-input-title", { identifier: props.identifier, class: props.labelHide ? 'sr-only' : undefined, required: props.required && !props.disabled && !props.readonly, "is-legend": props.isFieldset }, props.label));
|
|
@@ -1396,7 +1364,6 @@ const mgInputCheckboxCss = ":host{display:block}.mg-input{display:flex;align-ite
|
|
|
1396
1364
|
|
|
1397
1365
|
/**
|
|
1398
1366
|
* type CheckboxItem validation function
|
|
1399
|
-
*
|
|
1400
1367
|
* @param {unknown} items Checkbox item
|
|
1401
1368
|
* @returns {boolean} match item type
|
|
1402
1369
|
*/
|
|
@@ -1416,7 +1383,6 @@ const MgInputCheckbox = class {
|
|
|
1416
1383
|
this.hasDisplayedError = false;
|
|
1417
1384
|
/**
|
|
1418
1385
|
* Handle input event
|
|
1419
|
-
*
|
|
1420
1386
|
* @param {InputEvent} event input event
|
|
1421
1387
|
*/
|
|
1422
1388
|
this.handleInput = (event) => {
|
|
@@ -1439,7 +1405,6 @@ const MgInputCheckbox = class {
|
|
|
1439
1405
|
};
|
|
1440
1406
|
/**
|
|
1441
1407
|
* get invalid element
|
|
1442
|
-
*
|
|
1443
1408
|
* @returns {HTMLInputElement} element
|
|
1444
1409
|
*/
|
|
1445
1410
|
this.getInvalidElement = () => this.inputs.find((input) => input !== null && !input.disabled && !input.checkValidity());
|
|
@@ -1507,7 +1472,6 @@ const MgInputCheckbox = class {
|
|
|
1507
1472
|
}
|
|
1508
1473
|
/**
|
|
1509
1474
|
* Public method to display errors
|
|
1510
|
-
*
|
|
1511
1475
|
* @returns {Promise<void>}
|
|
1512
1476
|
*/
|
|
1513
1477
|
async displayError() {
|
|
@@ -1520,7 +1484,6 @@ const MgInputCheckbox = class {
|
|
|
1520
1484
|
*************/
|
|
1521
1485
|
/**
|
|
1522
1486
|
* Check if component props are well configured on init
|
|
1523
|
-
*
|
|
1524
1487
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
1525
1488
|
*/
|
|
1526
1489
|
componentWillLoad() {
|
|
@@ -1537,7 +1500,6 @@ const MgInputCheckbox = class {
|
|
|
1537
1500
|
}
|
|
1538
1501
|
/**
|
|
1539
1502
|
* Render
|
|
1540
|
-
*
|
|
1541
1503
|
* @returns {HTMLElement} HTML Element
|
|
1542
1504
|
*/
|
|
1543
1505
|
render() {
|
|
@@ -1605,7 +1567,6 @@ const MgInputDate = class {
|
|
|
1605
1567
|
};
|
|
1606
1568
|
/**
|
|
1607
1569
|
* get input error code
|
|
1608
|
-
*
|
|
1609
1570
|
* @returns {null | InputError} error code
|
|
1610
1571
|
*/
|
|
1611
1572
|
this.getInputError = () => {
|
|
@@ -1631,7 +1592,6 @@ const MgInputDate = class {
|
|
|
1631
1592
|
};
|
|
1632
1593
|
/**
|
|
1633
1594
|
* Check input errors
|
|
1634
|
-
*
|
|
1635
1595
|
* @returns {void}
|
|
1636
1596
|
*/
|
|
1637
1597
|
this.setErrorMessage = () => {
|
|
@@ -1701,7 +1661,6 @@ const MgInputDate = class {
|
|
|
1701
1661
|
}
|
|
1702
1662
|
/**
|
|
1703
1663
|
* Public method to display errors
|
|
1704
|
-
*
|
|
1705
1664
|
* @returns {Promise<void>}
|
|
1706
1665
|
*/
|
|
1707
1666
|
async displayError() {
|
|
@@ -1714,7 +1673,6 @@ const MgInputDate = class {
|
|
|
1714
1673
|
*************/
|
|
1715
1674
|
/**
|
|
1716
1675
|
* Check if component props are well configured on init
|
|
1717
|
-
*
|
|
1718
1676
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
1719
1677
|
*/
|
|
1720
1678
|
componentWillLoad() {
|
|
@@ -1735,7 +1693,6 @@ const MgInputDate = class {
|
|
|
1735
1693
|
}
|
|
1736
1694
|
/**
|
|
1737
1695
|
* Render
|
|
1738
|
-
*
|
|
1739
1696
|
* @returns {HTMLElement} HTML Element
|
|
1740
1697
|
*/
|
|
1741
1698
|
render() {
|
|
@@ -1779,7 +1736,6 @@ const MgInputNumeric = class {
|
|
|
1779
1736
|
this.hasDisplayedError = false;
|
|
1780
1737
|
/**
|
|
1781
1738
|
* Handle input event
|
|
1782
|
-
*
|
|
1783
1739
|
* @returns {void}
|
|
1784
1740
|
*/
|
|
1785
1741
|
this.handleInput = () => {
|
|
@@ -1792,7 +1748,6 @@ const MgInputNumeric = class {
|
|
|
1792
1748
|
};
|
|
1793
1749
|
/**
|
|
1794
1750
|
* Handle focus event
|
|
1795
|
-
*
|
|
1796
1751
|
* @returns {void}
|
|
1797
1752
|
*/
|
|
1798
1753
|
this.handleFocus = () => {
|
|
@@ -1800,7 +1755,6 @@ const MgInputNumeric = class {
|
|
|
1800
1755
|
};
|
|
1801
1756
|
/**
|
|
1802
1757
|
* Handle blur event
|
|
1803
|
-
*
|
|
1804
1758
|
* @returns {void}
|
|
1805
1759
|
*/
|
|
1806
1760
|
this.handleBlur = () => {
|
|
@@ -1810,7 +1764,6 @@ const MgInputNumeric = class {
|
|
|
1810
1764
|
};
|
|
1811
1765
|
/**
|
|
1812
1766
|
* Check if input is valid
|
|
1813
|
-
*
|
|
1814
1767
|
* @returns {void}
|
|
1815
1768
|
*/
|
|
1816
1769
|
this.checkValidity = () => {
|
|
@@ -1821,7 +1774,6 @@ const MgInputNumeric = class {
|
|
|
1821
1774
|
};
|
|
1822
1775
|
/**
|
|
1823
1776
|
* Set input error message
|
|
1824
|
-
*
|
|
1825
1777
|
* @returns {void}
|
|
1826
1778
|
*/
|
|
1827
1779
|
this.setErrorMessage = () => {
|
|
@@ -1839,7 +1791,6 @@ const MgInputNumeric = class {
|
|
|
1839
1791
|
};
|
|
1840
1792
|
/**
|
|
1841
1793
|
* Get input error code
|
|
1842
|
-
*
|
|
1843
1794
|
* @returns {null | InputError} error code
|
|
1844
1795
|
*/
|
|
1845
1796
|
this.getInputError = () => {
|
|
@@ -1868,14 +1819,12 @@ const MgInputNumeric = class {
|
|
|
1868
1819
|
};
|
|
1869
1820
|
/**
|
|
1870
1821
|
* Format value based on type
|
|
1871
|
-
*
|
|
1872
1822
|
* @param {number} value value to format
|
|
1873
1823
|
* @returns {string} formated local value
|
|
1874
1824
|
*/
|
|
1875
1825
|
this.formatValue = (value) => (this.type === 'currency' ? localeCurrency(value, this.locale, this.currency) : localeNumber(value, this.locale));
|
|
1876
1826
|
/**
|
|
1877
1827
|
* Validate append slot
|
|
1878
|
-
*
|
|
1879
1828
|
* @returns {void}
|
|
1880
1829
|
*/
|
|
1881
1830
|
this.validateAppendSlot = () => {
|
|
@@ -1964,7 +1913,6 @@ const MgInputNumeric = class {
|
|
|
1964
1913
|
}
|
|
1965
1914
|
/**
|
|
1966
1915
|
* Public method to display errors
|
|
1967
|
-
*
|
|
1968
1916
|
* @returns {Promise<void>}
|
|
1969
1917
|
*/
|
|
1970
1918
|
async displayError() {
|
|
@@ -1975,7 +1923,6 @@ const MgInputNumeric = class {
|
|
|
1975
1923
|
/**
|
|
1976
1924
|
* Displayed value in input
|
|
1977
1925
|
* Change on focus/blur
|
|
1978
|
-
*
|
|
1979
1926
|
* @returns {MgInputNumeric['value'] | MgInputNumeric['readonlyValue']} display value
|
|
1980
1927
|
*/
|
|
1981
1928
|
displayValue() {
|
|
@@ -1986,7 +1933,6 @@ const MgInputNumeric = class {
|
|
|
1986
1933
|
*************/
|
|
1987
1934
|
/**
|
|
1988
1935
|
* Check if component props are well configured on init
|
|
1989
|
-
*
|
|
1990
1936
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
1991
1937
|
*/
|
|
1992
1938
|
componentWillLoad() {
|
|
@@ -2010,7 +1956,6 @@ const MgInputNumeric = class {
|
|
|
2010
1956
|
}
|
|
2011
1957
|
/**
|
|
2012
1958
|
* Render
|
|
2013
|
-
*
|
|
2014
1959
|
* @returns {HTMLElement} HTML Element
|
|
2015
1960
|
*/
|
|
2016
1961
|
render() {
|
|
@@ -2111,7 +2056,6 @@ const MgInputPassword = class {
|
|
|
2111
2056
|
}
|
|
2112
2057
|
/**
|
|
2113
2058
|
* Public method to display errors
|
|
2114
|
-
*
|
|
2115
2059
|
* @returns {Promise<void>}
|
|
2116
2060
|
*/
|
|
2117
2061
|
async displayError() {
|
|
@@ -2124,7 +2068,6 @@ const MgInputPassword = class {
|
|
|
2124
2068
|
*************/
|
|
2125
2069
|
/**
|
|
2126
2070
|
* Check if component props are well configured on init
|
|
2127
|
-
*
|
|
2128
2071
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
2129
2072
|
*/
|
|
2130
2073
|
componentWillLoad() {
|
|
@@ -2139,7 +2082,6 @@ const MgInputPassword = class {
|
|
|
2139
2082
|
}
|
|
2140
2083
|
/**
|
|
2141
2084
|
* Render
|
|
2142
|
-
*
|
|
2143
2085
|
* @returns {HTMLElement} HTML Element
|
|
2144
2086
|
*/
|
|
2145
2087
|
render() {
|
|
@@ -2162,7 +2104,6 @@ const mgInputRadioCss = ":host{display:block}.mg-input{display:flex;align-items:
|
|
|
2162
2104
|
|
|
2163
2105
|
/**
|
|
2164
2106
|
* type Option validation function
|
|
2165
|
-
*
|
|
2166
2107
|
* @param {RadioOption} option radio option
|
|
2167
2108
|
* @returns {boolean} radio option type is valid
|
|
2168
2109
|
*/
|
|
@@ -2181,7 +2122,6 @@ const MgInputRadio = class {
|
|
|
2181
2122
|
this.hasDisplayedError = false;
|
|
2182
2123
|
/**
|
|
2183
2124
|
* Handle input event
|
|
2184
|
-
*
|
|
2185
2125
|
* @param {event} event input event
|
|
2186
2126
|
* @returns {void}
|
|
2187
2127
|
*/
|
|
@@ -2191,7 +2131,6 @@ const MgInputRadio = class {
|
|
|
2191
2131
|
};
|
|
2192
2132
|
/**
|
|
2193
2133
|
* Handle blur event
|
|
2194
|
-
*
|
|
2195
2134
|
* @returns {void}
|
|
2196
2135
|
*/
|
|
2197
2136
|
this.handleBlur = () => {
|
|
@@ -2200,7 +2139,6 @@ const MgInputRadio = class {
|
|
|
2200
2139
|
};
|
|
2201
2140
|
/**
|
|
2202
2141
|
* Check if input is valid
|
|
2203
|
-
*
|
|
2204
2142
|
* @returns {void}
|
|
2205
2143
|
*/
|
|
2206
2144
|
this.checkValidity = () => {
|
|
@@ -2211,7 +2149,6 @@ const MgInputRadio = class {
|
|
|
2211
2149
|
};
|
|
2212
2150
|
/**
|
|
2213
2151
|
* Set input error message
|
|
2214
|
-
*
|
|
2215
2152
|
* @returns {void}
|
|
2216
2153
|
*/
|
|
2217
2154
|
this.setErrorMessage = () => {
|
|
@@ -2224,7 +2161,6 @@ const MgInputRadio = class {
|
|
|
2224
2161
|
};
|
|
2225
2162
|
/**
|
|
2226
2163
|
* get invalid element
|
|
2227
|
-
*
|
|
2228
2164
|
* @returns {HTMLInputElement} element
|
|
2229
2165
|
*/
|
|
2230
2166
|
this.getInvalidElement = () => this.inputs.find((input) => !input.disabled && !input.readOnly && !input.checkValidity());
|
|
@@ -2279,7 +2215,6 @@ const MgInputRadio = class {
|
|
|
2279
2215
|
}
|
|
2280
2216
|
/**
|
|
2281
2217
|
* Public method to display errors
|
|
2282
|
-
*
|
|
2283
2218
|
* @returns {Promise<void>}
|
|
2284
2219
|
*/
|
|
2285
2220
|
async displayError() {
|
|
@@ -2292,7 +2227,6 @@ const MgInputRadio = class {
|
|
|
2292
2227
|
*************/
|
|
2293
2228
|
/**
|
|
2294
2229
|
* Check if component props are well configured on init
|
|
2295
|
-
*
|
|
2296
2230
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
2297
2231
|
*/
|
|
2298
2232
|
componentWillLoad() {
|
|
@@ -2309,7 +2243,6 @@ const MgInputRadio = class {
|
|
|
2309
2243
|
}
|
|
2310
2244
|
/**
|
|
2311
2245
|
* Render
|
|
2312
|
-
*
|
|
2313
2246
|
* @returns {HTMLElement} HTML Element
|
|
2314
2247
|
*/
|
|
2315
2248
|
render() {
|
|
@@ -2333,28 +2266,24 @@ const mgInputSelectCss = ":host{display:block}.mg-input{display:flex;align-items
|
|
|
2333
2266
|
|
|
2334
2267
|
/**
|
|
2335
2268
|
* Check if item is a well configured option
|
|
2336
|
-
*
|
|
2337
2269
|
* @param {unknown} option select option
|
|
2338
2270
|
* @returns {boolean} select option type is valid
|
|
2339
2271
|
*/
|
|
2340
2272
|
const isOption$1 = (option) => typeof option === 'object' && typeof option.title === 'string';
|
|
2341
2273
|
/**
|
|
2342
2274
|
* Check if items[] is SelectOption
|
|
2343
|
-
*
|
|
2344
2275
|
* @param {unknown[]} items select option
|
|
2345
2276
|
* @returns {boolean} select option array type is valid
|
|
2346
2277
|
*/
|
|
2347
2278
|
const allItemsAreOptions = (items) => Array.isArray(items) && items.every(item => isOption$1(item));
|
|
2348
2279
|
/**
|
|
2349
2280
|
* Check if item is a well configured optgroup
|
|
2350
|
-
*
|
|
2351
2281
|
* @param {unknown} optgroup select option
|
|
2352
2282
|
* @returns {boolean} select optgroup type is valid
|
|
2353
2283
|
*/
|
|
2354
2284
|
const isOptGroup = (optgroup) => typeof optgroup === 'object' && typeof optgroup.group === 'string' && allItemsAreOptions(optgroup.options);
|
|
2355
2285
|
/**
|
|
2356
2286
|
* Group options
|
|
2357
|
-
*
|
|
2358
2287
|
* @param {(SelectOption | OptGroup)[]} acc reduce accumulator
|
|
2359
2288
|
* @param {SelectOption} item item to add
|
|
2360
2289
|
* @param {string} item.group item group
|
|
@@ -2390,7 +2319,6 @@ const MgInputSelect = class {
|
|
|
2390
2319
|
this.hasDisplayedError = false;
|
|
2391
2320
|
/**
|
|
2392
2321
|
* Handle input event
|
|
2393
|
-
*
|
|
2394
2322
|
* @returns {void}
|
|
2395
2323
|
*/
|
|
2396
2324
|
this.handleInput = () => {
|
|
@@ -2400,14 +2328,12 @@ const MgInputSelect = class {
|
|
|
2400
2328
|
};
|
|
2401
2329
|
/**
|
|
2402
2330
|
* Method to compare item.title with input.value
|
|
2403
|
-
*
|
|
2404
2331
|
* @param {SelectOption} item item to compare with
|
|
2405
2332
|
* @returns {boolean} truthy if input.value is an item
|
|
2406
2333
|
*/
|
|
2407
2334
|
this.isInputValue = (item) => { var _a; return item.title === ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value); };
|
|
2408
2335
|
/**
|
|
2409
2336
|
* value props setter
|
|
2410
|
-
*
|
|
2411
2337
|
* @param {MgInputSelect['value']} newValue value to update with
|
|
2412
2338
|
* @returns {void}
|
|
2413
2339
|
*/
|
|
@@ -2417,7 +2343,6 @@ const MgInputSelect = class {
|
|
|
2417
2343
|
};
|
|
2418
2344
|
/**
|
|
2419
2345
|
* Update value from input.value
|
|
2420
|
-
*
|
|
2421
2346
|
* @returns {void}
|
|
2422
2347
|
*/
|
|
2423
2348
|
this.updateValue = () => {
|
|
@@ -2444,7 +2369,6 @@ const MgInputSelect = class {
|
|
|
2444
2369
|
};
|
|
2445
2370
|
/**
|
|
2446
2371
|
* Input value is disabled
|
|
2447
|
-
*
|
|
2448
2372
|
* @returns {boolean} truthy if input value is disabled
|
|
2449
2373
|
*/
|
|
2450
2374
|
this.isDisabledValue = () => { var _a; return allItemsAreOptions(this.options) && ((_a = this.options.find(this.isInputValue)) === null || _a === void 0 ? void 0 : _a.disabled) === true; };
|
|
@@ -2470,7 +2394,6 @@ const MgInputSelect = class {
|
|
|
2470
2394
|
};
|
|
2471
2395
|
/**
|
|
2472
2396
|
* Render option
|
|
2473
|
-
*
|
|
2474
2397
|
* @param {SelectOption} option to render
|
|
2475
2398
|
* @returns {HTMLElement} render option
|
|
2476
2399
|
*/
|
|
@@ -2551,7 +2474,6 @@ const MgInputSelect = class {
|
|
|
2551
2474
|
}
|
|
2552
2475
|
/**
|
|
2553
2476
|
* Public method to display errors
|
|
2554
|
-
*
|
|
2555
2477
|
* @returns {Promise<void>}
|
|
2556
2478
|
*/
|
|
2557
2479
|
async displayError() {
|
|
@@ -2564,7 +2486,6 @@ const MgInputSelect = class {
|
|
|
2564
2486
|
*************/
|
|
2565
2487
|
/**
|
|
2566
2488
|
* Check if component props are well configured on init
|
|
2567
|
-
*
|
|
2568
2489
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
2569
2490
|
*/
|
|
2570
2491
|
componentWillLoad() {
|
|
@@ -2586,7 +2507,6 @@ const MgInputSelect = class {
|
|
|
2586
2507
|
}
|
|
2587
2508
|
/**
|
|
2588
2509
|
* Render
|
|
2589
|
-
*
|
|
2590
2510
|
* @returns {HTMLElement} HTML Element
|
|
2591
2511
|
*/
|
|
2592
2512
|
render() {
|
|
@@ -2625,7 +2545,6 @@ const MgInputText = class {
|
|
|
2625
2545
|
this.hasDisplayedError = false;
|
|
2626
2546
|
/**
|
|
2627
2547
|
* Handle input event
|
|
2628
|
-
*
|
|
2629
2548
|
* @returns {void}
|
|
2630
2549
|
*/
|
|
2631
2550
|
this.handleInput = () => {
|
|
@@ -2637,7 +2556,6 @@ const MgInputText = class {
|
|
|
2637
2556
|
};
|
|
2638
2557
|
/**
|
|
2639
2558
|
* Handle focus event
|
|
2640
|
-
*
|
|
2641
2559
|
* @returns {void}
|
|
2642
2560
|
*/
|
|
2643
2561
|
this.handleFocus = () => {
|
|
@@ -2646,7 +2564,6 @@ const MgInputText = class {
|
|
|
2646
2564
|
};
|
|
2647
2565
|
/**
|
|
2648
2566
|
* Handle blur event
|
|
2649
|
-
*
|
|
2650
2567
|
* @returns {void}
|
|
2651
2568
|
*/
|
|
2652
2569
|
this.handleBlur = () => {
|
|
@@ -2658,7 +2575,6 @@ const MgInputText = class {
|
|
|
2658
2575
|
};
|
|
2659
2576
|
/**
|
|
2660
2577
|
* Check if input is valid
|
|
2661
|
-
*
|
|
2662
2578
|
* @returns {void}
|
|
2663
2579
|
*/
|
|
2664
2580
|
this.checkValidity = () => {
|
|
@@ -2670,7 +2586,6 @@ const MgInputText = class {
|
|
|
2670
2586
|
};
|
|
2671
2587
|
/**
|
|
2672
2588
|
* Set input error message
|
|
2673
|
-
*
|
|
2674
2589
|
* @returns {void}
|
|
2675
2590
|
*/
|
|
2676
2591
|
this.setErrorMessage = () => {
|
|
@@ -2687,11 +2602,10 @@ const MgInputText = class {
|
|
|
2687
2602
|
};
|
|
2688
2603
|
/**
|
|
2689
2604
|
* Validate pattern configuration
|
|
2690
|
-
*
|
|
2691
2605
|
* @returns {void}
|
|
2692
2606
|
*/
|
|
2693
2607
|
this.validatePattern = () => {
|
|
2694
|
-
if (this.pattern &&
|
|
2608
|
+
if (this.pattern !== undefined &&
|
|
2695
2609
|
typeof this.pattern === 'string' &&
|
|
2696
2610
|
this.pattern !== '' &&
|
|
2697
2611
|
(this.patternErrorMessage === undefined || typeof this.patternErrorMessage !== 'string' || this.patternErrorMessage === '')) {
|
|
@@ -2700,7 +2614,6 @@ const MgInputText = class {
|
|
|
2700
2614
|
};
|
|
2701
2615
|
/**
|
|
2702
2616
|
* Validate append slot
|
|
2703
|
-
*
|
|
2704
2617
|
* @returns {void}
|
|
2705
2618
|
*/
|
|
2706
2619
|
this.validateAppendSlot = () => {
|
|
@@ -2760,7 +2673,6 @@ const MgInputText = class {
|
|
|
2760
2673
|
}
|
|
2761
2674
|
/**
|
|
2762
2675
|
* Public method to play input focus
|
|
2763
|
-
*
|
|
2764
2676
|
* @returns {Promise<void>}
|
|
2765
2677
|
*/
|
|
2766
2678
|
async setFocus() {
|
|
@@ -2768,7 +2680,6 @@ const MgInputText = class {
|
|
|
2768
2680
|
}
|
|
2769
2681
|
/**
|
|
2770
2682
|
* Public method to display errors
|
|
2771
|
-
*
|
|
2772
2683
|
* @returns {Promise<void>}
|
|
2773
2684
|
*/
|
|
2774
2685
|
async displayError() {
|
|
@@ -2781,7 +2692,6 @@ const MgInputText = class {
|
|
|
2781
2692
|
*************/
|
|
2782
2693
|
/**
|
|
2783
2694
|
* Check if component props are well configured on init
|
|
2784
|
-
*
|
|
2785
2695
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
2786
2696
|
*/
|
|
2787
2697
|
componentWillLoad() {
|
|
@@ -2801,7 +2711,6 @@ const MgInputText = class {
|
|
|
2801
2711
|
}
|
|
2802
2712
|
/**
|
|
2803
2713
|
* Render
|
|
2804
|
-
*
|
|
2805
2714
|
* @returns {HTMLElement} HTML Element
|
|
2806
2715
|
*/
|
|
2807
2716
|
render() {
|
|
@@ -2870,7 +2779,6 @@ const MgInputTextarea = class {
|
|
|
2870
2779
|
/**
|
|
2871
2780
|
* Get pattern validity
|
|
2872
2781
|
* Pattern is not defined on textarea field: https://developer.mozilla.org/fr/docs/Web/HTML/Element/Textarea
|
|
2873
|
-
*
|
|
2874
2782
|
* @returns {boolean} is pattern valid
|
|
2875
2783
|
*/
|
|
2876
2784
|
this.getPatternValidity = () => this.pattern === undefined || new RegExp(`^${this.pattern}$`, 'u').test(this.value);
|
|
@@ -2903,7 +2811,7 @@ const MgInputTextarea = class {
|
|
|
2903
2811
|
* Validate pattern configuration
|
|
2904
2812
|
*/
|
|
2905
2813
|
this.validatePattern = () => {
|
|
2906
|
-
if (this.pattern &&
|
|
2814
|
+
if (this.pattern !== undefined &&
|
|
2907
2815
|
typeof this.pattern === 'string' &&
|
|
2908
2816
|
this.pattern !== '' &&
|
|
2909
2817
|
(this.patternErrorMessage === undefined || typeof this.patternErrorMessage !== 'string' || this.patternErrorMessage === '')) {
|
|
@@ -2958,7 +2866,6 @@ const MgInputTextarea = class {
|
|
|
2958
2866
|
}
|
|
2959
2867
|
/**
|
|
2960
2868
|
* Public method to display errors
|
|
2961
|
-
*
|
|
2962
2869
|
* @returns {Promise<void>}
|
|
2963
2870
|
*/
|
|
2964
2871
|
async displayError() {
|
|
@@ -2971,7 +2878,6 @@ const MgInputTextarea = class {
|
|
|
2971
2878
|
*************/
|
|
2972
2879
|
/**
|
|
2973
2880
|
* Check if component props are well configured on init
|
|
2974
|
-
*
|
|
2975
2881
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
2976
2882
|
*/
|
|
2977
2883
|
componentWillLoad() {
|
|
@@ -2990,7 +2896,6 @@ const MgInputTextarea = class {
|
|
|
2990
2896
|
}
|
|
2991
2897
|
/**
|
|
2992
2898
|
* Render
|
|
2993
|
-
*
|
|
2994
2899
|
* @returns {HTMLElement} HTML Element
|
|
2995
2900
|
*/
|
|
2996
2901
|
render() {
|
|
@@ -3038,7 +2943,6 @@ const MgInputTitle = class {
|
|
|
3038
2943
|
*************/
|
|
3039
2944
|
/**
|
|
3040
2945
|
* Init tag name
|
|
3041
|
-
*
|
|
3042
2946
|
* @returns {void}
|
|
3043
2947
|
*/
|
|
3044
2948
|
componentWillLoad() {
|
|
@@ -3047,7 +2951,6 @@ const MgInputTitle = class {
|
|
|
3047
2951
|
}
|
|
3048
2952
|
/**
|
|
3049
2953
|
* Render
|
|
3050
|
-
*
|
|
3051
2954
|
* @returns {HTMLElement} HTML Element
|
|
3052
2955
|
*/
|
|
3053
2956
|
render() {
|
|
@@ -3065,7 +2968,6 @@ const mgInputToggleCss = ":host{display:block}.mg-input{display:flex;align-items
|
|
|
3065
2968
|
|
|
3066
2969
|
/**
|
|
3067
2970
|
* type Option validation function
|
|
3068
|
-
*
|
|
3069
2971
|
* @param {ToggleValue} option radio option
|
|
3070
2972
|
* @returns {boolean} toggle option type is valid
|
|
3071
2973
|
*/
|
|
@@ -3086,7 +2988,6 @@ const MgInputToggle = class {
|
|
|
3086
2988
|
this.classIcon = 'mg-input--toggle-icon';
|
|
3087
2989
|
/**
|
|
3088
2990
|
* Change checked value
|
|
3089
|
-
*
|
|
3090
2991
|
* @returns {void}
|
|
3091
2992
|
*/
|
|
3092
2993
|
this.toggleChecked = () => {
|
|
@@ -3094,7 +2995,6 @@ const MgInputToggle = class {
|
|
|
3094
2995
|
};
|
|
3095
2996
|
/**
|
|
3096
2997
|
* Slots validation
|
|
3097
|
-
*
|
|
3098
2998
|
* @returns {void}
|
|
3099
2999
|
*/
|
|
3100
3000
|
this.validateSlots = () => {
|
|
@@ -3182,7 +3082,6 @@ const MgInputToggle = class {
|
|
|
3182
3082
|
}
|
|
3183
3083
|
/**
|
|
3184
3084
|
* set checked state
|
|
3185
|
-
*
|
|
3186
3085
|
* @returns {void}
|
|
3187
3086
|
*/
|
|
3188
3087
|
setChecked() {
|
|
@@ -3225,7 +3124,6 @@ const MgInputToggle = class {
|
|
|
3225
3124
|
}
|
|
3226
3125
|
/**
|
|
3227
3126
|
* Render
|
|
3228
|
-
*
|
|
3229
3127
|
* @returns {HTMLElement} HTML Element
|
|
3230
3128
|
*/
|
|
3231
3129
|
render() {
|
|
@@ -3260,7 +3158,6 @@ const MgMenu = class {
|
|
|
3260
3158
|
*************/
|
|
3261
3159
|
/**
|
|
3262
3160
|
* Close matching menu-item
|
|
3263
|
-
*
|
|
3264
3161
|
* @param {HTMLElement} item menu-item to close
|
|
3265
3162
|
* @param {boolean} condition addionnal condition
|
|
3266
3163
|
* @returns {void}
|
|
@@ -3272,19 +3169,16 @@ const MgMenu = class {
|
|
|
3272
3169
|
};
|
|
3273
3170
|
/**
|
|
3274
3171
|
* get mg-item-more element
|
|
3275
|
-
*
|
|
3276
3172
|
* @returns {HTMLMgItemMoreElement} mg-item-more element
|
|
3277
3173
|
*/
|
|
3278
3174
|
this.getItemMore = () => this.element.querySelector('mg-item-more');
|
|
3279
3175
|
/**
|
|
3280
3176
|
* get mg-item-more >>> mg-menu-item element
|
|
3281
|
-
*
|
|
3282
3177
|
* @returns {HTMLMgMenuItemElement} mg-item-more >>> mg-menu-item element
|
|
3283
3178
|
*/
|
|
3284
3179
|
this.getItemMoreMenuItem = () => { var _a, _b; return (_b = (_a = this.getItemMore()) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('mg-menu-item'); };
|
|
3285
3180
|
/**
|
|
3286
3181
|
* Set item listend
|
|
3287
|
-
*
|
|
3288
3182
|
* @param {HTMLMgMenuItemElement} item mg-menu-item element
|
|
3289
3183
|
* @param {MgMenu['focusedMenuItem']} index number
|
|
3290
3184
|
* @returns {void}
|
|
@@ -3302,7 +3196,6 @@ const MgMenu = class {
|
|
|
3302
3196
|
};
|
|
3303
3197
|
/**
|
|
3304
3198
|
* Store menu-items on component init and add listeners
|
|
3305
|
-
*
|
|
3306
3199
|
* @returns {void}
|
|
3307
3200
|
*/
|
|
3308
3201
|
this.initMenuItemsListeners = () => {
|
|
@@ -3313,7 +3206,6 @@ const MgMenu = class {
|
|
|
3313
3206
|
};
|
|
3314
3207
|
/**
|
|
3315
3208
|
* Handle item-loaded event on mg-item-more element
|
|
3316
|
-
*
|
|
3317
3209
|
* @returns {void}
|
|
3318
3210
|
*/
|
|
3319
3211
|
this.handleItemLoaded = () => {
|
|
@@ -3321,7 +3213,6 @@ const MgMenu = class {
|
|
|
3321
3213
|
};
|
|
3322
3214
|
/**
|
|
3323
3215
|
* render mg-item-more
|
|
3324
|
-
*
|
|
3325
3216
|
* @returns {void}
|
|
3326
3217
|
*/
|
|
3327
3218
|
this.renderMgItemMore = () => {
|
|
@@ -3364,7 +3255,6 @@ const MgMenu = class {
|
|
|
3364
3255
|
*************/
|
|
3365
3256
|
/**
|
|
3366
3257
|
* Validate props
|
|
3367
|
-
*
|
|
3368
3258
|
* @returns {void}
|
|
3369
3259
|
*/
|
|
3370
3260
|
componentWillLoad() {
|
|
@@ -3375,7 +3265,6 @@ const MgMenu = class {
|
|
|
3375
3265
|
}
|
|
3376
3266
|
/**
|
|
3377
3267
|
* Check if component slots configuration
|
|
3378
|
-
*
|
|
3379
3268
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
3380
3269
|
*/
|
|
3381
3270
|
componentDidLoad() {
|
|
@@ -3406,7 +3295,6 @@ const MgMenu = class {
|
|
|
3406
3295
|
}
|
|
3407
3296
|
/**
|
|
3408
3297
|
* Add listeners to items
|
|
3409
|
-
*
|
|
3410
3298
|
* @returns {void}
|
|
3411
3299
|
*/
|
|
3412
3300
|
componentDidRender() {
|
|
@@ -3414,7 +3302,6 @@ const MgMenu = class {
|
|
|
3414
3302
|
}
|
|
3415
3303
|
/**
|
|
3416
3304
|
* Render
|
|
3417
|
-
*
|
|
3418
3305
|
* @returns {HTMLElement} HTML Element
|
|
3419
3306
|
*/
|
|
3420
3307
|
render() {
|
|
@@ -3447,7 +3334,6 @@ const MgMenuItem = class {
|
|
|
3447
3334
|
**********/
|
|
3448
3335
|
/**
|
|
3449
3336
|
* Toggle expanded prop value
|
|
3450
|
-
*
|
|
3451
3337
|
* @returns {void}
|
|
3452
3338
|
*/
|
|
3453
3339
|
this.toggleExpanded = () => {
|
|
@@ -3455,7 +3341,6 @@ const MgMenuItem = class {
|
|
|
3455
3341
|
};
|
|
3456
3342
|
/**
|
|
3457
3343
|
* Does an Element have given Status
|
|
3458
|
-
*
|
|
3459
3344
|
* @param {HTMLMgMenuItemElement} mgMenuItemElement to parse
|
|
3460
3345
|
* @param {MgMenuItem['status']} status to check
|
|
3461
3346
|
* @returns {boolean} true if element with status is found
|
|
@@ -3463,7 +3348,6 @@ const MgMenuItem = class {
|
|
|
3463
3348
|
this.hasStatus = (mgMenuItemElement, status) => mgMenuItemElement.status === status;
|
|
3464
3349
|
/**
|
|
3465
3350
|
* Is component contextual direction match the given direction
|
|
3466
|
-
*
|
|
3467
3351
|
* @param {MgMenuItem['direction']} direction in parent menu
|
|
3468
3352
|
* @param {MgMenuItem['direction']} compareWith direction to compare with. Default: `this.direction`
|
|
3469
3353
|
* @returns {boolean} true is direction match the direction propertie
|
|
@@ -3472,7 +3356,6 @@ const MgMenuItem = class {
|
|
|
3472
3356
|
/**
|
|
3473
3357
|
* Update displayNotificationBadge
|
|
3474
3358
|
* current component notification badge have priority over the slot badge when submenu contain badge
|
|
3475
|
-
*
|
|
3476
3359
|
* @returns {void} update displayNotificationBadge value
|
|
3477
3360
|
*/
|
|
3478
3361
|
this.updateDisplayNotificationBadge = () => {
|
|
@@ -3483,7 +3366,6 @@ const MgMenuItem = class {
|
|
|
3483
3366
|
};
|
|
3484
3367
|
/**
|
|
3485
3368
|
* Method to control if one of component children have active status
|
|
3486
|
-
*
|
|
3487
3369
|
* @returns {boolean} truthy if component has active child
|
|
3488
3370
|
*/
|
|
3489
3371
|
this.hasActiveChild = () => {
|
|
@@ -3492,7 +3374,6 @@ const MgMenuItem = class {
|
|
|
3492
3374
|
};
|
|
3493
3375
|
/**
|
|
3494
3376
|
* Validate slots
|
|
3495
|
-
*
|
|
3496
3377
|
* @param {boolean} guard prevent action whith guard. Default: false.
|
|
3497
3378
|
* @returns {void}
|
|
3498
3379
|
*/
|
|
@@ -3512,7 +3393,6 @@ const MgMenuItem = class {
|
|
|
3512
3393
|
};
|
|
3513
3394
|
/**
|
|
3514
3395
|
* Update status
|
|
3515
|
-
*
|
|
3516
3396
|
* @param {Status[]} guard status to exclude from process in addition to [Status.HIDDEN, Status.DISABLED] . Default: [].
|
|
3517
3397
|
* @returns {void}
|
|
3518
3398
|
*/
|
|
@@ -3523,7 +3403,6 @@ const MgMenuItem = class {
|
|
|
3523
3403
|
};
|
|
3524
3404
|
/**
|
|
3525
3405
|
* Init event-listeners
|
|
3526
|
-
*
|
|
3527
3406
|
* @returns {void}
|
|
3528
3407
|
*/
|
|
3529
3408
|
this.initListeners = () => {
|
|
@@ -3540,13 +3419,11 @@ const MgMenuItem = class {
|
|
|
3540
3419
|
};
|
|
3541
3420
|
/**
|
|
3542
3421
|
* Get mg-popover identifier
|
|
3543
|
-
*
|
|
3544
3422
|
* @returns {MgPopover['identifier']} generated mg-popover identifier
|
|
3545
3423
|
*/
|
|
3546
3424
|
this.getPopoverIdentifier = () => `${this.identifier}-popover`;
|
|
3547
3425
|
/**
|
|
3548
3426
|
* Condition to know if component should display a mg-popover
|
|
3549
|
-
*
|
|
3550
3427
|
* @returns {boolean} truthy if component display popover
|
|
3551
3428
|
*/
|
|
3552
3429
|
this.displayPopover = () => this.isDirection(Direction.HORIZONTAL) && this.hasChildren && this.href === undefined;
|
|
@@ -3555,7 +3432,6 @@ const MgMenuItem = class {
|
|
|
3555
3432
|
************/
|
|
3556
3433
|
/**
|
|
3557
3434
|
* Handle interacrtive element click
|
|
3558
|
-
*
|
|
3559
3435
|
* @param {MouseEvent} event click on element
|
|
3560
3436
|
* @returns {void}
|
|
3561
3437
|
*/
|
|
@@ -3570,7 +3446,6 @@ const MgMenuItem = class {
|
|
|
3570
3446
|
};
|
|
3571
3447
|
/**
|
|
3572
3448
|
* Handle popover element display-change event
|
|
3573
|
-
*
|
|
3574
3449
|
* @param {CustomEvent} event popover display event
|
|
3575
3450
|
* @returns {void}
|
|
3576
3451
|
*/
|
|
@@ -3579,7 +3454,6 @@ const MgMenuItem = class {
|
|
|
3579
3454
|
};
|
|
3580
3455
|
/**
|
|
3581
3456
|
* Render slot
|
|
3582
|
-
*
|
|
3583
3457
|
* @returns {HTMLElement} HTML Element
|
|
3584
3458
|
*/
|
|
3585
3459
|
this.renderSlot = () => h("slot", null);
|
|
@@ -3646,7 +3520,6 @@ const MgMenuItem = class {
|
|
|
3646
3520
|
}
|
|
3647
3521
|
/**
|
|
3648
3522
|
* Render popover clickoutside guard for content slot
|
|
3649
|
-
*
|
|
3650
3523
|
* @returns {void}
|
|
3651
3524
|
*/
|
|
3652
3525
|
updatePopoverGuard() {
|
|
@@ -3660,7 +3533,6 @@ const MgMenuItem = class {
|
|
|
3660
3533
|
*************/
|
|
3661
3534
|
/**
|
|
3662
3535
|
* Validate props
|
|
3663
|
-
*
|
|
3664
3536
|
* @returns {void}
|
|
3665
3537
|
*/
|
|
3666
3538
|
componentWillLoad() {
|
|
@@ -3677,7 +3549,6 @@ const MgMenuItem = class {
|
|
|
3677
3549
|
}
|
|
3678
3550
|
/**
|
|
3679
3551
|
* Check if component slots configuration
|
|
3680
|
-
*
|
|
3681
3552
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
3682
3553
|
*/
|
|
3683
3554
|
componentDidLoad() {
|
|
@@ -3717,7 +3588,6 @@ const MgMenuItem = class {
|
|
|
3717
3588
|
}
|
|
3718
3589
|
/**
|
|
3719
3590
|
* Render ineractive element
|
|
3720
|
-
*
|
|
3721
3591
|
* @returns {HTMLElement} HTML Element
|
|
3722
3592
|
*/
|
|
3723
3593
|
renderInteractiveElement() {
|
|
@@ -3730,7 +3600,6 @@ const MgMenuItem = class {
|
|
|
3730
3600
|
}
|
|
3731
3601
|
/**
|
|
3732
3602
|
* Render
|
|
3733
|
-
*
|
|
3734
3603
|
* @returns {HTMLElement} HTML Element
|
|
3735
3604
|
*/
|
|
3736
3605
|
render() {
|
|
@@ -3780,7 +3649,6 @@ const MgMessage = class {
|
|
|
3780
3649
|
this.isHovered = false;
|
|
3781
3650
|
/**
|
|
3782
3651
|
* Set timer
|
|
3783
|
-
*
|
|
3784
3652
|
* @returns {void}
|
|
3785
3653
|
*/
|
|
3786
3654
|
this.setTimer = () => {
|
|
@@ -3788,7 +3656,6 @@ const MgMessage = class {
|
|
|
3788
3656
|
};
|
|
3789
3657
|
/**
|
|
3790
3658
|
* Clear timer
|
|
3791
|
-
*
|
|
3792
3659
|
* @returns {void}
|
|
3793
3660
|
*/
|
|
3794
3661
|
this.clearTimer = () => {
|
|
@@ -3796,7 +3663,6 @@ const MgMessage = class {
|
|
|
3796
3663
|
};
|
|
3797
3664
|
/**
|
|
3798
3665
|
* Event to add on element
|
|
3799
|
-
*
|
|
3800
3666
|
* @param {MouseEvent | FocusEvent} event event
|
|
3801
3667
|
* @returns {void}
|
|
3802
3668
|
*/
|
|
@@ -3821,8 +3687,7 @@ const MgMessage = class {
|
|
|
3821
3687
|
};
|
|
3822
3688
|
/**
|
|
3823
3689
|
* Get icon corresponding to variant
|
|
3824
|
-
*
|
|
3825
|
-
* @returns {string} icon
|
|
3690
|
+
* @returns {MgIcon['icon'] | undefined} icon
|
|
3826
3691
|
*/
|
|
3827
3692
|
this.getIcon = () => {
|
|
3828
3693
|
switch (this.variant) {
|
|
@@ -3845,7 +3710,7 @@ const MgMessage = class {
|
|
|
3845
3710
|
this.hasActions = false;
|
|
3846
3711
|
}
|
|
3847
3712
|
validateDelay(newValue) {
|
|
3848
|
-
if (newValue && newValue < 2) {
|
|
3713
|
+
if (newValue !== undefined && newValue < 2) {
|
|
3849
3714
|
throw new Error(`<mg-message> prop "delay" must be greater than 2 seconds.`);
|
|
3850
3715
|
}
|
|
3851
3716
|
}
|
|
@@ -3914,7 +3779,6 @@ const MgMessage = class {
|
|
|
3914
3779
|
}
|
|
3915
3780
|
/**
|
|
3916
3781
|
* Render
|
|
3917
|
-
*
|
|
3918
3782
|
* @returns {HTMLElement} HTML Element
|
|
3919
3783
|
*/
|
|
3920
3784
|
render() {
|
|
@@ -3978,7 +3842,6 @@ const MgModal = class {
|
|
|
3978
3842
|
*************/
|
|
3979
3843
|
/**
|
|
3980
3844
|
* Handle close button
|
|
3981
|
-
*
|
|
3982
3845
|
* @returns {void}
|
|
3983
3846
|
*/
|
|
3984
3847
|
this.handleClose = () => {
|
|
@@ -4011,7 +3874,6 @@ const MgModal = class {
|
|
|
4011
3874
|
}
|
|
4012
3875
|
/**
|
|
4013
3876
|
* Handle 'escape' key down
|
|
4014
|
-
*
|
|
4015
3877
|
* @param {KeyboardEvent} event keydown event
|
|
4016
3878
|
* @returns {void}
|
|
4017
3879
|
*/
|
|
@@ -4026,7 +3888,6 @@ const MgModal = class {
|
|
|
4026
3888
|
*************/
|
|
4027
3889
|
/**
|
|
4028
3890
|
* Check if component props are well configured on init
|
|
4029
|
-
*
|
|
4030
3891
|
* @returns {void}
|
|
4031
3892
|
*/
|
|
4032
3893
|
componentWillLoad() {
|
|
@@ -4046,7 +3907,6 @@ const MgModal = class {
|
|
|
4046
3907
|
}
|
|
4047
3908
|
/**
|
|
4048
3909
|
* Add observer on component to set focus when displayed
|
|
4049
|
-
*
|
|
4050
3910
|
* @returns {void}
|
|
4051
3911
|
*/
|
|
4052
3912
|
componentDidLoad() {
|
|
@@ -4062,7 +3922,6 @@ const MgModal = class {
|
|
|
4062
3922
|
}
|
|
4063
3923
|
/**
|
|
4064
3924
|
* Render
|
|
4065
|
-
*
|
|
4066
3925
|
* @returns {HTMLElement} HTML Element
|
|
4067
3926
|
*/
|
|
4068
3927
|
render() {
|
|
@@ -4098,7 +3957,6 @@ const mgPaginationCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1
|
|
|
4098
3957
|
* range(1, 1) = [1]
|
|
4099
3958
|
* range(1, 5) = [1, 2, 3, 4, 5]
|
|
4100
3959
|
* range(10, 20, 2) = [10, 12, 14, 16, 18, 20]
|
|
4101
|
-
*
|
|
4102
3960
|
* @param {number} start start range
|
|
4103
3961
|
* @param {number} end start end
|
|
4104
3962
|
* @param {number} step step size
|
|
@@ -4111,7 +3969,6 @@ const MgPagination = class {
|
|
|
4111
3969
|
this.currentPageChange = createEvent(this, "current-page-change", 7);
|
|
4112
3970
|
/**
|
|
4113
3971
|
* Change current page from target
|
|
4114
|
-
*
|
|
4115
3972
|
* @param {number} target target page
|
|
4116
3973
|
* @returns {void}
|
|
4117
3974
|
*/
|
|
@@ -4123,7 +3980,6 @@ const MgPagination = class {
|
|
|
4123
3980
|
************/
|
|
4124
3981
|
/**
|
|
4125
3982
|
* select handler
|
|
4126
|
-
*
|
|
4127
3983
|
* @param {InputEvent} event value change event
|
|
4128
3984
|
* @returns {void}
|
|
4129
3985
|
*/
|
|
@@ -4133,7 +3989,6 @@ const MgPagination = class {
|
|
|
4133
3989
|
};
|
|
4134
3990
|
/**
|
|
4135
3991
|
* Go to 'previous/next' page button handler
|
|
4136
|
-
*
|
|
4137
3992
|
* @param {string} action navigation action
|
|
4138
3993
|
* @param {boolean} disabled button disable state
|
|
4139
3994
|
* @returns {void}
|
|
@@ -4166,7 +4021,6 @@ const MgPagination = class {
|
|
|
4166
4021
|
*************/
|
|
4167
4022
|
/**
|
|
4168
4023
|
* Check if props are well configured on init
|
|
4169
|
-
*
|
|
4170
4024
|
* @returns {void}
|
|
4171
4025
|
*/
|
|
4172
4026
|
componentWillLoad() {
|
|
@@ -4182,7 +4036,6 @@ const MgPagination = class {
|
|
|
4182
4036
|
}
|
|
4183
4037
|
/**
|
|
4184
4038
|
* Render
|
|
4185
|
-
*
|
|
4186
4039
|
* @returns {HTMLElement} HTML Element
|
|
4187
4040
|
*/
|
|
4188
4041
|
render() {
|
|
@@ -4211,7 +4064,6 @@ const MgPanel = class {
|
|
|
4211
4064
|
************/
|
|
4212
4065
|
/**
|
|
4213
4066
|
* Toggle is editing state
|
|
4214
|
-
*
|
|
4215
4067
|
* @returns {void}
|
|
4216
4068
|
*/
|
|
4217
4069
|
this.toggleIsEditing = () => {
|
|
@@ -4222,7 +4074,6 @@ const MgPanel = class {
|
|
|
4222
4074
|
************/
|
|
4223
4075
|
/**
|
|
4224
4076
|
* Collapse button click handler
|
|
4225
|
-
*
|
|
4226
4077
|
* @returns {void}
|
|
4227
4078
|
*/
|
|
4228
4079
|
this.handleCollapseButton = () => {
|
|
@@ -4232,7 +4083,6 @@ const MgPanel = class {
|
|
|
4232
4083
|
};
|
|
4233
4084
|
/**
|
|
4234
4085
|
* Edit button click handler
|
|
4235
|
-
*
|
|
4236
4086
|
* @returns {void}
|
|
4237
4087
|
*/
|
|
4238
4088
|
this.handleEditButton = () => {
|
|
@@ -4240,7 +4090,6 @@ const MgPanel = class {
|
|
|
4240
4090
|
};
|
|
4241
4091
|
/**
|
|
4242
4092
|
* Update title handler
|
|
4243
|
-
*
|
|
4244
4093
|
* @param {CustomEvent<string>} event input value change event
|
|
4245
4094
|
* @returns {void}
|
|
4246
4095
|
*/
|
|
@@ -4249,7 +4098,6 @@ const MgPanel = class {
|
|
|
4249
4098
|
};
|
|
4250
4099
|
/**
|
|
4251
4100
|
* Cancel edition button handler
|
|
4252
|
-
*
|
|
4253
4101
|
* @returns {void}
|
|
4254
4102
|
*/
|
|
4255
4103
|
this.handleCancelEditButton = () => {
|
|
@@ -4258,7 +4106,6 @@ const MgPanel = class {
|
|
|
4258
4106
|
};
|
|
4259
4107
|
/**
|
|
4260
4108
|
* Validate edition button handler
|
|
4261
|
-
*
|
|
4262
4109
|
* @returns {void}
|
|
4263
4110
|
*/
|
|
4264
4111
|
this.handleValidateEditButton = () => {
|
|
@@ -4270,7 +4117,6 @@ const MgPanel = class {
|
|
|
4270
4117
|
};
|
|
4271
4118
|
/**
|
|
4272
4119
|
* Header left conditional render
|
|
4273
|
-
*
|
|
4274
4120
|
* @typedef {HTMLElement} HTMLMgButtonElement
|
|
4275
4121
|
* @returns {HTMLMgButtonElement | HTMLElement | HTMLElement[]} header left element
|
|
4276
4122
|
*/
|
|
@@ -4308,10 +4154,10 @@ const MgPanel = class {
|
|
|
4308
4154
|
this.titleChange.emit(newValue);
|
|
4309
4155
|
}
|
|
4310
4156
|
validatetitlePattern(newValue) {
|
|
4311
|
-
if (newValue && !this.titleEditable) {
|
|
4157
|
+
if (newValue !== undefined && !this.titleEditable) {
|
|
4312
4158
|
throw new Error('<mg-panel> prop "titleEditable" must be set to `true`.');
|
|
4313
4159
|
}
|
|
4314
|
-
if (newValue && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === '')) {
|
|
4160
|
+
if (newValue !== undefined && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === '')) {
|
|
4315
4161
|
throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
|
|
4316
4162
|
}
|
|
4317
4163
|
}
|
|
@@ -4323,7 +4169,6 @@ const MgPanel = class {
|
|
|
4323
4169
|
*************/
|
|
4324
4170
|
/**
|
|
4325
4171
|
* Check if props are well configured on init
|
|
4326
|
-
*
|
|
4327
4172
|
* @returns {void}
|
|
4328
4173
|
*/
|
|
4329
4174
|
componentWillLoad() {
|
|
@@ -4335,7 +4180,6 @@ const MgPanel = class {
|
|
|
4335
4180
|
}
|
|
4336
4181
|
/**
|
|
4337
4182
|
* Edit DOM after render
|
|
4338
|
-
*
|
|
4339
4183
|
* @returns {void}
|
|
4340
4184
|
*/
|
|
4341
4185
|
componentDidRender() {
|
|
@@ -4346,7 +4190,6 @@ const MgPanel = class {
|
|
|
4346
4190
|
}
|
|
4347
4191
|
/**
|
|
4348
4192
|
* Render component
|
|
4349
|
-
*
|
|
4350
4193
|
* @returns {HTMLElement} html element
|
|
4351
4194
|
*/
|
|
4352
4195
|
render() {
|
|
@@ -6169,7 +6012,6 @@ const MgPopover = class {
|
|
|
6169
6012
|
this.classArrowHide = `mg-popover--arrow-hide`;
|
|
6170
6013
|
/**
|
|
6171
6014
|
* Check if clicked outside of component
|
|
6172
|
-
*
|
|
6173
6015
|
* @param {MouseEvent} event mouse event
|
|
6174
6016
|
* @returns {void}
|
|
6175
6017
|
*/
|
|
@@ -6183,7 +6025,6 @@ const MgPopover = class {
|
|
|
6183
6025
|
};
|
|
6184
6026
|
/**
|
|
6185
6027
|
* Show popover
|
|
6186
|
-
*
|
|
6187
6028
|
* @returns {void}
|
|
6188
6029
|
*/
|
|
6189
6030
|
this.show = () => {
|
|
@@ -6203,7 +6044,6 @@ const MgPopover = class {
|
|
|
6203
6044
|
};
|
|
6204
6045
|
/**
|
|
6205
6046
|
* Hide popover
|
|
6206
|
-
*
|
|
6207
6047
|
* @returns {void}
|
|
6208
6048
|
*/
|
|
6209
6049
|
this.hide = () => {
|
|
@@ -6218,7 +6058,6 @@ const MgPopover = class {
|
|
|
6218
6058
|
};
|
|
6219
6059
|
/**
|
|
6220
6060
|
* Handle action for close button
|
|
6221
|
-
*
|
|
6222
6061
|
* @returns {void}
|
|
6223
6062
|
*/
|
|
6224
6063
|
this.handleCloseButton = () => {
|
|
@@ -6252,7 +6091,6 @@ const MgPopover = class {
|
|
|
6252
6091
|
*************/
|
|
6253
6092
|
/**
|
|
6254
6093
|
* Check if component props are well configured on init
|
|
6255
|
-
*
|
|
6256
6094
|
* @returns {void} timeout
|
|
6257
6095
|
*/
|
|
6258
6096
|
componentWillLoad() {
|
|
@@ -6264,7 +6102,6 @@ const MgPopover = class {
|
|
|
6264
6102
|
}
|
|
6265
6103
|
/**
|
|
6266
6104
|
* Check if component props are well configured on init
|
|
6267
|
-
*
|
|
6268
6105
|
* @returns {void}
|
|
6269
6106
|
*/
|
|
6270
6107
|
componentDidLoad() {
|
|
@@ -6322,7 +6159,6 @@ const MgPopover = class {
|
|
|
6322
6159
|
}
|
|
6323
6160
|
/**
|
|
6324
6161
|
* Render
|
|
6325
|
-
*
|
|
6326
6162
|
* @returns {HTMLElement} HTML Element
|
|
6327
6163
|
*/
|
|
6328
6164
|
render() {
|
|
@@ -6347,7 +6183,6 @@ const MgSkipLinks = class {
|
|
|
6347
6183
|
**********/
|
|
6348
6184
|
/**
|
|
6349
6185
|
* Handle link click and emit go-to-anchor event
|
|
6350
|
-
*
|
|
6351
6186
|
* @param {MouseEvent} event mouse event
|
|
6352
6187
|
* @returns {void}
|
|
6353
6188
|
*/
|
|
@@ -6369,7 +6204,6 @@ const MgSkipLinks = class {
|
|
|
6369
6204
|
*************/
|
|
6370
6205
|
/**
|
|
6371
6206
|
* Check if props are well configured on init
|
|
6372
|
-
*
|
|
6373
6207
|
* @returns {void}
|
|
6374
6208
|
*/
|
|
6375
6209
|
componentWillLoad() {
|
|
@@ -6378,7 +6212,6 @@ const MgSkipLinks = class {
|
|
|
6378
6212
|
}
|
|
6379
6213
|
/**
|
|
6380
6214
|
* Render
|
|
6381
|
-
*
|
|
6382
6215
|
* @returns {HTMLElement} HTML Element
|
|
6383
6216
|
*/
|
|
6384
6217
|
render() {
|
|
@@ -6410,7 +6243,6 @@ const mgTabsCss = ".mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.m
|
|
|
6410
6243
|
|
|
6411
6244
|
/**
|
|
6412
6245
|
* type TabItem validation function
|
|
6413
|
-
*
|
|
6414
6246
|
* @param {TabItem} tab tab item
|
|
6415
6247
|
* @returns {boolean} tab item type is valid
|
|
6416
6248
|
*/
|
|
@@ -6428,7 +6260,6 @@ const MgTabs = class {
|
|
|
6428
6260
|
this.startIndex = 1;
|
|
6429
6261
|
/**
|
|
6430
6262
|
* Method to know if given tab has the given status
|
|
6431
|
-
*
|
|
6432
6263
|
* @param {TabItem} tab item tab key to set to ACTIVE status
|
|
6433
6264
|
* @param {Status} status status to valide
|
|
6434
6265
|
* @returns {boolean} status comparaison
|
|
@@ -6436,7 +6267,6 @@ const MgTabs = class {
|
|
|
6436
6267
|
this.tabHasStatus = (tab, status) => tab.status === status;
|
|
6437
6268
|
/**
|
|
6438
6269
|
* Method to get element id from index
|
|
6439
|
-
*
|
|
6440
6270
|
* @param {string} element to get id
|
|
6441
6271
|
* @param {number} index to generate id
|
|
6442
6272
|
* @returns {string} generated element id
|
|
@@ -6444,20 +6274,17 @@ const MgTabs = class {
|
|
|
6444
6274
|
this.getElementId = (element, index) => `${element}-${this.getTabItemIndex(index)}`;
|
|
6445
6275
|
/**
|
|
6446
6276
|
* Method to get tab item index
|
|
6447
|
-
*
|
|
6448
6277
|
* @param {number} index to get
|
|
6449
6278
|
* @returns {number} index
|
|
6450
6279
|
*/
|
|
6451
6280
|
this.getTabItemIndex = (index) => index + this.startIndex;
|
|
6452
6281
|
/**
|
|
6453
6282
|
* Method to get the active-tab value
|
|
6454
|
-
*
|
|
6455
6283
|
* @returns {number} of the active-tab
|
|
6456
6284
|
*/
|
|
6457
6285
|
this.getActiveTab = () => this.activeTab || this.getTabItemIndex(this.tabs.map((tab, index) => (Object.assign(Object.assign({}, tab), { index }))).find(tab => this.tabHasStatus(tab, Status.ACTIVE)).index);
|
|
6458
6286
|
/**
|
|
6459
6287
|
* Handle click events on tabs
|
|
6460
|
-
*
|
|
6461
6288
|
* @param {MouseEvent} event mouse event
|
|
6462
6289
|
*/
|
|
6463
6290
|
this.handleClick = (event) => {
|
|
@@ -6473,14 +6300,12 @@ const MgTabs = class {
|
|
|
6473
6300
|
};
|
|
6474
6301
|
/**
|
|
6475
6302
|
* get navigation button class from given status
|
|
6476
|
-
*
|
|
6477
6303
|
* @param {Status} status button tab status
|
|
6478
6304
|
* @returns {string} button class/selector variant
|
|
6479
6305
|
*/
|
|
6480
6306
|
this.getNavigationButtonClass = (status) => `${this.buttonTabBaseClass}--${status}`;
|
|
6481
6307
|
/**
|
|
6482
6308
|
* Handle keyboard event on tabs
|
|
6483
|
-
*
|
|
6484
6309
|
* @param {MouseEvent} event mouse event
|
|
6485
6310
|
* @returns {void}
|
|
6486
6311
|
*/
|
|
@@ -6520,7 +6345,6 @@ const MgTabs = class {
|
|
|
6520
6345
|
};
|
|
6521
6346
|
/**
|
|
6522
6347
|
* Method to reset focus behavior
|
|
6523
|
-
*
|
|
6524
6348
|
* @returns {void}
|
|
6525
6349
|
*/
|
|
6526
6350
|
this.resetFocus = () => {
|
|
@@ -6600,7 +6424,6 @@ const MgTabs = class {
|
|
|
6600
6424
|
*************/
|
|
6601
6425
|
/**
|
|
6602
6426
|
* Check if component props are well configured on init
|
|
6603
|
-
*
|
|
6604
6427
|
* @returns {void}
|
|
6605
6428
|
*/
|
|
6606
6429
|
componentWillLoad() {
|
|
@@ -6613,7 +6436,6 @@ const MgTabs = class {
|
|
|
6613
6436
|
}
|
|
6614
6437
|
/**
|
|
6615
6438
|
* add listners
|
|
6616
|
-
*
|
|
6617
6439
|
* @returns {void}
|
|
6618
6440
|
*/
|
|
6619
6441
|
componentDidLoad() {
|
|
@@ -6624,7 +6446,6 @@ const MgTabs = class {
|
|
|
6624
6446
|
}
|
|
6625
6447
|
/**
|
|
6626
6448
|
* Render
|
|
6627
|
-
*
|
|
6628
6449
|
* @returns {HTMLElement} HTML Element
|
|
6629
6450
|
*/
|
|
6630
6451
|
render() {
|
|
@@ -6699,7 +6520,6 @@ const MgTag = class {
|
|
|
6699
6520
|
*************/
|
|
6700
6521
|
/**
|
|
6701
6522
|
* Validate the given textContent
|
|
6702
|
-
*
|
|
6703
6523
|
* @param {string} textContent html element textContent property
|
|
6704
6524
|
* @returns {void}
|
|
6705
6525
|
*/
|
|
@@ -6712,7 +6532,6 @@ const MgTag = class {
|
|
|
6712
6532
|
*************/
|
|
6713
6533
|
/**
|
|
6714
6534
|
* Check if props are well configured on init
|
|
6715
|
-
*
|
|
6716
6535
|
* @returns {void}
|
|
6717
6536
|
*/
|
|
6718
6537
|
componentWillLoad() {
|
|
@@ -6723,7 +6542,6 @@ const MgTag = class {
|
|
|
6723
6542
|
}
|
|
6724
6543
|
/**
|
|
6725
6544
|
* Render
|
|
6726
|
-
*
|
|
6727
6545
|
* @returns {HTMLElement} HTML Element
|
|
6728
6546
|
*/
|
|
6729
6547
|
render() {
|
|
@@ -6752,7 +6570,6 @@ const MgTooltip = class {
|
|
|
6752
6570
|
registerInstance(this, hostRef);
|
|
6753
6571
|
/**
|
|
6754
6572
|
* Show tooltip
|
|
6755
|
-
*
|
|
6756
6573
|
* @returns {void}
|
|
6757
6574
|
*/
|
|
6758
6575
|
this.show = () => {
|
|
@@ -6773,7 +6590,6 @@ const MgTooltip = class {
|
|
|
6773
6590
|
};
|
|
6774
6591
|
/**
|
|
6775
6592
|
* Hide tooltip
|
|
6776
|
-
*
|
|
6777
6593
|
* @returns {void}
|
|
6778
6594
|
*/
|
|
6779
6595
|
this.hide = () => {
|
|
@@ -6789,7 +6605,6 @@ const MgTooltip = class {
|
|
|
6789
6605
|
};
|
|
6790
6606
|
/**
|
|
6791
6607
|
* Check if clicked outside of component and hidde tooltip
|
|
6792
|
-
*
|
|
6793
6608
|
* @param {MouseEvent} event mouse event
|
|
6794
6609
|
* @returns {void}
|
|
6795
6610
|
*/
|
|
@@ -6799,7 +6614,6 @@ const MgTooltip = class {
|
|
|
6799
6614
|
};
|
|
6800
6615
|
/**
|
|
6801
6616
|
* Check if 'Escape' key is pressed of component and hidde tooltip
|
|
6802
|
-
*
|
|
6803
6617
|
* @param {KeyboardEvent} event keyboard event
|
|
6804
6618
|
* @returns {void}
|
|
6805
6619
|
*/
|
|
@@ -6809,7 +6623,6 @@ const MgTooltip = class {
|
|
|
6809
6623
|
};
|
|
6810
6624
|
/**
|
|
6811
6625
|
* Method to set display prop
|
|
6812
|
-
*
|
|
6813
6626
|
* @param {boolean} newValue display prop new value
|
|
6814
6627
|
* @param {boolean} condition additionnal condition to apply display prop newValue
|
|
6815
6628
|
* @returns {void}
|
|
@@ -6820,7 +6633,6 @@ const MgTooltip = class {
|
|
|
6820
6633
|
};
|
|
6821
6634
|
/**
|
|
6822
6635
|
* Action for tooltip element and tooltiped element mouse listener
|
|
6823
|
-
*
|
|
6824
6636
|
* @param {Guard} elementGuard tooltip element guard
|
|
6825
6637
|
* @param {boolean} isMouseenter mouseenter validation
|
|
6826
6638
|
* @param {Guard} conditionalGuard guard condition
|
|
@@ -6843,7 +6655,6 @@ const MgTooltip = class {
|
|
|
6843
6655
|
};
|
|
6844
6656
|
/**
|
|
6845
6657
|
* Method to reset guard value
|
|
6846
|
-
*
|
|
6847
6658
|
* @returns {void}
|
|
6848
6659
|
*/
|
|
6849
6660
|
this.resetGuard = () => {
|
|
@@ -6851,7 +6662,6 @@ const MgTooltip = class {
|
|
|
6851
6662
|
};
|
|
6852
6663
|
/**
|
|
6853
6664
|
* Update slot content when it is a mg-button
|
|
6854
|
-
*
|
|
6855
6665
|
* @param {HTMLMgButtonElement} mgButton slotted mg-button
|
|
6856
6666
|
* @returns {void}
|
|
6857
6667
|
*/
|
|
@@ -6870,7 +6680,6 @@ const MgTooltip = class {
|
|
|
6870
6680
|
};
|
|
6871
6681
|
/**
|
|
6872
6682
|
* Init tooltip
|
|
6873
|
-
*
|
|
6874
6683
|
* @param {HTMLElement} slotElement slotted element
|
|
6875
6684
|
* @param {HTMLElement} interactiveElement interactive element
|
|
6876
6685
|
*/
|
|
@@ -6948,7 +6757,6 @@ const MgTooltip = class {
|
|
|
6948
6757
|
*************/
|
|
6949
6758
|
/**
|
|
6950
6759
|
* set variables
|
|
6951
|
-
*
|
|
6952
6760
|
* @returns {void}
|
|
6953
6761
|
*/
|
|
6954
6762
|
componentWillLoad() {
|
|
@@ -6959,7 +6767,6 @@ const MgTooltip = class {
|
|
|
6959
6767
|
* Get slotted element
|
|
6960
6768
|
* Check if it already contain an interactive element, if not we need to add a tabIndex attribute
|
|
6961
6769
|
* We need to attach the focused element to the tooltip (aria-describedby)
|
|
6962
|
-
*
|
|
6963
6770
|
* @returns {void}
|
|
6964
6771
|
*/
|
|
6965
6772
|
componentDidLoad() {
|
|
@@ -6993,7 +6800,6 @@ const MgTooltip = class {
|
|
|
6993
6800
|
}
|
|
6994
6801
|
/**
|
|
6995
6802
|
* Render
|
|
6996
|
-
*
|
|
6997
6803
|
* @returns {HTMLElement} HTML Element
|
|
6998
6804
|
*/
|
|
6999
6805
|
render() {
|