@mgdis/mg-components 5.27.2 → 5.27.3

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 (93) hide show
  1. package/dist/cjs/index-7bb96ccc.js +1636 -0
  2. package/dist/cjs/index-7bb96ccc.js.map +1 -0
  3. package/dist/cjs/{index-00072168.js → index-8e9b0d9b.js} +67 -27
  4. package/dist/cjs/index-8e9b0d9b.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/mg-action-more_36.cjs.entry.js +123 -115
  7. package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
  8. package/dist/cjs/mg-components.cjs.js +9 -9
  9. package/dist/cjs/mg-components.cjs.js.map +1 -1
  10. package/dist/cjs/mg-loader.cjs.entry.js +3 -3
  11. package/dist/collection/collection-manifest.json +1 -1
  12. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +21 -18
  13. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  14. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +2 -1
  15. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  16. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +4 -4
  17. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  18. package/dist/collection/components/molecules/mg-popover/mg-popover.js +6 -2
  19. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  20. package/dist/components/index.es.js +60 -20
  21. package/dist/components/index.es.js.map +1 -1
  22. package/dist/components/index2.js +2 -2
  23. package/dist/components/mg-action-more.js +2 -2
  24. package/dist/components/mg-badge2.js +3 -3
  25. package/dist/components/mg-button2.js +4 -4
  26. package/dist/components/mg-card2.js +2 -2
  27. package/dist/components/mg-details.js +2 -2
  28. package/dist/components/mg-form.js +3 -3
  29. package/dist/components/mg-icon2.js +2 -2
  30. package/dist/components/mg-illustrated-message.js +2 -2
  31. package/dist/components/mg-input-checkbox.js +4 -4
  32. package/dist/components/mg-input-date.js +11 -11
  33. package/dist/components/mg-input-numeric.js +5 -5
  34. package/dist/components/mg-input-password.js +3 -3
  35. package/dist/components/mg-input-radio.js +4 -4
  36. package/dist/components/mg-input-select2.js +6 -6
  37. package/dist/components/mg-input-text2.js +6 -6
  38. package/dist/components/mg-input-textarea.js +6 -6
  39. package/dist/components/mg-input-title2.js +2 -2
  40. package/dist/components/mg-input-toggle.js +4 -4
  41. package/dist/components/mg-input2.js +3 -3
  42. package/dist/components/mg-item-more2.js +26 -23
  43. package/dist/components/mg-item-more2.js.map +1 -1
  44. package/dist/components/mg-loader.js +2 -2
  45. package/dist/components/mg-menu-item2.js +8 -7
  46. package/dist/components/mg-menu-item2.js.map +1 -1
  47. package/dist/components/mg-message.js +3 -3
  48. package/dist/components/mg-modal.js +6 -6
  49. package/dist/components/mg-pagination2.js +2 -2
  50. package/dist/components/mg-panel.js +4 -4
  51. package/dist/components/mg-popover-content2.js +3 -3
  52. package/dist/components/mg-popover2.js +9 -5
  53. package/dist/components/mg-popover2.js.map +1 -1
  54. package/dist/components/mg-skip-links.js +2 -2
  55. package/dist/components/mg-tabs.js +6 -6
  56. package/dist/components/mg-tag.js +3 -3
  57. package/dist/components/mg-tooltip2.js +6 -6
  58. package/dist/esm/{index-8d5d1bfd.js → index-138ea119.js} +62 -22
  59. package/dist/esm/index-138ea119.js.map +1 -0
  60. package/dist/esm/index-c4faef56.js +1607 -0
  61. package/dist/esm/index-c4faef56.js.map +1 -0
  62. package/dist/esm/loader.js +2 -2
  63. package/dist/esm/mg-action-more_36.entry.js +123 -115
  64. package/dist/esm/mg-action-more_36.entry.js.map +1 -1
  65. package/dist/esm/mg-components.js +10 -10
  66. package/dist/esm/mg-components.js.map +1 -1
  67. package/dist/esm/mg-loader.entry.js +3 -3
  68. package/dist/mg-components/mg-components.esm.js +1 -1
  69. package/dist/mg-components/mg-components.esm.js.map +1 -1
  70. package/dist/mg-components/p-284c8327.entry.js +2 -0
  71. package/dist/mg-components/p-284c8327.entry.js.map +1 -0
  72. package/dist/mg-components/p-4c68f6ea.js +3 -0
  73. package/dist/mg-components/p-4c68f6ea.js.map +1 -0
  74. package/dist/mg-components/{p-99e2f42a.entry.js → p-bac6ca1f.entry.js} +2 -2
  75. package/dist/mg-components/p-e9433a87.js +2 -0
  76. package/dist/mg-components/p-e9433a87.js.map +1 -0
  77. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +1 -5
  78. package/ide/intellij/web-types.json +1 -1
  79. package/ide/vscode/html-custom-data.json +1 -1
  80. package/package.json +21 -21
  81. package/dist/cjs/index-00072168.js.map +0 -1
  82. package/dist/cjs/index-7e27c7ae.js +0 -2561
  83. package/dist/cjs/index-7e27c7ae.js.map +0 -1
  84. package/dist/esm/index-8d5d1bfd.js.map +0 -1
  85. package/dist/esm/index-e479d5ae.js +0 -2532
  86. package/dist/esm/index-e479d5ae.js.map +0 -1
  87. package/dist/mg-components/p-7315d4a6.js +0 -3
  88. package/dist/mg-components/p-7315d4a6.js.map +0 -1
  89. package/dist/mg-components/p-8800813b.js +0 -2
  90. package/dist/mg-components/p-8800813b.js.map +0 -1
  91. package/dist/mg-components/p-f9ac8927.entry.js +0 -2
  92. package/dist/mg-components/p-f9ac8927.entry.js.map +0 -1
  93. /package/dist/mg-components/{p-99e2f42a.entry.js.map → p-bac6ca1f.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { q as qe, w as we, O as Oe, N as Ne } from './index.es.js';
2
+ import { K as Ke, Q as Qe, B as Be, P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$5, H as Handler, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$6 } from './mg-icon2.js';
@@ -123,9 +123,9 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class MgInputNumeric e
123
123
  this.formatValue = (value) => {
124
124
  switch (this.format) {
125
125
  case 'number':
126
- return we(value, this.locale, this.type === 'decimal' ? this.decimalLength : undefined);
126
+ return Qe(value, this.locale, this.type === 'decimal' ? this.decimalLength : undefined);
127
127
  case 'currency':
128
- return qe(value, this.locale, this.currency);
128
+ return Ke(value, this.locale, this.currency);
129
129
  case 'none':
130
130
  return value.toString();
131
131
  }
@@ -162,7 +162,7 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class MgInputNumeric e
162
162
  this.decimalLength = 2;
163
163
  this.valid = undefined;
164
164
  this.invalid = undefined;
165
- this.classCollection = new Oe(['mg-c-input--numeric']);
165
+ this.classCollection = new Be(['mg-c-input--numeric']);
166
166
  this.errorMessage = undefined;
167
167
  this.hasFocus = undefined;
168
168
  }
@@ -258,7 +258,7 @@ const MgInputNumeric$1 = /*@__PURE__*/ proxyCustomElement(class MgInputNumeric e
258
258
  if (typeof valid !== 'boolean') {
259
259
  throw new Error('<mg-input-numeric> method "setError()" param "valid" must be a boolean');
260
260
  }
261
- else if (!Ne(errorMessage)) {
261
+ else if (!Pe(errorMessage)) {
262
262
  throw new Error('<mg-input-numeric> method "setError()" param "errorMessage" must be a string');
263
263
  }
264
264
  else {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { O as Oe, N as Ne } from './index.es.js';
2
+ import { B as Be, P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$5, H as Handler, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$7 } from './mg-button2.js';
@@ -85,7 +85,7 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class MgInputPassword
85
85
  this.helpText = undefined;
86
86
  this.valid = undefined;
87
87
  this.invalid = undefined;
88
- this.classCollection = new Oe(['mg-c-input--password']);
88
+ this.classCollection = new Be(['mg-c-input--password']);
89
89
  this.errorMessage = undefined;
90
90
  this.displayPassword = false;
91
91
  }
@@ -143,7 +143,7 @@ const MgInputPassword$1 = /*@__PURE__*/ proxyCustomElement(class MgInputPassword
143
143
  if (typeof valid !== 'boolean') {
144
144
  throw new Error('<mg-input-password> method "setError()" param "valid" must be a boolean');
145
145
  }
146
- else if (!Ne(errorMessage)) {
146
+ else if (!Pe(errorMessage)) {
147
147
  throw new Error('<mg-input-password> method "setError()" param "errorMessage" must be a string');
148
148
  }
149
149
  else {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { O as Oe, F as Fe, N as Ne } from './index.es.js';
2
+ import { B as Be, U as Ue, P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$5, H as Handler, c as classFieldset, b as classReadonly, e as classDisabled } from './mg-input2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$6 } from './mg-icon2.js';
@@ -94,7 +94,7 @@ const MgInputRadio$1 = /*@__PURE__*/ proxyCustomElement(class MgInputRadio exten
94
94
  this.helpText = undefined;
95
95
  this.valid = undefined;
96
96
  this.invalid = undefined;
97
- this.classCollection = new Oe(['mg-c-input--radio', classFieldset]);
97
+ this.classCollection = new Be(['mg-c-input--radio', classFieldset]);
98
98
  this.errorMessage = undefined;
99
99
  this.options = undefined;
100
100
  }
@@ -107,7 +107,7 @@ const MgInputRadio$1 = /*@__PURE__*/ proxyCustomElement(class MgInputRadio exten
107
107
  throw new Error('<mg-input-radio> prop "items" require at least 2 items.');
108
108
  }
109
109
  // String array
110
- else if (Fe(newValue)) {
110
+ else if (Ue(newValue)) {
111
111
  this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
112
112
  }
113
113
  // Object array
@@ -166,7 +166,7 @@ const MgInputRadio$1 = /*@__PURE__*/ proxyCustomElement(class MgInputRadio exten
166
166
  if (typeof valid !== 'boolean') {
167
167
  throw new Error('<mg-input-radio> method "setError()" param "valid" must be a boolean');
168
168
  }
169
- else if (!Ne(errorMessage)) {
169
+ else if (!Pe(errorMessage)) {
170
170
  throw new Error('<mg-input-radio> method "setError()" param "errorMessage" must be a string');
171
171
  }
172
172
  else {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { F as Fe, O as Oe, N as Ne } from './index.es.js';
2
+ import { U as Ue, B as Be, P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$4, H as Handler, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$5 } from './mg-icon2.js';
@@ -90,7 +90,7 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class MgInputSelect exten
90
90
  if (this.input.value === '') {
91
91
  this.setValue(null);
92
92
  }
93
- else if (Fe(this.items) && this.items.includes(this.input.value)) {
93
+ else if (Ue(this.items) && this.items.includes(this.input.value)) {
94
94
  this.setValue(this.input.value);
95
95
  }
96
96
  else if (allItemsAreOptions(this.items) && typeof this.input.value === 'string' && this.items.some(this.isInputValue)) {
@@ -164,7 +164,7 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class MgInputSelect exten
164
164
  this.helpText = undefined;
165
165
  this.valid = undefined;
166
166
  this.invalid = undefined;
167
- this.classCollection = new Oe(['mg-c-input--select']);
167
+ this.classCollection = new Be(['mg-c-input--select']);
168
168
  this.errorMessage = undefined;
169
169
  this.options = undefined;
170
170
  this.valueExist = undefined;
@@ -172,7 +172,7 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class MgInputSelect exten
172
172
  }
173
173
  validateValue(newValue) {
174
174
  var _a, _b;
175
- if (Fe(this.items) && typeof newValue === 'string') {
175
+ if (Ue(this.items) && typeof newValue === 'string') {
176
176
  this.readonlyValue = ((_a = this.input) === null || _a === void 0 ? void 0 : _a.value) ? this.input.value : newValue;
177
177
  }
178
178
  else if (allItemsAreOptions(this.items)) {
@@ -189,7 +189,7 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class MgInputSelect exten
189
189
  this.options = [];
190
190
  }
191
191
  // String array
192
- else if (Fe(newValue)) {
192
+ else if (Ue(newValue)) {
193
193
  if (typeof this.value === 'string')
194
194
  this.valueExist = newValue.includes(this.value);
195
195
  this.options = newValue.map(item => ({ title: item, value: item }));
@@ -261,7 +261,7 @@ const MgInputSelect = /*@__PURE__*/ proxyCustomElement(class MgInputSelect exten
261
261
  if (typeof valid !== 'boolean') {
262
262
  throw new Error('<mg-input-select> method "setError()" param "valid" must be a boolean');
263
263
  }
264
- else if (!Ne(errorMessage)) {
264
+ else if (!Pe(errorMessage)) {
265
265
  throw new Error('<mg-input-select> method "setError()" param "errorMessage" must be a string');
266
266
  }
267
267
  else {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { O as Oe, N as Ne } from './index.es.js';
2
+ import { B as Be, P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$4, H as Handler, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$6 } from './mg-character-left2.js';
@@ -51,7 +51,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
51
51
  */
52
52
  this.handleFocus = () => {
53
53
  this.classCollection.add(this.classFocus);
54
- this.classCollection = new Oe(this.classCollection.classes);
54
+ this.classCollection = new Be(this.classCollection.classes);
55
55
  };
56
56
  /**
57
57
  * Handle blur event
@@ -59,7 +59,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
59
59
  this.handleBlur = () => {
60
60
  // Manage focus
61
61
  this.classCollection.delete(this.classFocus);
62
- this.classCollection = new Oe(this.classCollection.classes);
62
+ this.classCollection = new Be(this.classCollection.classes);
63
63
  // Display Error
64
64
  this.handlerInProgress = Handler.BLUR;
65
65
  this.displayError().finally(() => {
@@ -134,7 +134,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
134
134
  this.helpText = undefined;
135
135
  this.valid = undefined;
136
136
  this.invalid = undefined;
137
- this.classCollection = new Oe(['mg-c-input--text']);
137
+ this.classCollection = new Be(['mg-c-input--text']);
138
138
  this.errorMessage = undefined;
139
139
  }
140
140
  handleValue(newValue) {
@@ -185,7 +185,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
185
185
  this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
186
186
  }
187
187
  validatePattern(newValue) {
188
- if (newValue !== undefined && !(Ne(this.pattern) && Ne(this.patternErrorMessage))) {
188
+ if (newValue !== undefined && !(Pe(this.pattern) && Pe(this.patternErrorMessage))) {
189
189
  throw new Error('<mg-input-text> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
190
190
  }
191
191
  }
@@ -215,7 +215,7 @@ const MgInputText = /*@__PURE__*/ proxyCustomElement(class MgInputText extends H
215
215
  if (typeof valid !== 'boolean') {
216
216
  throw new Error('<mg-input-text> method "setError()" param "valid" must be a boolean');
217
217
  }
218
- else if (!Ne(errorMessage)) {
218
+ else if (!Pe(errorMessage)) {
219
219
  throw new Error('<mg-input-text> method "setError()" param "errorMessage" must be a string');
220
220
  }
221
221
  else {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { O as Oe, N as Ne } from './index.es.js';
2
+ import { B as Be, P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$5, H as Handler, b as classReadonly, e as classDisabled, w as widths } from './mg-input2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$7 } from './mg-character-left2.js';
@@ -41,7 +41,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
41
41
  */
42
42
  this.handleFocus = () => {
43
43
  this.classCollection.add(this.classFocus);
44
- this.classCollection = new Oe(this.classCollection.classes);
44
+ this.classCollection = new Be(this.classCollection.classes);
45
45
  };
46
46
  /**
47
47
  * Handle blur event
@@ -49,7 +49,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
49
49
  this.handleBlur = () => {
50
50
  // Manage focus
51
51
  this.classCollection.delete(this.classFocus);
52
- this.classCollection = new Oe(this.classCollection.classes);
52
+ this.classCollection = new Be(this.classCollection.classes);
53
53
  // Display Error
54
54
  this.handlerInProgress = Handler.BLUR;
55
55
  this.displayError().finally(() => {
@@ -112,7 +112,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
112
112
  this.valid = undefined;
113
113
  this.invalid = undefined;
114
114
  this.resizable = 'none';
115
- this.classCollection = new Oe(['mg-c-input--textarea']);
115
+ this.classCollection = new Be(['mg-c-input--textarea']);
116
116
  this.errorMessage = undefined;
117
117
  }
118
118
  handleValue(newValue) {
@@ -151,7 +151,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
151
151
  this.classCollection.add(`mg-c-input--width-${this.mgWidth}`);
152
152
  }
153
153
  validatePattern(newValue) {
154
- if (newValue !== undefined && !(Ne(this.pattern) && Ne(this.patternErrorMessage))) {
154
+ if (newValue !== undefined && !(Pe(this.pattern) && Pe(this.patternErrorMessage))) {
155
155
  throw new Error('<mg-input-textarea> props "pattern" and "patternErrorMessage" must be non-empty string and paired.');
156
156
  }
157
157
  }
@@ -183,7 +183,7 @@ const MgInputTextarea$1 = /*@__PURE__*/ proxyCustomElement(class MgInputTextarea
183
183
  if (typeof valid !== 'boolean') {
184
184
  throw new Error('<mg-input-textarea> method "setError()" param "valid" must be a boolean');
185
185
  }
186
- else if (!Ne(errorMessage)) {
186
+ else if (!Pe(errorMessage)) {
187
187
  throw new Error('<mg-input-textarea> method "setError()" param "errorMessage" must be a string');
188
188
  }
189
189
  else {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { N as Ne } from './index.es.js';
2
+ import { P as Pe } from './index.es.js';
3
3
 
4
4
  const mgInputTitleCss = ".mg-u-form-legacy.sc-mg-input-title{--mg-form-inputs-title-width:calc(100% / 3 - 20px)}.mg-u-is-asterisk.sc-mg-input-title{color:hsl(var(--color-danger))}legend.mg-c-input-title.sc-mg-input-title{padding-right:0;padding-left:0}.mg-c-input-title__required.sc-mg-input-title{display:var(--mg-input-title-display, unset)}";
5
5
  const MgInputTitleStyle0 = mgInputTitleCss;
@@ -15,7 +15,7 @@ const MgInputTitle = /*@__PURE__*/ proxyCustomElement(class MgInputTitle extends
15
15
  this.tagName = 'label';
16
16
  }
17
17
  validateIdentifier(newValue) {
18
- if (!Ne(newValue)) {
18
+ if (!Pe(newValue)) {
19
19
  throw new Error('<mg-input-title> prop "identifier" is required.');
20
20
  }
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { O as Oe, F as Fe, N as Ne } from './index.es.js';
2
+ import { B as Be, U as Ue, P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$5, b as classReadonly, e as classDisabled } from './mg-input2.js';
4
4
  import { d as defineCustomElement$6 } from './mg-icon2.js';
5
5
  import { d as defineCustomElement$4 } from './mg-input-title2.js';
@@ -89,7 +89,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
89
89
  this.tooltip = undefined;
90
90
  this.tooltipPosition = 'input';
91
91
  this.helpText = undefined;
92
- this.classCollection = new Oe(['mg-c-input--toggle']);
92
+ this.classCollection = new Be(['mg-c-input--toggle']);
93
93
  this.options = undefined;
94
94
  this.errorMessage = undefined;
95
95
  this.valid = undefined;
@@ -106,7 +106,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
106
106
  throw new Error('<mg-input-toggle> prop "items" require 2 items.');
107
107
  }
108
108
  // String array
109
- else if (Fe(newValue)) {
109
+ else if (Ue(newValue)) {
110
110
  this.options = newValue.map(item => ({ title: item, value: item }));
111
111
  }
112
112
  // Object array
@@ -162,7 +162,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
162
162
  if (typeof valid !== 'boolean') {
163
163
  throw new Error('<mg-input-toggle> method "setError()" param "valid" must be a boolean');
164
164
  }
165
- else if (!Ne(errorMessage)) {
165
+ else if (!Pe(errorMessage)) {
166
166
  throw new Error('<mg-input-toggle> method "setError()" param "errorMessage" must be a string');
167
167
  }
168
168
  else {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { N as Ne } from './index.es.js';
2
+ import { P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$4 } from './mg-icon2.js';
4
4
  import { d as defineCustomElement$3 } from './mg-input-title2.js';
5
5
  import { d as defineCustomElement$2 } from './mg-tooltip2.js';
@@ -82,7 +82,7 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
82
82
  this.isVerticalList = false;
83
83
  }
84
84
  watchIdentifier(newValue) {
85
- if (!Ne(newValue)) {
85
+ if (!Pe(newValue)) {
86
86
  throw new Error('<mg-input> prop "identifier" is required.');
87
87
  }
88
88
  else {
@@ -167,7 +167,7 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
167
167
  */
168
168
  // eslint-disable-next-line @stencil-community/no-unused-watch
169
169
  watchLabel() {
170
- if (!Ne(this.label)) {
170
+ if (!Pe(this.label)) {
171
171
  throw new Error('<mg-input> prop "label" is required.');
172
172
  }
173
173
  else {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { N as Ne } from './index.es.js';
2
+ import { P as Pe } from './index.es.js';
3
3
  import { d as defineCustomElement$4, D as Direction, s as sizes } from './mg-menu-item2.js';
4
4
  import { i as initLocales } from './index2.js';
5
5
  import { d as defineCustomElement$8 } from './mg-badge2.js';
@@ -177,16 +177,11 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class MgMenu extends HTMLElement
177
177
  item.expanded = false;
178
178
  }
179
179
  };
180
- /**
181
- * get mg-item-more element
182
- * @returns mg-item-more element
183
- */
184
- this.getItemMore = () => this.element.querySelector('mg-item-more');
185
180
  /**
186
181
  * get mg-item-more child mg-menu-item element
187
182
  * @returns mg-menu-item element
188
183
  */
189
- 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'); };
184
+ this.getItemMoreMenuItem = () => { var _a, _b; return (_b = (_a = this.itemMoreElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('mg-menu-item'); };
190
185
  /**
191
186
  * Set item listend
192
187
  * @param item - mg-menu-item element
@@ -222,20 +217,25 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class MgMenu extends HTMLElement
222
217
  * render mg-item-more
223
218
  */
224
219
  this.renderMgItemMore = () => {
225
- if (this.direction !== Direction.HORIZONTAL || this.isChildMenu) {
220
+ if (this.direction !== Direction.HORIZONTAL || this.isChildMenu || this.element.children.length <= 1) {
226
221
  return;
227
222
  }
228
- // /!\ externalise item tag name to get a string type and bypass type checking when value is used in next createElement
229
- // by doing this we prevent stencil to generate a circular dependencies graph at build time with mg-item-more component.
230
- let mgItemMore = this.getItemMore();
231
- if (!mgItemMore) {
232
- mgItemMore = document.createElement('mg-item-more');
233
- mgItemMore.addEventListener('item-loaded', this.handleItemLoaded);
234
- Object.assign(mgItemMore, this.itemmore || {});
235
- this.element.appendChild(mgItemMore);
223
+ // Insert mg-item-more outside the mg-menu shadowdom
224
+ if (!this.itemMoreElement) {
225
+ this.itemMoreElement = document.createElement('mg-item-more');
226
+ this.itemMoreElement.addEventListener('item-loaded', this.handleItemLoaded);
227
+ this.element.appendChild(this.itemMoreElement);
236
228
  }
237
- else {
238
- Object.defineProperties(mgItemMore, this.itemmore || {});
229
+ // update mg-item-more props
230
+ for (const attribute in this.itemmore) {
231
+ const newValue = this.itemmore[attribute];
232
+ // to improve rendering we use HTML attributes as much as possible
233
+ if (['string', 'number'].includes(typeof newValue)) {
234
+ this.itemMoreElement.setAttribute(attribute, newValue);
235
+ }
236
+ else {
237
+ this.itemMoreElement[attribute] = newValue;
238
+ }
239
239
  }
240
240
  };
241
241
  this.label = undefined;
@@ -258,6 +258,9 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class MgMenu extends HTMLElement
258
258
  if (newValue !== undefined && this.direction !== Direction.HORIZONTAL) {
259
259
  throw new Error(`<${this.name}> prop "itemmore" must be paired with direction ${Direction.HORIZONTAL}.`);
260
260
  }
261
+ else if (newValue) {
262
+ this.renderMgItemMore();
263
+ }
261
264
  }
262
265
  validateSize(newValue) {
263
266
  if (!sizes.includes(newValue)) {
@@ -308,7 +311,7 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class MgMenu extends HTMLElement
308
311
  * @returns HTML Element
309
312
  */
310
313
  render() {
311
- return (h(Host, { key: 'a5fe4a1a61b4255cc9a06217f30ef2f154fd797d', role: "list", "aria-label": this.label }, h("slot", { key: '37de5388d1cca3fa46dfbb73ab26ba6e299940b5' })));
314
+ return (h(Host, { key: 'a29897d754b7cbb34cc8d63b5ecb025c0d252e12', role: "list", "aria-label": this.label }, h("slot", { key: '7fc9dbd765f529e17f0c7ca2012d1b6bf86a05d9' })));
312
315
  }
313
316
  get element() { return this; }
314
317
  static get watchers() { return {
@@ -426,7 +429,7 @@ const MgItemMore = /*@__PURE__*/ proxyCustomElement(class MgItemMore extends HTM
426
429
  navElement.click();
427
430
  });
428
431
  // add id suffix to prevent duplicate key. default html id is: '';
429
- if (Ne(proxy.id))
432
+ if (Pe(proxy.id))
430
433
  proxy.id = `${proxy.id}-proxy`;
431
434
  // update properties and DOM when proxyfied item is updated
432
435
  proxified.addEventListener('item-updated', (event) => {
@@ -456,7 +459,7 @@ const MgItemMore = /*@__PURE__*/ proxyCustomElement(class MgItemMore extends HTM
456
459
  this.slotlabel.label = this.messages.menuLabel;
457
460
  }
458
461
  validateSize(newValue) {
459
- if (newValue && typeof newValue !== 'string')
462
+ if (newValue && !sizes.includes(newValue))
460
463
  throw new Error(`<${this.name}> prop "size" must match MgItemMore['size'] type.`);
461
464
  }
462
465
  /*************
@@ -505,10 +508,10 @@ const MgItemMore = /*@__PURE__*/ proxyCustomElement(class MgItemMore extends HTM
505
508
  * @returns HTML Element
506
509
  */
507
510
  render() {
508
- return (h(Host, { key: '18e3ecec55a7078662bdb04ba6325a4d44ff1c78', role: "listitem" }, this.parentMenu && (h("mg-menu-item", { key: 'e04f4b62b1ce70eeae25f959ef6aeca2e4a2690d', "data-overflow-more": true, "data-size": this.parentMenu.size, ref: el => {
511
+ return (h(Host, { key: 'b490696ded183a1db05673b3e9ba9744ee134382', role: "listitem" }, this.parentMenu && (h("mg-menu-item", { key: '6f8b1967da50e77d87355cedde8aeb2327ddd0ab', "data-overflow-more": true, "data-size": this.parentMenu.size, ref: el => {
509
512
  if (el)
510
513
  this.moreElementMenuItem = el;
511
- } }, h("mg-icon", { key: '8f20ef688479578ebee9eabb63644837e1d45113', icon: this.icon.icon, slot: "image" }), h("span", { key: '7a4f08410d1e85682a8c3e1935525c418a4141de', class: { 'mg-u-visually-hidden': !this.slotlabel.display }, slot: "label" }, this.slotlabel.label), h("mg-menu", { key: 'f67f53d289cf65883a3534f17fb2baaa91314a66', direction: Direction.VERTICAL, label: this.messages.menuLabel, size: this.size })))));
514
+ } }, h("mg-icon", { key: 'ddcf120831d42bc6cb9b8e147abac9ba7cbeedb6', icon: this.icon.icon, size: this.size, slot: "image" }), h("span", { key: 'fae667ee2f6ac8f4d4f85c5a8db91dede3f470e6', class: { 'mg-u-visually-hidden': !this.slotlabel.display }, slot: "label" }, this.slotlabel.label), h("mg-menu", { key: '912d544f80b84b4cffa28517ffbc91d60792a460', direction: Direction.VERTICAL, label: this.messages.menuLabel, size: this.size })))));
512
515
  }
513
516
  get element() { return this; }
514
517
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"mg-item-more2.js","mappings":";;;;;;;;;;;AAAA;;;;;AAKA,MAAM,YAAY,GAAG,CAAC,OAAoB,KAAuC,OAAO,CAAC,QAAQ,KAAK,cAAc,CAAC;AAErH,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,mEAAuC,CAAA;IACvC,qEAAyC,CAAA;AAC3C,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC;MAEY,gBAAgB;IAO3B,YACU,OAAgB,EAChB,MAAyB;QADzB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAmB;;;;;;;QAqB5B,eAAU,GAAG;YAClB,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC,CAAC;;;;;;;;QAUM,QAAG,GAAG,CAAC,KAAc;YAC3B,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;;gBAEnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;;gBAGlC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC5D,IAAI,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;oBACnC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;iBACvG;;gBAGD,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK;oBACtC,KAAK,CAAC,YAAY,CAAC,wBAAwB,CAAC,UAAU,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;;oBAEpE,IAAI,CA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,IAAI,GAAY,CACtF,CAChB,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["isValidString"],"sources":["src/utils/behaviors.utils.ts","../styles/dist/components/mg-menu.css?tag=mg-menu&encapsulation=shadow","src/components/molecules/menu/mg-menu/mg-menu.tsx","../styles/dist/components/mg-item-more.css?tag=mg-item-more&encapsulation=shadow","src/components/molecules/mg-item-more/mg-item-more.tsx"],"sourcesContent":["/**\n * MgItemMore type guard\n * @param element - element to control type\n * @returns truthy if element is mg-item-more\n */\nconst isMgItemMore = (element: HTMLElement): element is HTMLMgItemMoreElement => element.nodeName === 'MG-ITEM-MORE';\n\nexport enum OverflowBehaviorElements {\n BASE_INDEX = 'data-overflow-base-index',\n PROXY_INDEX = 'data-overflow-proxy-index',\n}\n\nexport class OverflowBehavior {\n // variables\n private _resizeObserver: ResizeObserver;\n private _moreElement: HTMLElement;\n private _baseChildren: Element[];\n private _proxyChildren: Element[];\n\n constructor(\n private element: Element,\n private render: () => HTMLElement,\n ) {\n if (this._resizeObserver === undefined) {\n // add resize observer\n this._resizeObserver = new ResizeObserver(entries => {\n entries.forEach(entry => {\n this.run(entry.contentRect.width);\n });\n });\n this._resizeObserver.observe(this.element);\n }\n this.run();\n }\n\n /**********\n * Public *\n **********/\n\n /**\n * Disconnect ResizeObserver\n */\n public disconnect = (): void => {\n this._resizeObserver.disconnect();\n };\n\n /************\n * Internal *\n ************/\n\n /**\n * run overflow behavior\n * @param width - width of the container. Optional.\n */\n private run = (width?: number): void => {\n if (this._moreElement === undefined) {\n // set moreElement\n this._moreElement = this.render();\n\n // set children\n this._baseChildren = this.getInteractiveItems(this.element);\n if (isMgItemMore(this._moreElement)) {\n this._proxyChildren = this.getInteractiveItems(this._moreElement.shadowRoot.querySelector('mg-menu'));\n }\n\n // update children\n this._baseChildren.forEach((child, index) => {\n child.setAttribute(OverflowBehaviorElements.BASE_INDEX, `${index}`);\n // set moreElement children\n this._proxyChildren[index].setAttribute(OverflowBehaviorElements.PROXY_INDEX, `${index}`);\n });\n }\n\n if (width !== undefined) this.updateDisplayedItems(width);\n };\n\n /**\n * Get interactive children filtred by authorized nodeName ['MG-MENU-ITEM', 'MG-BUTTON']\n * @param element - element to parse\n * @returns children\n */\n private getInteractiveItems = (element: Element) =>\n (element.children?.length > 0 ? Array.from(element.children) : []).filter(element => ['MG-MENU-ITEM', 'MG-BUTTON'].includes(element.nodeName));\n\n /**\n * Update displayed items in container from a given available space\n * @param availableWidth - available width in container to display child items\n */\n private updateDisplayedItems = (availableWidth: number): void => {\n this.restoreItems();\n const acc = { accWidth: 0, previousItem: null };\n [...this._baseChildren, this._moreElement].forEach((child: HTMLMgMenuItemElement | HTMLMgItemMoreElement) => {\n acc.accWidth += child.offsetWidth;\n const hasPreviuosItem = acc.previousItem !== null;\n const isPreviousItemHidden = hasPreviuosItem && acc.previousItem.getAttribute('hidden') !== null;\n // if previous item is hidden AND is NOT more element we hidde current\n // OR if item has an overflow we hidde current\n // OR if current item is more element AND have NOT previous hidden items, current more element item is an hidden item\n // ELSE current is a display item\n this.toggleItem(\n child,\n (isPreviousItemHidden && !this.isMoreElement(child)) || this.isOverflowElement(acc.accWidth, child, availableWidth) || (this.isMoreElement(child) && !isPreviousItemHidden),\n );\n\n // update previous item with current item\n acc.previousItem = child;\n });\n };\n\n /**\n * Utility method to know if item overflow partialy or totaly in the container\n * @param cumulateWidth - previous sibling elements cumulate width + item width\n * @param item - item HTML element\n * @param availableWidth - container available width\n * @returns truthy if element is overflow\n */\n private isOverflowElement = (cumulateWidth: number, item: HTMLElement, availableWidth: number): boolean => {\n if (item.previousElementSibling === null || this.isMoreElement(item)) return false;\n else if (!this.isMoreElement(item.nextElementSibling)) return cumulateWidth + this._moreElement.offsetWidth > availableWidth;\n else return cumulateWidth > availableWidth;\n };\n\n /**\n * Utility method to know if a given element is the 'MORE' element\n * @param element - element to match with 'MORE' element\n * @returns truthy if element is the 'MORE' element\n */\n private isMoreElement = (element: Element): boolean => element.nodeName === 'MG-ITEM-MORE';\n\n /**\n * Toggle display item element\n * @param item - item to control\n * @param isHidden - is item hidden\n */\n private toggleItem = (item: HTMLElement, isHidden: boolean): void => {\n const mgActionMenuindex = Number(item.getAttribute(OverflowBehaviorElements.BASE_INDEX));\n if (this.isMoreElement(item)) this.toggleElement(this._moreElement, isHidden);\n else if (mgActionMenuindex >= 0) {\n this.toggleElement(item, isHidden);\n this.toggleElement(this._proxyChildren[mgActionMenuindex], !isHidden);\n }\n };\n\n /**\n * Toggle element's hidde attribute\n * @param element - element to toggle\n * @param isHidden - element is hidden\n */\n private toggleElement = (element: Element, isHidden: boolean): void => {\n if (isHidden) element.setAttribute('hidden', '');\n else element.removeAttribute('hidden');\n };\n\n /**\n * Remove hidden attributes on all items\n */\n private restoreItems = (): void => {\n [...this._baseChildren, this._moreElement].forEach(item => item.removeAttribute('hidden'));\n };\n}\n",".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{display:flex;background-color:hsl(var(--mg-menu-background-color-hsl, var(--color-light)))}:host([direction=vertical]){height:100%;flex-direction:column;overflow-y:auto}/*# sourceMappingURL=mg-menu.css.map */\n","import { Component, h, Prop, State, Element, Watch, Host } from '@stencil/core';\nimport { Direction, sizes } from './mg-menu.conf';\nimport type { MenuSizeType, ItemMoreType } from './mg-menu.conf';\n\n/**\n * @slot - Menu content\n */\n@Component({\n tag: 'mg-menu',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-menu.css',\n shadow: true,\n})\nexport class MgMenu {\n /************\n * Internal *\n ************/\n\n private readonly name = 'mg-menu';\n private menuItems: HTMLMgMenuItemElement[] = [];\n private focusedMenuItem = 0;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMenuElement;\n\n /**\n * Menu label. Include short menu description.\n * Required for accessibility\n */\n @Prop() label!: string;\n @Watch('label')\n validateLabel(newValue: MgMenu['label']): void {\n if (newValue === undefined) {\n throw new Error(`<${this.name}> prop \"label\" is required.`);\n }\n }\n\n /**\n * Component display direction.\n */\n @Prop({ reflect: true }) direction: Direction = Direction.HORIZONTAL;\n @Watch('direction')\n validateDirection(newValue: MgMenu['direction']): void {\n if (![Direction.VERTICAL, Direction.HORIZONTAL].includes(newValue)) {\n throw new Error(`<${this.name}> prop \"direction\" must be one of: ${Direction.HORIZONTAL}, ${Direction.VERTICAL}.`);\n }\n }\n\n /**\n * Customize \"mg-item-more\" element\n * Used with direction: 'vertical' to manage overflow\n */\n @Prop() itemmore?: ItemMoreType;\n @Watch('itemmore')\n validateItemMore(newValue: MgMenu['itemmore']): void {\n if (newValue !== undefined && this.direction !== Direction.HORIZONTAL) {\n throw new Error(`<${this.name}> prop \"itemmore\" must be paired with direction ${Direction.HORIZONTAL}.`);\n }\n }\n\n /**\n * Define mg-menu size\n */\n @Prop() size: MenuSizeType = 'regular';\n @Watch('size')\n validateSize(newValue: MgMenu['size']): void {\n if (!sizes.includes(newValue)) {\n throw new Error(`<${this.name}> prop \"size\" must be one of: ${sizes.join(', ')}.`);\n }\n }\n\n /**\n * is this menu a child menu. Used for conditional render.\n */\n @State() isChildMenu: boolean;\n\n /*************\n * Methods *\n *************/\n\n /**\n * Close matching menu-item\n * @param item - menu-item to close\n * @param condition - addionnal condition\n */\n private closeMenuItem = (item: HTMLMgMenuItemElement, condition: boolean): void => {\n if (!this.isChildMenu && condition) {\n item.expanded = false;\n }\n };\n\n /**\n * get mg-item-more element\n * @returns mg-item-more element\n */\n private getItemMore = (): HTMLMgItemMoreElement => this.element.querySelector('mg-item-more');\n\n /**\n * get mg-item-more child mg-menu-item element\n * @returns mg-menu-item element\n */\n private getItemMoreMenuItem = (): HTMLMgMenuItemElement => this.getItemMore()?.shadowRoot?.querySelector('mg-menu-item');\n\n /**\n * Set item listend\n * @param item - mg-menu-item element\n * @param index - number\n */\n private setItemListener = (item: HTMLMgMenuItemElement, index: MgMenu['focusedMenuItem']): void => {\n ['click', 'focus'].forEach(trigger => {\n item.shadowRoot.querySelector('button,a').addEventListener(trigger, () => {\n this.focusedMenuItem = index;\n // reset expanded on previous active menu item\n (this.getItemMoreMenuItem() ? [...this.menuItems, this.getItemMoreMenuItem()] : this.menuItems).forEach((item, index) => {\n this.closeMenuItem(item, index !== this.focusedMenuItem);\n });\n });\n });\n };\n\n /**\n * Store menu-items on component init and add listeners\n */\n private initMenuItemsListeners = (): void => {\n // add listeners on menu item and edit index\n this.menuItems.forEach((item, index) => {\n this.setItemListener(item, index);\n });\n };\n\n /**\n * Handle item-loaded event on mg-item-more element\n */\n private handleItemLoaded = (): void => {\n this.setItemListener(this.getItemMoreMenuItem(), this.menuItems.length);\n };\n\n /**\n * render mg-item-more\n */\n private renderMgItemMore = (): void => {\n if (this.direction !== Direction.HORIZONTAL || this.isChildMenu) {\n return;\n }\n\n // /!\\ externalise item tag name to get a string type and bypass type checking when value is used in next createElement\n // by doing this we prevent stencil to generate a circular dependencies graph at build time with mg-item-more component.\n let mgItemMore = this.getItemMore();\n if (!mgItemMore) {\n mgItemMore = document.createElement('mg-item-more');\n mgItemMore.addEventListener('item-loaded', this.handleItemLoaded);\n Object.assign(mgItemMore, this.itemmore || {});\n this.element.appendChild(mgItemMore);\n } else {\n Object.defineProperties(mgItemMore, this.itemmore || {});\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n this.validateDirection(this.direction);\n this.validateLabel(this.label);\n this.validateItemMore(this.itemmore);\n this.validateSize(this.size);\n }\n\n /**\n * Check if component slots configuration\n * @returns timeout\n */\n componentDidLoad(): ReturnType<typeof setTimeout> {\n // update props and states after componentDidLoad hook\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n // store all menu-items\n this.menuItems = Array.from(this.element.children).filter(child => child.nodeName === 'MG-MENU-ITEM') as HTMLMgMenuItemElement[];\n this.isChildMenu = this.element.closest('mg-menu-item') !== null;\n\n // add mg-item-more to manage OverflowBehavior\n // when all props, states and DOM are already rendered we can render the mg-item-more\n this.renderMgItemMore();\n // then use mutation observer on children to improve reactivity\n new MutationObserver(() => {\n this.renderMgItemMore();\n }).observe(this.element, { childList: true });\n });\n }\n\n /**\n * Add listeners to items\n */\n componentDidRender(): void {\n this.initMenuItemsListeners();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role=\"list\" aria-label={this.label}>\n <slot></slot>\n </Host>\n );\n }\n}\n",".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host:not([hidden]){display:flex}/*# sourceMappingURL=mg-item-more.css.map */\n","import { Component, h, Prop, Element, Host, Watch, State } from '@stencil/core';\nimport { isValidString } from '@mgdis/stencil-helpers';\nimport { Direction } from '../menu/mg-menu/mg-menu.conf';\nimport { OverflowBehavior } from '../../../utils/behaviors.utils';\nimport { initLocales } from '../../../locales';\nimport type { IconType, SizeType, SlotLabelType } from './mg-item-more.conf';\nimport type { MessageType } from '../../../locales/index.conf';\n\n@Component({\n tag: 'mg-item-more',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-item-more.css',\n shadow: true,\n})\nexport class MgItemMore {\n /************\n * Internal *\n ************/\n private readonly name = 'mg-item-more';\n private messages: MessageType;\n private parentMenuItems: HTMLMgMenuItemElement[];\n private moreElementMenuItem: HTMLMgMenuItemElement;\n private overflowBehavior: OverflowBehavior;\n private canRenderMgMenuItemOverflowElement = true;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgItemMoreElement;\n\n /**\n * Define icon\n */\n @Prop() icon?: IconType = { icon: 'ellipsis-vertical' };\n @Watch('icon')\n validateIcon(newValue: MgItemMore['icon']): void {\n if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.icon !== 'string'))\n throw new Error(`<${this.name}> prop \"icon\" must match MgItemMore['icon'] type.`);\n }\n\n /**\n * Define slot label element\n */\n @Prop() slotlabel?: SlotLabelType = { display: false };\n @Watch('slotlabel')\n validateSlotLabel(newValue: MgItemMore['slotlabel']): void {\n if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.display !== 'boolean'))\n throw new Error(`<${this.name}> prop \"slotlabel\" must match MgItemMore['slotlabel'] type.`);\n else if (typeof newValue.label !== 'string') this.slotlabel.label = this.messages.menuLabel;\n }\n\n /**\n * Define component child menu size.\n */\n @Prop() size?: SizeType;\n @Watch('size')\n validateSize(newValue: MgItemMore['size']): void {\n if (newValue && typeof newValue !== 'string') throw new Error(`<${this.name}> prop \"size\" must match MgItemMore['size'] type.`);\n }\n\n /**\n * Define component parent menu.\n */\n @State() parentMenu: HTMLMgMenuElement;\n\n /***********\n * Methods *\n ***********/\n\n /**\n * render mg-item-more overflow element\n * @returns mg-item-more element\n */\n private renderMgMenuItemOverflowElement = (): HTMLMgItemMoreElement => {\n // create menu items proxy element from item clones\n this.parentMenuItems.forEach((child: HTMLMgMenuItemElement) => {\n this.moreElementMenuItem.querySelector('mg-menu').appendChild(child.cloneNode(true));\n });\n\n const allMenuItem = Array.from(this.parentMenu.querySelectorAll('mg-menu-item:not([data-overflow-more])'));\n\n Array.from(this.moreElementMenuItem.querySelectorAll('mg-menu-item:not([data-overflow-more])')).forEach((proxy, index) => {\n const proxified = allMenuItem[index];\n // manage click on proxy to mirror it on initial element\n proxy.addEventListener('click', () => {\n // be carefull to use element.click() method instead of dispatchEvent to ensure bubbles outside shadowDom\n const navElement = allMenuItem[index].shadowRoot.querySelector('a, button');\n if (navElement instanceof HTMLButtonElement || navElement instanceof HTMLAnchorElement) navElement.click();\n });\n\n // add id suffix to prevent duplicate key. default html id is: '';\n if (isValidString(proxy.id)) proxy.id = `${proxy.id}-proxy`;\n\n // update properties and DOM when proxyfied item is updated\n proxified.addEventListener('item-updated', (event: CustomEvent & { target: HTMLElement }) => {\n Object.assign(proxy, event.target);\n proxy.innerHTML = event.target.innerHTML;\n });\n\n // manage status change miror in proxyfied element\n proxified.addEventListener('status-change', (event: CustomEvent) => {\n proxy.setAttribute('status', event.detail);\n });\n });\n\n return this.element;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Set variables and validate props\n */\n componentWillLoad(): void {\n // init variables\n this.messages = initLocales(this.element).messages.itemMore as MessageType;\n\n // validate props\n this.validateIcon(this.icon);\n this.validateSlotLabel(this.slotlabel);\n this.validateSize(this.size);\n }\n\n /**\n * Ensure parent DOM is fully rendered with timeout method before parse elements\n * @returns timeout\n */\n componentDidLoad(): ReturnType<typeof setTimeout> {\n // ensure parent menu is fully rendered\n return setTimeout(() => {\n this.parentMenu = this.element.closest('mg-menu');\n });\n }\n\n /**\n * Set OverflowBehavior when parentMenu state is upate AND defined\n */\n componentDidUpdate(): void {\n if (this.parentMenu && this.canRenderMgMenuItemOverflowElement) {\n this.parentMenuItems = Array.from(this.parentMenu.children).filter(item => item.nodeName === 'MG-MENU-ITEM') as HTMLMgMenuItemElement[];\n this.overflowBehavior = new OverflowBehavior(this.parentMenu, this.renderMgMenuItemOverflowElement);\n this.canRenderMgMenuItemOverflowElement = false;\n }\n }\n\n /**\n * Disconnect overflow ResizeObserver\n */\n disconnectedCallback(): void {\n this.overflowBehavior?.disconnect();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role=\"listitem\">\n {this.parentMenu && (\n <mg-menu-item\n data-overflow-more\n data-size={this.parentMenu.size}\n ref={el => {\n if (el) this.moreElementMenuItem = el;\n }}\n >\n <mg-icon icon={this.icon.icon} slot=\"image\"></mg-icon>\n <span class={{ 'mg-u-visually-hidden': !this.slotlabel.display }} slot=\"label\">\n {this.slotlabel.label}\n </span>\n <mg-menu direction={Direction.VERTICAL} label={this.messages.menuLabel} size={this.size}></mg-menu>\n </mg-menu-item>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-item-more2.js","mappings":";;;;;;;;;;;AAAA;;;;;AAKA,MAAM,YAAY,GAAG,CAAC,OAAoB,KAAuC,OAAO,CAAC,QAAQ,KAAK,cAAc,CAAC;AAErH,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,mEAAuC,CAAA;IACvC,qEAAyC,CAAA;AAC3C,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC;MAEY,gBAAgB;IAO3B,YACU,OAAgB,EAChB,MAAyB;QADzB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAmB;;;;;;;QAqB5B,eAAU,GAAG;YAClB,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC,CAAC;;;;;;;;QAUM,QAAG,GAAG,CAAC,KAAc;YAC3B,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;;gBAEnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;;gBAGlC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC5D,IAAI,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;oBACnC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;iBACvG;;gBAGD,IAAI,CA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IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;aACvC,IAED,gEAAS,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAC,OAAO,GAAW,EACvE,6DAAM,KAAK,EAAE,EAAE,sBAAsB,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,IAAI,EAAC,OAAO,IAC3E,IAAI,CAAC,SAAS,CAAC,KAAK,CAChB,EACP,gEAAS,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAY,CACtF,CAChB,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["isValidString"],"sources":["src/utils/behaviors.utils.ts","../styles/dist/components/mg-menu.css?tag=mg-menu&encapsulation=shadow","src/components/molecules/menu/mg-menu/mg-menu.tsx","../styles/dist/components/mg-item-more.css?tag=mg-item-more&encapsulation=shadow","src/components/molecules/mg-item-more/mg-item-more.tsx"],"sourcesContent":["/**\n * MgItemMore type guard\n * @param element - element to control type\n * @returns truthy if element is mg-item-more\n */\nconst isMgItemMore = (element: HTMLElement): element is HTMLMgItemMoreElement => element.nodeName === 'MG-ITEM-MORE';\n\nexport enum OverflowBehaviorElements {\n BASE_INDEX = 'data-overflow-base-index',\n PROXY_INDEX = 'data-overflow-proxy-index',\n}\n\nexport class OverflowBehavior {\n // variables\n private _resizeObserver: ResizeObserver;\n private _moreElement: HTMLElement;\n private _baseChildren: Element[];\n private _proxyChildren: Element[];\n\n constructor(\n private element: Element,\n private render: () => HTMLElement,\n ) {\n if (this._resizeObserver === undefined) {\n // add resize observer\n this._resizeObserver = new ResizeObserver(entries => {\n entries.forEach(entry => {\n this.run(entry.contentRect.width);\n });\n });\n this._resizeObserver.observe(this.element);\n }\n this.run();\n }\n\n /**********\n * Public *\n **********/\n\n /**\n * Disconnect ResizeObserver\n */\n public disconnect = (): void => {\n this._resizeObserver.disconnect();\n };\n\n /************\n * Internal *\n ************/\n\n /**\n * run overflow behavior\n * @param width - width of the container. Optional.\n */\n private run = (width?: number): void => {\n if (this._moreElement === undefined) {\n // set moreElement\n this._moreElement = this.render();\n\n // set children\n this._baseChildren = this.getInteractiveItems(this.element);\n if (isMgItemMore(this._moreElement)) {\n this._proxyChildren = this.getInteractiveItems(this._moreElement.shadowRoot.querySelector('mg-menu'));\n }\n\n // update children\n this._baseChildren.forEach((child, index) => {\n child.setAttribute(OverflowBehaviorElements.BASE_INDEX, `${index}`);\n // set moreElement children\n this._proxyChildren[index].setAttribute(OverflowBehaviorElements.PROXY_INDEX, `${index}`);\n });\n }\n\n if (width !== undefined) this.updateDisplayedItems(width);\n };\n\n /**\n * Get interactive children filtred by authorized nodeName ['MG-MENU-ITEM', 'MG-BUTTON']\n * @param element - element to parse\n * @returns children\n */\n private getInteractiveItems = (element: Element) =>\n (element.children?.length > 0 ? Array.from(element.children) : []).filter(element => ['MG-MENU-ITEM', 'MG-BUTTON'].includes(element.nodeName));\n\n /**\n * Update displayed items in container from a given available space\n * @param availableWidth - available width in container to display child items\n */\n private updateDisplayedItems = (availableWidth: number): void => {\n this.restoreItems();\n const acc = { accWidth: 0, previousItem: null };\n [...this._baseChildren, this._moreElement].forEach((child: HTMLMgMenuItemElement | HTMLMgItemMoreElement) => {\n acc.accWidth += child.offsetWidth;\n const hasPreviuosItem = acc.previousItem !== null;\n const isPreviousItemHidden = hasPreviuosItem && acc.previousItem.getAttribute('hidden') !== null;\n // if previous item is hidden AND is NOT more element we hidde current\n // OR if item has an overflow we hidde current\n // OR if current item is more element AND have NOT previous hidden items, current more element item is an hidden item\n // ELSE current is a display item\n this.toggleItem(\n child,\n (isPreviousItemHidden && !this.isMoreElement(child)) || this.isOverflowElement(acc.accWidth, child, availableWidth) || (this.isMoreElement(child) && !isPreviousItemHidden),\n );\n\n // update previous item with current item\n acc.previousItem = child;\n });\n };\n\n /**\n * Utility method to know if item overflow partialy or totaly in the container\n * @param cumulateWidth - previous sibling elements cumulate width + item width\n * @param item - item HTML element\n * @param availableWidth - container available width\n * @returns truthy if element is overflow\n */\n private isOverflowElement = (cumulateWidth: number, item: HTMLElement, availableWidth: number): boolean => {\n if (item.previousElementSibling === null || this.isMoreElement(item)) return false;\n else if (!this.isMoreElement(item.nextElementSibling)) return cumulateWidth + this._moreElement.offsetWidth > availableWidth;\n else return cumulateWidth > availableWidth;\n };\n\n /**\n * Utility method to know if a given element is the 'MORE' element\n * @param element - element to match with 'MORE' element\n * @returns truthy if element is the 'MORE' element\n */\n private isMoreElement = (element: Element): boolean => element.nodeName === 'MG-ITEM-MORE';\n\n /**\n * Toggle display item element\n * @param item - item to control\n * @param isHidden - is item hidden\n */\n private toggleItem = (item: HTMLElement, isHidden: boolean): void => {\n const mgActionMenuindex = Number(item.getAttribute(OverflowBehaviorElements.BASE_INDEX));\n if (this.isMoreElement(item)) this.toggleElement(this._moreElement, isHidden);\n else if (mgActionMenuindex >= 0) {\n this.toggleElement(item, isHidden);\n this.toggleElement(this._proxyChildren[mgActionMenuindex], !isHidden);\n }\n };\n\n /**\n * Toggle element's hidde attribute\n * @param element - element to toggle\n * @param isHidden - element is hidden\n */\n private toggleElement = (element: Element, isHidden: boolean): void => {\n if (isHidden) element.setAttribute('hidden', '');\n else element.removeAttribute('hidden');\n };\n\n /**\n * Remove hidden attributes on all items\n */\n private restoreItems = (): void => {\n [...this._baseChildren, this._moreElement].forEach(item => item.removeAttribute('hidden'));\n };\n}\n",".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{display:flex;background-color:hsl(var(--mg-menu-background-color-hsl, var(--color-light)))}:host([direction=vertical]){height:100%;flex-direction:column;overflow-y:auto}/*# sourceMappingURL=mg-menu.css.map */\n","import { Component, h, Prop, State, Element, Watch, Host } from '@stencil/core';\nimport { Direction, sizes } from './mg-menu.conf';\nimport type { MenuSizeType, ItemMoreType } from './mg-menu.conf';\n\n/**\n * @slot - Menu content\n */\n@Component({\n tag: 'mg-menu',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-menu.css',\n shadow: true,\n})\nexport class MgMenu {\n /************\n * Internal *\n ************/\n\n private readonly name = 'mg-menu';\n private menuItems: HTMLMgMenuItemElement[] = [];\n private focusedMenuItem = 0;\n private itemMoreElement: HTMLMgItemMoreElement;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMenuElement;\n\n /**\n * Menu label. Include short menu description.\n * Required for accessibility\n */\n @Prop() label!: string;\n @Watch('label')\n validateLabel(newValue: MgMenu['label']): void {\n if (newValue === undefined) {\n throw new Error(`<${this.name}> prop \"label\" is required.`);\n }\n }\n\n /**\n * Component display direction.\n */\n @Prop({ reflect: true }) direction: Direction = Direction.HORIZONTAL;\n @Watch('direction')\n validateDirection(newValue: MgMenu['direction']): void {\n if (![Direction.VERTICAL, Direction.HORIZONTAL].includes(newValue)) {\n throw new Error(`<${this.name}> prop \"direction\" must be one of: ${Direction.HORIZONTAL}, ${Direction.VERTICAL}.`);\n }\n }\n\n /**\n * Customize \"mg-item-more\" element\n * Used with direction: 'vertical' to manage overflow\n */\n @Prop() itemmore?: ItemMoreType;\n @Watch('itemmore')\n validateItemMore(newValue: MgMenu['itemmore']): void {\n if (newValue !== undefined && this.direction !== Direction.HORIZONTAL) {\n throw new Error(`<${this.name}> prop \"itemmore\" must be paired with direction ${Direction.HORIZONTAL}.`);\n } else if (newValue) {\n this.renderMgItemMore();\n }\n }\n\n /**\n * Define mg-menu size\n */\n @Prop() size: MenuSizeType = 'regular';\n @Watch('size')\n validateSize(newValue: MgMenu['size']): void {\n if (!sizes.includes(newValue)) {\n throw new Error(`<${this.name}> prop \"size\" must be one of: ${sizes.join(', ')}.`);\n }\n }\n\n /**\n * is this menu a child menu. Used for conditional render.\n */\n @State() isChildMenu: boolean;\n\n /*************\n * Methods *\n *************/\n\n /**\n * Close matching menu-item\n * @param item - menu-item to close\n * @param condition - addionnal condition\n */\n private closeMenuItem = (item: HTMLMgMenuItemElement, condition: boolean): void => {\n if (!this.isChildMenu && condition) {\n item.expanded = false;\n }\n };\n\n /**\n * get mg-item-more child mg-menu-item element\n * @returns mg-menu-item element\n */\n private getItemMoreMenuItem = (): HTMLMgMenuItemElement => this.itemMoreElement?.shadowRoot?.querySelector('mg-menu-item');\n\n /**\n * Set item listend\n * @param item - mg-menu-item element\n * @param index - number\n */\n private setItemListener = (item: HTMLMgMenuItemElement, index: MgMenu['focusedMenuItem']): void => {\n ['click', 'focus'].forEach(trigger => {\n item.shadowRoot.querySelector('button,a').addEventListener(trigger, () => {\n this.focusedMenuItem = index;\n // reset expanded on previous active menu item\n (this.getItemMoreMenuItem() ? [...this.menuItems, this.getItemMoreMenuItem()] : this.menuItems).forEach((item, index) => {\n this.closeMenuItem(item, index !== this.focusedMenuItem);\n });\n });\n });\n };\n\n /**\n * Store menu-items on component init and add listeners\n */\n private initMenuItemsListeners = (): void => {\n // add listeners on menu item and edit index\n this.menuItems.forEach((item, index) => {\n this.setItemListener(item, index);\n });\n };\n\n /**\n * Handle item-loaded event on mg-item-more element\n */\n private handleItemLoaded = (): void => {\n this.setItemListener(this.getItemMoreMenuItem(), this.menuItems.length);\n };\n\n /**\n * render mg-item-more\n */\n private renderMgItemMore = (): void => {\n if (this.direction !== Direction.HORIZONTAL || this.isChildMenu || this.element.children.length <= 1) {\n return;\n }\n\n // Insert mg-item-more outside the mg-menu shadowdom\n if (!this.itemMoreElement) {\n this.itemMoreElement = document.createElement('mg-item-more');\n this.itemMoreElement.addEventListener('item-loaded', this.handleItemLoaded);\n this.element.appendChild(this.itemMoreElement);\n }\n\n // update mg-item-more props\n for (const attribute in this.itemmore) {\n const newValue = this.itemmore[attribute];\n // to improve rendering we use HTML attributes as much as possible\n if (['string', 'number'].includes(typeof newValue)) {\n this.itemMoreElement.setAttribute(attribute, newValue);\n } else {\n this.itemMoreElement[attribute] = newValue;\n }\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Validate props\n */\n componentWillLoad(): void {\n this.validateDirection(this.direction);\n this.validateLabel(this.label);\n this.validateItemMore(this.itemmore);\n this.validateSize(this.size);\n }\n\n /**\n * Check if component slots configuration\n * @returns timeout\n */\n componentDidLoad(): ReturnType<typeof setTimeout> {\n // update props and states after componentDidLoad hook\n // return a promise to process action only in the FIRST render().\n // https://stenciljs.com/docs/component-lifecycle#componentwillload\n return setTimeout(() => {\n // store all menu-items\n this.menuItems = Array.from(this.element.children).filter(child => child.nodeName === 'MG-MENU-ITEM') as HTMLMgMenuItemElement[];\n this.isChildMenu = this.element.closest('mg-menu-item') !== null;\n\n // add mg-item-more to manage OverflowBehavior\n // when all props, states and DOM are already rendered we can render the mg-item-more\n this.renderMgItemMore();\n // then use mutation observer on children to improve reactivity\n new MutationObserver(() => {\n this.renderMgItemMore();\n }).observe(this.element, { childList: true });\n });\n }\n\n /**\n * Add listeners to items\n */\n componentDidRender(): void {\n this.initMenuItemsListeners();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role=\"list\" aria-label={this.label}>\n <slot></slot>\n </Host>\n );\n }\n}\n",".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host:not([hidden]){display:flex}/*# sourceMappingURL=mg-item-more.css.map */\n","import { Component, h, Prop, Element, Host, Watch, State } from '@stencil/core';\nimport { isValidString } from '@mgdis/stencil-helpers';\nimport { Direction, sizes } from '../menu/mg-menu/mg-menu.conf';\nimport { OverflowBehavior } from '../../../utils/behaviors.utils';\nimport { initLocales } from '../../../locales';\nimport type { IconType, SizeType, SlotLabelType } from './mg-item-more.conf';\nimport type { MessageType } from '../../../locales/index.conf';\n\n@Component({\n tag: 'mg-item-more',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-item-more.css',\n shadow: true,\n})\nexport class MgItemMore {\n /************\n * Internal *\n ************/\n private readonly name = 'mg-item-more';\n private messages: MessageType;\n private parentMenuItems: HTMLMgMenuItemElement[];\n private moreElementMenuItem: HTMLMgMenuItemElement;\n private overflowBehavior: OverflowBehavior;\n private canRenderMgMenuItemOverflowElement = true;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgItemMoreElement;\n\n /**\n * Define icon\n */\n @Prop() icon?: IconType = { icon: 'ellipsis-vertical' };\n @Watch('icon')\n validateIcon(newValue: MgItemMore['icon']): void {\n if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.icon !== 'string'))\n throw new Error(`<${this.name}> prop \"icon\" must match MgItemMore['icon'] type.`);\n }\n\n /**\n * Define slot label element\n */\n @Prop() slotlabel?: SlotLabelType = { display: false };\n @Watch('slotlabel')\n validateSlotLabel(newValue: MgItemMore['slotlabel']): void {\n if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.display !== 'boolean'))\n throw new Error(`<${this.name}> prop \"slotlabel\" must match MgItemMore['slotlabel'] type.`);\n else if (typeof newValue.label !== 'string') this.slotlabel.label = this.messages.menuLabel;\n }\n\n /**\n * Define component child menu size.\n */\n @Prop() size?: SizeType;\n @Watch('size')\n validateSize(newValue: MgItemMore['size']): void {\n if (newValue && !sizes.includes(newValue)) throw new Error(`<${this.name}> prop \"size\" must match MgItemMore['size'] type.`);\n }\n\n /**\n * Define component parent menu.\n */\n @State() parentMenu: HTMLMgMenuElement;\n\n /***********\n * Methods *\n ***********/\n\n /**\n * render mg-item-more overflow element\n * @returns mg-item-more element\n */\n private renderMgMenuItemOverflowElement = (): HTMLMgItemMoreElement => {\n // create menu items proxy element from item clones\n this.parentMenuItems.forEach((child: HTMLMgMenuItemElement) => {\n this.moreElementMenuItem.querySelector('mg-menu').appendChild(child.cloneNode(true));\n });\n\n const allMenuItem = Array.from(this.parentMenu.querySelectorAll('mg-menu-item:not([data-overflow-more])'));\n\n Array.from(this.moreElementMenuItem.querySelectorAll('mg-menu-item:not([data-overflow-more])')).forEach((proxy, index) => {\n const proxified = allMenuItem[index];\n // manage click on proxy to mirror it on initial element\n proxy.addEventListener('click', () => {\n // be carefull to use element.click() method instead of dispatchEvent to ensure bubbles outside shadowDom\n const navElement = allMenuItem[index].shadowRoot.querySelector('a, button');\n if (navElement instanceof HTMLButtonElement || navElement instanceof HTMLAnchorElement) navElement.click();\n });\n\n // add id suffix to prevent duplicate key. default html id is: '';\n if (isValidString(proxy.id)) proxy.id = `${proxy.id}-proxy`;\n\n // update properties and DOM when proxyfied item is updated\n proxified.addEventListener('item-updated', (event: CustomEvent & { target: HTMLElement }) => {\n Object.assign(proxy, event.target);\n proxy.innerHTML = event.target.innerHTML;\n });\n\n // manage status change miror in proxyfied element\n proxified.addEventListener('status-change', (event: CustomEvent) => {\n proxy.setAttribute('status', event.detail);\n });\n });\n\n return this.element;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Set variables and validate props\n */\n componentWillLoad(): void {\n // init variables\n this.messages = initLocales(this.element).messages.itemMore as MessageType;\n\n // validate props\n this.validateIcon(this.icon);\n this.validateSlotLabel(this.slotlabel);\n this.validateSize(this.size);\n }\n\n /**\n * Ensure parent DOM is fully rendered with timeout method before parse elements\n * @returns timeout\n */\n componentDidLoad(): ReturnType<typeof setTimeout> {\n // ensure parent menu is fully rendered\n return setTimeout(() => {\n this.parentMenu = this.element.closest('mg-menu');\n });\n }\n\n /**\n * Set OverflowBehavior when parentMenu state is upate AND defined\n */\n componentDidUpdate(): void {\n if (this.parentMenu && this.canRenderMgMenuItemOverflowElement) {\n this.parentMenuItems = Array.from(this.parentMenu.children).filter(item => item.nodeName === 'MG-MENU-ITEM') as HTMLMgMenuItemElement[];\n this.overflowBehavior = new OverflowBehavior(this.parentMenu, this.renderMgMenuItemOverflowElement);\n this.canRenderMgMenuItemOverflowElement = false;\n }\n }\n\n /**\n * Disconnect overflow ResizeObserver\n */\n disconnectedCallback(): void {\n this.overflowBehavior?.disconnect();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role=\"listitem\">\n {this.parentMenu && (\n <mg-menu-item\n data-overflow-more\n data-size={this.parentMenu.size}\n ref={el => {\n if (el) this.moreElementMenuItem = el;\n }}\n >\n <mg-icon icon={this.icon.icon} size={this.size} slot=\"image\"></mg-icon>\n <span class={{ 'mg-u-visually-hidden': !this.slotlabel.display }} slot=\"label\">\n {this.slotlabel.label}\n </span>\n <mg-menu direction={Direction.VERTICAL} label={this.messages.menuLabel} size={this.size}></mg-menu>\n </mg-menu-item>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
2
  import { i as initLocales } from './index2.js';
3
- import { N as Ne } from './index.es.js';
3
+ import { P as Pe } from './index.es.js';
4
4
  import { d as defineCustomElement$2 } from './mg-icon2.js';
5
5
 
6
6
  const mgLoaderCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{display:block}.mg-c-loader{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.4rem;text-align:center}";
@@ -15,7 +15,7 @@ const MgLoader$1 = /*@__PURE__*/ proxyCustomElement(class MgLoader extends HTMLE
15
15
  this.messageHide = undefined;
16
16
  }
17
17
  watchMessage(newValue) {
18
- if (newValue && !Ne(newValue))
18
+ if (newValue && !Pe(newValue))
19
19
  throw new Error('<mg-loader> prop "message" must be a valid string.');
20
20
  }
21
21
  /*************