@mgdis/mg-components 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-94497267.js → index-c3450336.js} +0 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_29.cjs.entry.js → mg-badge_30.cjs.entry.js} +380 -625
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -7
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +4 -7
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -7
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +13 -0
- package/dist/collection/components/atoms/mg-button/mg-button.js +12 -29
- package/dist/collection/components/atoms/mg-card/mg-card.css +6 -1
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +2 -3
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +0 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +5 -12
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +4 -8
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +1 -9
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +58 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +60 -15
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +6 -19
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +17 -33
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +17 -25
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +24 -47
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -29
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +18 -33
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +23 -33
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +23 -41
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +23 -45
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +16 -33
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +4 -7
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +8 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +4 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +13 -24
- package/dist/collection/components/molecules/mg-details/mg-details.js +4 -8
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -22
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.css +2 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +0 -6
- package/dist/collection/components/molecules/mg-message/mg-message.css +13 -19
- package/dist/collection/components/molecules/mg-message/mg-message.js +8 -27
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +12 -7
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -26
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +4 -13
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +10 -5
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -22
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +13 -9
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +7 -23
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +24 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.css +28 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +77 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +10 -23
- package/dist/collection/locales/en/messages.json +3 -0
- package/dist/collection/locales/fr/messages.json +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +8 -0
- package/dist/components/mg-badge2.js +4 -7
- package/dist/components/mg-button2.js +13 -30
- package/dist/components/mg-card.js +1 -37
- package/dist/components/mg-card2.js +39 -0
- package/dist/components/mg-character-left2.js +2 -3
- package/dist/components/mg-details.js +4 -8
- package/dist/components/mg-divider.js +0 -6
- package/dist/components/mg-form.js +8 -22
- package/dist/components/mg-icon2.js +5 -12
- package/dist/components/mg-illustrated-message.js +1 -7
- package/dist/components/mg-input-checkbox.js +17 -33
- package/dist/components/mg-input-date.js +17 -25
- package/dist/components/mg-input-numeric.js +24 -47
- package/dist/components/mg-input-password.js +17 -29
- package/dist/components/mg-input-radio.js +18 -33
- package/dist/components/mg-input-select2.js +24 -34
- package/dist/components/mg-input-text2.js +23 -41
- package/dist/components/mg-input-textarea.js +23 -45
- package/dist/components/mg-input-title2.js +4 -8
- package/dist/components/mg-input-toggle.js +16 -33
- package/dist/components/mg-menu-item.js +14 -25
- package/dist/components/mg-menu.js +4 -7
- package/dist/components/mg-message.js +17 -30
- package/dist/components/mg-modal.js +18 -30
- package/dist/components/mg-pagination.js +4 -13
- package/dist/components/mg-panel.js +20 -25
- package/dist/components/mg-popover.js +16 -26
- package/dist/components/mg-skip-links.d.ts +11 -0
- package/dist/components/mg-skip-links.js +66 -0
- package/dist/components/mg-tabs.js +10 -23
- package/dist/components/mg-tag.js +34 -12
- package/dist/components/mg-tooltip2.js +6 -19
- package/dist/esm/{index-aad0184c.js → index-78edde1d.js} +0 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_29.entry.js → mg-badge_30.entry.js} +380 -626
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/mg-components/locales/en/messages.json +3 -0
- package/dist/mg-components/locales/fr/messages.json +3 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-3899d5d2.js → p-125c54ca.js} +0 -0
- package/dist/mg-components/p-4961c96c.entry.js +1 -0
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -11
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -1
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -11
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +6 -6
- package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -13
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +5 -1
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +27 -6
- package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +1 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +1 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -1
- package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +11 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +7 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +34 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +2 -2
- package/dist/types/components.d.ts +37 -6
- package/dist/types/locales/index.d.ts +6 -0
- package/dist/types/stencil-public-runtime.d.ts +5 -0
- package/dist/types/utils/unit.test.utils.d.ts +42 -0
- package/package.json +36 -31
- package/readme.md +3 -1
- package/dist/mg-components/p-059a9a59.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-78edde1d.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* List of all possibles variants
|
|
@@ -104,13 +104,10 @@ const MgBadge = class {
|
|
|
104
104
|
************/
|
|
105
105
|
// Classes
|
|
106
106
|
this.classOutline = `mg-badge--outline`;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this.
|
|
111
|
-
/**
|
|
112
|
-
* Component classes
|
|
113
|
-
*/
|
|
107
|
+
this.value = undefined;
|
|
108
|
+
this.label = undefined;
|
|
109
|
+
this.variant = variants$4[0];
|
|
110
|
+
this.outline = undefined;
|
|
114
111
|
this.classList = new ClassList(['mg-badge']);
|
|
115
112
|
}
|
|
116
113
|
validateValue(newValue) {
|
|
@@ -171,9 +168,9 @@ MgBadge.style = mgBadgeCss;
|
|
|
171
168
|
/**
|
|
172
169
|
* List of all possibles variants
|
|
173
170
|
*/
|
|
174
|
-
const variants$3 = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success'];
|
|
171
|
+
const variants$3 = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success', 'link'];
|
|
175
172
|
|
|
176
|
-
const mgButtonCss = ":host{display:inline-block;vertical-align:middle;max-width:100%}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:0.2rem}:host(:hover) .mg-button--flat:not(.mg-button--disabled),:host(:focus) .mg-button--flat:not(.mg-button--disabled),:host(:active) .mg-button--flat:not(.mg-button--disabled){background:hsla(var(--color-dark), 0.1)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-button.mg-button--primary{border-color:hsl(var(--mg-button-primary-border-color, var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-primary-font-color));background:linear-gradient(to bottom, hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l)), hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--primary:not(.mg-button--disabled),:host(:focus) .mg-button--primary:not(.mg-button--disabled),:host(:active) .mg-button--primary:not(.mg-button--disabled){background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))}.mg-button.mg-button--secondary{border-color:hsl(var(--mg-button-secondary-border-color, var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-secondary-font-color));background:linear-gradient(to bottom, hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l)), hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--secondary:not(.mg-button--disabled),:host(:focus) .mg-button--secondary:not(.mg-button--disabled),:host(:active) .mg-button--secondary:not(.mg-button--disabled){background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))}.mg-button.mg-button--danger{border-color:hsl(var(--mg-button-danger-border-color, var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));background:linear-gradient(to bottom, hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l)), hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--danger:not(.mg-button--disabled),:host(:focus) .mg-button--danger:not(.mg-button--disabled),:host(:active) .mg-button--danger:not(.mg-button--disabled){background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-button.mg-button--danger-alt{border-color:hsl(var(--mg-button-danger-alt-border-color, var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-danger));background:linear-gradient(to bottom, hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l)), hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--danger-alt:not(.mg-button--disabled),:host(:focus) .mg-button--danger-alt:not(.mg-button--disabled),:host(:active) .mg-button--danger-alt:not(.mg-button--disabled){background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-button.mg-button--info{border-color:hsl(var(--mg-button-info-border-color, var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));background:linear-gradient(to bottom, hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l)), hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--info:not(.mg-button--disabled),:host(:focus) .mg-button--info:not(.mg-button--disabled),:host(:active) .mg-button--info:not(.mg-button--disabled){background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-button.mg-button--success{border-color:hsl(var(--mg-button-success-border-color, var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-dark));background:linear-gradient(to bottom, hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l)), hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--success:not(.mg-button--disabled),:host(:focus) .mg-button--success:not(.mg-button--disabled),:host(:active) .mg-button--success:not(.mg-button--disabled){background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-button{position:relative;display:inline-flex;align-items:center;column-gap:0.6rem;padding:calc((var(--default-size) - 0.2rem - var(--font-size) * var(--line-height)) / 2) 1.1rem;min-height:var(--default-size);box-sizing:border-box;border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-border-radius));cursor:pointer;background-image:none;border-top-width:var(--mg-button-border-top-width, 0.1rem);border-right-width:var(--mg-button-border-right-width, 0.1rem);border-bottom-width:var(--mg-button-border-bottom-width, 0.1rem);border-left-width:var(--mg-button-border-left-width, 0.1rem);border-style:solid;text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);touch-action:manipulation}.mg-button.mg-button--disabled{opacity:var(--mg-button-disabled-opacity);cursor:default}.mg-button.mg-button--icon{padding:0;justify-content:center;width:var(--default-size);height:var(--default-size);border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-icon-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-icon-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-icon-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-icon-border-radius));font-size:var(--font-size);line-height:var(--font-size)}.mg-button.mg-button--flat{background:none;border:none}.mg-button.mg-button--full-width{display:flex;justify-content:center}.mg-button.mg-button--loading>mg-icon:first-of-type{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.mg-button.mg-button--loading .mg-button__content{opacity:0}.mg-button mg-icon:only-child,.mg-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;line-height:1;margin:auto 0}.mg-button slot,.mg-button ::slotted(*:not(mg-icon)){text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);display:flex;align-items:center;column-gap:0.6rem}";
|
|
173
|
+
const mgButtonCss = ":host{display:inline-block;vertical-align:middle;max-width:100%}:host(:focus-visible){outline:0}:host(:focus-visible) .mg-button{outline-color:-webkit-focus-ring-color;outline-style:auto;outline-width:0.2rem}:host(:hover) .mg-button--flat:not(.mg-button--disabled),:host(:focus) .mg-button--flat:not(.mg-button--disabled),:host(:active) .mg-button--flat:not(.mg-button--disabled){background:hsla(var(--color-dark), 0.1)}:host([full-width]){display:block}:host([disabled]),:host([aria-disabled=true]){pointer-events:none}.mg-button.mg-button--primary{border-color:hsl(var(--mg-button-primary-border-color, var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-primary-font-color));background:linear-gradient(to bottom, hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l)), hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), calc(var(--mg-button-primary-color-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--primary:not(.mg-button--disabled),:host(:focus) .mg-button--primary:not(.mg-button--disabled),:host(:active) .mg-button--primary:not(.mg-button--disabled){background:hsl(var(--mg-button-primary-color-h), var(--mg-button-primary-color-s), var(--mg-button-primary-color-l))}.mg-button.mg-button--secondary{border-color:hsl(var(--mg-button-secondary-border-color, var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--mg-button-secondary-font-color));background:linear-gradient(to bottom, hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l)), hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), calc(var(--mg-button-secondary-color-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--secondary:not(.mg-button--disabled),:host(:focus) .mg-button--secondary:not(.mg-button--disabled),:host(:active) .mg-button--secondary:not(.mg-button--disabled){background:hsl(var(--mg-button-secondary-color-h), var(--mg-button-secondary-color-s), var(--mg-button-secondary-color-l))}.mg-button.mg-button--danger{border-color:hsl(var(--mg-button-danger-border-color, var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));background:linear-gradient(to bottom, hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l)), hsl(var(--color-danger-h), var(--color-danger-s), calc(var(--color-danger-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--danger:not(.mg-button--disabled),:host(:focus) .mg-button--danger:not(.mg-button--disabled),:host(:active) .mg-button--danger:not(.mg-button--disabled){background:hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l))}.mg-button.mg-button--danger-alt{border-color:hsl(var(--mg-button-danger-alt-border-color, var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-danger));background:linear-gradient(to bottom, hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l)), hsl(var(--color-neutral-h), var(--color-neutral-s), calc(var(--color-neutral-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--danger-alt:not(.mg-button--disabled),:host(:focus) .mg-button--danger-alt:not(.mg-button--disabled),:host(:active) .mg-button--danger-alt:not(.mg-button--disabled){background:hsl(var(--color-neutral-h), var(--color-neutral-s), var(--color-neutral-l))}.mg-button.mg-button--info{border-color:hsl(var(--mg-button-info-border-color, var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-neutral));background:linear-gradient(to bottom, hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l)), hsl(var(--color-info-h), var(--color-info-s), calc(var(--color-info-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--info:not(.mg-button--disabled),:host(:focus) .mg-button--info:not(.mg-button--disabled),:host(:active) .mg-button--info:not(.mg-button--disabled){background:hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l))}.mg-button.mg-button--success{border-color:hsl(var(--mg-button-success-border-color, var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-border-variation) * 10%)));color:hsl(var(--color-dark));background:linear-gradient(to bottom, hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l)), hsl(var(--color-success-h), var(--color-success-s), calc(var(--color-success-l) - var(--mg-button-gradient) * 10%)))}:host(:hover) .mg-button--success:not(.mg-button--disabled),:host(:focus) .mg-button--success:not(.mg-button--disabled),:host(:active) .mg-button--success:not(.mg-button--disabled){background:hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l))}.mg-button{position:relative;display:inline-flex;align-items:center;column-gap:0.6rem;padding:calc((var(--default-size) - 0.2rem - var(--font-size) * var(--line-height)) / 2) 1.1rem;min-height:var(--default-size);box-sizing:border-box;border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-border-radius));cursor:pointer;background-image:none;border-top-width:var(--mg-button-border-top-width, 0.1rem);border-right-width:var(--mg-button-border-right-width, 0.1rem);border-bottom-width:var(--mg-button-border-bottom-width, 0.1rem);border-left-width:var(--mg-button-border-left-width, 0.1rem);border-style:solid;text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);touch-action:manipulation}.mg-button.mg-button--disabled{opacity:var(--mg-button-disabled-opacity);cursor:default}.mg-button.mg-button--icon{padding:0;justify-content:center;width:var(--default-size);height:var(--default-size);border-top-right-radius:var(--mg-button-border-radius-top-right, var(--mg-button-icon-border-radius));border-top-left-radius:var(--mg-button-border-radius-top-left, var(--mg-button-icon-border-radius));border-bottom-right-radius:var(--mg-button-border-radius-bottom-right, var(--mg-button-icon-border-radius));border-bottom-left-radius:var(--mg-button-border-radius-bottom-left, var(--mg-button-icon-border-radius));font-size:var(--font-size);line-height:var(--font-size)}.mg-button.mg-button--flat{background:none;border:none}.mg-button.mg-button--link{padding:unset;min-height:unset;background:unset;border:unset;text-decoration:underline}.mg-button.mg-button--link slot{font-weight:600}.mg-button.mg-button--link:hover{text-decoration:none}.mg-button.mg-button--full-width{display:flex;justify-content:center}.mg-button.mg-button--loading>mg-icon:first-of-type{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.mg-button.mg-button--loading .mg-button__content{opacity:0}.mg-button mg-icon:only-child,.mg-button ::slotted(mg-icon){display:inline-flex;flex-shrink:0;line-height:1;margin:auto 0}.mg-button slot,.mg-button ::slotted(*:not(mg-icon)){text-decoration:none;font-family:inherit;font-weight:var(--mg-button-font-weight, normal);text-align:left;font-size:var(--font-size);display:flex;align-items:center;column-gap:0.6rem}";
|
|
177
174
|
|
|
178
175
|
const MgButton = class {
|
|
179
176
|
constructor(hostRef) {
|
|
@@ -185,34 +182,6 @@ const MgButton = class {
|
|
|
185
182
|
this.classDisabled = 'mg-button--disabled';
|
|
186
183
|
this.classLoading = 'mg-button--loading';
|
|
187
184
|
this.classFullWidth = 'mg-button--full-width';
|
|
188
|
-
/**
|
|
189
|
-
* Define button variant
|
|
190
|
-
*/
|
|
191
|
-
this.variant = variants$3[0]; // Primary
|
|
192
|
-
/**
|
|
193
|
-
* Set button to full-width
|
|
194
|
-
*/
|
|
195
|
-
this.fullWidth = false;
|
|
196
|
-
/**
|
|
197
|
-
* Define if button is round.
|
|
198
|
-
* Used for icon button.
|
|
199
|
-
*/
|
|
200
|
-
this.isIcon = false;
|
|
201
|
-
/**
|
|
202
|
-
* Option to set input disable on click, in order to prevent multi-click.
|
|
203
|
-
* Parent component have to remove the attribute 'disabled' when the process ends.
|
|
204
|
-
*/
|
|
205
|
-
this.disableOnClick = false;
|
|
206
|
-
/**
|
|
207
|
-
* Define if button is loading, default to false.
|
|
208
|
-
* Trigger when button is clicked or key-up ['enter', 'space], then value change to true.
|
|
209
|
-
* It's required to reset to false when action/promise in parent is done to stop the loading state
|
|
210
|
-
*/
|
|
211
|
-
this.loading = false;
|
|
212
|
-
/**
|
|
213
|
-
* Component classes
|
|
214
|
-
*/
|
|
215
|
-
this.classList = new ClassList(['mg-button']);
|
|
216
185
|
/**
|
|
217
186
|
* Trigger actions onClick event
|
|
218
187
|
*
|
|
@@ -255,6 +224,17 @@ const MgButton = class {
|
|
|
255
224
|
this.element.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
256
225
|
}
|
|
257
226
|
};
|
|
227
|
+
this.variant = variants$3[0];
|
|
228
|
+
this.identifier = undefined;
|
|
229
|
+
this.label = undefined;
|
|
230
|
+
this.type = undefined;
|
|
231
|
+
this.fullWidth = false;
|
|
232
|
+
this.form = undefined;
|
|
233
|
+
this.disabled = undefined;
|
|
234
|
+
this.isIcon = false;
|
|
235
|
+
this.disableOnClick = false;
|
|
236
|
+
this.loading = false;
|
|
237
|
+
this.classList = new ClassList(['mg-button']);
|
|
258
238
|
}
|
|
259
239
|
validateVariant(newValue, oldValue) {
|
|
260
240
|
if (!variants$3.includes(newValue)) {
|
|
@@ -339,7 +319,7 @@ const MgButton = class {
|
|
|
339
319
|
};
|
|
340
320
|
MgButton.style = mgButtonCss;
|
|
341
321
|
|
|
342
|
-
const mgCardCss = ".mg-card{padding:var(--mg-card-padding);
|
|
322
|
+
const mgCardCss = ".mg-card{position:relative;width:100%;padding:var(--mg-card-padding);overflow:var(--mg-card-overflow);box-sizing:border-box;z-index:inherit;background:var(--mg-card-background);border:var(--mg-card-border);border-radius:var(--mg-card-border-radius);box-shadow:var(--mg-card-box-shadow)}";
|
|
343
323
|
|
|
344
324
|
const MgCard = class {
|
|
345
325
|
constructor(hostRef) {
|
|
@@ -400,6 +380,9 @@ const pagination$1 = {
|
|
|
400
380
|
const panel$1 = {
|
|
401
381
|
editLabel: "Edit section title."
|
|
402
382
|
};
|
|
383
|
+
const skipLinks$1 = {
|
|
384
|
+
navLabel: "Quick access"
|
|
385
|
+
};
|
|
403
386
|
const general$1 = {
|
|
404
387
|
confirm: "Confirm",
|
|
405
388
|
cancel: "Cancel",
|
|
@@ -416,6 +399,7 @@ const en = {
|
|
|
416
399
|
modal: modal$1,
|
|
417
400
|
pagination: pagination$1,
|
|
418
401
|
panel: panel$1,
|
|
402
|
+
skipLinks: skipLinks$1,
|
|
419
403
|
general: general$1
|
|
420
404
|
};
|
|
421
405
|
|
|
@@ -460,6 +444,9 @@ const pagination = {
|
|
|
460
444
|
const panel = {
|
|
461
445
|
editLabel: "Modifier le titre de la section."
|
|
462
446
|
};
|
|
447
|
+
const skipLinks = {
|
|
448
|
+
navLabel: "Accès rapide"
|
|
449
|
+
};
|
|
463
450
|
const general = {
|
|
464
451
|
confirm: "Valider",
|
|
465
452
|
cancel: "Annuler",
|
|
@@ -476,6 +463,7 @@ const fr = {
|
|
|
476
463
|
modal: modal,
|
|
477
464
|
pagination: pagination,
|
|
478
465
|
panel: panel,
|
|
466
|
+
skipLinks: skipLinks,
|
|
479
467
|
general: general
|
|
480
468
|
};
|
|
481
469
|
|
|
@@ -518,10 +506,9 @@ const mgCharacterLeftCss = "mg-character-left.sc-mg-character-left{display:block
|
|
|
518
506
|
const MgCharacterLeft = class {
|
|
519
507
|
constructor(hostRef) {
|
|
520
508
|
registerInstance(this, hostRef);
|
|
521
|
-
|
|
522
|
-
* Sets the characters to count
|
|
523
|
-
*/
|
|
509
|
+
this.identifier = undefined;
|
|
524
510
|
this.characters = '';
|
|
511
|
+
this.maxlength = undefined;
|
|
525
512
|
}
|
|
526
513
|
validateMaxlength(newValue) {
|
|
527
514
|
if (typeof newValue !== 'number') {
|
|
@@ -561,14 +548,6 @@ const MgDetails = class {
|
|
|
561
548
|
constructor(hostRef) {
|
|
562
549
|
registerInstance(this, hostRef);
|
|
563
550
|
this.expandedChange = createEvent(this, "expanded-change", 7);
|
|
564
|
-
/**
|
|
565
|
-
* Hide summary element
|
|
566
|
-
*/
|
|
567
|
-
this.hideSummary = false;
|
|
568
|
-
/**
|
|
569
|
-
* Define if details are diplayed
|
|
570
|
-
*/
|
|
571
|
-
this.expanded = false;
|
|
572
551
|
/**
|
|
573
552
|
* Handle details toggle
|
|
574
553
|
*
|
|
@@ -577,6 +556,10 @@ const MgDetails = class {
|
|
|
577
556
|
this.handleToggle = () => {
|
|
578
557
|
this.expanded = this.details.open;
|
|
579
558
|
};
|
|
559
|
+
this.toggleClosed = undefined;
|
|
560
|
+
this.toggleOpened = undefined;
|
|
561
|
+
this.hideSummary = false;
|
|
562
|
+
this.expanded = false;
|
|
580
563
|
}
|
|
581
564
|
validateTitles(newValue) {
|
|
582
565
|
if (newValue === undefined || newValue.trim() === '') {
|
|
@@ -619,12 +602,6 @@ const mgDividerCss = ".mg-divider{margin:var(--mg-divider-vertical-spacing) auto
|
|
|
619
602
|
const MgDivider = class {
|
|
620
603
|
constructor(hostRef) {
|
|
621
604
|
registerInstance(this, hostRef);
|
|
622
|
-
/**************
|
|
623
|
-
* Decorators *
|
|
624
|
-
**************/
|
|
625
|
-
/**
|
|
626
|
-
* Define component size
|
|
627
|
-
*/
|
|
628
605
|
this.size = 'regular';
|
|
629
606
|
}
|
|
630
607
|
/**
|
|
@@ -650,28 +627,6 @@ const MgForm = class {
|
|
|
650
627
|
this.formSubmit = createEvent(this, "form-submit", 7);
|
|
651
628
|
// Classes
|
|
652
629
|
this.classAllRequired = 'mg-form--all-required';
|
|
653
|
-
/**
|
|
654
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
655
|
-
* If not set, it will be created.
|
|
656
|
-
*/
|
|
657
|
-
this.identifier = createID('mg-form');
|
|
658
|
-
/**
|
|
659
|
-
* Input name
|
|
660
|
-
* If not set the value equals the identifier
|
|
661
|
-
*/
|
|
662
|
-
this.name = this.identifier;
|
|
663
|
-
/**
|
|
664
|
-
* Define if form is readonly
|
|
665
|
-
*/
|
|
666
|
-
this.readonly = false;
|
|
667
|
-
/**
|
|
668
|
-
* Define if form is disabled
|
|
669
|
-
*/
|
|
670
|
-
this.disabled = false;
|
|
671
|
-
/**
|
|
672
|
-
* Component classes
|
|
673
|
-
*/
|
|
674
|
-
this.classList = new ClassList(['mg-form']);
|
|
675
630
|
/**
|
|
676
631
|
* Define required message based on mg-inputs required elements
|
|
677
632
|
* Also
|
|
@@ -741,6 +696,14 @@ const MgForm = class {
|
|
|
741
696
|
input.addEventListener('input-valid', this.checkValidity);
|
|
742
697
|
});
|
|
743
698
|
};
|
|
699
|
+
this.identifier = createID('mg-form');
|
|
700
|
+
this.name = this.identifier;
|
|
701
|
+
this.readonly = false;
|
|
702
|
+
this.disabled = false;
|
|
703
|
+
this.valid = undefined;
|
|
704
|
+
this.invalid = undefined;
|
|
705
|
+
this.classList = new ClassList(['mg-form']);
|
|
706
|
+
this.requiredMessage = undefined;
|
|
744
707
|
}
|
|
745
708
|
handleAttributeChange() {
|
|
746
709
|
this.setMgInputs();
|
|
@@ -1011,24 +974,17 @@ const mgIconCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !i
|
|
|
1011
974
|
const MgIcon = class {
|
|
1012
975
|
constructor(hostRef) {
|
|
1013
976
|
registerInstance(this, hostRef);
|
|
1014
|
-
/**
|
|
1015
|
-
* Define icon size
|
|
1016
|
-
*/
|
|
1017
|
-
this.size = 'regular';
|
|
1018
|
-
/**
|
|
1019
|
-
* Make the icon spin
|
|
1020
|
-
*/
|
|
1021
|
-
this.spin = false;
|
|
1022
|
-
/**
|
|
1023
|
-
* Component classes
|
|
1024
|
-
*/
|
|
1025
|
-
this.classList = new ClassList(['mg-icon']);
|
|
1026
977
|
/**
|
|
1027
978
|
* getIcon
|
|
1028
979
|
*
|
|
1029
980
|
* @returns {HTMLElement} icon html
|
|
1030
981
|
*/
|
|
1031
982
|
this.getIcon = () => icons[this.icon]();
|
|
983
|
+
this.icon = undefined;
|
|
984
|
+
this.size = 'regular';
|
|
985
|
+
this.variant = undefined;
|
|
986
|
+
this.spin = false;
|
|
987
|
+
this.classList = new ClassList(['mg-icon']);
|
|
1032
988
|
}
|
|
1033
989
|
validateIcon(newValue, oldValue) {
|
|
1034
990
|
if (!Object.keys(icons).includes(newValue)) {
|
|
@@ -1101,18 +1057,12 @@ const MgIcon = class {
|
|
|
1101
1057
|
};
|
|
1102
1058
|
MgIcon.style = mgIconCss;
|
|
1103
1059
|
|
|
1104
|
-
const mgIllustratedMessageCss = ".mg-illustrated-message{display:flex;flex-direction:column;justify-content:center;gap:3em 7rem;margin:auto;padding:var(--mg-illustrated-message-padding-vertical) 1.5rem;max-width:47.5rem;box-sizing:border-box;text-align:center}.mg-illustrated-message.mg-illustrated-message--horizontal{flex-direction:row;flex-wrap:wrap;align-items:center;max-width:unset}.mg-illustrated-message.mg-illustrated-message--horizontal .mg-illustrated-message__slots,.mg-illustrated-message.mg-illustrated-message--horizontal .mg-illustrated-message__illustration{max-width:47.5rem}.mg-illustrated-message__illustration{max-height:
|
|
1060
|
+
const mgIllustratedMessageCss = ".mg-illustrated-message{display:flex;flex-direction:column;justify-content:center;gap:3em 7rem;margin:auto;padding:var(--mg-illustrated-message-padding-vertical) 1.5rem;max-width:47.5rem;box-sizing:border-box;text-align:center}.mg-illustrated-message.mg-illustrated-message--horizontal{flex-direction:row;flex-wrap:wrap;align-items:center;max-width:unset}.mg-illustrated-message.mg-illustrated-message--horizontal .mg-illustrated-message__slots,.mg-illustrated-message.mg-illustrated-message--horizontal .mg-illustrated-message__illustration{max-width:47.5rem}.mg-illustrated-message__illustration{max-height:18.4rem}.mg-illustrated-message__illustration ::slotted([slot=illustration]){width:auto;height:auto;max-width:100%;max-height:18.4rem}.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 ::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}";
|
|
1105
1061
|
|
|
1106
1062
|
const MgIllustratedMessage = class {
|
|
1107
1063
|
constructor(hostRef) {
|
|
1108
1064
|
registerInstance(this, hostRef);
|
|
1109
|
-
/**
|
|
1110
|
-
* Define illustration size
|
|
1111
|
-
*/
|
|
1112
1065
|
this.size = 'regular';
|
|
1113
|
-
/**
|
|
1114
|
-
* Define component orientation
|
|
1115
|
-
*/
|
|
1116
1066
|
this.direction = 'vertical';
|
|
1117
1067
|
}
|
|
1118
1068
|
/*************
|
|
@@ -1293,39 +1243,6 @@ const MgInputCheckbox = class {
|
|
|
1293
1243
|
this.inputs = [];
|
|
1294
1244
|
// hasDisplayedError (triggered by blur event)
|
|
1295
1245
|
this.hasDisplayedError = false;
|
|
1296
|
-
/**
|
|
1297
|
-
* Input name
|
|
1298
|
-
* If not set the value equals the identifier
|
|
1299
|
-
*/
|
|
1300
|
-
this.name = this.identifier;
|
|
1301
|
-
/**
|
|
1302
|
-
* Define if label is visible
|
|
1303
|
-
*/
|
|
1304
|
-
this.labelHide = false;
|
|
1305
|
-
/**
|
|
1306
|
-
* Define if inputs are display verticaly
|
|
1307
|
-
*/
|
|
1308
|
-
this.inputVerticalList = false;
|
|
1309
|
-
/**
|
|
1310
|
-
* Define if input is required
|
|
1311
|
-
*/
|
|
1312
|
-
this.required = false;
|
|
1313
|
-
/**
|
|
1314
|
-
* Define if input is readonly
|
|
1315
|
-
*/
|
|
1316
|
-
this.readonly = false;
|
|
1317
|
-
/**
|
|
1318
|
-
* Define if input is disabled
|
|
1319
|
-
*/
|
|
1320
|
-
this.disabled = false;
|
|
1321
|
-
/**
|
|
1322
|
-
* Component classes
|
|
1323
|
-
*/
|
|
1324
|
-
this.classList = new ClassList(['mg-input--checkbox']);
|
|
1325
|
-
/**
|
|
1326
|
-
* Formated value for display
|
|
1327
|
-
*/
|
|
1328
|
-
this.checkboxItems = [];
|
|
1329
1246
|
/**
|
|
1330
1247
|
* Handle input event
|
|
1331
1248
|
*
|
|
@@ -1375,6 +1292,23 @@ const MgInputCheckbox = class {
|
|
|
1375
1292
|
this.errorMessage = this.messages.errors.required;
|
|
1376
1293
|
}
|
|
1377
1294
|
};
|
|
1295
|
+
this.value = undefined;
|
|
1296
|
+
this.identifier = undefined;
|
|
1297
|
+
this.name = this.identifier;
|
|
1298
|
+
this.label = undefined;
|
|
1299
|
+
this.labelOnTop = undefined;
|
|
1300
|
+
this.labelHide = false;
|
|
1301
|
+
this.inputVerticalList = false;
|
|
1302
|
+
this.required = false;
|
|
1303
|
+
this.readonly = false;
|
|
1304
|
+
this.disabled = false;
|
|
1305
|
+
this.tooltip = undefined;
|
|
1306
|
+
this.helpText = undefined;
|
|
1307
|
+
this.valid = undefined;
|
|
1308
|
+
this.invalid = undefined;
|
|
1309
|
+
this.classList = new ClassList(['mg-input--checkbox']);
|
|
1310
|
+
this.errorMessage = undefined;
|
|
1311
|
+
this.checkboxItems = [];
|
|
1378
1312
|
}
|
|
1379
1313
|
validateValue(newValue) {
|
|
1380
1314
|
if (newValue && newValue.every(item => isCheckboxItem(item))) {
|
|
@@ -1511,31 +1445,6 @@ const MgInputDate = class {
|
|
|
1511
1445
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
1512
1446
|
// hasDisplayedError (triggered by blur event)
|
|
1513
1447
|
this.hasDisplayedError = false;
|
|
1514
|
-
/**
|
|
1515
|
-
* Input name
|
|
1516
|
-
* If not set the value equals the identifier
|
|
1517
|
-
*/
|
|
1518
|
-
this.name = this.identifier;
|
|
1519
|
-
/**
|
|
1520
|
-
* Define if label is visible
|
|
1521
|
-
*/
|
|
1522
|
-
this.labelHide = false;
|
|
1523
|
-
/**
|
|
1524
|
-
* Define if input is required
|
|
1525
|
-
*/
|
|
1526
|
-
this.required = false;
|
|
1527
|
-
/**
|
|
1528
|
-
* Define if input is readonly
|
|
1529
|
-
*/
|
|
1530
|
-
this.readonly = false;
|
|
1531
|
-
/**
|
|
1532
|
-
* Define if input is disabled
|
|
1533
|
-
*/
|
|
1534
|
-
this.disabled = false;
|
|
1535
|
-
/**
|
|
1536
|
-
* Component classes
|
|
1537
|
-
*/
|
|
1538
|
-
this.classList = new ClassList(['mg-input--date']);
|
|
1539
1448
|
/**
|
|
1540
1449
|
* Handle input event
|
|
1541
1450
|
*/
|
|
@@ -1614,6 +1523,23 @@ const MgInputDate = class {
|
|
|
1614
1523
|
}
|
|
1615
1524
|
}
|
|
1616
1525
|
};
|
|
1526
|
+
this.value = undefined;
|
|
1527
|
+
this.identifier = undefined;
|
|
1528
|
+
this.name = this.identifier;
|
|
1529
|
+
this.label = undefined;
|
|
1530
|
+
this.labelOnTop = undefined;
|
|
1531
|
+
this.labelHide = false;
|
|
1532
|
+
this.required = false;
|
|
1533
|
+
this.readonly = false;
|
|
1534
|
+
this.disabled = false;
|
|
1535
|
+
this.tooltip = undefined;
|
|
1536
|
+
this.helpText = undefined;
|
|
1537
|
+
this.valid = undefined;
|
|
1538
|
+
this.invalid = undefined;
|
|
1539
|
+
this.min = undefined;
|
|
1540
|
+
this.max = undefined;
|
|
1541
|
+
this.classList = new ClassList(['mg-input--date']);
|
|
1542
|
+
this.errorMessage = undefined;
|
|
1617
1543
|
}
|
|
1618
1544
|
validateValue(newValue) {
|
|
1619
1545
|
if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !dateRegExp.test(newValue))) {
|
|
@@ -1716,53 +1642,6 @@ const MgInputNumeric = class {
|
|
|
1716
1642
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
1717
1643
|
// hasDisplayedError (triggered by blur event)
|
|
1718
1644
|
this.hasDisplayedError = false;
|
|
1719
|
-
/**
|
|
1720
|
-
* Input name
|
|
1721
|
-
* If not set the value equals the identifier
|
|
1722
|
-
*/
|
|
1723
|
-
this.name = this.identifier;
|
|
1724
|
-
/**
|
|
1725
|
-
* Define if label is visible
|
|
1726
|
-
*/
|
|
1727
|
-
this.labelHide = false;
|
|
1728
|
-
/**
|
|
1729
|
-
* Define if input is required
|
|
1730
|
-
*/
|
|
1731
|
-
this.required = false;
|
|
1732
|
-
/**
|
|
1733
|
-
* Define if input is readonly
|
|
1734
|
-
*/
|
|
1735
|
-
this.readonly = false;
|
|
1736
|
-
/**
|
|
1737
|
-
* Define if input is disabled
|
|
1738
|
-
*/
|
|
1739
|
-
this.disabled = false;
|
|
1740
|
-
/**
|
|
1741
|
-
* Define numeric type
|
|
1742
|
-
*/
|
|
1743
|
-
this.type = types[0];
|
|
1744
|
-
/**
|
|
1745
|
-
* Define currency
|
|
1746
|
-
*/
|
|
1747
|
-
this.currency = 'USD';
|
|
1748
|
-
/**
|
|
1749
|
-
* Override integer length
|
|
1750
|
-
* integer is the number before the decimal point
|
|
1751
|
-
*/
|
|
1752
|
-
this.integerLength = 13;
|
|
1753
|
-
/**
|
|
1754
|
-
* Override decimal length
|
|
1755
|
-
* decimal is the number after the decimal point
|
|
1756
|
-
*/
|
|
1757
|
-
this.decimalLength = 2;
|
|
1758
|
-
/**
|
|
1759
|
-
* Component classes
|
|
1760
|
-
*/
|
|
1761
|
-
this.classList = new ClassList(['mg-input--numeric']);
|
|
1762
|
-
/**
|
|
1763
|
-
* Define if input has focus
|
|
1764
|
-
*/
|
|
1765
|
-
this.hasFocus = false;
|
|
1766
1645
|
/**
|
|
1767
1646
|
* Handle input event
|
|
1768
1647
|
*
|
|
@@ -1869,6 +1748,30 @@ const MgInputNumeric = class {
|
|
|
1869
1748
|
this.classList.add(slotAppendInput.nodeName === 'MG-BUTTON' ? 'mg-input--is-input-group-append' : 'mg-input--is-append-input-slot-content');
|
|
1870
1749
|
}
|
|
1871
1750
|
};
|
|
1751
|
+
this.value = undefined;
|
|
1752
|
+
this.identifier = undefined;
|
|
1753
|
+
this.name = this.identifier;
|
|
1754
|
+
this.label = undefined;
|
|
1755
|
+
this.labelOnTop = undefined;
|
|
1756
|
+
this.labelHide = false;
|
|
1757
|
+
this.placeholder = undefined;
|
|
1758
|
+
this.required = false;
|
|
1759
|
+
this.readonly = false;
|
|
1760
|
+
this.disabled = false;
|
|
1761
|
+
this.mgWidth = undefined;
|
|
1762
|
+
this.tooltip = undefined;
|
|
1763
|
+
this.helpText = undefined;
|
|
1764
|
+
this.type = types[0];
|
|
1765
|
+
this.currency = 'USD';
|
|
1766
|
+
this.max = undefined;
|
|
1767
|
+
this.min = undefined;
|
|
1768
|
+
this.integerLength = 13;
|
|
1769
|
+
this.decimalLength = 2;
|
|
1770
|
+
this.valid = undefined;
|
|
1771
|
+
this.invalid = undefined;
|
|
1772
|
+
this.classList = new ClassList(['mg-input--numeric']);
|
|
1773
|
+
this.errorMessage = undefined;
|
|
1774
|
+
this.hasFocus = false;
|
|
1872
1775
|
}
|
|
1873
1776
|
validateValue(newValue) {
|
|
1874
1777
|
if (newValue !== undefined && newValue !== null) {
|
|
@@ -2000,35 +1903,6 @@ const MgInputPassword = class {
|
|
|
2000
1903
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
2001
1904
|
// hasDisplayedError (triggered by blur event)
|
|
2002
1905
|
this.hasDisplayedError = false;
|
|
2003
|
-
/**
|
|
2004
|
-
* Input name
|
|
2005
|
-
* If not set the value equals the identifier
|
|
2006
|
-
*/
|
|
2007
|
-
this.name = this.identifier;
|
|
2008
|
-
/**
|
|
2009
|
-
* Define if label is visible
|
|
2010
|
-
*/
|
|
2011
|
-
this.labelHide = false;
|
|
2012
|
-
/**
|
|
2013
|
-
* Define if input is required
|
|
2014
|
-
*/
|
|
2015
|
-
this.required = false;
|
|
2016
|
-
/**
|
|
2017
|
-
* Define if input is readonly
|
|
2018
|
-
*/
|
|
2019
|
-
this.readonly = false;
|
|
2020
|
-
/**
|
|
2021
|
-
* Define if input is disabled
|
|
2022
|
-
*/
|
|
2023
|
-
this.disabled = false;
|
|
2024
|
-
/**
|
|
2025
|
-
* Define input width
|
|
2026
|
-
*/
|
|
2027
|
-
this.mgWidth = 'full';
|
|
2028
|
-
/**
|
|
2029
|
-
* Component classes
|
|
2030
|
-
*/
|
|
2031
|
-
this.classList = new ClassList(['mg-input--password']);
|
|
2032
1906
|
/**
|
|
2033
1907
|
* Handle input event
|
|
2034
1908
|
*/
|
|
@@ -2066,6 +1940,23 @@ const MgInputPassword = class {
|
|
|
2066
1940
|
this.errorMessage = this.messages.errors.required;
|
|
2067
1941
|
}
|
|
2068
1942
|
};
|
|
1943
|
+
this.value = undefined;
|
|
1944
|
+
this.identifier = undefined;
|
|
1945
|
+
this.name = this.identifier;
|
|
1946
|
+
this.label = undefined;
|
|
1947
|
+
this.labelOnTop = undefined;
|
|
1948
|
+
this.labelHide = false;
|
|
1949
|
+
this.placeholder = undefined;
|
|
1950
|
+
this.required = false;
|
|
1951
|
+
this.readonly = false;
|
|
1952
|
+
this.disabled = false;
|
|
1953
|
+
this.mgWidth = 'full';
|
|
1954
|
+
this.tooltip = undefined;
|
|
1955
|
+
this.helpText = undefined;
|
|
1956
|
+
this.valid = undefined;
|
|
1957
|
+
this.invalid = undefined;
|
|
1958
|
+
this.classList = new ClassList(['mg-input--password']);
|
|
1959
|
+
this.errorMessage = undefined;
|
|
2069
1960
|
}
|
|
2070
1961
|
handleValue(newValue) {
|
|
2071
1962
|
this.valueChange.emit(newValue);
|
|
@@ -2150,39 +2041,6 @@ const MgInputRadio = class {
|
|
|
2150
2041
|
this.inputs = [];
|
|
2151
2042
|
// hasDisplayedError (triggered by blur event)
|
|
2152
2043
|
this.hasDisplayedError = false;
|
|
2153
|
-
/**
|
|
2154
|
-
* Input name
|
|
2155
|
-
* If not set the value equals the identifier
|
|
2156
|
-
*/
|
|
2157
|
-
this.name = this.identifier;
|
|
2158
|
-
/**
|
|
2159
|
-
* Define if label is displayed on top
|
|
2160
|
-
*/
|
|
2161
|
-
this.labelOnTop = false;
|
|
2162
|
-
/**
|
|
2163
|
-
* Define if label is visible
|
|
2164
|
-
*/
|
|
2165
|
-
this.labelHide = false;
|
|
2166
|
-
/**
|
|
2167
|
-
* Define if inputs are display verticaly
|
|
2168
|
-
*/
|
|
2169
|
-
this.inputVerticalList = false;
|
|
2170
|
-
/**
|
|
2171
|
-
* Define if input is required
|
|
2172
|
-
*/
|
|
2173
|
-
this.required = false;
|
|
2174
|
-
/**
|
|
2175
|
-
* Define if input is readonly
|
|
2176
|
-
*/
|
|
2177
|
-
this.readonly = false;
|
|
2178
|
-
/**
|
|
2179
|
-
* Define if input is disabled
|
|
2180
|
-
*/
|
|
2181
|
-
this.disabled = false;
|
|
2182
|
-
/**
|
|
2183
|
-
* Component classes
|
|
2184
|
-
*/
|
|
2185
|
-
this.classList = new ClassList(['mg-input--radio']);
|
|
2186
2044
|
/**
|
|
2187
2045
|
* Handle input event
|
|
2188
2046
|
*
|
|
@@ -2232,6 +2090,24 @@ const MgInputRadio = class {
|
|
|
2232
2090
|
* @returns {HTMLInputElement} element
|
|
2233
2091
|
*/
|
|
2234
2092
|
this.getInvalidElement = () => this.inputs.find((input) => !input.disabled && !input.readOnly && !input.checkValidity());
|
|
2093
|
+
this.value = undefined;
|
|
2094
|
+
this.items = undefined;
|
|
2095
|
+
this.identifier = undefined;
|
|
2096
|
+
this.name = this.identifier;
|
|
2097
|
+
this.label = undefined;
|
|
2098
|
+
this.labelOnTop = false;
|
|
2099
|
+
this.labelHide = false;
|
|
2100
|
+
this.inputVerticalList = false;
|
|
2101
|
+
this.required = false;
|
|
2102
|
+
this.readonly = false;
|
|
2103
|
+
this.disabled = false;
|
|
2104
|
+
this.tooltip = undefined;
|
|
2105
|
+
this.helpText = undefined;
|
|
2106
|
+
this.valid = undefined;
|
|
2107
|
+
this.invalid = undefined;
|
|
2108
|
+
this.classList = new ClassList(['mg-input--radio']);
|
|
2109
|
+
this.errorMessage = undefined;
|
|
2110
|
+
this.options = undefined;
|
|
2235
2111
|
}
|
|
2236
2112
|
handleValue(newValue) {
|
|
2237
2113
|
this.valueChange.emit(newValue);
|
|
@@ -2360,39 +2236,6 @@ const MgInputSelect = class {
|
|
|
2360
2236
|
this.inputValid = createEvent(this, "input-valid", 7);
|
|
2361
2237
|
// hasDisplayedError (triggered by blur event)
|
|
2362
2238
|
this.hasDisplayedError = false;
|
|
2363
|
-
/**
|
|
2364
|
-
* Input name
|
|
2365
|
-
* If not set the value equals the identifier
|
|
2366
|
-
*/
|
|
2367
|
-
this.name = this.identifier;
|
|
2368
|
-
/**
|
|
2369
|
-
* Define if label is visible
|
|
2370
|
-
*/
|
|
2371
|
-
this.labelHide = false;
|
|
2372
|
-
/**
|
|
2373
|
-
* Option to remove placeholder
|
|
2374
|
-
*/
|
|
2375
|
-
this.placeholderHide = false;
|
|
2376
|
-
/**
|
|
2377
|
-
* Option to disable placeholder
|
|
2378
|
-
*/
|
|
2379
|
-
this.placeholderDisabled = false;
|
|
2380
|
-
/**
|
|
2381
|
-
* Define if input is required
|
|
2382
|
-
*/
|
|
2383
|
-
this.required = false;
|
|
2384
|
-
/**
|
|
2385
|
-
* Define if input is readonly
|
|
2386
|
-
*/
|
|
2387
|
-
this.readonly = false;
|
|
2388
|
-
/**
|
|
2389
|
-
* Define if input is disabled
|
|
2390
|
-
*/
|
|
2391
|
-
this.disabled = false;
|
|
2392
|
-
/**
|
|
2393
|
-
* Component classes
|
|
2394
|
-
*/
|
|
2395
|
-
this.classList = new ClassList(['mg-input--select']);
|
|
2396
2239
|
/**
|
|
2397
2240
|
* Handle input event
|
|
2398
2241
|
*/
|
|
@@ -2434,6 +2277,29 @@ const MgInputSelect = class {
|
|
|
2434
2277
|
this.errorMessage = this.messages.errors.required;
|
|
2435
2278
|
}
|
|
2436
2279
|
};
|
|
2280
|
+
this.value = undefined;
|
|
2281
|
+
this.items = undefined;
|
|
2282
|
+
this.identifier = undefined;
|
|
2283
|
+
this.name = this.identifier;
|
|
2284
|
+
this.label = undefined;
|
|
2285
|
+
this.labelOnTop = undefined;
|
|
2286
|
+
this.labelHide = false;
|
|
2287
|
+
this.placeholder = undefined;
|
|
2288
|
+
this.placeholderHide = false;
|
|
2289
|
+
this.placeholderDisabled = false;
|
|
2290
|
+
this.required = false;
|
|
2291
|
+
this.readonly = false;
|
|
2292
|
+
this.disabled = false;
|
|
2293
|
+
this.mgWidth = undefined;
|
|
2294
|
+
this.tooltip = undefined;
|
|
2295
|
+
this.helpText = undefined;
|
|
2296
|
+
this.valid = undefined;
|
|
2297
|
+
this.invalid = undefined;
|
|
2298
|
+
this.classList = new ClassList(['mg-input--select']);
|
|
2299
|
+
this.errorMessage = undefined;
|
|
2300
|
+
this.options = undefined;
|
|
2301
|
+
this.valueExist = undefined;
|
|
2302
|
+
this.readonlyValue = undefined;
|
|
2437
2303
|
}
|
|
2438
2304
|
handleValue(newValue) {
|
|
2439
2305
|
if (newValue !== null) {
|
|
@@ -2549,47 +2415,6 @@ const MgInputText = class {
|
|
|
2549
2415
|
this.classHasIcon = 'mg-input--has-icon';
|
|
2550
2416
|
// hasDisplayedError (triggered by blur event)
|
|
2551
2417
|
this.hasDisplayedError = false;
|
|
2552
|
-
/**
|
|
2553
|
-
* Input name
|
|
2554
|
-
* If not set the value equals the identifier
|
|
2555
|
-
*/
|
|
2556
|
-
this.name = this.identifier;
|
|
2557
|
-
/**
|
|
2558
|
-
* Input type
|
|
2559
|
-
*/
|
|
2560
|
-
this.type = 'text';
|
|
2561
|
-
/**
|
|
2562
|
-
* Define if label is visible
|
|
2563
|
-
*/
|
|
2564
|
-
this.labelHide = false;
|
|
2565
|
-
/**
|
|
2566
|
-
* Input max length
|
|
2567
|
-
*/
|
|
2568
|
-
this.maxlength = 400;
|
|
2569
|
-
/**
|
|
2570
|
-
* Define if input is required
|
|
2571
|
-
*/
|
|
2572
|
-
this.required = false;
|
|
2573
|
-
/**
|
|
2574
|
-
* Define if input is readonly
|
|
2575
|
-
*/
|
|
2576
|
-
this.readonly = false;
|
|
2577
|
-
/**
|
|
2578
|
-
* Define if input is disabled
|
|
2579
|
-
*/
|
|
2580
|
-
this.disabled = false;
|
|
2581
|
-
/**
|
|
2582
|
-
* Define input width
|
|
2583
|
-
*/
|
|
2584
|
-
this.mgWidth = 'full';
|
|
2585
|
-
/**
|
|
2586
|
-
* Define if component should display character left
|
|
2587
|
-
*/
|
|
2588
|
-
this.displayCharacterLeft = true;
|
|
2589
|
-
/**
|
|
2590
|
-
* Component classes
|
|
2591
|
-
*/
|
|
2592
|
-
this.classList = new ClassList(['mg-input--text']);
|
|
2593
2418
|
/**
|
|
2594
2419
|
* Handle input event
|
|
2595
2420
|
*
|
|
@@ -2680,6 +2505,29 @@ const MgInputText = class {
|
|
|
2680
2505
|
this.classList.add('mg-input--has-buttons-group-append');
|
|
2681
2506
|
}
|
|
2682
2507
|
};
|
|
2508
|
+
this.value = undefined;
|
|
2509
|
+
this.identifier = undefined;
|
|
2510
|
+
this.name = this.identifier;
|
|
2511
|
+
this.label = undefined;
|
|
2512
|
+
this.type = 'text';
|
|
2513
|
+
this.icon = undefined;
|
|
2514
|
+
this.labelOnTop = undefined;
|
|
2515
|
+
this.labelHide = false;
|
|
2516
|
+
this.placeholder = undefined;
|
|
2517
|
+
this.maxlength = 400;
|
|
2518
|
+
this.required = false;
|
|
2519
|
+
this.readonly = false;
|
|
2520
|
+
this.disabled = false;
|
|
2521
|
+
this.mgWidth = 'full';
|
|
2522
|
+
this.pattern = undefined;
|
|
2523
|
+
this.patternErrorMessage = undefined;
|
|
2524
|
+
this.tooltip = undefined;
|
|
2525
|
+
this.displayCharacterLeft = true;
|
|
2526
|
+
this.helpText = undefined;
|
|
2527
|
+
this.valid = undefined;
|
|
2528
|
+
this.invalid = undefined;
|
|
2529
|
+
this.classList = new ClassList(['mg-input--text']);
|
|
2530
|
+
this.errorMessage = undefined;
|
|
2683
2531
|
}
|
|
2684
2532
|
handleValue(newValue) {
|
|
2685
2533
|
this.valueChange.emit(newValue);
|
|
@@ -2784,51 +2632,6 @@ const MgInputTextarea = class {
|
|
|
2784
2632
|
this.classHasDisplayCharacterLeft = 'mg-input--has-display-character-left';
|
|
2785
2633
|
// hasDisplayedError (triggered by blur event)
|
|
2786
2634
|
this.hasDisplayedError = false;
|
|
2787
|
-
/**
|
|
2788
|
-
* Input name
|
|
2789
|
-
* If not set the value equals the identifier
|
|
2790
|
-
*/
|
|
2791
|
-
this.name = this.identifier;
|
|
2792
|
-
/**
|
|
2793
|
-
* Define if label is visible
|
|
2794
|
-
*/
|
|
2795
|
-
this.labelHide = false;
|
|
2796
|
-
/**
|
|
2797
|
-
* Input max length
|
|
2798
|
-
*/
|
|
2799
|
-
this.maxlength = 4000;
|
|
2800
|
-
/**
|
|
2801
|
-
* Define if input is required
|
|
2802
|
-
*/
|
|
2803
|
-
this.required = false;
|
|
2804
|
-
/**
|
|
2805
|
-
* Define if input is readonly
|
|
2806
|
-
*/
|
|
2807
|
-
this.readonly = false;
|
|
2808
|
-
/**
|
|
2809
|
-
* Define if input is disabled
|
|
2810
|
-
*/
|
|
2811
|
-
this.disabled = false;
|
|
2812
|
-
/**
|
|
2813
|
-
* Define input width
|
|
2814
|
-
*/
|
|
2815
|
-
this.mgWidth = 'full';
|
|
2816
|
-
/**
|
|
2817
|
-
* Define the number of visible text lines for the control
|
|
2818
|
-
*/
|
|
2819
|
-
this.rows = 3;
|
|
2820
|
-
/**
|
|
2821
|
-
* Define if component should display character left
|
|
2822
|
-
*/
|
|
2823
|
-
this.displayCharacterLeft = true;
|
|
2824
|
-
/**
|
|
2825
|
-
* Define if input is resizable
|
|
2826
|
-
*/
|
|
2827
|
-
this.resizable = 'none';
|
|
2828
|
-
/**
|
|
2829
|
-
* Component classes
|
|
2830
|
-
*/
|
|
2831
|
-
this.classList = new ClassList(['mg-input--textarea']);
|
|
2832
2635
|
/**
|
|
2833
2636
|
* Handle input event
|
|
2834
2637
|
*/
|
|
@@ -2899,6 +2702,29 @@ const MgInputTextarea = class {
|
|
|
2899
2702
|
throw new Error('<mg-input-textarea> prop "pattern" must be paired with the prop "patternErrorMessage"');
|
|
2900
2703
|
}
|
|
2901
2704
|
};
|
|
2705
|
+
this.value = undefined;
|
|
2706
|
+
this.identifier = undefined;
|
|
2707
|
+
this.name = this.identifier;
|
|
2708
|
+
this.label = undefined;
|
|
2709
|
+
this.labelOnTop = undefined;
|
|
2710
|
+
this.labelHide = false;
|
|
2711
|
+
this.placeholder = undefined;
|
|
2712
|
+
this.maxlength = 4000;
|
|
2713
|
+
this.required = false;
|
|
2714
|
+
this.readonly = false;
|
|
2715
|
+
this.disabled = false;
|
|
2716
|
+
this.mgWidth = 'full';
|
|
2717
|
+
this.pattern = undefined;
|
|
2718
|
+
this.patternErrorMessage = undefined;
|
|
2719
|
+
this.rows = 3;
|
|
2720
|
+
this.tooltip = undefined;
|
|
2721
|
+
this.displayCharacterLeft = true;
|
|
2722
|
+
this.helpText = undefined;
|
|
2723
|
+
this.valid = undefined;
|
|
2724
|
+
this.invalid = undefined;
|
|
2725
|
+
this.resizable = 'none';
|
|
2726
|
+
this.classList = new ClassList(['mg-input--textarea']);
|
|
2727
|
+
this.errorMessage = undefined;
|
|
2902
2728
|
}
|
|
2903
2729
|
handleValue(newValue) {
|
|
2904
2730
|
this.checkValidity();
|
|
@@ -2986,17 +2812,13 @@ const mgInputTitleCss = ".is-asterisk.sc-mg-input-title{color:hsl(var(--color-da
|
|
|
2986
2812
|
const MgInputTitle = class {
|
|
2987
2813
|
constructor(hostRef) {
|
|
2988
2814
|
registerInstance(this, hostRef);
|
|
2989
|
-
/**
|
|
2990
|
-
* Switch from label to fieldset sementic
|
|
2991
|
-
*/
|
|
2992
|
-
this.isLegend = false;
|
|
2993
|
-
/**
|
|
2994
|
-
* Component parent tagname
|
|
2995
|
-
*/
|
|
2996
|
-
this.tagName = 'label';
|
|
2997
2815
|
this.getTagName = () => {
|
|
2998
2816
|
this.tagName = this.isLegend ? 'legend' : 'label';
|
|
2999
2817
|
};
|
|
2818
|
+
this.identifier = undefined;
|
|
2819
|
+
this.required = undefined;
|
|
2820
|
+
this.isLegend = false;
|
|
2821
|
+
this.tagName = 'label';
|
|
3000
2822
|
}
|
|
3001
2823
|
validateIdentifier(newValue) {
|
|
3002
2824
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -3054,39 +2876,6 @@ const MgInputToggle = class {
|
|
|
3054
2876
|
this.classIsActive = 'mg-input--toggle-is-active';
|
|
3055
2877
|
this.classOnOff = 'mg-input--toggle-on-off';
|
|
3056
2878
|
this.classIcon = 'mg-input--toggle-icon';
|
|
3057
|
-
/**
|
|
3058
|
-
* Input name
|
|
3059
|
-
* If not set the value equals the identifier
|
|
3060
|
-
*/
|
|
3061
|
-
this.name = this.identifier;
|
|
3062
|
-
/**
|
|
3063
|
-
* Define if label is visible
|
|
3064
|
-
*/
|
|
3065
|
-
this.labelHide = false;
|
|
3066
|
-
/**
|
|
3067
|
-
* Define if toggle have on/off style
|
|
3068
|
-
*/
|
|
3069
|
-
this.isOnOff = false;
|
|
3070
|
-
/**
|
|
3071
|
-
* Define if toggle display icon
|
|
3072
|
-
*/
|
|
3073
|
-
this.isIcon = false;
|
|
3074
|
-
/**
|
|
3075
|
-
* Define if input is readonly
|
|
3076
|
-
*/
|
|
3077
|
-
this.readonly = false;
|
|
3078
|
-
/**
|
|
3079
|
-
* Define if input is disabled
|
|
3080
|
-
*/
|
|
3081
|
-
this.disabled = false;
|
|
3082
|
-
/**
|
|
3083
|
-
* Component classes
|
|
3084
|
-
*/
|
|
3085
|
-
this.classList = new ClassList(['mg-input--toggle']);
|
|
3086
|
-
/**
|
|
3087
|
-
* Checked internal value
|
|
3088
|
-
*/
|
|
3089
|
-
this.checked = false;
|
|
3090
2879
|
/**
|
|
3091
2880
|
* Change checked value
|
|
3092
2881
|
*
|
|
@@ -3111,6 +2900,22 @@ const MgInputToggle = class {
|
|
|
3111
2900
|
slots.forEach(slot => slot.setAttribute('title', slot.textContent));
|
|
3112
2901
|
}
|
|
3113
2902
|
};
|
|
2903
|
+
this.value = undefined;
|
|
2904
|
+
this.items = undefined;
|
|
2905
|
+
this.identifier = undefined;
|
|
2906
|
+
this.name = this.identifier;
|
|
2907
|
+
this.label = undefined;
|
|
2908
|
+
this.labelOnTop = undefined;
|
|
2909
|
+
this.labelHide = false;
|
|
2910
|
+
this.isOnOff = false;
|
|
2911
|
+
this.isIcon = false;
|
|
2912
|
+
this.readonly = false;
|
|
2913
|
+
this.disabled = false;
|
|
2914
|
+
this.tooltip = undefined;
|
|
2915
|
+
this.helpText = undefined;
|
|
2916
|
+
this.classList = new ClassList(['mg-input--toggle']);
|
|
2917
|
+
this.options = undefined;
|
|
2918
|
+
this.checked = false;
|
|
3114
2919
|
}
|
|
3115
2920
|
handleValue(newValue) {
|
|
3116
2921
|
// Swich to the right option
|
|
@@ -3250,10 +3055,6 @@ const MgMenu = class {
|
|
|
3250
3055
|
************/
|
|
3251
3056
|
this.name = 'mg-menu';
|
|
3252
3057
|
this.focusedMenuItem = 0;
|
|
3253
|
-
/**
|
|
3254
|
-
* Component display direction. Default: "horizontal"
|
|
3255
|
-
*/
|
|
3256
|
-
this.direction = Direction.HORIZONTAL;
|
|
3257
3058
|
/**
|
|
3258
3059
|
* Close matching menu-item
|
|
3259
3060
|
*
|
|
@@ -3275,9 +3076,7 @@ const MgMenu = class {
|
|
|
3275
3076
|
// add listeners on menu item and edit index
|
|
3276
3077
|
this.menuItems.forEach((item, menuItemIndex) => {
|
|
3277
3078
|
['click', 'focus'].forEach(trigger => {
|
|
3278
|
-
(item.shadowRoot.querySelector('button') || item.shadowRoot.querySelector('a')).addEventListener(trigger, (
|
|
3279
|
-
event.preventDefault();
|
|
3280
|
-
event.stopPropagation();
|
|
3079
|
+
(item.shadowRoot.querySelector('button') || item.shadowRoot.querySelector('a')).addEventListener(trigger, () => {
|
|
3281
3080
|
this.focusedMenuItem = menuItemIndex;
|
|
3282
3081
|
// reset expanded on previous active menu item
|
|
3283
3082
|
this.menuItems.forEach((item, index) => {
|
|
@@ -3287,6 +3086,9 @@ const MgMenu = class {
|
|
|
3287
3086
|
});
|
|
3288
3087
|
});
|
|
3289
3088
|
};
|
|
3089
|
+
this.label = undefined;
|
|
3090
|
+
this.direction = Direction.HORIZONTAL;
|
|
3091
|
+
this.isChildMenu = undefined;
|
|
3290
3092
|
}
|
|
3291
3093
|
validateLabel(newValue) {
|
|
3292
3094
|
if (newValue === undefined) {
|
|
@@ -3373,7 +3175,7 @@ var Status$1;
|
|
|
3373
3175
|
*/
|
|
3374
3176
|
const sizes$1 = ['regular', 'medium', 'large'];
|
|
3375
3177
|
|
|
3376
|
-
const mgMenuItemCss = ".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}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding:1rem 2rem}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular ::slotted([slot=metadata]){font-size:1.3rem}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular.mg-menu-item__navigation-button--vertical{padding-left:calc(2rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding:1.5rem 3rem}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium ::slotted([slot=metadata]){font-size:1.5rem}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1.5rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium.mg-menu-item__navigation-button--vertical{padding-left:calc(3rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding:2.5rem 4rem}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large ::slotted([slot=metadata]){font-size:1.5rem}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(2.5rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large.mg-menu-item__navigation-button--vertical{padding-left:calc(4rem - 0.3rem)}.mg-menu-item__navigation-button{display:flex;align-items:center;column-gap:1rem;background-color:unset;border:none;font-family:var(--font-family);color:hsl(var(--mg-menu-item-color-hsl, var(--color-dark)));line-height:var(--line-height);text-decoration:none;cursor:pointer}.mg-menu-item__navigation-button:disabled,.mg-menu-item__navigation-button--disabled{cursor:default;opacity:30%}.mg-menu-item__navigation-button:focus-visible{z-index:10}.mg-menu-item__navigation-button:hover:not(.mg-menu-item__navigation-button--disabled),.mg-menu-item__navigation-button:focus:not(.mg-menu-item__navigation-button--disabled){background-color:hsla(var(--mg-menu-item-focused-background-color-hsl), 10%)}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active{color:hsl(var(--mg-menu-item-color-active-hsl));font-weight:700}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active.mg-menu-item__navigation-button--horizontal{border-bottom-color:hsl(var(--mg-menu-item-border-color-active-hsl))}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active.mg-menu-item__navigation-button--vertical{border-left-color:hsl(var(--mg-menu-item-border-color-active-hsl))}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--hidden{display:none}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal{border-bottom:0.3rem solid transparent}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical{border-left:0.3rem solid transparent}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(1 * 2rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(2 * 2rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(3 * 2rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(4 * 2rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(5 * 2rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(6 * 2rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(1 * 3rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(2 * 3rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(3 * 3rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(4 * 3rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(5 * 3rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(6 * 3rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(1 * 4rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(2 * 4rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(3 * 4rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(4 * 4rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(5 * 4rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(6 * 4rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host{position:relative;display:flex}:host([data-style-position-last]) .mg-menu-item__collapse-container{left:unset;right:0}:host([data-style-direction-vertical]){flex-direction:column}:host([data-style-direction-vertical]) .mg-menu-item__collapse-container{left:unset;top:unset;position:unset;width:unset}:host([data-style-direction-vertical]) .mg-menu-item-chevron{margin-left:auto}:host([data-style-direction-horizontal]) .mg-menu-item__collapse-container.mg-menu-item__collapse-container--first-level{box-shadow:var(--box-shadow);background-color:hsl(var(--color-light))}:host([data-style-direction-horizontal]) .mg-menu-item__collapse-container.mg-menu-item__collapse-container--first-level ::slotted(mg-menu){padding:1rem 0}.mg-menu-item{max-width:var(--mg-menu-item-navigation-button-max-width)}.mg-menu-item__collapse-container{position:absolute;top:100%;left:0;width:max-content;z-index:10}.mg-menu-item__navigation-button-center{min-width:0}.mg-menu-item__navigation-button-text-content{width:100%;display:flex}.mg-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:1rem}.mg-menu-item__navigation-button-chevron{margin-left:auto;transition:200ms}.mg-menu-item__navigation-button-chevron--rotate.mg-menu-item__navigation-button-chevron{transform:rotate(180deg)}::slotted([slot=label]),::slotted([slot=metadata]){display:block;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";
|
|
3178
|
+
const mgMenuItemCss = ".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}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding:1rem 2rem}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular ::slotted([slot=metadata]){font-size:1.3rem}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-regular .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular.mg-menu-item__navigation-button--vertical{padding-left:calc(2rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding:1.5rem 3rem}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium ::slotted([slot=metadata]){font-size:1.5rem}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(1.5rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-medium .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium.mg-menu-item__navigation-button--vertical{padding-left:calc(3rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding:2.5rem 4rem}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button,.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button ::slotted([slot=label]),.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button ::slotted([slot=metadata]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large ::slotted([slot=label]),.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large ::slotted([slot=metadata]){font-size:1.5rem}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large.mg-menu-item__navigation-button--horizontal{padding-bottom:calc(2.5rem - 0.3rem)}.mg-menu-item.mg-menu-item--size-large .mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical,.mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large.mg-menu-item__navigation-button--vertical{padding-left:calc(4rem - 0.3rem)}.mg-menu-item__navigation-button{display:flex;align-items:center;column-gap:1rem;background-color:unset;border:none;font-family:var(--font-family);color:hsl(var(--mg-menu-item-color-hsl, var(--color-dark)));line-height:var(--line-height);text-decoration:none;cursor:pointer}.mg-menu-item__navigation-button:disabled,.mg-menu-item__navigation-button--disabled{cursor:default;opacity:30%}.mg-menu-item__navigation-button:focus-visible{z-index:10}.mg-menu-item__navigation-button:hover:not(.mg-menu-item__navigation-button--disabled),.mg-menu-item__navigation-button:focus:not(.mg-menu-item__navigation-button--disabled){background-color:hsla(var(--mg-menu-item-focused-background-color-hsl), 10%)}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active{color:hsl(var(--mg-menu-item-color-active-hsl));font-weight:700}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active.mg-menu-item__navigation-button--horizontal{border-bottom-color:hsl(var(--mg-menu-item-border-color-active-hsl))}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--active.mg-menu-item__navigation-button--vertical{border-left-color:hsl(var(--mg-menu-item-border-color-active-hsl))}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--hidden{display:none}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--horizontal{border-bottom:0.3rem solid transparent}.mg-menu-item__navigation-button.mg-menu-item__navigation-button--vertical{border-left:0.3rem solid transparent}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(1 * 2rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(2 * 2rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(3 * 2rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(4 * 2rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(5 * 2rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-regular{padding-left:calc(6 * 2rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(1 * 3rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(2 * 3rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(3 * 3rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(4 * 3rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(5 * 3rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-medium{padding-left:calc(6 * 3rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host([data-style-direction-vertical][data-level=\"1\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(1 * 4rem - 0.3rem)}:host([data-level=\"1\"]) .mg-menu-item__collapse-container{z-index:calc(1 * 10)}:host([data-style-direction-vertical][data-level=\"2\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(2 * 4rem - 0.3rem)}:host([data-level=\"2\"]) .mg-menu-item__collapse-container{z-index:calc(2 * 10)}:host([data-style-direction-vertical][data-level=\"3\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(3 * 4rem - 0.3rem)}:host([data-level=\"3\"]) .mg-menu-item__collapse-container{z-index:calc(3 * 10)}:host([data-style-direction-vertical][data-level=\"4\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(4 * 4rem - 0.3rem)}:host([data-level=\"4\"]) .mg-menu-item__collapse-container{z-index:calc(4 * 10)}:host([data-style-direction-vertical][data-level=\"5\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(5 * 4rem - 0.3rem)}:host([data-level=\"5\"]) .mg-menu-item__collapse-container{z-index:calc(5 * 10)}:host([data-style-direction-vertical][data-level=\"6\"]) .mg-menu-item__navigation-button.mg-menu-item__navigation-button--size-large{padding-left:calc(6 * 4rem - 0.3rem)}:host([data-level=\"6\"]) .mg-menu-item__collapse-container{z-index:calc(6 * 10)}:host{position:relative;display:flex}:host([data-style-position-last]) .mg-menu-item__collapse-container{left:unset;right:0}:host([data-style-direction-vertical]){flex-direction:column}:host([data-style-direction-vertical]) .mg-menu-item__collapse-container{left:unset;top:unset;position:unset;width:unset}:host([data-style-direction-vertical]) .mg-menu-item-chevron{margin-left:auto}:host([data-style-direction-horizontal]) .mg-menu-item__collapse-container.mg-menu-item__collapse-container--first-level{box-shadow:var(--box-shadow);background-color:hsl(var(--color-light))}:host([data-style-direction-horizontal]) .mg-menu-item__collapse-container.mg-menu-item__collapse-container--first-level ::slotted(mg-menu){padding:1rem 0}.mg-menu-item{max-width:var(--mg-menu-item-navigation-button-max-width)}.mg-menu-item__collapse-container{position:absolute;top:100%;left:0;width:max-content;z-index:10}.mg-menu-item__navigation-button-center{min-width:0}.mg-menu-item__navigation-button-text-content{width:100%;display:flex}.mg-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:1rem}.mg-menu-item__navigation-button-chevron{margin-left:auto;transition:200ms}.mg-menu-item__navigation-button-chevron--rotate.mg-menu-item__navigation-button-chevron{transform:rotate(180deg)}::slotted([slot=label]),::slotted([slot=metadata]){display:block;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([status=disabled]){pointer-events:none}";
|
|
3377
3179
|
|
|
3378
3180
|
const MgMenuItem = class {
|
|
3379
3181
|
constructor(hostRef) {
|
|
@@ -3383,29 +3185,6 @@ const MgMenuItem = class {
|
|
|
3383
3185
|
************/
|
|
3384
3186
|
this.name = 'mg-menu-item';
|
|
3385
3187
|
this.navigationButton = `${this.name}__navigation-button`;
|
|
3386
|
-
/**
|
|
3387
|
-
* Define menu-item status. Default: "visible"
|
|
3388
|
-
*/
|
|
3389
|
-
this.status = Status$1.VISIBLE;
|
|
3390
|
-
/**
|
|
3391
|
-
* Define menu-item size. Default: "large".
|
|
3392
|
-
*/
|
|
3393
|
-
this.size = 'large';
|
|
3394
|
-
/**
|
|
3395
|
-
* Define menu-item content expanded. Default: false.
|
|
3396
|
-
*/
|
|
3397
|
-
this.expanded = false;
|
|
3398
|
-
/************
|
|
3399
|
-
* States *
|
|
3400
|
-
************/
|
|
3401
|
-
/**
|
|
3402
|
-
* Component button classes
|
|
3403
|
-
*/
|
|
3404
|
-
this.navigationButtonClassList = new ClassList([this.navigationButton]);
|
|
3405
|
-
/**
|
|
3406
|
-
* Does component have children. Default: false.
|
|
3407
|
-
*/
|
|
3408
|
-
this.hasChildren = false;
|
|
3409
3188
|
/************
|
|
3410
3189
|
* Methods *
|
|
3411
3190
|
************/
|
|
@@ -3442,10 +3221,22 @@ const MgMenuItem = class {
|
|
|
3442
3221
|
* @returns {void}
|
|
3443
3222
|
*/
|
|
3444
3223
|
this.handleElementCLick = (event) => {
|
|
3445
|
-
|
|
3224
|
+
if (this.hasChildren || this.status === Status$1.DISABLED) {
|
|
3225
|
+
event.preventDefault();
|
|
3226
|
+
event.stopPropagation();
|
|
3227
|
+
}
|
|
3228
|
+
// toggle expanded when mg-menu-item has child items
|
|
3446
3229
|
if (this.hasChildren)
|
|
3447
3230
|
this.toggleExpanded();
|
|
3448
3231
|
};
|
|
3232
|
+
this.href = undefined;
|
|
3233
|
+
this.status = Status$1.VISIBLE;
|
|
3234
|
+
this.size = 'large';
|
|
3235
|
+
this.expanded = false;
|
|
3236
|
+
this.navigationButtonClassList = new ClassList([this.navigationButton]);
|
|
3237
|
+
this.direction = undefined;
|
|
3238
|
+
this.isInMainMenu = undefined;
|
|
3239
|
+
this.hasChildren = false;
|
|
3449
3240
|
}
|
|
3450
3241
|
validateStatus(newValue, oldValue) {
|
|
3451
3242
|
if (oldValue !== undefined) {
|
|
@@ -3585,7 +3376,7 @@ MgMenuItem.style = mgMenuItemCss;
|
|
|
3585
3376
|
*/
|
|
3586
3377
|
const variants$1 = ['info', 'warning', 'success', 'danger'];
|
|
3587
3378
|
|
|
3588
|
-
const mgMessageCss = "
|
|
3379
|
+
const mgMessageCss = ":host{--mg-card-padding:0;--mg-card-border-radius:var(--mg-message-border-radius);--mg-card-border:none;--mg-card-overflow:hidden}.mg-message{display:inline-block;min-height:var(--default-size)}.mg-message__bar{position:absolute;top:0;left:0;width:0.3rem;height:100%}.mg-message.mg-message--info .mg-message__bar{background-color:hsl(var(--color-info))}.mg-message.mg-message--info .mg-message__icon{color:hsl(var(--color-info))}.mg-message.mg-message--warning .mg-message__bar{background-color:hsl(var(--color-warning))}.mg-message.mg-message--warning .mg-message__icon{color:hsl(var(--color-warning))}.mg-message.mg-message--success .mg-message__bar{background-color:hsl(var(--color-success))}.mg-message.mg-message--success .mg-message__icon{color:hsl(var(--color-success))}.mg-message.mg-message--danger .mg-message__bar{background-color:hsl(var(--color-danger))}.mg-message.mg-message--danger .mg-message__icon{color:hsl(var(--color-danger))}.mg-message.mg-message--close-button{--mg-card-padding:0 3.4rem 0 0}.mg-message.mg-message--hide{display:none}.mg-message ::slotted(*){margin:0;padding:0}.mg-message__icon{position:absolute;top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2);left:1.3rem;line-height:1}.mg-message__content{display:flex;flex-wrap:wrap;justify-content:flex-end;align-content:stretch;padding:0 1rem 0 3.8rem}.mg-message__content-slot{flex-grow:1;margin:0.84rem 0}.mg-message__content-separator{display:inline-block;width:4.5rem;height:0}.mg-message__content-actions-slot{padding:1rem 0;text-align:right}.mg-message__close-button{position:absolute;top:0;right:0}.mg-message,mg-message{max-width:100%}";
|
|
3589
3380
|
|
|
3590
3381
|
const MgMessage = class {
|
|
3591
3382
|
constructor(hostRef) {
|
|
@@ -3601,32 +3392,6 @@ const MgMessage = class {
|
|
|
3601
3392
|
this.closeButtonId = '';
|
|
3602
3393
|
// Stored timer setted when hide action is run from setTimeOut
|
|
3603
3394
|
this.storedTimer = null;
|
|
3604
|
-
/**
|
|
3605
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
3606
|
-
* If not set, it will be created.
|
|
3607
|
-
*/
|
|
3608
|
-
this.identifier = createID('mg-message');
|
|
3609
|
-
/**
|
|
3610
|
-
* Message variant
|
|
3611
|
-
*/
|
|
3612
|
-
this.variant = variants$1[0]; // info
|
|
3613
|
-
/**
|
|
3614
|
-
* Define if message has a cross button
|
|
3615
|
-
* RG 01: https://jira.mgdis.fr/browse/PDA9-140
|
|
3616
|
-
*/
|
|
3617
|
-
this.closeButton = false;
|
|
3618
|
-
/**
|
|
3619
|
-
* Define if message is hidden
|
|
3620
|
-
*/
|
|
3621
|
-
this.hide = false;
|
|
3622
|
-
/**
|
|
3623
|
-
* Component classes
|
|
3624
|
-
*/
|
|
3625
|
-
this.classList = new ClassList(['mg-message']);
|
|
3626
|
-
/**
|
|
3627
|
-
* Define if component is using actions slot
|
|
3628
|
-
*/
|
|
3629
|
-
this.hasActions = false;
|
|
3630
3395
|
/**
|
|
3631
3396
|
* Handle close button
|
|
3632
3397
|
*/
|
|
@@ -3661,6 +3426,13 @@ const MgMessage = class {
|
|
|
3661
3426
|
return 'exclamation-circle';
|
|
3662
3427
|
}
|
|
3663
3428
|
};
|
|
3429
|
+
this.identifier = createID('mg-message');
|
|
3430
|
+
this.delay = undefined;
|
|
3431
|
+
this.variant = variants$1[0];
|
|
3432
|
+
this.closeButton = false;
|
|
3433
|
+
this.hide = false;
|
|
3434
|
+
this.classList = new ClassList(['mg-message']);
|
|
3435
|
+
this.hasActions = false;
|
|
3664
3436
|
}
|
|
3665
3437
|
validateDelay(newValue) {
|
|
3666
3438
|
if (newValue && newValue < 2) {
|
|
@@ -3722,7 +3494,7 @@ const MgMessage = class {
|
|
|
3722
3494
|
* @returns {HTMLElement} HTML Element
|
|
3723
3495
|
*/
|
|
3724
3496
|
render() {
|
|
3725
|
-
return (h("div", { id: this.identifier, class: this.classList.join(), role: this.variant === 'info' ? 'status' : 'alert' }, h("span", { class: "mg-message__icon" }, h("mg-icon", { icon: this.getIcon() })), h("div", { class: "mg-message__content" }, h("span", { class: "mg-message__content-slot" }, h("slot", null)), this.hasActions && h("span", { class: "mg-message__content-separator" }), this.hasActions && (h("span", { class: "mg-message__content-actions-slot" }, h("slot", { name: "actions" })))), this.closeButton && (h("span", { class: "mg-message__close-button" }, h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" }))))));
|
|
3497
|
+
return (h("div", { id: this.identifier, class: this.classList.join(), role: this.variant === 'info' ? 'status' : 'alert' }, h("mg-card", null, h("span", { class: "mg-message__bar" }), h("span", { class: "mg-message__icon" }, h("mg-icon", { icon: this.getIcon() })), h("div", { class: "mg-message__content" }, h("span", { class: "mg-message__content-slot" }, h("slot", null)), this.hasActions && h("span", { class: "mg-message__content-separator" }), this.hasActions && (h("span", { class: "mg-message__content-actions-slot" }, h("slot", { name: "actions" })))), this.closeButton && (h("span", { class: "mg-message__close-button" }, h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" })))))));
|
|
3726
3498
|
}
|
|
3727
3499
|
get element() { return getElement(this); }
|
|
3728
3500
|
static get watchers() { return {
|
|
@@ -3734,7 +3506,7 @@ const MgMessage = class {
|
|
|
3734
3506
|
};
|
|
3735
3507
|
MgMessage.style = mgMessageCss;
|
|
3736
3508
|
|
|
3737
|
-
const mgModalCss = ".mg-modal{display:flex;justify-content:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;padding:2rem 0;background-color:hsla(var(--color-light), 85%)}.mg-modal__dialog{display:flex;position:relative;flex-direction:column;align-self:center;row-gap:3rem;
|
|
3509
|
+
const mgModalCss = ":host{--mg-card-border-radius:var(--mg-modal-border-radius);--mg-card-padding:1.5rem 2.5rem;--mg-card-border:none}.mg-modal{display:flex;justify-content:center;align-items:center;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;padding:2rem 0;background-color:hsla(var(--color-light), 85%)}.mg-modal mg-card{display:flex;width:60rem;max-width:100%;max-height:100%}.mg-modal__dialog{display:flex;position:relative;flex-direction:column;align-self:center;row-gap:3rem;height:fit-content;max-height:100%}.mg-modal__header{margin-bottom:0.5rem}.mg-modal__title{margin:0;font-family:var(--font-family-heading);font-size:var(--mg-modal-title-font-size);font-weight:600}.mg-modal__close-button{float:right;height:var(--mg-modal-title-font-size);margin-top:calc((var(--default-size) - var(--mg-modal-title-font-size) * var(--line-height)) / 2 * -1);margin-right:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2 * -1)}.mg-modal__content{overflow-y:auto}.mg-modal__content::slotted(*){font-size:var(--mg-modal-content-font-size)}.mg-modal.mg-modal--hide{display:none}";
|
|
3738
3510
|
|
|
3739
3511
|
const MgModal = class {
|
|
3740
3512
|
constructor(hostRef) {
|
|
@@ -3746,31 +3518,6 @@ const MgModal = class {
|
|
|
3746
3518
|
// IDs
|
|
3747
3519
|
this.closeButtonId = '';
|
|
3748
3520
|
this.titleId = '';
|
|
3749
|
-
/**
|
|
3750
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
3751
|
-
* If not set, it will be created.
|
|
3752
|
-
*/
|
|
3753
|
-
this.identifier = createID('mg-modal');
|
|
3754
|
-
/**
|
|
3755
|
-
* Define if modal has a cross button
|
|
3756
|
-
*/
|
|
3757
|
-
this.closeButton = false;
|
|
3758
|
-
/**
|
|
3759
|
-
* Define if modal is hidden
|
|
3760
|
-
*/
|
|
3761
|
-
this.hide = false;
|
|
3762
|
-
/**
|
|
3763
|
-
* Define if component is using actions slot
|
|
3764
|
-
*/
|
|
3765
|
-
this.hasActions = false;
|
|
3766
|
-
/**
|
|
3767
|
-
* Define if component is using content slot
|
|
3768
|
-
*/
|
|
3769
|
-
this.hasContent = false;
|
|
3770
|
-
/**
|
|
3771
|
-
* Component classes
|
|
3772
|
-
*/
|
|
3773
|
-
this.classList = new ClassList(['mg-modal']);
|
|
3774
3521
|
this.setFocus = () => {
|
|
3775
3522
|
// Get all focusable elements
|
|
3776
3523
|
this.modalFocusableElements = Array.from(this.element.querySelectorAll(focusableElements)).reduce((acc, focusableElement) => {
|
|
@@ -3813,6 +3560,13 @@ const MgModal = class {
|
|
|
3813
3560
|
this.handleClose = () => {
|
|
3814
3561
|
this.hide = true;
|
|
3815
3562
|
};
|
|
3563
|
+
this.identifier = createID('mg-modal');
|
|
3564
|
+
this.modalTitle = undefined;
|
|
3565
|
+
this.closeButton = false;
|
|
3566
|
+
this.hide = false;
|
|
3567
|
+
this.hasActions = false;
|
|
3568
|
+
this.hasContent = false;
|
|
3569
|
+
this.classList = new ClassList(['mg-modal']);
|
|
3816
3570
|
}
|
|
3817
3571
|
validateModalTitle(newValue) {
|
|
3818
3572
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -3888,7 +3642,7 @@ const MgModal = class {
|
|
|
3888
3642
|
* @returns {HTMLElement} HTML Element
|
|
3889
3643
|
*/
|
|
3890
3644
|
render() {
|
|
3891
|
-
return (h("
|
|
3645
|
+
return (h("div", { role: "alertdialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, h("mg-card", null, h("div", { class: "mg-modal__dialog" }, h("header", { class: "mg-modal__header" }, this.closeButton && (h("span", { class: "mg-modal__close-button" }, h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { icon: "cross" })))), h("h1", { class: "mg-modal__title", id: this.titleId }, this.modalTitle)), this.hasContent && (h("article", { class: "mg-modal__content" }, h("slot", { name: "content" }))), this.hasActions && (h("footer", { class: "mg-modal__footer" }, h("slot", { name: "actions" })))))));
|
|
3892
3646
|
}
|
|
3893
3647
|
get element() { return getElement(this); }
|
|
3894
3648
|
static get watchers() { return {
|
|
@@ -3931,19 +3685,6 @@ const MgPagination = class {
|
|
|
3931
3685
|
constructor(hostRef) {
|
|
3932
3686
|
registerInstance(this, hostRef);
|
|
3933
3687
|
this.currentPageChange = createEvent(this, "current-page-change", 7);
|
|
3934
|
-
/**
|
|
3935
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
3936
|
-
* If not set, it will be created.
|
|
3937
|
-
*/
|
|
3938
|
-
this.identifier = createID('mg-pagination');
|
|
3939
|
-
/**
|
|
3940
|
-
* Component total pages
|
|
3941
|
-
*/
|
|
3942
|
-
this.totalPages = 1;
|
|
3943
|
-
/**
|
|
3944
|
-
* Component current page
|
|
3945
|
-
*/
|
|
3946
|
-
this.currentPage = 1;
|
|
3947
3688
|
/**
|
|
3948
3689
|
* Change current page from target
|
|
3949
3690
|
*
|
|
@@ -3976,6 +3717,10 @@ const MgPagination = class {
|
|
|
3976
3717
|
this.handleGoToPage = (action, disabled) => {
|
|
3977
3718
|
!disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
|
|
3978
3719
|
};
|
|
3720
|
+
this.identifier = createID('mg-pagination');
|
|
3721
|
+
this.label = undefined;
|
|
3722
|
+
this.totalPages = 1;
|
|
3723
|
+
this.currentPage = 1;
|
|
3979
3724
|
}
|
|
3980
3725
|
validateTotalPages(newValue) {
|
|
3981
3726
|
if (newValue < 1) {
|
|
@@ -4029,34 +3774,13 @@ const MgPagination = class {
|
|
|
4029
3774
|
};
|
|
4030
3775
|
MgPagination.style = mgPaginationCss;
|
|
4031
3776
|
|
|
4032
|
-
const mgPanelCss = "
|
|
3777
|
+
const mgPanelCss = ":host{--mg-card-border:none;--mg-card-padding:0;--mg-card-border-radius:var(--mg-panel-border-radius);--mg-card-background:hsl(var(--mg-panel-background));--mg-card-box-shadow:var(--mg-panel-box-shadow)}.mg-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 1rem 0 0.3rem;align-items:flex-start}.mg-panel__header-left,.mg-panel__header-right{display:flex;margin:0.3rem 0}.mg-panel__header-right{padding-left:0.3rem;flex:1 auto;min-height:var(--default-size);align-items:center}.mg-panel__header-left mg-input-text{flex-grow:1;margin-left:0.3rem}.mg-panel__header-left mg-button+mg-button:not([slot=append-input]){margin-left:0.3rem}.mg-panel__header-left.mg-panel__header-left--full{flex:1 1 auto}.mg-panel__collapse-button-content{--font-size:1.4rem;--mg-button-font-weight:600}.mg-panel__content{padding:var(--mg-panel-content-padding)}.mg-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;gap:1rem;margin-left:auto}";
|
|
4033
3778
|
|
|
4034
3779
|
const MgPanel = class {
|
|
4035
3780
|
constructor(hostRef) {
|
|
4036
3781
|
registerInstance(this, hostRef);
|
|
4037
3782
|
this.titleChange = createEvent(this, "title-change", 7);
|
|
4038
3783
|
this.expandedChange = createEvent(this, "expanded-change", 7);
|
|
4039
|
-
/**
|
|
4040
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
4041
|
-
* If not set, it will be created.
|
|
4042
|
-
*/
|
|
4043
|
-
this.identifier = createID('mg-panel');
|
|
4044
|
-
/**
|
|
4045
|
-
* Panel is opened
|
|
4046
|
-
*/
|
|
4047
|
-
this.expanded = false;
|
|
4048
|
-
/**
|
|
4049
|
-
* Panel title is editabled
|
|
4050
|
-
*/
|
|
4051
|
-
this.titleEditable = false;
|
|
4052
|
-
/**
|
|
4053
|
-
* Component classes
|
|
4054
|
-
*/
|
|
4055
|
-
this.classList = new ClassList(['mg-panel']);
|
|
4056
|
-
/**
|
|
4057
|
-
* Title is in edition mode
|
|
4058
|
-
*/
|
|
4059
|
-
this.isEditing = false;
|
|
4060
3784
|
/************
|
|
4061
3785
|
* Methods *
|
|
4062
3786
|
************/
|
|
@@ -4141,6 +3865,16 @@ const MgPanel = class {
|
|
|
4141
3865
|
}
|
|
4142
3866
|
return collapseButton();
|
|
4143
3867
|
};
|
|
3868
|
+
this.identifier = createID('mg-panel');
|
|
3869
|
+
this.panelTitle = undefined;
|
|
3870
|
+
this.titlePattern = undefined;
|
|
3871
|
+
this.titlePatternErrorMessage = undefined;
|
|
3872
|
+
this.expanded = false;
|
|
3873
|
+
this.expandToggleDisabled = undefined;
|
|
3874
|
+
this.titleEditable = false;
|
|
3875
|
+
this.classList = new ClassList(['mg-panel']);
|
|
3876
|
+
this.isEditing = false;
|
|
3877
|
+
this.updatedPanelTitle = undefined;
|
|
4144
3878
|
}
|
|
4145
3879
|
validatePanelTitle(newValue) {
|
|
4146
3880
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -4191,7 +3925,7 @@ const MgPanel = class {
|
|
|
4191
3925
|
* @returns {HTMLElement} html element
|
|
4192
3926
|
*/
|
|
4193
3927
|
render() {
|
|
4194
|
-
return (h("section", { class: this.classList.join(), id: this.identifier }, h("header", { class: "mg-panel__header", id: `${this.identifier}-header` }, h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()), h("div", { class: "mg-panel__header-right" }, h("slot", { name: "header-right" }))), h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded }, h("slot", null))));
|
|
3928
|
+
return (h("section", { class: this.classList.join(), id: this.identifier }, h("mg-card", null, h("header", { class: "mg-panel__header", id: `${this.identifier}-header` }, h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()), h("div", { class: "mg-panel__header-right" }, h("slot", { name: "header-right" }))), h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded }, h("slot", null)))));
|
|
4195
3929
|
}
|
|
4196
3930
|
get element() { return getElement(this); }
|
|
4197
3931
|
static get watchers() { return {
|
|
@@ -6000,34 +5734,13 @@ var createPopper = /*#__PURE__*/popperGenerator({
|
|
|
6000
5734
|
defaultModifiers: defaultModifiers
|
|
6001
5735
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
6002
5736
|
|
|
6003
|
-
const mgPopoverCss = "
|
|
5737
|
+
const mgPopoverCss = ":host{--mg-card-padding:1.5rem;--mg-card-border:none;--mg-card-border-radius:0.5rem;--mg-card-background:hsl(var(--mg-popover-background-color));position:relative;display:contents}:host::slotted(*){display:inline-block}.mg-popover{display:none;z-index:2000;color:hsl(var(--mg-popover-font-color))}.mg-popover mg-card{z-index:-1}.mg-popover[data-show]{display:block}.mg-popover mg-button{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__arrow,.mg-popover__arrow::before{position:absolute;width:2rem;height:2rem;z-index:2000;background:hsl(var(--mg-popover-background-color))}.mg-popover__arrow{visibility:hidden}.mg-popover__arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-popover[data-popper-placement^=top]>.mg-popover__arrow{bottom:-6px}.mg-popover[data-popper-placement^=bottom]>.mg-popover__arrow{top:-6px}.mg-popover[data-popper-placement^=left]>.mg-popover__arrow{right:-6px}.mg-popover[data-popper-placement^=right]>.mg-popover__arrow{left:-6px}.mg-popover__title ::slotted([slot=title]){margin:0 0 1rem !important;font-size:var(--mg-popover-title-font-size) !important;font-weight:600}";
|
|
6004
5738
|
|
|
6005
5739
|
const MgPopover = class {
|
|
6006
5740
|
constructor(hostRef) {
|
|
6007
5741
|
registerInstance(this, hostRef);
|
|
6008
5742
|
this.displayChange = createEvent(this, "display-change", 7);
|
|
6009
5743
|
this.closeButtonId = '';
|
|
6010
|
-
/**
|
|
6011
|
-
* Sets an `id` attribute.
|
|
6012
|
-
* Needed by the input for accessibility `aria-decribedby`.
|
|
6013
|
-
*/
|
|
6014
|
-
this.identifier = createID('mg-popover');
|
|
6015
|
-
/**
|
|
6016
|
-
* Popover placement
|
|
6017
|
-
*/
|
|
6018
|
-
this.placement = 'bottom';
|
|
6019
|
-
/**
|
|
6020
|
-
* Define if popover has a cross button
|
|
6021
|
-
*/
|
|
6022
|
-
this.closeButton = false;
|
|
6023
|
-
/**
|
|
6024
|
-
* Display popover
|
|
6025
|
-
*/
|
|
6026
|
-
this.display = false;
|
|
6027
|
-
/**
|
|
6028
|
-
* Disable popover
|
|
6029
|
-
*/
|
|
6030
|
-
this.disabled = false;
|
|
6031
5744
|
/**
|
|
6032
5745
|
* Check if clicked outside of component
|
|
6033
5746
|
*
|
|
@@ -6078,6 +5791,11 @@ const MgPopover = class {
|
|
|
6078
5791
|
this.handleCloseButton = () => {
|
|
6079
5792
|
this.display = false;
|
|
6080
5793
|
};
|
|
5794
|
+
this.identifier = createID('mg-popover');
|
|
5795
|
+
this.placement = 'bottom';
|
|
5796
|
+
this.closeButton = false;
|
|
5797
|
+
this.display = false;
|
|
5798
|
+
this.disabled = false;
|
|
6081
5799
|
}
|
|
6082
5800
|
handleDisplay(newValue) {
|
|
6083
5801
|
if (newValue) {
|
|
@@ -6116,7 +5834,7 @@ const MgPopover = class {
|
|
|
6116
5834
|
this.closeButtonId = `${this.identifier}-close-button`;
|
|
6117
5835
|
}
|
|
6118
5836
|
// Get popover content
|
|
6119
|
-
this.popover = this.element.shadowRoot.
|
|
5837
|
+
this.popover = this.element.shadowRoot.getElementById(this.identifier);
|
|
6120
5838
|
//Get interactive element (first element without slot attribute)
|
|
6121
5839
|
const interactiveElement = this.element.querySelector(':not([slot])');
|
|
6122
5840
|
// Add aria attributes
|
|
@@ -6153,7 +5871,7 @@ const MgPopover = class {
|
|
|
6153
5871
|
* @returns {HTMLElement} HTML Element
|
|
6154
5872
|
*/
|
|
6155
5873
|
render() {
|
|
6156
|
-
return (h(Host, null, h("slot", null), h("div", { id: this.identifier, class: "mg-popover" }, 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 }))));
|
|
5874
|
+
return (h(Host, null, h("slot", null), h("div", { id: this.identifier, class: "mg-popover" }, h("mg-card", null, !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 }))));
|
|
6157
5875
|
}
|
|
6158
5876
|
get element() { return getElement(this); }
|
|
6159
5877
|
static get watchers() { return {
|
|
@@ -6162,6 +5880,47 @@ const MgPopover = class {
|
|
|
6162
5880
|
};
|
|
6163
5881
|
MgPopover.style = mgPopoverCss;
|
|
6164
5882
|
|
|
5883
|
+
const mgSkipLinksCss = ".mg-skip-links{position:absolute;transform:translateY(-100%);opacity:0;background:hsl(var(--color-light))}.mg-skip-links:focus-within{position:relative;transform:translateY(0);opacity:1}.mg-skip-links__list{display:flex;flex-wrap:wrap;align-items:center;gap:0.6rem;margin:0;padding:0.64rem 1.8rem;list-style:none}.mg-skip-links__link{display:inline-block;padding:1.2rem;color:hsl(var(--color-dark))}.mg-skip-links__link:hover{background:hsl(var(--color-dark), 0.1)}";
|
|
5884
|
+
|
|
5885
|
+
const MgSkipLinks = class {
|
|
5886
|
+
constructor(hostRef) {
|
|
5887
|
+
registerInstance(this, hostRef);
|
|
5888
|
+
this.links = undefined;
|
|
5889
|
+
}
|
|
5890
|
+
validateLinks(links) {
|
|
5891
|
+
if (links === undefined ||
|
|
5892
|
+
links.length === 0 ||
|
|
5893
|
+
links.some(link => link.href === undefined || !link.href.startsWith('#') || link.label === undefined || link.label.trim() === '')) {
|
|
5894
|
+
throw new Error(`<mg-skip-links> prop "links": Cannot be empty and each link must contains an href starting with a "#" and a non empty label attributes.`);
|
|
5895
|
+
}
|
|
5896
|
+
}
|
|
5897
|
+
/*************
|
|
5898
|
+
* Lifecycle *
|
|
5899
|
+
*************/
|
|
5900
|
+
/**
|
|
5901
|
+
* Check if props are well configured on init
|
|
5902
|
+
*
|
|
5903
|
+
* @returns {void}
|
|
5904
|
+
*/
|
|
5905
|
+
componentWillLoad() {
|
|
5906
|
+
this.validateLinks(this.links);
|
|
5907
|
+
this.messages = initLocales(this.element).messages;
|
|
5908
|
+
}
|
|
5909
|
+
/**
|
|
5910
|
+
* Render
|
|
5911
|
+
*
|
|
5912
|
+
* @returns {HTMLElement} HTML Element
|
|
5913
|
+
*/
|
|
5914
|
+
render() {
|
|
5915
|
+
return (h("nav", { class: "mg-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, h("ul", { class: "mg-skip-links__list" }, this.links.map(link => (h("li", null, h("a", { class: "mg-skip-links__link", href: link.href }, link.label)))))));
|
|
5916
|
+
}
|
|
5917
|
+
get element() { return getElement(this); }
|
|
5918
|
+
static get watchers() { return {
|
|
5919
|
+
"links": ["validateLinks"]
|
|
5920
|
+
}; }
|
|
5921
|
+
};
|
|
5922
|
+
MgSkipLinks.style = mgSkipLinksCss;
|
|
5923
|
+
|
|
6165
5924
|
/**
|
|
6166
5925
|
* Available tabs items status
|
|
6167
5926
|
*/
|
|
@@ -6193,31 +5952,11 @@ const MgTabs = class {
|
|
|
6193
5952
|
/************
|
|
6194
5953
|
* Internal *
|
|
6195
5954
|
************/
|
|
5955
|
+
// classes
|
|
6196
5956
|
this.tabPanel = 'panel';
|
|
6197
|
-
this.startIndex = 1;
|
|
6198
5957
|
this.buttonTabBaseClass = 'mg-tabs__navigation-button';
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
* If not set, it will be created.
|
|
6202
|
-
*/
|
|
6203
|
-
this.identifier = createID('mg-tabs');
|
|
6204
|
-
/**
|
|
6205
|
-
* Define tabs size
|
|
6206
|
-
*/
|
|
6207
|
-
this.size = 'regular';
|
|
6208
|
-
/**
|
|
6209
|
-
* Active tab number
|
|
6210
|
-
* default: first is 1
|
|
6211
|
-
*/
|
|
6212
|
-
this.activeTab = 1;
|
|
6213
|
-
/**
|
|
6214
|
-
* Component tabs
|
|
6215
|
-
*/
|
|
6216
|
-
this.tabs = [];
|
|
6217
|
-
/**
|
|
6218
|
-
* Component classes
|
|
6219
|
-
*/
|
|
6220
|
-
this.classList = new ClassList(['mg-tabs']);
|
|
5958
|
+
// variables
|
|
5959
|
+
this.startIndex = 1;
|
|
6221
5960
|
/**
|
|
6222
5961
|
* Method to set active tab
|
|
6223
5962
|
*
|
|
@@ -6308,6 +6047,13 @@ const MgTabs = class {
|
|
|
6308
6047
|
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
6309
6048
|
}
|
|
6310
6049
|
};
|
|
6050
|
+
this.identifier = createID('mg-tabs');
|
|
6051
|
+
this.label = undefined;
|
|
6052
|
+
this.size = 'regular';
|
|
6053
|
+
this.items = undefined;
|
|
6054
|
+
this.activeTab = 1;
|
|
6055
|
+
this.tabs = [];
|
|
6056
|
+
this.classList = new ClassList(['mg-tabs']);
|
|
6311
6057
|
}
|
|
6312
6058
|
validateLabel(newValue) {
|
|
6313
6059
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -6386,7 +6132,7 @@ MgTabs.style = mgTabsCss;
|
|
|
6386
6132
|
*/
|
|
6387
6133
|
const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'];
|
|
6388
6134
|
|
|
6389
|
-
const mgTagCss = ".mg-tag{padding:calc((var(--mg-tag-height) - 0.2rem - var(--mg-tag-font-size) * var(--line-height)) / 2) 0.6rem;min-height:var(--mg-tag-height);box-sizing:border-box;border-radius:var(--mg-tag-border-radius);border:0.1rem solid;font-size:var(--mg-tag-font-size);font-weight:600;text-align:center}.mg-tag.mg-tag--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-tag.mg-tag--primary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary{background-color:hsl(var(--color-light));border-color:hsl(var(--color-light));color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-light))}.mg-tag.mg-tag--success{background-color:hsl(var(--color-success));border-color:hsl(var(--color-success));color:hsl(var(--color-dark))}.mg-tag.mg-tag--success.mg-tag--outline{background-color:transparent;color:hsl(var(--color-success))}.mg-tag.mg-tag--warning{background-color:hsl(var(--color-warning));border-color:hsl(var(--color-warning));color:hsl(var(--color-dark))}.mg-tag.mg-tag--warning.mg-tag--outline{background-color:transparent;color:hsl(var(--color-warning))}.mg-tag.mg-tag--danger{background-color:hsl(var(--color-danger));border-color:hsl(var(--color-danger));color:hsl(var(--color-light))}.mg-tag.mg-tag--danger.mg-tag--outline{background-color:transparent;color:hsl(var(--color-danger))}.mg-tag.mg-tag--info{background-color:hsl(var(--color-info));border-color:hsl(var(--color-info));color:hsl(var(--color-light))}.mg-tag.mg-tag--info.mg-tag--outline{background-color:transparent;color:hsl(var(--color-info))}.mg-tag,mg-tag{display:inline-block;vertical-align:middle}";
|
|
6135
|
+
const mgTagCss = ".mg-tag{padding:calc((var(--mg-tag-height) - 0.2rem - var(--mg-tag-font-size) * var(--line-height)) / 2) 0.6rem;min-height:var(--mg-tag-height);box-sizing:border-box;border-radius:var(--mg-tag-border-radius);border:0.1rem solid;font-size:var(--mg-tag-font-size);font-weight:600;text-align:center}.mg-tag.mg-tag--primary{background-color:hsl(var(--color-dark));border-color:hsl(var(--color-dark));color:hsl(var(--color-light))}.mg-tag.mg-tag--primary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-dark))}.mg-tag.mg-tag--primary.mg-tag--soft{font-weight:200;background-color:hsl(var(--color-dark-h), var(--color-dark-s), 90%);border-color:hsl(var(--color-dark-h), var(--color-dark-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--primary.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary{background-color:hsl(var(--color-light));border-color:hsl(var(--color-light));color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary.mg-tag--outline{background-color:transparent;color:hsl(var(--color-light))}.mg-tag.mg-tag--secondary.mg-tag--soft{font-weight:200;background-color:hsl(var(--color-light-h), var(--color-light-s), 90%);border-color:hsl(var(--color-light-h), var(--color-light-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--secondary.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-dark))}.mg-tag.mg-tag--success{background-color:hsl(var(--color-success));border-color:hsl(var(--color-success));color:hsl(var(--color-dark))}.mg-tag.mg-tag--success.mg-tag--outline{background-color:transparent;color:hsl(var(--color-success))}.mg-tag.mg-tag--success.mg-tag--soft{font-weight:200;background-color:hsl(var(--color-success-h), var(--color-success-s), 90%);border-color:hsl(var(--color-success-h), var(--color-success-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--success.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-success))}.mg-tag.mg-tag--warning{background-color:hsl(var(--color-warning));border-color:hsl(var(--color-warning));color:hsl(var(--color-dark))}.mg-tag.mg-tag--warning.mg-tag--outline{background-color:transparent;color:hsl(var(--color-warning))}.mg-tag.mg-tag--warning.mg-tag--soft{font-weight:200;background-color:hsl(var(--color-warning-h), var(--color-warning-s), 90%);border-color:hsl(var(--color-warning-h), var(--color-warning-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--warning.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-warning))}.mg-tag.mg-tag--danger{background-color:hsl(var(--color-danger));border-color:hsl(var(--color-danger));color:hsl(var(--color-light))}.mg-tag.mg-tag--danger.mg-tag--outline{background-color:transparent;color:hsl(var(--color-danger))}.mg-tag.mg-tag--danger.mg-tag--soft{font-weight:200;background-color:hsl(var(--color-danger-h), var(--color-danger-s), 90%);border-color:hsl(var(--color-danger-h), var(--color-danger-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--danger.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-danger))}.mg-tag.mg-tag--info{background-color:hsl(var(--color-info));border-color:hsl(var(--color-info));color:hsl(var(--color-light))}.mg-tag.mg-tag--info.mg-tag--outline{background-color:transparent;color:hsl(var(--color-info))}.mg-tag.mg-tag--info.mg-tag--soft{font-weight:200;background-color:hsl(var(--color-info-h), var(--color-info-s), 90%);border-color:hsl(var(--color-info-h), var(--color-info-s), 90%);color:hsl(var(--color-dark))}.mg-tag.mg-tag--info.mg-tag--soft ::slotted(mg-icon){color:hsl(var(--color-info))}.mg-tag,mg-tag{display:inline-block;vertical-align:middle}::slotted(mg-icon){margin-right:0.4rem}";
|
|
6390
6136
|
|
|
6391
6137
|
const MgTag = class {
|
|
6392
6138
|
constructor(hostRef) {
|
|
@@ -6396,16 +6142,10 @@ const MgTag = class {
|
|
|
6396
6142
|
************/
|
|
6397
6143
|
// Classes
|
|
6398
6144
|
this.classOutline = `mg-tag--outline`;
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
* Define button variant
|
|
6404
|
-
*/
|
|
6405
|
-
this.variant = variants[0]; // primary
|
|
6406
|
-
/**
|
|
6407
|
-
* Component classes
|
|
6408
|
-
*/
|
|
6145
|
+
this.classSoft = `mg-tag--soft`;
|
|
6146
|
+
this.variant = variants[0];
|
|
6147
|
+
this.outline = undefined;
|
|
6148
|
+
this.soft = undefined;
|
|
6409
6149
|
this.classList = new ClassList(['mg-tag']);
|
|
6410
6150
|
}
|
|
6411
6151
|
validateVariant(newValue, oldValue) {
|
|
@@ -6425,6 +6165,29 @@ const MgTag = class {
|
|
|
6425
6165
|
else
|
|
6426
6166
|
this.classList.delete(this.classOutline);
|
|
6427
6167
|
}
|
|
6168
|
+
validateSoft(newValue) {
|
|
6169
|
+
// usage validation
|
|
6170
|
+
if (newValue && this.outline)
|
|
6171
|
+
throw new Error('<mg-tag> prop "soft" can NOT be used with prop "outline".');
|
|
6172
|
+
// apply class
|
|
6173
|
+
if (newValue)
|
|
6174
|
+
this.classList.add(this.classSoft);
|
|
6175
|
+
else
|
|
6176
|
+
this.classList.delete(this.classSoft);
|
|
6177
|
+
}
|
|
6178
|
+
/*************
|
|
6179
|
+
* Methods *
|
|
6180
|
+
*************/
|
|
6181
|
+
/**
|
|
6182
|
+
* Validate the given textContent
|
|
6183
|
+
*
|
|
6184
|
+
* @param {string} textContent html element textContent property
|
|
6185
|
+
* @returns {void}
|
|
6186
|
+
*/
|
|
6187
|
+
validateTextContent(textContent) {
|
|
6188
|
+
if (!textContent || textContent.trim() === '')
|
|
6189
|
+
throw new Error('<mg-tag> slot must contain a text content.');
|
|
6190
|
+
}
|
|
6428
6191
|
/*************
|
|
6429
6192
|
* Lifecycle *
|
|
6430
6193
|
*************/
|
|
@@ -6436,6 +6199,8 @@ const MgTag = class {
|
|
|
6436
6199
|
componentWillLoad() {
|
|
6437
6200
|
this.validateVariant(this.variant);
|
|
6438
6201
|
this.validateOutline(this.outline);
|
|
6202
|
+
this.validateSoft(this.soft);
|
|
6203
|
+
this.validateTextContent(this.element.textContent);
|
|
6439
6204
|
}
|
|
6440
6205
|
/**
|
|
6441
6206
|
* Render
|
|
@@ -6445,9 +6210,11 @@ const MgTag = class {
|
|
|
6445
6210
|
render() {
|
|
6446
6211
|
return (h("span", { class: this.classList.join() }, h("slot", null)));
|
|
6447
6212
|
}
|
|
6213
|
+
get element() { return getElement(this); }
|
|
6448
6214
|
static get watchers() { return {
|
|
6449
6215
|
"variant": ["validateVariant"],
|
|
6450
|
-
"outline": ["validateOutline"]
|
|
6216
|
+
"outline": ["validateOutline"],
|
|
6217
|
+
"soft": ["validateSoft"]
|
|
6451
6218
|
}; }
|
|
6452
6219
|
};
|
|
6453
6220
|
MgTag.style = mgTagCss;
|
|
@@ -6464,23 +6231,6 @@ const mgTooltipCss = ":host{display:inline-block}.mg-tooltip{display:none;paddin
|
|
|
6464
6231
|
const MgTooltip = class {
|
|
6465
6232
|
constructor(hostRef) {
|
|
6466
6233
|
registerInstance(this, hostRef);
|
|
6467
|
-
/**
|
|
6468
|
-
* Sets an `id` attribute.
|
|
6469
|
-
* Needed by the input for accessibility `aria-decribedby`.
|
|
6470
|
-
*/
|
|
6471
|
-
this.identifier = createID('mg-tooltip');
|
|
6472
|
-
/**
|
|
6473
|
-
* Tooltip placement
|
|
6474
|
-
*/
|
|
6475
|
-
this.placement = 'bottom';
|
|
6476
|
-
/**
|
|
6477
|
-
* Display tooltip
|
|
6478
|
-
*/
|
|
6479
|
-
this.display = false;
|
|
6480
|
-
/**
|
|
6481
|
-
* Disable tooltip
|
|
6482
|
-
*/
|
|
6483
|
-
this.disabled = false;
|
|
6484
6234
|
/**
|
|
6485
6235
|
* Show tooltip
|
|
6486
6236
|
*
|
|
@@ -6626,6 +6376,11 @@ const MgTooltip = class {
|
|
|
6626
6376
|
});
|
|
6627
6377
|
});
|
|
6628
6378
|
};
|
|
6379
|
+
this.identifier = createID('mg-tooltip');
|
|
6380
|
+
this.message = undefined;
|
|
6381
|
+
this.placement = 'bottom';
|
|
6382
|
+
this.display = false;
|
|
6383
|
+
this.disabled = false;
|
|
6629
6384
|
}
|
|
6630
6385
|
validateMessage(newValue) {
|
|
6631
6386
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -6658,8 +6413,7 @@ const MgTooltip = class {
|
|
|
6658
6413
|
const slotElement = this.element.firstElementChild;
|
|
6659
6414
|
// Get interactive element
|
|
6660
6415
|
const interactiveElements = ['a', 'button', 'input', 'textarea', 'select']; //! Might needs updates
|
|
6661
|
-
const interactiveElement = this.element.shadowRoot.querySelector(interactiveElements.join(',')) ||
|
|
6662
|
-
((_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(interactiveElements.join(',')));
|
|
6416
|
+
const interactiveElement = this.element.shadowRoot.querySelector(interactiveElements.join(',')) || ((_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(interactiveElements.join(',')));
|
|
6663
6417
|
// define selected element to become tooltip selector
|
|
6664
6418
|
this.tooltipedElement = interactiveElement || slotElement;
|
|
6665
6419
|
// Check if slotted element is a disabled mg-button
|
|
@@ -6694,4 +6448,4 @@ const MgTooltip = class {
|
|
|
6694
6448
|
};
|
|
6695
6449
|
MgTooltip.style = mgTooltipCss;
|
|
6696
6450
|
|
|
6697
|
-
export { MgBadge as mg_badge, MgButton as mg_button, MgCard as mg_card, MgCharacterLeft as mg_character_left, MgDetails as mg_details, MgDivider as mg_divider, 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, MgMenu as mg_menu, MgMenuItem as mg_menu_item, MgMessage as mg_message, MgModal as mg_modal, MgPagination as mg_pagination, MgPanel as mg_panel, MgPopover as mg_popover, MgTabs as mg_tabs, MgTag as mg_tag, MgTooltip as mg_tooltip };
|
|
6451
|
+
export { MgBadge as mg_badge, MgButton as mg_button, MgCard as mg_card, MgCharacterLeft as mg_character_left, MgDetails as mg_details, MgDivider as mg_divider, 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, MgMenu as mg_menu, MgMenuItem as mg_menu_item, MgMessage as mg_message, MgModal as mg_modal, MgPagination as mg_pagination, MgPanel as mg_panel, MgPopover as mg_popover, MgSkipLinks as mg_skip_links, MgTabs as mg_tabs, MgTag as mg_tag, MgTooltip as mg_tooltip };
|