@mgdis/mg-components 4.2.0 → 4.2.1

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 (50) hide show
  1. package/dist/cjs/{index-64cee0c8.js → index-94497267.js} +220 -202
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/mg-badge_23.cjs.entry.js +21 -9
  4. package/dist/cjs/mg-components.cjs.js +2 -2
  5. package/dist/cjs/mg-modal.cjs.entry.js +9 -3
  6. package/dist/cjs/mg-popover.cjs.entry.js +3 -3
  7. package/dist/cjs/{popper-71bf3058.js → popper-11d5f714.js} +60 -49
  8. package/dist/collection/collection-manifest.json +1 -1
  9. package/dist/collection/components/atoms/mg-badge/mg-badge.js +3 -1
  10. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +3 -1
  11. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +3 -1
  12. package/dist/collection/components/molecules/inputs/MgInput.js +3 -1
  13. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
  14. package/dist/collection/components/molecules/mg-modal/mg-modal.css +2 -2
  15. package/dist/collection/components/molecules/mg-modal/mg-modal.js +7 -1
  16. package/dist/collection/components/molecules/mg-panel/mg-panel.js +3 -1
  17. package/dist/collection/components/molecules/mg-popover/mg-popover.css +3 -5
  18. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +3 -1
  19. package/dist/components/MgInput.js +3 -1
  20. package/dist/components/mg-badge2.js +3 -1
  21. package/dist/components/mg-input-numeric.js +1 -1
  22. package/dist/components/mg-input-title2.js +3 -1
  23. package/dist/components/mg-modal.js +8 -2
  24. package/dist/components/mg-panel.js +3 -1
  25. package/dist/components/mg-popover.js +1 -1
  26. package/dist/components/mg-tabs.js +3 -1
  27. package/dist/components/mg-tooltip2.js +3 -1
  28. package/dist/components/popper.js +60 -49
  29. package/dist/esm/{index-120f47fd.js → index-aad0184c.js} +220 -202
  30. package/dist/esm/loader.js +2 -2
  31. package/dist/esm/mg-badge_23.entry.js +21 -9
  32. package/dist/esm/mg-components.js +2 -2
  33. package/dist/esm/mg-modal.entry.js +9 -3
  34. package/dist/esm/mg-popover.entry.js +3 -3
  35. package/dist/esm/polyfills/css-shim.js +1 -1
  36. package/dist/esm/{popper-93ecb064.js → popper-f860750c.js} +60 -49
  37. package/dist/mg-components/mg-components.css +1 -1
  38. package/dist/mg-components/mg-components.esm.js +1 -1
  39. package/dist/mg-components/p-25452f60.entry.js +1 -0
  40. package/dist/mg-components/p-3899d5d2.js +2 -0
  41. package/dist/mg-components/p-a20fc541.entry.js +1 -0
  42. package/dist/mg-components/{p-b380a0df.entry.js → p-e08bc19a.entry.js} +1 -1
  43. package/dist/mg-components/p-ec26fc38.js +1 -0
  44. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -0
  45. package/dist/types/stencil-public-runtime.d.ts +15 -4
  46. package/package.json +2 -2
  47. package/dist/mg-components/p-21991be8.entry.js +0 -1
  48. package/dist/mg-components/p-36a64f8c.entry.js +0 -1
  49. package/dist/mg-components/p-4c66f794.js +0 -1
  50. package/dist/mg-components/p-7bc32a2f.js +0 -2
@@ -22,6 +22,14 @@ function _interopNamespace(e) {
22
22
 
23
23
  const NAMESPACE = 'mg-components';
24
24
 
25
+ /**
26
+ * Virtual DOM patching algorithm based on Snabbdom by
27
+ * Simon Friis Vindum (@paldepind)
28
+ * Licensed under the MIT License
29
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
30
+ *
31
+ * Modified for Stencil's renderer and slot projection
32
+ */
25
33
  let scopeId;
26
34
  let contentRef;
27
35
  let hostTagName;
@@ -30,62 +38,6 @@ let checkSlotFallbackVisibility = false;
30
38
  let checkSlotRelocate = false;
31
39
  let isSvgMode = false;
32
40
  let queuePending = false;
33
- const win = typeof window !== 'undefined' ? window : {};
34
- const doc = win.document || { head: {} };
35
- const plt = {
36
- $flags$: 0,
37
- $resourcesUrl$: '',
38
- jmp: (h) => h(),
39
- raf: (h) => requestAnimationFrame(h),
40
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
41
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
42
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
43
- };
44
- const promiseResolve = (v) => Promise.resolve(v);
45
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
46
- try {
47
- new CSSStyleSheet();
48
- return typeof new CSSStyleSheet().replaceSync === 'function';
49
- }
50
- catch (e) { }
51
- return false;
52
- })()
53
- ;
54
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
55
- if (listeners) {
56
- listeners.map(([flags, name, method]) => {
57
- const target = getHostListenerTarget(elm, flags) ;
58
- const handler = hostListenerProxy(hostRef, method);
59
- const opts = hostListenerOpts(flags);
60
- plt.ael(target, name, handler, opts);
61
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
62
- });
63
- }
64
- };
65
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
66
- try {
67
- {
68
- if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
69
- // instance is ready, let's call it's member method for this event
70
- hostRef.$lazyInstance$[methodName](ev);
71
- }
72
- else {
73
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
74
- }
75
- }
76
- }
77
- catch (e) {
78
- consoleError(e);
79
- }
80
- };
81
- const getHostListenerTarget = (elm, flags) => {
82
- if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
83
- return win;
84
- return elm;
85
- };
86
- // prettier-ignore
87
- const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
88
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
89
41
  const createTime = (fnName, tagName = '') => {
90
42
  {
91
43
  return () => {
@@ -100,79 +52,7 @@ const uniqueTime = (key, measureText) => {
100
52
  };
101
53
  }
102
54
  };
103
- const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
104
- const registerStyle = (scopeId, cssText, allowCS) => {
105
- let style = styles.get(scopeId);
106
- if (supportsConstructableStylesheets && allowCS) {
107
- style = (style || new CSSStyleSheet());
108
- if (typeof style === 'string') {
109
- style = cssText;
110
- }
111
- else {
112
- style.replaceSync(cssText);
113
- }
114
- }
115
- else {
116
- style = cssText;
117
- }
118
- styles.set(scopeId, style);
119
- };
120
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
121
- let scopeId = getScopeId(cmpMeta);
122
- const style = styles.get(scopeId);
123
- // if an element is NOT connected then getRootNode() will return the wrong root node
124
- // so the fallback is to always use the document for the root node in those cases
125
- styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
126
- if (style) {
127
- if (typeof style === 'string') {
128
- styleContainerNode = styleContainerNode.head || styleContainerNode;
129
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
130
- let styleElm;
131
- if (!appliedStyles) {
132
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
133
- }
134
- if (!appliedStyles.has(scopeId)) {
135
- {
136
- {
137
- styleElm = doc.createElement('style');
138
- styleElm.innerHTML = style;
139
- }
140
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
141
- }
142
- if (appliedStyles) {
143
- appliedStyles.add(scopeId);
144
- }
145
- }
146
- }
147
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
148
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
149
- }
150
- }
151
- return scopeId;
152
- };
153
- const attachStyles = (hostRef) => {
154
- const cmpMeta = hostRef.$cmpMeta$;
155
- const elm = hostRef.$hostElement$;
156
- const flags = cmpMeta.$flags$;
157
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
158
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
159
- if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
160
- // only required when we're NOT using native shadow dom (slot)
161
- // or this browser doesn't support native shadow dom
162
- // and this host element was NOT created with SSR
163
- // let's pick out the inner content for slot projection
164
- // create a node to represent where the original
165
- // content was first placed, which is useful later on
166
- // DOM WRITE!!
167
- elm['s-sc'] = scopeId;
168
- elm.classList.add(scopeId + '-h');
169
- if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
170
- elm.classList.add(scopeId + '-s');
171
- }
172
- }
173
- endAttachStyles();
174
- };
175
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
55
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
176
56
  /**
177
57
  * Default style mode id
178
58
  */
@@ -310,6 +190,152 @@ const convertToPrivate = (node) => {
310
190
  vnode.$name$ = node.vname;
311
191
  return vnode;
312
192
  };
193
+ /**
194
+ * Parse a new property value for a given property type.
195
+ *
196
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
197
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
198
+ * 1. `any`, the type given to `propValue` in the function signature
199
+ * 2. the type stored from `propType`.
200
+ *
201
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
202
+ *
203
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
204
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
205
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
206
+ * ```tsx
207
+ * <my-cmp prop-val={0}></my-cmp>
208
+ * ```
209
+ *
210
+ * HTML prop values on the other hand, will always a string
211
+ *
212
+ * @param propValue the new value to coerce to some type
213
+ * @param propType the type of the prop, expressed as a binary number
214
+ * @returns the parsed/coerced value
215
+ */
216
+ const parsePropertyValue = (propValue, propType) => {
217
+ // ensure this value is of the correct prop type
218
+ if (propValue != null && !isComplexType(propValue)) {
219
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
220
+ // per the HTML spec, any string value means it is a boolean true value
221
+ // but we'll cheat here and say that the string "false" is the boolean false
222
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
223
+ }
224
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
225
+ // force it to be a number
226
+ return parseFloat(propValue);
227
+ }
228
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
229
+ // could have been passed as a number or boolean
230
+ // but we still want it as a string
231
+ return String(propValue);
232
+ }
233
+ // redundant return here for better minification
234
+ return propValue;
235
+ }
236
+ // not sure exactly what type we want
237
+ // so no need to change to a different type
238
+ return propValue;
239
+ };
240
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
241
+ const createEvent = (ref, name, flags) => {
242
+ const elm = getElement(ref);
243
+ return {
244
+ emit: (detail) => {
245
+ return emitEvent(elm, name, {
246
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
247
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
248
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
249
+ detail,
250
+ });
251
+ },
252
+ };
253
+ };
254
+ /**
255
+ * Helper function to create & dispatch a custom Event on a provided target
256
+ * @param elm the target of the Event
257
+ * @param name the name to give the custom Event
258
+ * @param opts options for configuring a custom Event
259
+ * @returns the custom Event
260
+ */
261
+ const emitEvent = (elm, name, opts) => {
262
+ const ev = plt.ce(name, opts);
263
+ elm.dispatchEvent(ev);
264
+ return ev;
265
+ };
266
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
267
+ const registerStyle = (scopeId, cssText, allowCS) => {
268
+ let style = styles.get(scopeId);
269
+ if (supportsConstructableStylesheets && allowCS) {
270
+ style = (style || new CSSStyleSheet());
271
+ if (typeof style === 'string') {
272
+ style = cssText;
273
+ }
274
+ else {
275
+ style.replaceSync(cssText);
276
+ }
277
+ }
278
+ else {
279
+ style = cssText;
280
+ }
281
+ styles.set(scopeId, style);
282
+ };
283
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
284
+ let scopeId = getScopeId(cmpMeta);
285
+ const style = styles.get(scopeId);
286
+ // if an element is NOT connected then getRootNode() will return the wrong root node
287
+ // so the fallback is to always use the document for the root node in those cases
288
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
289
+ if (style) {
290
+ if (typeof style === 'string') {
291
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
292
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
293
+ let styleElm;
294
+ if (!appliedStyles) {
295
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
296
+ }
297
+ if (!appliedStyles.has(scopeId)) {
298
+ {
299
+ {
300
+ styleElm = doc.createElement('style');
301
+ styleElm.innerHTML = style;
302
+ }
303
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
304
+ }
305
+ if (appliedStyles) {
306
+ appliedStyles.add(scopeId);
307
+ }
308
+ }
309
+ }
310
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
311
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
312
+ }
313
+ }
314
+ return scopeId;
315
+ };
316
+ const attachStyles = (hostRef) => {
317
+ const cmpMeta = hostRef.$cmpMeta$;
318
+ const elm = hostRef.$hostElement$;
319
+ const flags = cmpMeta.$flags$;
320
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
321
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
322
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
323
+ // only required when we're NOT using native shadow dom (slot)
324
+ // or this browser doesn't support native shadow dom
325
+ // and this host element was NOT created with SSR
326
+ // let's pick out the inner content for slot projection
327
+ // create a node to represent where the original
328
+ // content was first placed, which is useful later on
329
+ // DOM WRITE!!
330
+ elm['s-sc'] = scopeId;
331
+ elm.classList.add(scopeId + '-h');
332
+ if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
333
+ elm.classList.add(scopeId + '-s');
334
+ }
335
+ }
336
+ endAttachStyles();
337
+ };
338
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
313
339
  /**
314
340
  * Production setAccessor() function based on Preact by
315
341
  * Jason Miller (@developit)
@@ -1172,32 +1198,6 @@ const renderVdom = (hostRef, renderFnResults) => {
1172
1198
  relocateNodes.length = 0;
1173
1199
  }
1174
1200
  };
1175
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
1176
- const createEvent = (ref, name, flags) => {
1177
- const elm = getElement(ref);
1178
- return {
1179
- emit: (detail) => {
1180
- return emitEvent(elm, name, {
1181
- bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
1182
- composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
1183
- cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
1184
- detail,
1185
- });
1186
- },
1187
- };
1188
- };
1189
- /**
1190
- * Helper function to create & dispatch a custom Event on a provided target
1191
- * @param elm the target of the Event
1192
- * @param name the name to give the custom Event
1193
- * @param opts options for configuring a custom Event
1194
- * @returns the custom Event
1195
- */
1196
- const emitEvent = (elm, name, opts) => {
1197
- const ev = plt.ce(name, opts);
1198
- elm.dispatchEvent(ev);
1199
- return ev;
1200
- };
1201
1201
  const attachToAncestor = (hostRef, ancestorComponent) => {
1202
1202
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1203
1203
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
@@ -1369,53 +1369,6 @@ const then = (promise, thenFn) => {
1369
1369
  };
1370
1370
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1371
1371
  ;
1372
- /**
1373
- * Parse a new property value for a given property type.
1374
- *
1375
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
1376
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
1377
- * 1. `any`, the type given to `propValue` in the function signature
1378
- * 2. the type stored from `propType`.
1379
- *
1380
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
1381
- *
1382
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
1383
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
1384
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
1385
- * ```tsx
1386
- * <my-cmp prop-val={0}></my-cmp>
1387
- * ```
1388
- *
1389
- * HTML prop values on the other hand, will always a string
1390
- *
1391
- * @param propValue the new value to coerce to some type
1392
- * @param propType the type of the prop, expressed as a binary number
1393
- * @returns the parsed/coerced value
1394
- */
1395
- const parsePropertyValue = (propValue, propType) => {
1396
- // ensure this value is of the correct prop type
1397
- if (propValue != null && !isComplexType(propValue)) {
1398
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
1399
- // per the HTML spec, any string value means it is a boolean true value
1400
- // but we'll cheat here and say that the string "false" is the boolean false
1401
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1402
- }
1403
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
1404
- // force it to be a number
1405
- return parseFloat(propValue);
1406
- }
1407
- if (propType & 1 /* MEMBER_FLAGS.String */) {
1408
- // could have been passed as a number or boolean
1409
- // but we still want it as a string
1410
- return String(propValue);
1411
- }
1412
- // redundant return here for better minification
1413
- return propValue;
1414
- }
1415
- // not sure exactly what type we want
1416
- // so no need to change to a different type
1417
- return propValue;
1418
- };
1419
1372
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1420
1373
  const setValue = (ref, propName, newVal, cmpMeta) => {
1421
1374
  // check our new property value against our internal value
@@ -1459,6 +1412,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1459
1412
  }
1460
1413
  }
1461
1414
  };
1415
+ /**
1416
+ * Attach a series of runtime constructs to a compiled Stencil component
1417
+ * constructor, including getters and setters for the `@Prop` and `@State`
1418
+ * decorators, callbacks for when attributes change, and so on.
1419
+ *
1420
+ * @param Cstr the constructor for a component that we need to process
1421
+ * @param cmpMeta metadata collected previously about the component
1422
+ * @param flags a number used to store a series of bit flags
1423
+ * @returns a reference to the same constructor passed in (but now mutated)
1424
+ */
1462
1425
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1463
1426
  if (cmpMeta.$members$) {
1464
1427
  if (Cstr.watchers) {
@@ -1818,6 +1781,40 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1818
1781
  // Fallback appLoad event
1819
1782
  endBootstrap();
1820
1783
  };
1784
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1785
+ if (listeners) {
1786
+ listeners.map(([flags, name, method]) => {
1787
+ const target = getHostListenerTarget(elm, flags) ;
1788
+ const handler = hostListenerProxy(hostRef, method);
1789
+ const opts = hostListenerOpts(flags);
1790
+ plt.ael(target, name, handler, opts);
1791
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1792
+ });
1793
+ }
1794
+ };
1795
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1796
+ try {
1797
+ {
1798
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1799
+ // instance is ready, let's call it's member method for this event
1800
+ hostRef.$lazyInstance$[methodName](ev);
1801
+ }
1802
+ else {
1803
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1804
+ }
1805
+ }
1806
+ }
1807
+ catch (e) {
1808
+ consoleError(e);
1809
+ }
1810
+ };
1811
+ const getHostListenerTarget = (elm, flags) => {
1812
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1813
+ return win;
1814
+ return elm;
1815
+ };
1816
+ // prettier-ignore
1817
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1821
1818
  const hostRefs = /*@__PURE__*/ new WeakMap();
1822
1819
  const getHostRef = (ref) => hostRefs.get(ref);
1823
1820
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
@@ -1864,6 +1861,27 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1864
1861
  }, consoleError);
1865
1862
  };
1866
1863
  const styles = /*@__PURE__*/ new Map();
1864
+ const win = typeof window !== 'undefined' ? window : {};
1865
+ const doc = win.document || { head: {} };
1866
+ const plt = {
1867
+ $flags$: 0,
1868
+ $resourcesUrl$: '',
1869
+ jmp: (h) => h(),
1870
+ raf: (h) => requestAnimationFrame(h),
1871
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1872
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1873
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1874
+ };
1875
+ const promiseResolve = (v) => Promise.resolve(v);
1876
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1877
+ try {
1878
+ new CSSStyleSheet();
1879
+ return typeof new CSSStyleSheet().replaceSync === 'function';
1880
+ }
1881
+ catch (e) { }
1882
+ return false;
1883
+ })()
1884
+ ;
1867
1885
  const queueDomReads = [];
1868
1886
  const queueDomWrites = [];
1869
1887
  const queueTask = (queue, write) => (cb) => {
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-64cee0c8.js');
5
+ const index = require('./index-94497267.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.18.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.18.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-64cee0c8.js');
5
+ const index = require('./index-94497267.js');
6
6
  const index$1 = require('./index-179621c8.js');
7
- const popper = require('./popper-71bf3058.js');
7
+ const popper = require('./popper-11d5f714.js');
8
8
 
9
9
  /**
10
10
  * List of all possibles variants
@@ -37,7 +37,9 @@ const MgBadge = class {
37
37
  }
38
38
  validateLabel(newValue) {
39
39
  if (typeof newValue !== 'string' || newValue.trim() === '') {
40
- throw new Error('<mg-badge> prop "label" is required.');
40
+ // TODO: throw new Error on next major (5.0.0)
41
+ // throw new Error('<mg-badge> prop "label" is required.');
42
+ console.error('<mg-badge> prop "label" is required.');
41
43
  }
42
44
  }
43
45
  validateVariant(newValue, oldValue) {
@@ -796,7 +798,9 @@ const MgInput = (props, children, utils) => {
796
798
  * Check required properties
797
799
  */
798
800
  if (typeof props.identifier !== 'string' || props.identifier.trim() === '') {
799
- throw new Error('<mg-input> prop "identifier" is required.');
801
+ // TODO: throw new Error on next major (5.0.0)
802
+ // throw new Error('<mg-input> prop "identifier" is required.');
803
+ console.error('<mg-input> prop "identifier" is required.');
800
804
  }
801
805
  if (typeof props.label !== 'string' || props.label.trim() === '') {
802
806
  throw new Error('<mg-input> prop "label" is required.');
@@ -1470,7 +1474,7 @@ const MgInputNumeric = class {
1470
1474
  // Split number and decimal
1471
1475
  const [integer, decimal = ''] = newValue.replace('-', '').split(/[\.,]/);
1472
1476
  // Regex
1473
- const regex = this.type === 'integer' ? /^[\-]?\d+$/ : /^[\-]?\d+[.,]?\d*$/;
1477
+ const regex = this.type === 'integer' ? /^-?\d+$/ : /^-?\d+[.,]?\d*$/;
1474
1478
  // Filter input
1475
1479
  if (newValue === '' || (newValue.match(regex) && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength))) {
1476
1480
  this.storedValue = newValue;
@@ -2512,7 +2516,9 @@ const MgInputTitle = class {
2512
2516
  }
2513
2517
  validateIdentifier(newValue) {
2514
2518
  if (typeof newValue !== 'string' || newValue.trim() === '') {
2515
- throw new Error('<mg-input-title> prop "identifier" is required.');
2519
+ // TODO: throw new Error on next major (5.0.0)
2520
+ // throw new Error('<mg-input-title> prop "identifier" is required.');
2521
+ console.error('<mg-input-title> prop "identifier" is required.');
2516
2522
  }
2517
2523
  }
2518
2524
  /*************
@@ -3142,7 +3148,9 @@ const MgPanel = class {
3142
3148
  }
3143
3149
  validatePanelTitle(newValue) {
3144
3150
  if (typeof newValue !== 'string' || newValue.trim() === '') {
3145
- throw new Error('<mg-panel> prop "panelTitle" is required.');
3151
+ // TODO: throw new Error on next major (5.0.0)
3152
+ // throw new Error('<mg-panel> prop "panelTitle" is required.');
3153
+ console.error('<mg-panel> prop "panelTitle" is required.');
3146
3154
  }
3147
3155
  this.titleChange.emit(newValue);
3148
3156
  }
@@ -3346,7 +3354,9 @@ const MgTabs = class {
3346
3354
  }
3347
3355
  validateLabel(newValue) {
3348
3356
  if (typeof newValue !== 'string' || newValue.trim() === '') {
3349
- throw new Error('<mg-tabs> prop "label" is required.');
3357
+ // TODO: throw new Error on next major (5.0.0)
3358
+ // throw new Error('<mg-tabs> prop "label" is required.');
3359
+ console.error('<mg-tabs> prop "label" is required.');
3350
3360
  }
3351
3361
  }
3352
3362
  validateSize(newValue) {
@@ -3587,7 +3597,9 @@ const MgTooltip = class {
3587
3597
  }
3588
3598
  validateMessage(newValue) {
3589
3599
  if (typeof newValue !== 'string' || newValue.trim() === '') {
3590
- throw new Error('<mg-tooltip> prop "message" is required.');
3600
+ // TODO: throw new Error on next major (5.0.0)
3601
+ // throw new Error('<mg-tooltip> prop "message" is required.');
3602
+ console.error('<mg-tooltip> prop "message" is required.');
3591
3603
  }
3592
3604
  }
3593
3605
  handleDisplay(newValue) {
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-64cee0c8.js');
3
+ const index = require('./index-94497267.js');
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v2.18.0 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v2.18.1 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  const patchBrowser = () => {
9
9
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('mg-components.cjs.js', document.baseURI).href));
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-64cee0c8.js');
5
+ const index = require('./index-94497267.js');
6
6
  const index$1 = require('./index-179621c8.js');
7
7
 
8
- const mgModalCss = ".mg-modal{display:flex;justify-content:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;padding:2rem 0;background-color:hsla(var(--color-light), 85%)}.mg-modal__dialog{display:flex;flex-direction:column;align-self:center;row-gap:3rem;padding:1.5rem 2.5rem;width:60rem;height:fit-content;max-width:100%;max-height:100%;box-sizing:border-box;background-color:hsl(var(--color-light));box-shadow:var(--box-shadow);border-radius:var(--mg-modal-border-radius)}.mg-modal__header{margin-bottom:0.5rem}.mg-modal__title{margin:0;font-family:var(--font-family-heading);font-size:var(--mg-modal-title-font-size);font-weight:600}.mg-modal__close-button{float:right;height:var(--mg-modal-title-font-size);margin-top:calc((var(--default-size) - var(--mg-modal-title-font-size) * var(--line-height)) / 2 * -1);margin-right:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2 * -1)}.mg-modal .mg-modal__content{overflow-y:auto}.mg-modal .mg-modal__content::slotted(*){font-size:var(--mg-modal-content-font-size)}.mg-modal.mg-modal--hide{display:none}";
8
+ const mgModalCss = ".mg-modal{display:flex;justify-content:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;padding:2rem 0;background-color:hsla(var(--color-light), 85%)}.mg-modal__dialog{display:flex;flex-direction:column;align-self:center;row-gap:3rem;padding:1.5rem 2.5rem;width:60rem;height:fit-content;max-width:100%;max-height:100%;box-sizing:border-box;background-color:hsl(var(--color-light));box-shadow:var(--box-shadow);border-radius:var(--mg-modal-border-radius)}.mg-modal__header{margin-bottom:0.5rem}.mg-modal__title{margin:0;font-family:var(--font-family-heading);font-size:var(--mg-modal-title-font-size);font-weight:600}.mg-modal__close-button{float:right;height:var(--mg-modal-title-font-size);margin-top:calc((var(--default-size) - var(--mg-modal-title-font-size) * var(--line-height)) / 2 * -1);margin-right:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2 * -1)}.mg-modal__content{overflow-y:auto}.mg-modal__content::slotted(*){font-size:var(--mg-modal-content-font-size)}.mg-modal.mg-modal--hide{display:none}";
9
9
 
10
10
  const MgModal = class {
11
11
  constructor(hostRef) {
@@ -59,17 +59,21 @@ const MgModal = class {
59
59
  }
60
60
  validateModalTitle(newValue) {
61
61
  if (typeof newValue !== 'string' || newValue.trim() === '') {
62
- throw new Error('<mg-modal> prop "modalTitle" is required.');
62
+ // TODO: throw new Error on next major (5.0.0)
63
+ // throw new Error('<mg-modal> prop "modalTitle" is required.');
64
+ console.error('<mg-modal> prop "modalTitle" is required.');
63
65
  }
64
66
  }
65
67
  validateHide(newValue) {
66
68
  if (newValue) {
67
69
  this.componentHide.emit();
68
70
  this.classList.add(this.classHide);
71
+ document.body.style.overflow = this.bodyOverflow;
69
72
  }
70
73
  else {
71
74
  this.componentShow.emit();
72
75
  this.classList.delete(this.classHide);
76
+ document.body.style.overflow = 'hidden';
73
77
  }
74
78
  }
75
79
  /**
@@ -93,6 +97,8 @@ const MgModal = class {
93
97
  * @returns {void}
94
98
  */
95
99
  componentWillLoad() {
100
+ // Store body overflow
101
+ this.bodyOverflow = document.body.style.overflow;
96
102
  // Get locales
97
103
  this.messages = index$1.initLocales(this.element).messages;
98
104
  // Validate
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-64cee0c8.js');
5
+ const index = require('./index-94497267.js');
6
6
  const index$1 = require('./index-179621c8.js');
7
- const popper = require('./popper-71bf3058.js');
7
+ const popper = require('./popper-11d5f714.js');
8
8
 
9
- const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color));box-shadow:var(--box-shadow);color:hsl(var(--mg-popover-font-color))}.mg-popover[data-show].sc-mg-popover{display:block}.mg-popover.sc-mg-popover mg-button.sc-mg-popover{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover,.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{position:absolute;width:2rem;height:2rem;z-index:-1;background:inherit}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover{visibility:hidden}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-popover[data-popper-placement^=top].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{bottom:-6px}.mg-popover[data-popper-placement^=bottom].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{top:-6px}.mg-popover[data-popper-placement^=left].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{right:-6px}.mg-popover[data-popper-placement^=right].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{left:-6px}.mg-popover__title.sc-mg-popover-s>[slot=title],.mg-popover__title .sc-mg-popover-s>[slot=title]{margin:0 0 1rem;font-size:var(--mg-popover-title-font-size);font-weight:600}";
9
+ const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color));box-shadow:var(--box-shadow);color:hsl(var(--mg-popover-font-color))}.mg-popover[data-show].sc-mg-popover{display:block}.mg-popover.sc-mg-popover mg-button.sc-mg-popover{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover__arrow.sc-mg-popover,.mg-popover__arrow.sc-mg-popover::before{position:absolute;width:2rem;height:2rem;z-index:-1;background:inherit}.mg-popover__arrow.sc-mg-popover{visibility:hidden}.mg-popover__arrow.sc-mg-popover::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-popover[data-popper-placement^=top].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{bottom:-6px}.mg-popover[data-popper-placement^=bottom].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{top:-6px}.mg-popover[data-popper-placement^=left].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{right:-6px}.mg-popover[data-popper-placement^=right].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{left:-6px}.mg-popover__title.sc-mg-popover-s>[slot=title],.mg-popover__title .sc-mg-popover-s>[slot=title]{margin:0 0 1rem;font-size:var(--mg-popover-title-font-size);font-weight:600}";
10
10
 
11
11
  const MgPopover = class {
12
12
  constructor(hostRef) {