@mgdis/mg-components 5.11.1 → 5.12.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/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_31.cjs.entry.js +287 -242
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +1 -1
- package/dist/cjs/{mg-menu.conf-05ec32a3.js → mg-menu.conf-79f0c761.js} +12 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +0 -218
- package/dist/collection/components/atoms/mg-icon/mg-icon.css +0 -7
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +6 -9
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +34 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +156 -14
- package/dist/collection/components/molecules/mg-details/mg-details.css +18 -3
- package/dist/collection/locales/en/messages.json +6 -1
- package/dist/collection/locales/fr/messages.json +6 -1
- package/dist/collection/styles/a11y.scss +5 -1
- package/dist/collection/styles/typography.scss +7 -0
- package/dist/collection/variables.css +8 -0
- package/dist/components/index2.js +12 -2
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-icon2.js +157 -227
- package/dist/components/mg-input-checkbox.js +167 -23
- package/dist/components/mg-pagination.js +1 -170
- package/dist/components/mg-pagination2.js +172 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_31.entry.js +287 -242
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-item-more.entry.js +1 -1
- package/dist/esm/{mg-menu.conf-c8aa56ce.js → mg-menu.conf-850d4c6e.js} +12 -2
- package/dist/mg-components/locales/en/messages.json +6 -1
- package/dist/mg-components/locales/fr/messages.json +6 -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-d3ed97d3.entry.js → p-67ba5d05.entry.js} +1 -1
- package/dist/mg-components/p-689503fc.js +1 -0
- package/dist/mg-components/p-ec5a0dd6.entry.js +1 -0
- package/dist/mg-components/styles/a11y.scss +5 -1
- package/dist/mg-components/styles/typography.scss +7 -0
- package/dist/mg-components/variables.css +8 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +0 -4
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +0 -5
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +78 -1
- package/dist/types/components.d.ts +8 -0
- package/dist/types/locales/index.d.ts +10 -0
- package/package.json +7 -5
- package/dist/mg-components/p-4539cdfd.entry.js +0 -1
- package/dist/mg-components/p-b14be68b.js +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// Make content available only for screen reader
|
|
6
6
|
// https://gist.github.com/ffoodd/000b59f431e3e64e4ce1a24d5bb36034
|
|
7
|
-
|
|
7
|
+
@mixin sr-only {
|
|
8
8
|
border: 0 !important;
|
|
9
9
|
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
10
10
|
-webkit-clip-path: inset(50%) !important;
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
white-space: nowrap !important;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.sr-only {
|
|
22
|
+
@include sr-only();
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
// Remove outline for non-keyboard :focus
|
|
22
26
|
// https://www.tpgi.com/focus-visible-and-backwards-compatibility/
|
|
23
27
|
*:focus:not(:focus-visible) {
|
|
@@ -75,6 +75,9 @@
|
|
|
75
75
|
--color-dark-l: 13.1%;
|
|
76
76
|
--color-dark: var(--color-dark-h), var(--color-dark-s), var(--color-dark-l);
|
|
77
77
|
|
|
78
|
+
/* dark-5 */
|
|
79
|
+
--mg-color-dark-5-hsl: hsl(var(--color-dark-h), 9%, 96%);
|
|
80
|
+
|
|
78
81
|
/* Light */
|
|
79
82
|
/* white; (#ffffff) */
|
|
80
83
|
/* rgb(255, 255, 255); */
|
|
@@ -259,4 +262,9 @@
|
|
|
259
262
|
--mg-tabs-focused-background-color-hsl: var(--mg-color-app-hsl);
|
|
260
263
|
--mg-tabs-border-color-active-hsl: var(--mg-color-app-hsl);
|
|
261
264
|
--mg-tabs-color-active-hsl: var(--mg-color-app-hsl);
|
|
265
|
+
|
|
266
|
+
/*
|
|
267
|
+
<mg-details>
|
|
268
|
+
*/
|
|
269
|
+
--mg-details-spacing: 1.5rem;
|
|
262
270
|
}
|
|
@@ -34,11 +34,6 @@ export declare class MgIcon {
|
|
|
34
34
|
* Component classes
|
|
35
35
|
*/
|
|
36
36
|
classCollection: ClassList;
|
|
37
|
-
/**
|
|
38
|
-
* getIcon
|
|
39
|
-
* @returns icon html
|
|
40
|
-
*/
|
|
41
|
-
private getIcon;
|
|
42
37
|
/**
|
|
43
38
|
* Method to set default varianStyle props
|
|
44
39
|
* needeed has stencil doesn't know that props is mutated when updated in prop watcher
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../../stencil-public-runtime';
|
|
2
2
|
import { ClassList } from '../../../../utils/components.utils';
|
|
3
|
-
import { CheckboxItem, CheckboxType, CheckboxValue } from './mg-input-checkbox.conf';
|
|
3
|
+
import { CheckboxItem, CheckboxType, CheckboxValue, SearchValueType } from './mg-input-checkbox.conf';
|
|
4
4
|
export declare class MgInputCheckbox {
|
|
5
5
|
/************
|
|
6
6
|
* Internal *
|
|
@@ -10,6 +10,9 @@ export declare class MgInputCheckbox {
|
|
|
10
10
|
private messages;
|
|
11
11
|
private hasDisplayedError;
|
|
12
12
|
private baseClassName;
|
|
13
|
+
private multiStart;
|
|
14
|
+
private searchStart;
|
|
15
|
+
private searchOffset;
|
|
13
16
|
/**************
|
|
14
17
|
* Decorators *
|
|
15
18
|
**************/
|
|
@@ -62,6 +65,11 @@ export declare class MgInputCheckbox {
|
|
|
62
65
|
* Define if input is readonly
|
|
63
66
|
*/
|
|
64
67
|
readonly: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Display selected values list in "multi" type
|
|
70
|
+
*/
|
|
71
|
+
displaySelectedValues: boolean;
|
|
72
|
+
validateDisplaySelectedValues(newValue: MgInputCheckbox['displaySelectedValues']): void;
|
|
65
73
|
/**
|
|
66
74
|
* Define if input is disabled
|
|
67
75
|
*/
|
|
@@ -96,6 +104,24 @@ export declare class MgInputCheckbox {
|
|
|
96
104
|
* Formated value for display
|
|
97
105
|
*/
|
|
98
106
|
checkboxItems: CheckboxItem[];
|
|
107
|
+
validateCheckboxItems(newValue: MgInputCheckbox['checkboxItems']): void;
|
|
108
|
+
/**
|
|
109
|
+
* Display search input
|
|
110
|
+
*/
|
|
111
|
+
displaySearchInput: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Search current page
|
|
114
|
+
*/
|
|
115
|
+
currentSearchPage: number;
|
|
116
|
+
/**
|
|
117
|
+
* Search value
|
|
118
|
+
*/
|
|
119
|
+
searchValue: SearchValueType;
|
|
120
|
+
validateSearchValue(newValue: MgInputCheckbox['searchValue']): void;
|
|
121
|
+
/**
|
|
122
|
+
* Search current page
|
|
123
|
+
*/
|
|
124
|
+
searchResults: CheckboxItem[];
|
|
99
125
|
/**
|
|
100
126
|
* Emitted event when value change
|
|
101
127
|
*/
|
|
@@ -118,10 +144,25 @@ export declare class MgInputCheckbox {
|
|
|
118
144
|
* @param event - to trak "tab" key
|
|
119
145
|
*/
|
|
120
146
|
private handleKeydown;
|
|
147
|
+
/**
|
|
148
|
+
* Reset current-search-page prop
|
|
149
|
+
*/
|
|
150
|
+
private setCurrentSearchPage;
|
|
121
151
|
/**
|
|
122
152
|
* Handle blur event
|
|
123
153
|
*/
|
|
124
154
|
private handleBlur;
|
|
155
|
+
/**
|
|
156
|
+
* Handle input search value-change event
|
|
157
|
+
* @param event - input value-change event
|
|
158
|
+
*/
|
|
159
|
+
private handleSearchChange;
|
|
160
|
+
/**
|
|
161
|
+
* Handle mg-pagination current page change event
|
|
162
|
+
* @param event - pagination current page change event
|
|
163
|
+
*/
|
|
164
|
+
private handleCurrentPageChange;
|
|
165
|
+
private handleMgPopoverDisplayChange;
|
|
125
166
|
/**
|
|
126
167
|
* get invalid element
|
|
127
168
|
* @returns element
|
|
@@ -146,6 +187,29 @@ export declare class MgInputCheckbox {
|
|
|
146
187
|
* @returns MgPopover identifier
|
|
147
188
|
*/
|
|
148
189
|
private getMgPopoverIdentifier;
|
|
190
|
+
/**
|
|
191
|
+
* Manage items to display depending on the search state
|
|
192
|
+
* @returns items to display
|
|
193
|
+
*/
|
|
194
|
+
private getDisplayItems;
|
|
195
|
+
/**
|
|
196
|
+
* Method to get a array range
|
|
197
|
+
* @param from - array start index
|
|
198
|
+
* @param to - array end index
|
|
199
|
+
* @returns array's range
|
|
200
|
+
*/
|
|
201
|
+
private getArrayRange;
|
|
202
|
+
/**
|
|
203
|
+
* Get from and to index
|
|
204
|
+
* @returns [from,to] index
|
|
205
|
+
*/
|
|
206
|
+
private getFromToIndexes;
|
|
207
|
+
/**
|
|
208
|
+
* Method to get pagination total-page
|
|
209
|
+
* @param checkboxes - checkboxes to paginate
|
|
210
|
+
* @returns total page number for pagination
|
|
211
|
+
*/
|
|
212
|
+
private getPaginationTotalPages;
|
|
149
213
|
/*************
|
|
150
214
|
* Lifecycle *
|
|
151
215
|
*************/
|
|
@@ -154,6 +218,18 @@ export declare class MgInputCheckbox {
|
|
|
154
218
|
* @returns timeout
|
|
155
219
|
*/
|
|
156
220
|
componentWillLoad(): ReturnType<typeof setTimeout>;
|
|
221
|
+
/**
|
|
222
|
+
* Render checkbox multi display values
|
|
223
|
+
* @param selectedValuesNb - selected values length
|
|
224
|
+
* @returns display selected values
|
|
225
|
+
*/
|
|
226
|
+
private renderCheckboxMultiDisplaySelectedValues;
|
|
227
|
+
/**
|
|
228
|
+
* Render paginated checkboxes
|
|
229
|
+
* @param checkboxes - checkboxes to render
|
|
230
|
+
* @returns paginated checkboxes
|
|
231
|
+
*/
|
|
232
|
+
private renderPaginatedCheckboxes;
|
|
157
233
|
/**
|
|
158
234
|
* render checkbox multi element
|
|
159
235
|
* @returns html element
|
|
@@ -161,6 +237,7 @@ export declare class MgInputCheckbox {
|
|
|
161
237
|
private renderCheckboxMulti;
|
|
162
238
|
/**
|
|
163
239
|
* Render checkbox element
|
|
240
|
+
* @param checkboxes - checkboxes to render
|
|
164
241
|
* @returns HTML Element
|
|
165
242
|
*/
|
|
166
243
|
private renderCheckboxes;
|
|
@@ -217,6 +217,10 @@ export namespace Components {
|
|
|
217
217
|
* Public method to display errors
|
|
218
218
|
*/
|
|
219
219
|
"displayError": () => Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Display selected values list in "multi" type
|
|
222
|
+
*/
|
|
223
|
+
"displaySelectedValues": boolean;
|
|
220
224
|
/**
|
|
221
225
|
* Add a help text under the input, usually expected data format and example
|
|
222
226
|
*/
|
|
@@ -1635,6 +1639,10 @@ declare namespace LocalJSX {
|
|
|
1635
1639
|
* Define if input is disabled
|
|
1636
1640
|
*/
|
|
1637
1641
|
"disabled"?: boolean;
|
|
1642
|
+
/**
|
|
1643
|
+
* Display selected values list in "multi" type
|
|
1644
|
+
*/
|
|
1645
|
+
"displaySelectedValues"?: boolean;
|
|
1638
1646
|
/**
|
|
1639
1647
|
* Add a help text under the input, usually expected data format and example
|
|
1640
1648
|
*/
|
|
@@ -25,6 +25,11 @@ declare const messages: {
|
|
|
25
25
|
editButton: string;
|
|
26
26
|
selectButton: string;
|
|
27
27
|
showButton: string;
|
|
28
|
+
label: string;
|
|
29
|
+
result: string;
|
|
30
|
+
results: string;
|
|
31
|
+
searchResults: string;
|
|
32
|
+
noResult: string;
|
|
28
33
|
};
|
|
29
34
|
};
|
|
30
35
|
form: {
|
|
@@ -94,6 +99,11 @@ declare const messages: {
|
|
|
94
99
|
editButton: string;
|
|
95
100
|
selectButton: string;
|
|
96
101
|
showButton: string;
|
|
102
|
+
label: string;
|
|
103
|
+
result: string;
|
|
104
|
+
results: string;
|
|
105
|
+
searchResults: string;
|
|
106
|
+
noResult: string;
|
|
97
107
|
};
|
|
98
108
|
};
|
|
99
109
|
form: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/mg-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.1",
|
|
4
4
|
"description": "MG Components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@popperjs/core": "^2.11.7",
|
|
27
27
|
"@stencil/core": "^2.22.1",
|
|
28
|
-
"normalize.css": "^8.0.1"
|
|
28
|
+
"normalize.css": "^8.0.1",
|
|
29
|
+
"@mgdis/img": "1.0.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@babel/core": "^7.20.12",
|
|
@@ -53,9 +54,9 @@
|
|
|
53
54
|
"jest-cli": "npm:jest-cli@^26",
|
|
54
55
|
"jest-image-snapshot": "^4.5.1",
|
|
55
56
|
"jest-junit": "^15.0.0",
|
|
57
|
+
"jest-transform-stub": "^2.0.0",
|
|
56
58
|
"jsx-dom": "^8.0.4",
|
|
57
59
|
"npm-run-all": "^4.1.5",
|
|
58
|
-
"playwright-config": "^1.0.0",
|
|
59
60
|
"prettier": "^2.8.4",
|
|
60
61
|
"puppeteer": "^13.7.0",
|
|
61
62
|
"sass": "^1.58.0",
|
|
@@ -63,9 +64,10 @@
|
|
|
63
64
|
"style-loader": "^2.0.0",
|
|
64
65
|
"ts-node": "^10.9.1",
|
|
65
66
|
"typescript": "^4.9.5",
|
|
66
|
-
"@mgdis/linting-stencil": "1.0.0",
|
|
67
67
|
"eslint-config-stencil": "1.0.0",
|
|
68
|
-
"tsconfig": "1.0.0"
|
|
68
|
+
"tsconfig": "1.0.0",
|
|
69
|
+
"playwright-config": "1.0.0",
|
|
70
|
+
"@mgdis/linting-stencil": "1.0.0"
|
|
69
71
|
},
|
|
70
72
|
"license": "BSD-3-Clause",
|
|
71
73
|
"scripts": {
|