@mgdis/mg-components 6.26.0 → 6.27.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_36.cjs.entry.js +144 -87
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-illustration.cjs.entry.js +1 -1
- package/dist/cjs/mg-input-combobox.cjs.entry.js +25 -7
- package/dist/cjs/mg-input-file.cjs.entry.js +1 -1
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +1591 -631
- package/dist/cjs/mg-loader.cjs.entry.js +1 -1
- package/dist/cjs/mg-progress.cjs.entry.js +1 -1
- package/dist/collection/assets/illustrations/index.js +1 -1
- package/dist/collection/assets/jodit/jodit.css +14 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +103 -55
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +2 -4
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +24 -6
- package/dist/collection/components/molecules/mg-details/mg-details.js +5 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +10 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +3 -3
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-form.js +1 -1
- package/dist/components/mg-illustrated-message.js +1 -1
- package/dist/components/mg-illustration.js +1 -1
- package/dist/components/mg-input-checkbox.js +1 -1
- package/dist/components/mg-input-combobox.js +1 -1
- package/dist/components/mg-input-date.js +1 -1
- package/dist/components/mg-input-file.js +1 -1
- package/dist/components/mg-input-numeric.js +1 -1
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +1 -1
- package/dist/components/mg-input-rich-text-editor.js +284 -284
- package/dist/components/mg-input-select2.js +1 -1
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-input2.js +1 -1
- package/dist/components/mg-loader2.js +1 -1
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-message2.js +1 -1
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover-content2.js +1 -1
- package/dist/components/mg-popover2.js +1 -1
- package/dist/components/mg-progress.js +1 -1
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-tabs2.js +1 -1
- package/dist/components/mg-tooltip2.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_36.entry.js +144 -87
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-illustration.entry.js +1 -1
- package/dist/esm/mg-input-combobox.entry.js +25 -7
- package/dist/esm/mg-input-file.entry.js +1 -1
- package/dist/esm/mg-input-rich-text-editor.entry.js +1591 -631
- package/dist/esm/mg-loader.entry.js +1 -1
- package/dist/esm/mg-progress.entry.js +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-3ad7441c.entry.js → p-32a55ddb.entry.js} +1 -1
- package/dist/mg-components/p-6f492676.entry.js +1667 -0
- package/dist/mg-components/p-813d69c7.entry.js +1 -0
- package/dist/mg-components/p-85ebacd6.entry.js +1 -0
- package/dist/mg-components/p-a2445605.entry.js +1 -0
- package/dist/mg-components/{p-96fc508e.entry.js → p-c2beff2c.entry.js} +1 -1
- package/dist/mg-components/p-f308e2e4.entry.js +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +33 -6
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +11 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +4 -0
- package/ide/intellij/web-types.json +1 -1
- package/package.json +17 -17
- package/dist/mg-components/p-206505b5.entry.js +0 -1667
- package/dist/mg-components/p-5dff879a.entry.js +0 -1
- package/dist/mg-components/p-b20f3698.entry.js +0 -1
- package/dist/mg-components/p-bf2252c9.entry.js +0 -1
- package/dist/mg-components/p-f8e58181.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.13.
|
|
4
|
+
* Version: v4.13.22
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -3841,6 +3841,19 @@ a + .jodit-file-browser-tree__source-title {
|
|
|
3841
3841
|
.jodit-color-picker__color-item:active {
|
|
3842
3842
|
border: 2px solid var(--jd-color-border-selected);
|
|
3843
3843
|
}
|
|
3844
|
+
.jodit-color-picker__extra {
|
|
3845
|
+
display: flex;
|
|
3846
|
+
align-items: center;
|
|
3847
|
+
justify-content: space-between;
|
|
3848
|
+
}
|
|
3849
|
+
.jodit-color-picker__hex input {
|
|
3850
|
+
width: 80px;
|
|
3851
|
+
padding: 2px 4px;
|
|
3852
|
+
border: 1px solid var(--jd-color-border);
|
|
3853
|
+
border-radius: var(--jd-border-radius-default);
|
|
3854
|
+
font-family: monospace;
|
|
3855
|
+
font-size: var(--jd-font-size-small, 12px);
|
|
3856
|
+
}
|
|
3844
3857
|
.jodit-color-picker__native svg {
|
|
3845
3858
|
display: inline-block;
|
|
3846
3859
|
width: 16px;
|
|
@@ -30,6 +30,13 @@ export class MgTooltip {
|
|
|
30
30
|
* Disable tooltip
|
|
31
31
|
*/
|
|
32
32
|
this.disabled = false;
|
|
33
|
+
/**
|
|
34
|
+
* Toggle the popper scroll and resize listeners, only needed while the tooltip is visible
|
|
35
|
+
* @param enabled - listeners state to apply
|
|
36
|
+
*/
|
|
37
|
+
this.setPopperEventListeners = (enabled) => {
|
|
38
|
+
this.popper.setOptions((options) => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled }] })));
|
|
39
|
+
};
|
|
33
40
|
/**
|
|
34
41
|
* Show tooltip
|
|
35
42
|
*/
|
|
@@ -37,7 +44,7 @@ export class MgTooltip {
|
|
|
37
44
|
// Make the tooltip visible
|
|
38
45
|
this.mgTooltipContent.dataset.show = '';
|
|
39
46
|
// Enable the event listeners
|
|
40
|
-
this.
|
|
47
|
+
this.setPopperEventListeners(true);
|
|
41
48
|
// hide when click outside on nextTick to prevent event to trigger after creation
|
|
42
49
|
nextTick(() => {
|
|
43
50
|
this.windows.forEach((localWindow) => {
|
|
@@ -53,7 +60,7 @@ export class MgTooltip {
|
|
|
53
60
|
// Hide the tooltip
|
|
54
61
|
this.mgTooltipContent.removeAttribute('data-show');
|
|
55
62
|
// Disable the event listeners
|
|
56
|
-
this.
|
|
63
|
+
this.setPopperEventListeners(false);
|
|
57
64
|
// Remove event listener
|
|
58
65
|
this.windows.forEach((localWindow) => {
|
|
59
66
|
localWindow.removeEventListener('click', this.handleClickOutside, false);
|
|
@@ -117,6 +124,47 @@ export class MgTooltip {
|
|
|
117
124
|
this.resetGuard = () => {
|
|
118
125
|
this.guard = undefined;
|
|
119
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Display tooltip when the tooltiped element takes focus
|
|
129
|
+
*/
|
|
130
|
+
this.handleTooltipedElementFocus = () => {
|
|
131
|
+
this.guard = Guard.FOCUS;
|
|
132
|
+
this.setDisplay(true);
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Hide tooltip when the tooltiped element loses focus
|
|
136
|
+
*/
|
|
137
|
+
this.handleTooltipedElementBlur = () => {
|
|
138
|
+
this.resetGuard();
|
|
139
|
+
this.setDisplay(false);
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Display tooltip when the tooltiped element is hovered
|
|
143
|
+
*/
|
|
144
|
+
this.handleTooltipedElementMouseenter = () => {
|
|
145
|
+
this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, 'mouseenter', Guard.HOVER_TOOLTIP_ELEMENT);
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Hide tooltip when the tooltiped element is not hovered anymore
|
|
149
|
+
*/
|
|
150
|
+
this.handleTooltipedElementMouseleave = () => {
|
|
151
|
+
this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, 'mouseleave', Guard.HOVER_TOOLTIP_ELEMENT);
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Manage all tooltiped element listeners
|
|
155
|
+
* @param element - element to bind or unbind
|
|
156
|
+
* @param action - process to apply on element listeners
|
|
157
|
+
*/
|
|
158
|
+
this.manageTooltipedElementListeners = (element, action) => {
|
|
159
|
+
element[action]('focus', this.handleTooltipedElementFocus);
|
|
160
|
+
// as `click` event is the composition of `mousedown` and `mouseup` event,
|
|
161
|
+
// and `click` event trigger `focus` event after a success `mousedown` wich set the `guard` to `Guard.FOCUS`
|
|
162
|
+
// we reset the guard on `mouseup` event to unlock tooltip
|
|
163
|
+
element[action]('mouseup', this.resetGuard);
|
|
164
|
+
element[action]('blur', this.handleTooltipedElementBlur);
|
|
165
|
+
element[action]('mouseenter', this.handleTooltipedElementMouseenter);
|
|
166
|
+
element[action]('mouseleave', this.handleTooltipedElementMouseleave);
|
|
167
|
+
};
|
|
120
168
|
/**
|
|
121
169
|
* Update slot content when it is a mg-button
|
|
122
170
|
* @param mgButton - slotted mg-button
|
|
@@ -143,10 +191,11 @@ export class MgTooltip {
|
|
|
143
191
|
}
|
|
144
192
|
};
|
|
145
193
|
/**
|
|
146
|
-
* Set popper instance
|
|
147
|
-
* @param strategy - popper strategy to apply on instance
|
|
194
|
+
* Set popper instance on the current tooltiped element
|
|
148
195
|
*/
|
|
149
|
-
this.setPopper = (
|
|
196
|
+
this.setPopper = () => {
|
|
197
|
+
// mg-popover content is already `fixed`: position a nested tooltip relatively to it
|
|
198
|
+
const strategy = this.element.closest('mg-popover') !== null ? 'absolute' : 'fixed';
|
|
150
199
|
// Create popperjs tooltip
|
|
151
200
|
this.popper = createPopper(this.tooltipedElement, this.mgTooltipContent, {
|
|
152
201
|
placement: this.placement,
|
|
@@ -172,29 +221,20 @@ export class MgTooltip {
|
|
|
172
221
|
* @param element - tooltiped element
|
|
173
222
|
*/
|
|
174
223
|
this.setTooltipedElement = (element) => {
|
|
224
|
+
// unbind the previous element so its listeners do not stack up on every `disabled` toggle
|
|
225
|
+
if (this.tooltipedElement !== undefined) {
|
|
226
|
+
this.manageTooltipedElementListeners(this.tooltipedElement, 'removeEventListener');
|
|
227
|
+
}
|
|
175
228
|
this.tooltipedElement = element;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
this.resetGuard();
|
|
186
|
-
});
|
|
187
|
-
this.tooltipedElement.addEventListener('blur', () => {
|
|
188
|
-
this.resetGuard();
|
|
189
|
-
this.setDisplay(false);
|
|
190
|
-
});
|
|
191
|
-
// manage tooltipElement & tooltipedElement mouseenter/mouseleave events
|
|
192
|
-
this.tooltipedElement.addEventListener('mouseenter', () => {
|
|
193
|
-
this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, 'mouseenter', Guard.HOVER_TOOLTIP_ELEMENT);
|
|
194
|
-
});
|
|
195
|
-
this.tooltipedElement.addEventListener('mouseleave', () => {
|
|
196
|
-
this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, 'mouseleave', Guard.HOVER_TOOLTIP_ELEMENT);
|
|
197
|
-
});
|
|
229
|
+
this.manageTooltipedElementListeners(this.tooltipedElement, 'addEventListener');
|
|
230
|
+
// popper freezes its reference element, so re-create it to follow the new one.
|
|
231
|
+
// The initial instance comes from `componentDidLoad`.
|
|
232
|
+
if (this.popper !== undefined) {
|
|
233
|
+
this.popper.destroy();
|
|
234
|
+
this.setPopper();
|
|
235
|
+
// a fresh instance has its listeners enabled, realign them
|
|
236
|
+
this.setPopperEventListeners(this.display);
|
|
237
|
+
}
|
|
198
238
|
};
|
|
199
239
|
/**
|
|
200
240
|
* Set button mutation observer
|
|
@@ -222,17 +262,36 @@ export class MgTooltip {
|
|
|
222
262
|
}).observe(mgButton, { attributes: true });
|
|
223
263
|
};
|
|
224
264
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
265
|
+
* Reconcile the tooltiped element a11y: the tooltip is restituted — `aria-describedby` exposed, and a
|
|
266
|
+
* non-interactive element made focusable (`tabindex` + `role`) — unless it is disabled and not displayed.
|
|
267
|
+
* Pre-existing `aria-describedby` ids are preserved.
|
|
227
268
|
*/
|
|
228
|
-
this.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
269
|
+
this.updateTooltipedElementA11y = () => {
|
|
270
|
+
const restitute = !this.disabled || this.display;
|
|
271
|
+
const currentValue = this.tooltipedElement.getAttribute('aria-describedby');
|
|
272
|
+
const ids = new Set(currentValue !== null ? currentValue.split(' ') : []);
|
|
273
|
+
if (restitute) {
|
|
274
|
+
ids.add(this.identifier);
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
ids.delete(this.identifier);
|
|
278
|
+
}
|
|
279
|
+
if (ids.size > 0) {
|
|
280
|
+
this.tooltipedElement.setAttribute('aria-describedby', [...ids].join(' '));
|
|
232
281
|
}
|
|
233
282
|
else {
|
|
234
|
-
|
|
235
|
-
|
|
283
|
+
this.tooltipedElement.removeAttribute('aria-describedby');
|
|
284
|
+
}
|
|
285
|
+
if (this.hasCustomTabIndex) {
|
|
286
|
+
if (restitute) {
|
|
287
|
+
this.tooltipedElement.setAttribute('role', 'button');
|
|
288
|
+
if (!this.tooltipedElement.hasAttribute('tabindex'))
|
|
289
|
+
this.tooltipedElement.setAttribute('tabindex', '0');
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
this.tooltipedElement.removeAttribute('role');
|
|
293
|
+
this.tooltipedElement.removeAttribute('tabindex');
|
|
294
|
+
}
|
|
236
295
|
}
|
|
237
296
|
};
|
|
238
297
|
}
|
|
@@ -257,14 +316,11 @@ export class MgTooltip {
|
|
|
257
316
|
else {
|
|
258
317
|
this.hide();
|
|
259
318
|
}
|
|
319
|
+
this.updateTooltipedElementA11y();
|
|
260
320
|
}
|
|
261
|
-
watchDisabled(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
this.tooltipedElement.removeAttribute('tabindex');
|
|
265
|
-
else if (!this.tooltipedElement.hasAttribute('tabindex'))
|
|
266
|
-
this.tooltipedElement.setAttribute('tabindex', '0');
|
|
267
|
-
}
|
|
321
|
+
watchDisabled() {
|
|
322
|
+
// Only fires on runtime changes; the initial reconcile is done in componentDidLoad via watchDisplay.
|
|
323
|
+
this.updateTooltipedElementA11y();
|
|
268
324
|
}
|
|
269
325
|
/**
|
|
270
326
|
* Render tooltip content element and init listeners
|
|
@@ -304,7 +360,6 @@ export class MgTooltip {
|
|
|
304
360
|
// Get tooltip element
|
|
305
361
|
this.renderTooltipContent();
|
|
306
362
|
//validate properties
|
|
307
|
-
this.watchDisabled(this.disabled);
|
|
308
363
|
this.watchMessage(this.message);
|
|
309
364
|
this.watchIdentifier(this.identifier);
|
|
310
365
|
}
|
|
@@ -333,20 +388,13 @@ export class MgTooltip {
|
|
|
333
388
|
if (this.element.querySelector('mg-button[full-width]') !== null) {
|
|
334
389
|
this.element.classList.add('mg-c-tooltip--full-width');
|
|
335
390
|
}
|
|
336
|
-
//
|
|
337
|
-
|
|
338
|
-
this.hasCustomTabIndex = true;
|
|
339
|
-
slotElement.tabIndex = 0;
|
|
340
|
-
// Add role on non-interactive element to work with "aria-describedby" for screen readers
|
|
341
|
-
slotElement.setAttribute('role', 'button');
|
|
342
|
-
}
|
|
343
|
-
// apply a11y aria
|
|
344
|
-
this.setAriaDescribedby(slotElement);
|
|
391
|
+
// Non-interactive slotted element (no focusable element found): needs synthesized focus to be reachable.
|
|
392
|
+
this.hasCustomTabIndex = [undefined, null].includes(interactiveElement);
|
|
345
393
|
// set Tooltip
|
|
346
|
-
this.setPopper(
|
|
394
|
+
this.setPopper();
|
|
347
395
|
// add document keyboard handler
|
|
348
396
|
document.addEventListener('keydown', this.handlePressEscape);
|
|
349
|
-
// check props
|
|
397
|
+
// check props (also does the initial a11y reconcile)
|
|
350
398
|
this.watchDisplay(this.display);
|
|
351
399
|
}
|
|
352
400
|
/**
|
|
@@ -371,7 +419,7 @@ export class MgTooltip {
|
|
|
371
419
|
* @returns HTML Element
|
|
372
420
|
*/
|
|
373
421
|
render() {
|
|
374
|
-
return (h(Host, { key: '
|
|
422
|
+
return (h(Host, { key: '1e9cfc59c335510c21d159253e3f8e1b4256a465' }, h("slot", { key: 'c52d57e3302d4865a2365ac62c931af2948bdf03' }), h("slot", { key: '527b5d8ae562ed1f5faed74356f10be5aca10ac4', name: "content" })));
|
|
375
423
|
}
|
|
376
424
|
static get is() { return "mg-tooltip"; }
|
|
377
425
|
static get encapsulation() { return "shadow"; }
|
|
@@ -295,9 +295,7 @@ export class MgInputCheckbox {
|
|
|
295
295
|
* Renders the readonly value of the input.
|
|
296
296
|
* @returns The rendered readonly value.
|
|
297
297
|
*/
|
|
298
|
-
this.renderReadonly = (readonlyValue) => {
|
|
299
|
-
return this.inputVerticalList ? (h("ul", { class: "mg-c-input__readonly-value" }, readonlyValue.map((value) => (h("li", { key: value }, h("b", null, value)))))) : (h("b", { class: "mg-c-input__readonly-value" }, readonlyValue.join(', ')));
|
|
300
|
-
};
|
|
298
|
+
this.renderReadonly = (readonlyValue) => (h("b", { class: "mg-c-input__readonly-value" }, readonlyValue.join(', ')));
|
|
301
299
|
/**
|
|
302
300
|
* Renders the MgInputCheckboxList component.
|
|
303
301
|
* @returns The rendered MgInputCheckboxList component.
|
|
@@ -605,7 +603,7 @@ export class MgInputCheckbox {
|
|
|
605
603
|
else {
|
|
606
604
|
inputContent = this.renderCheckboxMulti();
|
|
607
605
|
}
|
|
608
|
-
return (h("mg-input", { key: '
|
|
606
|
+
return (h("mg-input", { key: 'e243244fb902cf960d112502e4627a787212db31', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue.length === 0 ? 'label' : this.tooltipPosition, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined }, inputContent));
|
|
609
607
|
}
|
|
610
608
|
static get is() { return "mg-input-checkbox"; }
|
|
611
609
|
static get encapsulation() { return "shadow"; }
|
|
@@ -352,11 +352,29 @@ export class MgInputCombobox {
|
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
+
/**
|
|
356
|
+
* Check if an option matches the current filter
|
|
357
|
+
* @param option - option to match
|
|
358
|
+
* @returns true if the option matches the filter
|
|
359
|
+
*/
|
|
360
|
+
this.matchFilter = (option) => this.filter === '' || option.title.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase());
|
|
361
|
+
/**
|
|
362
|
+
* Get all the options matching the current filter
|
|
363
|
+
* @returns filtered options
|
|
364
|
+
*/
|
|
365
|
+
this.getFilteredOptions = () => this.options.items.filter(this.matchFilter);
|
|
355
366
|
/**
|
|
356
367
|
* Get first page with filter applied
|
|
357
368
|
* @returns first page with filter applied
|
|
358
369
|
*/
|
|
359
|
-
this.getFirstPage = () =>
|
|
370
|
+
this.getFirstPage = () => {
|
|
371
|
+
const page = this.options.getPage(0, this.matchFilter);
|
|
372
|
+
// `Paginate` keeps the unfiltered total: realign it with the filtered options, except in
|
|
373
|
+
// `fetchurl` mode where the total counts the options left to load
|
|
374
|
+
if (this.fetchurl === undefined)
|
|
375
|
+
page.total = this.getFilteredOptions().length;
|
|
376
|
+
return page;
|
|
377
|
+
};
|
|
360
378
|
/**
|
|
361
379
|
* Loading wrapper with a given action
|
|
362
380
|
* @param action - wrapped loading action
|
|
@@ -400,9 +418,7 @@ export class MgInputCombobox {
|
|
|
400
418
|
return promise()
|
|
401
419
|
.then(() => {
|
|
402
420
|
// parse full items list from options
|
|
403
|
-
const options = this.
|
|
404
|
-
? this.options.items
|
|
405
|
-
: this.options.items.filter((option) => option.title.includes(this.filter));
|
|
421
|
+
const options = this.getFilteredOptions();
|
|
406
422
|
// update visual focus
|
|
407
423
|
if (action.name !== 'load-data') {
|
|
408
424
|
index = this.page.getIndexFromCursor(action.cursor, this.loadingAction === 'load-more' && index >= 0 ? options[index] : this.option);
|
|
@@ -439,7 +455,9 @@ export class MgInputCombobox {
|
|
|
439
455
|
return nextTick(() => {
|
|
440
456
|
if (typeof this.page.next === 'function') {
|
|
441
457
|
const nextPage = this.page.next();
|
|
442
|
-
this.page = new Page(Object.assign(Object.assign({}, nextPage), { items: [...this.page.items, ...nextPage.items]
|
|
458
|
+
this.page = new Page(Object.assign(Object.assign({}, nextPage), { items: [...this.page.items, ...nextPage.items],
|
|
459
|
+
// `Paginate` keeps the unfiltered total, realign it as in `getFirstPage`
|
|
460
|
+
total: this.getFilteredOptions().length }));
|
|
443
461
|
}
|
|
444
462
|
});
|
|
445
463
|
}
|
|
@@ -778,7 +796,7 @@ export class MgInputCombobox {
|
|
|
778
796
|
else {
|
|
779
797
|
activeDescendant = (_e = this.value) === null || _e === void 0 ? void 0 : _e.value;
|
|
780
798
|
}
|
|
781
|
-
return (h("mg-input", { key: '
|
|
799
|
+
return (h("mg-input", { key: '047c14310f70117e1aec89161d2261f175487be7', label: this.label, identifier: this.identifier, class: this.classCollection.classes.join(' '), ariaDescribedbyIDs: popoverContent && popoverContent !== 'list' ? popoverContent : undefined, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, readonlyValue)) : (h("mg-popover", { identifier: this.popoverId, placement: this.popoverPlacement, display: this.popoverDisplay, style: {
|
|
782
800
|
'--mg-c-input-list-width': ((_f = this.input) === null || _f === void 0 ? void 0 : _f.offsetWidth) > 0 ? `${this.input.offsetWidth}px` : undefined,
|
|
783
801
|
}, "data-fallback-placement": "bottom-end", "onDisplay-change": this.handlePopoverDisplay }, h("div", { class: "mg-c-input__input-group-container" }, h("mg-icon", { icon: "magnifying-glass" }), h("input", { type: "text", role: "combobox", class: "mg-c-input__box mg-c-input__box--width", value: this.filter, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, autocomplete: "off", "aria-autocomplete": "list", "aria-expanded": this.popoverDisplay.toString(), "aria-controls": listId, "aria-invalid": (this.invalid === true).toString(), "aria-activedescendant": formatID(activeDescendant), onInput: this.handleFilterInput, onBlur: this.handleFilterBlur, onFocus: this.handleFilterFocus, onKeyDown: this.handleFilterKeydown, ref: (el) => {
|
|
784
802
|
if (el !== null)
|
|
@@ -55,7 +55,11 @@ export class MgDetails {
|
|
|
55
55
|
* @returns HTML Element
|
|
56
56
|
*/
|
|
57
57
|
render() {
|
|
58
|
-
return (h("details", { key: '
|
|
58
|
+
return (h("details", { key: '12eac25682e22d65ace61f6697656459d1494903', class: {
|
|
59
|
+
'mg-c-details': true,
|
|
60
|
+
'mg-c-details--hide-summary': this.hideSummary,
|
|
61
|
+
'mg-c-details--empty-summary': this.isEmptySummary,
|
|
62
|
+
}, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: 'd6d621db04bca17297f770a633fcb17711f99ecf' }, h("slot", { key: '245aad29a2f2cd93e3a5426ce1e010ab6f5b5e07', name: "summary" }), h("span", { key: 'ebfe3c80a00b9b7a38a670f536a3984420ec3945', class: "mg-c-details__toggle" }, h("mg-icon", { key: '73c4eb27b3d6aa9168bf6af9fa118afc51b8ee1a', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: '96730ec386137f7f3aa463b76c20547a5922f294', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: '8ac6eee499e613a543fd2a2ea9d954719d48005d', class: "mg-c-details__details" }, h("slot", { key: '37af4674491d7857163dcc48424e652cfcefbed6', name: "details" }))));
|
|
59
63
|
}
|
|
60
64
|
static get is() { return "mg-details"; }
|
|
61
65
|
static get encapsulation() { return "shadow"; }
|
|
@@ -39,6 +39,10 @@ export class MgForm {
|
|
|
39
39
|
* Component classes
|
|
40
40
|
*/
|
|
41
41
|
this.classCollection = new ClassList(['mg-c-form']);
|
|
42
|
+
/**
|
|
43
|
+
* Whether the form has slotted actions
|
|
44
|
+
*/
|
|
45
|
+
this.hasActions = false;
|
|
42
46
|
/**
|
|
43
47
|
* Define required message based on mg-inputs required elements
|
|
44
48
|
*/
|
|
@@ -205,6 +209,8 @@ export class MgForm {
|
|
|
205
209
|
this.validateAriaRole(this.ariaRole);
|
|
206
210
|
this.validateRequiredMessage(this.requiredMessage);
|
|
207
211
|
this.handlelabelOnTop(this.labelOnTop);
|
|
212
|
+
// Detect slotted actions
|
|
213
|
+
this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
|
|
208
214
|
// Get slotted mgButtons
|
|
209
215
|
this.mgButtons = Array.from(this.element.querySelectorAll('mg-button'));
|
|
210
216
|
// Set button form identifier
|
|
@@ -239,6 +245,7 @@ export class MgForm {
|
|
|
239
245
|
if (mutations.some((mutation) => Object.keys(observerOptions).includes(mutation.type))) {
|
|
240
246
|
this.setMgInputs();
|
|
241
247
|
this.checkValidity();
|
|
248
|
+
this.hasActions = this.element.querySelector('[slot="actions"]') !== null;
|
|
242
249
|
}
|
|
243
250
|
}).observe(this.element, observerOptions);
|
|
244
251
|
}
|
|
@@ -247,7 +254,7 @@ export class MgForm {
|
|
|
247
254
|
* @returns HTML Element
|
|
248
255
|
*/
|
|
249
256
|
render() {
|
|
250
|
-
return (h("form", { key: '
|
|
257
|
+
return (h("form", { key: 'c851e6f19af32f28cad695daa1f42ddff10796a0', class: this.classCollection.join(), id: this.identifier, name: this.name, onSubmit: this.handleFormSubmit, role: this.ariaRole }, this.requiredMessageText && h("p", { key: '7f92b35872c938e87959acac8841937ad503d98f', innerHTML: this.requiredMessageText }), h("slot", { key: 'e75e90f1fe3076d93df82a7a426b17d82035e0cf' }), !this.readonly && !this.disabled && this.hasActions && (h("div", { key: 'a472cf024a61d6be1665d149749ce7d560a00473', class: "mg-c-form__actions" }, h("slot", { key: 'f9098c711cb2d2714057c4f14d6df295b75de774', name: "actions" })))));
|
|
251
258
|
}
|
|
252
259
|
static get is() { return "mg-form"; }
|
|
253
260
|
static get encapsulation() { return "shadow"; }
|
|
@@ -458,7 +465,8 @@ export class MgForm {
|
|
|
458
465
|
static get states() {
|
|
459
466
|
return {
|
|
460
467
|
"classCollection": {},
|
|
461
|
-
"requiredMessageText": {}
|
|
468
|
+
"requiredMessageText": {},
|
|
469
|
+
"hasActions": {}
|
|
462
470
|
};
|
|
463
471
|
}
|
|
464
472
|
static get events() {
|
package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js
CHANGED
|
@@ -100,7 +100,7 @@ export class MgIllustratedMessage {
|
|
|
100
100
|
* @returns HTML Element
|
|
101
101
|
*/
|
|
102
102
|
render() {
|
|
103
|
-
return (h("div", { key: '
|
|
103
|
+
return (h("div", { key: 'b914eadabb438b17c1cddc6b6e0167facf264a37', class: this.classCollection.join() }, h("div", { key: 'c2c55e775db2a622948ebd0d2efef8336520a52a', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: '1b549999f75245d17d7c4ba5696af25921c1725a', name: "illustration" })), h("div", { key: '6f19510b6775bbd366dbb4127ad1ca7b1be8a261', class: "mg-c-illustrated-message__slots" }, h("slot", { key: 'db37d12c2812c8fca129f4d0f24cb011198ba474', name: "title" }), h("slot", { key: '2a1aaf4fe8ea18a971c741c03e05d146584567a7', name: "details" }))));
|
|
104
104
|
}
|
|
105
105
|
static get is() { return "mg-illustrated-message"; }
|
|
106
106
|
static get encapsulation() { return "shadow"; }
|
|
@@ -29,7 +29,7 @@ export class MgLoader {
|
|
|
29
29
|
* @returns HTML Element
|
|
30
30
|
*/
|
|
31
31
|
render() {
|
|
32
|
-
return (h("div", { key: '
|
|
32
|
+
return (h("div", { key: '55e8bc6908f1cd83f9ffc0e30dd28ede501e30d8', class: "mg-c-loader", "aria-live": "polite" }, h("mg-icon", { key: '4306e748a509ac3c546d565bf2bed74529ce3c24', icon: "loader", spin: true }), h("span", { key: '6636df5f58654f6de7f0b79e8e4dd32e4fe2bfc7', class: { 'mg-u-visually-hidden': this.messageHide } }, this.message || this.messages.loader.inProgress)));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "mg-loader"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -100,9 +100,9 @@ export class MgMessage {
|
|
|
100
100
|
* @returns HTML Element
|
|
101
101
|
*/
|
|
102
102
|
render() {
|
|
103
|
-
return (h("div", { key: '
|
|
103
|
+
return (h("div", { key: 'ac4ce18faacbbc2e1f1ecaa03f4ddb4693c9f821', class: this.classCollection.join() }, h("mg-card", { key: '25ce44964f85c27386138f9e2f2e6f9c066810b4', shadow: this.variantStyle !== 'background' }, h("span", { key: '1ec4146aefe5f7a41eb92947b3dfd2d975517de2', class: "mg-c-message__icon" }, h("mg-icon", { key: '24e7c80b674e260e47d6134a996a8da774e5eb68', icon: this.getIcon() })), h("div", { key: '5344654d4373a0f4636d062b16a861a12eda19f0', class: "mg-c-message__content" }, h("span", { key: '63bd0aecd75f348be533a92cf63697eaa35db77b', class: "mg-c-message__content-slot" }, h("slot", { key: '4321f84c6b1679b163b0115b78e4801eeece2e25' })), this.hasActions && [
|
|
104
104
|
h("span", { class: "mg-c-message__content-separator", key: "content-separator" }),
|
|
105
|
-
h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '
|
|
105
|
+
h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '42c8d32832a41bb6dce997078aabaa8a40c16f5c', name: "actions" })),
|
|
106
106
|
]))));
|
|
107
107
|
}
|
|
108
108
|
static get is() { return "mg-message"; }
|
|
@@ -189,7 +189,7 @@ export class MgMessage {
|
|
|
189
189
|
},
|
|
190
190
|
"getter": false,
|
|
191
191
|
"setter": false,
|
|
192
|
-
"reflect":
|
|
192
|
+
"reflect": true,
|
|
193
193
|
"attribute": "full-width",
|
|
194
194
|
"defaultValue": "false"
|
|
195
195
|
}
|
|
@@ -106,11 +106,11 @@ export class MgModal {
|
|
|
106
106
|
* @returns HTML Element
|
|
107
107
|
*/
|
|
108
108
|
render() {
|
|
109
|
-
return (h("dialog", { key: '
|
|
109
|
+
return (h("dialog", { key: '30175543565cfaad83c561b8316ee7af057d6439', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), "aria-labelledby": this.titleId, ref: (el) => {
|
|
110
110
|
if (el !== null) {
|
|
111
111
|
this.dialog = el;
|
|
112
112
|
}
|
|
113
|
-
} }, h("mg-card", { key: '
|
|
113
|
+
} }, h("mg-card", { key: 'b1ddb9603f4956c171fd4e0f5193236b7fc5a739', shadow: true }, h("div", { key: '9d6e8f1d4e19088a31f6785176cee3c099dce111', class: "mg-c-modal__dialog" }, h("header", { key: 'f2e85f730ff4a4dd94df7640d1bb6e3b89c94fbf', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: 'ab1c36f6bbbeed4ba54342a1cae4b08bc3befbb7', class: "mg-c-modal__close-button" }, h("mg-button", { key: '7d3658b31d901dd6b95610e7cbb1d28a47f178f3', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '662f7ee9badfe12dff1c2df58572c8829bf32bff', icon: "cross" })))), h("h1", { key: '8e2ec325dacc29c31806c9525dc4e56ce7f1232b', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: '5bc09995ddda790ec1015737176d24484b4b178c', class: "mg-c-modal__content" }, h("slot", { key: 'c3ff57659beb9e0d523ed0a20ad9768c549f6332' })), this.hasActions && (h("footer", { key: '30336eb46581adbc144a9f8275489e5f9a1b9bcd', class: "mg-c-modal__footer" }, h("slot", { key: 'fc2cc4e0b3c300801d1cf928a8d1ef825c8775bc', name: "actions" })))))));
|
|
114
114
|
}
|
|
115
115
|
static get is() { return "mg-modal"; }
|
|
116
116
|
static get encapsulation() { return "shadow"; }
|
|
@@ -245,7 +245,7 @@ export class MgPanel {
|
|
|
245
245
|
*/
|
|
246
246
|
render() {
|
|
247
247
|
const headerId = `${this.identifier}-header`;
|
|
248
|
-
return (h("section", { key: '
|
|
248
|
+
return (h("section", { key: 'b578e1389d1bbd5e035121c350d5c39b9bdf8a5e', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: '44f71cd6cb5973719608d04d1581d440a53f5d7d', shadow: this.shadow }, h("header", { key: 'fb3b381c2c574bca89391e9007afc0552cce9a14', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: 'ee1ee946f594900680e2182a41de5d86dd515212', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: '7f878c18e3e5d60a7619312b16336858313f1eae' })))));
|
|
249
249
|
}
|
|
250
250
|
static get is() { return "mg-panel"; }
|
|
251
251
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js
CHANGED
|
@@ -46,7 +46,7 @@ export class MgPopoverContent {
|
|
|
46
46
|
* @returns HTML Element
|
|
47
47
|
*/
|
|
48
48
|
render() {
|
|
49
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: 'e019ee038ec460eb854f0c3e1735dbf5d107b76c' }, h("mg-card", { key: 'ddcfa4488e4e1d88f9f04cbe1adbce5571810dc2', class: this.classCollection.join(), shadow: true }, this.closeButton && (h("mg-button", { key: 'ecd864254f96e0e4d855f4fd17ea6cefd9606a75', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: 'ef52183b075b47d9fc81b7ec0074c790c51741aa', icon: "cross" }))), h("div", { key: 'df62e551869ec69e902788d20aa50b169bdfc0ee', class: "mg-c-popover-content__title" }, h("slot", { key: '5a4eada9d48368a34094ba22f83d23c0abd92223', name: "title" })), h("slot", { key: 'bfa7298291aed96a01a45cf2921a5646a022287f', name: "content" }))));
|
|
50
50
|
}
|
|
51
51
|
static get is() { return "mg-popover-content"; }
|
|
52
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -240,7 +240,7 @@ export class MgPopover {
|
|
|
240
240
|
* @returns HTML Element
|
|
241
241
|
*/
|
|
242
242
|
render() {
|
|
243
|
-
return (h(Host, { key: '
|
|
243
|
+
return (h(Host, { key: 'c8f404452600fb8c3c4219c3873d407c9546fa9c' }, h("slot", { key: '0031a6cef5ecab29b82c38a6cdfeef61277e7f57' }), h("slot", { key: 'ececc678b5d54aaad029adcf7d9681471cf78701', name: "content" })));
|
|
244
244
|
}
|
|
245
245
|
static get is() { return "mg-popover"; }
|
|
246
246
|
static get encapsulation() { return "shadow"; }
|
|
@@ -65,7 +65,7 @@ export class MgProgress {
|
|
|
65
65
|
* @returns HTML Element
|
|
66
66
|
*/
|
|
67
67
|
render() {
|
|
68
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: 'c0df3a5d374a8e5761efcd1e340775e5a33b17b4', role: this.ariaRole, "aria-label": this.label, "aria-valuenow": this.value, "aria-valuemin": this.min, "aria-valuemax": this.max }, h("div", { key: '9481f0fdb3bb5b9c0a27cd47113207537dcf0eec', class: "mg-c-progress" }, h("div", { key: '67bf52635d482d56a8b0a85f31da78c243054e22', class: { 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min } }, h("div", { key: '9a55b0bf8132bcec41350941d2bbd470194d7981', class: "mg-c-progress__fill", style: {
|
|
69
69
|
width: `${Math.round(((this.value - this.min) / (this.max - this.min)) * 100)}%`,
|
|
70
70
|
} })))));
|
|
71
71
|
}
|
|
@@ -38,7 +38,7 @@ export class MgSkipLinks {
|
|
|
38
38
|
* @returns HTML Element
|
|
39
39
|
*/
|
|
40
40
|
render() {
|
|
41
|
-
return (h("nav", { key: '
|
|
41
|
+
return (h("nav", { key: '972bbcd87ccb46025324b4dc8e3ded00407e2b77', class: "mg-c-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { key: 'a4673c4b29484e654f4adb5d7c669d4ad372760f', class: "mg-c-skip-links__list", role: "list" }, this.links.map((link) => (h("li", { key: link.href }, h("a", { class: "mg-c-skip-links__link", href: link.href, onClick: this.handleLinkCLick }, link.label)))))));
|
|
42
42
|
}
|
|
43
43
|
static get is() { return "mg-skip-links"; }
|
|
44
44
|
static get encapsulation() { return "shadow"; }
|
|
@@ -226,7 +226,7 @@ export class MgTabs {
|
|
|
226
226
|
* @returns HTML Element
|
|
227
227
|
*/
|
|
228
228
|
render() {
|
|
229
|
-
return (h("div", { key: '
|
|
229
|
+
return (h("div", { key: '6f741baa1d25495fd980586c2cad6203cbb69906', class: this.classCollection.join() }, h("header", { key: '1dd40593a076db2d6c883b2f066e8c96938175bf', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index) => (h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index), class: {
|
|
230
230
|
[`${this.buttonTabBaseClass}`]: true,
|
|
231
231
|
[`${this.buttonTabBaseClass}--horizontal`]: true,
|
|
232
232
|
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasStatus(tab, Status.ACTIVE),
|