@mgdis/mg-components 5.13.1 → 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/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_32.cjs.entry.js +72 -47
- package/dist/cjs/mg-components.cjs.js +1 -1
- 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 +61 -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/styles/global.scss +0 -7
- package/dist/components/mg-details.js +2 -2
- package/dist/components/mg-form.js +1 -1
- package/dist/components/mg-input-checkbox-paginated2.js +4 -4
- package/dist/components/mg-input-select2.js +2 -2
- package/dist/components/mg-message.js +1 -1
- package/dist/components/mg-modal.js +61 -36
- package/dist/components/mg-pagination2.js +2 -2
- package/dist/components/mg-panel.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_32.entry.js +72 -47
- package/dist/esm/mg-components.js +1 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.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/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 +16 -1
- package/package.json +2 -2
- package/readme.md +20 -25
- package/dist/collection/styles/components.scss +0 -3
- package/dist/mg-components/p-b790596f.entry.js +0 -1
- package/dist/mg-components/styles/components.scss +0 -3
|
@@ -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,21 @@ 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;
|
|
64
79
|
/**
|
|
65
80
|
* Method to manage focus on modal focusable elements
|
|
66
81
|
*/
|
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",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"style-loader": "^2.0.0",
|
|
75
75
|
"ts-node": "^10.9.1",
|
|
76
76
|
"typescript": "^4.9.5",
|
|
77
|
-
"playwright-config": "1.0.0",
|
|
78
77
|
"@mgdis/linting-stencil": "1.1.0",
|
|
79
78
|
"eslint-config-stencil": "1.1.1",
|
|
79
|
+
"playwright-config": "1.0.0",
|
|
80
80
|
"tsconfig": "1.0.0"
|
|
81
81
|
},
|
|
82
82
|
"license": "BSD-3-Clause",
|
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
|
|