@mgdis/mg-components 4.0.1 → 4.1.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/.storybook/utils.js +24 -0
- package/dist/cjs/{index-a39c5567.js → index-179621c8.js} +11 -0
- package/dist/cjs/{index-88560a66.js → index-dd2c7f7b.js} +47 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_21.cjs.entry.js → mg-badge_24.cjs.entry.js} +2363 -214
- package/dist/cjs/mg-components.cjs.js +26 -3
- package/dist/cjs/mg-modal.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +9 -5
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +15 -12
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +4 -0
- package/dist/collection/components/atoms/mg-button/mg-button.js +46 -20
- package/dist/collection/components/atoms/mg-character-left/doc/mg-character-left.stories.js +9 -12
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +11 -3
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +13 -0
- package/dist/collection/components/atoms/mg-input-title/doc/mg-input-title.stories.js +9 -9
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +9 -7
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +27 -8
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +6 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +64 -11
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.js +3 -15
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +3 -12
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +3 -14
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.js +3 -14
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.js +3 -14
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +3 -16
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +11 -22
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.js +4 -13
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +17 -38
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +16 -7
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +25 -0
- package/dist/collection/components/molecules/mg-details/mg-details.css +14 -0
- package/dist/collection/components/molecules/mg-details/mg-details.js +141 -0
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +9 -6
- package/dist/collection/components/molecules/mg-form/mg-form.css +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +48 -4
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +22 -0
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.css +37 -0
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +74 -0
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +9 -15
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +23 -31
- package/dist/collection/components/molecules/mg-pagination/doc/mg-pagination.stories.js +7 -11
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +16 -26
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -6
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +13 -17
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +24 -8
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +11 -12
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +14 -14
- package/dist/collection/stories/helpers.stories.js +11 -3
- package/dist/collection/stories/icons.stories.js +10 -2
- package/dist/collection/stories/typography.stories.js +8 -1
- package/dist/collection/utils/components.utils.js +10 -0
- package/dist/components/components.utils.js +11 -1
- package/dist/components/index.d.ts +25 -23
- package/dist/components/index.js +2 -0
- package/dist/components/mg-button2.js +6 -14
- package/dist/components/mg-details.d.ts +11 -0
- package/dist/components/mg-details.js +87 -0
- package/dist/components/mg-form.js +35 -5
- package/dist/components/mg-icon2.js +13 -0
- package/dist/components/mg-illustrated-message.d.ts +11 -0
- package/dist/components/mg-illustrated-message.js +68 -0
- package/dist/components/mg-input-checkbox.js +1 -1
- package/dist/components/mg-input-date.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-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 +17 -8
- package/dist/components/mg-panel.js +0 -4
- package/dist/components/mg-popover.js +10 -9
- package/dist/components/mg-tabs.js +5 -4
- package/dist/components/mg-tooltip2.js +73 -11
- package/dist/esm/{index-e51ae032.js → index-7efedd97.js} +11 -1
- package/dist/esm/{index-bca81100.js → index-f58b769f.js} +47 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_21.entry.js → mg-badge_24.entry.js} +2360 -214
- package/dist/esm/mg-components.js +26 -3
- package/dist/esm/mg-modal.entry.js +2 -2
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-462d648a.entry.js → p-2a3d8f60.entry.js} +1 -1
- package/dist/mg-components/p-5f89600c.js +1 -0
- package/dist/mg-components/p-b6df1cac.js +2 -0
- package/dist/mg-components/p-c8779533.entry.js +1 -0
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +6 -0
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +8 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +11 -0
- package/dist/types/components/atoms/mg-character-left/doc/mg-character-left.stories.d.ts +0 -10
- package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +1 -6
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +5 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +25 -1
- package/dist/types/components/molecules/mg-details/doc/mg-details.stories.d.ts +11 -0
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +49 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +13 -0
- package/dist/types/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.d.ts +6 -0
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +28 -0
- package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +4 -1
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +6 -1
- package/dist/types/components.d.ts +95 -0
- package/dist/types/home/runner/work/mg-components/mg-components/.stencil/.storybook/utils.d.ts +1 -0
- package/dist/types/utils/components.utils.d.ts +8 -0
- package/package.json +11 -11
- package/dist/cjs/mg-popover.cjs.entry.js +0 -170
- package/dist/cjs/popper-71bf3058.js +0 -1790
- package/dist/esm/mg-popover.entry.js +0 -166
- package/dist/esm/popper-93ecb064.js +0 -1788
- package/dist/mg-components/p-4c66f794.js +0 -1
- package/dist/mg-components/p-5126ab10.entry.js +0 -1
- package/dist/mg-components/p-766c918b.entry.js +0 -1
- package/dist/mg-components/p-780bd52d.js +0 -1
- package/dist/mg-components/p-b14a3443.js +0 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement, c as createEvent,
|
|
2
|
-
import { C as ClassList, c as createID, i as initLocales, a as allItemsAreString } from './index-
|
|
3
|
-
import { c as createPopper } from './popper-93ecb064.js';
|
|
1
|
+
import { r as registerInstance, h, g as getElement, c as createEvent, a as Host } from './index-f58b769f.js';
|
|
2
|
+
import { C as ClassList, c as createID, i as initLocales, a as isTagName, b as allItemsAreString } from './index-7efedd97.js';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* List of all possibles variants
|
|
@@ -97,10 +96,6 @@ const MgButton = class {
|
|
|
97
96
|
* If not set, it will be created.
|
|
98
97
|
*/
|
|
99
98
|
this.identifier = createID('mg-button');
|
|
100
|
-
/**
|
|
101
|
-
* Disable button
|
|
102
|
-
*/
|
|
103
|
-
this.disabled = false;
|
|
104
99
|
/**
|
|
105
100
|
* Define if button is round.
|
|
106
101
|
* Used for icon button.
|
|
@@ -111,15 +106,6 @@ const MgButton = class {
|
|
|
111
106
|
* Parent component have to remove the attribute 'disabled' when the process ends.
|
|
112
107
|
*/
|
|
113
108
|
this.disableOnClick = false;
|
|
114
|
-
/**
|
|
115
|
-
* Prop to set aria-expanded on button element
|
|
116
|
-
*/
|
|
117
|
-
this.expanded = false;
|
|
118
|
-
/**
|
|
119
|
-
* Option to set aria-haspopup
|
|
120
|
-
* The aria-haspopup state informs assistive technology users that there is a popup and the type of popup it is, but provides no interactivity.
|
|
121
|
-
*/
|
|
122
|
-
this.haspopup = false;
|
|
123
109
|
/**
|
|
124
110
|
* Define if button is loading, default to false.
|
|
125
111
|
* Trigger when button is clicked or key-up ['enter', 'space], then value change to true.
|
|
@@ -198,7 +184,10 @@ const MgButton = class {
|
|
|
198
184
|
* @returns {HTMLElement} html element
|
|
199
185
|
*/
|
|
200
186
|
render() {
|
|
201
|
-
return (h("button", { id: this.identifier, class: this.classList.join(), "aria-label": this.label, "aria-disabled": this.disabled.toString(), "aria-expanded": this.expanded, "aria-controls": this.controls, "aria-haspopup": this.haspopup
|
|
187
|
+
return (h("button", { id: this.identifier, class: this.classList.join(), type: this.type, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), "aria-expanded": this.expanded !== undefined && this.expanded.toString(), "aria-controls": this.controls, "aria-haspopup": this.haspopup !== undefined && this.haspopup.toString(), onClick: this.handleClick,
|
|
188
|
+
// has stencil does not support form attribute on button, we set the attribute from the ref
|
|
189
|
+
// https://github.com/ionic-team/stencil/issues/2703#issuecomment-1050943715
|
|
190
|
+
ref: btn => this.form && btn.setAttribute('form', this.form) }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { class: "mg-button__content" }, h("slot", null))));
|
|
202
191
|
}
|
|
203
192
|
get element() { return getElement(this); }
|
|
204
193
|
static get watchers() { return {
|
|
@@ -251,12 +240,68 @@ const MgCharacterLeft = class {
|
|
|
251
240
|
};
|
|
252
241
|
MgCharacterLeft.style = mgCharacterLeftCss;
|
|
253
242
|
|
|
254
|
-
const
|
|
243
|
+
const mgDetailsCss = ".mg-details summary{display:flex;align-items:baseline;cursor:pointer}.mg-details__toggle{margin-left:1.5rem;flex-shrink:0}.mg-details__details{margin-top:1.5rem}";
|
|
244
|
+
|
|
245
|
+
const MgDetails = class {
|
|
246
|
+
constructor(hostRef) {
|
|
247
|
+
registerInstance(this, hostRef);
|
|
248
|
+
this.expandedChange = createEvent(this, "expanded-change", 7);
|
|
249
|
+
/**
|
|
250
|
+
* Define if details are diplayed
|
|
251
|
+
*/
|
|
252
|
+
this.expanded = false;
|
|
253
|
+
/**
|
|
254
|
+
* Handle details toggle
|
|
255
|
+
*
|
|
256
|
+
* @returns {void}
|
|
257
|
+
*/
|
|
258
|
+
this.handleToggle = () => {
|
|
259
|
+
this.expanded = this.details.open;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
validateTitles(newValue) {
|
|
263
|
+
if (newValue === undefined || newValue === '') {
|
|
264
|
+
throw new Error('<mg-details> prop "toggleClosed" and "toggleOpened" must be defined.');
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
handleExpanded(newValue) {
|
|
268
|
+
this.expandedChange.emit(newValue);
|
|
269
|
+
}
|
|
270
|
+
/*************
|
|
271
|
+
* Lifecycle *
|
|
272
|
+
*************/
|
|
273
|
+
/**
|
|
274
|
+
* Check if component props are well configured on init
|
|
275
|
+
*
|
|
276
|
+
* @returns {void}
|
|
277
|
+
*/
|
|
278
|
+
componentWillLoad() {
|
|
279
|
+
this.validateTitles(this.toggleClosed);
|
|
280
|
+
this.validateTitles(this.toggleOpened);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Render
|
|
284
|
+
*
|
|
285
|
+
* @returns {HTMLElement} HTML Element
|
|
286
|
+
*/
|
|
287
|
+
render() {
|
|
288
|
+
return (h("details", { class: "mg-details", onToggle: this.handleToggle, open: this.expanded, ref: el => (this.details = el) }, h("summary", null, h("slot", { name: "summary" }), h("span", { class: "mg-details__toggle" }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), " ", this.expanded ? this.toggleOpened : this.toggleClosed)), h("div", { class: "mg-details__details" }, h("slot", { name: "details" }))));
|
|
289
|
+
}
|
|
290
|
+
static get watchers() { return {
|
|
291
|
+
"toggleClosed": ["validateTitles"],
|
|
292
|
+
"toggleOpened": ["validateTitles"],
|
|
293
|
+
"expanded": ["handleExpanded"]
|
|
294
|
+
}; }
|
|
295
|
+
};
|
|
296
|
+
MgDetails.style = mgDetailsCss;
|
|
297
|
+
|
|
298
|
+
const mgFormCss = ".is-asterisk{color:hsl(var(--color-danger))}.mg-form,.mg-form-group{--mg-inputs-title-width:var(--mg-form-inputs-title-width, 15rem);--mg-inputs-margin-bottom:1.5rem;--mg-inputs-title-horizontal-space:3rem;--mg-inputs-shrink:0}.mg-form.mg-form--all-required,.mg-form-group.mg-form--all-required{--mg-input-title-display:none}.mg-form>p,.mg-form-group>p{font-size:1.2rem}";
|
|
255
299
|
|
|
256
300
|
const MgForm = class {
|
|
257
301
|
constructor(hostRef) {
|
|
258
302
|
registerInstance(this, hostRef);
|
|
259
303
|
this.formValid = createEvent(this, "form-valid", 7);
|
|
304
|
+
this.formSubmit = createEvent(this, "form-submit", 7);
|
|
260
305
|
/**
|
|
261
306
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
262
307
|
* If not set, it will be created.
|
|
@@ -310,6 +355,10 @@ const MgForm = class {
|
|
|
310
355
|
this.invalid = !validity;
|
|
311
356
|
this.formValid.emit(validity);
|
|
312
357
|
};
|
|
358
|
+
this.handleFormSubmit = (event) => {
|
|
359
|
+
event.preventDefault();
|
|
360
|
+
this.formSubmit.emit();
|
|
361
|
+
};
|
|
313
362
|
}
|
|
314
363
|
/**
|
|
315
364
|
* Public method to display errors
|
|
@@ -335,11 +384,17 @@ const MgForm = class {
|
|
|
335
384
|
componentWillLoad() {
|
|
336
385
|
// Get locales
|
|
337
386
|
this.messages = initLocales(this.element).messages;
|
|
338
|
-
// Get slotted
|
|
387
|
+
// Get slotted mgInputs
|
|
339
388
|
this.mgInputs = Array.from(this.element.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-INPUT-'));
|
|
389
|
+
// Get slotted mgButtons
|
|
390
|
+
this.mgButtons = Array.from(this.element.querySelectorAll('*')).filter((node) => node.nodeName.startsWith('MG-BUTTON'));
|
|
391
|
+
// Set button form identifier
|
|
392
|
+
this.mgButtons.forEach(mgButton => {
|
|
393
|
+
mgButton.setAttribute('form', this.identifier);
|
|
394
|
+
});
|
|
340
395
|
// Define required message
|
|
341
396
|
this.setRequiredMessage();
|
|
342
|
-
// Check validity when slotted
|
|
397
|
+
// Check validity when slotted mgInputs are ready
|
|
343
398
|
Promise.all(this.mgInputs.map(async (input) => {
|
|
344
399
|
// Set inputs readonly or disabled based on form configuration
|
|
345
400
|
// Othewise listen to events
|
|
@@ -349,18 +404,37 @@ const MgForm = class {
|
|
|
349
404
|
input.disabled = true;
|
|
350
405
|
else
|
|
351
406
|
input.addEventListener('input-valid', this.checkValidity);
|
|
352
|
-
|
|
407
|
+
try {
|
|
408
|
+
await input.componentOnReady();
|
|
409
|
+
}
|
|
410
|
+
catch (_a) { } // prevent error with VueJS first render
|
|
353
411
|
})).then(() => {
|
|
354
412
|
this.checkValidity();
|
|
355
413
|
});
|
|
356
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* Add slot listeners
|
|
417
|
+
*
|
|
418
|
+
* @returns {void}
|
|
419
|
+
*/
|
|
420
|
+
componentDidLoad() {
|
|
421
|
+
this.mgButtons.forEach(mgButton => {
|
|
422
|
+
// submit buttons should trigger form submition
|
|
423
|
+
const button = mgButton.querySelector('button');
|
|
424
|
+
if (['submit', null].includes(button.getAttribute('type'))) {
|
|
425
|
+
mgButton.addEventListener('click', () => {
|
|
426
|
+
this.form.dispatchEvent(new CustomEvent('submit', { bubbles: true }));
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
357
431
|
/**
|
|
358
432
|
* Render
|
|
359
433
|
*
|
|
360
434
|
* @returns {HTMLElement} HTML Element
|
|
361
435
|
*/
|
|
362
436
|
render() {
|
|
363
|
-
return (h("form", { class: this.classList.join(), id: this.identifier, name: this.name }, this.requiredMessage && h("p", { innerHTML: this.requiredMessage }), h("slot", null), !this.readonly && !this.disabled && h("slot", { name: "actions" })));
|
|
437
|
+
return (h("form", { class: this.classList.join(), id: this.identifier, name: this.name, ref: el => (this.form = el), onSubmit: this.handleFormSubmit }, this.requiredMessage && h("p", { innerHTML: this.requiredMessage }), h("slot", null), !this.readonly && !this.disabled && h("slot", { name: "actions" })));
|
|
364
438
|
}
|
|
365
439
|
get element() { return getElement(this); }
|
|
366
440
|
};
|
|
@@ -377,12 +451,16 @@ const icons = {
|
|
|
377
451
|
'align-right': () => (h("path", { fill: "currentColor", d: "M2.12 7.1h11.76c.25 0 .45-.21.45-.46v-.9c0-.25-.2-.45-.45-.45H2.12c-.25 0-.45.2-.45.45v.9c0 .25.2.45.45.46Zm11.76 5.42H2.12c-.25 0-.45.21-.45.46v.9c0 .25.2.45.45.45h11.76c.25 0 .45-.2.45-.45V13a.466.466 0 0 0-.44-.48h-.01ZM14 1.67H6.55a.36.36 0 0 0-.36.33v1.11c0 .2.16.36.36.37H14c.2 0 .36-.17.36-.37V2a.36.36 0 0 0-.36-.33Zm0 7.23H6.55c-.2 0-.36.17-.36.37v1.08c0 .2.16.36.36.36H14c.2 0 .36-.16.36-.36V9.27c0-.2-.16-.36-.36-.37Z" })),
|
|
378
452
|
'api': () => (h("path", { fill: "currentColor", d: "M14.44 11.47h-.02l-.66-.1-.02-.08c-.03-.11-.08-.21-.13-.31l-.04-.07.4-.54v-.02l-.52-.52h-.02l-.54.41-.07-.04c-.1-.05-.2-.09-.31-.13l-.08-.02-.1-.67v-.01h-.73v.02l-.1.66-.08.02c-.11.03-.21.08-.31.13l-.07.04-.55-.41-.52.52v.02l.41.54-.04.07c-.05.1-.09.2-.13.31l-.02.08-.67.1h-.01v.73h.02l.66.1.02.08c.03.1.08.21.13.3l.04.07-.41.55.52.52h.02l.54-.41.07.04c.1.05.2.09.31.13l.08.02.1.67v.01h.73v-.02l.1-.66.08-.02c.11-.03.21-.08.31-.13l.07-.04.55.41.52-.52v-.02l-.4-.54.04-.07c.05-.1.09-.2.13-.31l.02-.08.67-.1h.01v-.73Zm-2.46 1.38c-.56 0-1.01-.45-1.01-1.01s.45-1.01 1.01-1.01 1.01.45 1.01 1.01-.45 1.01-1.01 1.01ZM8.51 5.81c-.11-.09-.27-.14-.5-.14h-.38v1.17h.27c.26 0 .45-.05.58-.15.13-.1.19-.25.19-.44s-.05-.34-.16-.43Zm1.57 5.13-.3-.4c-.1-.1-.09-.27 0-.37l.52-.52c.1-.1.26-.1.37 0l.4.29c.06-.03.13-.06.2-.08l.07-.49c0-.14.12-.25.26-.25h.45a5.44 5.44 0 1 0-10.5-1.99 5.44 5.44 0 0 0 5.44 5.44c.78 0 1.54-.17 2.25-.49v-.6c0-.14.11-.26.26-.26l.49-.07c.02-.07.05-.13.08-.2Zm.18-5.96h.84v3.94h-.84V4.98ZM5.4 8.92l-.29-.94H3.67l-.29.94h-.9l1.39-3.96h1.02l1.4 3.96h-.9Zm3.72-1.74c-.26.23-.64.34-1.13.34h-.36v1.4h-.84V4.98h1.26c.48 0 .84.1 1.09.31.25.21.37.51.37.92 0 .42-.13.75-.4.97ZM4.4 5.57c-.06.23-.23.8-.51 1.71h1.03c-.26-.85-.41-1.33-.45-1.44-.03-.11-.06-.2-.07-.26Z" })),
|
|
379
453
|
'arrow-down': () => (h("path", { fill: "currentColor", d: "M13,10.1H10.23a.31.31,0,0,1-.32-.28h0V.94A.3.3,0,0,0,9.59.65H6.37A.32.32,0,0,0,6,.94H6V9.81a.29.29,0,0,1-.31.29H3a.3.3,0,0,0-.31.29.27.27,0,0,0,.08.22l5.06,4.58a.36.36,0,0,0,.46,0l5-4.58a.29.29,0,0,0,0-.42C13.22,10.1,13.12,10.1,13,10.1Z" })),
|
|
454
|
+
'arrow-down-right': () => (h("path", { fill: "currentColor", d: "m1.98 3.47 8.75 8.75H6.94c-.58 0-1.05.47-1.05 1.06s.47 1.05 1.05 1.05h6.33c.58 0 1.05-.47 1.05-1.05V6.94a1.05 1.05 0 1 0-2.1 0v3.79L3.47 1.98c-.41-.41-1.08-.41-1.49 0-.41.41-.41 1.08 0 1.49Z" })),
|
|
380
455
|
'arrow-left': () => (h("path", { fill: "currentColor", d: "M5.88,12.93V10.18a.3.3,0,0,1,.28-.32H15a.31.31,0,0,0,.29-.33h0V6.32A.31.31,0,0,0,15,6H6.17a.32.32,0,0,1-.29-.31h0V2.93a.3.3,0,0,0-.28-.32.32.32,0,0,0-.23.09L.79,7.76a.36.36,0,0,0,0,.46l4.58,5a.31.31,0,0,0,.43,0A.4.4,0,0,0,5.88,12.93Z" })),
|
|
381
456
|
'arrow-right': () => (h("path", { fill: "currentColor", d: "M10.16,3V5.75a.3.3,0,0,1-.28.32H1a.31.31,0,0,0-.29.33h0V9.61A.31.31,0,0,0,1,9.94H9.87a.29.29,0,0,1,.29.31h0V13a.3.3,0,0,0,.28.32.32.32,0,0,0,.23-.09l4.58-5.06a.36.36,0,0,0,0-.46l-4.58-5a.3.3,0,0,0-.42,0C10.16,2.76,10.16,2.87,10.16,3Z" })),
|
|
382
457
|
'arrow-rotate': () => (h("path", { fill: "currentColor", d: "M8.02 1.67c-1.6 0-3.15.59-4.33 1.67a6.316 6.316 0 0 0-.38 8.94 6.324 6.324 0 0 0 8.94.37.29.29 0 0 0 0-.42l-1-1a.296.296 0 0 0-.41 0 4.302 4.302 0 0 1-5.76-.09 4.276 4.276 0 0 1-.21-6.06 4.276 4.276 0 0 1 6.06-.21L9.86 5.95c-.11.12-.18.27-.18.43 0 .34.28.62.62.62h3.44c.34-.01.6-.29.59-.63V2.94a.62.62 0 0 0-.18-.44.61.61 0 0 0-.85 0l-.91.91a6.37 6.37 0 0 0-4.38-1.75h.02Z" })),
|
|
383
458
|
'arrow-rotate-backward': () => (h("path", { fill: "currentColor", d: "M8 1.67c-1.63 0-3.2.63-4.38 1.75l-.91-.91a.6.6 0 0 0-.85-.01h-.01a.62.62 0 0 0-.18.44v3.43c-.01.34.25.62.59.63H5.7c.34 0 .62-.28.62-.62 0-.16-.07-.31-.18-.43L5.07 4.87a4.276 4.276 0 0 1 6.06.21 4.276 4.276 0 0 1-.21 6.06 4.302 4.302 0 0 1-5.76.09.296.296 0 0 0-.41 0l-1 1a.29.29 0 0 0 0 .42 6.324 6.324 0 0 0 8.94-.37 6.316 6.316 0 0 0-.38-8.94 6.365 6.365 0 0 0-4.33-1.67Z" })),
|
|
384
459
|
'arrow-up': () => (h("path", { fill: "currentColor", d: "M3.06,5.82H5.81a.31.31,0,0,1,.32.28h0V15a.31.31,0,0,0,.33.29H9.67A.3.3,0,0,0,10,15h0V6.11a.3.3,0,0,1,.31-.29h2.75a.3.3,0,0,0,.23-.51L8.23.73a.36.36,0,0,0-.46,0l-5,4.58a.3.3,0,0,0,0,.43C2.82,5.83,2.92,5.82,3.06,5.82Z" })),
|
|
460
|
+
'arrow-up-right': () => (h("path", { fill: "currentColor", d: "m3.47 14.02 8.75-8.75v3.78c0 .58.47 1.05 1.06 1.05s1.05-.47 1.05-1.05V2.72c0-.58-.47-1.05-1.05-1.05H6.94a1.05 1.05 0 1 0 0 2.1h3.78l-8.74 8.76c-.41.41-.41 1.08 0 1.49s1.08.41 1.49 0Z" })),
|
|
385
461
|
'arrow-up-right-square': () => (h("path", { fill: "currentColor", d: "M14.33 3v10A1.34 1.34 0 0 1 13 14.33H3A1.34 1.34 0 0 1 1.67 13V3A1.34 1.34 0 0 1 3 1.67h10A1.34 1.34 0 0 1 14.33 3Zm-2.48.46H8.68a.67.67 0 0 0-.68.7.63.63 0 0 0 .2.47l.91.91-5.53 5.53a.33.33 0 0 0 0 .48l.87.87a.33.33 0 0 0 .48 0l5.53-5.52.91.9a.69.69 0 0 0 1 0 .71.71 0 0 0 .19-.48V4.15a.67.67 0 0 0-.67-.67Z" })),
|
|
462
|
+
'arrows-compare': () => h("path", { fill: "currentColor", d: "M5.81 9.47H.67v1.47h5.14v2.2l2.93-2.93-2.93-2.93v2.2Zm4.39-.73v-2.2h5.14V5.07H10.2v-2.2L7.27 5.8l2.93 2.93Z" }),
|
|
463
|
+
'arrows-right-down': () => (h("path", { fill: "currentColor", d: "M10.68 10.78c.16.17.16.45-.02.61l-2.8 2.78a.43.43 0 0 1-.31.12.42.42 0 0 1-.31-.12l-2.8-2.78a.44.44 0 0 1 0-.62.44.44 0 0 1 .62 0l2.06 2.05V5.38H2.11c-.24 0-.44-.19-.44-.44 0-.24.2-.44.44-.44H8v8.32l2.06-2.05a.44.44 0 0 1 .62 0Zm3.53-6.14-2.78-2.8a.438.438 0 0 0-.61-.02.44.44 0 0 0 0 .62l2.05 2.06H8.89v.88h3.98l-2.05 2.06a.44.44 0 0 0 0 .62c.17.17.45.17.62 0l2.78-2.8s.07-.09.09-.14c.02-.05.03-.11.03-.17 0-.11-.04-.23-.12-.31Z" })),
|
|
386
464
|
'arrows-right-left': () => (h("path", { fill: "currentColor", d: "M.73,5.65V5.23a.64.64,0,0,1,.64-.64H12V3.31a.64.64,0,0,1,.64-.64.63.63,0,0,1,.45.18L15.19,5a.63.63,0,0,1,0,.9L13.05,8A.65.65,0,0,1,12,7.57V6.29H1.37a.64.64,0,0,1-.64-.64Zm14,4.06H4.09V8.43A.64.64,0,0,0,3,8L.87,10.11a.63.63,0,0,0,0,.9L3,13.15a.64.64,0,0,0,.91,0,.61.61,0,0,0,.18-.45V11.41H14.73a.63.63,0,0,0,.64-.64h0v-.42a.63.63,0,0,0-.64-.64Z" })),
|
|
387
465
|
'arrows-rotate': () => (h("path", { fill: "currentColor", d: "M14.3 6.37V2.94c0-.16-.06-.32-.18-.43a.6.6 0 0 0-.85 0l-.91.91a6.354 6.354 0 0 0-3.31-1.65 6.365 6.365 0 0 0-7.33 5.22h2.14c.16-.72.5-1.38 1-1.92v-.02a4.281 4.281 0 0 1 6.05-.18L9.84 6c-.1.1-.16.24-.18.38 0 .34.28.62.62.62h3.44c.33-.02.59-.3.58-.63ZM1.71 9.63v3.43c0 .16.06.32.18.43a.6.6 0 0 0 .85 0l.91-.91c.92.88 2.09 1.46 3.35 1.66 3.47.57 6.74-1.77 7.31-5.24h-2.14c-.17.74-.54 1.42-1.06 1.97a4.254 4.254 0 0 1-6.02.16l1.07-1.08c.11-.11.17-.27.17-.42A.63.63 0 0 0 5.72 9H2.28c-.33.03-.58.3-.57.63Z" })),
|
|
388
466
|
'arrows-rotate-backward': () => (h("path", { fill: "currentColor", d: "M2.3,7h3.4c0.3,0,0.6-0.3,0.6-0.6c0-0.1-0.1-0.3-0.2-0.4L5.1,4.9c1.7-1.6,4.4-1.5,6,0.2c0,0,0,0,0,0 c0.5,0.5,0.8,1.2,1,1.9h2.1C13.7,3.5,10.4,1.2,7,1.8C5.7,2,4.6,2.6,3.6,3.4L2.7,2.5c-0.2-0.2-0.6-0.2-0.8,0c0,0,0,0,0,0l0,0 C1.8,2.6,1.7,2.8,1.7,2.9v3.4C1.7,6.7,1.9,7,2.3,7z M13.7,9h-3.4C9.9,9,9.7,9.3,9.7,9.6c0,0.2,0.1,0.3,0.2,0.4l1.1,1.1 c-1.7,1.6-4.4,1.5-6-0.2C4.4,10.4,4,9.7,3.8,9H1.7c0.6,3.5,3.9,5.8,7.3,5.2c1.3-0.2,2.4-0.8,3.3-1.7l0.9,0.9c0.2,0.2,0.6,0.2,0.8,0 c0,0,0,0,0,0l0,0c0.1-0.1,0.2-0.3,0.2-0.4V9.6C14.3,9.3,14.1,9,13.7,9z" })),
|
|
@@ -406,11 +484,15 @@ const icons = {
|
|
|
406
484
|
'conversation': () => (h("path", { fill: "currentColor", d: "M11.22,6.48c0-2.11-2.36-3.81-5.28-3.81S.67,4.37.67,6.48a3.15,3.15,0,0,0,1,2.19A5.17,5.17,0,0,1,.72,10a.2.2,0,0,0,0,.21.23.23,0,0,0,.19.12,4.79,4.79,0,0,0,2.25-.6,6.84,6.84,0,0,0,2.82.6C8.86,10.29,11.22,8.58,11.22,6.48Zm3.1,5.23a3.08,3.08,0,0,0,1-2.19C15.28,7.93,14,6.57,12,6a3.84,3.84,0,0,1,0,.48C12,9,9.3,11.05,6,11.05a7.16,7.16,0,0,1-.8-.05A5.6,5.6,0,0,0,10,13.33a6.7,6.7,0,0,0,2.82-.59,4.66,4.66,0,0,0,2.25.59.21.21,0,0,0,.19-.11.2.2,0,0,0,0-.21,5.15,5.15,0,0,1-.91-1.3Z" })),
|
|
407
485
|
'cog': () => (h("path", { fill: "currentColor", d: "M14.82 9.76 13.56 9a5.54 5.54 0 0 0 0-2.07l1.26-.72a.36.36 0 0 0 .18-.38A7.5 7.5 0 0 0 13.37 3a.35.35 0 0 0-.44 0l-1.26.72a5.51 5.51 0 0 0-1.79-1V1.21a.34.34 0 0 0-.27-.34 7.29 7.29 0 0 0-3.22 0 .34.34 0 0 0-.28.34v1.45a5.83 5.83 0 0 0-1.79 1L3.06 3a.35.35 0 0 0-.43 0A7.24 7.24 0 0 0 1 5.83a.34.34 0 0 0 .16.41L2.44 7a5.49 5.49 0 0 0 0 2l-1.26.73a.35.35 0 0 0-.16.41A7.24 7.24 0 0 0 2.63 13a.35.35 0 0 0 .43.07l1.26-.73a5.56 5.56 0 0 0 1.79 1v1.45a.35.35 0 0 0 .28.34 7.29 7.29 0 0 0 3.22 0 .35.35 0 0 0 .28-.34v-1.45a6 6 0 0 0 1.79-1l1.26.73a.35.35 0 0 0 .43-.07A7.39 7.39 0 0 0 15 10.17a.37.37 0 0 0-.17-.41Zm-6.82.6A2.36 2.36 0 1 1 10.35 8 2.36 2.36 0 0 1 8 10.36Z" })),
|
|
408
486
|
'comment': () => (h("path", { fill: "currentColor", d: "M8 1.67c-3.37-.12-6.21 2.51-6.33 5.88 0 1.36.5 2.68 1.41 3.69-.26 1-.72 1.94-1.36 2.76-.04.08-.04.17 0 .25.03.08.1.13.18.13 1.3-.03 2.54-.55 3.48-1.45.83.34 1.72.51 2.62.5 3.37.12 6.21-2.51 6.33-5.88-.12-3.37-2.96-6-6.33-5.88Zm2.53 8.43c0 .14-.11.25-.25.25H5.73c-.14 0-.25-.1-.26-.24V9.2c0-.17.13-.3.3-.31h4.5c.14 0 .26.12.26.26v.95Zm.92-3.29c0 .17-.13.3-.3.3h-6.3c-.17 0-.3-.13-.3-.3V6c0-.16.12-.29.28-.3H11.15c.16 0 .29.12.3.28V6.81Z" })),
|
|
487
|
+
'comment-sms': () => (h("path", { fill: "currentColor", d: "M8 2.67c-3.37 0-6.1 2.21-6.1 4.95.02 1.18.51 2.3 1.36 3.11-.26.85-.71 1.62-1.3 2.28a.2.2 0 0 0-.04.21c.03.07.1.11.17.11 1.22-.02 2.4-.45 3.34-1.22.82.31 1.68.46 2.56.46 3.37 0 6.1-2.22 6.1-4.95S11.37 2.67 8 2.67M4.95 8.39a.76.76 0 1 1 .76-.76c0 .42-.34.76-.76.76m3.05 0a.76.76 0 1 1 .76-.76c0 .42-.34.76-.76.76m3.05 0a.76.76 0 1 1-.02-1.52c.42 0 .77.33.77.75v.01c0 .42-.34.76-.76.76" })),
|
|
409
488
|
'credit-card': () => (h("path", { fill: "currentColor", d: "M14 2.67H2A1.33 1.33 0 0 0 .67 4v8A1.32 1.32 0 0 0 2 13.33h12A1.32 1.32 0 0 0 15.33 12V4A1.32 1.32 0 0 0 14 2.67M14 12H2V8h12Zm0-6.67H2V4h12Z" })),
|
|
410
489
|
'cross': () => (h("path", { fill: "currentColor", d: "M14.26 12.74 9.52 8l4.7-4.7a.29.29 0 0 0 0-.41l-1.1-1.1a.29.29 0 0 0-.41 0L8 6.48 3.26 1.74a.24.24 0 0 0-.34 0L1.74 2.91a.24.24 0 0 0 0 .34L6.48 8l-4.7 4.7a.29.29 0 0 0 0 .41l1.1 1.1a.29.29 0 0 0 .41 0L8 9.52l4.74 4.74a.24.24 0 0 0 .34 0l1.17-1.17a.24.24 0 0 0 0-.34Z" })),
|
|
411
490
|
'cross-circle': () => (h("path", { fill: "currentColor", d: "M8.06.67H8A7.33 7.33 0 0 0 .68 8v.1a7.42 7.42 0 0 0 7.23 7.23A7.33 7.33 0 1 0 8.06.67Zm3.6 9.57a.28.28 0 0 1 0 .4l-.19.2-.61.61-.2.19a.27.27 0 0 1-.39 0L8 9.41l-2.23 2.24a.27.27 0 0 1-.39 0l-.2-.2-.6-.6-.19-.2a.28.28 0 0 1 0-.4L6.6 8 4.36 5.76a.28.28 0 0 1 0-.4l1-1a.28.28 0 0 1 .4 0L8 6.59l2.24-2.24a.28.28 0 0 1 .4 0l.2.2.6.6.2.2a.28.28 0 0 1 0 .4L9.42 8Z" })),
|
|
491
|
+
'dashboard': () => h("path", { fill: "currentColor", d: "M1.67 8.7H7.3V1.67H1.67v7.04Zm0 5.63H7.3v-4.22H1.67v4.22Zm7.04 0h5.63V7.3H8.71v7.04Zm0-12.67v4.23h5.63V1.67H8.71Z" }),
|
|
492
|
+
'dashboard-outline': () => (h("path", { fill: "currentColor", d: "M13.33 2.67v2.22H9.7V2.67h3.63m-7.04 0V7.7H2.67V2.67H6.3m7.04 5.63v5.04H9.71V8.3h3.63M6.3 11.11v2.22H2.67v-2.22H6.3m8.03-9.44H8.7v4.22h5.63V1.67Zm-7.04 0H1.67v7.04H7.3V1.67Zm7.04 5.63H8.7v7.04h5.63V7.3Zm-7.04 2.81H1.67v4.22H7.3v-4.22Z" })),
|
|
412
493
|
'download': () => (h("path", { fill: "currentColor", d: "M6.4 2v4.1c0 .2-.1.3-.3.3H4c-.2 0-.3.1-.3.3 0 .1 0 .2.1.2l4 4c.1.1.3.1.4 0l4-4c.1-.1.1-.3 0-.4-.1-.1-.1-.1-.2-.1H9.9c-.2 0-.3-.1-.3-.3V2c0-.2-.1-.3-.3-.3H6.7c-.1 0-.3.1-.3.3zm7.9 11v1c0 .2-.1.3-.3.3H2c-.2 0-.3-.1-.3-.3v-1c0-.2.1-.3.3-.3h12c.2 0 .3.1.3.3z" })),
|
|
413
494
|
'euro': () => (h("path", { fill: "currentColor", d: "M13 13.14a.4.4 0 0 0-.47-.31A7.79 7.79 0 0 1 11 13a4.31 4.31 0 0 1-4-2.79h3.8a.41.41 0 0 0 .39-.31l.19-.9a.39.39 0 0 0-.3-.47H6.51a7.07 7.07 0 0 1 0-1.38h4.89a.4.4 0 0 0 .39-.31l.22-1a.4.4 0 0 0-.3-.47H7a4.2 4.2 0 0 1 3.92-2.45 6.57 6.57 0 0 1 1.26.14.41.41 0 0 0 .47-.29l.4-1.45a.4.4 0 0 0-.28-.48A9.43 9.43 0 0 0 11 .67a7.12 7.12 0 0 0-6.83 4.7h-1.1a.4.4 0 0 0-.4.39v1a.4.4 0 0 0 .4.39h.72a9.08 9.08 0 0 0 0 1.38h-.72a.39.39 0 0 0-.4.39v.93a.4.4 0 0 0 .4.39h1A7 7 0 0 0 11 15.3a8.7 8.7 0 0 0 2-.25.39.39 0 0 0 .3-.46l-.3-1.45Z" })),
|
|
495
|
+
'euro-circle': () => (h("path", { fill: "currentColor", d: "M8 .67C3.95.67.67 3.95.67 8S3.95 15.33 8 15.33s7.33-3.28 7.33-7.33S12.05.67 8 .67Zm2.27 11.4c-.38.09-.76.14-1.15.14a4.038 4.038 0 0 1-3.99-2.92h-.58c-.13 0-.23-.1-.23-.22v-.54c0-.12.11-.22.23-.22h.41a5.34 5.34 0 0 1 0-.8h-.41c-.13 0-.23-.1-.23-.22v-.58c0-.13.11-.22.23-.22h.63c.6-1.65 2.18-2.74 3.94-2.71.34 0 .68.03 1.02.1.12.03.19.16.16.28l-.23.84c-.03.12-.15.19-.27.17-.24-.05-.48-.08-.73-.08A2.42 2.42 0 0 0 6.81 6.5h2.71c.12.03.2.15.17.27l-.13.58c-.02.1-.12.18-.22.18H6.52c-.03.26-.03.53 0 .8h2.63c.12.03.2.15.17.27l-.11.52c-.03.1-.12.18-.22.18H6.8c.36.96 1.28 1.6 2.31 1.61.3 0 .59-.04.88-.1.12-.02.24.05.27.18l.17.84c.02.12-.05.24-.17.27v-.03Z" })),
|
|
414
496
|
'exclamation-circle': () => (h("path", { fill: "currentColor", d: "M8 15.33c4.05 0 7.33-3.28 7.33-7.33S12.05.67 8 .67.67 3.95.67 8 3.95 15.33 8 15.33Zm.95-3.3c0 .15-.12.27-.28.27h-1.4c-.15 0-.28-.12-.28-.27v-1.31c0-.15.12-.28.28-.28h1.4c.15 0 .28.12.28.28v1.31ZM7 3.96c0-.14.11-.25.25-.25H8.7c.14 0 .25.11.25.25v4.8c0 .14-.11.25-.25.25H7.25c-.14 0-.25-.11-.25-.25V3.95Z" })),
|
|
415
497
|
'exclamation-triangle': () => (h("path", { fill: "currentColor", d: "m14.3 13.88-6-12a.32.32 0 0 0-.41-.15.31.31 0 0 0-.15.15l-6 12a.31.31 0 0 0 .14.42.32.32 0 0 0 .14 0H14a.31.31 0 0 0 .33-.29.23.23 0 0 0-.03-.13ZM7 6a.28.28 0 0 1 .28-.28h1.46A.28.28 0 0 1 9 6v4a.29.29 0 0 1-.28.29H7.3A.29.29 0 0 1 7 10Zm2 7a.31.31 0 0 1-.31.32H7.34A.32.32 0 0 1 7 13v-1.37a.31.31 0 0 1 .32-.31h1.39a.31.31 0 0 1 .31.31Z" })),
|
|
416
498
|
'eye': () => [
|
|
@@ -443,6 +525,7 @@ const icons = {
|
|
|
443
525
|
'folder': () => (h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2C1.27 2.67.68 3.27.67 4v8c0 .73.6 1.32 1.33 1.33h12c.73 0 1.32-.6 1.33-1.33V5.78c0-.73-.6-1.33-1.33-1.34Z" })),
|
|
444
526
|
'folder-lines': () => (h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2A1.35 1.35 0 0 0 .67 4v8A1.35 1.35 0 0 0 2 13.33h12A1.35 1.35 0 0 0 15.33 12V5.78A1.36 1.36 0 0 0 14 4.44Zm-4.57 6.38a.2.2 0 0 1-.2.2H3.41a.2.2 0 0 1-.2-.2v-.9a.2.2 0 0 1 .2-.2h5.82a.2.2 0 0 1 .2.2Zm3.36-2.95a.2.2 0 0 1-.2.2H3.42a.2.2 0 0 1-.2-.2V7a.2.2 0 0 1 .2-.2h9.17a.2.2 0 0 1 .2.2Z" })),
|
|
445
527
|
'folder-link': () => (h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2C1.27 2.67.68 3.27.67 4v8c0 .73.6 1.32 1.33 1.33h12c.73 0 1.32-.6 1.33-1.33V5.78c0-.73-.6-1.33-1.33-1.34Zm-6.82 6.88H5.65c-1.34 0-2.42-1.08-2.42-2.42 0-1.34 1.08-2.42 2.42-2.42h.84c.14 0 .25.11.25.25 0 .06-.02.13-.06.17-.2.21-.36.45-.49.71-.04.07-.11.13-.19.14h-.33c-.62-.15-1.24.22-1.39.84-.15.62.22 1.24.84 1.39.15.04.31.04.47.02h1.58c.62 0 1.12-.48 1.15-1.1v-.22c-.02-.08 0-.16.06-.22.12-.13.29-.2.47-.2h.45c.12 0 .23.09.25.21.02.14.02.29 0 .43 0 1.32-1.05 2.39-2.37 2.42Zm3.17 0h-.84c-.06 0-.13-.02-.17-.07-.1-.1-.1-.25 0-.35.2-.21.36-.45.49-.71.02-.09.08-.16.17-.19h.36c.63.04 1.18-.43 1.23-1.07.04-.63-.43-1.18-1.07-1.23H8.83c-.64 0-1.15.51-1.15 1.15v.25c.02.08 0 .16-.06.22-.12.13-.29.21-.47.21H6.7c-.13 0-.24-.09-.26-.22-.01-.14-.01-.27 0-.41a2.41 2.41 0 0 1 2.38-2.43h1.52c1.34 0 2.42 1.07 2.43 2.41 0 1.34-1.09 2.42-2.42 2.43Z" })),
|
|
528
|
+
'folder-outline': () => (h("path", { fill: "currentColor", d: "m6.22 3.67 1.55 1.49.29.28h5.93c.19 0 .34.16.34.34v6.21c0 .18-.15.34-.33.34H2.01c-.18 0-.34-.15-.34-.33V4.01c0-.18.15-.34.33-.34h4.22m.4-1H2C1.27 2.67.68 3.27.67 4v8c0 .73.6 1.32 1.33 1.33h12c.73 0 1.32-.6 1.33-1.33V5.78c0-.73-.6-1.33-1.33-1.34H8.46L6.62 2.67Z" })),
|
|
446
529
|
'folder-star': () => (h("path", { fill: "currentColor", d: "M14 4.44H8.46L6.62 2.67H2A1.35 1.35 0 0 0 .67 4v8A1.35 1.35 0 0 0 2 13.33h12A1.35 1.35 0 0 0 15.33 12V5.78A1.36 1.36 0 0 0 14 4.44Zm-.2 3.89L12 9.66l.69 2a.22.22 0 0 1-.08.27.26.26 0 0 1-.13.06.39.39 0 0 1-.15-.06l-1.77-1.26L8.75 12a.34.34 0 0 1-.15 0 .31.31 0 0 1-.13 0 .23.23 0 0 1-.08-.27l.69-2-1.81-1.35a.23.23 0 0 1-.1-.17.24.24 0 0 1 .24-.24h2.21l.67-2a.26.26 0 0 1 .15-.14.24.24 0 0 1 .31.14l.67 2h2.2a.26.26 0 0 1 .26.24.3.3 0 0 1-.08.12Z" })),
|
|
447
530
|
'graduation-cap': () => (h("path", { fill: "currentColor", d: "M14.93 5.14 8.54 2.76c-.35-.13-.73-.13-1.08 0L1.07 5.14c-.31.13-.48.47-.39.8.04.22.19.39.39.47l1.12.42c-.26.38-.4.84-.41 1.3-.35.28-.47.75-.3 1.16.06.12.14.23.24.31l-.59 3.19c-.06.22.07.45.28.53h1.37c.22-.02.38-.22.36-.44v-.1L2.55 9.6c.32-.31.4-.79.2-1.18a.814.814 0 0 0-.24-.28c0-.38.18-.75.47-1l4.48 1.65c.35.13.73.13 1.08 0l6.39-2.38c.31-.13.48-.47.39-.8a.625.625 0 0 0-.39-.47Zm-6.18 4.5c-.48.18-1.02.18-1.5 0L3.93 8.4l-.33 3.15c0 1 2 1.78 4.4 1.78s4.4-.79 4.4-1.78l-.33-3.15-3.32 1.24Z" })),
|
|
448
531
|
'history': () => [
|
|
@@ -474,7 +557,10 @@ const icons = {
|
|
|
474
557
|
'paper-plane': () => (h("path", { fill: "currentColor", d: "M14 1.69 1.84 7a.28.28 0 0 0-.15.36.29.29 0 0 0 .16.15l3.27 1.82a.57.57 0 0 0 .61-.06l6.45-5.57c.05 0 .15-.1.19-.06s0 .14-.06.18l-5.59 6.29a.52.52 0 0 0 0 .63l2.09 3.44a.28.28 0 0 0 .37.12.3.3 0 0 0 .13-.12l5-12.11a.3.3 0 0 0-.14-.37.28.28 0 0 0-.17-.01Z" })),
|
|
475
558
|
'paper-plane-slash': () => (h("path", { fill: "currentColor", d: "M2.67,1.69,14.26,13.28l-1,1-2.79-2.8-1.1,2.67a.3.3,0,0,1-.13.12.28.28,0,0,1-.37-.12L6.75,10.74a.52.52,0,0,1,0-.63L7.82,8.9l-.76-.76L5.76,9.27a.57.57,0,0,1-.61.06L1.88,7.51a.29.29,0,0,1-.16-.15A.28.28,0,0,1,1.87,7L4.68,5.76l-3-3Zm11.53,0a.28.28,0,0,0-.22,0L7.53,4.51,9.26,6.24l3-2.54s.15-.1.19-.06,0,.14-.06.18L9.75,6.73l1.88,1.88,2.71-6.54A.3.3,0,0,0,14.2,1.7Z" })),
|
|
476
559
|
'pen': () => (h("path", { fill: "currentColor", d: "M1.67,11.69v2.64h2.64l7.78-7.78-2.64-2.64L1.67,11.69ZM14.13,4.51c.27-.28,.27-.72,0-1h0l-1.65-1.64c-.28-.27-.72-.27-1,0h0l-1.28,1.29,2.64,2.64,1.29-1.29Z" })),
|
|
560
|
+
'pen-circle': () => (h("path", { fill: "currentColor", d: "M8 .44C3.82.44.44 3.82.44 8S3.83 15.56 8 15.56s7.56-3.39 7.56-7.56C15.56 3.82 12.18.44 8 .44M5.47 12.19H3.62v-1.85l5.46-5.45 1.85 1.86-5.45 5.45Zm6.88-6.89-.9.9-1.86-1.85.9-.9c.19-.19.51-.19.7 0l1.16 1.15c.19.19.19.51 0 .7" })),
|
|
477
561
|
'pen-fancy': () => (h("path", { fill: "currentColor", d: "M3.63,8.65c-.24,.07-.43,.26-.5,.5l-1.46,4.37,.11,.12,2.3-2.3c0-.06,0-.13,0-.19,0-.44,.35-.8,.79-.81,.44,0,.8,.35,.81,.79,0,.44-.35,.8-.79,.81,0,0-.01,0-.02,0h-.19l-2.3,2.3,.12,.11,4.37-1.46c.24-.07,.43-.26,.5-.5l.82-2.08-2.49-2.48-2.07,.82ZM10.8,2.35L6.27,7.28l2.42,2.42,4.94-4.52c2.1-1.86-.99-4.92-2.83-2.83Z" })),
|
|
562
|
+
'pen-fancy-outline': () => (h("path", { fill: "currentColor", d: "M12.24 1.67c-.49 0-1 .21-1.44.7L6.27 7.3l2.42 2.42 4.94-4.52c1.6-1.42.19-3.53-1.39-3.53ZM8.72 8.34 7.66 7.28l3.9-4.24c.22-.24.44-.36.69-.36.41 0 .87.34 1.03.78.14.37.04.7-.32 1.02L8.73 8.36ZM5.7 7.86l-2.08.82c-.24.08-.42.26-.5.5l-1.46 4.37.12.12.56.56.12.12 4.37-1.46c.24-.08.42-.26.5-.5l.81-2.08L5.7 7.87Zm-2.57 4.46L4 9.72c.03-.08.09-.15.17-.18l1.29-.51 1.52 1.52-.5 1.29c-.03.08-.1.15-.19.18l-2.6.87.95-.95c.06.02.12.04.19.04.44 0 .79-.35.79-.79s-.35-.79-.79-.79-.79.35-.79.79c0 .07.02.13.04.19l-.95.95Z" })),
|
|
563
|
+
'phone': () => (h("path", { fill: "currentColor", d: "M13.97 10.62 11.2 9.43a.6.6 0 0 0-.69.17l-1.23 1.5A9.137 9.137 0 0 1 4.9 6.72l1.5-1.23c.21-.17.28-.45.17-.69L5.38 2.03a.589.589 0 0 0-.68-.34l-2.57.59a.59.59 0 0 0-.46.58c0 6.34 5.14 11.48 11.48 11.48.28 0 .52-.19.58-.46l.59-2.57a.595.595 0 0 0-.35-.68Z" })),
|
|
478
564
|
'picture': () => (h("path", { fill: "currentColor", d: "M14.33 12.93V3.07a1.4 1.4 0 0 0-1.4-1.4H3.07a1.4 1.4 0 0 0-1.4 1.4v9.86a1.4 1.4 0 0 0 1.4 1.4h9.86a1.4 1.4 0 0 0 1.4-1.4ZM5.54 9.06l1.76 2.11L9.76 8l3.17 4.22H3.07Z" })),
|
|
479
565
|
'play-circle': () => (h("path", { fill: "currentColor", d: "M8 .67A7.33 7.33 0 1 0 15.33 8 7.33 7.33 0 0 0 8 .67Zm3.42 8-5.2 3a.72.72 0 0 1-1-.28.73.73 0 0 1-.09-.35V4.92a.71.71 0 0 1 .71-.71 1.06 1.06 0 0 1 .35.09l5.2 3.17a.71.71 0 0 1 .27 1 .64.64 0 0 1-.24.24Z" })),
|
|
480
566
|
'plus': () => (h("path", { fill: "currentColor", d: "M9.41 6.59V1.92a.24.24 0 0 0-.24-.25H6.84a.24.24 0 0 0-.25.24v4.68H1.92a.24.24 0 0 0-.25.24v2.33a.24.24 0 0 0 .24.25h4.68v4.67a.24.24 0 0 0 .24.25h2.33a.24.24 0 0 0 .25-.24V9.41h4.67a.24.24 0 0 0 .25-.24V6.84a.24.24 0 0 0-.24-.25H9.41Z" })),
|
|
@@ -503,6 +589,7 @@ const icons = {
|
|
|
503
589
|
'user-circle': () => (h("path", { fill: "currentColor", d: "M8 .62C3.95.61.66 3.9.65 7.95c0 4.05 3.28 7.34 7.33 7.35 4.04 0 7.33-3.26 7.35-7.3.02-4.05-3.25-7.36-7.3-7.38H8Zm0 .75c3.64 0 6.59 2.96 6.58 6.6V8c0 1.35-.41 2.66-1.19 3.76a2.713 2.713 0 0 0-2.66-2.37H9.54c-.98.46-2.1.46-3.08 0H5.28c-1.36 0-2.5 1.02-2.67 2.37A6.483 6.483 0 0 1 1.42 8a6.59 6.59 0 0 1 6.55-6.63H8ZM5 5.63c0-1.68 1.37-3.05 3.05-3.05 1.68 0 3.05 1.37 3.05 3.05 0 1.68-1.37 3.05-3.05 3.05H8c-1.66-.03-3-1.39-3-3.05Z" })),
|
|
504
590
|
'user-group': () => (h("path", { fill: "currentColor", d: "M13.15 4.12c-.81-.01-1.47.65-1.48 1.46 0 .82.65 1.47 1.46 1.48s1.47-.65 1.48-1.46-.65-1.47-1.46-1.48Zm-10.04.01a1.47 1.47 0 0 0-1.58 1.59c.06.71.62 1.28 1.34 1.34.81.07 1.52-.53 1.59-1.34.06-.81-.54-1.52-1.35-1.59Zm7.36.39c-.22-.84-.87-1.51-1.71-1.75-1.36-.41-2.8.36-3.22 1.72-.18.61-.13 1.27.14 1.85.41.9 1.33 1.48 2.32 1.45 1.41.01 2.56-1.14 2.57-2.55 0-.24-.03-.49-.1-.72Zm-.71 4h-.19c-.99.49-2.14.49-3.13 0h-.19c-1.46 0-2.64 1.18-2.64 2.64v2.69c1.23.93 2.74 1.47 4.39 1.47s3.17-.55 4.4-1.48v-2.68c0-1.46-1.18-2.64-2.64-2.64Zm5.52.25a7.282 7.282 0 0 1-1.65 3.91c-.08.1-.16.19-.25.28-.08.09-.17.18-.25.27v-.55h.03v-.72s.01-.07 0-.1v-.66c.01-1.25-.66-2.4-1.76-3 .27-.26.63-.41 1-.41h1.51c.63.01 1.17.41 1.37.98ZM2.86 11.16v1.52h.01v.55l-.28-.31c-.08-.08-.15-.16-.22-.24A7.238 7.238 0 0 1 .74 8.86c.16-.62.72-1.07 1.4-1.07h1.47c.37-.01.73.12 1.01.37-1.1.6-1.77 1.75-1.76 3Z" })),
|
|
505
591
|
'user-plus': () => (h("path", { fill: "currentColor", d: "M14,3.33H12.65V2a.36.36,0,0,0-.35-.33h-.65A.36.36,0,0,0,11.3,2V3.33H10a.34.34,0,0,0-.33.34v.66a.34.34,0,0,0,.33.34H11.3V6a.37.37,0,0,0,.35.33h.65A.37.37,0,0,0,12.65,6V4.67H14a.34.34,0,0,0,.32-.34V3.67A.34.34,0,0,0,14,3.33ZM9.28,9.77h-.2a5.19,5.19,0,0,1-3.91,0H5A3,3,0,0,0,1.7,12.46h0v.72A1.27,1.27,0,0,0,3,14.33h8.25a1.26,1.26,0,0,0,1.36-1.14v-.68A3,3,0,0,0,9.37,9.76H9.28ZM7.13,3.7A2.64,2.64,0,1,1,4.5,6.34h0A2.64,2.64,0,0,1,7.13,3.7Z" })),
|
|
592
|
+
'user-question-outline': () => (h("path", { fill: "currentColor", d: "M5.23 11.14c.86-.66 1.01-1.9.35-2.75s-1.9-1.01-2.75-.35a1.96 1.96 0 0 0 0 3.1c-.72.42-1.16 1.2-1.16 2.03v.8c0 .2.17.37.37.37h3.98c.2 0 .37-.17.37-.37v-.8c0-.83-.44-1.61-1.16-2.03ZM2.81 9.59c0-.67.55-1.22 1.22-1.22s1.22.55 1.22 1.22-.55 1.22-1.22 1.22-1.22-.55-1.22-1.22Zm2.83 4H2.41v-.42c0-.89.72-1.62 1.62-1.62s1.62.72 1.62 1.62v.42h-.01Zm7.13-11.93H8c-.86 0-1.56.7-1.56 1.56v7.16c0 .21.17.37.37.37.08 0 .16-.03.22-.07l1.49-1.12h4.25c.86 0 1.56-.7 1.56-1.56V3.22c0-.86-.7-1.56-1.56-1.56Zm.82 6.33c0 .45-.37.82-.82.82H8.4a.41.41 0 0 0-.22.07l-1 .75V3.22c0-.45.37-.82.82-.82h4.77c.45 0 .82.37.82.82v4.77Zm-2.8-.42c0 .23-.18.41-.41.41s-.41-.18-.41-.41.18-.41.41-.41c.23 0 .41.18.41.41Zm-.41-4.34c-.83 0-1.5.67-1.5 1.5 0 .23.18.41.41.41s.41-.18.41-.41c0-.38.31-.68.69-.68.38 0 .68.31.68.69 0 .38-.31.68-.68.68-.23 0-.41.18-.41.41v.44c0 .23.18.41.41.41s.41-.18.41-.41v-.09c.8-.23 1.26-1.06 1.04-1.85-.18-.65-.77-1.09-1.44-1.09Z" })),
|
|
506
593
|
'users': () => (h("path", { fill: "currentColor", d: "M12,8.76h-.2a5.24,5.24,0,0,1-3.93,0H7.61a3.05,3.05,0,0,0-3.3,2.75v.69a1.28,1.28,0,0,0,1.38,1.14H14a1.27,1.27,0,0,0,1.37-1.14v-.69A3.07,3.07,0,0,0,12,8.75Zm-6.4-.32A2,2,0,0,0,4.31,8H2.48A1.69,1.69,0,0,0,.65,9.53v.76a.85.85,0,0,0,.91.76H3.45A3.58,3.58,0,0,1,5.61,8.44ZM9.81,2.66A2.65,2.65,0,1,1,7.16,5.31h0A2.65,2.65,0,0,1,9.81,2.66ZM3.31,4.18A1.51,1.51,0,1,1,1.8,5.69,1.51,1.51,0,0,1,3.31,4.18Z" })),
|
|
507
594
|
'wallet': () => (h("path", { fill: "currentColor", d: "M13.88 5H3a.43.43 0 0 1-.46-.38.43.43 0 0 1 .46-.43h11a.43.43 0 0 0 .46-.38A1.28 1.28 0 0 0 13 2.67H2.5A1.7 1.7 0 0 0 .67 4.19v7.62a1.7 1.7 0 0 0 1.83 1.52h11.38a1.32 1.32 0 0 0 1.45-1.14V6.1A1.33 1.33 0 0 0 13.88 5Zm-1.21 5.29a1.1 1.1 0 1 1 1.1-1.1 1.1 1.1 0 0 1-1.1 1.05Z" })),
|
|
508
595
|
};
|
|
@@ -608,6 +695,49 @@ const MgIcon = class {
|
|
|
608
695
|
};
|
|
609
696
|
MgIcon.style = mgIconCss;
|
|
610
697
|
|
|
698
|
+
const mgIllustratedMessageCss = ".mg-illustrated-message{margin:auto;padding:0 1.5rem;max-width:47.5rem;box-sizing:border-box;text-align:center}.mg-illustrated-message__illustration{max-height:33.5rem}.mg-illustrated-message__illustration ::slotted([slot=illustration]){width:auto;height:auto;max-width:100%;max-height:33.5rem}.mg-illustrated-message__illustration.mg-illustrated-message__illustration--small{max-height:6rem}.mg-illustrated-message__illustration.mg-illustrated-message__illustration--small ::slotted([slot=illustration]){max-height:6rem}.mg-illustrated-message__title{margin:3rem 0 0}.mg-illustrated-message__title ::slotted([slot=title]){margin:0;font-size:2rem !important;font-family:var(--font-family) !important;font-weight:400}.mg-illustrated-message__details ::slotted([slot=details]){margin:2rem 0 0}";
|
|
699
|
+
|
|
700
|
+
const MgIllustratedMessage = class {
|
|
701
|
+
constructor(hostRef) {
|
|
702
|
+
registerInstance(this, hostRef);
|
|
703
|
+
/**
|
|
704
|
+
* Define illustration size
|
|
705
|
+
*/
|
|
706
|
+
this.size = 'regular';
|
|
707
|
+
}
|
|
708
|
+
/*************
|
|
709
|
+
* Lifecycle *
|
|
710
|
+
*************/
|
|
711
|
+
/**
|
|
712
|
+
* Check if component props are well configured on init
|
|
713
|
+
*
|
|
714
|
+
* @returns {void}
|
|
715
|
+
*/
|
|
716
|
+
componentDidLoad() {
|
|
717
|
+
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
718
|
+
const imageTags = ['img', 'svg'];
|
|
719
|
+
if (!isTagName(this.element.querySelector('[slot="title"]'), headingTags)) {
|
|
720
|
+
throw new Error(`<mg-illustrated-message> Slotted title must be a heading: ${headingTags.join(', ')}`);
|
|
721
|
+
}
|
|
722
|
+
else if (!isTagName(this.element.querySelector('[slot="illustration"]'), imageTags)) {
|
|
723
|
+
throw new Error(`<mg-illustrated-message> Slotted illustration must be an image: ${imageTags.join(', ')}`);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Render
|
|
728
|
+
*
|
|
729
|
+
* @returns {HTMLElement} HTML Element
|
|
730
|
+
*/
|
|
731
|
+
render() {
|
|
732
|
+
return (h("div", { class: "mg-illustrated-message" }, h("div", { class: {
|
|
733
|
+
'mg-illustrated-message__illustration': true,
|
|
734
|
+
'mg-illustrated-message__illustration--small': this.size === 'small',
|
|
735
|
+
} }, h("slot", { name: "illustration" })), h("div", { class: "mg-illustrated-message__title" }, h("slot", { name: "title" })), h("div", { class: "mg-illustrated-message__details" }, h("slot", { name: "details" }))));
|
|
736
|
+
}
|
|
737
|
+
get element() { return getElement(this); }
|
|
738
|
+
};
|
|
739
|
+
MgIllustratedMessage.style = mgIllustratedMessageCss;
|
|
740
|
+
|
|
611
741
|
/**
|
|
612
742
|
* Apply in all input child node the aria-describedby attribute
|
|
613
743
|
*
|
|
@@ -734,7 +864,7 @@ const MgInput = (props, children, utils) => {
|
|
|
734
864
|
props.errorMessage && !props.readonly && !props.disabled && (h("div", { id: helpTextErrorId, class: "mg-input__error", innerHTML: props.errorMessage, "aria-live": "assertive" }))))));
|
|
735
865
|
};
|
|
736
866
|
|
|
737
|
-
const mgInputCheckboxCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
867
|
+
const mgInputCheckboxCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.mg-input__input-group.mg-input__input-group--disabled label{opacity:0.3}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}";
|
|
738
868
|
|
|
739
869
|
/**
|
|
740
870
|
* type CheckboxItem validation function
|
|
@@ -954,7 +1084,7 @@ function localeDate(date, locale) {
|
|
|
954
1084
|
return new Intl.DateTimeFormat(locale).format(new Date(date));
|
|
955
1085
|
}
|
|
956
1086
|
|
|
957
|
-
const mgInputDateCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
1087
|
+
const mgInputDateCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}";
|
|
958
1088
|
|
|
959
1089
|
const MgInputDate = class {
|
|
960
1090
|
constructor(hostRef) {
|
|
@@ -1171,7 +1301,7 @@ var InputError;
|
|
|
1171
1301
|
InputError["REQUIRED"] = "required";
|
|
1172
1302
|
})(InputError || (InputError = {}));
|
|
1173
1303
|
|
|
1174
|
-
const mgInputNumericCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
1304
|
+
const mgInputNumericCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input .mg-input__box{text-align:var(--mg-inputs-text-align, right)}";
|
|
1175
1305
|
|
|
1176
1306
|
const MgInputNumeric = class {
|
|
1177
1307
|
constructor(hostRef) {
|
|
@@ -1457,7 +1587,7 @@ const MgInputNumeric = class {
|
|
|
1457
1587
|
};
|
|
1458
1588
|
MgInputNumeric.style = mgInputNumericCss;
|
|
1459
1589
|
|
|
1460
|
-
const mgInputPasswordCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
1590
|
+
const mgInputPasswordCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}";
|
|
1461
1591
|
|
|
1462
1592
|
const MgInputPassword = class {
|
|
1463
1593
|
constructor(hostRef) {
|
|
@@ -1587,7 +1717,7 @@ const MgInputPassword = class {
|
|
|
1587
1717
|
};
|
|
1588
1718
|
MgInputPassword.style = mgInputPasswordCss;
|
|
1589
1719
|
|
|
1590
|
-
const mgInputRadioCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
1720
|
+
const mgInputRadioCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.mg-input__input-group.mg-input__input-group--disabled label{opacity:0.3}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}";
|
|
1591
1721
|
|
|
1592
1722
|
/**
|
|
1593
1723
|
* type Option validation function
|
|
@@ -1763,7 +1893,7 @@ const MgInputRadio = class {
|
|
|
1763
1893
|
};
|
|
1764
1894
|
MgInputRadio.style = mgInputRadioCss;
|
|
1765
1895
|
|
|
1766
|
-
const mgInputSelectCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
1896
|
+
const mgInputSelectCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input__box{width:100%;padding-top:0;padding-bottom:0;padding-right:1rem}";
|
|
1767
1897
|
|
|
1768
1898
|
/**
|
|
1769
1899
|
* Check if item is a well configured option
|
|
@@ -1973,7 +2103,7 @@ const MgInputSelect = class {
|
|
|
1973
2103
|
};
|
|
1974
2104
|
MgInputSelect.style = mgInputSelectCss;
|
|
1975
2105
|
|
|
1976
|
-
const mgInputTextCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
2106
|
+
const mgInputTextCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.mg-input mg-character-left{opacity:0.6;font-size:1.1rem}.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__help-text,.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__error{margin-top:0}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input.mg-input--has-icon .mg-input__with-character-left>mg-icon{position:absolute;top:50%;left:var(--mg-inputs-spacer);color:var(--mg-inputs-color);transform:translateY(-50%)}.mg-input.mg-input--has-icon .mg-input__with-character-left .mg-input__box{padding-left:calc(var(--mg-icon-regular-size) + var(--mg-inputs-spacer) * 2)}.mg-input__with-character-left{position:relative;display:inline-flex;width:100%}.mg-input.is-focused .mg-input__with-character-left .mg-input__box{padding-right:calc(var(--mg-character-left-message-length) * 1ch + 0.8rem)}.mg-input__with-character-left mg-character-left{position:absolute;display:none;top:50%;right:1rem;opacity:0.6;transform:translateY(-50%);font-size:1.1rem}.mg-input.is-focused .mg-input__with-character-left mg-character-left{display:block}";
|
|
1977
2107
|
|
|
1978
2108
|
const MgInputText = class {
|
|
1979
2109
|
constructor(hostRef) {
|
|
@@ -2201,7 +2331,7 @@ const MgInputText = class {
|
|
|
2201
2331
|
};
|
|
2202
2332
|
MgInputText.style = mgInputTextCss;
|
|
2203
2333
|
|
|
2204
|
-
const mgInputTextareaCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
2334
|
+
const mgInputTextareaCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.mg-input__box{padding:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2) var(--mg-inputs-spacer);height:var(--default-size);box-sizing:border-box;border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:var(--mg-inputs-border-radius);background-color:hsl(var(--color-light));font-family:inherit;color:hsl(var(--color-dark));font-size:var(--font-size);text-align:var(--mg-inputs-text-align, left)}.mg-input__box::placeholder{color:var(--mg-inputs-color);font-style:italic}.mg-input__box:focus{box-shadow:0 0 0.6rem hsla(var(--mg-inputs-color-shadow-focus-hsl), 0.5)}.mg-input__box:disabled{opacity:0.3}.mg-input.mg-input--is-input-group-append{--mg-button-border-radius-top-left:0;--mg-button-border-radius-bottom-left:0;}.mg-input.mg-input--is-input-group-append .mg-input__box{margin-right:-0.1rem;border-top-right-radius:0%;border-bottom-right-radius:0%}.mg-input.mg-input--is-input-group-append .mg-input__box:focus-visible{outline-style:solid;outline-offset:-0.2rem;outline-width:0.2rem}.mg-input.mg-input--is-input-group-append.mg-input--readonly slot[name=append-input]{display:none}.mg-input.mg-input--label-on-top .mg-input__box{width:auto;max-width:100%}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]){--mg-button-border-radius-top-right:0;--mg-button-border-radius-bottom-right:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:not(:last-of-type)){--mg-button-border-right-width:0}.mg-input.mg-input--has-buttons-group-append ::slotted([slot=append-input]:last-of-type){--mg-button-border-radius-top-right:var(--mg-inputs-border-radius);--mg-button-border-radius-bottom-right:var(--mg-inputs-border-radius)}.mg-input.mg-input--is-append-input-slot-content:not(.mg-input--readonly) ::slotted([slot=append-input]){padding-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input.mg-input--width-full:not(.mg-input--label-on-top){justify-content:space-between}.mg-input.mg-input--width-full .mg-input__input-container{flex:auto;width:100%}.mg-input.mg-input--width-full .mg-input__input-container .mg-input__box{width:100%}.mg-input.mg-input--width-16 .mg-input__box{width:21rem}.mg-input.mg-input--width-4 .mg-input__box{width:7rem}.mg-input.mg-input--width-2 .mg-input__box{width:5rem}.mg-input mg-character-left{opacity:0.6;font-size:1.1rem}.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__help-text,.mg-input.mg-input--has-display-character-left .mg-input__input+.mg-input__error{margin-top:0}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input .mg-input__box{display:block;height:auto;resize:none}.mg-input .mg-input__box.mg-input__box--resizable{resize:both}.mg-input .mg-input__box.mg-input__box--resizable-horizontal{resize:horizontal}.mg-input .mg-input__box.mg-input__box--resizable-vertical{resize:vertical}.mg-input__with-character-left{width:100%}.mg-input__with-character-left mg-character-left{display:block;visibility:hidden;margin-top:0.2rem;text-align:end}.mg-input.is-focused .mg-input__with-character-left mg-character-left{visibility:visible}@-moz-document url-prefix(){.mg-input__box{overflow-x:hidden}}";
|
|
2205
2335
|
|
|
2206
2336
|
const MgInputTextarea = class {
|
|
2207
2337
|
constructor(hostRef) {
|
|
@@ -2446,7 +2576,7 @@ const MgInputTitle = class {
|
|
|
2446
2576
|
};
|
|
2447
2577
|
MgInputTitle.style = mgInputTitleCss;
|
|
2448
2578
|
|
|
2449
|
-
const mgInputToggleCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container
|
|
2579
|
+
const mgInputToggleCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}.mg-input.mg-input.mg-input--toggle .mg-input__input-container{flex:auto;min-width:0}.mg-input__button-toggle{display:flex;padding:0.2rem;min-width:0;background-color:hsl(var(--color-light));border-width:var(--mg-inputs-border-width);border-style:solid;border-color:var(--mg-inputs-color);border-radius:calc((var(--font-size) * var(--line-height) + 2 * (0.7rem + var(--mg-inputs-border-width))) / var(--mg-input-toggle-border-radius-ratio));font-size:inherit;line-height:inherit;cursor:pointer}.mg-input__button-toggle:disabled{cursor:default}.mg-input__toggle-item-container{padding:0.5rem 0.9rem;border:0;box-sizing:border-box;border-radius:calc((var(--font-size) * var(--line-height) + 1rem) / var(--mg-input-toggle-border-radius-ratio));background-color:unset;font-weight:unset;color:hsl(var(--color-dark));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mg-input__toggle-item-container:first-of-type{font-weight:600;color:hsl(var(--color-info));background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%))}.mg-input.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{background-color:unset;font-weight:unset;color:hsl(var(--color-dark))}.mg-input.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{font-weight:600;color:hsl(var(--color-info));background-color:hsl(var(--color-info-h), calc(var(--color-info-s) - 64%), calc(var(--color-info-l) + 55%))}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container{display:flex;justify-content:center;align-items:center;width:calc(var(--font-size) * var(--line-height) + 1rem);height:calc(var(--font-size) * var(--line-height) + 1rem);padding:0;visibility:hidden}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container:first-of-type{visibility:visible}.mg-input.mg-input--toggle-icon .mg-input__toggle-item-container ::slotted(mg-icon){display:flex}.mg-input.mg-input--toggle-icon.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{visibility:hidden}.mg-input.mg-input--toggle-icon.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{visibility:visible}.mg-input.mg-input--toggle-on-off .mg-input__toggle-item-container:first-of-type{font-weight:600;color:hsl(var(--color-dark));background-color:hsl(var(--color-dark-h), calc(var(--color-dark-s) - 30%), calc(var(--color-dark-l) + 75%))}.mg-input.mg-input--toggle-on-off.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{background-color:unset;font-weight:unset;color:hsl(var(--color-dark))}.mg-input.mg-input--toggle-readonly .mg-input__button-toggle{border-color:transparent;background-color:transparent;cursor:initial}.mg-input.mg-input--toggle-readonly .mg-input__toggle-item-container:last-of-type{display:none}.mg-input.mg-input--toggle-readonly.mg-input--toggle-is-active .mg-input__toggle-item-container:first-of-type{display:none}.mg-input.mg-input--toggle-readonly.mg-input--toggle-is-active .mg-input__toggle-item-container:last-of-type{display:flex}.mg-input.mg-input--toggle-disabled .mg-input__button-toggle{opacity:0.3}";
|
|
2450
2580
|
|
|
2451
2581
|
/**
|
|
2452
2582
|
* type Option validation function
|
|
@@ -2593,14 +2723,23 @@ const MgInputToggle = class {
|
|
|
2593
2723
|
* @returns {void}
|
|
2594
2724
|
*/
|
|
2595
2725
|
setChecked() {
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2726
|
+
const optionTrueValueIndex = this.options.map(option => option.value).findIndex(value => value === true);
|
|
2727
|
+
if ([0, 1].includes(optionTrueValueIndex)) {
|
|
2728
|
+
// has "value" props type is not a boolean, it is bind/render as an attributes/props
|
|
2729
|
+
// true props will be represent by "true" string so we convert it has boolean
|
|
2730
|
+
// true attribute will be represent by "" string so we convert it has boolean
|
|
2731
|
+
// https://stenciljs.com/docs/properties
|
|
2732
|
+
if (['', 'true'].includes(this.value) && this.options.find(option => option.value) !== undefined) {
|
|
2733
|
+
this.value = true;
|
|
2734
|
+
}
|
|
2735
|
+
// when options are boolean values and ordered as [true,false] instead [false,true]
|
|
2736
|
+
// we need to reversed the checked value logic
|
|
2737
|
+
const selectedValue = this.value === this.options[optionTrueValueIndex].value;
|
|
2738
|
+
this.checked = optionTrueValueIndex === 0 ? !selectedValue : selectedValue;
|
|
2739
|
+
}
|
|
2740
|
+
else {
|
|
2741
|
+
this.checked = this.value === this.options[1].value;
|
|
2602
2742
|
}
|
|
2603
|
-
this.checked = this.value === this.options[1].value;
|
|
2604
2743
|
}
|
|
2605
2744
|
/*************
|
|
2606
2745
|
* Lifecycle *
|
|
@@ -2942,10 +3081,6 @@ const MgPanel = class {
|
|
|
2942
3081
|
* Panel is opened
|
|
2943
3082
|
*/
|
|
2944
3083
|
this.expanded = false;
|
|
2945
|
-
/**
|
|
2946
|
-
* Disable possibility to toggle expand
|
|
2947
|
-
*/
|
|
2948
|
-
this.expandToggleDisabled = false;
|
|
2949
3084
|
/**
|
|
2950
3085
|
* Panel title is editabled
|
|
2951
3086
|
*/
|
|
@@ -3099,168 +3234,2117 @@ const MgPanel = class {
|
|
|
3099
3234
|
};
|
|
3100
3235
|
MgPanel.style = mgPanelCss;
|
|
3101
3236
|
|
|
3102
|
-
var
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3237
|
+
var top = 'top';
|
|
3238
|
+
var bottom = 'bottom';
|
|
3239
|
+
var right = 'right';
|
|
3240
|
+
var left = 'left';
|
|
3241
|
+
var auto = 'auto';
|
|
3242
|
+
var basePlacements = [top, bottom, right, left];
|
|
3243
|
+
var start = 'start';
|
|
3244
|
+
var end = 'end';
|
|
3245
|
+
var clippingParents = 'clippingParents';
|
|
3246
|
+
var viewport = 'viewport';
|
|
3247
|
+
var popper = 'popper';
|
|
3248
|
+
var reference = 'reference';
|
|
3249
|
+
var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
|
|
3250
|
+
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
3251
|
+
}, []);
|
|
3252
|
+
var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
|
|
3253
|
+
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
3254
|
+
}, []); // modifiers that need to read the DOM
|
|
3113
3255
|
|
|
3114
|
-
|
|
3256
|
+
var beforeRead = 'beforeRead';
|
|
3257
|
+
var read = 'read';
|
|
3258
|
+
var afterRead = 'afterRead'; // pure-logic modifiers
|
|
3115
3259
|
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
this.buttonTabBaseClass = 'mg-tabs__navigation-button';
|
|
3133
|
-
/**
|
|
3134
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
3135
|
-
* If not set, it will be created.
|
|
3136
|
-
*/
|
|
3137
|
-
this.identifier = createID('mg-tabs');
|
|
3138
|
-
/**
|
|
3139
|
-
* Define tabs size
|
|
3140
|
-
*/
|
|
3141
|
-
this.size = 'regular';
|
|
3142
|
-
/**
|
|
3143
|
-
* Active tab number
|
|
3144
|
-
* default: first is 1
|
|
3145
|
-
*/
|
|
3146
|
-
this.activeTab = 1;
|
|
3147
|
-
/**
|
|
3148
|
-
* Component tabs
|
|
3149
|
-
*/
|
|
3150
|
-
this.tabs = [];
|
|
3151
|
-
/**
|
|
3152
|
-
* Component classes
|
|
3153
|
-
*/
|
|
3154
|
-
this.classList = new ClassList(['mg-tabs']);
|
|
3155
|
-
/**
|
|
3156
|
-
* Method to set active tab
|
|
3157
|
-
*
|
|
3158
|
-
* @param {number} tabKey item tab key to set to ACTIVE status
|
|
3159
|
-
* @returns {void}
|
|
3160
|
-
*/
|
|
3161
|
-
this.setActiveTab = (tabKey) => {
|
|
3162
|
-
// reset active tabs
|
|
3163
|
-
this.tabs.forEach(tab => {
|
|
3164
|
-
if (this.tabHasGivenStatus(tab, Status.ACTIVE))
|
|
3165
|
-
tab.status = Status.VISIBLE;
|
|
3166
|
-
});
|
|
3167
|
-
// set active tab from given tab key
|
|
3168
|
-
this.tabs[tabKey - this.startIndex].status = Status.ACTIVE;
|
|
3169
|
-
// emit change active tab key event
|
|
3170
|
-
this.activeTabChange.emit(tabKey);
|
|
3171
|
-
};
|
|
3172
|
-
/**
|
|
3173
|
-
* Method to know if given tab has the given status
|
|
3174
|
-
*
|
|
3175
|
-
* @param {TabItem} tab item tab key to set to ACTIVE status
|
|
3176
|
-
* @param {Status} status status to valide
|
|
3177
|
-
* @returns {boolean} status comparaison
|
|
3178
|
-
*/
|
|
3179
|
-
this.tabHasGivenStatus = (tab, status) => tab.status === status;
|
|
3180
|
-
/**
|
|
3181
|
-
* Method to get element id from index
|
|
3182
|
-
*
|
|
3183
|
-
* @param {string} element to get id
|
|
3184
|
-
* @param {number} index to generate id
|
|
3185
|
-
* @returns {string} generated element id
|
|
3186
|
-
*/
|
|
3187
|
-
this.getElementId = (element, index) => `${element}-${this.getTabIndex(index)}`;
|
|
3188
|
-
/**
|
|
3189
|
-
* Method to get tab index
|
|
3190
|
-
*
|
|
3191
|
-
* @param {number} index to get
|
|
3192
|
-
* @returns {number} index
|
|
3193
|
-
*/
|
|
3194
|
-
this.getTabIndex = (index) => index + this.startIndex;
|
|
3195
|
-
/**
|
|
3196
|
-
* Handle click events on tabs
|
|
3197
|
-
*
|
|
3198
|
-
* @param {MouseEvent} event mouse event
|
|
3199
|
-
*/
|
|
3200
|
-
this.handleClick = (event) => {
|
|
3201
|
-
const tabId = event.currentTarget.getAttribute('data-index');
|
|
3202
|
-
this.activeTab = Number(tabId);
|
|
3203
|
-
};
|
|
3204
|
-
/**
|
|
3205
|
-
* get navigation button class from given status
|
|
3206
|
-
*
|
|
3207
|
-
* @param {Status} status button tab status
|
|
3208
|
-
* @param {boolean} isSelector set if we need a CSS selector with the dot '.' at the begin. default value = false.
|
|
3209
|
-
* @returns {string} button class/selector variant
|
|
3210
|
-
*/
|
|
3211
|
-
this.getNavigationButtonClass = (status, isSelector = false) => `${isSelector ? '.' : ''}${this.buttonTabBaseClass}--${status}`;
|
|
3212
|
-
/**
|
|
3213
|
-
* Handle keyboard event on tabs
|
|
3214
|
-
*
|
|
3215
|
-
* @param {MouseEvent} event mouse event
|
|
3216
|
-
* @returns {void}
|
|
3217
|
-
*/
|
|
3218
|
-
this.handleKeydown = (event) => {
|
|
3219
|
-
let tabId = Number(event.target.getAttribute('data-index'));
|
|
3220
|
-
const parent = event.target.parentElement;
|
|
3221
|
-
// change selected id from key code
|
|
3222
|
-
if (event.key === 'ArrowRight') {
|
|
3223
|
-
tabId++;
|
|
3224
|
-
}
|
|
3225
|
-
else if (event.key === 'ArrowLeft') {
|
|
3226
|
-
tabId--;
|
|
3227
|
-
}
|
|
3228
|
-
// get selected tab if NOT hidden, disabled
|
|
3229
|
-
const selectedTab = parent.querySelector(`[data-index="${tabId}"]:not(${[this.getNavigationButtonClass(Status.HIDDEN, true), this.getNavigationButtonClass(Status.DISABLED, true)].join()})`);
|
|
3230
|
-
// apply selected tab if exist
|
|
3231
|
-
if (selectedTab !== null) {
|
|
3232
|
-
selectedTab.focus();
|
|
3233
|
-
this.activeTab = tabId;
|
|
3234
|
-
}
|
|
3235
|
-
};
|
|
3236
|
-
/**
|
|
3237
|
-
* Validate slots setting
|
|
3238
|
-
*/
|
|
3239
|
-
this.validateSlots = () => {
|
|
3240
|
-
const slots = Array.from(this.element.children).filter(slot => { var _a; return (_a = slot.getAttribute('slot')) === null || _a === void 0 ? void 0 : _a.includes('tab_content-'); });
|
|
3241
|
-
if (slots.length !== this.tabs.length) {
|
|
3242
|
-
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
3243
|
-
}
|
|
3244
|
-
};
|
|
3260
|
+
var beforeMain = 'beforeMain';
|
|
3261
|
+
var main = 'main';
|
|
3262
|
+
var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
|
|
3263
|
+
|
|
3264
|
+
var beforeWrite = 'beforeWrite';
|
|
3265
|
+
var write = 'write';
|
|
3266
|
+
var afterWrite = 'afterWrite';
|
|
3267
|
+
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
3268
|
+
|
|
3269
|
+
function getNodeName(element) {
|
|
3270
|
+
return element ? (element.nodeName || '').toLowerCase() : null;
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3273
|
+
function getWindow(node) {
|
|
3274
|
+
if (node == null) {
|
|
3275
|
+
return window;
|
|
3245
3276
|
}
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
this.classList.add(`mg-tabs--size-${this.size}`);
|
|
3277
|
+
|
|
3278
|
+
if (node.toString() !== '[object Window]') {
|
|
3279
|
+
var ownerDocument = node.ownerDocument;
|
|
3280
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
3251
3281
|
}
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3282
|
+
|
|
3283
|
+
return node;
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
function isElement(node) {
|
|
3287
|
+
var OwnElement = getWindow(node).Element;
|
|
3288
|
+
return node instanceof OwnElement || node instanceof Element;
|
|
3289
|
+
}
|
|
3290
|
+
|
|
3291
|
+
function isHTMLElement(node) {
|
|
3292
|
+
var OwnElement = getWindow(node).HTMLElement;
|
|
3293
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
3294
|
+
}
|
|
3295
|
+
|
|
3296
|
+
function isShadowRoot(node) {
|
|
3297
|
+
// IE 11 has no ShadowRoot
|
|
3298
|
+
if (typeof ShadowRoot === 'undefined') {
|
|
3299
|
+
return false;
|
|
3300
|
+
}
|
|
3301
|
+
|
|
3302
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
3303
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
3304
|
+
}
|
|
3305
|
+
|
|
3306
|
+
// and applies them to the HTMLElements such as popper and arrow
|
|
3307
|
+
|
|
3308
|
+
function applyStyles(_ref) {
|
|
3309
|
+
var state = _ref.state;
|
|
3310
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
3311
|
+
var style = state.styles[name] || {};
|
|
3312
|
+
var attributes = state.attributes[name] || {};
|
|
3313
|
+
var element = state.elements[name]; // arrow is optional + virtual elements
|
|
3314
|
+
|
|
3315
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
3316
|
+
return;
|
|
3317
|
+
} // Flow doesn't support to extend this property, but it's the most
|
|
3318
|
+
// effective way to apply styles to an HTMLElement
|
|
3319
|
+
// $FlowFixMe[cannot-write]
|
|
3320
|
+
|
|
3321
|
+
|
|
3322
|
+
Object.assign(element.style, style);
|
|
3323
|
+
Object.keys(attributes).forEach(function (name) {
|
|
3324
|
+
var value = attributes[name];
|
|
3325
|
+
|
|
3326
|
+
if (value === false) {
|
|
3327
|
+
element.removeAttribute(name);
|
|
3328
|
+
} else {
|
|
3329
|
+
element.setAttribute(name, value === true ? '' : value);
|
|
3330
|
+
}
|
|
3331
|
+
});
|
|
3332
|
+
});
|
|
3333
|
+
}
|
|
3334
|
+
|
|
3335
|
+
function effect$2(_ref2) {
|
|
3336
|
+
var state = _ref2.state;
|
|
3337
|
+
var initialStyles = {
|
|
3338
|
+
popper: {
|
|
3339
|
+
position: state.options.strategy,
|
|
3340
|
+
left: '0',
|
|
3341
|
+
top: '0',
|
|
3342
|
+
margin: '0'
|
|
3343
|
+
},
|
|
3344
|
+
arrow: {
|
|
3345
|
+
position: 'absolute'
|
|
3346
|
+
},
|
|
3347
|
+
reference: {}
|
|
3348
|
+
};
|
|
3349
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
3350
|
+
state.styles = initialStyles;
|
|
3351
|
+
|
|
3352
|
+
if (state.elements.arrow) {
|
|
3353
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
return function () {
|
|
3357
|
+
Object.keys(state.elements).forEach(function (name) {
|
|
3358
|
+
var element = state.elements[name];
|
|
3359
|
+
var attributes = state.attributes[name] || {};
|
|
3360
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
|
|
3361
|
+
|
|
3362
|
+
var style = styleProperties.reduce(function (style, property) {
|
|
3363
|
+
style[property] = '';
|
|
3364
|
+
return style;
|
|
3365
|
+
}, {}); // arrow is optional + virtual elements
|
|
3366
|
+
|
|
3367
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
3368
|
+
return;
|
|
3369
|
+
}
|
|
3370
|
+
|
|
3371
|
+
Object.assign(element.style, style);
|
|
3372
|
+
Object.keys(attributes).forEach(function (attribute) {
|
|
3373
|
+
element.removeAttribute(attribute);
|
|
3374
|
+
});
|
|
3375
|
+
});
|
|
3376
|
+
};
|
|
3377
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
3378
|
+
|
|
3379
|
+
|
|
3380
|
+
const applyStyles$1 = {
|
|
3381
|
+
name: 'applyStyles',
|
|
3382
|
+
enabled: true,
|
|
3383
|
+
phase: 'write',
|
|
3384
|
+
fn: applyStyles,
|
|
3385
|
+
effect: effect$2,
|
|
3386
|
+
requires: ['computeStyles']
|
|
3387
|
+
};
|
|
3388
|
+
|
|
3389
|
+
function getBasePlacement(placement) {
|
|
3390
|
+
return placement.split('-')[0];
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3393
|
+
var max = Math.max;
|
|
3394
|
+
var min = Math.min;
|
|
3395
|
+
var round = Math.round;
|
|
3396
|
+
|
|
3397
|
+
function getBoundingClientRect(element, includeScale) {
|
|
3398
|
+
if (includeScale === void 0) {
|
|
3399
|
+
includeScale = false;
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
var rect = element.getBoundingClientRect();
|
|
3403
|
+
var scaleX = 1;
|
|
3404
|
+
var scaleY = 1;
|
|
3405
|
+
|
|
3406
|
+
if (isHTMLElement(element) && includeScale) {
|
|
3407
|
+
var offsetHeight = element.offsetHeight;
|
|
3408
|
+
var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
|
|
3409
|
+
// Fallback to 1 in case both values are `0`
|
|
3410
|
+
|
|
3411
|
+
if (offsetWidth > 0) {
|
|
3412
|
+
scaleX = round(rect.width) / offsetWidth || 1;
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
if (offsetHeight > 0) {
|
|
3416
|
+
scaleY = round(rect.height) / offsetHeight || 1;
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
return {
|
|
3421
|
+
width: rect.width / scaleX,
|
|
3422
|
+
height: rect.height / scaleY,
|
|
3423
|
+
top: rect.top / scaleY,
|
|
3424
|
+
right: rect.right / scaleX,
|
|
3425
|
+
bottom: rect.bottom / scaleY,
|
|
3426
|
+
left: rect.left / scaleX,
|
|
3427
|
+
x: rect.left / scaleX,
|
|
3428
|
+
y: rect.top / scaleY
|
|
3429
|
+
};
|
|
3430
|
+
}
|
|
3431
|
+
|
|
3432
|
+
// means it doesn't take into account transforms.
|
|
3433
|
+
|
|
3434
|
+
function getLayoutRect(element) {
|
|
3435
|
+
var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
|
|
3436
|
+
// Fixes https://github.com/popperjs/popper-core/issues/1223
|
|
3437
|
+
|
|
3438
|
+
var width = element.offsetWidth;
|
|
3439
|
+
var height = element.offsetHeight;
|
|
3440
|
+
|
|
3441
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
3442
|
+
width = clientRect.width;
|
|
3443
|
+
}
|
|
3444
|
+
|
|
3445
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
3446
|
+
height = clientRect.height;
|
|
3447
|
+
}
|
|
3448
|
+
|
|
3449
|
+
return {
|
|
3450
|
+
x: element.offsetLeft,
|
|
3451
|
+
y: element.offsetTop,
|
|
3452
|
+
width: width,
|
|
3453
|
+
height: height
|
|
3454
|
+
};
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3457
|
+
function contains(parent, child) {
|
|
3458
|
+
var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
|
|
3459
|
+
|
|
3460
|
+
if (parent.contains(child)) {
|
|
3461
|
+
return true;
|
|
3462
|
+
} // then fallback to custom implementation with Shadow DOM support
|
|
3463
|
+
else if (rootNode && isShadowRoot(rootNode)) {
|
|
3464
|
+
var next = child;
|
|
3465
|
+
|
|
3466
|
+
do {
|
|
3467
|
+
if (next && parent.isSameNode(next)) {
|
|
3468
|
+
return true;
|
|
3469
|
+
} // $FlowFixMe[prop-missing]: need a better way to handle this...
|
|
3470
|
+
|
|
3471
|
+
|
|
3472
|
+
next = next.parentNode || next.host;
|
|
3473
|
+
} while (next);
|
|
3474
|
+
} // Give up, the result is false
|
|
3475
|
+
|
|
3476
|
+
|
|
3477
|
+
return false;
|
|
3478
|
+
}
|
|
3479
|
+
|
|
3480
|
+
function getComputedStyle(element) {
|
|
3481
|
+
return getWindow(element).getComputedStyle(element);
|
|
3482
|
+
}
|
|
3483
|
+
|
|
3484
|
+
function isTableElement(element) {
|
|
3485
|
+
return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3488
|
+
function getDocumentElement(element) {
|
|
3489
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
3490
|
+
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
|
3491
|
+
element.document) || window.document).documentElement;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
function getParentNode(element) {
|
|
3495
|
+
if (getNodeName(element) === 'html') {
|
|
3496
|
+
return element;
|
|
3497
|
+
}
|
|
3498
|
+
|
|
3499
|
+
return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
3500
|
+
// $FlowFixMe[incompatible-return]
|
|
3501
|
+
// $FlowFixMe[prop-missing]
|
|
3502
|
+
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
3503
|
+
element.parentNode || ( // DOM Element detected
|
|
3504
|
+
isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
3505
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
3506
|
+
getDocumentElement(element) // fallback
|
|
3507
|
+
|
|
3508
|
+
);
|
|
3509
|
+
}
|
|
3510
|
+
|
|
3511
|
+
function getTrueOffsetParent(element) {
|
|
3512
|
+
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
3513
|
+
getComputedStyle(element).position === 'fixed') {
|
|
3514
|
+
return null;
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
return element.offsetParent;
|
|
3518
|
+
} // `.offsetParent` reports `null` for fixed elements, while absolute elements
|
|
3519
|
+
// return the containing block
|
|
3520
|
+
|
|
3521
|
+
|
|
3522
|
+
function getContainingBlock(element) {
|
|
3523
|
+
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
|
|
3524
|
+
var isIE = navigator.userAgent.indexOf('Trident') !== -1;
|
|
3525
|
+
|
|
3526
|
+
if (isIE && isHTMLElement(element)) {
|
|
3527
|
+
// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
|
|
3528
|
+
var elementCss = getComputedStyle(element);
|
|
3529
|
+
|
|
3530
|
+
if (elementCss.position === 'fixed') {
|
|
3531
|
+
return null;
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
var currentNode = getParentNode(element);
|
|
3536
|
+
|
|
3537
|
+
if (isShadowRoot(currentNode)) {
|
|
3538
|
+
currentNode = currentNode.host;
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
3542
|
+
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
3543
|
+
// create a containing block.
|
|
3544
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
3545
|
+
|
|
3546
|
+
if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
|
|
3547
|
+
return currentNode;
|
|
3548
|
+
} else {
|
|
3549
|
+
currentNode = currentNode.parentNode;
|
|
3550
|
+
}
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
return null;
|
|
3554
|
+
} // Gets the closest ancestor positioned element. Handles some edge cases,
|
|
3555
|
+
// such as table ancestors and cross browser bugs.
|
|
3556
|
+
|
|
3557
|
+
|
|
3558
|
+
function getOffsetParent(element) {
|
|
3559
|
+
var window = getWindow(element);
|
|
3560
|
+
var offsetParent = getTrueOffsetParent(element);
|
|
3561
|
+
|
|
3562
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
3563
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
|
|
3567
|
+
return window;
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3570
|
+
return offsetParent || getContainingBlock(element) || window;
|
|
3571
|
+
}
|
|
3572
|
+
|
|
3573
|
+
function getMainAxisFromPlacement(placement) {
|
|
3574
|
+
return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
function within(min$1, value, max$1) {
|
|
3578
|
+
return max(min$1, min(value, max$1));
|
|
3579
|
+
}
|
|
3580
|
+
function withinMaxClamp(min, value, max) {
|
|
3581
|
+
var v = within(min, value, max);
|
|
3582
|
+
return v > max ? max : v;
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
function getFreshSideObject() {
|
|
3586
|
+
return {
|
|
3587
|
+
top: 0,
|
|
3588
|
+
right: 0,
|
|
3589
|
+
bottom: 0,
|
|
3590
|
+
left: 0
|
|
3591
|
+
};
|
|
3592
|
+
}
|
|
3593
|
+
|
|
3594
|
+
function mergePaddingObject(paddingObject) {
|
|
3595
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
function expandToHashMap(value, keys) {
|
|
3599
|
+
return keys.reduce(function (hashMap, key) {
|
|
3600
|
+
hashMap[key] = value;
|
|
3601
|
+
return hashMap;
|
|
3602
|
+
}, {});
|
|
3603
|
+
}
|
|
3604
|
+
|
|
3605
|
+
var toPaddingObject = function toPaddingObject(padding, state) {
|
|
3606
|
+
padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
|
|
3607
|
+
placement: state.placement
|
|
3608
|
+
})) : padding;
|
|
3609
|
+
return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
3610
|
+
};
|
|
3611
|
+
|
|
3612
|
+
function arrow(_ref) {
|
|
3613
|
+
var _state$modifiersData$;
|
|
3614
|
+
|
|
3615
|
+
var state = _ref.state,
|
|
3616
|
+
name = _ref.name,
|
|
3617
|
+
options = _ref.options;
|
|
3618
|
+
var arrowElement = state.elements.arrow;
|
|
3619
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
3620
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
3621
|
+
var axis = getMainAxisFromPlacement(basePlacement);
|
|
3622
|
+
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
|
3623
|
+
var len = isVertical ? 'height' : 'width';
|
|
3624
|
+
|
|
3625
|
+
if (!arrowElement || !popperOffsets) {
|
|
3626
|
+
return;
|
|
3627
|
+
}
|
|
3628
|
+
|
|
3629
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
|
3630
|
+
var arrowRect = getLayoutRect(arrowElement);
|
|
3631
|
+
var minProp = axis === 'y' ? top : left;
|
|
3632
|
+
var maxProp = axis === 'y' ? bottom : right;
|
|
3633
|
+
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
|
|
3634
|
+
var startDiff = popperOffsets[axis] - state.rects.reference[axis];
|
|
3635
|
+
var arrowOffsetParent = getOffsetParent(arrowElement);
|
|
3636
|
+
var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
3637
|
+
var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
|
|
3638
|
+
// outside of the popper bounds
|
|
3639
|
+
|
|
3640
|
+
var min = paddingObject[minProp];
|
|
3641
|
+
var max = clientSize - arrowRect[len] - paddingObject[maxProp];
|
|
3642
|
+
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
|
3643
|
+
var offset = within(min, center, max); // Prevents breaking syntax highlighting...
|
|
3644
|
+
|
|
3645
|
+
var axisProp = axis;
|
|
3646
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
|
|
3647
|
+
}
|
|
3648
|
+
|
|
3649
|
+
function effect$1(_ref2) {
|
|
3650
|
+
var state = _ref2.state,
|
|
3651
|
+
options = _ref2.options;
|
|
3652
|
+
var _options$element = options.element,
|
|
3653
|
+
arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
|
|
3654
|
+
|
|
3655
|
+
if (arrowElement == null) {
|
|
3656
|
+
return;
|
|
3657
|
+
} // CSS selector
|
|
3658
|
+
|
|
3659
|
+
|
|
3660
|
+
if (typeof arrowElement === 'string') {
|
|
3661
|
+
arrowElement = state.elements.popper.querySelector(arrowElement);
|
|
3662
|
+
|
|
3663
|
+
if (!arrowElement) {
|
|
3664
|
+
return;
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
if (!contains(state.elements.popper, arrowElement)) {
|
|
3669
|
+
|
|
3670
|
+
return;
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3673
|
+
state.elements.arrow = arrowElement;
|
|
3674
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
3675
|
+
|
|
3676
|
+
|
|
3677
|
+
const arrow$1 = {
|
|
3678
|
+
name: 'arrow',
|
|
3679
|
+
enabled: true,
|
|
3680
|
+
phase: 'main',
|
|
3681
|
+
fn: arrow,
|
|
3682
|
+
effect: effect$1,
|
|
3683
|
+
requires: ['popperOffsets'],
|
|
3684
|
+
requiresIfExists: ['preventOverflow']
|
|
3685
|
+
};
|
|
3686
|
+
|
|
3687
|
+
function getVariation(placement) {
|
|
3688
|
+
return placement.split('-')[1];
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
var unsetSides = {
|
|
3692
|
+
top: 'auto',
|
|
3693
|
+
right: 'auto',
|
|
3694
|
+
bottom: 'auto',
|
|
3695
|
+
left: 'auto'
|
|
3696
|
+
}; // Round the offsets to the nearest suitable subpixel based on the DPR.
|
|
3697
|
+
// Zooming can change the DPR, but it seems to report a value that will
|
|
3698
|
+
// cleanly divide the values into the appropriate subpixels.
|
|
3699
|
+
|
|
3700
|
+
function roundOffsetsByDPR(_ref) {
|
|
3701
|
+
var x = _ref.x,
|
|
3702
|
+
y = _ref.y;
|
|
3703
|
+
var win = window;
|
|
3704
|
+
var dpr = win.devicePixelRatio || 1;
|
|
3705
|
+
return {
|
|
3706
|
+
x: round(x * dpr) / dpr || 0,
|
|
3707
|
+
y: round(y * dpr) / dpr || 0
|
|
3708
|
+
};
|
|
3709
|
+
}
|
|
3710
|
+
|
|
3711
|
+
function mapToStyles(_ref2) {
|
|
3712
|
+
var _Object$assign2;
|
|
3713
|
+
|
|
3714
|
+
var popper = _ref2.popper,
|
|
3715
|
+
popperRect = _ref2.popperRect,
|
|
3716
|
+
placement = _ref2.placement,
|
|
3717
|
+
variation = _ref2.variation,
|
|
3718
|
+
offsets = _ref2.offsets,
|
|
3719
|
+
position = _ref2.position,
|
|
3720
|
+
gpuAcceleration = _ref2.gpuAcceleration,
|
|
3721
|
+
adaptive = _ref2.adaptive,
|
|
3722
|
+
roundOffsets = _ref2.roundOffsets,
|
|
3723
|
+
isFixed = _ref2.isFixed;
|
|
3724
|
+
var _offsets$x = offsets.x,
|
|
3725
|
+
x = _offsets$x === void 0 ? 0 : _offsets$x,
|
|
3726
|
+
_offsets$y = offsets.y,
|
|
3727
|
+
y = _offsets$y === void 0 ? 0 : _offsets$y;
|
|
3728
|
+
|
|
3729
|
+
var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
|
|
3730
|
+
x: x,
|
|
3731
|
+
y: y
|
|
3732
|
+
}) : {
|
|
3733
|
+
x: x,
|
|
3734
|
+
y: y
|
|
3735
|
+
};
|
|
3736
|
+
|
|
3737
|
+
x = _ref3.x;
|
|
3738
|
+
y = _ref3.y;
|
|
3739
|
+
var hasX = offsets.hasOwnProperty('x');
|
|
3740
|
+
var hasY = offsets.hasOwnProperty('y');
|
|
3741
|
+
var sideX = left;
|
|
3742
|
+
var sideY = top;
|
|
3743
|
+
var win = window;
|
|
3744
|
+
|
|
3745
|
+
if (adaptive) {
|
|
3746
|
+
var offsetParent = getOffsetParent(popper);
|
|
3747
|
+
var heightProp = 'clientHeight';
|
|
3748
|
+
var widthProp = 'clientWidth';
|
|
3749
|
+
|
|
3750
|
+
if (offsetParent === getWindow(popper)) {
|
|
3751
|
+
offsetParent = getDocumentElement(popper);
|
|
3752
|
+
|
|
3753
|
+
if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
|
|
3754
|
+
heightProp = 'scrollHeight';
|
|
3755
|
+
widthProp = 'scrollWidth';
|
|
3756
|
+
}
|
|
3757
|
+
} // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
|
|
3758
|
+
|
|
3759
|
+
|
|
3760
|
+
offsetParent = offsetParent;
|
|
3761
|
+
|
|
3762
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
3763
|
+
sideY = bottom;
|
|
3764
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
3765
|
+
offsetParent[heightProp];
|
|
3766
|
+
y -= offsetY - popperRect.height;
|
|
3767
|
+
y *= gpuAcceleration ? 1 : -1;
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
3771
|
+
sideX = right;
|
|
3772
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
3773
|
+
offsetParent[widthProp];
|
|
3774
|
+
x -= offsetX - popperRect.width;
|
|
3775
|
+
x *= gpuAcceleration ? 1 : -1;
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
var commonStyles = Object.assign({
|
|
3780
|
+
position: position
|
|
3781
|
+
}, adaptive && unsetSides);
|
|
3782
|
+
|
|
3783
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
|
3784
|
+
x: x,
|
|
3785
|
+
y: y
|
|
3786
|
+
}) : {
|
|
3787
|
+
x: x,
|
|
3788
|
+
y: y
|
|
3789
|
+
};
|
|
3790
|
+
|
|
3791
|
+
x = _ref4.x;
|
|
3792
|
+
y = _ref4.y;
|
|
3793
|
+
|
|
3794
|
+
if (gpuAcceleration) {
|
|
3795
|
+
var _Object$assign;
|
|
3796
|
+
|
|
3797
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
function computeStyles(_ref5) {
|
|
3804
|
+
var state = _ref5.state,
|
|
3805
|
+
options = _ref5.options;
|
|
3806
|
+
var _options$gpuAccelerat = options.gpuAcceleration,
|
|
3807
|
+
gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
|
|
3808
|
+
_options$adaptive = options.adaptive,
|
|
3809
|
+
adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
|
|
3810
|
+
_options$roundOffsets = options.roundOffsets,
|
|
3811
|
+
roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
3812
|
+
|
|
3813
|
+
var commonStyles = {
|
|
3814
|
+
placement: getBasePlacement(state.placement),
|
|
3815
|
+
variation: getVariation(state.placement),
|
|
3816
|
+
popper: state.elements.popper,
|
|
3817
|
+
popperRect: state.rects.popper,
|
|
3818
|
+
gpuAcceleration: gpuAcceleration,
|
|
3819
|
+
isFixed: state.options.strategy === 'fixed'
|
|
3820
|
+
};
|
|
3821
|
+
|
|
3822
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
3823
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
|
3824
|
+
offsets: state.modifiersData.popperOffsets,
|
|
3825
|
+
position: state.options.strategy,
|
|
3826
|
+
adaptive: adaptive,
|
|
3827
|
+
roundOffsets: roundOffsets
|
|
3828
|
+
})));
|
|
3829
|
+
}
|
|
3830
|
+
|
|
3831
|
+
if (state.modifiersData.arrow != null) {
|
|
3832
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
|
3833
|
+
offsets: state.modifiersData.arrow,
|
|
3834
|
+
position: 'absolute',
|
|
3835
|
+
adaptive: false,
|
|
3836
|
+
roundOffsets: roundOffsets
|
|
3837
|
+
})));
|
|
3838
|
+
}
|
|
3839
|
+
|
|
3840
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
3841
|
+
'data-popper-placement': state.placement
|
|
3842
|
+
});
|
|
3843
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
3844
|
+
|
|
3845
|
+
|
|
3846
|
+
const computeStyles$1 = {
|
|
3847
|
+
name: 'computeStyles',
|
|
3848
|
+
enabled: true,
|
|
3849
|
+
phase: 'beforeWrite',
|
|
3850
|
+
fn: computeStyles,
|
|
3851
|
+
data: {}
|
|
3852
|
+
};
|
|
3853
|
+
|
|
3854
|
+
var passive = {
|
|
3855
|
+
passive: true
|
|
3856
|
+
};
|
|
3857
|
+
|
|
3858
|
+
function effect(_ref) {
|
|
3859
|
+
var state = _ref.state,
|
|
3860
|
+
instance = _ref.instance,
|
|
3861
|
+
options = _ref.options;
|
|
3862
|
+
var _options$scroll = options.scroll,
|
|
3863
|
+
scroll = _options$scroll === void 0 ? true : _options$scroll,
|
|
3864
|
+
_options$resize = options.resize,
|
|
3865
|
+
resize = _options$resize === void 0 ? true : _options$resize;
|
|
3866
|
+
var window = getWindow(state.elements.popper);
|
|
3867
|
+
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
|
3868
|
+
|
|
3869
|
+
if (scroll) {
|
|
3870
|
+
scrollParents.forEach(function (scrollParent) {
|
|
3871
|
+
scrollParent.addEventListener('scroll', instance.update, passive);
|
|
3872
|
+
});
|
|
3873
|
+
}
|
|
3874
|
+
|
|
3875
|
+
if (resize) {
|
|
3876
|
+
window.addEventListener('resize', instance.update, passive);
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3879
|
+
return function () {
|
|
3880
|
+
if (scroll) {
|
|
3881
|
+
scrollParents.forEach(function (scrollParent) {
|
|
3882
|
+
scrollParent.removeEventListener('scroll', instance.update, passive);
|
|
3883
|
+
});
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3886
|
+
if (resize) {
|
|
3887
|
+
window.removeEventListener('resize', instance.update, passive);
|
|
3888
|
+
}
|
|
3889
|
+
};
|
|
3890
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
3891
|
+
|
|
3892
|
+
|
|
3893
|
+
const eventListeners = {
|
|
3894
|
+
name: 'eventListeners',
|
|
3895
|
+
enabled: true,
|
|
3896
|
+
phase: 'write',
|
|
3897
|
+
fn: function fn() {},
|
|
3898
|
+
effect: effect,
|
|
3899
|
+
data: {}
|
|
3900
|
+
};
|
|
3901
|
+
|
|
3902
|
+
var hash$1 = {
|
|
3903
|
+
left: 'right',
|
|
3904
|
+
right: 'left',
|
|
3905
|
+
bottom: 'top',
|
|
3906
|
+
top: 'bottom'
|
|
3907
|
+
};
|
|
3908
|
+
function getOppositePlacement(placement) {
|
|
3909
|
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
|
3910
|
+
return hash$1[matched];
|
|
3911
|
+
});
|
|
3912
|
+
}
|
|
3913
|
+
|
|
3914
|
+
var hash = {
|
|
3915
|
+
start: 'end',
|
|
3916
|
+
end: 'start'
|
|
3917
|
+
};
|
|
3918
|
+
function getOppositeVariationPlacement(placement) {
|
|
3919
|
+
return placement.replace(/start|end/g, function (matched) {
|
|
3920
|
+
return hash[matched];
|
|
3921
|
+
});
|
|
3922
|
+
}
|
|
3923
|
+
|
|
3924
|
+
function getWindowScroll(node) {
|
|
3925
|
+
var win = getWindow(node);
|
|
3926
|
+
var scrollLeft = win.pageXOffset;
|
|
3927
|
+
var scrollTop = win.pageYOffset;
|
|
3928
|
+
return {
|
|
3929
|
+
scrollLeft: scrollLeft,
|
|
3930
|
+
scrollTop: scrollTop
|
|
3931
|
+
};
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3934
|
+
function getWindowScrollBarX(element) {
|
|
3935
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
3936
|
+
// incorrect for RTL.
|
|
3937
|
+
// Popper 1 is broken in this case and never had a bug report so let's assume
|
|
3938
|
+
// it's not an issue. I don't think anyone ever specifies width on <html>
|
|
3939
|
+
// anyway.
|
|
3940
|
+
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
|
3941
|
+
// this (e.g. Edge 2019, IE11, Safari)
|
|
3942
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
|
3943
|
+
}
|
|
3944
|
+
|
|
3945
|
+
function getViewportRect(element) {
|
|
3946
|
+
var win = getWindow(element);
|
|
3947
|
+
var html = getDocumentElement(element);
|
|
3948
|
+
var visualViewport = win.visualViewport;
|
|
3949
|
+
var width = html.clientWidth;
|
|
3950
|
+
var height = html.clientHeight;
|
|
3951
|
+
var x = 0;
|
|
3952
|
+
var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
|
|
3953
|
+
// can be obscured underneath it.
|
|
3954
|
+
// Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
|
|
3955
|
+
// if it isn't open, so if this isn't available, the popper will be detected
|
|
3956
|
+
// to overflow the bottom of the screen too early.
|
|
3957
|
+
|
|
3958
|
+
if (visualViewport) {
|
|
3959
|
+
width = visualViewport.width;
|
|
3960
|
+
height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
|
|
3961
|
+
// In Chrome, it returns a value very close to 0 (+/-) but contains rounding
|
|
3962
|
+
// errors due to floating point numbers, so we need to check precision.
|
|
3963
|
+
// Safari returns a number <= 0, usually < -1 when pinch-zoomed
|
|
3964
|
+
// Feature detection fails in mobile emulation mode in Chrome.
|
|
3965
|
+
// Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
|
|
3966
|
+
// 0.001
|
|
3967
|
+
// Fallback here: "Not Safari" userAgent
|
|
3968
|
+
|
|
3969
|
+
if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
|
3970
|
+
x = visualViewport.offsetLeft;
|
|
3971
|
+
y = visualViewport.offsetTop;
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
return {
|
|
3976
|
+
width: width,
|
|
3977
|
+
height: height,
|
|
3978
|
+
x: x + getWindowScrollBarX(element),
|
|
3979
|
+
y: y
|
|
3980
|
+
};
|
|
3981
|
+
}
|
|
3982
|
+
|
|
3983
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable
|
|
3984
|
+
|
|
3985
|
+
function getDocumentRect(element) {
|
|
3986
|
+
var _element$ownerDocumen;
|
|
3987
|
+
|
|
3988
|
+
var html = getDocumentElement(element);
|
|
3989
|
+
var winScroll = getWindowScroll(element);
|
|
3990
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
3991
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
3992
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
3993
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
|
3994
|
+
var y = -winScroll.scrollTop;
|
|
3995
|
+
|
|
3996
|
+
if (getComputedStyle(body || html).direction === 'rtl') {
|
|
3997
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
3998
|
+
}
|
|
3999
|
+
|
|
4000
|
+
return {
|
|
4001
|
+
width: width,
|
|
4002
|
+
height: height,
|
|
4003
|
+
x: x,
|
|
4004
|
+
y: y
|
|
4005
|
+
};
|
|
4006
|
+
}
|
|
4007
|
+
|
|
4008
|
+
function isScrollParent(element) {
|
|
4009
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
|
4010
|
+
var _getComputedStyle = getComputedStyle(element),
|
|
4011
|
+
overflow = _getComputedStyle.overflow,
|
|
4012
|
+
overflowX = _getComputedStyle.overflowX,
|
|
4013
|
+
overflowY = _getComputedStyle.overflowY;
|
|
4014
|
+
|
|
4015
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
4016
|
+
}
|
|
4017
|
+
|
|
4018
|
+
function getScrollParent(node) {
|
|
4019
|
+
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
|
|
4020
|
+
// $FlowFixMe[incompatible-return]: assume body is always available
|
|
4021
|
+
return node.ownerDocument.body;
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
|
4025
|
+
return node;
|
|
4026
|
+
}
|
|
4027
|
+
|
|
4028
|
+
return getScrollParent(getParentNode(node));
|
|
4029
|
+
}
|
|
4030
|
+
|
|
4031
|
+
/*
|
|
4032
|
+
given a DOM element, return the list of all scroll parents, up the list of ancesors
|
|
4033
|
+
until we get to the top window object. This list is what we attach scroll listeners
|
|
4034
|
+
to, because if any of these parent elements scroll, we'll need to re-calculate the
|
|
4035
|
+
reference element's position.
|
|
4036
|
+
*/
|
|
4037
|
+
|
|
4038
|
+
function listScrollParents(element, list) {
|
|
4039
|
+
var _element$ownerDocumen;
|
|
4040
|
+
|
|
4041
|
+
if (list === void 0) {
|
|
4042
|
+
list = [];
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
var scrollParent = getScrollParent(element);
|
|
4046
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
|
4047
|
+
var win = getWindow(scrollParent);
|
|
4048
|
+
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
|
4049
|
+
var updatedList = list.concat(target);
|
|
4050
|
+
return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
4051
|
+
updatedList.concat(listScrollParents(getParentNode(target)));
|
|
4052
|
+
}
|
|
4053
|
+
|
|
4054
|
+
function rectToClientRect(rect) {
|
|
4055
|
+
return Object.assign({}, rect, {
|
|
4056
|
+
left: rect.x,
|
|
4057
|
+
top: rect.y,
|
|
4058
|
+
right: rect.x + rect.width,
|
|
4059
|
+
bottom: rect.y + rect.height
|
|
4060
|
+
});
|
|
4061
|
+
}
|
|
4062
|
+
|
|
4063
|
+
function getInnerBoundingClientRect(element) {
|
|
4064
|
+
var rect = getBoundingClientRect(element);
|
|
4065
|
+
rect.top = rect.top + element.clientTop;
|
|
4066
|
+
rect.left = rect.left + element.clientLeft;
|
|
4067
|
+
rect.bottom = rect.top + element.clientHeight;
|
|
4068
|
+
rect.right = rect.left + element.clientWidth;
|
|
4069
|
+
rect.width = element.clientWidth;
|
|
4070
|
+
rect.height = element.clientHeight;
|
|
4071
|
+
rect.x = rect.left;
|
|
4072
|
+
rect.y = rect.top;
|
|
4073
|
+
return rect;
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
function getClientRectFromMixedType(element, clippingParent) {
|
|
4077
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
|
4078
|
+
} // A "clipping parent" is an overflowable container with the characteristic of
|
|
4079
|
+
// clipping (or hiding) overflowing elements with a position different from
|
|
4080
|
+
// `initial`
|
|
4081
|
+
|
|
4082
|
+
|
|
4083
|
+
function getClippingParents(element) {
|
|
4084
|
+
var clippingParents = listScrollParents(getParentNode(element));
|
|
4085
|
+
var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
|
|
4086
|
+
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
|
4087
|
+
|
|
4088
|
+
if (!isElement(clipperElement)) {
|
|
4089
|
+
return [];
|
|
4090
|
+
} // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
|
|
4091
|
+
|
|
4092
|
+
|
|
4093
|
+
return clippingParents.filter(function (clippingParent) {
|
|
4094
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
|
|
4095
|
+
});
|
|
4096
|
+
} // Gets the maximum area that the element is visible in due to any number of
|
|
4097
|
+
// clipping parents
|
|
4098
|
+
|
|
4099
|
+
|
|
4100
|
+
function getClippingRect(element, boundary, rootBoundary) {
|
|
4101
|
+
var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
|
|
4102
|
+
var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
|
|
4103
|
+
var firstClippingParent = clippingParents[0];
|
|
4104
|
+
var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
|
|
4105
|
+
var rect = getClientRectFromMixedType(element, clippingParent);
|
|
4106
|
+
accRect.top = max(rect.top, accRect.top);
|
|
4107
|
+
accRect.right = min(rect.right, accRect.right);
|
|
4108
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
4109
|
+
accRect.left = max(rect.left, accRect.left);
|
|
4110
|
+
return accRect;
|
|
4111
|
+
}, getClientRectFromMixedType(element, firstClippingParent));
|
|
4112
|
+
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
4113
|
+
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
4114
|
+
clippingRect.x = clippingRect.left;
|
|
4115
|
+
clippingRect.y = clippingRect.top;
|
|
4116
|
+
return clippingRect;
|
|
4117
|
+
}
|
|
4118
|
+
|
|
4119
|
+
function computeOffsets(_ref) {
|
|
4120
|
+
var reference = _ref.reference,
|
|
4121
|
+
element = _ref.element,
|
|
4122
|
+
placement = _ref.placement;
|
|
4123
|
+
var basePlacement = placement ? getBasePlacement(placement) : null;
|
|
4124
|
+
var variation = placement ? getVariation(placement) : null;
|
|
4125
|
+
var commonX = reference.x + reference.width / 2 - element.width / 2;
|
|
4126
|
+
var commonY = reference.y + reference.height / 2 - element.height / 2;
|
|
4127
|
+
var offsets;
|
|
4128
|
+
|
|
4129
|
+
switch (basePlacement) {
|
|
4130
|
+
case top:
|
|
4131
|
+
offsets = {
|
|
4132
|
+
x: commonX,
|
|
4133
|
+
y: reference.y - element.height
|
|
4134
|
+
};
|
|
4135
|
+
break;
|
|
4136
|
+
|
|
4137
|
+
case bottom:
|
|
4138
|
+
offsets = {
|
|
4139
|
+
x: commonX,
|
|
4140
|
+
y: reference.y + reference.height
|
|
4141
|
+
};
|
|
4142
|
+
break;
|
|
4143
|
+
|
|
4144
|
+
case right:
|
|
4145
|
+
offsets = {
|
|
4146
|
+
x: reference.x + reference.width,
|
|
4147
|
+
y: commonY
|
|
4148
|
+
};
|
|
4149
|
+
break;
|
|
4150
|
+
|
|
4151
|
+
case left:
|
|
4152
|
+
offsets = {
|
|
4153
|
+
x: reference.x - element.width,
|
|
4154
|
+
y: commonY
|
|
4155
|
+
};
|
|
4156
|
+
break;
|
|
4157
|
+
|
|
4158
|
+
default:
|
|
4159
|
+
offsets = {
|
|
4160
|
+
x: reference.x,
|
|
4161
|
+
y: reference.y
|
|
4162
|
+
};
|
|
4163
|
+
}
|
|
4164
|
+
|
|
4165
|
+
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
|
4166
|
+
|
|
4167
|
+
if (mainAxis != null) {
|
|
4168
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
4169
|
+
|
|
4170
|
+
switch (variation) {
|
|
4171
|
+
case start:
|
|
4172
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
|
|
4173
|
+
break;
|
|
4174
|
+
|
|
4175
|
+
case end:
|
|
4176
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
|
|
4177
|
+
break;
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
|
|
4181
|
+
return offsets;
|
|
4182
|
+
}
|
|
4183
|
+
|
|
4184
|
+
function detectOverflow(state, options) {
|
|
4185
|
+
if (options === void 0) {
|
|
4186
|
+
options = {};
|
|
4187
|
+
}
|
|
4188
|
+
|
|
4189
|
+
var _options = options,
|
|
4190
|
+
_options$placement = _options.placement,
|
|
4191
|
+
placement = _options$placement === void 0 ? state.placement : _options$placement,
|
|
4192
|
+
_options$boundary = _options.boundary,
|
|
4193
|
+
boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
|
|
4194
|
+
_options$rootBoundary = _options.rootBoundary,
|
|
4195
|
+
rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
|
|
4196
|
+
_options$elementConte = _options.elementContext,
|
|
4197
|
+
elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
|
|
4198
|
+
_options$altBoundary = _options.altBoundary,
|
|
4199
|
+
altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
|
|
4200
|
+
_options$padding = _options.padding,
|
|
4201
|
+
padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
4202
|
+
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
4203
|
+
var altContext = elementContext === popper ? reference : popper;
|
|
4204
|
+
var popperRect = state.rects.popper;
|
|
4205
|
+
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
4206
|
+
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
|
4207
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
4208
|
+
var popperOffsets = computeOffsets({
|
|
4209
|
+
reference: referenceClientRect,
|
|
4210
|
+
element: popperRect,
|
|
4211
|
+
strategy: 'absolute',
|
|
4212
|
+
placement: placement
|
|
4213
|
+
});
|
|
4214
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
|
|
4215
|
+
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
|
|
4216
|
+
// 0 or negative = within the clipping rect
|
|
4217
|
+
|
|
4218
|
+
var overflowOffsets = {
|
|
4219
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
4220
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
4221
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
4222
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
4223
|
+
};
|
|
4224
|
+
var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
|
|
4225
|
+
|
|
4226
|
+
if (elementContext === popper && offsetData) {
|
|
4227
|
+
var offset = offsetData[placement];
|
|
4228
|
+
Object.keys(overflowOffsets).forEach(function (key) {
|
|
4229
|
+
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
|
4230
|
+
var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
|
|
4231
|
+
overflowOffsets[key] += offset[axis] * multiply;
|
|
4232
|
+
});
|
|
4233
|
+
}
|
|
4234
|
+
|
|
4235
|
+
return overflowOffsets;
|
|
4236
|
+
}
|
|
4237
|
+
|
|
4238
|
+
function computeAutoPlacement(state, options) {
|
|
4239
|
+
if (options === void 0) {
|
|
4240
|
+
options = {};
|
|
4241
|
+
}
|
|
4242
|
+
|
|
4243
|
+
var _options = options,
|
|
4244
|
+
placement = _options.placement,
|
|
4245
|
+
boundary = _options.boundary,
|
|
4246
|
+
rootBoundary = _options.rootBoundary,
|
|
4247
|
+
padding = _options.padding,
|
|
4248
|
+
flipVariations = _options.flipVariations,
|
|
4249
|
+
_options$allowedAutoP = _options.allowedAutoPlacements,
|
|
4250
|
+
allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
4251
|
+
var variation = getVariation(placement);
|
|
4252
|
+
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
|
|
4253
|
+
return getVariation(placement) === variation;
|
|
4254
|
+
}) : basePlacements;
|
|
4255
|
+
var allowedPlacements = placements$1.filter(function (placement) {
|
|
4256
|
+
return allowedAutoPlacements.indexOf(placement) >= 0;
|
|
4257
|
+
});
|
|
4258
|
+
|
|
4259
|
+
if (allowedPlacements.length === 0) {
|
|
4260
|
+
allowedPlacements = placements$1;
|
|
4261
|
+
} // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
|
|
4262
|
+
|
|
4263
|
+
|
|
4264
|
+
var overflows = allowedPlacements.reduce(function (acc, placement) {
|
|
4265
|
+
acc[placement] = detectOverflow(state, {
|
|
4266
|
+
placement: placement,
|
|
4267
|
+
boundary: boundary,
|
|
4268
|
+
rootBoundary: rootBoundary,
|
|
4269
|
+
padding: padding
|
|
4270
|
+
})[getBasePlacement(placement)];
|
|
4271
|
+
return acc;
|
|
4272
|
+
}, {});
|
|
4273
|
+
return Object.keys(overflows).sort(function (a, b) {
|
|
4274
|
+
return overflows[a] - overflows[b];
|
|
4275
|
+
});
|
|
4276
|
+
}
|
|
4277
|
+
|
|
4278
|
+
function getExpandedFallbackPlacements(placement) {
|
|
4279
|
+
if (getBasePlacement(placement) === auto) {
|
|
4280
|
+
return [];
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
var oppositePlacement = getOppositePlacement(placement);
|
|
4284
|
+
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
function flip(_ref) {
|
|
4288
|
+
var state = _ref.state,
|
|
4289
|
+
options = _ref.options,
|
|
4290
|
+
name = _ref.name;
|
|
4291
|
+
|
|
4292
|
+
if (state.modifiersData[name]._skip) {
|
|
4293
|
+
return;
|
|
4294
|
+
}
|
|
4295
|
+
|
|
4296
|
+
var _options$mainAxis = options.mainAxis,
|
|
4297
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
4298
|
+
_options$altAxis = options.altAxis,
|
|
4299
|
+
checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
|
|
4300
|
+
specifiedFallbackPlacements = options.fallbackPlacements,
|
|
4301
|
+
padding = options.padding,
|
|
4302
|
+
boundary = options.boundary,
|
|
4303
|
+
rootBoundary = options.rootBoundary,
|
|
4304
|
+
altBoundary = options.altBoundary,
|
|
4305
|
+
_options$flipVariatio = options.flipVariations,
|
|
4306
|
+
flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
|
|
4307
|
+
allowedAutoPlacements = options.allowedAutoPlacements;
|
|
4308
|
+
var preferredPlacement = state.options.placement;
|
|
4309
|
+
var basePlacement = getBasePlacement(preferredPlacement);
|
|
4310
|
+
var isBasePlacement = basePlacement === preferredPlacement;
|
|
4311
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
4312
|
+
var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
|
|
4313
|
+
return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
|
|
4314
|
+
placement: placement,
|
|
4315
|
+
boundary: boundary,
|
|
4316
|
+
rootBoundary: rootBoundary,
|
|
4317
|
+
padding: padding,
|
|
4318
|
+
flipVariations: flipVariations,
|
|
4319
|
+
allowedAutoPlacements: allowedAutoPlacements
|
|
4320
|
+
}) : placement);
|
|
4321
|
+
}, []);
|
|
4322
|
+
var referenceRect = state.rects.reference;
|
|
4323
|
+
var popperRect = state.rects.popper;
|
|
4324
|
+
var checksMap = new Map();
|
|
4325
|
+
var makeFallbackChecks = true;
|
|
4326
|
+
var firstFittingPlacement = placements[0];
|
|
4327
|
+
|
|
4328
|
+
for (var i = 0; i < placements.length; i++) {
|
|
4329
|
+
var placement = placements[i];
|
|
4330
|
+
|
|
4331
|
+
var _basePlacement = getBasePlacement(placement);
|
|
4332
|
+
|
|
4333
|
+
var isStartVariation = getVariation(placement) === start;
|
|
4334
|
+
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
|
4335
|
+
var len = isVertical ? 'width' : 'height';
|
|
4336
|
+
var overflow = detectOverflow(state, {
|
|
4337
|
+
placement: placement,
|
|
4338
|
+
boundary: boundary,
|
|
4339
|
+
rootBoundary: rootBoundary,
|
|
4340
|
+
altBoundary: altBoundary,
|
|
4341
|
+
padding: padding
|
|
4342
|
+
});
|
|
4343
|
+
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
4344
|
+
|
|
4345
|
+
if (referenceRect[len] > popperRect[len]) {
|
|
4346
|
+
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
4347
|
+
}
|
|
4348
|
+
|
|
4349
|
+
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
4350
|
+
var checks = [];
|
|
4351
|
+
|
|
4352
|
+
if (checkMainAxis) {
|
|
4353
|
+
checks.push(overflow[_basePlacement] <= 0);
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4356
|
+
if (checkAltAxis) {
|
|
4357
|
+
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
if (checks.every(function (check) {
|
|
4361
|
+
return check;
|
|
4362
|
+
})) {
|
|
4363
|
+
firstFittingPlacement = placement;
|
|
4364
|
+
makeFallbackChecks = false;
|
|
4365
|
+
break;
|
|
4366
|
+
}
|
|
4367
|
+
|
|
4368
|
+
checksMap.set(placement, checks);
|
|
4369
|
+
}
|
|
4370
|
+
|
|
4371
|
+
if (makeFallbackChecks) {
|
|
4372
|
+
// `2` may be desired in some cases – research later
|
|
4373
|
+
var numberOfChecks = flipVariations ? 3 : 1;
|
|
4374
|
+
|
|
4375
|
+
var _loop = function _loop(_i) {
|
|
4376
|
+
var fittingPlacement = placements.find(function (placement) {
|
|
4377
|
+
var checks = checksMap.get(placement);
|
|
4378
|
+
|
|
4379
|
+
if (checks) {
|
|
4380
|
+
return checks.slice(0, _i).every(function (check) {
|
|
4381
|
+
return check;
|
|
4382
|
+
});
|
|
4383
|
+
}
|
|
4384
|
+
});
|
|
4385
|
+
|
|
4386
|
+
if (fittingPlacement) {
|
|
4387
|
+
firstFittingPlacement = fittingPlacement;
|
|
4388
|
+
return "break";
|
|
4389
|
+
}
|
|
4390
|
+
};
|
|
4391
|
+
|
|
4392
|
+
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
4393
|
+
var _ret = _loop(_i);
|
|
4394
|
+
|
|
4395
|
+
if (_ret === "break") break;
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
|
|
4399
|
+
if (state.placement !== firstFittingPlacement) {
|
|
4400
|
+
state.modifiersData[name]._skip = true;
|
|
4401
|
+
state.placement = firstFittingPlacement;
|
|
4402
|
+
state.reset = true;
|
|
4403
|
+
}
|
|
4404
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
4405
|
+
|
|
4406
|
+
|
|
4407
|
+
const flip$1 = {
|
|
4408
|
+
name: 'flip',
|
|
4409
|
+
enabled: true,
|
|
4410
|
+
phase: 'main',
|
|
4411
|
+
fn: flip,
|
|
4412
|
+
requiresIfExists: ['offset'],
|
|
4413
|
+
data: {
|
|
4414
|
+
_skip: false
|
|
4415
|
+
}
|
|
4416
|
+
};
|
|
4417
|
+
|
|
4418
|
+
function getSideOffsets(overflow, rect, preventedOffsets) {
|
|
4419
|
+
if (preventedOffsets === void 0) {
|
|
4420
|
+
preventedOffsets = {
|
|
4421
|
+
x: 0,
|
|
4422
|
+
y: 0
|
|
4423
|
+
};
|
|
4424
|
+
}
|
|
4425
|
+
|
|
4426
|
+
return {
|
|
4427
|
+
top: overflow.top - rect.height - preventedOffsets.y,
|
|
4428
|
+
right: overflow.right - rect.width + preventedOffsets.x,
|
|
4429
|
+
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
|
4430
|
+
left: overflow.left - rect.width - preventedOffsets.x
|
|
4431
|
+
};
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
function isAnySideFullyClipped(overflow) {
|
|
4435
|
+
return [top, right, bottom, left].some(function (side) {
|
|
4436
|
+
return overflow[side] >= 0;
|
|
4437
|
+
});
|
|
4438
|
+
}
|
|
4439
|
+
|
|
4440
|
+
function hide(_ref) {
|
|
4441
|
+
var state = _ref.state,
|
|
4442
|
+
name = _ref.name;
|
|
4443
|
+
var referenceRect = state.rects.reference;
|
|
4444
|
+
var popperRect = state.rects.popper;
|
|
4445
|
+
var preventedOffsets = state.modifiersData.preventOverflow;
|
|
4446
|
+
var referenceOverflow = detectOverflow(state, {
|
|
4447
|
+
elementContext: 'reference'
|
|
4448
|
+
});
|
|
4449
|
+
var popperAltOverflow = detectOverflow(state, {
|
|
4450
|
+
altBoundary: true
|
|
4451
|
+
});
|
|
4452
|
+
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
|
4453
|
+
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
|
4454
|
+
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
|
4455
|
+
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
|
4456
|
+
state.modifiersData[name] = {
|
|
4457
|
+
referenceClippingOffsets: referenceClippingOffsets,
|
|
4458
|
+
popperEscapeOffsets: popperEscapeOffsets,
|
|
4459
|
+
isReferenceHidden: isReferenceHidden,
|
|
4460
|
+
hasPopperEscaped: hasPopperEscaped
|
|
4461
|
+
};
|
|
4462
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
|
4463
|
+
'data-popper-reference-hidden': isReferenceHidden,
|
|
4464
|
+
'data-popper-escaped': hasPopperEscaped
|
|
4465
|
+
});
|
|
4466
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
4467
|
+
|
|
4468
|
+
|
|
4469
|
+
const hide$1 = {
|
|
4470
|
+
name: 'hide',
|
|
4471
|
+
enabled: true,
|
|
4472
|
+
phase: 'main',
|
|
4473
|
+
requiresIfExists: ['preventOverflow'],
|
|
4474
|
+
fn: hide
|
|
4475
|
+
};
|
|
4476
|
+
|
|
4477
|
+
function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
4478
|
+
var basePlacement = getBasePlacement(placement);
|
|
4479
|
+
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
|
4480
|
+
|
|
4481
|
+
var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
|
|
4482
|
+
placement: placement
|
|
4483
|
+
})) : offset,
|
|
4484
|
+
skidding = _ref[0],
|
|
4485
|
+
distance = _ref[1];
|
|
4486
|
+
|
|
4487
|
+
skidding = skidding || 0;
|
|
4488
|
+
distance = (distance || 0) * invertDistance;
|
|
4489
|
+
return [left, right].indexOf(basePlacement) >= 0 ? {
|
|
4490
|
+
x: distance,
|
|
4491
|
+
y: skidding
|
|
4492
|
+
} : {
|
|
4493
|
+
x: skidding,
|
|
4494
|
+
y: distance
|
|
4495
|
+
};
|
|
4496
|
+
}
|
|
4497
|
+
|
|
4498
|
+
function offset(_ref2) {
|
|
4499
|
+
var state = _ref2.state,
|
|
4500
|
+
options = _ref2.options,
|
|
4501
|
+
name = _ref2.name;
|
|
4502
|
+
var _options$offset = options.offset,
|
|
4503
|
+
offset = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
4504
|
+
var data = placements.reduce(function (acc, placement) {
|
|
4505
|
+
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
|
|
4506
|
+
return acc;
|
|
4507
|
+
}, {});
|
|
4508
|
+
var _data$state$placement = data[state.placement],
|
|
4509
|
+
x = _data$state$placement.x,
|
|
4510
|
+
y = _data$state$placement.y;
|
|
4511
|
+
|
|
4512
|
+
if (state.modifiersData.popperOffsets != null) {
|
|
4513
|
+
state.modifiersData.popperOffsets.x += x;
|
|
4514
|
+
state.modifiersData.popperOffsets.y += y;
|
|
4515
|
+
}
|
|
4516
|
+
|
|
4517
|
+
state.modifiersData[name] = data;
|
|
4518
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
4519
|
+
|
|
4520
|
+
|
|
4521
|
+
const offset$1 = {
|
|
4522
|
+
name: 'offset',
|
|
4523
|
+
enabled: true,
|
|
4524
|
+
phase: 'main',
|
|
4525
|
+
requires: ['popperOffsets'],
|
|
4526
|
+
fn: offset
|
|
4527
|
+
};
|
|
4528
|
+
|
|
4529
|
+
function popperOffsets(_ref) {
|
|
4530
|
+
var state = _ref.state,
|
|
4531
|
+
name = _ref.name;
|
|
4532
|
+
// Offsets are the actual position the popper needs to have to be
|
|
4533
|
+
// properly positioned near its reference element
|
|
4534
|
+
// This is the most basic placement, and will be adjusted by
|
|
4535
|
+
// the modifiers in the next step
|
|
4536
|
+
state.modifiersData[name] = computeOffsets({
|
|
4537
|
+
reference: state.rects.reference,
|
|
4538
|
+
element: state.rects.popper,
|
|
4539
|
+
strategy: 'absolute',
|
|
4540
|
+
placement: state.placement
|
|
4541
|
+
});
|
|
4542
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
4543
|
+
|
|
4544
|
+
|
|
4545
|
+
const popperOffsets$1 = {
|
|
4546
|
+
name: 'popperOffsets',
|
|
4547
|
+
enabled: true,
|
|
4548
|
+
phase: 'read',
|
|
4549
|
+
fn: popperOffsets,
|
|
4550
|
+
data: {}
|
|
4551
|
+
};
|
|
4552
|
+
|
|
4553
|
+
function getAltAxis(axis) {
|
|
4554
|
+
return axis === 'x' ? 'y' : 'x';
|
|
4555
|
+
}
|
|
4556
|
+
|
|
4557
|
+
function preventOverflow(_ref) {
|
|
4558
|
+
var state = _ref.state,
|
|
4559
|
+
options = _ref.options,
|
|
4560
|
+
name = _ref.name;
|
|
4561
|
+
var _options$mainAxis = options.mainAxis,
|
|
4562
|
+
checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
|
|
4563
|
+
_options$altAxis = options.altAxis,
|
|
4564
|
+
checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
|
|
4565
|
+
boundary = options.boundary,
|
|
4566
|
+
rootBoundary = options.rootBoundary,
|
|
4567
|
+
altBoundary = options.altBoundary,
|
|
4568
|
+
padding = options.padding,
|
|
4569
|
+
_options$tether = options.tether,
|
|
4570
|
+
tether = _options$tether === void 0 ? true : _options$tether,
|
|
4571
|
+
_options$tetherOffset = options.tetherOffset,
|
|
4572
|
+
tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
|
4573
|
+
var overflow = detectOverflow(state, {
|
|
4574
|
+
boundary: boundary,
|
|
4575
|
+
rootBoundary: rootBoundary,
|
|
4576
|
+
padding: padding,
|
|
4577
|
+
altBoundary: altBoundary
|
|
4578
|
+
});
|
|
4579
|
+
var basePlacement = getBasePlacement(state.placement);
|
|
4580
|
+
var variation = getVariation(state.placement);
|
|
4581
|
+
var isBasePlacement = !variation;
|
|
4582
|
+
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
|
4583
|
+
var altAxis = getAltAxis(mainAxis);
|
|
4584
|
+
var popperOffsets = state.modifiersData.popperOffsets;
|
|
4585
|
+
var referenceRect = state.rects.reference;
|
|
4586
|
+
var popperRect = state.rects.popper;
|
|
4587
|
+
var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
|
|
4588
|
+
placement: state.placement
|
|
4589
|
+
})) : tetherOffset;
|
|
4590
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
|
|
4591
|
+
mainAxis: tetherOffsetValue,
|
|
4592
|
+
altAxis: tetherOffsetValue
|
|
4593
|
+
} : Object.assign({
|
|
4594
|
+
mainAxis: 0,
|
|
4595
|
+
altAxis: 0
|
|
4596
|
+
}, tetherOffsetValue);
|
|
4597
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
|
4598
|
+
var data = {
|
|
4599
|
+
x: 0,
|
|
4600
|
+
y: 0
|
|
4601
|
+
};
|
|
4602
|
+
|
|
4603
|
+
if (!popperOffsets) {
|
|
4604
|
+
return;
|
|
4605
|
+
}
|
|
4606
|
+
|
|
4607
|
+
if (checkMainAxis) {
|
|
4608
|
+
var _offsetModifierState$;
|
|
4609
|
+
|
|
4610
|
+
var mainSide = mainAxis === 'y' ? top : left;
|
|
4611
|
+
var altSide = mainAxis === 'y' ? bottom : right;
|
|
4612
|
+
var len = mainAxis === 'y' ? 'height' : 'width';
|
|
4613
|
+
var offset = popperOffsets[mainAxis];
|
|
4614
|
+
var min$1 = offset + overflow[mainSide];
|
|
4615
|
+
var max$1 = offset - overflow[altSide];
|
|
4616
|
+
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
4617
|
+
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
4618
|
+
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
|
|
4619
|
+
// outside the reference bounds
|
|
4620
|
+
|
|
4621
|
+
var arrowElement = state.elements.arrow;
|
|
4622
|
+
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
|
4623
|
+
width: 0,
|
|
4624
|
+
height: 0
|
|
4625
|
+
};
|
|
4626
|
+
var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
|
|
4627
|
+
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
|
4628
|
+
var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
|
|
4629
|
+
// to include its full size in the calculation. If the reference is small
|
|
4630
|
+
// and near the edge of a boundary, the popper can overflow even if the
|
|
4631
|
+
// reference is not overflowing as well (e.g. virtual elements with no
|
|
4632
|
+
// width or height)
|
|
4633
|
+
|
|
4634
|
+
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
|
4635
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
|
4636
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
|
4637
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
|
4638
|
+
var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
|
4639
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
4640
|
+
var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
|
|
4641
|
+
var tetherMax = offset + maxOffset - offsetModifierValue;
|
|
4642
|
+
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
|
|
4643
|
+
popperOffsets[mainAxis] = preventedOffset;
|
|
4644
|
+
data[mainAxis] = preventedOffset - offset;
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4647
|
+
if (checkAltAxis) {
|
|
4648
|
+
var _offsetModifierState$2;
|
|
4649
|
+
|
|
4650
|
+
var _mainSide = mainAxis === 'x' ? top : left;
|
|
4651
|
+
|
|
4652
|
+
var _altSide = mainAxis === 'x' ? bottom : right;
|
|
4653
|
+
|
|
4654
|
+
var _offset = popperOffsets[altAxis];
|
|
4655
|
+
|
|
4656
|
+
var _len = altAxis === 'y' ? 'height' : 'width';
|
|
4657
|
+
|
|
4658
|
+
var _min = _offset + overflow[_mainSide];
|
|
4659
|
+
|
|
4660
|
+
var _max = _offset - overflow[_altSide];
|
|
4661
|
+
|
|
4662
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
|
4663
|
+
|
|
4664
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
|
4665
|
+
|
|
4666
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
|
4667
|
+
|
|
4668
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
|
4669
|
+
|
|
4670
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
|
4671
|
+
|
|
4672
|
+
popperOffsets[altAxis] = _preventedOffset;
|
|
4673
|
+
data[altAxis] = _preventedOffset - _offset;
|
|
4674
|
+
}
|
|
4675
|
+
|
|
4676
|
+
state.modifiersData[name] = data;
|
|
4677
|
+
} // eslint-disable-next-line import/no-unused-modules
|
|
4678
|
+
|
|
4679
|
+
|
|
4680
|
+
const preventOverflow$1 = {
|
|
4681
|
+
name: 'preventOverflow',
|
|
4682
|
+
enabled: true,
|
|
4683
|
+
phase: 'main',
|
|
4684
|
+
fn: preventOverflow,
|
|
4685
|
+
requiresIfExists: ['offset']
|
|
4686
|
+
};
|
|
4687
|
+
|
|
4688
|
+
function getHTMLElementScroll(element) {
|
|
4689
|
+
return {
|
|
4690
|
+
scrollLeft: element.scrollLeft,
|
|
4691
|
+
scrollTop: element.scrollTop
|
|
4692
|
+
};
|
|
4693
|
+
}
|
|
4694
|
+
|
|
4695
|
+
function getNodeScroll(node) {
|
|
4696
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
|
4697
|
+
return getWindowScroll(node);
|
|
4698
|
+
} else {
|
|
4699
|
+
return getHTMLElementScroll(node);
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
|
|
4703
|
+
function isElementScaled(element) {
|
|
4704
|
+
var rect = element.getBoundingClientRect();
|
|
4705
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
|
4706
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
|
4707
|
+
return scaleX !== 1 || scaleY !== 1;
|
|
4708
|
+
} // Returns the composite rect of an element relative to its offsetParent.
|
|
4709
|
+
// Composite means it takes into account transforms as well as layout.
|
|
4710
|
+
|
|
4711
|
+
|
|
4712
|
+
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
4713
|
+
if (isFixed === void 0) {
|
|
4714
|
+
isFixed = false;
|
|
4715
|
+
}
|
|
4716
|
+
|
|
4717
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
4718
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
4719
|
+
var documentElement = getDocumentElement(offsetParent);
|
|
4720
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
|
4721
|
+
var scroll = {
|
|
4722
|
+
scrollLeft: 0,
|
|
4723
|
+
scrollTop: 0
|
|
4724
|
+
};
|
|
4725
|
+
var offsets = {
|
|
4726
|
+
x: 0,
|
|
4727
|
+
y: 0
|
|
4728
|
+
};
|
|
4729
|
+
|
|
4730
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
4731
|
+
if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
|
|
4732
|
+
isScrollParent(documentElement)) {
|
|
4733
|
+
scroll = getNodeScroll(offsetParent);
|
|
4734
|
+
}
|
|
4735
|
+
|
|
4736
|
+
if (isHTMLElement(offsetParent)) {
|
|
4737
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
|
4738
|
+
offsets.x += offsetParent.clientLeft;
|
|
4739
|
+
offsets.y += offsetParent.clientTop;
|
|
4740
|
+
} else if (documentElement) {
|
|
4741
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
4742
|
+
}
|
|
4743
|
+
}
|
|
4744
|
+
|
|
4745
|
+
return {
|
|
4746
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
4747
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
4748
|
+
width: rect.width,
|
|
4749
|
+
height: rect.height
|
|
4750
|
+
};
|
|
4751
|
+
}
|
|
4752
|
+
|
|
4753
|
+
function order(modifiers) {
|
|
4754
|
+
var map = new Map();
|
|
4755
|
+
var visited = new Set();
|
|
4756
|
+
var result = [];
|
|
4757
|
+
modifiers.forEach(function (modifier) {
|
|
4758
|
+
map.set(modifier.name, modifier);
|
|
4759
|
+
}); // On visiting object, check for its dependencies and visit them recursively
|
|
4760
|
+
|
|
4761
|
+
function sort(modifier) {
|
|
4762
|
+
visited.add(modifier.name);
|
|
4763
|
+
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
|
4764
|
+
requires.forEach(function (dep) {
|
|
4765
|
+
if (!visited.has(dep)) {
|
|
4766
|
+
var depModifier = map.get(dep);
|
|
4767
|
+
|
|
4768
|
+
if (depModifier) {
|
|
4769
|
+
sort(depModifier);
|
|
4770
|
+
}
|
|
4771
|
+
}
|
|
4772
|
+
});
|
|
4773
|
+
result.push(modifier);
|
|
4774
|
+
}
|
|
4775
|
+
|
|
4776
|
+
modifiers.forEach(function (modifier) {
|
|
4777
|
+
if (!visited.has(modifier.name)) {
|
|
4778
|
+
// check for visited object
|
|
4779
|
+
sort(modifier);
|
|
4780
|
+
}
|
|
4781
|
+
});
|
|
4782
|
+
return result;
|
|
4783
|
+
}
|
|
4784
|
+
|
|
4785
|
+
function orderModifiers(modifiers) {
|
|
4786
|
+
// order based on dependencies
|
|
4787
|
+
var orderedModifiers = order(modifiers); // order based on phase
|
|
4788
|
+
|
|
4789
|
+
return modifierPhases.reduce(function (acc, phase) {
|
|
4790
|
+
return acc.concat(orderedModifiers.filter(function (modifier) {
|
|
4791
|
+
return modifier.phase === phase;
|
|
4792
|
+
}));
|
|
4793
|
+
}, []);
|
|
4794
|
+
}
|
|
4795
|
+
|
|
4796
|
+
function debounce(fn) {
|
|
4797
|
+
var pending;
|
|
4798
|
+
return function () {
|
|
4799
|
+
if (!pending) {
|
|
4800
|
+
pending = new Promise(function (resolve) {
|
|
4801
|
+
Promise.resolve().then(function () {
|
|
4802
|
+
pending = undefined;
|
|
4803
|
+
resolve(fn());
|
|
4804
|
+
});
|
|
4805
|
+
});
|
|
4806
|
+
}
|
|
4807
|
+
|
|
4808
|
+
return pending;
|
|
4809
|
+
};
|
|
4810
|
+
}
|
|
4811
|
+
|
|
4812
|
+
function mergeByName(modifiers) {
|
|
4813
|
+
var merged = modifiers.reduce(function (merged, current) {
|
|
4814
|
+
var existing = merged[current.name];
|
|
4815
|
+
merged[current.name] = existing ? Object.assign({}, existing, current, {
|
|
4816
|
+
options: Object.assign({}, existing.options, current.options),
|
|
4817
|
+
data: Object.assign({}, existing.data, current.data)
|
|
4818
|
+
}) : current;
|
|
4819
|
+
return merged;
|
|
4820
|
+
}, {}); // IE11 does not support Object.values
|
|
4821
|
+
|
|
4822
|
+
return Object.keys(merged).map(function (key) {
|
|
4823
|
+
return merged[key];
|
|
4824
|
+
});
|
|
4825
|
+
}
|
|
4826
|
+
|
|
4827
|
+
var DEFAULT_OPTIONS = {
|
|
4828
|
+
placement: 'bottom',
|
|
4829
|
+
modifiers: [],
|
|
4830
|
+
strategy: 'absolute'
|
|
4831
|
+
};
|
|
4832
|
+
|
|
4833
|
+
function areValidElements() {
|
|
4834
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4835
|
+
args[_key] = arguments[_key];
|
|
4836
|
+
}
|
|
4837
|
+
|
|
4838
|
+
return !args.some(function (element) {
|
|
4839
|
+
return !(element && typeof element.getBoundingClientRect === 'function');
|
|
4840
|
+
});
|
|
4841
|
+
}
|
|
4842
|
+
|
|
4843
|
+
function popperGenerator(generatorOptions) {
|
|
4844
|
+
if (generatorOptions === void 0) {
|
|
4845
|
+
generatorOptions = {};
|
|
4846
|
+
}
|
|
4847
|
+
|
|
4848
|
+
var _generatorOptions = generatorOptions,
|
|
4849
|
+
_generatorOptions$def = _generatorOptions.defaultModifiers,
|
|
4850
|
+
defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
|
|
4851
|
+
_generatorOptions$def2 = _generatorOptions.defaultOptions,
|
|
4852
|
+
defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
|
4853
|
+
return function createPopper(reference, popper, options) {
|
|
4854
|
+
if (options === void 0) {
|
|
4855
|
+
options = defaultOptions;
|
|
4856
|
+
}
|
|
4857
|
+
|
|
4858
|
+
var state = {
|
|
4859
|
+
placement: 'bottom',
|
|
4860
|
+
orderedModifiers: [],
|
|
4861
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
|
4862
|
+
modifiersData: {},
|
|
4863
|
+
elements: {
|
|
4864
|
+
reference: reference,
|
|
4865
|
+
popper: popper
|
|
4866
|
+
},
|
|
4867
|
+
attributes: {},
|
|
4868
|
+
styles: {}
|
|
4869
|
+
};
|
|
4870
|
+
var effectCleanupFns = [];
|
|
4871
|
+
var isDestroyed = false;
|
|
4872
|
+
var instance = {
|
|
4873
|
+
state: state,
|
|
4874
|
+
setOptions: function setOptions(setOptionsAction) {
|
|
4875
|
+
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
|
4876
|
+
cleanupModifierEffects();
|
|
4877
|
+
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
4878
|
+
state.scrollParents = {
|
|
4879
|
+
reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
|
|
4880
|
+
popper: listScrollParents(popper)
|
|
4881
|
+
}; // Orders the modifiers based on their dependencies and `phase`
|
|
4882
|
+
// properties
|
|
4883
|
+
|
|
4884
|
+
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
|
|
4885
|
+
|
|
4886
|
+
state.orderedModifiers = orderedModifiers.filter(function (m) {
|
|
4887
|
+
return m.enabled;
|
|
4888
|
+
}); // Validate the provided modifiers so that the consumer will get warned
|
|
4889
|
+
|
|
4890
|
+
runModifierEffects();
|
|
4891
|
+
return instance.update();
|
|
4892
|
+
},
|
|
4893
|
+
// Sync update – it will always be executed, even if not necessary. This
|
|
4894
|
+
// is useful for low frequency updates where sync behavior simplifies the
|
|
4895
|
+
// logic.
|
|
4896
|
+
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
4897
|
+
// prefer the async Popper#update method
|
|
4898
|
+
forceUpdate: function forceUpdate() {
|
|
4899
|
+
if (isDestroyed) {
|
|
4900
|
+
return;
|
|
4901
|
+
}
|
|
4902
|
+
|
|
4903
|
+
var _state$elements = state.elements,
|
|
4904
|
+
reference = _state$elements.reference,
|
|
4905
|
+
popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
|
|
4906
|
+
// anymore
|
|
4907
|
+
|
|
4908
|
+
if (!areValidElements(reference, popper)) {
|
|
4909
|
+
|
|
4910
|
+
return;
|
|
4911
|
+
} // Store the reference and popper rects to be read by modifiers
|
|
4912
|
+
|
|
4913
|
+
|
|
4914
|
+
state.rects = {
|
|
4915
|
+
reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
|
|
4916
|
+
popper: getLayoutRect(popper)
|
|
4917
|
+
}; // Modifiers have the ability to reset the current update cycle. The
|
|
4918
|
+
// most common use case for this is the `flip` modifier changing the
|
|
4919
|
+
// placement, which then needs to re-run all the modifiers, because the
|
|
4920
|
+
// logic was previously ran for the previous placement and is therefore
|
|
4921
|
+
// stale/incorrect
|
|
4922
|
+
|
|
4923
|
+
state.reset = false;
|
|
4924
|
+
state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
|
|
4925
|
+
// is filled with the initial data specified by the modifier. This means
|
|
4926
|
+
// it doesn't persist and is fresh on each update.
|
|
4927
|
+
// To ensure persistent data, use `${name}#persistent`
|
|
4928
|
+
|
|
4929
|
+
state.orderedModifiers.forEach(function (modifier) {
|
|
4930
|
+
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
4931
|
+
});
|
|
4932
|
+
|
|
4933
|
+
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
|
4934
|
+
|
|
4935
|
+
if (state.reset === true) {
|
|
4936
|
+
state.reset = false;
|
|
4937
|
+
index = -1;
|
|
4938
|
+
continue;
|
|
4939
|
+
}
|
|
4940
|
+
|
|
4941
|
+
var _state$orderedModifie = state.orderedModifiers[index],
|
|
4942
|
+
fn = _state$orderedModifie.fn,
|
|
4943
|
+
_state$orderedModifie2 = _state$orderedModifie.options,
|
|
4944
|
+
_options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
|
4945
|
+
name = _state$orderedModifie.name;
|
|
4946
|
+
|
|
4947
|
+
if (typeof fn === 'function') {
|
|
4948
|
+
state = fn({
|
|
4949
|
+
state: state,
|
|
4950
|
+
options: _options,
|
|
4951
|
+
name: name,
|
|
4952
|
+
instance: instance
|
|
4953
|
+
}) || state;
|
|
4954
|
+
}
|
|
4955
|
+
}
|
|
4956
|
+
},
|
|
4957
|
+
// Async and optimistically optimized update – it will not be executed if
|
|
4958
|
+
// not necessary (debounced to run at most once-per-tick)
|
|
4959
|
+
update: debounce(function () {
|
|
4960
|
+
return new Promise(function (resolve) {
|
|
4961
|
+
instance.forceUpdate();
|
|
4962
|
+
resolve(state);
|
|
4963
|
+
});
|
|
4964
|
+
}),
|
|
4965
|
+
destroy: function destroy() {
|
|
4966
|
+
cleanupModifierEffects();
|
|
4967
|
+
isDestroyed = true;
|
|
4968
|
+
}
|
|
4969
|
+
};
|
|
4970
|
+
|
|
4971
|
+
if (!areValidElements(reference, popper)) {
|
|
4972
|
+
|
|
4973
|
+
return instance;
|
|
4974
|
+
}
|
|
4975
|
+
|
|
4976
|
+
instance.setOptions(options).then(function (state) {
|
|
4977
|
+
if (!isDestroyed && options.onFirstUpdate) {
|
|
4978
|
+
options.onFirstUpdate(state);
|
|
4979
|
+
}
|
|
4980
|
+
}); // Modifiers have the ability to execute arbitrary code before the first
|
|
4981
|
+
// update cycle runs. They will be executed in the same order as the update
|
|
4982
|
+
// cycle. This is useful when a modifier adds some persistent data that
|
|
4983
|
+
// other modifiers need to use, but the modifier is run after the dependent
|
|
4984
|
+
// one.
|
|
4985
|
+
|
|
4986
|
+
function runModifierEffects() {
|
|
4987
|
+
state.orderedModifiers.forEach(function (_ref3) {
|
|
4988
|
+
var name = _ref3.name,
|
|
4989
|
+
_ref3$options = _ref3.options,
|
|
4990
|
+
options = _ref3$options === void 0 ? {} : _ref3$options,
|
|
4991
|
+
effect = _ref3.effect;
|
|
4992
|
+
|
|
4993
|
+
if (typeof effect === 'function') {
|
|
4994
|
+
var cleanupFn = effect({
|
|
4995
|
+
state: state,
|
|
4996
|
+
name: name,
|
|
4997
|
+
instance: instance,
|
|
4998
|
+
options: options
|
|
4999
|
+
});
|
|
5000
|
+
|
|
5001
|
+
var noopFn = function noopFn() {};
|
|
5002
|
+
|
|
5003
|
+
effectCleanupFns.push(cleanupFn || noopFn);
|
|
5004
|
+
}
|
|
5005
|
+
});
|
|
5006
|
+
}
|
|
5007
|
+
|
|
5008
|
+
function cleanupModifierEffects() {
|
|
5009
|
+
effectCleanupFns.forEach(function (fn) {
|
|
5010
|
+
return fn();
|
|
5011
|
+
});
|
|
5012
|
+
effectCleanupFns = [];
|
|
5013
|
+
}
|
|
5014
|
+
|
|
5015
|
+
return instance;
|
|
5016
|
+
};
|
|
5017
|
+
}
|
|
5018
|
+
|
|
5019
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
5020
|
+
var createPopper = /*#__PURE__*/popperGenerator({
|
|
5021
|
+
defaultModifiers: defaultModifiers
|
|
5022
|
+
}); // eslint-disable-next-line import/no-unused-modules
|
|
5023
|
+
|
|
5024
|
+
const mgPopoverCss = "mg-popover.sc-mg-popover{display:contents}mg-popover.sc-mg-popover-s>*{display:inline-block}.mg-popover.sc-mg-popover{display:none;padding:1.5rem;z-index:9999;border-radius:0.5rem;background-color:hsl(var(--mg-popover-background-color));box-shadow:var(--box-shadow);color:hsl(var(--mg-popover-font-color))}.mg-popover[data-show].sc-mg-popover{display:block}.mg-popover.sc-mg-popover mg-button.sc-mg-popover{float:right;margin-right:calc(0rem - (var(--default-size) - var(--mg-icon-regular-size)) / 2);margin-top:calc(0rem - (var(--default-size) - var(--mg-popover-title-font-size) * var(--line-height)) / 2);margin-left:3rem}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover,.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{position:absolute;width:2rem;height:2rem;z-index:-1;background:inherit}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover{visibility:hidden}.mg-popover.sc-mg-popover .mg-popover__arrow.sc-mg-popover::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-popover[data-popper-placement^=top].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{bottom:-6px}.mg-popover[data-popper-placement^=bottom].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{top:-6px}.mg-popover[data-popper-placement^=left].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{right:-6px}.mg-popover[data-popper-placement^=right].sc-mg-popover>.mg-popover__arrow.sc-mg-popover{left:-6px}.mg-popover__title.sc-mg-popover-s>[slot=title],.mg-popover__title .sc-mg-popover-s>[slot=title]{margin:0 0 1rem;font-size:var(--mg-popover-title-font-size);font-weight:600}";
|
|
5025
|
+
|
|
5026
|
+
const MgPopover = class {
|
|
5027
|
+
constructor(hostRef) {
|
|
5028
|
+
registerInstance(this, hostRef);
|
|
5029
|
+
this.displayChange = createEvent(this, "display-change", 7);
|
|
5030
|
+
this.closeButtonId = '';
|
|
5031
|
+
/**
|
|
5032
|
+
* Sets an `id` attribute.
|
|
5033
|
+
* Needed by the input for accessibility `aria-decribedby`.
|
|
5034
|
+
*/
|
|
5035
|
+
this.identifier = createID('mg-popover');
|
|
5036
|
+
/**
|
|
5037
|
+
* Popover placement
|
|
5038
|
+
*/
|
|
5039
|
+
this.placement = 'bottom';
|
|
5040
|
+
/**
|
|
5041
|
+
* Define if popover has a cross button
|
|
5042
|
+
*/
|
|
5043
|
+
this.closeButton = false;
|
|
5044
|
+
/**
|
|
5045
|
+
* Display popover
|
|
5046
|
+
*/
|
|
5047
|
+
this.display = false;
|
|
5048
|
+
/**
|
|
5049
|
+
* Disable popover
|
|
5050
|
+
*/
|
|
5051
|
+
this.disabled = false;
|
|
5052
|
+
/**
|
|
5053
|
+
* Check if clicked outside of component
|
|
5054
|
+
*
|
|
5055
|
+
* @param {MouseEvent} event mouse event
|
|
5056
|
+
* @returns {void}
|
|
5057
|
+
*/
|
|
5058
|
+
this.clickOutside = (event) => {
|
|
5059
|
+
var _a;
|
|
5060
|
+
if (!this.disabled && ((_a = event.target.closest(`#${this.identifier}`)) === null || _a === void 0 ? void 0 : _a.parentElement.nodeName) !== 'MG-POPOVER') {
|
|
5061
|
+
this.display = false;
|
|
5062
|
+
}
|
|
5063
|
+
};
|
|
5064
|
+
/**
|
|
5065
|
+
* Show popover
|
|
5066
|
+
*
|
|
5067
|
+
* @returns {void}
|
|
5068
|
+
*/
|
|
5069
|
+
this.show = () => {
|
|
5070
|
+
// Make the popover visible
|
|
5071
|
+
this.popover.setAttribute('data-show', '');
|
|
5072
|
+
// Enable the event listeners
|
|
5073
|
+
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
|
|
5074
|
+
// Update its position
|
|
5075
|
+
this.popper.update();
|
|
5076
|
+
// hide when click outside
|
|
5077
|
+
// setTimeout is used to prevent event to trigger after creation
|
|
5078
|
+
setTimeout(() => {
|
|
5079
|
+
document.addEventListener('click', this.clickOutside, false);
|
|
5080
|
+
}, 0);
|
|
5081
|
+
};
|
|
5082
|
+
/**
|
|
5083
|
+
* Hide popover
|
|
5084
|
+
*
|
|
5085
|
+
* @returns {void}
|
|
5086
|
+
*/
|
|
5087
|
+
this.hide = () => {
|
|
5088
|
+
// Hide the popover
|
|
5089
|
+
this.popover.removeAttribute('data-show');
|
|
5090
|
+
// Disable the event listeners
|
|
5091
|
+
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
|
|
5092
|
+
// Remove event listener
|
|
5093
|
+
document.removeEventListener('click', this.clickOutside, false);
|
|
5094
|
+
};
|
|
5095
|
+
/**
|
|
5096
|
+
* Handle action for close button
|
|
5097
|
+
*
|
|
5098
|
+
* @returns {void}
|
|
5099
|
+
*/
|
|
5100
|
+
this.handleCloseButton = () => {
|
|
5101
|
+
this.display = false;
|
|
5102
|
+
};
|
|
5103
|
+
}
|
|
5104
|
+
handleDisplay(newValue) {
|
|
5105
|
+
if (newValue) {
|
|
5106
|
+
this.show();
|
|
5107
|
+
}
|
|
5108
|
+
else {
|
|
5109
|
+
this.hide();
|
|
5110
|
+
}
|
|
5111
|
+
this.displayChange.emit(newValue);
|
|
5112
|
+
}
|
|
5113
|
+
/*************
|
|
5114
|
+
* Lifecycle *
|
|
5115
|
+
*************/
|
|
5116
|
+
/**
|
|
5117
|
+
* Check if component props are well configured on init
|
|
5118
|
+
*
|
|
5119
|
+
* @returns {void} timeout
|
|
5120
|
+
*/
|
|
5121
|
+
componentWillLoad() {
|
|
5122
|
+
// Get locales
|
|
5123
|
+
this.messages = initLocales(this.element).messages;
|
|
5124
|
+
}
|
|
5125
|
+
/**
|
|
5126
|
+
* Check if component props are well configured on init
|
|
5127
|
+
*
|
|
5128
|
+
* @returns {void}
|
|
5129
|
+
*/
|
|
5130
|
+
componentDidLoad() {
|
|
5131
|
+
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
5132
|
+
const slotedTitleElement = this.element.querySelector('[slot="title"]');
|
|
5133
|
+
if (slotedTitleElement && !isTagName(slotedTitleElement, headingTags)) {
|
|
5134
|
+
throw new Error(`<mg-popover> Slotted title must be a heading: ${headingTags.join(', ')}`);
|
|
5135
|
+
}
|
|
5136
|
+
// Set close button id
|
|
5137
|
+
if (this.closeButton) {
|
|
5138
|
+
this.closeButtonId = `${this.identifier}-close-button`;
|
|
5139
|
+
}
|
|
5140
|
+
// Get popover content
|
|
5141
|
+
this.popover = this.element.querySelector(`#${this.identifier}`);
|
|
5142
|
+
//Get interactive element
|
|
5143
|
+
const interactiveElement = this.element.firstElementChild;
|
|
5144
|
+
// Add aria attributes
|
|
5145
|
+
interactiveElement.setAttribute('aria-controls', this.identifier);
|
|
5146
|
+
interactiveElement.setAttribute('aria-expanded', `${this.display}`);
|
|
5147
|
+
// Create popperjs popover
|
|
5148
|
+
this.popper = createPopper(interactiveElement, this.popover, {
|
|
5149
|
+
placement: this.placement,
|
|
5150
|
+
modifiers: [
|
|
5151
|
+
{
|
|
5152
|
+
name: 'offset',
|
|
5153
|
+
options: {
|
|
5154
|
+
offset: [0, 10],
|
|
5155
|
+
},
|
|
5156
|
+
},
|
|
5157
|
+
],
|
|
5158
|
+
});
|
|
5159
|
+
// Add events to toggle display
|
|
5160
|
+
interactiveElement.addEventListener('click', () => {
|
|
5161
|
+
if (!this.disabled)
|
|
5162
|
+
this.display = !this.display;
|
|
5163
|
+
});
|
|
5164
|
+
// Add events to hide popover
|
|
5165
|
+
this.element.addEventListener('keydown', e => {
|
|
5166
|
+
if (!this.disabled && e.code === 'Escape')
|
|
5167
|
+
this.display = false;
|
|
5168
|
+
});
|
|
5169
|
+
this.handleDisplay(this.display);
|
|
5170
|
+
}
|
|
5171
|
+
/**
|
|
5172
|
+
* Render
|
|
5173
|
+
*
|
|
5174
|
+
* @returns {HTMLElement} HTML Element
|
|
5175
|
+
*/
|
|
5176
|
+
render() {
|
|
5177
|
+
return (h(Host, null, h("slot", null), h("div", { id: this.identifier, class: "mg-popover" }, !this.disabled && this.closeButton && (h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { icon: "cross" }))), h("div", { class: "mg-popover__title" }, h("slot", { name: "title" })), h("slot", { name: "content" }), h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
|
|
5178
|
+
}
|
|
5179
|
+
get element() { return getElement(this); }
|
|
5180
|
+
static get watchers() { return {
|
|
5181
|
+
"display": ["handleDisplay"]
|
|
5182
|
+
}; }
|
|
5183
|
+
};
|
|
5184
|
+
MgPopover.style = mgPopoverCss;
|
|
5185
|
+
|
|
5186
|
+
var Status;
|
|
5187
|
+
(function (Status) {
|
|
5188
|
+
Status["VISIBLE"] = "visible";
|
|
5189
|
+
Status["HIDDEN"] = "hidden";
|
|
5190
|
+
Status["DISABLED"] = "disabled";
|
|
5191
|
+
Status["ACTIVE"] = "active";
|
|
5192
|
+
})(Status || (Status = {}));
|
|
5193
|
+
/**
|
|
5194
|
+
* List of all possibles sizes
|
|
5195
|
+
*/
|
|
5196
|
+
const sizes = ['regular', 'large'];
|
|
5197
|
+
|
|
5198
|
+
const mgTabsCss = ".mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button{padding:calc(1rem + 0.3rem) calc(1rem * 1.3) 1rem}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button{padding:calc(1.8rem + 0.3rem) calc(1.8rem * 1.3) 1.8rem}.mg-tabs__header{display:flex;flex-direction:row;flex-wrap:wrap}.mg-tabs__navigation-button{display:flex;align-items:center;column-gap:0.5rem;background:none;border:none;border-bottom:0.3rem solid transparent;color:hsl(var(--color-dark));line-height:var(--line-height);cursor:pointer}.mg-tabs__navigation-button:disabled,.mg-tabs__navigation-button--disabled{cursor:default;opacity:30%}.mg-tabs__navigation-button:hover:not(:disabled),.mg-tabs__navigation-button:focus:not(:disabled){background-color:hsla(var(--color-info-h), var(--color-info-s), var(--color-info-l), 10%)}.mg-tabs__navigation-button.mg-tabs__navigation-button--active{color:hsl(var(--color-info));border-bottom-color:hsl(var(--color-info));font-weight:700}.mg-tabs__navigation-button.mg-tabs__navigation-button--hidden{display:none}.mg-tabs__content-container:focus-visible{outline:none}";
|
|
5199
|
+
|
|
5200
|
+
/**
|
|
5201
|
+
* type TabItem validation function
|
|
5202
|
+
*
|
|
5203
|
+
* @param {TabItem} tab tab item
|
|
5204
|
+
* @returns {boolean} tab item type is valid
|
|
5205
|
+
*/
|
|
5206
|
+
const isTabItem = (tab) => typeof tab === 'object' && typeof tab.label === 'string';
|
|
5207
|
+
const MgTabs = class {
|
|
5208
|
+
constructor(hostRef) {
|
|
5209
|
+
registerInstance(this, hostRef);
|
|
5210
|
+
this.activeTabChange = createEvent(this, "active-tab-change", 7);
|
|
5211
|
+
/************
|
|
5212
|
+
* Internal *
|
|
5213
|
+
************/
|
|
5214
|
+
this.tabPanel = 'panel';
|
|
5215
|
+
this.startIndex = 1;
|
|
5216
|
+
this.buttonTabBaseClass = 'mg-tabs__navigation-button';
|
|
5217
|
+
/**
|
|
5218
|
+
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
5219
|
+
* If not set, it will be created.
|
|
5220
|
+
*/
|
|
5221
|
+
this.identifier = createID('mg-tabs');
|
|
5222
|
+
/**
|
|
5223
|
+
* Define tabs size
|
|
5224
|
+
*/
|
|
5225
|
+
this.size = 'regular';
|
|
5226
|
+
/**
|
|
5227
|
+
* Active tab number
|
|
5228
|
+
* default: first is 1
|
|
5229
|
+
*/
|
|
5230
|
+
this.activeTab = 1;
|
|
5231
|
+
/**
|
|
5232
|
+
* Component tabs
|
|
5233
|
+
*/
|
|
5234
|
+
this.tabs = [];
|
|
5235
|
+
/**
|
|
5236
|
+
* Component classes
|
|
5237
|
+
*/
|
|
5238
|
+
this.classList = new ClassList(['mg-tabs']);
|
|
5239
|
+
/**
|
|
5240
|
+
* Method to set active tab
|
|
5241
|
+
*
|
|
5242
|
+
* @param {number} tabKey item tab key to set to ACTIVE status
|
|
5243
|
+
* @returns {void}
|
|
5244
|
+
*/
|
|
5245
|
+
this.setActiveTab = (tabKey) => {
|
|
5246
|
+
// reset active tabs
|
|
5247
|
+
this.tabs.forEach(tab => {
|
|
5248
|
+
if (this.tabHasGivenStatus(tab, Status.ACTIVE))
|
|
5249
|
+
tab.status = Status.VISIBLE;
|
|
5250
|
+
});
|
|
5251
|
+
// set active tab from given tab key
|
|
5252
|
+
this.tabs[tabKey - this.startIndex].status = Status.ACTIVE;
|
|
5253
|
+
// emit change active tab key event
|
|
5254
|
+
this.activeTabChange.emit(tabKey);
|
|
5255
|
+
};
|
|
5256
|
+
/**
|
|
5257
|
+
* Method to know if given tab has the given status
|
|
5258
|
+
*
|
|
5259
|
+
* @param {TabItem} tab item tab key to set to ACTIVE status
|
|
5260
|
+
* @param {Status} status status to valide
|
|
5261
|
+
* @returns {boolean} status comparaison
|
|
5262
|
+
*/
|
|
5263
|
+
this.tabHasGivenStatus = (tab, status) => tab.status === status;
|
|
5264
|
+
/**
|
|
5265
|
+
* Method to get element id from index
|
|
5266
|
+
*
|
|
5267
|
+
* @param {string} element to get id
|
|
5268
|
+
* @param {number} index to generate id
|
|
5269
|
+
* @returns {string} generated element id
|
|
5270
|
+
*/
|
|
5271
|
+
this.getElementId = (element, index) => `${element}-${this.getTabIndex(index)}`;
|
|
5272
|
+
/**
|
|
5273
|
+
* Method to get tab index
|
|
5274
|
+
*
|
|
5275
|
+
* @param {number} index to get
|
|
5276
|
+
* @returns {number} index
|
|
5277
|
+
*/
|
|
5278
|
+
this.getTabIndex = (index) => index + this.startIndex;
|
|
5279
|
+
/**
|
|
5280
|
+
* Handle click events on tabs
|
|
5281
|
+
*
|
|
5282
|
+
* @param {MouseEvent} event mouse event
|
|
5283
|
+
*/
|
|
5284
|
+
this.handleClick = (event) => {
|
|
5285
|
+
const tabId = event.currentTarget.getAttribute('data-index');
|
|
5286
|
+
this.activeTab = Number(tabId);
|
|
5287
|
+
};
|
|
5288
|
+
/**
|
|
5289
|
+
* get navigation button class from given status
|
|
5290
|
+
*
|
|
5291
|
+
* @param {Status} status button tab status
|
|
5292
|
+
* @param {boolean} isSelector set if we need a CSS selector with the dot '.' at the begin. default value = false.
|
|
5293
|
+
* @returns {string} button class/selector variant
|
|
5294
|
+
*/
|
|
5295
|
+
this.getNavigationButtonClass = (status, isSelector = false) => `${isSelector ? '.' : ''}${this.buttonTabBaseClass}--${status}`;
|
|
5296
|
+
/**
|
|
5297
|
+
* Handle keyboard event on tabs
|
|
5298
|
+
*
|
|
5299
|
+
* @param {MouseEvent} event mouse event
|
|
5300
|
+
* @returns {void}
|
|
5301
|
+
*/
|
|
5302
|
+
this.handleKeydown = (event) => {
|
|
5303
|
+
let tabId = Number(event.target.getAttribute('data-index'));
|
|
5304
|
+
const parent = event.target.parentElement;
|
|
5305
|
+
// change selected id from key code
|
|
5306
|
+
if (event.key === 'ArrowRight') {
|
|
5307
|
+
tabId++;
|
|
5308
|
+
}
|
|
5309
|
+
else if (event.key === 'ArrowLeft') {
|
|
5310
|
+
tabId--;
|
|
5311
|
+
}
|
|
5312
|
+
// get selected tab if NOT hidden, disabled
|
|
5313
|
+
const selectedTab = parent.querySelector(`[data-index="${tabId}"]:not(${[this.getNavigationButtonClass(Status.HIDDEN, true), this.getNavigationButtonClass(Status.DISABLED, true)].join()})`);
|
|
5314
|
+
// apply selected tab if exist
|
|
5315
|
+
if (selectedTab !== null) {
|
|
5316
|
+
selectedTab.focus();
|
|
5317
|
+
this.activeTab = tabId;
|
|
5318
|
+
}
|
|
5319
|
+
};
|
|
5320
|
+
/**
|
|
5321
|
+
* Validate slots setting
|
|
5322
|
+
*/
|
|
5323
|
+
this.validateSlots = () => {
|
|
5324
|
+
const slots = Array.from(this.element.children).filter(slot => { var _a; return (_a = slot.getAttribute('slot')) === null || _a === void 0 ? void 0 : _a.includes('tab_content-'); });
|
|
5325
|
+
if (slots.length !== this.tabs.length) {
|
|
5326
|
+
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
5327
|
+
}
|
|
5328
|
+
};
|
|
5329
|
+
}
|
|
5330
|
+
validateSize(newValue) {
|
|
5331
|
+
if (!sizes.includes(newValue)) {
|
|
5332
|
+
throw new Error(`<mg-tabs> prop "size" must be one of : ${sizes.join(', ')}`);
|
|
5333
|
+
}
|
|
5334
|
+
this.classList.add(`mg-tabs--size-${this.size}`);
|
|
5335
|
+
}
|
|
5336
|
+
validateItems(newValue) {
|
|
5337
|
+
// String array
|
|
5338
|
+
if (allItemsAreString(newValue)) {
|
|
5339
|
+
this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
|
|
5340
|
+
}
|
|
5341
|
+
// Object array
|
|
5342
|
+
else if (newValue && newValue.every(item => isTabItem(item))) {
|
|
5343
|
+
this.tabs = newValue;
|
|
5344
|
+
}
|
|
5345
|
+
else {
|
|
5346
|
+
throw new Error('<mg-tabs> prop "items" is required and all items must be the same type: TabItem.');
|
|
5347
|
+
}
|
|
3264
5348
|
}
|
|
3265
5349
|
validateActiveTab(newValue) {
|
|
3266
5350
|
if (newValue < 1 || newValue > this.tabs.length) {
|
|
@@ -3291,12 +5375,12 @@ const MgTabs = class {
|
|
|
3291
5375
|
* @returns {HTMLElement} HTML Element
|
|
3292
5376
|
*/
|
|
3293
5377
|
render() {
|
|
3294
|
-
return (h(
|
|
5378
|
+
return (h("div", { class: this.classList.join() }, h("header", { role: "tablist", "aria-label": this.label, class: "mg-tabs__header" }, this.tabs.map((tab, index) => (h("button", { role: "tab", id: this.getElementId(this.identifier, index), class: {
|
|
3295
5379
|
[`${this.buttonTabBaseClass}`]: true,
|
|
3296
5380
|
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasGivenStatus(tab, Status.ACTIVE),
|
|
3297
5381
|
[`${this.getNavigationButtonClass(Status.DISABLED)}`]: this.tabHasGivenStatus(tab, Status.DISABLED),
|
|
3298
5382
|
[`${this.getNavigationButtonClass(Status.HIDDEN)}`]: this.tabHasGivenStatus(tab, Status.HIDDEN),
|
|
3299
|
-
}, tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasGivenStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabIndex(index), disabled: this.tabHasGivenStatus(tab, Status.DISABLED) }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon }), tab.label, tab.badge !== undefined && h("mg-badge", { variant: "info", value: tab.badge.value, label: tab.badge.label }))))), this.tabs.map((tab, index) => (h("article", { role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasGivenStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-tabs__content-container" }, h("slot", { name: this.getElementId('tab_content', index) }))))))
|
|
5383
|
+
}, tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasGivenStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabIndex(index), disabled: this.tabHasGivenStatus(tab, Status.DISABLED) }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon }), tab.label, tab.badge !== undefined && h("mg-badge", { variant: "info", value: tab.badge.value, label: tab.badge.label }))))), this.tabs.map((tab, index) => (h("article", { role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasGivenStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasGivenStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-tabs__content-container" }, h("slot", { name: this.getElementId('tab_content', index) }))))));
|
|
3300
5384
|
}
|
|
3301
5385
|
get element() { return getElement(this); }
|
|
3302
5386
|
static get watchers() { return {
|
|
@@ -3378,6 +5462,16 @@ const MgTag = class {
|
|
|
3378
5462
|
};
|
|
3379
5463
|
MgTag.style = mgTagCss;
|
|
3380
5464
|
|
|
5465
|
+
/**
|
|
5466
|
+
* List of all possibles placements
|
|
5467
|
+
*/
|
|
5468
|
+
var Guard;
|
|
5469
|
+
(function (Guard) {
|
|
5470
|
+
Guard["FOCUS"] = "focus";
|
|
5471
|
+
Guard["HOVER_TOOLTIP_ELEMENT"] = "hoverTooltipGuard";
|
|
5472
|
+
Guard["HOVER_TOOLTIPED_ELEMENT"] = "hoverTooltipedGuard";
|
|
5473
|
+
})(Guard || (Guard = {}));
|
|
5474
|
+
|
|
3381
5475
|
const mgTooltipCss = ".sc-mg-tooltip-h{display:inline-block}.mg-tooltip.sc-mg-tooltip{display:none;padding:0.5rem 0.8rem;z-index:9999;border-radius:var(--mg-tooltip-border-radius);background-color:hsl(var(--mg-tooltip-background-color));color:hsl(var(--mg-tooltip-font-color));text-align:start}.mg-tooltip[data-show].sc-mg-tooltip{display:block}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip,.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{position:absolute;width:0.8rem;height:0.8rem;z-index:9999;background:inherit}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip{visibility:hidden}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-tooltip[data-popper-placement^=top].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{bottom:-4px}.mg-tooltip[data-popper-placement^=bottom].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{top:-4px}.mg-tooltip[data-popper-placement^=left].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{right:-4px}.mg-tooltip[data-popper-placement^=right].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{left:-4px}";
|
|
3382
5476
|
|
|
3383
5477
|
const MgTooltip = class {
|
|
@@ -3424,9 +5518,51 @@ const MgTooltip = class {
|
|
|
3424
5518
|
// Disable the event listeners
|
|
3425
5519
|
this.popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
|
|
3426
5520
|
};
|
|
5521
|
+
/**
|
|
5522
|
+
* Method to set display prop
|
|
5523
|
+
*
|
|
5524
|
+
* @param {boolean} newValue display prop new value
|
|
5525
|
+
* @param {boolean} condition additionnal condition to apply display prop newValue
|
|
5526
|
+
* @returns {void}
|
|
5527
|
+
*/
|
|
5528
|
+
this.setDisplay = (newValue, condition = true) => {
|
|
5529
|
+
if (!this.disabled && condition)
|
|
5530
|
+
this.display = newValue;
|
|
5531
|
+
};
|
|
5532
|
+
/**
|
|
5533
|
+
* Action for tooltip element and tooltiped element mouse listener
|
|
5534
|
+
*
|
|
5535
|
+
* @param {Guard} elementGuard tooltip element guard
|
|
5536
|
+
* @param {boolean} isMouseenter mouseenter validation
|
|
5537
|
+
* @param {Guard} conditionalGuard guard condition
|
|
5538
|
+
* @returns {void}
|
|
5539
|
+
*/
|
|
5540
|
+
this.tooltipMouseListenerAction = (elementGuard, isMouseenter, conditionalGuard) => {
|
|
5541
|
+
// we mutate elementGuard
|
|
5542
|
+
if (this.guard !== Guard.FOCUS) {
|
|
5543
|
+
this.guard = elementGuard;
|
|
5544
|
+
if (!isMouseenter) {
|
|
5545
|
+
setTimeout(() => {
|
|
5546
|
+
this.setDisplay(isMouseenter, this.guard !== conditionalGuard);
|
|
5547
|
+
this.resetGuard();
|
|
5548
|
+
}, 100);
|
|
5549
|
+
}
|
|
5550
|
+
else if (isMouseenter && elementGuard === Guard.HOVER_TOOLTIPED_ELEMENT) {
|
|
5551
|
+
this.setDisplay(isMouseenter);
|
|
5552
|
+
}
|
|
5553
|
+
}
|
|
5554
|
+
};
|
|
5555
|
+
/**
|
|
5556
|
+
* Method to reset guard value
|
|
5557
|
+
*
|
|
5558
|
+
* @returns {void}
|
|
5559
|
+
*/
|
|
5560
|
+
this.resetGuard = () => {
|
|
5561
|
+
this.guard = undefined;
|
|
5562
|
+
};
|
|
3427
5563
|
}
|
|
3428
|
-
handleDisplay(
|
|
3429
|
-
if (
|
|
5564
|
+
handleDisplay(newValue) {
|
|
5565
|
+
if (newValue) {
|
|
3430
5566
|
this.show();
|
|
3431
5567
|
}
|
|
3432
5568
|
else {
|
|
@@ -3477,21 +5613,31 @@ const MgTooltip = class {
|
|
|
3477
5613
|
},
|
|
3478
5614
|
],
|
|
3479
5615
|
});
|
|
3480
|
-
//
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
this.display = true;
|
|
3485
|
-
});
|
|
5616
|
+
// Manage tooltipedElement focus/blur events
|
|
5617
|
+
tooltipedElement.addEventListener('focus', () => {
|
|
5618
|
+
this.guard = Guard.FOCUS;
|
|
5619
|
+
this.setDisplay(true);
|
|
3486
5620
|
});
|
|
3487
|
-
['
|
|
5621
|
+
['blur', 'keydown'].forEach(event => {
|
|
3488
5622
|
tooltipedElement.addEventListener(event, (e) => {
|
|
3489
5623
|
// we continue to process ONLY for KeyboardEvents 'Escape'
|
|
3490
5624
|
if (e.type === 'keydown' && e.code !== 'Escape') {
|
|
3491
5625
|
return;
|
|
3492
5626
|
}
|
|
3493
|
-
|
|
3494
|
-
|
|
5627
|
+
this.resetGuard();
|
|
5628
|
+
this.setDisplay(false);
|
|
5629
|
+
});
|
|
5630
|
+
});
|
|
5631
|
+
// manage tooltipElement & tooltipedElement mouseenter/mouseleave events
|
|
5632
|
+
['mouseenter', 'mouseleave'].forEach(event => {
|
|
5633
|
+
const isMouseenter = event === 'mouseenter';
|
|
5634
|
+
[
|
|
5635
|
+
{ element: this.tooltip, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIP_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIPED_ELEMENT) },
|
|
5636
|
+
{ element: tooltipedElement, action: () => this.tooltipMouseListenerAction(Guard.HOVER_TOOLTIPED_ELEMENT, isMouseenter, Guard.HOVER_TOOLTIP_ELEMENT) },
|
|
5637
|
+
].forEach(({ element, action }) => {
|
|
5638
|
+
element.addEventListener(event, () => {
|
|
5639
|
+
action();
|
|
5640
|
+
});
|
|
3495
5641
|
});
|
|
3496
5642
|
});
|
|
3497
5643
|
this.handleDisplay(this.display);
|
|
@@ -3511,4 +5657,4 @@ const MgTooltip = class {
|
|
|
3511
5657
|
};
|
|
3512
5658
|
MgTooltip.style = mgTooltipCss;
|
|
3513
5659
|
|
|
3514
|
-
export { MgBadge as mg_badge, MgButton as mg_button, MgCharacterLeft as mg_character_left, MgForm as mg_form, MgIcon as mg_icon, MgInputCheckbox as mg_input_checkbox, MgInputDate as mg_input_date, MgInputNumeric as mg_input_numeric, MgInputPassword as mg_input_password, MgInputRadio as mg_input_radio, MgInputSelect as mg_input_select, MgInputText as mg_input_text, MgInputTextarea as mg_input_textarea, MgInputTitle as mg_input_title, MgInputToggle as mg_input_toggle, MgMessage as mg_message, MgPagination as mg_pagination, MgPanel as mg_panel, MgTabs as mg_tabs, MgTag as mg_tag, MgTooltip as mg_tooltip };
|
|
5660
|
+
export { MgBadge as mg_badge, MgButton as mg_button, MgCharacterLeft as mg_character_left, MgDetails as mg_details, MgForm as mg_form, MgIcon as mg_icon, MgIllustratedMessage as mg_illustrated_message, MgInputCheckbox as mg_input_checkbox, MgInputDate as mg_input_date, MgInputNumeric as mg_input_numeric, MgInputPassword as mg_input_password, MgInputRadio as mg_input_radio, MgInputSelect as mg_input_select, MgInputText as mg_input_text, MgInputTextarea as mg_input_textarea, MgInputTitle as mg_input_title, MgInputToggle as mg_input_toggle, MgMessage as mg_message, MgPagination as mg_pagination, MgPanel as mg_panel, MgPopover as mg_popover, MgTabs as mg_tabs, MgTag as mg_tag, MgTooltip as mg_tooltip };
|