@mgdis/mg-components 5.13.0 → 5.13.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.
- package/dist/cjs/{index-03d2557d.js → index-fede8ee2.js} +8 -33
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_32.cjs.entry.js +217 -50
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +2 -2
- package/dist/cjs/{mg-menu.conf-857748e1.js → mg-menu.conf-f9d0ddec.js} +12 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +20 -6
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +7 -4
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +3 -0
- package/dist/collection/locales/fr/messages.json +12 -6
- package/dist/collection/utils/unit.test.utils.js +27 -0
- package/dist/components/index2.js +12 -6
- package/dist/components/mg-icon2.js +207 -44
- package/dist/components/mg-input-title2.js +6 -5
- package/dist/components/mg-modal.js +3 -0
- package/dist/esm/{index-407d5211.js → index-1d40b052.js} +8 -33
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mg-action-more_32.entry.js +217 -50
- package/dist/esm/mg-components.js +2 -2
- package/dist/esm/mg-item-more.entry.js +2 -2
- package/dist/esm/{mg-menu.conf-c31828ca.js → mg-menu.conf-2cc079ae.js} +12 -6
- package/dist/mg-components/locales/fr/messages.json +12 -6
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-622e2323.js → p-067080e4.js} +1 -1
- package/dist/mg-components/p-3bf1e2f0.js +2 -0
- package/dist/mg-components/{p-d37b29bb.entry.js → p-4ae1130f.entry.js} +1 -1
- package/dist/mg-components/p-b790596f.entry.js +1 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +12 -3
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +3 -0
- package/dist/types/locales/index.d.ts +12 -6
- package/dist/types/utils/components.utils.d.ts +3 -0
- package/dist/types/utils/unit.test.utils.d.ts +4 -4
- package/package.json +7 -6
- package/dist/mg-components/p-3bf533f7.js +0 -2
- package/dist/mg-components/p-bda0b795.entry.js +0 -1
|
@@ -6,9 +6,6 @@ const MgInputTitle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|
|
9
|
-
this.getTagName = () => {
|
|
10
|
-
this.tagName = this.isLegend ? 'legend' : 'label';
|
|
11
|
-
};
|
|
12
9
|
this.identifier = undefined;
|
|
13
10
|
this.required = undefined;
|
|
14
11
|
this.isLegend = false;
|
|
@@ -19,6 +16,9 @@ const MgInputTitle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
19
16
|
throw new Error('<mg-input-title> prop "identifier" is required.');
|
|
20
17
|
}
|
|
21
18
|
}
|
|
19
|
+
validateIsLegend(newValue) {
|
|
20
|
+
this.tagName = newValue ? 'legend' : 'label';
|
|
21
|
+
}
|
|
22
22
|
/*************
|
|
23
23
|
* Lifecycle *
|
|
24
24
|
*************/
|
|
@@ -27,7 +27,7 @@ const MgInputTitle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
27
27
|
*/
|
|
28
28
|
componentWillLoad() {
|
|
29
29
|
this.validateIdentifier(this.identifier);
|
|
30
|
-
this.
|
|
30
|
+
this.validateIsLegend(this.isLegend);
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Render
|
|
@@ -39,7 +39,8 @@ const MgInputTitle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
39
39
|
return (h(TagName, { class: "mg-input-title", htmlFor: this.isLegend ? undefined : this.identifier }, h("slot", null), this.required && (h("span", { class: "mg-input-title__required" }, "\u00A0", h("span", { class: "is-asterisk" }, "*")))));
|
|
40
40
|
}
|
|
41
41
|
static get watchers() { return {
|
|
42
|
-
"identifier": ["validateIdentifier"]
|
|
42
|
+
"identifier": ["validateIdentifier"],
|
|
43
|
+
"isLegend": ["validateIsLegend"]
|
|
43
44
|
}; }
|
|
44
45
|
static get style() { return mgInputTitleCss; }
|
|
45
46
|
}, [6, "mg-input-title", {
|
|
@@ -19,6 +19,9 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
19
19
|
// IDs
|
|
20
20
|
this.closeButtonId = '';
|
|
21
21
|
this.titleId = '';
|
|
22
|
+
/**
|
|
23
|
+
* Method to manage focus on modal focusable elements
|
|
24
|
+
*/
|
|
22
25
|
this.setFocus = () => {
|
|
23
26
|
// Get all focusable elements
|
|
24
27
|
this.modalFocusableElements = Array.from(this.element.querySelectorAll(focusableElements)).reduce((acc, focusableElement) => {
|
|
@@ -40,11 +40,6 @@ const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
|
40
40
|
* Don't add values to these!!
|
|
41
41
|
*/
|
|
42
42
|
const EMPTY_OBJ = {};
|
|
43
|
-
/**
|
|
44
|
-
* Namespaces
|
|
45
|
-
*/
|
|
46
|
-
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
47
|
-
const HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
48
43
|
const isDef = (v) => v != null;
|
|
49
44
|
const isComplexType = (o) => {
|
|
50
45
|
// https://jsperf.com/typeof-fn-object/5
|
|
@@ -564,17 +559,10 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
564
559
|
doc.createTextNode('');
|
|
565
560
|
}
|
|
566
561
|
else {
|
|
567
|
-
if (!isSvgMode) {
|
|
568
|
-
isSvgMode = newVNode.$tag$ === 'svg';
|
|
569
|
-
}
|
|
570
562
|
// create element
|
|
571
|
-
elm = newVNode.$elm$ = (doc.
|
|
563
|
+
elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
572
564
|
? 'slot-fb'
|
|
573
|
-
: newVNode.$tag$)
|
|
574
|
-
);
|
|
575
|
-
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
|
576
|
-
isSvgMode = false;
|
|
577
|
-
}
|
|
565
|
+
: newVNode.$tag$));
|
|
578
566
|
// add css classes, attrs, props, listeners, etc.
|
|
579
567
|
{
|
|
580
568
|
updateElement(null, newVNode, isSvgMode);
|
|
@@ -595,16 +583,6 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
595
583
|
}
|
|
596
584
|
}
|
|
597
585
|
}
|
|
598
|
-
{
|
|
599
|
-
if (newVNode.$tag$ === 'svg') {
|
|
600
|
-
// Only reset the SVG context when we're exiting <svg> element
|
|
601
|
-
isSvgMode = false;
|
|
602
|
-
}
|
|
603
|
-
else if (elm.tagName === 'foreignObject') {
|
|
604
|
-
// Reenter SVG context when we're exiting <foreignObject> element
|
|
605
|
-
isSvgMode = true;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
586
|
}
|
|
609
587
|
{
|
|
610
588
|
elm['s-hn'] = hostTagName;
|
|
@@ -988,11 +966,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
988
966
|
const text = newVNode.$text$;
|
|
989
967
|
let defaultHolder;
|
|
990
968
|
if (text === null) {
|
|
991
|
-
{
|
|
992
|
-
// test if we're rendering an svg element, or still rendering nodes inside of one
|
|
993
|
-
// only add this to the when the compiler sees we're using an svg somewhere
|
|
994
|
-
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
|
995
|
-
}
|
|
996
969
|
{
|
|
997
970
|
if (tag === 'slot')
|
|
998
971
|
;
|
|
@@ -1021,9 +994,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
1021
994
|
// no new child vnodes, but there are old child vnodes to remove
|
|
1022
995
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1023
996
|
}
|
|
1024
|
-
if (isSvgMode && tag === 'svg') {
|
|
1025
|
-
isSvgMode = false;
|
|
1026
|
-
}
|
|
1027
997
|
}
|
|
1028
998
|
else if ((defaultHolder = elm['s-cr'])) {
|
|
1029
999
|
// this element has slotted content
|
|
@@ -1310,6 +1280,11 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1310
1280
|
promise = safeCall(instance, 'componentWillLoad');
|
|
1311
1281
|
}
|
|
1312
1282
|
}
|
|
1283
|
+
else {
|
|
1284
|
+
{
|
|
1285
|
+
promise = safeCall(instance, 'componentWillUpdate');
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1313
1288
|
endSchedule();
|
|
1314
1289
|
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1315
1290
|
};
|
|
@@ -1350,7 +1325,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1350
1325
|
};
|
|
1351
1326
|
const callRender = (hostRef, instance, elm) => {
|
|
1352
1327
|
try {
|
|
1353
|
-
instance = instance.render()
|
|
1328
|
+
instance = instance.render && instance.render();
|
|
1354
1329
|
{
|
|
1355
1330
|
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1356
1331
|
}
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-1d40b052.js';
|
|
2
|
+
export { s as setNonce } from './index-1d40b052.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Esm v2.22.1 | MIT Licensed | https://stenciljs.com
|