@mgdis/mg-components 5.17.0 → 5.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/mg-action-more_34.cjs.entry.js +464 -157
  3. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  4. package/dist/cjs/mg-components.cjs.js +1 -1
  5. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +31 -11
  6. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  7. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js +6 -0
  8. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.e2e.js.map +1 -1
  9. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js +8 -0
  10. package/dist/collection/components/atoms/mg-tooltip/test/mg-tooltip.spec.js.map +1 -1
  11. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +92 -16
  12. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  13. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js +58 -1
  14. package/dist/collection/components/molecules/inputs/mg-input-checkbox/test/mg-input-checkbox.spec.js.map +1 -1
  15. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +79 -8
  16. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  17. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js +55 -0
  18. package/dist/collection/components/molecules/inputs/mg-input-date/test/mg-input-date.spec.js.map +1 -1
  19. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +109 -38
  20. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js +55 -0
  22. package/dist/collection/components/molecules/inputs/mg-input-numeric/test/mg-input-numeric.spec.js.map +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +83 -10
  24. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js +55 -0
  26. package/dist/collection/components/molecules/inputs/mg-input-password/test/mg-input-password.spec.js.map +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +82 -9
  28. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js +60 -0
  30. package/dist/collection/components/molecules/inputs/mg-input-radio/test/mg-input-radio.spec.js.map +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +82 -9
  32. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  33. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js +55 -0
  34. package/dist/collection/components/molecules/inputs/mg-input-select/test/mg-input-select.spec.js.map +1 -1
  35. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +94 -21
  36. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js +68 -5
  38. package/dist/collection/components/molecules/inputs/mg-input-text/test/mg-input-text.spec.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +100 -26
  40. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js +67 -4
  42. package/dist/collection/components/molecules/inputs/mg-input-textarea/test/mg-input-textarea.spec.js.map +1 -1
  43. package/dist/collection/components/molecules/mg-form/mg-form.js +2 -2
  44. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  45. package/dist/collection/components/molecules/mg-panel/mg-panel.js +8 -6
  46. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  47. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js +1 -1
  48. package/dist/collection/components/molecules/mg-panel/test/mg-panel.e2e.playwright.js.map +1 -1
  49. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js +3 -13
  50. package/dist/collection/components/molecules/mg-panel/test/mg-panel.spec.js.map +1 -1
  51. package/dist/collection/components/molecules/mg-popover/mg-popover.js +34 -14
  52. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  53. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.js +13 -2
  54. package/dist/collection/components/molecules/mg-popover/test/mg-popover.e2e.js.map +1 -1
  55. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js +12 -0
  56. package/dist/collection/components/molecules/mg-popover/test/mg-popover.spec.js.map +1 -1
  57. package/dist/collection/utils/components.utils.js +6 -0
  58. package/dist/collection/utils/components.utils.js.map +1 -1
  59. package/dist/collection/utils/components.utils.spec.js +9 -1
  60. package/dist/collection/utils/components.utils.spec.js.map +1 -1
  61. package/dist/components/components.utils.js +7 -1
  62. package/dist/components/components.utils.js.map +1 -1
  63. package/dist/components/mg-form.js +1 -1
  64. package/dist/components/mg-form.js.map +1 -1
  65. package/dist/components/mg-input-checkbox.js +52 -13
  66. package/dist/components/mg-input-checkbox.js.map +1 -1
  67. package/dist/components/mg-input-date.js +41 -8
  68. package/dist/components/mg-input-date.js.map +1 -1
  69. package/dist/components/mg-input-numeric.js +71 -38
  70. package/dist/components/mg-input-numeric.js.map +1 -1
  71. package/dist/components/mg-input-password.js +45 -10
  72. package/dist/components/mg-input-password.js.map +1 -1
  73. package/dist/components/mg-input-radio.js +44 -9
  74. package/dist/components/mg-input-radio.js.map +1 -1
  75. package/dist/components/mg-input-select2.js +44 -9
  76. package/dist/components/mg-input-select2.js.map +1 -1
  77. package/dist/components/mg-input-text2.js +56 -23
  78. package/dist/components/mg-input-text2.js.map +1 -1
  79. package/dist/components/mg-input-textarea.js +60 -26
  80. package/dist/components/mg-input-textarea.js.map +1 -1
  81. package/dist/components/mg-panel.js +8 -7
  82. package/dist/components/mg-panel.js.map +1 -1
  83. package/dist/components/mg-popover2.js +33 -14
  84. package/dist/components/mg-popover2.js.map +1 -1
  85. package/dist/components/mg-tooltip2.js +30 -11
  86. package/dist/components/mg-tooltip2.js.map +1 -1
  87. package/dist/esm/loader.js +1 -1
  88. package/dist/esm/mg-action-more_34.entry.js +464 -157
  89. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  90. package/dist/esm/mg-components.js +1 -1
  91. package/dist/mg-components/mg-components.esm.js +1 -1
  92. package/dist/mg-components/mg-components.esm.js.map +1 -1
  93. package/dist/mg-components/p-ff3ca349.entry.js +2 -0
  94. package/dist/mg-components/p-ff3ca349.entry.js.map +1 -0
  95. package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +2 -1
  96. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +22 -1
  97. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +17 -2
  98. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +35 -20
  99. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +16 -1
  100. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +16 -1
  101. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +16 -1
  102. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +17 -5
  103. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +17 -5
  104. package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
  105. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
  106. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +1 -0
  107. package/dist/types/components.d.ts +59 -11
  108. package/dist/types/utils/components.utils.d.ts +6 -0
  109. package/package.json +1 -1
  110. package/dist/mg-components/p-caafc9cf.entry.js +0 -2
  111. package/dist/mg-components/p-caafc9cf.entry.js.map +0 -1
@@ -63,21 +63,27 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class MgPopover extends HTMLE
63
63
  * Render popover content element
64
64
  */
65
65
  this.renderPopoverContent = () => {
66
- this.mgPopoverContent = document.createElement('mg-popover-content');
67
- this.mgPopoverContent.setAttribute('slot', 'content');
68
- this.mgPopoverContent.setAttribute('id', this.identifier);
69
- this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);
70
- const arrow = document.createElement('div');
71
- arrow.setAttribute('slot', 'arrow');
72
- arrow.dataset.popperArrow = '';
73
- this.mgPopoverContent.appendChild(arrow);
74
- // insert elements in DOM
75
- ['[slot="title"]', '[slot="content"]:not(mg-popover-content)'].forEach(slotType => {
76
- Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {
77
- this.mgPopoverContent.appendChild(slot);
66
+ const mgPopoverContent = this.element.querySelector('mg-popover-content');
67
+ if (mgPopoverContent === null) {
68
+ this.mgPopoverContent = document.createElement('mg-popover-content');
69
+ this.mgPopoverContent.setAttribute('slot', 'content');
70
+ this.mgPopoverContent.setAttribute('id', this.identifier);
71
+ this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);
72
+ const arrow = document.createElement('div');
73
+ arrow.setAttribute('slot', 'arrow');
74
+ arrow.dataset.popperArrow = '';
75
+ this.mgPopoverContent.appendChild(arrow);
76
+ // insert elements in DOM
77
+ ['[slot="title"]', '[slot="content"]:not(mg-popover-content)'].forEach(slotType => {
78
+ Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {
79
+ this.mgPopoverContent.appendChild(slot);
80
+ });
78
81
  });
79
- });
80
- this.element.appendChild(this.mgPopoverContent);
82
+ this.element.appendChild(this.mgPopoverContent);
83
+ }
84
+ else {
85
+ mgPopoverContent.setAttribute('id', this.identifier);
86
+ }
81
87
  };
82
88
  this.identifier = createID('mg-popover');
83
89
  this.placement = 'bottom';
@@ -86,6 +92,10 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class MgPopover extends HTMLE
86
92
  this.display = false;
87
93
  this.disabled = false;
88
94
  }
95
+ validateIdentifier() {
96
+ // use renderPopoverContent to update popover-content id
97
+ this.renderPopoverContent();
98
+ }
89
99
  validateArrowHide(newValue) {
90
100
  if (newValue)
91
101
  this.mgPopoverContent.dataset.arrowHide = '';
@@ -122,6 +132,7 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class MgPopover extends HTMLE
122
132
  // render mg-popover-content slot
123
133
  this.renderPopoverContent();
124
134
  this.validateCloseButton(this.closeButton);
135
+ this.validateIdentifier();
125
136
  this.validateArrowHide(this.arrowHide);
126
137
  }
127
138
  /**
@@ -146,6 +157,12 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class MgPopover extends HTMLE
146
157
  offset: [0, 0],
147
158
  },
148
159
  },
160
+ {
161
+ name: 'flip',
162
+ options: {
163
+ fallbackPlacements: ['auto'],
164
+ },
165
+ },
149
166
  ],
150
167
  });
151
168
  // add resize observer
@@ -175,6 +192,7 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class MgPopover extends HTMLE
175
192
  }
176
193
  get element() { return this; }
177
194
  static get watchers() { return {
195
+ "identifier": ["validateIdentifier"],
178
196
  "arrowHide": ["validateArrowHide"],
179
197
  "closeButton": ["validateCloseButton"],
180
198
  "display": ["handleDisplay"]
@@ -188,6 +206,7 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class MgPopover extends HTMLE
188
206
  "display": [1028],
189
207
  "disabled": [4]
190
208
  }, undefined, {
209
+ "identifier": ["validateIdentifier"],
191
210
  "arrowHide": ["validateArrowHide"],
192
211
  "closeButton": ["validateCloseButton"],
193
212
  "display": ["handleDisplay"]
@@ -1 +1 @@
1
- {"file":"mg-popover2.js","mapp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apsulation=shadow","src/components/molecules/mg-popover/mg-popover.tsx"],"sourcesContent":["$mg-popover-padding-vertical: var(--mg-popover-padding-vertical, 1.5rem);\n\n:host {\n --mg-card-padding: #{$mg-popover-padding-vertical} var(--mg-popover-padding-horizontal, #{$mg-popover-padding-vertical});\n --mg-card-border: none;\n --mg-card-border-radius: 0.5rem;\n --mg-card-background: hsl(var(--mg-popover-background-color));\n position: relative;\n\n display: contents;\n &::slotted(*) {\n display: inline-block;\n }\n}\n","import { Component, Element, Host, h, Prop, Watch, EventEmitter, Event } from '@stencil/core';\nimport { createID, getWindows } from '../../../utils/components.utils';\nimport { Instance as PopperInstance, createPopper, Placement } from '@popperjs/core';\n\n@Component({\n tag: 'mg-popover',\n styleUrl: 'mg-popover.scss',\n shadow: true,\n})\nexport class MgPopover {\n /************\n * Internal *\n ************/\n\n private popper: PopperInstance;\n private mgPopover: HTMLElement;\n private mgPopoverContent: HTMLMgPopoverContentElement;\n private windows: Window[];\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPopoverElement;\n\n /**\n * Sets an `id` attribute.\n * Needed by the input for accessibility `aria-decribedby`.\n */\n @Prop() identifier: string = createID('mg-popover');\n\n /**\n * Popover placement\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Hide popover arrow\n */\n @Prop() arrowHide = false;\n @Watch('arrowHide')\n validateArrowHide(newValue: MgPopover['arrowHide']): void {\n if (newValue) this.mgPopoverContent.dataset.arrowHide = '';\n else delete this.mgPopoverContent.dataset.arrowHide;\n }\n\n /**\n * Define if popover has a cross button\n */\n @Prop() closeButton = false;\n @Watch('closeButton')\n validateCloseButton(newValue: MgPopover['arrowHide']): void {\n this.mgPopoverContent.closeButton = newValue;\n }\n\n /**\n * Display popover\n */\n @Prop({ mutable: true }) display = false;\n @Watch('display')\n handleDisplay(newValue: boolean): void {\n if (newValue) {\n this.show();\n } else {\n this.hide();\n }\n this.displayChange.emit(newValue);\n }\n\n /**\n * Disable popover\n */\n @Prop() disabled = false;\n\n /**\n * Emited event when display value change\n */\n @Event({ eventName: 'display-change' }) displayChange: EventEmitter<boolean>;\n\n /**\n * Check if clicked outside of component\n * @param event - mouse event\n */\n private clickOutside = (event: MouseEvent & { target: HTMLElement }): void => {\n const closestElement: HTMLElement = event.target.closest(`[data-mg-popover-guard]`);\n if (!this.disabled && event.target.closest('mg-popover') !== this.element && closestElement?.dataset.mgPopoverGuard !== this.identifier) {\n this.display = false;\n }\n };\n\n /**\n * Show popover\n */\n private show = (): void => {\n // Make the popover visible\n this.mgPopover.dataset.show = '';\n // Enable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }],\n }));\n // hide when click outside\n // setTimeout is used to prevent event to trigger after creation\n setTimeout(() => {\n this.windows.forEach((localWindow: Window) => {\n localWindow.addEventListener('click', this.clickOutside, false);\n });\n }, 0);\n };\n\n /**\n * Hide popover\n */\n private hide = (): void => {\n // Hide the popover\n this.mgPopover.removeAttribute('data-show');\n // Disable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }],\n }));\n // Remove event listener\n this.windows.forEach((localWindow: Window) => {\n localWindow.removeEventListener('click', this.clickOutside, false);\n });\n };\n\n /**\n * Handle content hide event\n */\n private handleHideContent = (): void => {\n this.display = false;\n };\n\n /**\n * Render popover content element\n */\n private renderPopoverContent = (): void => {\n this.mgPopoverContent = document.createElement('mg-popover-content');\n this.mgPopoverContent.setAttribute('slot', 'content');\n this.mgPopoverContent.setAttribute('id', this.identifier);\n this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);\n\n const arrow = document.createElement('div');\n arrow.setAttribute('slot', 'arrow');\n arrow.dataset.popperArrow = '';\n this.mgPopoverContent.appendChild(arrow);\n\n // insert elements in DOM\n ['[slot=\"title\"]', '[slot=\"content\"]:not(mg-popover-content)'].forEach(slotType => {\n Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {\n this.mgPopoverContent.appendChild(slot);\n });\n });\n this.element.appendChild(this.mgPopoverContent);\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * update popper position after props change on component did update hook to benefit from render ended\n */\n componentDidUpdate(): void {\n this.popper.update();\n }\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get windows to attach events\n this.windows = getWindows(window);\n // render mg-popover-content slot\n this.renderPopoverContent();\n this.validateCloseButton(this.closeButton);\n this.validateArrowHide(this.arrowHide);\n }\n\n /**\n * Check if component props are well configured on init\n */\n componentDidLoad(): void {\n // Get popover content\n this.mgPopover = this.element.querySelector(`#${this.identifier}`);\n\n //Get interactive element (first element without slot attribute)\n const interactiveElement: HTMLElement = this.element.querySelector(':not([slot])');\n // Add aria attributes\n interactiveElement.setAttribute('aria-controls', this.identifier);\n interactiveElement.setAttribute('aria-expanded', `${this.display}`);\n\n // Create popperjs popover\n this.popper = createPopper(interactiveElement, this.mgPopover, {\n placement: this.placement,\n strategy: 'fixed',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 0],\n },\n },\n ],\n });\n\n // add resize observer\n new ResizeObserver(() => {\n this.popper.update();\n }).observe(this.element.querySelector('mg-popover-content'));\n\n // Add events to toggle display\n interactiveElement.addEventListener('click', () => {\n if (!this.disabled) this.display = !this.display;\n });\n\n // Add events to hide popover\n this.element.addEventListener('keydown', e => {\n if (!this.disabled && e.code === 'Escape') {\n this.display = false;\n interactiveElement.focus();\n }\n });\n\n this.handleDisplay(this.display);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <slot></slot>\n <slot name=\"content\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-popover2.js","mappings":";;;;;;;;AAAA,MAAM,YAAY,GAAG,kVAAkV;;MCS1V,SAAS;;;;;;;;;;IAkFZ,iBAAY,GAAG,CAAC,KAA2C;MACjE,MAAM,cAAc,GAAgB,KAAK,CA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AC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;GAClC;;;;;EAMD,MAAM;IACJ,QACE,EAAC,IAAI,QACH,eAAa,EACb,YAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/mg-popover/mg-popover.scss?tag=mg-popover&encapsulation=shadow","src/components/molecules/mg-popover/mg-popover.tsx"],"sourcesContent":["$mg-popover-padding-vertical: var(--mg-popover-padding-vertical, 1.5rem);\n\n:host {\n --mg-card-padding: #{$mg-popover-padding-vertical} var(--mg-popover-padding-horizontal, #{$mg-popover-padding-vertical});\n --mg-card-border: none;\n --mg-card-border-radius: 0.5rem;\n --mg-card-background: hsl(var(--mg-popover-background-color));\n position: relative;\n\n display: contents;\n &::slotted(*) {\n display: inline-block;\n }\n}\n","import { Component, Element, Host, h, Prop, Watch, EventEmitter, Event } from '@stencil/core';\nimport { createID, getWindows } from '../../../utils/components.utils';\nimport { Instance as PopperInstance, createPopper, Placement } from '@popperjs/core';\n\n@Component({\n tag: 'mg-popover',\n styleUrl: 'mg-popover.scss',\n shadow: true,\n})\nexport class MgPopover {\n /************\n * Internal *\n ************/\n\n private popper: PopperInstance;\n private mgPopover: HTMLElement;\n private mgPopoverContent: HTMLMgPopoverContentElement;\n private windows: Window[];\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPopoverElement;\n\n /**\n * Sets an `id` attribute.\n * Needed by the input for accessibility `aria-decribedby`.\n */\n @Prop() identifier: string = createID('mg-popover');\n @Watch('identifier')\n validateIdentifier(): void {\n // use renderPopoverContent to update popover-content id\n this.renderPopoverContent();\n }\n\n /**\n * Popover placement\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Hide popover arrow\n */\n @Prop() arrowHide = false;\n @Watch('arrowHide')\n validateArrowHide(newValue: MgPopover['arrowHide']): void {\n if (newValue) this.mgPopoverContent.dataset.arrowHide = '';\n else delete this.mgPopoverContent.dataset.arrowHide;\n }\n\n /**\n * Define if popover has a cross button\n */\n @Prop() closeButton = false;\n @Watch('closeButton')\n validateCloseButton(newValue: MgPopover['arrowHide']): void {\n this.mgPopoverContent.closeButton = newValue;\n }\n\n /**\n * Display popover\n */\n @Prop({ mutable: true }) display = false;\n @Watch('display')\n handleDisplay(newValue: boolean): void {\n if (newValue) {\n this.show();\n } else {\n this.hide();\n }\n this.displayChange.emit(newValue);\n }\n\n /**\n * Disable popover\n */\n @Prop() disabled = false;\n\n /**\n * Emited event when display value change\n */\n @Event({ eventName: 'display-change' }) displayChange: EventEmitter<boolean>;\n\n /**\n * Check if clicked outside of component\n * @param event - mouse event\n */\n private clickOutside = (event: MouseEvent & { target: HTMLElement }): void => {\n const closestElement: HTMLElement = event.target.closest(`[data-mg-popover-guard]`);\n if (!this.disabled && event.target.closest('mg-popover') !== this.element && closestElement?.dataset.mgPopoverGuard !== this.identifier) {\n this.display = false;\n }\n };\n\n /**\n * Show popover\n */\n private show = (): void => {\n // Make the popover visible\n this.mgPopover.dataset.show = '';\n // Enable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }],\n }));\n // hide when click outside\n // setTimeout is used to prevent event to trigger after creation\n setTimeout(() => {\n this.windows.forEach((localWindow: Window) => {\n localWindow.addEventListener('click', this.clickOutside, false);\n });\n }, 0);\n };\n\n /**\n * Hide popover\n */\n private hide = (): void => {\n // Hide the popover\n this.mgPopover.removeAttribute('data-show');\n // Disable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }],\n }));\n // Remove event listener\n this.windows.forEach((localWindow: Window) => {\n localWindow.removeEventListener('click', this.clickOutside, false);\n });\n };\n\n /**\n * Handle content hide event\n */\n private handleHideContent = (): void => {\n this.display = false;\n };\n\n /**\n * Render popover content element\n */\n private renderPopoverContent = (): void => {\n const mgPopoverContent = this.element.querySelector('mg-popover-content');\n if (mgPopoverContent === null) {\n this.mgPopoverContent = document.createElement('mg-popover-content');\n this.mgPopoverContent.setAttribute('slot', 'content');\n this.mgPopoverContent.setAttribute('id', this.identifier);\n this.mgPopoverContent.addEventListener('hide-content', this.handleHideContent);\n\n const arrow = document.createElement('div');\n arrow.setAttribute('slot', 'arrow');\n arrow.dataset.popperArrow = '';\n this.mgPopoverContent.appendChild(arrow);\n\n // insert elements in DOM\n ['[slot=\"title\"]', '[slot=\"content\"]:not(mg-popover-content)'].forEach(slotType => {\n Array.from(this.element.querySelectorAll(slotType)).forEach(slot => {\n this.mgPopoverContent.appendChild(slot);\n });\n });\n this.element.appendChild(this.mgPopoverContent);\n } else {\n mgPopoverContent.setAttribute('id', this.identifier);\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * update popper position after props change on component did update hook to benefit from render ended\n */\n componentDidUpdate(): void {\n this.popper.update();\n }\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get windows to attach events\n this.windows = getWindows(window);\n // render mg-popover-content slot\n this.renderPopoverContent();\n this.validateCloseButton(this.closeButton);\n this.validateIdentifier();\n this.validateArrowHide(this.arrowHide);\n }\n\n /**\n * Check if component props are well configured on init\n */\n componentDidLoad(): void {\n // Get popover content\n this.mgPopover = this.element.querySelector(`#${this.identifier}`);\n\n //Get interactive element (first element without slot attribute)\n const interactiveElement: HTMLElement = this.element.querySelector(':not([slot])');\n // Add aria attributes\n interactiveElement.setAttribute('aria-controls', this.identifier);\n interactiveElement.setAttribute('aria-expanded', `${this.display}`);\n\n // Create popperjs popover\n this.popper = createPopper(interactiveElement, this.mgPopover, {\n placement: this.placement,\n strategy: 'fixed',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 0],\n },\n },\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['auto'],\n },\n },\n ],\n });\n\n // add resize observer\n new ResizeObserver(() => {\n this.popper.update();\n }).observe(this.element.querySelector('mg-popover-content'));\n\n // Add events to toggle display\n interactiveElement.addEventListener('click', () => {\n if (!this.disabled) this.display = !this.display;\n });\n\n // Add events to hide popover\n this.element.addEventListener('keydown', e => {\n if (!this.disabled && e.code === 'Escape') {\n this.display = false;\n interactiveElement.focus();\n }\n });\n\n this.handleDisplay(this.display);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <slot></slot>\n <slot name=\"content\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -158,6 +158,12 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
158
158
  offset: [0, 8],
159
159
  },
160
160
  },
161
+ {
162
+ name: 'flip',
163
+ options: {
164
+ fallbackPlacements: ['auto'],
165
+ },
166
+ },
161
167
  ],
162
168
  });
163
169
  // Manage tooltipedElement focus/blur events
@@ -195,6 +201,10 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
195
201
  this.display = false;
196
202
  this.disabled = false;
197
203
  }
204
+ validateIdentifier() {
205
+ // use renderTooltipContent to update tooltip-content id
206
+ this.renderTooltipContent();
207
+ }
198
208
  validateMessage(newValue) {
199
209
  if (typeof newValue !== 'string' || newValue.trim() === '') {
200
210
  throw new Error('<mg-tooltip> prop "message" is required.');
@@ -220,16 +230,22 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
220
230
  /**
221
231
  * Render tooltip content element
222
232
  */
223
- renderTooltip() {
224
- const mgTooltipContent = document.createElement('mg-tooltip-content');
225
- mgTooltipContent.setAttribute('slot', 'content');
226
- mgTooltipContent.setAttribute('id', this.identifier);
227
- const arrow = document.createElement('div');
228
- arrow.setAttribute('slot', 'arrow');
229
- arrow.dataset.popperArrow = '';
230
- mgTooltipContent.appendChild(arrow);
231
- // append tooltip element to component
232
- this.element.appendChild(mgTooltipContent);
233
+ renderTooltipContent() {
234
+ const mgTooltipContent = this.element.querySelector('mg-tooltip-content');
235
+ if (mgTooltipContent === null) {
236
+ const mgTooltipContent = document.createElement('mg-tooltip-content');
237
+ mgTooltipContent.setAttribute('slot', 'content');
238
+ mgTooltipContent.setAttribute('id', this.identifier);
239
+ const arrow = document.createElement('div');
240
+ arrow.setAttribute('slot', 'arrow');
241
+ arrow.dataset.popperArrow = '';
242
+ mgTooltipContent.appendChild(arrow);
243
+ // append tooltip element to component
244
+ this.element.appendChild(mgTooltipContent);
245
+ }
246
+ else {
247
+ mgTooltipContent.setAttribute('id', this.identifier);
248
+ }
233
249
  }
234
250
  /*************
235
251
  * Lifecycle *
@@ -241,11 +257,12 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
241
257
  // Get windows to attach events
242
258
  this.windows = getWindows(window);
243
259
  // Get tooltip element
244
- this.renderTooltip();
260
+ this.renderTooltipContent();
245
261
  this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);
246
262
  //validate properties
247
263
  this.validateDisabled(this.disabled);
248
264
  this.validateMessage(this.message);
265
+ this.validateIdentifier();
249
266
  }
250
267
  /**
251
268
  * Get slotted element
@@ -293,6 +310,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
293
310
  }
294
311
  get element() { return this; }
295
312
  static get watchers() { return {
313
+ "identifier": ["validateIdentifier"],
296
314
  "message": ["validateMessage"],
297
315
  "display": ["handleDisplay"],
298
316
  "disabled": ["validateDisabled"]
@@ -305,6 +323,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
305
323
  "display": [1028],
306
324
  "disabled": [4]
307
325
  }, undefined, {
326
+ "identifier": ["validateIdentifier"],
308
327
  "message": ["validateMessage"],
309
328
  "display": ["handleDisplay"],
310
329
  "disabled": ["validateDisabled"]
@@ -1 +1 @@
1
- {"file":"mg-tooltip2.js","mappings":";;;;;AAAA,IAAY,KAIX;AAJD,WAAY,KAAK;EACf,wBAA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AAkB,IAAI,WAAW,CAAC;;;IAI1D,IAAI,QAAQ,CAAC,WAAW,CAAC,EAAE;MACzB,IAAI,gBAAgB,CAAC,YAAY;QAC/B,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,EAAE;UACjG,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;;;UAGrC,IAAI,CAAC,UAAU,EAAE,CAAC;UAClB,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;SACnD;OACF,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;MAC9C,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;KACtC;;IAGD,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;IAElD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;GAClC;;;;EAKD,kBAAkB;IAChB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;GACtB;;;;;EAMD,MAAM;IACJ,QACE,EAAC,IAAI,QACH,eAAa,EACb,YAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/mg-tooltip/mg-tooltip.conf.tsx","src/components/atoms/mg-tooltip/mg-tooltip.scss?tag=mg-tooltip&encapsulation=shadow","src/components/atoms/mg-tooltip/mg-tooltip.tsx"],"sourcesContent":["export enum Guard {\n FOCUS = 'focus',\n HOVER_TOOLTIP_ELEMENT = 'hoverTooltipGuard',\n HOVER_TOOLTIPED_ELEMENT = 'hoverTooltipedGuard',\n}\n",":host {\n display: inline-block;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\nimport { createID, focusableElements, getWindows } from '../../../utils/components.utils';\nimport { Instance as PopperInstance, createPopper, Placement } from '@popperjs/core';\nimport { Guard } from './mg-tooltip.conf';\n\n/**\n * HTMLMgButtonElement type guard\n * @param element - element to check\n * @returns return true if type is HTMLMgButtonElement\n */\nconst isButton = (element: unknown): element is HTMLMgButtonElement => typeof element === 'object' && ['MG-BUTTON', 'BUTTON'].includes((element as Element).tagName);\n\n@Component({\n tag: 'mg-tooltip',\n styleUrl: 'mg-tooltip.scss',\n shadow: true,\n})\nexport class MgTooltip {\n /************\n * Internal *\n ************/\n\n private popper: PopperInstance;\n private mgTooltipContent: HTMLMgTooltipContentElement;\n private tooltipedElement: HTMLElement;\n private windows: Window[];\n private hasCustomTabIndex: boolean;\n\n // tooltip actions guards\n private guard: Guard;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTooltipElement;\n\n /**\n * Sets an `id` attribute.\n * Needed by the input for accessibility `aria-decribedby`.\n */\n @Prop() identifier: string = createID('mg-tooltip');\n\n /**\n * Displayed message in the tooltip\n */\n @Prop() message!: string;\n @Watch('message')\n validateMessage(newValue: string): void {\n if (typeof newValue !== 'string' || newValue.trim() === '') {\n throw new Error('<mg-tooltip> prop \"message\" is required.');\n }\n this.mgTooltipContent.message = newValue;\n }\n\n /**\n * Tooltip placement\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Display tooltip\n */\n @Prop({ mutable: true }) display = false;\n @Watch('display')\n handleDisplay(newValue: boolean): void {\n if (newValue) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Disable tooltip\n */\n @Prop() disabled = false;\n @Watch('disabled')\n validateDisabled(newValue: MgTooltip['disabled']): void {\n if (this.hasCustomTabIndex) {\n if (newValue) this.tooltipedElement.removeAttribute('tabindex');\n else if (this.tooltipedElement.getAttribute('tabindex') === null) this.tooltipedElement.setAttribute('tabindex', '0');\n }\n }\n\n /**\n * Show tooltip\n */\n private show = (): void => {\n // Make the tooltip visible\n this.mgTooltipContent.dataset.show = '';\n // Enable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }],\n }));\n // hide when click outside\n // setTimeout is used to prevent event to trigger after creation\n setTimeout(() => {\n this.windows.forEach((localWindow: Window) => {\n localWindow.addEventListener('click', this.clickOutside, false);\n localWindow.addEventListener('keydown', this.pressEscape, false);\n });\n }, 0);\n };\n\n /**\n * Hide tooltip\n */\n private hide = (): void => {\n // Hide the tooltip\n this.mgTooltipContent.removeAttribute('data-show');\n // Disable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }],\n }));\n // Remove event listener\n this.windows.forEach((localWindow: Window) => {\n localWindow.removeEventListener('click', this.clickOutside, false);\n localWindow.removeEventListener('keyboard', this.pressEscape, false);\n });\n };\n\n /**\n * Check if clicked outside of component and hidde tooltip\n * @param event - mouse event\n */\n private clickOutside = (event: MouseEvent & { target: HTMLElement }): void => {\n if (event.target.closest('mg-tooltip') !== this.element) this.setDisplay(false);\n };\n\n /**\n * Check if 'Escape' key is pressed of component and hidde tooltip\n * @param event - keyboard event\n */\n private pressEscape = (event: KeyboardEvent): void => {\n if (event.code === 'Escape') {\n this.setDisplay(false);\n this.resetGuard();\n }\n };\n\n /**\n * Method to set display prop\n * @param newValue - display prop new value\n * @param condition - additionnal condition to apply display prop newValue\n */\n private setDisplay = (newValue: boolean, condition = true): void => {\n if (!this.disabled && condition) this.display = newValue;\n };\n\n /**\n * Action for tooltip element and tooltiped element mouse listener\n * @param elementGuard - tooltip element guard\n * @param isMouseenter - mouseenter validation\n * @param conditionalGuard - guard condition\n */\n private tooltipMouseListenerAction = (elementGuard: Guard, isMouseenter: boolean, conditionalGuard: Guard): void => {\n // we mutate elementGuard\n if (this.guard !== Guard.FOCUS) {\n this.guard = elementGuard;\n if (!isMouseenter) {\n setTimeout(() => {\n this.setDisplay(isMouseenter, this.guard !== conditionalGuard);\n this.resetGuard();\n }, 100);\n } else if (this.guard === Guard.HOVER_TOOLTIPED_ELEMENT) {\n this.setDisplay(isMouseenter);\n }\n }\n };\n\n /**\n * Method to reset guard value\n */\n private resetGuard = (): void => {\n this.guard = undefined;\n };\n\n /**\n * Update slot content when it is a mg-button\n * @param mgButton - slotted mg-button\n */\n private setMgButtonWrapper = (mgButton: HTMLMgButtonElement): void => {\n if (mgButton.disabled) {\n const div = document.createElement('div');\n div.classList.add('mg-tooltip__mg-button-wrapper');\n mgButton.parentNode.insertBefore(div, mgButton);\n div.appendChild(mgButton);\n this.tooltipedElement = div;\n } else if (mgButton.parentElement.classList.contains('mg-tooltip__mg-button-wrapper')) {\n this.element.firstElementChild.replaceWith(mgButton);\n this.tooltipedElement = mgButton;\n }\n };\n\n /**\n * Init tooltip\n * @param slotElement - slotted element\n * @param interactiveElement - interactive element\n */\n private initTooltip = (slotElement: HTMLElement, interactiveElement: HTMLElement): void => {\n // Add tabindex to slotted element if we can't find any interactive element\n if (!this.disabled && !Boolean(interactiveElement)) {\n this.hasCustomTabIndex = true;\n slotElement.tabIndex = 0;\n // Add role on non-interactive element to work with \"aria-describedby\" for screen readers\n slotElement.setAttribute('role', 'button');\n }\n // Set aria-describedby\n const ariaDescribedby = slotElement.getAttribute('aria-describedby');\n\n if (ariaDescribedby === null) {\n this.tooltipedElement.setAttribute('aria-describedby', this.identifier);\n } else {\n // We ensure to have uniq ids\n slotElement.setAttribute('aria-describedby', `${[...new Set([...ariaDescribedby.split(' '), this.identifier])].join(' ')}`);\n }\n\n // Create popperjs tooltip\n this.popper = createPopper(this.tooltipedElement, this.mgTooltipContent, {\n placement: this.placement,\n strategy: 'fixed',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n ],\n });\n\n // Manage tooltipedElement focus/blur events\n this.tooltipedElement.addEventListener('focus', () => {\n this.guard = Guard.FOCUS;\n this.setDisplay(true);\n });\n\n // as `click` event is the composition of `mousedown` and `mouseup` event,\n // and `click` event trigger `focus` event after a success `mousedown` wich set the `guard` to `Guard.FOCUS`\n // we reset the guard on `mouseup` event to unlock tooltip\n this.tooltipedElement.addEventListener('mouseup', () => {\n this.resetGuard();\n });\n\n this.tooltipedElement.addEventListener('blur', () => {\n this.resetGuard();\n this.setDisplay(false);\n });\n\n document.addEventListener('keydown', this.pressEscape);\n\n // manage tooltipElement & tooltipedElement mouseenter/mouseleave events\n ['mouseenter', 'mouseleave'].forEach(eventType => {\n const isMouseenter = eventType === 'mouseenter';\n [\n { element: this.mgTooltipContent, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIPED_ELEMENT) },\n { element: this.tooltipedElement, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIP_ELEMENT) },\n ].forEach(({ element, action }) => {\n element.addEventListener(eventType, () => {\n action();\n });\n });\n });\n };\n\n /**\n * Render tooltip content element\n */\n private renderTooltip(): void {\n const mgTooltipContent = document.createElement('mg-tooltip-content');\n mgTooltipContent.setAttribute('slot', 'content');\n mgTooltipContent.setAttribute('id', this.identifier);\n\n const arrow = document.createElement('div');\n arrow.setAttribute('slot', 'arrow');\n arrow.dataset.popperArrow = '';\n mgTooltipContent.appendChild(arrow);\n\n // append tooltip element to component\n this.element.appendChild(mgTooltipContent);\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * set variables\n */\n componentWillLoad(): void {\n // Get windows to attach events\n this.windows = getWindows(window);\n\n // Get tooltip element\n this.renderTooltip();\n this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);\n\n //validate properties\n this.validateDisabled(this.disabled);\n this.validateMessage(this.message);\n }\n\n /**\n * Get slotted element\n * Check if it already contain an interactive element, if not we need to add a tabIndex attribute\n * We need to attach the focused element to the tooltip (aria-describedby)\n */\n componentDidLoad(): void {\n // get slotted element wich is not the tooltip\n const slotElement: HTMLElement = this.element.querySelector(`*:not(#${this.identifier})`);\n\n // Get interactive element\n const interactiveElement: HTMLElement = slotElement.matches(focusableElements) ? slotElement : slotElement.shadowRoot?.querySelector(focusableElements);\n\n // define selected element to become tooltip selector\n this.tooltipedElement = interactiveElement || slotElement;\n\n // Check if slotted element is a disabled mg-button\n // In this case we wrap the mg-button into a div to enable the tooltip\n if (isButton(slotElement)) {\n new MutationObserver(mutationList => {\n if (mutationList.some(mutation => ['aria-disabled', 'disabled'].includes(mutation.attributeName))) {\n this.setMgButtonWrapper(slotElement);\n // Since Firefox doesn't trigger a \"blur\" event when the \"disabled\" attribute is added or removed from a button\n // we have to manually unlock the guard because the \"blur\" handler of the tooltipedElement won't do it.\n this.resetGuard();\n this.initTooltip(slotElement, interactiveElement);\n }\n }).observe(slotElement, { attributes: true });\n this.setMgButtonWrapper(slotElement);\n }\n\n // Init Tooltip\n this.initTooltip(slotElement, interactiveElement);\n\n this.handleDisplay(this.display);\n }\n\n /**\n * update popper position after props change on component did update hook to benefit from render ended\n */\n componentDidUpdate(): void {\n this.popper.update();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <slot></slot>\n <slot name=\"content\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"mg-tooltip2.js","mappings":";;;;;AAAA,IAAY,KAIX;AAJD,WAAY,KAAK;EACf,wBAAe,CAAA;EACf,oDAA2C,CAAA;EAC3C,wDAA+C,CAAA;AACjD,CAAC,EAJW,KAAK,KAAL,KAAK;;ACAjB,MAAM,YAAY,GAAG,6BAA6B;;ACKlD;;;;;AAKA,MAAM,QAAQ,GAAG,CAAC,OAAgB,KAAqC,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAE,OAAmB,CAAC,OAAO,CAAC,CAAC;MAOxJ,SAAS;;;;;;;;IA+EZ,SAAI,GAAG;;MAEb,IAAI,CAAC,gBAAgB,CAAC,OAAO,C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AC;;IAGxJ,IAAI,CAAC,gBAAgB,GAAG,kBAAkB,IAAI,WAAW,CAAC;;;IAI1D,IAAI,QAAQ,CAAC,WAAW,CAAC,EAAE;MACzB,IAAI,gBAAgB,CAAC,YAAY;QAC/B,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,EAAE;UACjG,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;;;UAGrC,IAAI,CAAC,UAAU,EAAE,CAAC;UAClB,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;SACnD;OACF,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;MAC9C,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;KACtC;;IAGD,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;IAElD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;GAClC;;;;EAKD,kBAAkB;IAChB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;GACtB;;;;;EAMD,MAAM;IACJ,QACE,EAAC,IAAI,QACH,eAAa,EACb,YAAM,IAAI,EAAC,SAAS,GAAQ,CACvB,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/mg-tooltip/mg-tooltip.conf.tsx","src/components/atoms/mg-tooltip/mg-tooltip.scss?tag=mg-tooltip&encapsulation=shadow","src/components/atoms/mg-tooltip/mg-tooltip.tsx"],"sourcesContent":["export enum Guard {\n FOCUS = 'focus',\n HOVER_TOOLTIP_ELEMENT = 'hoverTooltipGuard',\n HOVER_TOOLTIPED_ELEMENT = 'hoverTooltipedGuard',\n}\n",":host {\n display: inline-block;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\nimport { createID, focusableElements, getWindows } from '../../../utils/components.utils';\nimport { Instance as PopperInstance, createPopper, Placement } from '@popperjs/core';\nimport { Guard } from './mg-tooltip.conf';\n\n/**\n * HTMLMgButtonElement type guard\n * @param element - element to check\n * @returns return true if type is HTMLMgButtonElement\n */\nconst isButton = (element: unknown): element is HTMLMgButtonElement => typeof element === 'object' && ['MG-BUTTON', 'BUTTON'].includes((element as Element).tagName);\n\n@Component({\n tag: 'mg-tooltip',\n styleUrl: 'mg-tooltip.scss',\n shadow: true,\n})\nexport class MgTooltip {\n /************\n * Internal *\n ************/\n\n private popper: PopperInstance;\n private mgTooltipContent: HTMLMgTooltipContentElement;\n private tooltipedElement: HTMLElement;\n private windows: Window[];\n private hasCustomTabIndex: boolean;\n\n // tooltip actions guards\n private guard: Guard;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTooltipElement;\n\n /**\n * Sets an `id` attribute.\n * Needed by the input for accessibility `aria-decribedby`.\n */\n @Prop() identifier: string = createID('mg-tooltip');\n @Watch('identifier')\n validateIdentifier(): void {\n // use renderTooltipContent to update tooltip-content id\n this.renderTooltipContent();\n }\n\n /**\n * Displayed message in the tooltip\n */\n @Prop() message!: string;\n @Watch('message')\n validateMessage(newValue: string): void {\n if (typeof newValue !== 'string' || newValue.trim() === '') {\n throw new Error('<mg-tooltip> prop \"message\" is required.');\n }\n this.mgTooltipContent.message = newValue;\n }\n\n /**\n * Tooltip placement\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Display tooltip\n */\n @Prop({ mutable: true }) display = false;\n @Watch('display')\n handleDisplay(newValue: boolean): void {\n if (newValue) {\n this.show();\n } else {\n this.hide();\n }\n }\n\n /**\n * Disable tooltip\n */\n @Prop() disabled = false;\n @Watch('disabled')\n validateDisabled(newValue: MgTooltip['disabled']): void {\n if (this.hasCustomTabIndex) {\n if (newValue) this.tooltipedElement.removeAttribute('tabindex');\n else if (this.tooltipedElement.getAttribute('tabindex') === null) this.tooltipedElement.setAttribute('tabindex', '0');\n }\n }\n\n /**\n * Show tooltip\n */\n private show = (): void => {\n // Make the tooltip visible\n this.mgTooltipContent.dataset.show = '';\n // Enable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }],\n }));\n // hide when click outside\n // setTimeout is used to prevent event to trigger after creation\n setTimeout(() => {\n this.windows.forEach((localWindow: Window) => {\n localWindow.addEventListener('click', this.clickOutside, false);\n localWindow.addEventListener('keydown', this.pressEscape, false);\n });\n }, 0);\n };\n\n /**\n * Hide tooltip\n */\n private hide = (): void => {\n // Hide the tooltip\n this.mgTooltipContent.removeAttribute('data-show');\n // Disable the event listeners\n this.popper.setOptions(options => ({\n ...options,\n modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }],\n }));\n // Remove event listener\n this.windows.forEach((localWindow: Window) => {\n localWindow.removeEventListener('click', this.clickOutside, false);\n localWindow.removeEventListener('keyboard', this.pressEscape, false);\n });\n };\n\n /**\n * Check if clicked outside of component and hidde tooltip\n * @param event - mouse event\n */\n private clickOutside = (event: MouseEvent & { target: HTMLElement }): void => {\n if (event.target.closest('mg-tooltip') !== this.element) this.setDisplay(false);\n };\n\n /**\n * Check if 'Escape' key is pressed of component and hidde tooltip\n * @param event - keyboard event\n */\n private pressEscape = (event: KeyboardEvent): void => {\n if (event.code === 'Escape') {\n this.setDisplay(false);\n this.resetGuard();\n }\n };\n\n /**\n * Method to set display prop\n * @param newValue - display prop new value\n * @param condition - additionnal condition to apply display prop newValue\n */\n private setDisplay = (newValue: boolean, condition = true): void => {\n if (!this.disabled && condition) this.display = newValue;\n };\n\n /**\n * Action for tooltip element and tooltiped element mouse listener\n * @param elementGuard - tooltip element guard\n * @param isMouseenter - mouseenter validation\n * @param conditionalGuard - guard condition\n */\n private tooltipMouseListenerAction = (elementGuard: Guard, isMouseenter: boolean, conditionalGuard: Guard): void => {\n // we mutate elementGuard\n if (this.guard !== Guard.FOCUS) {\n this.guard = elementGuard;\n if (!isMouseenter) {\n setTimeout(() => {\n this.setDisplay(isMouseenter, this.guard !== conditionalGuard);\n this.resetGuard();\n }, 100);\n } else if (this.guard === Guard.HOVER_TOOLTIPED_ELEMENT) {\n this.setDisplay(isMouseenter);\n }\n }\n };\n\n /**\n * Method to reset guard value\n */\n private resetGuard = (): void => {\n this.guard = undefined;\n };\n\n /**\n * Update slot content when it is a mg-button\n * @param mgButton - slotted mg-button\n */\n private setMgButtonWrapper = (mgButton: HTMLMgButtonElement): void => {\n if (mgButton.disabled) {\n const div = document.createElement('div');\n div.classList.add('mg-tooltip__mg-button-wrapper');\n mgButton.parentNode.insertBefore(div, mgButton);\n div.appendChild(mgButton);\n this.tooltipedElement = div;\n } else if (mgButton.parentElement.classList.contains('mg-tooltip__mg-button-wrapper')) {\n this.element.firstElementChild.replaceWith(mgButton);\n this.tooltipedElement = mgButton;\n }\n };\n\n /**\n * Init tooltip\n * @param slotElement - slotted element\n * @param interactiveElement - interactive element\n */\n private initTooltip = (slotElement: HTMLElement, interactiveElement: HTMLElement): void => {\n // Add tabindex to slotted element if we can't find any interactive element\n if (!this.disabled && !Boolean(interactiveElement)) {\n this.hasCustomTabIndex = true;\n slotElement.tabIndex = 0;\n // Add role on non-interactive element to work with \"aria-describedby\" for screen readers\n slotElement.setAttribute('role', 'button');\n }\n // Set aria-describedby\n const ariaDescribedby = slotElement.getAttribute('aria-describedby');\n\n if (ariaDescribedby === null) {\n this.tooltipedElement.setAttribute('aria-describedby', this.identifier);\n } else {\n // We ensure to have uniq ids\n slotElement.setAttribute('aria-describedby', `${[...new Set([...ariaDescribedby.split(' '), this.identifier])].join(' ')}`);\n }\n\n // Create popperjs tooltip\n this.popper = createPopper(this.tooltipedElement, this.mgTooltipContent, {\n placement: this.placement,\n strategy: 'fixed',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 8],\n },\n },\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['auto'],\n },\n },\n ],\n });\n\n // Manage tooltipedElement focus/blur events\n this.tooltipedElement.addEventListener('focus', () => {\n this.guard = Guard.FOCUS;\n this.setDisplay(true);\n });\n\n // as `click` event is the composition of `mousedown` and `mouseup` event,\n // and `click` event trigger `focus` event after a success `mousedown` wich set the `guard` to `Guard.FOCUS`\n // we reset the guard on `mouseup` event to unlock tooltip\n this.tooltipedElement.addEventListener('mouseup', () => {\n this.resetGuard();\n });\n\n this.tooltipedElement.addEventListener('blur', () => {\n this.resetGuard();\n this.setDisplay(false);\n });\n\n document.addEventListener('keydown', this.pressEscape);\n\n // manage tooltipElement & tooltipedElement mouseenter/mouseleave events\n ['mouseenter', 'mouseleave'].forEach(eventType => {\n const isMouseenter = eventType === 'mouseenter';\n [\n { element: this.mgTooltipContent, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIPED_ELEMENT) },\n { element: this.tooltipedElement, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIP_ELEMENT) },\n ].forEach(({ element, action }) => {\n element.addEventListener(eventType, () => {\n action();\n });\n });\n });\n };\n\n /**\n * Render tooltip content element\n */\n private renderTooltipContent(): void {\n const mgTooltipContent = this.element.querySelector('mg-tooltip-content');\n if (mgTooltipContent === null) {\n const mgTooltipContent = document.createElement('mg-tooltip-content');\n mgTooltipContent.setAttribute('slot', 'content');\n mgTooltipContent.setAttribute('id', this.identifier);\n\n const arrow = document.createElement('div');\n arrow.setAttribute('slot', 'arrow');\n arrow.dataset.popperArrow = '';\n mgTooltipContent.appendChild(arrow);\n\n // append tooltip element to component\n this.element.appendChild(mgTooltipContent);\n } else {\n mgTooltipContent.setAttribute('id', this.identifier);\n }\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * set variables\n */\n componentWillLoad(): void {\n // Get windows to attach events\n this.windows = getWindows(window);\n\n // Get tooltip element\n this.renderTooltipContent();\n this.mgTooltipContent = this.element.querySelector(`#${this.identifier}`);\n\n //validate properties\n this.validateDisabled(this.disabled);\n this.validateMessage(this.message);\n this.validateIdentifier();\n }\n\n /**\n * Get slotted element\n * Check if it already contain an interactive element, if not we need to add a tabIndex attribute\n * We need to attach the focused element to the tooltip (aria-describedby)\n */\n componentDidLoad(): void {\n // get slotted element wich is not the tooltip\n const slotElement: HTMLElement = this.element.querySelector(`*:not(#${this.identifier})`);\n\n // Get interactive element\n const interactiveElement: HTMLElement = slotElement.matches(focusableElements) ? slotElement : slotElement.shadowRoot?.querySelector(focusableElements);\n\n // define selected element to become tooltip selector\n this.tooltipedElement = interactiveElement || slotElement;\n\n // Check if slotted element is a disabled mg-button\n // In this case we wrap the mg-button into a div to enable the tooltip\n if (isButton(slotElement)) {\n new MutationObserver(mutationList => {\n if (mutationList.some(mutation => ['aria-disabled', 'disabled'].includes(mutation.attributeName))) {\n this.setMgButtonWrapper(slotElement);\n // Since Firefox doesn't trigger a \"blur\" event when the \"disabled\" attribute is added or removed from a button\n // we have to manually unlock the guard because the \"blur\" handler of the tooltipedElement won't do it.\n this.resetGuard();\n this.initTooltip(slotElement, interactiveElement);\n }\n }).observe(slotElement, { attributes: true });\n this.setMgButtonWrapper(slotElement);\n }\n\n // Init Tooltip\n this.initTooltip(slotElement, interactiveElement);\n\n this.handleDisplay(this.display);\n }\n\n /**\n * update popper position after props change on component did update hook to benefit from render ended\n */\n componentDidUpdate(): void {\n this.popper.update();\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <slot></slot>\n <slot name=\"content\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -3,7 +3,7 @@ export { s as setNonce } from './index-ce01e63b.js';
3
3
 
4
4
  const defineCustomElements = (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
- return bootstrapLazy(JSON.parse("[[\"mg-action-more_34\",[[1,\"mg-input-checkbox\",{\"value\":[1040],\"type\":[1025],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"inputVerticalList\":[4,\"input-vertical-list\"],\"required\":[4],\"readonly\":[4],\"displaySelectedValues\":[4,\"display-selected-values\"],\"disabled\":[4],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"checkboxItems\":[32],\"displaySearchInput\":[32],\"searchValue\":[32],\"searchResults\":[32],\"displayError\":[64]},null,{\"value\":[\"validateValue\"],\"type\":[\"validateType\"],\"displaySelectedValues\":[\"validateDisplaySelectedValues\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\",\"validateDisabled\"],\"checkboxItems\":[\"validateCheckboxItems\"],\"searchValue\":[\"validateSearchValue\"]}],[1,\"mg-action-more\",{\"icon\":[1040],\"button\":[16],\"items\":[16],\"displayChevron\":[4,\"display-chevron\"],\"expanded\":[32]},null,{\"icon\":[\"validateIcon\"],\"button\":[\"validateButton\"],\"items\":[\"validateItems\"],\"displayChevron\":[\"validateDisplayChevron\"]}],[1,\"mg-panel\",{\"identifier\":[1],\"panelTitle\":[1025,\"panel-title\"],\"titlePattern\":[1,\"title-pattern\"],\"titlePatternErrorMessage\":[1,\"title-pattern-error-message\"],\"titleEditable\":[1028,\"title-editable\"],\"titlePosition\":[1,\"title-position\"],\"expanded\":[1028],\"expandToggleDisplay\":[1,\"expand-toggle-display\"],\"expandToggleDisabled\":[4,\"expand-toggle-disabled\"],\"classCollection\":[32],\"isEditing\":[32],\"updatedPanelTitle\":[32]},null,{\"panelTitle\":[\"validatePanelTitle\"],\"titlePattern\":[\"validatetitlePattern\"],\"titlePosition\":[\"validateTitlePosition\"],\"expanded\":[\"handleExpanded\"],\"expandToggleDisplay\":[\"validateExpandToggleDisplay\"]}],[1,\"mg-input-textarea\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1],\"maxlength\":[2],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[8,\"mg-width\"],\"pattern\":[1],\"patternErrorMessage\":[1,\"pattern-error-message\"],\"rows\":[2],\"tooltip\":[1],\"displayCharacterLeft\":[4,\"display-character-left\"],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"resizable\":[1],\"classCollection\":[32],\"errorMessage\":[32],\"displayError\":[64]},null,{\"value\":[\"handleValue\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"],\"displayCharacterLeft\":[\"validateDisplayCharacterLeft\"]}],[1,\"mg-input-date\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"min\":[1],\"max\":[1],\"classCollection\":[32],\"errorMessage\":[32],\"displayError\":[64]},null,{\"value\":[\"validateValue\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"],\"min\":[\"validateMinMax\"],\"max\":[\"validateMinMax\"]}],[1,\"mg-input-numeric\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[8,\"mg-width\"],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"type\":[1],\"currency\":[1],\"max\":[2],\"min\":[2],\"integerLength\":[2,\"integer-length\"],\"decimalLength\":[2,\"decimal-length\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"hasFocus\":[32],\"displayError\":[64]},null,{\"value\":[\"validateValue\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"],\"type\":[\"validateType\"],\"integerLength\":[\"validateIntegerLength\"],\"decimalLength\":[\"validateDecimalLength\"]}],[1,\"mg-input-password\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[8,\"mg-width\"],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"displayError\":[64]},null,{\"value\":[\"handleValue\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"]}],[1,\"mg-input-radio\",{\"value\":[1032],\"items\":[16],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"inputVerticalList\":[4,\"input-vertical-list\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"options\":[32],\"displayError\":[64]},null,{\"value\":[\"handleValue\"],\"items\":[\"validateItems\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"]}],[1,\"mg-input-toggle\",{\"value\":[1032],\"items\":[16],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"isOnOff\":[4,\"is-on-off\"],\"isIcon\":[4,\"is-icon\"],\"readonly\":[4],\"disabled\":[4],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"classCollection\":[32],\"options\":[32],\"checked\":[32]},null,{\"value\":[\"handleValue\"],\"items\":[\"validateItems\"],\"isOnOff\":[\"handleIsOnOff\"],\"isIcon\":[\"handleIsIcon\"],\"readonly\":[\"handleReadonly\"],\"disabled\":[\"handleDisabled\"],\"checked\":[\"handleChecked\"]}],[1,\"mg-message\",{\"identifier\":[1],\"delay\":[2],\"variant\":[1],\"closeButton\":[1028,\"close-button\"],\"hide\":[1028],\"classCollection\":[32],\"hasActions\":[32]},null,{\"delay\":[\"validateDelay\"],\"variant\":[\"validateVariant\"],\"closeButton\":[\"validateCloseButton\"],\"hide\":[\"validateHide\"]}],[1,\"mg-modal\",{\"identifier\":[1],\"dialogRole\":[1,\"dialog-role\"],\"modalTitle\":[1,\"modal-title\"],\"closeButton\":[4,\"close-button\"],\"hide\":[1028],\"hasActions\":[32],\"hasContent\":[32],\"classCollection\":[32]},[[8,\"keydown\",\"handleKeyDown\"]],{\"dialogRole\":[\"validateDialogRole\"],\"modalTitle\":[\"validateModalTitle\"],\"hide\":[\"validateHide\"]}],[1,\"mg-tabs\",{\"identifier\":[1],\"label\":[1],\"size\":[1],\"items\":[16],\"activeTab\":[1538,\"active-tab\"],\"tabs\":[32],\"classCollection\":[32]},null,{\"label\":[\"validateLabel\"],\"size\":[\"validateSize\"],\"items\":[\"validateItems\"],\"activeTab\":[\"validateActiveTab\"]}],[1,\"mg-details\",{\"toggleClosed\":[1,\"toggle-closed\"],\"toggleOpened\":[1,\"toggle-opened\"],\"hideSummary\":[4,\"hide-summary\"],\"expanded\":[1028]},null,{\"toggleClosed\":[\"validateTitles\"],\"toggleOpened\":[\"validateTitles\"],\"expanded\":[\"handleExpanded\"]}],[1,\"mg-divider\",{\"size\":[1]}],[1,\"mg-form\",{\"identifier\":[1],\"name\":[1],\"readonly\":[4],\"disabled\":[4],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"requiredMessage\":[32],\"displayError\":[64]},null,{\"readonly\":[\"handleAttributeChange\"],\"disabled\":[\"handleAttributeChange\"]}],[1,\"mg-illustrated-message\",{\"size\":[1],\"direction\":[1]}],[1,\"mg-skip-links\",{\"links\":[16]},null,{\"links\":[\"validateLinks\"]}],[1,\"mg-tag\",{\"variant\":[1],\"outline\":[4],\"soft\":[4],\"classCollection\":[32]},null,{\"variant\":[\"validateVariant\"],\"outline\":[\"validateOutline\"],\"soft\":[\"validateSoft\"]}],[2,\"mg-input-checkbox-paginated\",{\"readonly\":[4],\"disabled\":[4],\"name\":[1],\"checkboxes\":[16],\"sectionKind\":[1,\"section-kind\"],\"messages\":[16],\"titleKind\":[32],\"currentPage\":[32],\"expanded\":[32]},null,{\"checkboxes\":[\"validateCheckboxes\"],\"sectionKind\":[\"validateSectionKind\"]}],[1,\"mg-menu-item\",{\"identifier\":[1],\"href\":[1],\"status\":[1537],\"expanded\":[1028],\"size\":[32],\"navigationButtonClassList\":[32],\"direction\":[32],\"isInMainMenu\":[32],\"isItemMore\":[32],\"hasChildren\":[32],\"displayNotificationBadge\":[32]},null,{\"status\":[\"validateStatus\"],\"expanded\":[\"validateExpanded\"],\"size\":[\"validateSize\"],\"direction\":[\"validateDirection\"],\"hasChildren\":[\"validateHasChildren\"]}],[1,\"mg-pagination\",{\"identifier\":[1],\"label\":[1025],\"hideNavigationLabels\":[4,\"hide-navigation-labels\"],\"hidePageCount\":[4,\"hide-page-count\"],\"totalPages\":[2,\"total-pages\"],\"currentPage\":[1538,\"current-page\"]},null,{\"totalPages\":[\"validateTotalPages\"],\"currentPage\":[\"validateCurrentPage\"]}],[1,\"mg-input-text\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"type\":[1],\"icon\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1],\"maxlength\":[2],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[8,\"mg-width\"],\"pattern\":[1],\"patternErrorMessage\":[1,\"pattern-error-message\"],\"tooltip\":[1],\"displayCharacterLeft\":[4,\"display-character-left\"],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"setFocus\":[64],\"displayError\":[64]},null,{\"value\":[\"handleValue\"],\"icon\":[\"validateIcon\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"]}],[1,\"mg-menu\",{\"label\":[1],\"direction\":[513],\"itemmore\":[16],\"size\":[1],\"isChildMenu\":[32]},null,{\"label\":[\"validateLabel\"],\"direction\":[\"validateDirection\"],\"itemmore\":[\"validateItemMore\"],\"size\":[\"validateSize\"]}],[1,\"mg-input-select\",{\"value\":[1032],\"items\":[16],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1025],\"placeholderHide\":[4,\"placeholder-hide\"],\"placeholderDisabled\":[4,\"placeholder-disabled\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[520,\"mg-width\"],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"options\":[32],\"valueExist\":[32],\"readonlyValue\":[32],\"displayError\":[64]},null,{\"value\":[\"validateValue\"],\"items\":[\"validateItems\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"]}],[1,\"mg-popover\",{\"identifier\":[1],\"placement\":[1],\"arrowHide\":[4,\"arrow-hide\"],\"closeButton\":[4,\"close-button\"],\"display\":[1028],\"disabled\":[4]},null,{\"arrowHide\":[\"validateArrowHide\"],\"closeButton\":[\"validateCloseButton\"],\"display\":[\"handleDisplay\"]}],[1,\"mg-badge\",{\"value\":[8],\"label\":[1],\"variant\":[1],\"outline\":[4],\"classCollection\":[32]},null,{\"value\":[\"validateValue\"],\"label\":[\"validateLabel\"],\"variant\":[\"validateVariant\"],\"outline\":[\"validateOutline\"]}],[2,\"mg-character-left\",{\"identifier\":[1],\"characters\":[1],\"maxlength\":[2]},null,{\"maxlength\":[\"validateMaxlength\"]}],[1,\"mg-popover-content\",{\"closeButton\":[4,\"close-button\"],\"classCollection\":[32]}],[1,\"mg-card\",{\"variant\":[1],\"variantStyle\":[1025,\"variant-style\"],\"classCollection\":[32]},null,{\"variant\":[\"validateVariant\"],\"variantStyle\":[\"validateVariantStyle\"]}],[1,\"mg-button\",{\"variant\":[1],\"identifier\":[1],\"label\":[1],\"type\":[1],\"fullWidth\":[4,\"full-width\"],\"form\":[1],\"disabled\":[1028],\"isIcon\":[4,\"is-icon\"],\"disableOnClick\":[4,\"disable-on-click\"],\"loading\":[32],\"classCollection\":[32]},null,{\"variant\":[\"validateVariant\"],\"fullWidth\":[\"validateFullWidth\"],\"disabled\":[\"disabledHandler\"],\"loading\":[\"loadingHandler\"]}],[1,\"mg-tooltip\",{\"identifier\":[1],\"message\":[1],\"placement\":[1],\"display\":[1028],\"disabled\":[4]},null,{\"message\":[\"validateMessage\"],\"display\":[\"handleDisplay\"],\"disabled\":[\"validateDisabled\"]}],[6,\"mg-input-title\",{\"identifier\":[1],\"required\":[4],\"isLegend\":[4,\"is-legend\"],\"tagName\":[32]},null,{\"identifier\":[\"validateIdentifier\"],\"isLegend\":[\"validateIsLegend\"]}],[1,\"mg-tooltip-content\",{\"message\":[1]}],[1,\"mg-icon\",{\"icon\":[1],\"size\":[1],\"variant\":[1],\"variantStyle\":[1025,\"variant-style\"],\"spin\":[4],\"classCollection\":[32]},null,{\"icon\":[\"validateIcon\"],\"size\":[\"validateSize\"],\"variant\":[\"validateVariant\"],\"variantStyle\":[\"validateVariantStyle\"],\"spin\":[\"handleSpin\"]}]]],[\"mg-item-more\",[[1,\"mg-item-more\",{\"icon\":[16],\"slotlabel\":[16],\"size\":[1],\"parentMenu\":[32]},null,{\"icon\":[\"validateIcon\"],\"slotlabel\":[\"validateSlotLabel\"],\"size\":[\"validateSize\"]}]]]]"), options);
6
+ return bootstrapLazy(JSON.parse("[[\"mg-action-more_34\",[[1,\"mg-input-checkbox\",{\"value\":[1040],\"type\":[1025],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"inputVerticalList\":[4,\"input-vertical-list\"],\"required\":[4],\"readonly\":[4],\"displaySelectedValues\":[4,\"display-selected-values\"],\"disabled\":[4],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"checkboxItems\":[32],\"displaySearchInput\":[32],\"searchValue\":[32],\"searchResults\":[32],\"displayError\":[64],\"setError\":[64]},null,{\"value\":[\"validateValue\"],\"type\":[\"validateType\"],\"displaySelectedValues\":[\"validateDisplaySelectedValues\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\",\"validateDisabled\"],\"checkboxItems\":[\"validateCheckboxItems\"],\"searchValue\":[\"validateSearchValue\"]}],[1,\"mg-action-more\",{\"icon\":[1040],\"button\":[16],\"items\":[16],\"displayChevron\":[4,\"display-chevron\"],\"expanded\":[32]},null,{\"icon\":[\"validateIcon\"],\"button\":[\"validateButton\"],\"items\":[\"validateItems\"],\"displayChevron\":[\"validateDisplayChevron\"]}],[1,\"mg-panel\",{\"identifier\":[1],\"panelTitle\":[1025,\"panel-title\"],\"titlePattern\":[1,\"title-pattern\"],\"titlePatternErrorMessage\":[1,\"title-pattern-error-message\"],\"titleEditable\":[1028,\"title-editable\"],\"titlePosition\":[1,\"title-position\"],\"expanded\":[1028],\"expandToggleDisplay\":[1,\"expand-toggle-display\"],\"expandToggleDisabled\":[4,\"expand-toggle-disabled\"],\"classCollection\":[32],\"isEditing\":[32],\"updatedPanelTitle\":[32]},null,{\"panelTitle\":[\"validatePanelTitle\"],\"titlePattern\":[\"validateTitlePattern\"],\"titlePatternErrorMessage\":[\"validateTitlePattern\"],\"titlePosition\":[\"validateTitlePosition\"],\"expanded\":[\"handleExpanded\"],\"expandToggleDisplay\":[\"validateExpandToggleDisplay\"]}],[1,\"mg-input-textarea\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1],\"maxlength\":[2],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[8,\"mg-width\"],\"pattern\":[1],\"patternErrorMessage\":[1,\"pattern-error-message\"],\"rows\":[2],\"tooltip\":[1],\"displayCharacterLeft\":[4,\"display-character-left\"],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"resizable\":[1],\"classCollection\":[32],\"errorMessage\":[32],\"displayError\":[64],\"setError\":[64]},null,{\"value\":[\"handleValue\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"],\"pattern\":[\"validatePattern\"],\"patternErrorMessage\":[\"validatePattern\"],\"displayCharacterLeft\":[\"validateDisplayCharacterLeft\"]}],[1,\"mg-input-date\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"min\":[1],\"max\":[1],\"classCollection\":[32],\"errorMessage\":[32],\"displayError\":[64],\"setError\":[64]},null,{\"value\":[\"validateValue\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"],\"min\":[\"validateMinMax\"],\"max\":[\"validateMinMax\"]}],[1,\"mg-input-numeric\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[8,\"mg-width\"],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"type\":[1],\"currency\":[1],\"max\":[2],\"min\":[2],\"integerLength\":[2,\"integer-length\"],\"decimalLength\":[2,\"decimal-length\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"hasFocus\":[32],\"displayError\":[64],\"setError\":[64]},null,{\"value\":[\"validateValue\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"],\"type\":[\"validateType\"],\"integerLength\":[\"validateIntegerLength\"],\"decimalLength\":[\"validateDecimalLength\"]}],[1,\"mg-input-password\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[8,\"mg-width\"],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"displayError\":[64],\"setError\":[64]},null,{\"value\":[\"handleValue\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"]}],[1,\"mg-input-radio\",{\"value\":[1032],\"items\":[16],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"inputVerticalList\":[4,\"input-vertical-list\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"options\":[32],\"displayError\":[64],\"setError\":[64]},null,{\"value\":[\"handleValue\"],\"items\":[\"validateItems\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"]}],[1,\"mg-input-toggle\",{\"value\":[1032],\"items\":[16],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"isOnOff\":[4,\"is-on-off\"],\"isIcon\":[4,\"is-icon\"],\"readonly\":[4],\"disabled\":[4],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"classCollection\":[32],\"options\":[32],\"checked\":[32]},null,{\"value\":[\"handleValue\"],\"items\":[\"validateItems\"],\"isOnOff\":[\"handleIsOnOff\"],\"isIcon\":[\"handleIsIcon\"],\"readonly\":[\"handleReadonly\"],\"disabled\":[\"handleDisabled\"],\"checked\":[\"handleChecked\"]}],[1,\"mg-message\",{\"identifier\":[1],\"delay\":[2],\"variant\":[1],\"closeButton\":[1028,\"close-button\"],\"hide\":[1028],\"classCollection\":[32],\"hasActions\":[32]},null,{\"delay\":[\"validateDelay\"],\"variant\":[\"validateVariant\"],\"closeButton\":[\"validateCloseButton\"],\"hide\":[\"validateHide\"]}],[1,\"mg-modal\",{\"identifier\":[1],\"dialogRole\":[1,\"dialog-role\"],\"modalTitle\":[1,\"modal-title\"],\"closeButton\":[4,\"close-button\"],\"hide\":[1028],\"hasActions\":[32],\"hasContent\":[32],\"classCollection\":[32]},[[8,\"keydown\",\"handleKeyDown\"]],{\"dialogRole\":[\"validateDialogRole\"],\"modalTitle\":[\"validateModalTitle\"],\"hide\":[\"validateHide\"]}],[1,\"mg-tabs\",{\"identifier\":[1],\"label\":[1],\"size\":[1],\"items\":[16],\"activeTab\":[1538,\"active-tab\"],\"tabs\":[32],\"classCollection\":[32]},null,{\"label\":[\"validateLabel\"],\"size\":[\"validateSize\"],\"items\":[\"validateItems\"],\"activeTab\":[\"validateActiveTab\"]}],[1,\"mg-details\",{\"toggleClosed\":[1,\"toggle-closed\"],\"toggleOpened\":[1,\"toggle-opened\"],\"hideSummary\":[4,\"hide-summary\"],\"expanded\":[1028]},null,{\"toggleClosed\":[\"validateTitles\"],\"toggleOpened\":[\"validateTitles\"],\"expanded\":[\"handleExpanded\"]}],[1,\"mg-divider\",{\"size\":[1]}],[1,\"mg-form\",{\"identifier\":[1],\"name\":[1],\"readonly\":[4],\"disabled\":[4],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"requiredMessage\":[32],\"displayError\":[64]},null,{\"readonly\":[\"handleAttributeChange\"],\"disabled\":[\"handleAttributeChange\"]}],[1,\"mg-illustrated-message\",{\"size\":[1],\"direction\":[1]}],[1,\"mg-skip-links\",{\"links\":[16]},null,{\"links\":[\"validateLinks\"]}],[1,\"mg-tag\",{\"variant\":[1],\"outline\":[4],\"soft\":[4],\"classCollection\":[32]},null,{\"variant\":[\"validateVariant\"],\"outline\":[\"validateOutline\"],\"soft\":[\"validateSoft\"]}],[2,\"mg-input-checkbox-paginated\",{\"readonly\":[4],\"disabled\":[4],\"name\":[1],\"checkboxes\":[16],\"sectionKind\":[1,\"section-kind\"],\"messages\":[16],\"titleKind\":[32],\"currentPage\":[32],\"expanded\":[32]},null,{\"checkboxes\":[\"validateCheckboxes\"],\"sectionKind\":[\"validateSectionKind\"]}],[1,\"mg-menu-item\",{\"identifier\":[1],\"href\":[1],\"status\":[1537],\"expanded\":[1028],\"size\":[32],\"navigationButtonClassList\":[32],\"direction\":[32],\"isInMainMenu\":[32],\"isItemMore\":[32],\"hasChildren\":[32],\"displayNotificationBadge\":[32]},null,{\"status\":[\"validateStatus\"],\"expanded\":[\"validateExpanded\"],\"size\":[\"validateSize\"],\"direction\":[\"validateDirection\"],\"hasChildren\":[\"validateHasChildren\"]}],[1,\"mg-pagination\",{\"identifier\":[1],\"label\":[1025],\"hideNavigationLabels\":[4,\"hide-navigation-labels\"],\"hidePageCount\":[4,\"hide-page-count\"],\"totalPages\":[2,\"total-pages\"],\"currentPage\":[1538,\"current-page\"]},null,{\"totalPages\":[\"validateTotalPages\"],\"currentPage\":[\"validateCurrentPage\"]}],[1,\"mg-input-text\",{\"value\":[1537],\"identifier\":[1],\"name\":[1],\"label\":[1],\"type\":[1],\"icon\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1],\"maxlength\":[2],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[8,\"mg-width\"],\"pattern\":[1],\"patternErrorMessage\":[1,\"pattern-error-message\"],\"tooltip\":[1],\"displayCharacterLeft\":[4,\"display-character-left\"],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"setFocus\":[64],\"displayError\":[64],\"setError\":[64]},null,{\"value\":[\"handleValue\"],\"icon\":[\"validateIcon\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"],\"pattern\":[\"validatePattern\"],\"patternErrorMessage\":[\"validatePattern\"]}],[1,\"mg-menu\",{\"label\":[1],\"direction\":[513],\"itemmore\":[16],\"size\":[1],\"isChildMenu\":[32]},null,{\"label\":[\"validateLabel\"],\"direction\":[\"validateDirection\"],\"itemmore\":[\"validateItemMore\"],\"size\":[\"validateSize\"]}],[1,\"mg-input-select\",{\"value\":[1032],\"items\":[16],\"identifier\":[1],\"name\":[1],\"label\":[1],\"labelOnTop\":[4,\"label-on-top\"],\"labelHide\":[4,\"label-hide\"],\"placeholder\":[1025],\"placeholderHide\":[4,\"placeholder-hide\"],\"placeholderDisabled\":[4,\"placeholder-disabled\"],\"required\":[4],\"readonly\":[4],\"disabled\":[4],\"mgWidth\":[520,\"mg-width\"],\"tooltip\":[1],\"helpText\":[1,\"help-text\"],\"valid\":[1028],\"invalid\":[1028],\"classCollection\":[32],\"errorMessage\":[32],\"options\":[32],\"valueExist\":[32],\"readonlyValue\":[32],\"displayError\":[64],\"setError\":[64]},null,{\"value\":[\"validateValue\"],\"items\":[\"validateItems\"],\"required\":[\"handleValidityChange\"],\"readonly\":[\"handleValidityChange\"],\"disabled\":[\"handleValidityChange\"]}],[1,\"mg-popover\",{\"identifier\":[1],\"placement\":[1],\"arrowHide\":[4,\"arrow-hide\"],\"closeButton\":[4,\"close-button\"],\"display\":[1028],\"disabled\":[4]},null,{\"identifier\":[\"validateIdentifier\"],\"arrowHide\":[\"validateArrowHide\"],\"closeButton\":[\"validateCloseButton\"],\"display\":[\"handleDisplay\"]}],[1,\"mg-badge\",{\"value\":[8],\"label\":[1],\"variant\":[1],\"outline\":[4],\"classCollection\":[32]},null,{\"value\":[\"validateValue\"],\"label\":[\"validateLabel\"],\"variant\":[\"validateVariant\"],\"outline\":[\"validateOutline\"]}],[2,\"mg-character-left\",{\"identifier\":[1],\"characters\":[1],\"maxlength\":[2]},null,{\"maxlength\":[\"validateMaxlength\"]}],[1,\"mg-popover-content\",{\"closeButton\":[4,\"close-button\"],\"classCollection\":[32]}],[1,\"mg-card\",{\"variant\":[1],\"variantStyle\":[1025,\"variant-style\"],\"classCollection\":[32]},null,{\"variant\":[\"validateVariant\"],\"variantStyle\":[\"validateVariantStyle\"]}],[1,\"mg-button\",{\"variant\":[1],\"identifier\":[1],\"label\":[1],\"type\":[1],\"fullWidth\":[4,\"full-width\"],\"form\":[1],\"disabled\":[1028],\"isIcon\":[4,\"is-icon\"],\"disableOnClick\":[4,\"disable-on-click\"],\"loading\":[32],\"classCollection\":[32]},null,{\"variant\":[\"validateVariant\"],\"fullWidth\":[\"validateFullWidth\"],\"disabled\":[\"disabledHandler\"],\"loading\":[\"loadingHandler\"]}],[1,\"mg-tooltip\",{\"identifier\":[1],\"message\":[1],\"placement\":[1],\"display\":[1028],\"disabled\":[4]},null,{\"identifier\":[\"validateIdentifier\"],\"message\":[\"validateMessage\"],\"display\":[\"handleDisplay\"],\"disabled\":[\"validateDisabled\"]}],[6,\"mg-input-title\",{\"identifier\":[1],\"required\":[4],\"isLegend\":[4,\"is-legend\"],\"tagName\":[32]},null,{\"identifier\":[\"validateIdentifier\"],\"isLegend\":[\"validateIsLegend\"]}],[1,\"mg-tooltip-content\",{\"message\":[1]}],[1,\"mg-icon\",{\"icon\":[1],\"size\":[1],\"variant\":[1],\"variantStyle\":[1025,\"variant-style\"],\"spin\":[4],\"classCollection\":[32]},null,{\"icon\":[\"validateIcon\"],\"size\":[\"validateSize\"],\"variant\":[\"validateVariant\"],\"variantStyle\":[\"validateVariantStyle\"],\"spin\":[\"handleSpin\"]}]]],[\"mg-item-more\",[[1,\"mg-item-more\",{\"icon\":[16],\"slotlabel\":[16],\"size\":[1],\"parentMenu\":[32]},null,{\"icon\":[\"validateIcon\"],\"slotlabel\":[\"validateSlotLabel\"],\"size\":[\"validateSize\"]}]]]]"), options);
7
7
  };
8
8
 
9
9
  export { defineCustomElements };