@mgdis/mg-components 5.13.0 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-03d2557d.js → index-fede8ee2.js} +8 -33
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_32.cjs.entry.js +289 -97
- package/dist/cjs/mg-components.cjs.js +2 -2
- 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/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +4 -4
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +2 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.css +3 -0
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.css +4 -0
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +64 -36
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +3 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
- package/dist/collection/locales/fr/messages.json +12 -6
- package/dist/collection/styles/global.scss +0 -7
- package/dist/collection/utils/unit.test.utils.js +27 -0
- package/dist/components/index2.js +12 -6
- package/dist/components/mg-details.js +2 -2
- package/dist/components/mg-form.js +1 -1
- package/dist/components/mg-icon2.js +207 -44
- package/dist/components/mg-input-checkbox-paginated2.js +4 -4
- package/dist/components/mg-input-select2.js +2 -2
- package/dist/components/mg-input-title2.js +6 -5
- package/dist/components/mg-message.js +1 -1
- package/dist/components/mg-modal.js +64 -36
- package/dist/components/mg-pagination2.js +2 -2
- package/dist/components/mg-panel.js +2 -2
- package/dist/esm/{index-407d5211.js → index-1d40b052.js} +8 -33
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_32.entry.js +289 -97
- package/dist/esm/mg-components.js +3 -3
- 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.css +1 -1
- 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-aa298e17.entry.js +1 -0
- package/dist/mg-components/styles/global.scss +0 -7
- 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/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +1 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +19 -1
- 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 +6 -5
- package/readme.md +20 -25
- package/dist/collection/styles/components.scss +0 -3
- package/dist/mg-components/p-3bf533f7.js +0 -2
- package/dist/mg-components/p-bda0b795.entry.js +0 -1
- package/dist/mg-components/styles/components.scss +0 -3
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { IconVariantType, IconSizeType, IconVariantStyleType } from './mg-icon.conf';
|
|
2
2
|
import { ClassList } from '../../../utils/components.utils';
|
|
3
3
|
export declare class MgIcon {
|
|
4
|
+
private svg;
|
|
5
|
+
/**
|
|
6
|
+
* Icon HTML Element
|
|
7
|
+
*/
|
|
8
|
+
element: HTMLMgIconElement;
|
|
4
9
|
/**
|
|
5
10
|
* Icon to display.
|
|
6
11
|
*/
|
|
@@ -39,13 +44,17 @@ export declare class MgIcon {
|
|
|
39
44
|
* needeed has stencil doesn't know that props is mutated when updated in prop watcher
|
|
40
45
|
*/
|
|
41
46
|
private setDefaultVariantStyle;
|
|
47
|
+
/**
|
|
48
|
+
* Render icon in shadowroot
|
|
49
|
+
* @param icon - icon to render
|
|
50
|
+
*/
|
|
51
|
+
private renderIcon;
|
|
42
52
|
/**
|
|
43
53
|
* Check if props are well configured on init
|
|
44
54
|
*/
|
|
45
55
|
componentWillLoad(): void;
|
|
46
56
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @returns HTML Element
|
|
57
|
+
* update html when component trigger changes
|
|
49
58
|
*/
|
|
50
|
-
|
|
59
|
+
componentWillUpdate(): void;
|
|
51
60
|
}
|
|
@@ -12,11 +12,11 @@ export declare class MgInputTitle {
|
|
|
12
12
|
* Switch from label to fieldset sementic
|
|
13
13
|
*/
|
|
14
14
|
isLegend: boolean;
|
|
15
|
+
validateIsLegend(newValue: MgInputTitle['isLegend']): void;
|
|
15
16
|
/**
|
|
16
17
|
* Component parent tagname
|
|
17
18
|
*/
|
|
18
19
|
tagName: string;
|
|
19
|
-
private getTagName;
|
|
20
20
|
/*************
|
|
21
21
|
* Lifecycle *
|
|
22
22
|
*************/
|
|
@@ -5,8 +5,8 @@ export declare class MgModal {
|
|
|
5
5
|
* Internal *
|
|
6
6
|
************/
|
|
7
7
|
private modalFocusableElements;
|
|
8
|
+
private closeButtonElement;
|
|
8
9
|
private readonly classHide;
|
|
9
|
-
private closeButtonId;
|
|
10
10
|
private titleId;
|
|
11
11
|
private messages;
|
|
12
12
|
private bodyOverflow;
|
|
@@ -61,6 +61,24 @@ export declare class MgModal {
|
|
|
61
61
|
* @param event - keydown event
|
|
62
62
|
*/
|
|
63
63
|
handleKeyDown(event: KeyboardEvent): void;
|
|
64
|
+
/**
|
|
65
|
+
* Handle last focusable element
|
|
66
|
+
* @param event - keyboard event
|
|
67
|
+
*/
|
|
68
|
+
private handleLastFocusableElement;
|
|
69
|
+
/**
|
|
70
|
+
* Handle first focusable element
|
|
71
|
+
* @param event - keyboard event
|
|
72
|
+
*/
|
|
73
|
+
private handleFirstFocusableElement;
|
|
74
|
+
/**
|
|
75
|
+
* Get last focusablmeElement
|
|
76
|
+
* @returns last modal focusable element
|
|
77
|
+
*/
|
|
78
|
+
private getLastFocusableElement;
|
|
79
|
+
/**
|
|
80
|
+
* Method to manage focus on modal focusable elements
|
|
81
|
+
*/
|
|
64
82
|
private setFocus;
|
|
65
83
|
/*************
|
|
66
84
|
* Handlers *
|
|
@@ -116,12 +116,18 @@ declare const messages: {
|
|
|
116
116
|
results: string;
|
|
117
117
|
searchResults: string;
|
|
118
118
|
noResult: string;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
sections: {
|
|
120
|
+
selected: {
|
|
121
|
+
title: string;
|
|
122
|
+
titlePlurial: string;
|
|
123
|
+
action: string;
|
|
124
|
+
};
|
|
125
|
+
notSelected: {
|
|
126
|
+
title: string;
|
|
127
|
+
titlePlurial: string;
|
|
128
|
+
action: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
125
131
|
};
|
|
126
132
|
};
|
|
127
133
|
form: {
|
|
@@ -10,6 +10,9 @@ export declare const createID: (prefix?: string, length?: number) => string;
|
|
|
10
10
|
* Set() are not working when imported in project
|
|
11
11
|
*/
|
|
12
12
|
export declare class ClassList {
|
|
13
|
+
/**
|
|
14
|
+
* Available classes
|
|
15
|
+
*/
|
|
13
16
|
classes: string[];
|
|
14
17
|
constructor(classlist?: string[]);
|
|
15
18
|
/**
|
|
@@ -31,6 +31,10 @@ type SetupMutationObserverMockParams = {
|
|
|
31
31
|
takeRecords: MutationObserver['takeRecords'];
|
|
32
32
|
};
|
|
33
33
|
export declare const setupMutationObserverMock: ({ disconnect, observe, takeRecords }: SetupMutationObserverMockParams) => typeof MutationObserver;
|
|
34
|
+
type setupResizeObserverMockParams = {
|
|
35
|
+
disconnect: ResizeObserver['disconnect'];
|
|
36
|
+
observe: ResizeObserver['observe'];
|
|
37
|
+
};
|
|
34
38
|
/**
|
|
35
39
|
* Utility function that mocks the `ResizeObserver` API. Recommended to execute inside `beforeEach`.
|
|
36
40
|
* @param resizeObserverMock - Parameter that is sent to the `Object.defineProperty`
|
|
@@ -57,10 +61,6 @@ export declare const setupMutationObserverMock: ({ disconnect, observe, takeReco
|
|
|
57
61
|
* }]);;
|
|
58
62
|
* ```
|
|
59
63
|
*/
|
|
60
|
-
type setupResizeObserverMockParams = {
|
|
61
|
-
disconnect: ResizeObserver['disconnect'];
|
|
62
|
-
observe: ResizeObserver['observe'];
|
|
63
|
-
};
|
|
64
64
|
export declare const setupResizeObserverMock: ({ disconnect, observe }: setupResizeObserverMockParams) => typeof ResizeObserver;
|
|
65
65
|
/**
|
|
66
66
|
* Utility function that mocks the `SubmitEvent` API. Recommended to execute inside `beforeEach`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/mg-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.14.0",
|
|
4
4
|
"description": "MG Components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"babel-plugin-jsx-pragmatic": "^1.0.2",
|
|
55
55
|
"chromatic": "^6.15.0",
|
|
56
56
|
"css-loader": "^5.2.7",
|
|
57
|
-
"eslint": "^8.
|
|
57
|
+
"eslint": "^8.45.0",
|
|
58
58
|
"eslint-plugin-storybook": "^0.6.12",
|
|
59
59
|
"jest": "npm:jest@^26",
|
|
60
60
|
"jest-cli": "npm:jest-cli@^26",
|
|
@@ -75,14 +75,15 @@
|
|
|
75
75
|
"ts-node": "^10.9.1",
|
|
76
76
|
"typescript": "^4.9.5",
|
|
77
77
|
"@mgdis/linting-stencil": "1.1.0",
|
|
78
|
-
"eslint-config-stencil": "1.1.
|
|
78
|
+
"eslint-config-stencil": "1.1.1",
|
|
79
79
|
"playwright-config": "1.0.0",
|
|
80
80
|
"tsconfig": "1.0.0"
|
|
81
81
|
},
|
|
82
82
|
"license": "BSD-3-Clause",
|
|
83
83
|
"scripts": {
|
|
84
|
-
"
|
|
85
|
-
"
|
|
84
|
+
"prebuild": "node ./bin/build-icons",
|
|
85
|
+
"build": "pnpm prebuild && stencil build --docs",
|
|
86
|
+
"start": "pnpm prebuild && stencil build --dev --watch --serve",
|
|
86
87
|
"lint": "run-s lint:es lint:prettier",
|
|
87
88
|
"lint:fix": "run-s lint:es:fix lint:prettier:fix",
|
|
88
89
|
"lint:es": "eslint src/**/*.{ts,tsx}",
|
package/readme.md
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
1
|
# MG Components
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
## Introduction
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
MG Components is a reusable component library that aims to help MGDIS developers build UIs faster. It provides a collection of UI components that are designed to be productive, framework-agnostic, and satisfying to use. The library follows the principles of the Atomic Design methodology, which divides UI components into small, reusable parts.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
Components in MG Components are written using [StencilJS](https://stenciljs.com/), a compiler for building fast web apps using Web Components. The library utilizes [StorybookJS](https://storybook.js.org/) for component development and documentation.
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
### Atomic Design
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
Atomic Design is an interface design method that takes into account the constraints of development. It emphasizes the need to consider technical design constraints when creating web designs. You can learn more about Atomic Design in this [introduction to Atomic Design](https://openclassrooms.com/fr/courses/5249021-initiez-vous-a-la-methode-atomic-design/5630171-decouvrez-l-atomic-design) (in French).
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
### Stencil
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
MG Components is built using Stencil, a compiler for building fast web apps using Web Components. Stencil combines the best concepts from popular frontend frameworks and generates 100% standards-based Web Components that can run in any modern browser. Stencil components can be used with any major framework or even without a framework.
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
pnpm i
|
|
23
|
-
pnpm start
|
|
24
|
-
```
|
|
17
|
+
## Developer
|
|
18
|
+
|
|
19
|
+
### Scripts
|
|
25
20
|
|
|
26
21
|
To build for production, run:
|
|
27
22
|
|
|
@@ -49,7 +44,7 @@ pnpm test:unit -- mg-icon
|
|
|
49
44
|
|
|
50
45
|
To regenerate snapshot you must add the `--updateSnapshot` parameter.
|
|
51
46
|
|
|
52
|
-
For
|
|
47
|
+
For e2e tests you **must** use [WSL](https://docs.microsoft.com/fr-fr/windows/wsl/install) or a Linux OS to get the same screenshots as the GitLab CI.
|
|
53
48
|
|
|
54
49
|
To add a component, run:
|
|
55
50
|
|
|
@@ -63,21 +58,21 @@ pnpm generate atoms/mg-icon
|
|
|
63
58
|
pnpm generate molecules/mg-message
|
|
64
59
|
```
|
|
65
60
|
|
|
66
|
-
|
|
61
|
+
### Naming Components
|
|
67
62
|
|
|
68
63
|
All of the MGDIS generated web components must use the prefix `mg`.
|
|
69
64
|
|
|
70
|
-
|
|
65
|
+
### Using this library
|
|
71
66
|
|
|
72
|
-
You will find how to use the library instructions in the [Getting Started section](
|
|
67
|
+
You will find how to use the library instructions in the [Getting Started section](./getting-started.md).
|
|
73
68
|
|
|
74
|
-
|
|
69
|
+
### Style
|
|
75
70
|
|
|
76
|
-
|
|
71
|
+
#### Naming methodology
|
|
77
72
|
|
|
78
73
|
MG Components is using [BEM](https://en.bem.info/) (Block, Element, Modifier) methodology with the [two dashes style](https://en.bem.info/methodology/naming-convention/#two-dashes-style) naming scheme.
|
|
79
74
|
|
|
80
|
-
|
|
75
|
+
#### Declaration organisation
|
|
81
76
|
|
|
82
77
|
When a selector contains too many declaration it is recommended to organize them by theme : Display, Decoration, Font, Others.
|
|
83
78
|
|
|
@@ -102,18 +97,18 @@ When a selector contains too many declaration it is recommended to organize them
|
|
|
102
97
|
}
|
|
103
98
|
```
|
|
104
99
|
|
|
105
|
-
|
|
100
|
+
### Storybook
|
|
106
101
|
|
|
107
102
|
The plugin [storybook-addon-docs-stencil
|
|
108
103
|
](https://github.com/pixtron/storybook-addon-docs-stencil) is used to generate the doc. **To be up to date on local it needs a fresh build**.
|
|
109
104
|
|
|
110
|
-
|
|
105
|
+
#### run
|
|
111
106
|
|
|
112
107
|
```bash
|
|
113
108
|
pnpm storybook
|
|
114
109
|
```
|
|
115
110
|
|
|
116
|
-
|
|
111
|
+
#### Notes
|
|
117
112
|
|
|
118
113
|
To display components in our `stories`, we use the `filterArgs` method to only show the necessary arguments in the code example. It takes in the first parameter an object containing the arguments to be used, and in the second parameter, an object containing the component default values.
|
|
119
114
|
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
let e,t,n,l=!1,o=!1,s=!1,i=!1,c=!1;const r="http://www.w3.org/1999/xlink",f={},u=e=>"object"==(e=typeof e)||"function"===e;function a(e){var t,n,l;return null!==(l=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==l?l:void 0}const d=(e,t,...n)=>{let l=null,o=null,s=null,i=!1,c=!1;const r=[],f=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((i="function"!=typeof e&&!u(l))&&(l+=""),i&&c?r[r.length-1].t+=l:r.push(i?p(null,l):l),c=i)};if(f(n),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,r,m);const a=p(e,null);return a.l=t,r.length>0&&(a.o=r),a.i=o,a.u=s,a},p=(e,t)=>({p:0,$:e,t,m:null,o:null,l:null,i:null,u:null}),$={},m={forEach:(e,t)=>e.map(h).forEach(t),map:(e,t)=>e.map(h).map(t).map(y)},h=e=>({vattrs:e.l,vchildren:e.o,vkey:e.i,vname:e.u,vtag:e.$,vtext:e.t}),y=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),d(e.vtag,t,...e.vchildren||[])}const t=p(e.vtag,e.vtext);return t.l=e.vattrs,t.o=e.vchildren,t.i=e.vkey,t.u=e.vname,t},b=e=>oe(e).h,v=(e,t,n)=>{const l=b(e);return{emit:e=>w(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},w=(e,t,n)=>{const l=$e.ce(t,n);return e.dispatchEvent(l),l},g=new WeakMap,k=e=>"sc-"+e.v,j=(e,t,n,l,o,s)=>{if(n!==l){let i=ce(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=O(n),s=O(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const f=u(l);if((i||f&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let a=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,a=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(a?e.removeAttributeNS(r,t):e.removeAttribute(t)):(!i||4&s||o)&&!f&&(l=!0===l?"":l,a?e.setAttributeNS(r,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):ce(de,c)?c.slice(2):c[2]+t.slice(3),n&&$e.rel(e,t,n,!1),l&&$e.ael(e,t,l,!1)}},S=/\s/,O=e=>e?e.split(S):[],M=(e,t,n,l)=>{const o=11===t.m.nodeType&&t.m.host?t.m.host:t.m,s=e&&e.l||f,i=t.l||f;for(l in s)l in i||j(o,l,s[l],void 0,n,t.p);for(l in i)j(o,l,s[l],i[l],n,t.p)},x=(o,c,r,f)=>{const u=c.o[r];let a,d,p,$=0;if(l||(s=!0,"slot"===u.$&&(e&&f.classList.add(e+"-s"),u.p|=u.o?2:1)),null!==u.t)a=u.m=pe.createTextNode(u.t);else if(1&u.p)a=u.m=pe.createTextNode("");else{if(i||(i="svg"===u.$),a=u.m=pe.createElementNS(i?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&u.p?"slot-fb":u.$),i&&"foreignObject"===u.$&&(i=!1),M(null,u,i),null!=e&&a["s-si"]!==e&&a.classList.add(a["s-si"]=e),u.o)for($=0;$<u.o.length;++$)d=x(o,u,$,a),d&&a.appendChild(d);"svg"===u.$?i=!1:"foreignObject"===a.tagName&&(i=!0)}return a["s-hn"]=n,3&u.p&&(a["s-sr"]=!0,a["s-cr"]=t,a["s-sn"]=u.u||"",p=o&&o.o&&o.o[r],p&&p.$===u.$&&o.m&&C(o.m,!1)),a},C=(e,t)=>{$e.p|=1;const l=e.childNodes;for(let e=l.length-1;e>=0;e--){const o=l[e];o["s-hn"]!==n&&o["s-ol"]&&(L(o).insertBefore(o,E(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&C(o,t)}$e.p&=-2},R=(e,t,l,o,s,i)=>{let c,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=x(null,l,s,e),c&&(o[s].m=c,r.insertBefore(c,E(t))))},P=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,F(l),o=!0,s["s-ol"]?s["s-ol"].remove():C(s,!0),s.remove())},T=(e,t)=>e.$===t.$&&("slot"===e.$?e.u===t.u:e.i===t.i),E=e=>e&&e["s-ol"]||e,L=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,N=(e,t)=>{const n=t.m=e.m,l=e.o,o=t.o,s=t.$,c=t.t;let r;null===c?(i="svg"===s||"foreignObject"!==s&&i,"slot"===s||M(e,t,i),null!==l&&null!==o?((e,t,n,l)=>{let o,s,i=0,c=0,r=0,f=0,u=t.length-1,a=t[0],d=t[u],p=l.length-1,$=l[0],m=l[p];for(;i<=u&&c<=p;)if(null==a)a=t[++i];else if(null==d)d=t[--u];else if(null==$)$=l[++c];else if(null==m)m=l[--p];else if(T(a,$))N(a,$),a=t[++i],$=l[++c];else if(T(d,m))N(d,m),d=t[--u],m=l[--p];else if(T(a,m))"slot"!==a.$&&"slot"!==m.$||C(a.m.parentNode,!1),N(a,m),e.insertBefore(a.m,d.m.nextSibling),a=t[++i],m=l[--p];else if(T(d,$))"slot"!==a.$&&"slot"!==m.$||C(d.m.parentNode,!1),N(d,$),e.insertBefore(d.m,a.m),d=t[--u],$=l[++c];else{for(r=-1,f=i;f<=u;++f)if(t[f]&&null!==t[f].i&&t[f].i===$.i){r=f;break}r>=0?(s=t[r],s.$!==$.$?o=x(t&&t[c],n,r,e):(N(s,$),t[r]=void 0,o=s.m),$=l[++c]):(o=x(t&&t[c],n,c,e),$=l[++c]),o&&L(a.m).insertBefore(o,E(a.m))}i>u?R(e,null==l[p+1]?null:l[p+1].m,n,l,c,p):c>p&&P(t,i,u)})(n,l,t,o):null!==o?(null!==e.t&&(n.textContent=""),R(n,null,t,o,0,o.length-1)):null!==l&&P(l,0,l.length-1),i&&"svg"===s&&(i=!1)):(r=n["s-cr"])?r.parentNode.textContent=c:e.t!==c&&(n.data=c)},D=e=>{const t=e.childNodes;let n,l,o,s,i,c;for(l=0,o=t.length;l<o;l++)if(n=t[l],1===n.nodeType){if(n["s-sr"])for(i=n["s-sn"],n.hidden=!1,s=0;s<o;s++)if(c=t[s].nodeType,t[s]["s-hn"]!==n["s-hn"]||""!==i){if(1===c&&i===t[s].getAttribute("slot")){n.hidden=!0;break}}else if(1===c||3===c&&""!==t[s].textContent.trim()){n.hidden=!0;break}D(n)}},U=[],W=e=>{let t,n,l,s,i,c,r=0;const f=e.childNodes,u=f.length;for(;r<u;r++){if(t=f[r],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=t["s-sn"],c=l.length-1;c>=0;c--)n=l[c],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(A(n,s)?(i=U.find((e=>e.g===n)),o=!0,n["s-sn"]=n["s-sn"]||s,i?i.k=t:U.push({k:t,g:n}),n["s-sr"]&&U.map((e=>{A(e.g,n["s-sn"])&&(i=U.find((e=>e.g===n)),i&&!e.k&&(e.k=i.k))}))):U.some((e=>e.g===n))||U.push({g:n}));1===t.nodeType&&W(t)}},A=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,F=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(F)},H=(e,t)=>{t&&!e.j&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.j=t)))},q=(e,t)=>{if(e.p|=16,!(4&e.p))return H(e,e.S),je((()=>V(e,t)));e.p|=512},V=(e,t)=>{const n=e.O;let l;return t&&(e.p|=256,e.M&&(e.M.map((([e,t])=>I(n,e,t))),e.M=null),l=I(n,"componentWillLoad")),J(l,(()=>_(e,n,t)))},_=async(e,t,n)=>{const l=e.h,o=l["s-rc"];n&&(e=>{const t=e.C,n=e.h,l=t.p,o=((e,t)=>{var n;let l=k(t);const o=ae.get(l);if(e=11===e.nodeType?e:pe,o)if("string"==typeof o){let t,s=g.get(e=e.head||e);if(s||g.set(e,s=new Set),!s.has(l)){{t=pe.createElement("style"),t.innerHTML=o;const l=null!==(n=$e.R)&&void 0!==n?n:a(pe);null!=l&&t.setAttribute("nonce",l),e.insertBefore(t,e.querySelector("link"))}s&&s.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"),2&l&&n.classList.add(o+"-s"))})(e);z(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>B(e);0===t.length?n():(Promise.all(t).then(n),e.p|=4,t.length=0)}},z=(i,c)=>{try{c=c.render(),i.p&=-17,i.p|=2,((i,c)=>{const r=i.h,f=i.C,u=i.P||p(null,null),a=(e=>e&&e.$===$)(c)?c:d(null,null,c);if(n=r.tagName,f.T&&(a.l=a.l||{},f.T.map((([e,t])=>a.l[t]=r[e]))),a.$=null,a.p|=4,i.P=a,a.m=u.m=r.shadowRoot||r,e=r["s-sc"],t=r["s-cr"],l=0!=(1&f.p),o=!1,N(u,a),$e.p|=1,s){let e,t,n,l,o,s;W(a.m);let i=0;for(;i<U.length;i++)e=U[i],t=e.g,t["s-ol"]||(n=pe.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(i=0;i<U.length;i++)if(e=U[i],t=e.g,e.k){for(l=e.k.parentNode,o=e.k.nextSibling,n=t["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===t["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),l.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&D(a.m),$e.p&=-2,U.length=0})(i,c)}catch(e){re(e,i.h)}return null},B=e=>{const t=e.h,n=e.O,l=e.S;I(n,"componentDidRender"),64&e.p?I(n,"componentDidUpdate"):(e.p|=64,K(t),I(n,"componentDidLoad"),e.L(t),l||G()),e.N(t),e.j&&(e.j(),e.j=void 0),512&e.p&&ke((()=>q(e,!1))),e.p&=-517},G=()=>{K(pe.documentElement),ke((()=>w(de,"appload",{detail:{namespace:"mg-components"}})))},I=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){re(e)}},J=(e,t)=>e&&e.then?e.then(t):t(),K=e=>e.classList.add("hydrated"),Q=(e,t,n)=>{if(t.D){e.watchers&&(t.U=e.watchers);const l=Object.entries(t.D),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>oe(this).W.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=oe(e),s=o.h,i=o.W.get(t),c=o.p,r=o.O;if(n=((e,t)=>null==e||u(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.D[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(o.W.set(t,n),r)){if(l.U&&128&c){const e=l.U[t];e&&e.map((e=>{try{r[e](n,i,t)}catch(e){re(e,s)}}))}2==(18&c)&&q(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=oe(this);return n.A.then((()=>n.O[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){$e.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.T.push([e,o]),o}))}}return e},X=(e,t={})=>{var n;const l=[],o=t.exclude||[],s=de.customElements,i=pe.head,c=i.querySelector("meta[charset]"),r=pe.createElement("style"),f=[];let u,d=!0;Object.assign($e,t),$e.F=new URL(t.resourcesUrl||"./",pe.baseURI).href,e.map((e=>{e[1].map((t=>{const n={p:t[0],v:t[1],D:t[2],H:t[3]};n.D=t[2],n.H=t[3],n.T=[],n.U={};const i=n.v,c=class extends HTMLElement{constructor(e){super(e),ie(e=this,n),1&n.p&&e.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),d?f.push(this):$e.jmp((()=>(e=>{if(0==(1&$e.p)){const t=oe(e),n=t.C,l=()=>{};if(1&t.p)Y(e,t,n.H);else{t.p|=1,12&n.p&&(e=>{const t=e["s-cr"]=pe.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){H(t,t.S=n);break}}n.D&&Object.entries(n.D).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.p)){{if(t.p|=32,(o=ue(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.U=o.watchers,Q(o,n,2),o.isProxied=!0);const e=()=>{};t.p|=8;try{new o(t)}catch(e){re(e)}t.p&=-9,t.p|=128,e()}if(o.style){let e=o.style;const t=k(n);if(!ae.has(t)){const l=()=>{};((e,t,n)=>{let l=ae.get(e);he&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,ae.set(e,l)})(t,e,!!(1&n.p)),l()}}}const s=t.S,i=()=>q(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){$e.jmp((()=>(()=>{if(0==(1&$e.p)){const e=oe(this),t=e.O;e.q&&(e.q.map((e=>e())),e.q=void 0),I(t,"disconnectedCallback")}})()))}componentOnReady(){return oe(this).V}};n._=e[0],o.includes(i)||s.get(i)||(l.push(i),s.define(i,Q(c,n,1)))}))}));{r.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles","");const e=null!==(n=$e.R)&&void 0!==n?n:a(pe);null!=e&&r.setAttribute("nonce",e),i.insertBefore(r,c?c.nextSibling:i.firstChild)}d=!1,f.length?f.map((e=>e.connectedCallback())):$e.jmp((()=>u=setTimeout(G,30)))},Y=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=ee(e,n),i=Z(t,o),c=te(n);$e.ael(s,l,i,c),(t.q=t.q||[]).push((()=>$e.rel(s,l,i,c)))}))},Z=(e,t)=>n=>{try{256&e.p?e.O[t](n):(e.M=e.M||[]).push([t,n])}catch(e){re(e)}},ee=(e,t)=>8&t?de:e,te=e=>0!=(2&e),ne=e=>$e.R=e,le=new WeakMap,oe=e=>le.get(e),se=(e,t)=>le.set(t.O=e,t),ie=(e,t)=>{const n={p:0,h:e,C:t,W:new Map};return n.A=new Promise((e=>n.N=e)),n.V=new Promise((e=>n.L=e)),e["s-p"]=[],e["s-rc"]=[],Y(e,n,t.H),le.set(e,n)},ce=(e,t)=>t in e,re=(e,t)=>(0,console.error)(e,t),fe=new Map,ue=e=>{const t=e.v.replace(/-/g,"_"),n=e._,l=fe.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(fe.set(n,e),e[t])),re)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},ae=new Map,de="undefined"!=typeof window?window:{},pe=de.document||{head:{}},$e={p:0,F:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},me=e=>Promise.resolve(e),he=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ye=[],be=[],ve=(e,t)=>n=>{e.push(n),c||(c=!0,t&&4&$e.p?ke(ge):$e.raf(ge))},we=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){re(e)}e.length=0},ge=()=>{we(ye),we(be),(c=ye.length>0)&&$e.raf(ge)},ke=e=>me().then(e),je=ve(be,!0);export{$ as H,X as b,v as c,b as g,d as h,me as p,se as r,ne as s}
|