@mgdis/mg-components 5.9.1 → 5.10.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_31.cjs.entry.js +31 -225
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +1 -16
- package/dist/cjs/{mg-menu.conf-9afe6571.js → mg-menu.conf-1942ac70.js} +0 -5
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -3
- package/dist/collection/components/atoms/mg-button/mg-button.js +2 -7
- package/dist/collection/components/atoms/mg-card/mg-card.js +13 -4
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +0 -2
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +0 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +10 -5
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +0 -2
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +0 -3
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -13
- package/dist/collection/components/molecules/inputs/MgInput.js +0 -6
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +0 -6
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +0 -5
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +0 -12
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +0 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +0 -9
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +0 -13
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +1 -12
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -5
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +0 -5
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +0 -11
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +0 -18
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +0 -8
- package/dist/collection/components/molecules/mg-details/mg-details.js +0 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js +0 -8
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +0 -2
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +0 -5
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -7
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +1 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +0 -6
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +5 -15
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -8
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +0 -12
- package/dist/collection/locales/index.js +0 -1
- package/dist/collection/utils/behaviors.utils.js +0 -10
- package/dist/collection/utils/components.utils.js +1 -10
- package/dist/collection/utils/locale.utils.js +0 -4
- package/dist/collection/utils/unit.test.utils.js +0 -5
- package/dist/components/MgInput.js +0 -6
- package/dist/components/components.utils.js +1 -10
- package/dist/components/index2.js +0 -5
- package/dist/components/mg-action-more.js +0 -8
- package/dist/components/mg-badge2.js +1 -3
- package/dist/components/mg-button2.js +2 -7
- package/dist/components/mg-card2.js +13 -4
- package/dist/components/mg-character-left2.js +0 -2
- package/dist/components/mg-details.js +0 -3
- package/dist/components/mg-divider.js +0 -1
- package/dist/components/mg-form.js +0 -8
- package/dist/components/mg-icon2.js +10 -5
- package/dist/components/mg-illustrated-message.js +0 -2
- package/dist/components/mg-input-checkbox.js +0 -6
- package/dist/components/mg-input-date.js +0 -5
- package/dist/components/mg-input-numeric.js +0 -12
- package/dist/components/mg-input-password.js +0 -3
- package/dist/components/mg-input-radio.js +0 -9
- package/dist/components/mg-input-select2.js +0 -13
- package/dist/components/mg-input-text2.js +1 -12
- package/dist/components/mg-input-textarea.js +1 -5
- package/dist/components/mg-input-title2.js +0 -2
- package/dist/components/mg-input-toggle.js +0 -5
- package/dist/components/mg-item-more.js +0 -15
- package/dist/components/mg-menu-item2.js +0 -18
- package/dist/components/mg-menu2.js +0 -11
- package/dist/components/mg-message.js +2 -7
- package/dist/components/mg-modal.js +1 -6
- package/dist/components/mg-pagination.js +0 -6
- package/dist/components/mg-panel.js +5 -15
- package/dist/components/mg-popover2.js +1 -8
- package/dist/components/mg-skip-links.js +1 -4
- package/dist/components/mg-tabs.js +0 -12
- package/dist/components/mg-tag.js +0 -3
- package/dist/components/mg-tooltip2.js +1 -13
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_31.entry.js +31 -225
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-item-more.entry.js +1 -16
- package/dist/esm/{mg-menu.conf-881fbd82.js → mg-menu.conf-2cc1bb67.js} +0 -5
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-67ce7cb8.entry.js → p-a56a3157.entry.js} +1 -1
- package/dist/mg-components/{p-9a93b7af.entry.js → p-eb32bb18.entry.js} +1 -1
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +0 -2
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -5
- package/dist/types/components/atoms/mg-card/mg-card.d.ts +10 -3
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +0 -2
- package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +0 -1
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +6 -3
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +0 -2
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +0 -3
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +0 -12
- package/dist/types/components/molecules/inputs/MgInput.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +0 -5
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +0 -5
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +0 -12
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +0 -3
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -8
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -9
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +0 -11
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -4
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +0 -5
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +0 -11
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +0 -18
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +0 -5
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +0 -3
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +0 -8
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +0 -2
- package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +0 -5
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +1 -6
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +0 -5
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +0 -5
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +0 -10
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +0 -7
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +0 -3
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +0 -11
- package/dist/types/locales/index.d.ts +0 -1
- package/dist/types/utils/behaviors.utils.d.ts +0 -9
- package/dist/types/utils/components.utils.d.ts +1 -9
- package/dist/types/utils/locale.utils.d.ts +0 -4
- package/dist/types/utils/unit.test.utils.d.ts +0 -7
- package/package.json +11 -12
- /package/dist/mg-components/{p-367f92d2.js → p-73156ac9.js} +0 -0
|
@@ -11,7 +11,6 @@ import { d as defineCustomElement$2 } from './mg-popover2.js';
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* MgItemMore type guard
|
|
14
|
-
*
|
|
15
14
|
* @param {HTMLElement} element element to control type
|
|
16
15
|
* @returns {boolean} truthy if element is mg-item-more
|
|
17
16
|
*/
|
|
@@ -30,7 +29,6 @@ class OverflowBehavior {
|
|
|
30
29
|
**********/
|
|
31
30
|
/**
|
|
32
31
|
* Disconnect ResizeObserver
|
|
33
|
-
*
|
|
34
32
|
* @returns {void}
|
|
35
33
|
*/
|
|
36
34
|
this.disconnect = () => {
|
|
@@ -41,7 +39,6 @@ class OverflowBehavior {
|
|
|
41
39
|
************/
|
|
42
40
|
/**
|
|
43
41
|
* run overflow behavior
|
|
44
|
-
*
|
|
45
42
|
* @param {number} width width of the container. Optional.
|
|
46
43
|
* @returns {void}
|
|
47
44
|
*/
|
|
@@ -66,14 +63,12 @@ class OverflowBehavior {
|
|
|
66
63
|
};
|
|
67
64
|
/**
|
|
68
65
|
* Get interactive children filtred by authorized nodeName ['MG-MENU-ITEM', 'MG-BUTTON']
|
|
69
|
-
*
|
|
70
66
|
* @param {Element} element element to parse
|
|
71
67
|
* @returns {Element[]} children
|
|
72
68
|
*/
|
|
73
69
|
this.getInteractiveItems = (element) => { var _a; return (((_a = element.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? Array.from(element.children) : []).filter(element => ['MG-MENU-ITEM', 'MG-BUTTON'].includes(element.nodeName)); };
|
|
74
70
|
/**
|
|
75
71
|
* Update displayed items in container from a given available space
|
|
76
|
-
*
|
|
77
72
|
* @param {number} availableWidth available width in container to display child items
|
|
78
73
|
* @returns {void}
|
|
79
74
|
*/
|
|
@@ -94,7 +89,6 @@ class OverflowBehavior {
|
|
|
94
89
|
};
|
|
95
90
|
/**
|
|
96
91
|
* Utility method to know if item overflow partialy or totaly in the container
|
|
97
|
-
*
|
|
98
92
|
* @param {number} cumulateWidth previous sibling elements cumulate width + item width
|
|
99
93
|
* @param {HTMLElement} item item HTML element
|
|
100
94
|
* @param {number} availableWidth container available width
|
|
@@ -110,14 +104,12 @@ class OverflowBehavior {
|
|
|
110
104
|
};
|
|
111
105
|
/**
|
|
112
106
|
* Utility method to know if a given element is the 'MORE' element
|
|
113
|
-
*
|
|
114
107
|
* @param {Element} element element to match with 'MORE' element
|
|
115
108
|
* @returns {boolean} truthy if element is the 'MORE' element
|
|
116
109
|
*/
|
|
117
110
|
this.isMoreElement = (element) => element.nodeName === 'MG-ITEM-MORE';
|
|
118
111
|
/**
|
|
119
112
|
* Toggle display item element
|
|
120
|
-
*
|
|
121
113
|
* @param {HTMLElement} item item to control
|
|
122
114
|
* @param {boolean} isHidden is item hidden
|
|
123
115
|
* @returns {void}
|
|
@@ -133,7 +125,6 @@ class OverflowBehavior {
|
|
|
133
125
|
};
|
|
134
126
|
/**
|
|
135
127
|
* Toggle element's hidde attribute
|
|
136
|
-
*
|
|
137
128
|
* @param {Element} element element to toggle
|
|
138
129
|
* @param {boolean} isHidden element is hidden
|
|
139
130
|
* @returns {void}
|
|
@@ -146,7 +137,6 @@ class OverflowBehavior {
|
|
|
146
137
|
};
|
|
147
138
|
/**
|
|
148
139
|
* Remove hidden attributes on all items
|
|
149
|
-
*
|
|
150
140
|
* @returns {void}
|
|
151
141
|
*/
|
|
152
142
|
this.restoreItems = () => {
|
|
@@ -181,7 +171,6 @@ const MgItemMore$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
181
171
|
***********/
|
|
182
172
|
/**
|
|
183
173
|
* render mg-item-more overflow element
|
|
184
|
-
*
|
|
185
174
|
* @returns {HTMLMgItemMoreElement} mg-item-more element
|
|
186
175
|
*/
|
|
187
176
|
this.renderMgMenuItemOverflowElement = () => {
|
|
@@ -231,7 +220,6 @@ const MgItemMore$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
231
220
|
*************/
|
|
232
221
|
/**
|
|
233
222
|
* Disconnect overflow ResizeObserver
|
|
234
|
-
*
|
|
235
223
|
* @returns {void} run overflow resize obeserver disconnexion
|
|
236
224
|
*/
|
|
237
225
|
disconnectedCallback() {
|
|
@@ -239,7 +227,6 @@ const MgItemMore$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
239
227
|
}
|
|
240
228
|
/**
|
|
241
229
|
* Set variables and validate props
|
|
242
|
-
*
|
|
243
230
|
* @returns {void}
|
|
244
231
|
*/
|
|
245
232
|
componentWillLoad() {
|
|
@@ -254,7 +241,6 @@ const MgItemMore$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
254
241
|
}
|
|
255
242
|
/**
|
|
256
243
|
* Add overflow behavior
|
|
257
|
-
*
|
|
258
244
|
* @returns {void}
|
|
259
245
|
*/
|
|
260
246
|
componentDidLoad() {
|
|
@@ -262,7 +248,6 @@ const MgItemMore$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
262
248
|
}
|
|
263
249
|
/**
|
|
264
250
|
* Render
|
|
265
|
-
*
|
|
266
251
|
* @returns {HTMLElement} HTML Element
|
|
267
252
|
*/
|
|
268
253
|
render() {
|
|
@@ -46,7 +46,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
46
46
|
**********/
|
|
47
47
|
/**
|
|
48
48
|
* Toggle expanded prop value
|
|
49
|
-
*
|
|
50
49
|
* @returns {void}
|
|
51
50
|
*/
|
|
52
51
|
this.toggleExpanded = () => {
|
|
@@ -54,7 +53,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
54
53
|
};
|
|
55
54
|
/**
|
|
56
55
|
* Does an Element have given Status
|
|
57
|
-
*
|
|
58
56
|
* @param {HTMLMgMenuItemElement} mgMenuItemElement to parse
|
|
59
57
|
* @param {MgMenuItem['status']} status to check
|
|
60
58
|
* @returns {boolean} true if element with status is found
|
|
@@ -62,7 +60,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
62
60
|
this.hasStatus = (mgMenuItemElement, status) => mgMenuItemElement.status === status;
|
|
63
61
|
/**
|
|
64
62
|
* Is component contextual direction match the given direction
|
|
65
|
-
*
|
|
66
63
|
* @param {MgMenuItem['direction']} direction in parent menu
|
|
67
64
|
* @param {MgMenuItem['direction']} compareWith direction to compare with. Default: `this.direction`
|
|
68
65
|
* @returns {boolean} true is direction match the direction propertie
|
|
@@ -71,7 +68,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
71
68
|
/**
|
|
72
69
|
* Update displayNotificationBadge
|
|
73
70
|
* current component notification badge have priority over the slot badge when submenu contain badge
|
|
74
|
-
*
|
|
75
71
|
* @returns {void} update displayNotificationBadge value
|
|
76
72
|
*/
|
|
77
73
|
this.updateDisplayNotificationBadge = () => {
|
|
@@ -82,7 +78,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
82
78
|
};
|
|
83
79
|
/**
|
|
84
80
|
* Method to control if one of component children have active status
|
|
85
|
-
*
|
|
86
81
|
* @returns {boolean} truthy if component has active child
|
|
87
82
|
*/
|
|
88
83
|
this.hasActiveChild = () => {
|
|
@@ -91,7 +86,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
91
86
|
};
|
|
92
87
|
/**
|
|
93
88
|
* Validate slots
|
|
94
|
-
*
|
|
95
89
|
* @param {boolean} guard prevent action whith guard. Default: false.
|
|
96
90
|
* @returns {void}
|
|
97
91
|
*/
|
|
@@ -111,7 +105,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
111
105
|
};
|
|
112
106
|
/**
|
|
113
107
|
* Update status
|
|
114
|
-
*
|
|
115
108
|
* @param {Status[]} guard status to exclude from process in addition to [Status.HIDDEN, Status.DISABLED] . Default: [].
|
|
116
109
|
* @returns {void}
|
|
117
110
|
*/
|
|
@@ -122,7 +115,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
122
115
|
};
|
|
123
116
|
/**
|
|
124
117
|
* Init event-listeners
|
|
125
|
-
*
|
|
126
118
|
* @returns {void}
|
|
127
119
|
*/
|
|
128
120
|
this.initListeners = () => {
|
|
@@ -139,13 +131,11 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
139
131
|
};
|
|
140
132
|
/**
|
|
141
133
|
* Get mg-popover identifier
|
|
142
|
-
*
|
|
143
134
|
* @returns {MgPopover['identifier']} generated mg-popover identifier
|
|
144
135
|
*/
|
|
145
136
|
this.getPopoverIdentifier = () => `${this.identifier}-popover`;
|
|
146
137
|
/**
|
|
147
138
|
* Condition to know if component should display a mg-popover
|
|
148
|
-
*
|
|
149
139
|
* @returns {boolean} truthy if component display popover
|
|
150
140
|
*/
|
|
151
141
|
this.displayPopover = () => this.isDirection(Direction.HORIZONTAL) && this.hasChildren && this.href === undefined;
|
|
@@ -154,7 +144,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
154
144
|
************/
|
|
155
145
|
/**
|
|
156
146
|
* Handle interacrtive element click
|
|
157
|
-
*
|
|
158
147
|
* @param {MouseEvent} event click on element
|
|
159
148
|
* @returns {void}
|
|
160
149
|
*/
|
|
@@ -169,7 +158,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
169
158
|
};
|
|
170
159
|
/**
|
|
171
160
|
* Handle popover element display-change event
|
|
172
|
-
*
|
|
173
161
|
* @param {CustomEvent} event popover display event
|
|
174
162
|
* @returns {void}
|
|
175
163
|
*/
|
|
@@ -178,7 +166,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
178
166
|
};
|
|
179
167
|
/**
|
|
180
168
|
* Render slot
|
|
181
|
-
*
|
|
182
169
|
* @returns {HTMLElement} HTML Element
|
|
183
170
|
*/
|
|
184
171
|
this.renderSlot = () => h("slot", null);
|
|
@@ -245,7 +232,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
245
232
|
}
|
|
246
233
|
/**
|
|
247
234
|
* Render popover clickoutside guard for content slot
|
|
248
|
-
*
|
|
249
235
|
* @returns {void}
|
|
250
236
|
*/
|
|
251
237
|
updatePopoverGuard() {
|
|
@@ -259,7 +245,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
259
245
|
*************/
|
|
260
246
|
/**
|
|
261
247
|
* Validate props
|
|
262
|
-
*
|
|
263
248
|
* @returns {void}
|
|
264
249
|
*/
|
|
265
250
|
componentWillLoad() {
|
|
@@ -276,7 +261,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
276
261
|
}
|
|
277
262
|
/**
|
|
278
263
|
* Check if component slots configuration
|
|
279
|
-
*
|
|
280
264
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
281
265
|
*/
|
|
282
266
|
componentDidLoad() {
|
|
@@ -316,7 +300,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
316
300
|
}
|
|
317
301
|
/**
|
|
318
302
|
* Render ineractive element
|
|
319
|
-
*
|
|
320
303
|
* @returns {HTMLElement} HTML Element
|
|
321
304
|
*/
|
|
322
305
|
renderInteractiveElement() {
|
|
@@ -329,7 +312,6 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
329
312
|
}
|
|
330
313
|
/**
|
|
331
314
|
* Render
|
|
332
|
-
*
|
|
333
315
|
* @returns {HTMLElement} HTML Element
|
|
334
316
|
*/
|
|
335
317
|
render() {
|
|
@@ -19,7 +19,6 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
19
19
|
*************/
|
|
20
20
|
/**
|
|
21
21
|
* Close matching menu-item
|
|
22
|
-
*
|
|
23
22
|
* @param {HTMLElement} item menu-item to close
|
|
24
23
|
* @param {boolean} condition addionnal condition
|
|
25
24
|
* @returns {void}
|
|
@@ -31,19 +30,16 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
31
30
|
};
|
|
32
31
|
/**
|
|
33
32
|
* get mg-item-more element
|
|
34
|
-
*
|
|
35
33
|
* @returns {HTMLMgItemMoreElement} mg-item-more element
|
|
36
34
|
*/
|
|
37
35
|
this.getItemMore = () => this.element.querySelector('mg-item-more');
|
|
38
36
|
/**
|
|
39
37
|
* get mg-item-more >>> mg-menu-item element
|
|
40
|
-
*
|
|
41
38
|
* @returns {HTMLMgMenuItemElement} mg-item-more >>> mg-menu-item element
|
|
42
39
|
*/
|
|
43
40
|
this.getItemMoreMenuItem = () => { var _a, _b; return (_b = (_a = this.getItemMore()) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('mg-menu-item'); };
|
|
44
41
|
/**
|
|
45
42
|
* Set item listend
|
|
46
|
-
*
|
|
47
43
|
* @param {HTMLMgMenuItemElement} item mg-menu-item element
|
|
48
44
|
* @param {MgMenu['focusedMenuItem']} index number
|
|
49
45
|
* @returns {void}
|
|
@@ -61,7 +57,6 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
61
57
|
};
|
|
62
58
|
/**
|
|
63
59
|
* Store menu-items on component init and add listeners
|
|
64
|
-
*
|
|
65
60
|
* @returns {void}
|
|
66
61
|
*/
|
|
67
62
|
this.initMenuItemsListeners = () => {
|
|
@@ -72,7 +67,6 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
72
67
|
};
|
|
73
68
|
/**
|
|
74
69
|
* Handle item-loaded event on mg-item-more element
|
|
75
|
-
*
|
|
76
70
|
* @returns {void}
|
|
77
71
|
*/
|
|
78
72
|
this.handleItemLoaded = () => {
|
|
@@ -80,7 +74,6 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
80
74
|
};
|
|
81
75
|
/**
|
|
82
76
|
* render mg-item-more
|
|
83
|
-
*
|
|
84
77
|
* @returns {void}
|
|
85
78
|
*/
|
|
86
79
|
this.renderMgItemMore = () => {
|
|
@@ -123,7 +116,6 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
123
116
|
*************/
|
|
124
117
|
/**
|
|
125
118
|
* Validate props
|
|
126
|
-
*
|
|
127
119
|
* @returns {void}
|
|
128
120
|
*/
|
|
129
121
|
componentWillLoad() {
|
|
@@ -134,7 +126,6 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
134
126
|
}
|
|
135
127
|
/**
|
|
136
128
|
* Check if component slots configuration
|
|
137
|
-
*
|
|
138
129
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
139
130
|
*/
|
|
140
131
|
componentDidLoad() {
|
|
@@ -165,7 +156,6 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
165
156
|
}
|
|
166
157
|
/**
|
|
167
158
|
* Add listeners to items
|
|
168
|
-
*
|
|
169
159
|
* @returns {void}
|
|
170
160
|
*/
|
|
171
161
|
componentDidRender() {
|
|
@@ -173,7 +163,6 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
173
163
|
}
|
|
174
164
|
/**
|
|
175
165
|
* Render
|
|
176
|
-
*
|
|
177
166
|
* @returns {HTMLElement} HTML Element
|
|
178
167
|
*/
|
|
179
168
|
render() {
|
|
@@ -33,7 +33,6 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
33
33
|
this.isHovered = false;
|
|
34
34
|
/**
|
|
35
35
|
* Set timer
|
|
36
|
-
*
|
|
37
36
|
* @returns {void}
|
|
38
37
|
*/
|
|
39
38
|
this.setTimer = () => {
|
|
@@ -41,7 +40,6 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
41
40
|
};
|
|
42
41
|
/**
|
|
43
42
|
* Clear timer
|
|
44
|
-
*
|
|
45
43
|
* @returns {void}
|
|
46
44
|
*/
|
|
47
45
|
this.clearTimer = () => {
|
|
@@ -49,7 +47,6 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
49
47
|
};
|
|
50
48
|
/**
|
|
51
49
|
* Event to add on element
|
|
52
|
-
*
|
|
53
50
|
* @param {MouseEvent | FocusEvent} event event
|
|
54
51
|
* @returns {void}
|
|
55
52
|
*/
|
|
@@ -74,8 +71,7 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
74
71
|
};
|
|
75
72
|
/**
|
|
76
73
|
* Get icon corresponding to variant
|
|
77
|
-
*
|
|
78
|
-
* @returns {string} icon
|
|
74
|
+
* @returns {MgIcon['icon'] | undefined} icon
|
|
79
75
|
*/
|
|
80
76
|
this.getIcon = () => {
|
|
81
77
|
switch (this.variant) {
|
|
@@ -98,7 +94,7 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
98
94
|
this.hasActions = false;
|
|
99
95
|
}
|
|
100
96
|
validateDelay(newValue) {
|
|
101
|
-
if (newValue && newValue < 2) {
|
|
97
|
+
if (newValue !== undefined && newValue < 2) {
|
|
102
98
|
throw new Error(`<mg-message> prop "delay" must be greater than 2 seconds.`);
|
|
103
99
|
}
|
|
104
100
|
}
|
|
@@ -167,7 +163,6 @@ const MgMessage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
167
163
|
}
|
|
168
164
|
/**
|
|
169
165
|
* Render
|
|
170
|
-
*
|
|
171
166
|
* @returns {HTMLElement} HTML Element
|
|
172
167
|
*/
|
|
173
168
|
render() {
|
|
@@ -55,7 +55,6 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
55
55
|
*************/
|
|
56
56
|
/**
|
|
57
57
|
* Handle close button
|
|
58
|
-
*
|
|
59
58
|
* @returns {void}
|
|
60
59
|
*/
|
|
61
60
|
this.handleClose = () => {
|
|
@@ -88,7 +87,6 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
88
87
|
}
|
|
89
88
|
/**
|
|
90
89
|
* Handle 'escape' key down
|
|
91
|
-
*
|
|
92
90
|
* @param {KeyboardEvent} event keydown event
|
|
93
91
|
* @returns {void}
|
|
94
92
|
*/
|
|
@@ -103,7 +101,6 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
103
101
|
*************/
|
|
104
102
|
/**
|
|
105
103
|
* Check if component props are well configured on init
|
|
106
|
-
*
|
|
107
104
|
* @returns {void}
|
|
108
105
|
*/
|
|
109
106
|
componentWillLoad() {
|
|
@@ -123,7 +120,6 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
123
120
|
}
|
|
124
121
|
/**
|
|
125
122
|
* Add observer on component to set focus when displayed
|
|
126
|
-
*
|
|
127
123
|
* @returns {void}
|
|
128
124
|
*/
|
|
129
125
|
componentDidLoad() {
|
|
@@ -139,7 +135,6 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
139
135
|
}
|
|
140
136
|
/**
|
|
141
137
|
* Render
|
|
142
|
-
*
|
|
143
138
|
* @returns {HTMLElement} HTML Element
|
|
144
139
|
*/
|
|
145
140
|
render() {
|
|
@@ -154,7 +149,7 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
154
149
|
}, [1, "mg-modal", {
|
|
155
150
|
"identifier": [1],
|
|
156
151
|
"modalTitle": [1, "modal-title"],
|
|
157
|
-
"closeButton": [
|
|
152
|
+
"closeButton": [4, "close-button"],
|
|
158
153
|
"hide": [1028],
|
|
159
154
|
"hasActions": [32],
|
|
160
155
|
"hasContent": [32],
|
|
@@ -29,7 +29,6 @@ const mgPaginationCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1
|
|
|
29
29
|
* range(1, 1) = [1]
|
|
30
30
|
* range(1, 5) = [1, 2, 3, 4, 5]
|
|
31
31
|
* range(10, 20, 2) = [10, 12, 14, 16, 18, 20]
|
|
32
|
-
*
|
|
33
32
|
* @param {number} start start range
|
|
34
33
|
* @param {number} end start end
|
|
35
34
|
* @param {number} step step size
|
|
@@ -44,7 +43,6 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
44
43
|
this.currentPageChange = createEvent(this, "current-page-change", 7);
|
|
45
44
|
/**
|
|
46
45
|
* Change current page from target
|
|
47
|
-
*
|
|
48
46
|
* @param {number} target target page
|
|
49
47
|
* @returns {void}
|
|
50
48
|
*/
|
|
@@ -56,7 +54,6 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
56
54
|
************/
|
|
57
55
|
/**
|
|
58
56
|
* select handler
|
|
59
|
-
*
|
|
60
57
|
* @param {InputEvent} event value change event
|
|
61
58
|
* @returns {void}
|
|
62
59
|
*/
|
|
@@ -66,7 +63,6 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
66
63
|
};
|
|
67
64
|
/**
|
|
68
65
|
* Go to 'previous/next' page button handler
|
|
69
|
-
*
|
|
70
66
|
* @param {string} action navigation action
|
|
71
67
|
* @param {boolean} disabled button disable state
|
|
72
68
|
* @returns {void}
|
|
@@ -99,7 +95,6 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
99
95
|
*************/
|
|
100
96
|
/**
|
|
101
97
|
* Check if props are well configured on init
|
|
102
|
-
*
|
|
103
98
|
* @returns {void}
|
|
104
99
|
*/
|
|
105
100
|
componentWillLoad() {
|
|
@@ -115,7 +110,6 @@ const MgPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
115
110
|
}
|
|
116
111
|
/**
|
|
117
112
|
* Render
|
|
118
|
-
*
|
|
119
113
|
* @returns {HTMLElement} HTML Element
|
|
120
114
|
*/
|
|
121
115
|
render() {
|
|
@@ -23,7 +23,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
23
23
|
************/
|
|
24
24
|
/**
|
|
25
25
|
* Toggle is editing state
|
|
26
|
-
*
|
|
27
26
|
* @returns {void}
|
|
28
27
|
*/
|
|
29
28
|
this.toggleIsEditing = () => {
|
|
@@ -34,7 +33,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
34
33
|
************/
|
|
35
34
|
/**
|
|
36
35
|
* Collapse button click handler
|
|
37
|
-
*
|
|
38
36
|
* @returns {void}
|
|
39
37
|
*/
|
|
40
38
|
this.handleCollapseButton = () => {
|
|
@@ -44,7 +42,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
44
42
|
};
|
|
45
43
|
/**
|
|
46
44
|
* Edit button click handler
|
|
47
|
-
*
|
|
48
45
|
* @returns {void}
|
|
49
46
|
*/
|
|
50
47
|
this.handleEditButton = () => {
|
|
@@ -52,7 +49,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
52
49
|
};
|
|
53
50
|
/**
|
|
54
51
|
* Update title handler
|
|
55
|
-
*
|
|
56
52
|
* @param {CustomEvent<string>} event input value change event
|
|
57
53
|
* @returns {void}
|
|
58
54
|
*/
|
|
@@ -61,7 +57,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
61
57
|
};
|
|
62
58
|
/**
|
|
63
59
|
* Cancel edition button handler
|
|
64
|
-
*
|
|
65
60
|
* @returns {void}
|
|
66
61
|
*/
|
|
67
62
|
this.handleCancelEditButton = () => {
|
|
@@ -70,7 +65,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
70
65
|
};
|
|
71
66
|
/**
|
|
72
67
|
* Validate edition button handler
|
|
73
|
-
*
|
|
74
68
|
* @returns {void}
|
|
75
69
|
*/
|
|
76
70
|
this.handleValidateEditButton = () => {
|
|
@@ -82,7 +76,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
82
76
|
};
|
|
83
77
|
/**
|
|
84
78
|
* Header left conditional render
|
|
85
|
-
*
|
|
86
79
|
* @typedef {HTMLElement} HTMLMgButtonElement
|
|
87
80
|
* @returns {HTMLMgButtonElement | HTMLElement | HTMLElement[]} header left element
|
|
88
81
|
*/
|
|
@@ -120,10 +113,10 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
120
113
|
this.titleChange.emit(newValue);
|
|
121
114
|
}
|
|
122
115
|
validatetitlePattern(newValue) {
|
|
123
|
-
if (newValue && !this.titleEditable) {
|
|
116
|
+
if (newValue !== undefined && !this.titleEditable) {
|
|
124
117
|
throw new Error('<mg-panel> prop "titleEditable" must be set to `true`.');
|
|
125
118
|
}
|
|
126
|
-
if (newValue && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === '')) {
|
|
119
|
+
if (newValue !== undefined && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === '')) {
|
|
127
120
|
throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
|
|
128
121
|
}
|
|
129
122
|
}
|
|
@@ -135,7 +128,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
135
128
|
*************/
|
|
136
129
|
/**
|
|
137
130
|
* Check if props are well configured on init
|
|
138
|
-
*
|
|
139
131
|
* @returns {void}
|
|
140
132
|
*/
|
|
141
133
|
componentWillLoad() {
|
|
@@ -147,7 +139,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
147
139
|
}
|
|
148
140
|
/**
|
|
149
141
|
* Edit DOM after render
|
|
150
|
-
*
|
|
151
142
|
* @returns {void}
|
|
152
143
|
*/
|
|
153
144
|
componentDidRender() {
|
|
@@ -158,7 +149,6 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
158
149
|
}
|
|
159
150
|
/**
|
|
160
151
|
* Render component
|
|
161
|
-
*
|
|
162
152
|
* @returns {HTMLElement} html element
|
|
163
153
|
*/
|
|
164
154
|
render() {
|
|
@@ -174,10 +164,10 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
174
164
|
}, [1, "mg-panel", {
|
|
175
165
|
"identifier": [1],
|
|
176
166
|
"panelTitle": [1025, "panel-title"],
|
|
177
|
-
"titlePattern": [
|
|
178
|
-
"titlePatternErrorMessage": [
|
|
167
|
+
"titlePattern": [1, "title-pattern"],
|
|
168
|
+
"titlePatternErrorMessage": [1, "title-pattern-error-message"],
|
|
179
169
|
"expanded": [1028],
|
|
180
|
-
"expandToggleDisabled": [
|
|
170
|
+
"expandToggleDisabled": [4, "expand-toggle-disabled"],
|
|
181
171
|
"titleEditable": [4, "title-editable"],
|
|
182
172
|
"classList": [32],
|
|
183
173
|
"isEditing": [32],
|
|
@@ -19,7 +19,6 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
19
19
|
this.classArrowHide = `mg-popover--arrow-hide`;
|
|
20
20
|
/**
|
|
21
21
|
* Check if clicked outside of component
|
|
22
|
-
*
|
|
23
22
|
* @param {MouseEvent} event mouse event
|
|
24
23
|
* @returns {void}
|
|
25
24
|
*/
|
|
@@ -33,7 +32,6 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
33
32
|
};
|
|
34
33
|
/**
|
|
35
34
|
* Show popover
|
|
36
|
-
*
|
|
37
35
|
* @returns {void}
|
|
38
36
|
*/
|
|
39
37
|
this.show = () => {
|
|
@@ -53,7 +51,6 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
53
51
|
};
|
|
54
52
|
/**
|
|
55
53
|
* Hide popover
|
|
56
|
-
*
|
|
57
54
|
* @returns {void}
|
|
58
55
|
*/
|
|
59
56
|
this.hide = () => {
|
|
@@ -68,7 +65,6 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
68
65
|
};
|
|
69
66
|
/**
|
|
70
67
|
* Handle action for close button
|
|
71
|
-
*
|
|
72
68
|
* @returns {void}
|
|
73
69
|
*/
|
|
74
70
|
this.handleCloseButton = () => {
|
|
@@ -102,7 +98,6 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
102
98
|
*************/
|
|
103
99
|
/**
|
|
104
100
|
* Check if component props are well configured on init
|
|
105
|
-
*
|
|
106
101
|
* @returns {void} timeout
|
|
107
102
|
*/
|
|
108
103
|
componentWillLoad() {
|
|
@@ -114,7 +109,6 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
114
109
|
}
|
|
115
110
|
/**
|
|
116
111
|
* Check if component props are well configured on init
|
|
117
|
-
*
|
|
118
112
|
* @returns {void}
|
|
119
113
|
*/
|
|
120
114
|
componentDidLoad() {
|
|
@@ -172,7 +166,6 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
172
166
|
}
|
|
173
167
|
/**
|
|
174
168
|
* Render
|
|
175
|
-
*
|
|
176
169
|
* @returns {HTMLElement} HTML Element
|
|
177
170
|
*/
|
|
178
171
|
render() {
|
|
@@ -190,7 +183,7 @@ const MgPopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
190
183
|
"arrowHide": [4, "arrow-hide"],
|
|
191
184
|
"closeButton": [4, "close-button"],
|
|
192
185
|
"display": [1028],
|
|
193
|
-
"disabled": [
|
|
186
|
+
"disabled": [4],
|
|
194
187
|
"classList": [32]
|
|
195
188
|
}]);
|
|
196
189
|
function defineCustomElement() {
|
|
@@ -14,7 +14,6 @@ const MgSkipLinks$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
14
14
|
**********/
|
|
15
15
|
/**
|
|
16
16
|
* Handle link click and emit go-to-anchor event
|
|
17
|
-
*
|
|
18
17
|
* @param {MouseEvent} event mouse event
|
|
19
18
|
* @returns {void}
|
|
20
19
|
*/
|
|
@@ -36,7 +35,6 @@ const MgSkipLinks$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
36
35
|
*************/
|
|
37
36
|
/**
|
|
38
37
|
* Check if props are well configured on init
|
|
39
|
-
*
|
|
40
38
|
* @returns {void}
|
|
41
39
|
*/
|
|
42
40
|
componentWillLoad() {
|
|
@@ -45,7 +43,6 @@ const MgSkipLinks$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
45
43
|
}
|
|
46
44
|
/**
|
|
47
45
|
* Render
|
|
48
|
-
*
|
|
49
46
|
* @returns {HTMLElement} HTML Element
|
|
50
47
|
*/
|
|
51
48
|
render() {
|
|
@@ -57,7 +54,7 @@ const MgSkipLinks$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
57
54
|
}; }
|
|
58
55
|
static get style() { return mgSkipLinksCss; }
|
|
59
56
|
}, [1, "mg-skip-links", {
|
|
60
|
-
"links": [
|
|
57
|
+
"links": [16]
|
|
61
58
|
}]);
|
|
62
59
|
function defineCustomElement$1() {
|
|
63
60
|
if (typeof customElements === "undefined") {
|