@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-c3450336.js');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* List of all possibles variants
|
|
@@ -108,13 +108,10 @@ const MgBadge = class {
|
|
|
108
108
|
************/
|
|
109
109
|
// Classes
|
|
110
110
|
this.classOutline = `mg-badge--outline`;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.
|
|
115
|
-
/**
|
|
116
|
-
* Component classes
|
|
117
|
-
*/
|
|
111
|
+
this.value = undefined;
|
|
112
|
+
this.label = undefined;
|
|
113
|
+
this.variant = variants$4[0];
|
|
114
|
+
this.outline = undefined;
|
|
118
115
|
this.classList = new ClassList(['mg-badge']);
|
|
119
116
|
}
|
|
120
117
|
validateValue(newValue) {
|
|
@@ -175,9 +172,9 @@ MgBadge.style = mgBadgeCss;
|
|
|
175
172
|
/**
|
|
176
173
|
* List of all possibles variants
|
|
177
174
|
*/
|
|
178
|
-
const variants$3 = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success'];
|
|
175
|
+
const variants$3 = ['primary', 'secondary', 'danger', 'danger-alt', 'info', 'flat', 'success', 'link'];
|
|
179
176
|
|
|
180
|
-
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}";
|
|
177
|
+
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}";
|
|
181
178
|
|
|
182
179
|
const MgButton = class {
|
|
183
180
|
constructor(hostRef) {
|
|
@@ -189,34 +186,6 @@ const MgButton = class {
|
|
|
189
186
|
this.classDisabled = 'mg-button--disabled';
|
|
190
187
|
this.classLoading = 'mg-button--loading';
|
|
191
188
|
this.classFullWidth = 'mg-button--full-width';
|
|
192
|
-
/**
|
|
193
|
-
* Define button variant
|
|
194
|
-
*/
|
|
195
|
-
this.variant = variants$3[0]; // Primary
|
|
196
|
-
/**
|
|
197
|
-
* Set button to full-width
|
|
198
|
-
*/
|
|
199
|
-
this.fullWidth = false;
|
|
200
|
-
/**
|
|
201
|
-
* Define if button is round.
|
|
202
|
-
* Used for icon button.
|
|
203
|
-
*/
|
|
204
|
-
this.isIcon = false;
|
|
205
|
-
/**
|
|
206
|
-
* Option to set input disable on click, in order to prevent multi-click.
|
|
207
|
-
* Parent component have to remove the attribute 'disabled' when the process ends.
|
|
208
|
-
*/
|
|
209
|
-
this.disableOnClick = false;
|
|
210
|
-
/**
|
|
211
|
-
* Define if button is loading, default to false.
|
|
212
|
-
* Trigger when button is clicked or key-up ['enter', 'space], then value change to true.
|
|
213
|
-
* It's required to reset to false when action/promise in parent is done to stop the loading state
|
|
214
|
-
*/
|
|
215
|
-
this.loading = false;
|
|
216
|
-
/**
|
|
217
|
-
* Component classes
|
|
218
|
-
*/
|
|
219
|
-
this.classList = new ClassList(['mg-button']);
|
|
220
189
|
/**
|
|
221
190
|
* Trigger actions onClick event
|
|
222
191
|
*
|
|
@@ -259,6 +228,17 @@ const MgButton = class {
|
|
|
259
228
|
this.element.dispatchEvent(new MouseEvent('click', { bubbles: true }));
|
|
260
229
|
}
|
|
261
230
|
};
|
|
231
|
+
this.variant = variants$3[0];
|
|
232
|
+
this.identifier = undefined;
|
|
233
|
+
this.label = undefined;
|
|
234
|
+
this.type = undefined;
|
|
235
|
+
this.fullWidth = false;
|
|
236
|
+
this.form = undefined;
|
|
237
|
+
this.disabled = undefined;
|
|
238
|
+
this.isIcon = false;
|
|
239
|
+
this.disableOnClick = false;
|
|
240
|
+
this.loading = false;
|
|
241
|
+
this.classList = new ClassList(['mg-button']);
|
|
262
242
|
}
|
|
263
243
|
validateVariant(newValue, oldValue) {
|
|
264
244
|
if (!variants$3.includes(newValue)) {
|
|
@@ -343,7 +323,7 @@ const MgButton = class {
|
|
|
343
323
|
};
|
|
344
324
|
MgButton.style = mgButtonCss;
|
|
345
325
|
|
|
346
|
-
const mgCardCss = ".mg-card{padding:var(--mg-card-padding);
|
|
326
|
+
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)}";
|
|
347
327
|
|
|
348
328
|
const MgCard = class {
|
|
349
329
|
constructor(hostRef) {
|
|
@@ -404,6 +384,9 @@ const pagination$1 = {
|
|
|
404
384
|
const panel$1 = {
|
|
405
385
|
editLabel: "Edit section title."
|
|
406
386
|
};
|
|
387
|
+
const skipLinks$1 = {
|
|
388
|
+
navLabel: "Quick access"
|
|
389
|
+
};
|
|
407
390
|
const general$1 = {
|
|
408
391
|
confirm: "Confirm",
|
|
409
392
|
cancel: "Cancel",
|
|
@@ -420,6 +403,7 @@ const en = {
|
|
|
420
403
|
modal: modal$1,
|
|
421
404
|
pagination: pagination$1,
|
|
422
405
|
panel: panel$1,
|
|
406
|
+
skipLinks: skipLinks$1,
|
|
423
407
|
general: general$1
|
|
424
408
|
};
|
|
425
409
|
|
|
@@ -464,6 +448,9 @@ const pagination = {
|
|
|
464
448
|
const panel = {
|
|
465
449
|
editLabel: "Modifier le titre de la section."
|
|
466
450
|
};
|
|
451
|
+
const skipLinks = {
|
|
452
|
+
navLabel: "Accès rapide"
|
|
453
|
+
};
|
|
467
454
|
const general = {
|
|
468
455
|
confirm: "Valider",
|
|
469
456
|
cancel: "Annuler",
|
|
@@ -480,6 +467,7 @@ const fr = {
|
|
|
480
467
|
modal: modal,
|
|
481
468
|
pagination: pagination,
|
|
482
469
|
panel: panel,
|
|
470
|
+
skipLinks: skipLinks,
|
|
483
471
|
general: general
|
|
484
472
|
};
|
|
485
473
|
|
|
@@ -522,10 +510,9 @@ const mgCharacterLeftCss = "mg-character-left.sc-mg-character-left{display:block
|
|
|
522
510
|
const MgCharacterLeft = class {
|
|
523
511
|
constructor(hostRef) {
|
|
524
512
|
index.registerInstance(this, hostRef);
|
|
525
|
-
|
|
526
|
-
* Sets the characters to count
|
|
527
|
-
*/
|
|
513
|
+
this.identifier = undefined;
|
|
528
514
|
this.characters = '';
|
|
515
|
+
this.maxlength = undefined;
|
|
529
516
|
}
|
|
530
517
|
validateMaxlength(newValue) {
|
|
531
518
|
if (typeof newValue !== 'number') {
|
|
@@ -565,14 +552,6 @@ const MgDetails = class {
|
|
|
565
552
|
constructor(hostRef) {
|
|
566
553
|
index.registerInstance(this, hostRef);
|
|
567
554
|
this.expandedChange = index.createEvent(this, "expanded-change", 7);
|
|
568
|
-
/**
|
|
569
|
-
* Hide summary element
|
|
570
|
-
*/
|
|
571
|
-
this.hideSummary = false;
|
|
572
|
-
/**
|
|
573
|
-
* Define if details are diplayed
|
|
574
|
-
*/
|
|
575
|
-
this.expanded = false;
|
|
576
555
|
/**
|
|
577
556
|
* Handle details toggle
|
|
578
557
|
*
|
|
@@ -581,6 +560,10 @@ const MgDetails = class {
|
|
|
581
560
|
this.handleToggle = () => {
|
|
582
561
|
this.expanded = this.details.open;
|
|
583
562
|
};
|
|
563
|
+
this.toggleClosed = undefined;
|
|
564
|
+
this.toggleOpened = undefined;
|
|
565
|
+
this.hideSummary = false;
|
|
566
|
+
this.expanded = false;
|
|
584
567
|
}
|
|
585
568
|
validateTitles(newValue) {
|
|
586
569
|
if (newValue === undefined || newValue.trim() === '') {
|
|
@@ -623,12 +606,6 @@ const mgDividerCss = ".mg-divider{margin:var(--mg-divider-vertical-spacing) auto
|
|
|
623
606
|
const MgDivider = class {
|
|
624
607
|
constructor(hostRef) {
|
|
625
608
|
index.registerInstance(this, hostRef);
|
|
626
|
-
/**************
|
|
627
|
-
* Decorators *
|
|
628
|
-
**************/
|
|
629
|
-
/**
|
|
630
|
-
* Define component size
|
|
631
|
-
*/
|
|
632
609
|
this.size = 'regular';
|
|
633
610
|
}
|
|
634
611
|
/**
|
|
@@ -654,28 +631,6 @@ const MgForm = class {
|
|
|
654
631
|
this.formSubmit = index.createEvent(this, "form-submit", 7);
|
|
655
632
|
// Classes
|
|
656
633
|
this.classAllRequired = 'mg-form--all-required';
|
|
657
|
-
/**
|
|
658
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
659
|
-
* If not set, it will be created.
|
|
660
|
-
*/
|
|
661
|
-
this.identifier = createID('mg-form');
|
|
662
|
-
/**
|
|
663
|
-
* Input name
|
|
664
|
-
* If not set the value equals the identifier
|
|
665
|
-
*/
|
|
666
|
-
this.name = this.identifier;
|
|
667
|
-
/**
|
|
668
|
-
* Define if form is readonly
|
|
669
|
-
*/
|
|
670
|
-
this.readonly = false;
|
|
671
|
-
/**
|
|
672
|
-
* Define if form is disabled
|
|
673
|
-
*/
|
|
674
|
-
this.disabled = false;
|
|
675
|
-
/**
|
|
676
|
-
* Component classes
|
|
677
|
-
*/
|
|
678
|
-
this.classList = new ClassList(['mg-form']);
|
|
679
634
|
/**
|
|
680
635
|
* Define required message based on mg-inputs required elements
|
|
681
636
|
* Also
|
|
@@ -745,6 +700,14 @@ const MgForm = class {
|
|
|
745
700
|
input.addEventListener('input-valid', this.checkValidity);
|
|
746
701
|
});
|
|
747
702
|
};
|
|
703
|
+
this.identifier = createID('mg-form');
|
|
704
|
+
this.name = this.identifier;
|
|
705
|
+
this.readonly = false;
|
|
706
|
+
this.disabled = false;
|
|
707
|
+
this.valid = undefined;
|
|
708
|
+
this.invalid = undefined;
|
|
709
|
+
this.classList = new ClassList(['mg-form']);
|
|
710
|
+
this.requiredMessage = undefined;
|
|
748
711
|
}
|
|
749
712
|
handleAttributeChange() {
|
|
750
713
|
this.setMgInputs();
|
|
@@ -1015,24 +978,17 @@ const mgIconCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !i
|
|
|
1015
978
|
const MgIcon = class {
|
|
1016
979
|
constructor(hostRef) {
|
|
1017
980
|
index.registerInstance(this, hostRef);
|
|
1018
|
-
/**
|
|
1019
|
-
* Define icon size
|
|
1020
|
-
*/
|
|
1021
|
-
this.size = 'regular';
|
|
1022
|
-
/**
|
|
1023
|
-
* Make the icon spin
|
|
1024
|
-
*/
|
|
1025
|
-
this.spin = false;
|
|
1026
|
-
/**
|
|
1027
|
-
* Component classes
|
|
1028
|
-
*/
|
|
1029
|
-
this.classList = new ClassList(['mg-icon']);
|
|
1030
981
|
/**
|
|
1031
982
|
* getIcon
|
|
1032
983
|
*
|
|
1033
984
|
* @returns {HTMLElement} icon html
|
|
1034
985
|
*/
|
|
1035
986
|
this.getIcon = () => icons[this.icon]();
|
|
987
|
+
this.icon = undefined;
|
|
988
|
+
this.size = 'regular';
|
|
989
|
+
this.variant = undefined;
|
|
990
|
+
this.spin = false;
|
|
991
|
+
this.classList = new ClassList(['mg-icon']);
|
|
1036
992
|
}
|
|
1037
993
|
validateIcon(newValue, oldValue) {
|
|
1038
994
|
if (!Object.keys(icons).includes(newValue)) {
|
|
@@ -1105,18 +1061,12 @@ const MgIcon = class {
|
|
|
1105
1061
|
};
|
|
1106
1062
|
MgIcon.style = mgIconCss;
|
|
1107
1063
|
|
|
1108
|
-
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:
|
|
1064
|
+
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}";
|
|
1109
1065
|
|
|
1110
1066
|
const MgIllustratedMessage = class {
|
|
1111
1067
|
constructor(hostRef) {
|
|
1112
1068
|
index.registerInstance(this, hostRef);
|
|
1113
|
-
/**
|
|
1114
|
-
* Define illustration size
|
|
1115
|
-
*/
|
|
1116
1069
|
this.size = 'regular';
|
|
1117
|
-
/**
|
|
1118
|
-
* Define component orientation
|
|
1119
|
-
*/
|
|
1120
1070
|
this.direction = 'vertical';
|
|
1121
1071
|
}
|
|
1122
1072
|
/*************
|
|
@@ -1297,39 +1247,6 @@ const MgInputCheckbox = class {
|
|
|
1297
1247
|
this.inputs = [];
|
|
1298
1248
|
// hasDisplayedError (triggered by blur event)
|
|
1299
1249
|
this.hasDisplayedError = false;
|
|
1300
|
-
/**
|
|
1301
|
-
* Input name
|
|
1302
|
-
* If not set the value equals the identifier
|
|
1303
|
-
*/
|
|
1304
|
-
this.name = this.identifier;
|
|
1305
|
-
/**
|
|
1306
|
-
* Define if label is visible
|
|
1307
|
-
*/
|
|
1308
|
-
this.labelHide = false;
|
|
1309
|
-
/**
|
|
1310
|
-
* Define if inputs are display verticaly
|
|
1311
|
-
*/
|
|
1312
|
-
this.inputVerticalList = false;
|
|
1313
|
-
/**
|
|
1314
|
-
* Define if input is required
|
|
1315
|
-
*/
|
|
1316
|
-
this.required = false;
|
|
1317
|
-
/**
|
|
1318
|
-
* Define if input is readonly
|
|
1319
|
-
*/
|
|
1320
|
-
this.readonly = false;
|
|
1321
|
-
/**
|
|
1322
|
-
* Define if input is disabled
|
|
1323
|
-
*/
|
|
1324
|
-
this.disabled = false;
|
|
1325
|
-
/**
|
|
1326
|
-
* Component classes
|
|
1327
|
-
*/
|
|
1328
|
-
this.classList = new ClassList(['mg-input--checkbox']);
|
|
1329
|
-
/**
|
|
1330
|
-
* Formated value for display
|
|
1331
|
-
*/
|
|
1332
|
-
this.checkboxItems = [];
|
|
1333
1250
|
/**
|
|
1334
1251
|
* Handle input event
|
|
1335
1252
|
*
|
|
@@ -1379,6 +1296,23 @@ const MgInputCheckbox = class {
|
|
|
1379
1296
|
this.errorMessage = this.messages.errors.required;
|
|
1380
1297
|
}
|
|
1381
1298
|
};
|
|
1299
|
+
this.value = undefined;
|
|
1300
|
+
this.identifier = undefined;
|
|
1301
|
+
this.name = this.identifier;
|
|
1302
|
+
this.label = undefined;
|
|
1303
|
+
this.labelOnTop = undefined;
|
|
1304
|
+
this.labelHide = false;
|
|
1305
|
+
this.inputVerticalList = false;
|
|
1306
|
+
this.required = false;
|
|
1307
|
+
this.readonly = false;
|
|
1308
|
+
this.disabled = false;
|
|
1309
|
+
this.tooltip = undefined;
|
|
1310
|
+
this.helpText = undefined;
|
|
1311
|
+
this.valid = undefined;
|
|
1312
|
+
this.invalid = undefined;
|
|
1313
|
+
this.classList = new ClassList(['mg-input--checkbox']);
|
|
1314
|
+
this.errorMessage = undefined;
|
|
1315
|
+
this.checkboxItems = [];
|
|
1382
1316
|
}
|
|
1383
1317
|
validateValue(newValue) {
|
|
1384
1318
|
if (newValue && newValue.every(item => isCheckboxItem(item))) {
|
|
@@ -1515,31 +1449,6 @@ const MgInputDate = class {
|
|
|
1515
1449
|
this.inputValid = index.createEvent(this, "input-valid", 7);
|
|
1516
1450
|
// hasDisplayedError (triggered by blur event)
|
|
1517
1451
|
this.hasDisplayedError = false;
|
|
1518
|
-
/**
|
|
1519
|
-
* Input name
|
|
1520
|
-
* If not set the value equals the identifier
|
|
1521
|
-
*/
|
|
1522
|
-
this.name = this.identifier;
|
|
1523
|
-
/**
|
|
1524
|
-
* Define if label is visible
|
|
1525
|
-
*/
|
|
1526
|
-
this.labelHide = false;
|
|
1527
|
-
/**
|
|
1528
|
-
* Define if input is required
|
|
1529
|
-
*/
|
|
1530
|
-
this.required = false;
|
|
1531
|
-
/**
|
|
1532
|
-
* Define if input is readonly
|
|
1533
|
-
*/
|
|
1534
|
-
this.readonly = false;
|
|
1535
|
-
/**
|
|
1536
|
-
* Define if input is disabled
|
|
1537
|
-
*/
|
|
1538
|
-
this.disabled = false;
|
|
1539
|
-
/**
|
|
1540
|
-
* Component classes
|
|
1541
|
-
*/
|
|
1542
|
-
this.classList = new ClassList(['mg-input--date']);
|
|
1543
1452
|
/**
|
|
1544
1453
|
* Handle input event
|
|
1545
1454
|
*/
|
|
@@ -1618,6 +1527,23 @@ const MgInputDate = class {
|
|
|
1618
1527
|
}
|
|
1619
1528
|
}
|
|
1620
1529
|
};
|
|
1530
|
+
this.value = undefined;
|
|
1531
|
+
this.identifier = undefined;
|
|
1532
|
+
this.name = this.identifier;
|
|
1533
|
+
this.label = undefined;
|
|
1534
|
+
this.labelOnTop = undefined;
|
|
1535
|
+
this.labelHide = false;
|
|
1536
|
+
this.required = false;
|
|
1537
|
+
this.readonly = false;
|
|
1538
|
+
this.disabled = false;
|
|
1539
|
+
this.tooltip = undefined;
|
|
1540
|
+
this.helpText = undefined;
|
|
1541
|
+
this.valid = undefined;
|
|
1542
|
+
this.invalid = undefined;
|
|
1543
|
+
this.min = undefined;
|
|
1544
|
+
this.max = undefined;
|
|
1545
|
+
this.classList = new ClassList(['mg-input--date']);
|
|
1546
|
+
this.errorMessage = undefined;
|
|
1621
1547
|
}
|
|
1622
1548
|
validateValue(newValue) {
|
|
1623
1549
|
if (newValue !== undefined && newValue !== null && (typeof newValue !== 'string' || !dateRegExp.test(newValue))) {
|
|
@@ -1720,53 +1646,6 @@ const MgInputNumeric = class {
|
|
|
1720
1646
|
this.inputValid = index.createEvent(this, "input-valid", 7);
|
|
1721
1647
|
// hasDisplayedError (triggered by blur event)
|
|
1722
1648
|
this.hasDisplayedError = false;
|
|
1723
|
-
/**
|
|
1724
|
-
* Input name
|
|
1725
|
-
* If not set the value equals the identifier
|
|
1726
|
-
*/
|
|
1727
|
-
this.name = this.identifier;
|
|
1728
|
-
/**
|
|
1729
|
-
* Define if label is visible
|
|
1730
|
-
*/
|
|
1731
|
-
this.labelHide = false;
|
|
1732
|
-
/**
|
|
1733
|
-
* Define if input is required
|
|
1734
|
-
*/
|
|
1735
|
-
this.required = false;
|
|
1736
|
-
/**
|
|
1737
|
-
* Define if input is readonly
|
|
1738
|
-
*/
|
|
1739
|
-
this.readonly = false;
|
|
1740
|
-
/**
|
|
1741
|
-
* Define if input is disabled
|
|
1742
|
-
*/
|
|
1743
|
-
this.disabled = false;
|
|
1744
|
-
/**
|
|
1745
|
-
* Define numeric type
|
|
1746
|
-
*/
|
|
1747
|
-
this.type = types[0];
|
|
1748
|
-
/**
|
|
1749
|
-
* Define currency
|
|
1750
|
-
*/
|
|
1751
|
-
this.currency = 'USD';
|
|
1752
|
-
/**
|
|
1753
|
-
* Override integer length
|
|
1754
|
-
* integer is the number before the decimal point
|
|
1755
|
-
*/
|
|
1756
|
-
this.integerLength = 13;
|
|
1757
|
-
/**
|
|
1758
|
-
* Override decimal length
|
|
1759
|
-
* decimal is the number after the decimal point
|
|
1760
|
-
*/
|
|
1761
|
-
this.decimalLength = 2;
|
|
1762
|
-
/**
|
|
1763
|
-
* Component classes
|
|
1764
|
-
*/
|
|
1765
|
-
this.classList = new ClassList(['mg-input--numeric']);
|
|
1766
|
-
/**
|
|
1767
|
-
* Define if input has focus
|
|
1768
|
-
*/
|
|
1769
|
-
this.hasFocus = false;
|
|
1770
1649
|
/**
|
|
1771
1650
|
* Handle input event
|
|
1772
1651
|
*
|
|
@@ -1873,6 +1752,30 @@ const MgInputNumeric = class {
|
|
|
1873
1752
|
this.classList.add(slotAppendInput.nodeName === 'MG-BUTTON' ? 'mg-input--is-input-group-append' : 'mg-input--is-append-input-slot-content');
|
|
1874
1753
|
}
|
|
1875
1754
|
};
|
|
1755
|
+
this.value = undefined;
|
|
1756
|
+
this.identifier = undefined;
|
|
1757
|
+
this.name = this.identifier;
|
|
1758
|
+
this.label = undefined;
|
|
1759
|
+
this.labelOnTop = undefined;
|
|
1760
|
+
this.labelHide = false;
|
|
1761
|
+
this.placeholder = undefined;
|
|
1762
|
+
this.required = false;
|
|
1763
|
+
this.readonly = false;
|
|
1764
|
+
this.disabled = false;
|
|
1765
|
+
this.mgWidth = undefined;
|
|
1766
|
+
this.tooltip = undefined;
|
|
1767
|
+
this.helpText = undefined;
|
|
1768
|
+
this.type = types[0];
|
|
1769
|
+
this.currency = 'USD';
|
|
1770
|
+
this.max = undefined;
|
|
1771
|
+
this.min = undefined;
|
|
1772
|
+
this.integerLength = 13;
|
|
1773
|
+
this.decimalLength = 2;
|
|
1774
|
+
this.valid = undefined;
|
|
1775
|
+
this.invalid = undefined;
|
|
1776
|
+
this.classList = new ClassList(['mg-input--numeric']);
|
|
1777
|
+
this.errorMessage = undefined;
|
|
1778
|
+
this.hasFocus = false;
|
|
1876
1779
|
}
|
|
1877
1780
|
validateValue(newValue) {
|
|
1878
1781
|
if (newValue !== undefined && newValue !== null) {
|
|
@@ -2004,35 +1907,6 @@ const MgInputPassword = class {
|
|
|
2004
1907
|
this.inputValid = index.createEvent(this, "input-valid", 7);
|
|
2005
1908
|
// hasDisplayedError (triggered by blur event)
|
|
2006
1909
|
this.hasDisplayedError = false;
|
|
2007
|
-
/**
|
|
2008
|
-
* Input name
|
|
2009
|
-
* If not set the value equals the identifier
|
|
2010
|
-
*/
|
|
2011
|
-
this.name = this.identifier;
|
|
2012
|
-
/**
|
|
2013
|
-
* Define if label is visible
|
|
2014
|
-
*/
|
|
2015
|
-
this.labelHide = false;
|
|
2016
|
-
/**
|
|
2017
|
-
* Define if input is required
|
|
2018
|
-
*/
|
|
2019
|
-
this.required = false;
|
|
2020
|
-
/**
|
|
2021
|
-
* Define if input is readonly
|
|
2022
|
-
*/
|
|
2023
|
-
this.readonly = false;
|
|
2024
|
-
/**
|
|
2025
|
-
* Define if input is disabled
|
|
2026
|
-
*/
|
|
2027
|
-
this.disabled = false;
|
|
2028
|
-
/**
|
|
2029
|
-
* Define input width
|
|
2030
|
-
*/
|
|
2031
|
-
this.mgWidth = 'full';
|
|
2032
|
-
/**
|
|
2033
|
-
* Component classes
|
|
2034
|
-
*/
|
|
2035
|
-
this.classList = new ClassList(['mg-input--password']);
|
|
2036
1910
|
/**
|
|
2037
1911
|
* Handle input event
|
|
2038
1912
|
*/
|
|
@@ -2070,6 +1944,23 @@ const MgInputPassword = class {
|
|
|
2070
1944
|
this.errorMessage = this.messages.errors.required;
|
|
2071
1945
|
}
|
|
2072
1946
|
};
|
|
1947
|
+
this.value = undefined;
|
|
1948
|
+
this.identifier = undefined;
|
|
1949
|
+
this.name = this.identifier;
|
|
1950
|
+
this.label = undefined;
|
|
1951
|
+
this.labelOnTop = undefined;
|
|
1952
|
+
this.labelHide = false;
|
|
1953
|
+
this.placeholder = undefined;
|
|
1954
|
+
this.required = false;
|
|
1955
|
+
this.readonly = false;
|
|
1956
|
+
this.disabled = false;
|
|
1957
|
+
this.mgWidth = 'full';
|
|
1958
|
+
this.tooltip = undefined;
|
|
1959
|
+
this.helpText = undefined;
|
|
1960
|
+
this.valid = undefined;
|
|
1961
|
+
this.invalid = undefined;
|
|
1962
|
+
this.classList = new ClassList(['mg-input--password']);
|
|
1963
|
+
this.errorMessage = undefined;
|
|
2073
1964
|
}
|
|
2074
1965
|
handleValue(newValue) {
|
|
2075
1966
|
this.valueChange.emit(newValue);
|
|
@@ -2154,39 +2045,6 @@ const MgInputRadio = class {
|
|
|
2154
2045
|
this.inputs = [];
|
|
2155
2046
|
// hasDisplayedError (triggered by blur event)
|
|
2156
2047
|
this.hasDisplayedError = false;
|
|
2157
|
-
/**
|
|
2158
|
-
* Input name
|
|
2159
|
-
* If not set the value equals the identifier
|
|
2160
|
-
*/
|
|
2161
|
-
this.name = this.identifier;
|
|
2162
|
-
/**
|
|
2163
|
-
* Define if label is displayed on top
|
|
2164
|
-
*/
|
|
2165
|
-
this.labelOnTop = false;
|
|
2166
|
-
/**
|
|
2167
|
-
* Define if label is visible
|
|
2168
|
-
*/
|
|
2169
|
-
this.labelHide = false;
|
|
2170
|
-
/**
|
|
2171
|
-
* Define if inputs are display verticaly
|
|
2172
|
-
*/
|
|
2173
|
-
this.inputVerticalList = false;
|
|
2174
|
-
/**
|
|
2175
|
-
* Define if input is required
|
|
2176
|
-
*/
|
|
2177
|
-
this.required = false;
|
|
2178
|
-
/**
|
|
2179
|
-
* Define if input is readonly
|
|
2180
|
-
*/
|
|
2181
|
-
this.readonly = false;
|
|
2182
|
-
/**
|
|
2183
|
-
* Define if input is disabled
|
|
2184
|
-
*/
|
|
2185
|
-
this.disabled = false;
|
|
2186
|
-
/**
|
|
2187
|
-
* Component classes
|
|
2188
|
-
*/
|
|
2189
|
-
this.classList = new ClassList(['mg-input--radio']);
|
|
2190
2048
|
/**
|
|
2191
2049
|
* Handle input event
|
|
2192
2050
|
*
|
|
@@ -2236,6 +2094,24 @@ const MgInputRadio = class {
|
|
|
2236
2094
|
* @returns {HTMLInputElement} element
|
|
2237
2095
|
*/
|
|
2238
2096
|
this.getInvalidElement = () => this.inputs.find((input) => !input.disabled && !input.readOnly && !input.checkValidity());
|
|
2097
|
+
this.value = undefined;
|
|
2098
|
+
this.items = undefined;
|
|
2099
|
+
this.identifier = undefined;
|
|
2100
|
+
this.name = this.identifier;
|
|
2101
|
+
this.label = undefined;
|
|
2102
|
+
this.labelOnTop = false;
|
|
2103
|
+
this.labelHide = false;
|
|
2104
|
+
this.inputVerticalList = false;
|
|
2105
|
+
this.required = false;
|
|
2106
|
+
this.readonly = false;
|
|
2107
|
+
this.disabled = false;
|
|
2108
|
+
this.tooltip = undefined;
|
|
2109
|
+
this.helpText = undefined;
|
|
2110
|
+
this.valid = undefined;
|
|
2111
|
+
this.invalid = undefined;
|
|
2112
|
+
this.classList = new ClassList(['mg-input--radio']);
|
|
2113
|
+
this.errorMessage = undefined;
|
|
2114
|
+
this.options = undefined;
|
|
2239
2115
|
}
|
|
2240
2116
|
handleValue(newValue) {
|
|
2241
2117
|
this.valueChange.emit(newValue);
|
|
@@ -2364,39 +2240,6 @@ const MgInputSelect = class {
|
|
|
2364
2240
|
this.inputValid = index.createEvent(this, "input-valid", 7);
|
|
2365
2241
|
// hasDisplayedError (triggered by blur event)
|
|
2366
2242
|
this.hasDisplayedError = false;
|
|
2367
|
-
/**
|
|
2368
|
-
* Input name
|
|
2369
|
-
* If not set the value equals the identifier
|
|
2370
|
-
*/
|
|
2371
|
-
this.name = this.identifier;
|
|
2372
|
-
/**
|
|
2373
|
-
* Define if label is visible
|
|
2374
|
-
*/
|
|
2375
|
-
this.labelHide = false;
|
|
2376
|
-
/**
|
|
2377
|
-
* Option to remove placeholder
|
|
2378
|
-
*/
|
|
2379
|
-
this.placeholderHide = false;
|
|
2380
|
-
/**
|
|
2381
|
-
* Option to disable placeholder
|
|
2382
|
-
*/
|
|
2383
|
-
this.placeholderDisabled = false;
|
|
2384
|
-
/**
|
|
2385
|
-
* Define if input is required
|
|
2386
|
-
*/
|
|
2387
|
-
this.required = false;
|
|
2388
|
-
/**
|
|
2389
|
-
* Define if input is readonly
|
|
2390
|
-
*/
|
|
2391
|
-
this.readonly = false;
|
|
2392
|
-
/**
|
|
2393
|
-
* Define if input is disabled
|
|
2394
|
-
*/
|
|
2395
|
-
this.disabled = false;
|
|
2396
|
-
/**
|
|
2397
|
-
* Component classes
|
|
2398
|
-
*/
|
|
2399
|
-
this.classList = new ClassList(['mg-input--select']);
|
|
2400
2243
|
/**
|
|
2401
2244
|
* Handle input event
|
|
2402
2245
|
*/
|
|
@@ -2438,6 +2281,29 @@ const MgInputSelect = class {
|
|
|
2438
2281
|
this.errorMessage = this.messages.errors.required;
|
|
2439
2282
|
}
|
|
2440
2283
|
};
|
|
2284
|
+
this.value = undefined;
|
|
2285
|
+
this.items = undefined;
|
|
2286
|
+
this.identifier = undefined;
|
|
2287
|
+
this.name = this.identifier;
|
|
2288
|
+
this.label = undefined;
|
|
2289
|
+
this.labelOnTop = undefined;
|
|
2290
|
+
this.labelHide = false;
|
|
2291
|
+
this.placeholder = undefined;
|
|
2292
|
+
this.placeholderHide = false;
|
|
2293
|
+
this.placeholderDisabled = false;
|
|
2294
|
+
this.required = false;
|
|
2295
|
+
this.readonly = false;
|
|
2296
|
+
this.disabled = false;
|
|
2297
|
+
this.mgWidth = undefined;
|
|
2298
|
+
this.tooltip = undefined;
|
|
2299
|
+
this.helpText = undefined;
|
|
2300
|
+
this.valid = undefined;
|
|
2301
|
+
this.invalid = undefined;
|
|
2302
|
+
this.classList = new ClassList(['mg-input--select']);
|
|
2303
|
+
this.errorMessage = undefined;
|
|
2304
|
+
this.options = undefined;
|
|
2305
|
+
this.valueExist = undefined;
|
|
2306
|
+
this.readonlyValue = undefined;
|
|
2441
2307
|
}
|
|
2442
2308
|
handleValue(newValue) {
|
|
2443
2309
|
if (newValue !== null) {
|
|
@@ -2553,47 +2419,6 @@ const MgInputText = class {
|
|
|
2553
2419
|
this.classHasIcon = 'mg-input--has-icon';
|
|
2554
2420
|
// hasDisplayedError (triggered by blur event)
|
|
2555
2421
|
this.hasDisplayedError = false;
|
|
2556
|
-
/**
|
|
2557
|
-
* Input name
|
|
2558
|
-
* If not set the value equals the identifier
|
|
2559
|
-
*/
|
|
2560
|
-
this.name = this.identifier;
|
|
2561
|
-
/**
|
|
2562
|
-
* Input type
|
|
2563
|
-
*/
|
|
2564
|
-
this.type = 'text';
|
|
2565
|
-
/**
|
|
2566
|
-
* Define if label is visible
|
|
2567
|
-
*/
|
|
2568
|
-
this.labelHide = false;
|
|
2569
|
-
/**
|
|
2570
|
-
* Input max length
|
|
2571
|
-
*/
|
|
2572
|
-
this.maxlength = 400;
|
|
2573
|
-
/**
|
|
2574
|
-
* Define if input is required
|
|
2575
|
-
*/
|
|
2576
|
-
this.required = false;
|
|
2577
|
-
/**
|
|
2578
|
-
* Define if input is readonly
|
|
2579
|
-
*/
|
|
2580
|
-
this.readonly = false;
|
|
2581
|
-
/**
|
|
2582
|
-
* Define if input is disabled
|
|
2583
|
-
*/
|
|
2584
|
-
this.disabled = false;
|
|
2585
|
-
/**
|
|
2586
|
-
* Define input width
|
|
2587
|
-
*/
|
|
2588
|
-
this.mgWidth = 'full';
|
|
2589
|
-
/**
|
|
2590
|
-
* Define if component should display character left
|
|
2591
|
-
*/
|
|
2592
|
-
this.displayCharacterLeft = true;
|
|
2593
|
-
/**
|
|
2594
|
-
* Component classes
|
|
2595
|
-
*/
|
|
2596
|
-
this.classList = new ClassList(['mg-input--text']);
|
|
2597
2422
|
/**
|
|
2598
2423
|
* Handle input event
|
|
2599
2424
|
*
|
|
@@ -2684,6 +2509,29 @@ const MgInputText = class {
|
|
|
2684
2509
|
this.classList.add('mg-input--has-buttons-group-append');
|
|
2685
2510
|
}
|
|
2686
2511
|
};
|
|
2512
|
+
this.value = undefined;
|
|
2513
|
+
this.identifier = undefined;
|
|
2514
|
+
this.name = this.identifier;
|
|
2515
|
+
this.label = undefined;
|
|
2516
|
+
this.type = 'text';
|
|
2517
|
+
this.icon = undefined;
|
|
2518
|
+
this.labelOnTop = undefined;
|
|
2519
|
+
this.labelHide = false;
|
|
2520
|
+
this.placeholder = undefined;
|
|
2521
|
+
this.maxlength = 400;
|
|
2522
|
+
this.required = false;
|
|
2523
|
+
this.readonly = false;
|
|
2524
|
+
this.disabled = false;
|
|
2525
|
+
this.mgWidth = 'full';
|
|
2526
|
+
this.pattern = undefined;
|
|
2527
|
+
this.patternErrorMessage = undefined;
|
|
2528
|
+
this.tooltip = undefined;
|
|
2529
|
+
this.displayCharacterLeft = true;
|
|
2530
|
+
this.helpText = undefined;
|
|
2531
|
+
this.valid = undefined;
|
|
2532
|
+
this.invalid = undefined;
|
|
2533
|
+
this.classList = new ClassList(['mg-input--text']);
|
|
2534
|
+
this.errorMessage = undefined;
|
|
2687
2535
|
}
|
|
2688
2536
|
handleValue(newValue) {
|
|
2689
2537
|
this.valueChange.emit(newValue);
|
|
@@ -2788,51 +2636,6 @@ const MgInputTextarea = class {
|
|
|
2788
2636
|
this.classHasDisplayCharacterLeft = 'mg-input--has-display-character-left';
|
|
2789
2637
|
// hasDisplayedError (triggered by blur event)
|
|
2790
2638
|
this.hasDisplayedError = false;
|
|
2791
|
-
/**
|
|
2792
|
-
* Input name
|
|
2793
|
-
* If not set the value equals the identifier
|
|
2794
|
-
*/
|
|
2795
|
-
this.name = this.identifier;
|
|
2796
|
-
/**
|
|
2797
|
-
* Define if label is visible
|
|
2798
|
-
*/
|
|
2799
|
-
this.labelHide = false;
|
|
2800
|
-
/**
|
|
2801
|
-
* Input max length
|
|
2802
|
-
*/
|
|
2803
|
-
this.maxlength = 4000;
|
|
2804
|
-
/**
|
|
2805
|
-
* Define if input is required
|
|
2806
|
-
*/
|
|
2807
|
-
this.required = false;
|
|
2808
|
-
/**
|
|
2809
|
-
* Define if input is readonly
|
|
2810
|
-
*/
|
|
2811
|
-
this.readonly = false;
|
|
2812
|
-
/**
|
|
2813
|
-
* Define if input is disabled
|
|
2814
|
-
*/
|
|
2815
|
-
this.disabled = false;
|
|
2816
|
-
/**
|
|
2817
|
-
* Define input width
|
|
2818
|
-
*/
|
|
2819
|
-
this.mgWidth = 'full';
|
|
2820
|
-
/**
|
|
2821
|
-
* Define the number of visible text lines for the control
|
|
2822
|
-
*/
|
|
2823
|
-
this.rows = 3;
|
|
2824
|
-
/**
|
|
2825
|
-
* Define if component should display character left
|
|
2826
|
-
*/
|
|
2827
|
-
this.displayCharacterLeft = true;
|
|
2828
|
-
/**
|
|
2829
|
-
* Define if input is resizable
|
|
2830
|
-
*/
|
|
2831
|
-
this.resizable = 'none';
|
|
2832
|
-
/**
|
|
2833
|
-
* Component classes
|
|
2834
|
-
*/
|
|
2835
|
-
this.classList = new ClassList(['mg-input--textarea']);
|
|
2836
2639
|
/**
|
|
2837
2640
|
* Handle input event
|
|
2838
2641
|
*/
|
|
@@ -2903,6 +2706,29 @@ const MgInputTextarea = class {
|
|
|
2903
2706
|
throw new Error('<mg-input-textarea> prop "pattern" must be paired with the prop "patternErrorMessage"');
|
|
2904
2707
|
}
|
|
2905
2708
|
};
|
|
2709
|
+
this.value = undefined;
|
|
2710
|
+
this.identifier = undefined;
|
|
2711
|
+
this.name = this.identifier;
|
|
2712
|
+
this.label = undefined;
|
|
2713
|
+
this.labelOnTop = undefined;
|
|
2714
|
+
this.labelHide = false;
|
|
2715
|
+
this.placeholder = undefined;
|
|
2716
|
+
this.maxlength = 4000;
|
|
2717
|
+
this.required = false;
|
|
2718
|
+
this.readonly = false;
|
|
2719
|
+
this.disabled = false;
|
|
2720
|
+
this.mgWidth = 'full';
|
|
2721
|
+
this.pattern = undefined;
|
|
2722
|
+
this.patternErrorMessage = undefined;
|
|
2723
|
+
this.rows = 3;
|
|
2724
|
+
this.tooltip = undefined;
|
|
2725
|
+
this.displayCharacterLeft = true;
|
|
2726
|
+
this.helpText = undefined;
|
|
2727
|
+
this.valid = undefined;
|
|
2728
|
+
this.invalid = undefined;
|
|
2729
|
+
this.resizable = 'none';
|
|
2730
|
+
this.classList = new ClassList(['mg-input--textarea']);
|
|
2731
|
+
this.errorMessage = undefined;
|
|
2906
2732
|
}
|
|
2907
2733
|
handleValue(newValue) {
|
|
2908
2734
|
this.checkValidity();
|
|
@@ -2990,17 +2816,13 @@ const mgInputTitleCss = ".is-asterisk.sc-mg-input-title{color:hsl(var(--color-da
|
|
|
2990
2816
|
const MgInputTitle = class {
|
|
2991
2817
|
constructor(hostRef) {
|
|
2992
2818
|
index.registerInstance(this, hostRef);
|
|
2993
|
-
/**
|
|
2994
|
-
* Switch from label to fieldset sementic
|
|
2995
|
-
*/
|
|
2996
|
-
this.isLegend = false;
|
|
2997
|
-
/**
|
|
2998
|
-
* Component parent tagname
|
|
2999
|
-
*/
|
|
3000
|
-
this.tagName = 'label';
|
|
3001
2819
|
this.getTagName = () => {
|
|
3002
2820
|
this.tagName = this.isLegend ? 'legend' : 'label';
|
|
3003
2821
|
};
|
|
2822
|
+
this.identifier = undefined;
|
|
2823
|
+
this.required = undefined;
|
|
2824
|
+
this.isLegend = false;
|
|
2825
|
+
this.tagName = 'label';
|
|
3004
2826
|
}
|
|
3005
2827
|
validateIdentifier(newValue) {
|
|
3006
2828
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -3058,39 +2880,6 @@ const MgInputToggle = class {
|
|
|
3058
2880
|
this.classIsActive = 'mg-input--toggle-is-active';
|
|
3059
2881
|
this.classOnOff = 'mg-input--toggle-on-off';
|
|
3060
2882
|
this.classIcon = 'mg-input--toggle-icon';
|
|
3061
|
-
/**
|
|
3062
|
-
* Input name
|
|
3063
|
-
* If not set the value equals the identifier
|
|
3064
|
-
*/
|
|
3065
|
-
this.name = this.identifier;
|
|
3066
|
-
/**
|
|
3067
|
-
* Define if label is visible
|
|
3068
|
-
*/
|
|
3069
|
-
this.labelHide = false;
|
|
3070
|
-
/**
|
|
3071
|
-
* Define if toggle have on/off style
|
|
3072
|
-
*/
|
|
3073
|
-
this.isOnOff = false;
|
|
3074
|
-
/**
|
|
3075
|
-
* Define if toggle display icon
|
|
3076
|
-
*/
|
|
3077
|
-
this.isIcon = false;
|
|
3078
|
-
/**
|
|
3079
|
-
* Define if input is readonly
|
|
3080
|
-
*/
|
|
3081
|
-
this.readonly = false;
|
|
3082
|
-
/**
|
|
3083
|
-
* Define if input is disabled
|
|
3084
|
-
*/
|
|
3085
|
-
this.disabled = false;
|
|
3086
|
-
/**
|
|
3087
|
-
* Component classes
|
|
3088
|
-
*/
|
|
3089
|
-
this.classList = new ClassList(['mg-input--toggle']);
|
|
3090
|
-
/**
|
|
3091
|
-
* Checked internal value
|
|
3092
|
-
*/
|
|
3093
|
-
this.checked = false;
|
|
3094
2883
|
/**
|
|
3095
2884
|
* Change checked value
|
|
3096
2885
|
*
|
|
@@ -3115,6 +2904,22 @@ const MgInputToggle = class {
|
|
|
3115
2904
|
slots.forEach(slot => slot.setAttribute('title', slot.textContent));
|
|
3116
2905
|
}
|
|
3117
2906
|
};
|
|
2907
|
+
this.value = undefined;
|
|
2908
|
+
this.items = undefined;
|
|
2909
|
+
this.identifier = undefined;
|
|
2910
|
+
this.name = this.identifier;
|
|
2911
|
+
this.label = undefined;
|
|
2912
|
+
this.labelOnTop = undefined;
|
|
2913
|
+
this.labelHide = false;
|
|
2914
|
+
this.isOnOff = false;
|
|
2915
|
+
this.isIcon = false;
|
|
2916
|
+
this.readonly = false;
|
|
2917
|
+
this.disabled = false;
|
|
2918
|
+
this.tooltip = undefined;
|
|
2919
|
+
this.helpText = undefined;
|
|
2920
|
+
this.classList = new ClassList(['mg-input--toggle']);
|
|
2921
|
+
this.options = undefined;
|
|
2922
|
+
this.checked = false;
|
|
3118
2923
|
}
|
|
3119
2924
|
handleValue(newValue) {
|
|
3120
2925
|
// Swich to the right option
|
|
@@ -3254,10 +3059,6 @@ const MgMenu = class {
|
|
|
3254
3059
|
************/
|
|
3255
3060
|
this.name = 'mg-menu';
|
|
3256
3061
|
this.focusedMenuItem = 0;
|
|
3257
|
-
/**
|
|
3258
|
-
* Component display direction. Default: "horizontal"
|
|
3259
|
-
*/
|
|
3260
|
-
this.direction = Direction.HORIZONTAL;
|
|
3261
3062
|
/**
|
|
3262
3063
|
* Close matching menu-item
|
|
3263
3064
|
*
|
|
@@ -3279,9 +3080,7 @@ const MgMenu = class {
|
|
|
3279
3080
|
// add listeners on menu item and edit index
|
|
3280
3081
|
this.menuItems.forEach((item, menuItemIndex) => {
|
|
3281
3082
|
['click', 'focus'].forEach(trigger => {
|
|
3282
|
-
(item.shadowRoot.querySelector('button') || item.shadowRoot.querySelector('a')).addEventListener(trigger, (
|
|
3283
|
-
event.preventDefault();
|
|
3284
|
-
event.stopPropagation();
|
|
3083
|
+
(item.shadowRoot.querySelector('button') || item.shadowRoot.querySelector('a')).addEventListener(trigger, () => {
|
|
3285
3084
|
this.focusedMenuItem = menuItemIndex;
|
|
3286
3085
|
// reset expanded on previous active menu item
|
|
3287
3086
|
this.menuItems.forEach((item, index) => {
|
|
@@ -3291,6 +3090,9 @@ const MgMenu = class {
|
|
|
3291
3090
|
});
|
|
3292
3091
|
});
|
|
3293
3092
|
};
|
|
3093
|
+
this.label = undefined;
|
|
3094
|
+
this.direction = Direction.HORIZONTAL;
|
|
3095
|
+
this.isChildMenu = undefined;
|
|
3294
3096
|
}
|
|
3295
3097
|
validateLabel(newValue) {
|
|
3296
3098
|
if (newValue === undefined) {
|
|
@@ -3377,7 +3179,7 @@ var Status$1;
|
|
|
3377
3179
|
*/
|
|
3378
3180
|
const sizes$1 = ['regular', 'medium', 'large'];
|
|
3379
3181
|
|
|
3380
|
-
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}";
|
|
3182
|
+
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}";
|
|
3381
3183
|
|
|
3382
3184
|
const MgMenuItem = class {
|
|
3383
3185
|
constructor(hostRef) {
|
|
@@ -3387,29 +3189,6 @@ const MgMenuItem = class {
|
|
|
3387
3189
|
************/
|
|
3388
3190
|
this.name = 'mg-menu-item';
|
|
3389
3191
|
this.navigationButton = `${this.name}__navigation-button`;
|
|
3390
|
-
/**
|
|
3391
|
-
* Define menu-item status. Default: "visible"
|
|
3392
|
-
*/
|
|
3393
|
-
this.status = Status$1.VISIBLE;
|
|
3394
|
-
/**
|
|
3395
|
-
* Define menu-item size. Default: "large".
|
|
3396
|
-
*/
|
|
3397
|
-
this.size = 'large';
|
|
3398
|
-
/**
|
|
3399
|
-
* Define menu-item content expanded. Default: false.
|
|
3400
|
-
*/
|
|
3401
|
-
this.expanded = false;
|
|
3402
|
-
/************
|
|
3403
|
-
* States *
|
|
3404
|
-
************/
|
|
3405
|
-
/**
|
|
3406
|
-
* Component button classes
|
|
3407
|
-
*/
|
|
3408
|
-
this.navigationButtonClassList = new ClassList([this.navigationButton]);
|
|
3409
|
-
/**
|
|
3410
|
-
* Does component have children. Default: false.
|
|
3411
|
-
*/
|
|
3412
|
-
this.hasChildren = false;
|
|
3413
3192
|
/************
|
|
3414
3193
|
* Methods *
|
|
3415
3194
|
************/
|
|
@@ -3446,10 +3225,22 @@ const MgMenuItem = class {
|
|
|
3446
3225
|
* @returns {void}
|
|
3447
3226
|
*/
|
|
3448
3227
|
this.handleElementCLick = (event) => {
|
|
3449
|
-
|
|
3228
|
+
if (this.hasChildren || this.status === Status$1.DISABLED) {
|
|
3229
|
+
event.preventDefault();
|
|
3230
|
+
event.stopPropagation();
|
|
3231
|
+
}
|
|
3232
|
+
// toggle expanded when mg-menu-item has child items
|
|
3450
3233
|
if (this.hasChildren)
|
|
3451
3234
|
this.toggleExpanded();
|
|
3452
3235
|
};
|
|
3236
|
+
this.href = undefined;
|
|
3237
|
+
this.status = Status$1.VISIBLE;
|
|
3238
|
+
this.size = 'large';
|
|
3239
|
+
this.expanded = false;
|
|
3240
|
+
this.navigationButtonClassList = new ClassList([this.navigationButton]);
|
|
3241
|
+
this.direction = undefined;
|
|
3242
|
+
this.isInMainMenu = undefined;
|
|
3243
|
+
this.hasChildren = false;
|
|
3453
3244
|
}
|
|
3454
3245
|
validateStatus(newValue, oldValue) {
|
|
3455
3246
|
if (oldValue !== undefined) {
|
|
@@ -3589,7 +3380,7 @@ MgMenuItem.style = mgMenuItemCss;
|
|
|
3589
3380
|
*/
|
|
3590
3381
|
const variants$1 = ['info', 'warning', 'success', 'danger'];
|
|
3591
3382
|
|
|
3592
|
-
const mgMessageCss = "
|
|
3383
|
+
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%}";
|
|
3593
3384
|
|
|
3594
3385
|
const MgMessage = class {
|
|
3595
3386
|
constructor(hostRef) {
|
|
@@ -3605,32 +3396,6 @@ const MgMessage = class {
|
|
|
3605
3396
|
this.closeButtonId = '';
|
|
3606
3397
|
// Stored timer setted when hide action is run from setTimeOut
|
|
3607
3398
|
this.storedTimer = null;
|
|
3608
|
-
/**
|
|
3609
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
3610
|
-
* If not set, it will be created.
|
|
3611
|
-
*/
|
|
3612
|
-
this.identifier = createID('mg-message');
|
|
3613
|
-
/**
|
|
3614
|
-
* Message variant
|
|
3615
|
-
*/
|
|
3616
|
-
this.variant = variants$1[0]; // info
|
|
3617
|
-
/**
|
|
3618
|
-
* Define if message has a cross button
|
|
3619
|
-
* RG 01: https://jira.mgdis.fr/browse/PDA9-140
|
|
3620
|
-
*/
|
|
3621
|
-
this.closeButton = false;
|
|
3622
|
-
/**
|
|
3623
|
-
* Define if message is hidden
|
|
3624
|
-
*/
|
|
3625
|
-
this.hide = false;
|
|
3626
|
-
/**
|
|
3627
|
-
* Component classes
|
|
3628
|
-
*/
|
|
3629
|
-
this.classList = new ClassList(['mg-message']);
|
|
3630
|
-
/**
|
|
3631
|
-
* Define if component is using actions slot
|
|
3632
|
-
*/
|
|
3633
|
-
this.hasActions = false;
|
|
3634
3399
|
/**
|
|
3635
3400
|
* Handle close button
|
|
3636
3401
|
*/
|
|
@@ -3665,6 +3430,13 @@ const MgMessage = class {
|
|
|
3665
3430
|
return 'exclamation-circle';
|
|
3666
3431
|
}
|
|
3667
3432
|
};
|
|
3433
|
+
this.identifier = createID('mg-message');
|
|
3434
|
+
this.delay = undefined;
|
|
3435
|
+
this.variant = variants$1[0];
|
|
3436
|
+
this.closeButton = false;
|
|
3437
|
+
this.hide = false;
|
|
3438
|
+
this.classList = new ClassList(['mg-message']);
|
|
3439
|
+
this.hasActions = false;
|
|
3668
3440
|
}
|
|
3669
3441
|
validateDelay(newValue) {
|
|
3670
3442
|
if (newValue && newValue < 2) {
|
|
@@ -3726,7 +3498,7 @@ const MgMessage = class {
|
|
|
3726
3498
|
* @returns {HTMLElement} HTML Element
|
|
3727
3499
|
*/
|
|
3728
3500
|
render() {
|
|
3729
|
-
return (index.h("div", { id: this.identifier, class: this.classList.join(), role: this.variant === 'info' ? 'status' : 'alert' }, index.h("span", { class: "mg-message__icon" }, index.h("mg-icon", { icon: this.getIcon() })), index.h("div", { class: "mg-message__content" }, index.h("span", { class: "mg-message__content-slot" }, index.h("slot", null)), this.hasActions && index.h("span", { class: "mg-message__content-separator" }), this.hasActions && (index.h("span", { class: "mg-message__content-actions-slot" }, index.h("slot", { name: "actions" })))), this.closeButton && (index.h("span", { class: "mg-message__close-button" }, index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose }, index.h("mg-icon", { icon: "cross" }))))));
|
|
3501
|
+
return (index.h("div", { id: this.identifier, class: this.classList.join(), role: this.variant === 'info' ? 'status' : 'alert' }, index.h("mg-card", null, index.h("span", { class: "mg-message__bar" }), index.h("span", { class: "mg-message__icon" }, index.h("mg-icon", { icon: this.getIcon() })), index.h("div", { class: "mg-message__content" }, index.h("span", { class: "mg-message__content-slot" }, index.h("slot", null)), this.hasActions && index.h("span", { class: "mg-message__content-separator" }), this.hasActions && (index.h("span", { class: "mg-message__content-actions-slot" }, index.h("slot", { name: "actions" })))), this.closeButton && (index.h("span", { class: "mg-message__close-button" }, index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.message.closeButton, onClick: this.handleClose }, index.h("mg-icon", { icon: "cross" })))))));
|
|
3730
3502
|
}
|
|
3731
3503
|
get element() { return index.getElement(this); }
|
|
3732
3504
|
static get watchers() { return {
|
|
@@ -3738,7 +3510,7 @@ const MgMessage = class {
|
|
|
3738
3510
|
};
|
|
3739
3511
|
MgMessage.style = mgMessageCss;
|
|
3740
3512
|
|
|
3741
|
-
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;
|
|
3513
|
+
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}";
|
|
3742
3514
|
|
|
3743
3515
|
const MgModal = class {
|
|
3744
3516
|
constructor(hostRef) {
|
|
@@ -3750,31 +3522,6 @@ const MgModal = class {
|
|
|
3750
3522
|
// IDs
|
|
3751
3523
|
this.closeButtonId = '';
|
|
3752
3524
|
this.titleId = '';
|
|
3753
|
-
/**
|
|
3754
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
3755
|
-
* If not set, it will be created.
|
|
3756
|
-
*/
|
|
3757
|
-
this.identifier = createID('mg-modal');
|
|
3758
|
-
/**
|
|
3759
|
-
* Define if modal has a cross button
|
|
3760
|
-
*/
|
|
3761
|
-
this.closeButton = false;
|
|
3762
|
-
/**
|
|
3763
|
-
* Define if modal is hidden
|
|
3764
|
-
*/
|
|
3765
|
-
this.hide = false;
|
|
3766
|
-
/**
|
|
3767
|
-
* Define if component is using actions slot
|
|
3768
|
-
*/
|
|
3769
|
-
this.hasActions = false;
|
|
3770
|
-
/**
|
|
3771
|
-
* Define if component is using content slot
|
|
3772
|
-
*/
|
|
3773
|
-
this.hasContent = false;
|
|
3774
|
-
/**
|
|
3775
|
-
* Component classes
|
|
3776
|
-
*/
|
|
3777
|
-
this.classList = new ClassList(['mg-modal']);
|
|
3778
3525
|
this.setFocus = () => {
|
|
3779
3526
|
// Get all focusable elements
|
|
3780
3527
|
this.modalFocusableElements = Array.from(this.element.querySelectorAll(focusableElements)).reduce((acc, focusableElement) => {
|
|
@@ -3817,6 +3564,13 @@ const MgModal = class {
|
|
|
3817
3564
|
this.handleClose = () => {
|
|
3818
3565
|
this.hide = true;
|
|
3819
3566
|
};
|
|
3567
|
+
this.identifier = createID('mg-modal');
|
|
3568
|
+
this.modalTitle = undefined;
|
|
3569
|
+
this.closeButton = false;
|
|
3570
|
+
this.hide = false;
|
|
3571
|
+
this.hasActions = false;
|
|
3572
|
+
this.hasContent = false;
|
|
3573
|
+
this.classList = new ClassList(['mg-modal']);
|
|
3820
3574
|
}
|
|
3821
3575
|
validateModalTitle(newValue) {
|
|
3822
3576
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -3892,7 +3646,7 @@ const MgModal = class {
|
|
|
3892
3646
|
* @returns {HTMLElement} HTML Element
|
|
3893
3647
|
*/
|
|
3894
3648
|
render() {
|
|
3895
|
-
return (index.h("
|
|
3649
|
+
return (index.h("div", { role: "alertdialog", id: this.identifier, class: this.classList.join(), tabindex: "-1", "aria-labelledby": this.titleId, "aria-modal": "true", "aria-hidden": this.hide }, index.h("mg-card", null, index.h("div", { class: "mg-modal__dialog" }, index.h("header", { class: "mg-modal__header" }, this.closeButton && (index.h("span", { class: "mg-modal__close-button" }, index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, index.h("mg-icon", { icon: "cross" })))), index.h("h1", { class: "mg-modal__title", id: this.titleId }, this.modalTitle)), this.hasContent && (index.h("article", { class: "mg-modal__content" }, index.h("slot", { name: "content" }))), this.hasActions && (index.h("footer", { class: "mg-modal__footer" }, index.h("slot", { name: "actions" })))))));
|
|
3896
3650
|
}
|
|
3897
3651
|
get element() { return index.getElement(this); }
|
|
3898
3652
|
static get watchers() { return {
|
|
@@ -3935,19 +3689,6 @@ const MgPagination = class {
|
|
|
3935
3689
|
constructor(hostRef) {
|
|
3936
3690
|
index.registerInstance(this, hostRef);
|
|
3937
3691
|
this.currentPageChange = index.createEvent(this, "current-page-change", 7);
|
|
3938
|
-
/**
|
|
3939
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
3940
|
-
* If not set, it will be created.
|
|
3941
|
-
*/
|
|
3942
|
-
this.identifier = createID('mg-pagination');
|
|
3943
|
-
/**
|
|
3944
|
-
* Component total pages
|
|
3945
|
-
*/
|
|
3946
|
-
this.totalPages = 1;
|
|
3947
|
-
/**
|
|
3948
|
-
* Component current page
|
|
3949
|
-
*/
|
|
3950
|
-
this.currentPage = 1;
|
|
3951
3692
|
/**
|
|
3952
3693
|
* Change current page from target
|
|
3953
3694
|
*
|
|
@@ -3980,6 +3721,10 @@ const MgPagination = class {
|
|
|
3980
3721
|
this.handleGoToPage = (action, disabled) => {
|
|
3981
3722
|
!disabled && this.goToPage(action === NavigationAction.NEXT ? this.currentPage + 1 : this.currentPage - 1);
|
|
3982
3723
|
};
|
|
3724
|
+
this.identifier = createID('mg-pagination');
|
|
3725
|
+
this.label = undefined;
|
|
3726
|
+
this.totalPages = 1;
|
|
3727
|
+
this.currentPage = 1;
|
|
3983
3728
|
}
|
|
3984
3729
|
validateTotalPages(newValue) {
|
|
3985
3730
|
if (newValue < 1) {
|
|
@@ -4033,34 +3778,13 @@ const MgPagination = class {
|
|
|
4033
3778
|
};
|
|
4034
3779
|
MgPagination.style = mgPaginationCss;
|
|
4035
3780
|
|
|
4036
|
-
const mgPanelCss = "
|
|
3781
|
+
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}";
|
|
4037
3782
|
|
|
4038
3783
|
const MgPanel = class {
|
|
4039
3784
|
constructor(hostRef) {
|
|
4040
3785
|
index.registerInstance(this, hostRef);
|
|
4041
3786
|
this.titleChange = index.createEvent(this, "title-change", 7);
|
|
4042
3787
|
this.expandedChange = index.createEvent(this, "expanded-change", 7);
|
|
4043
|
-
/**
|
|
4044
|
-
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
4045
|
-
* If not set, it will be created.
|
|
4046
|
-
*/
|
|
4047
|
-
this.identifier = createID('mg-panel');
|
|
4048
|
-
/**
|
|
4049
|
-
* Panel is opened
|
|
4050
|
-
*/
|
|
4051
|
-
this.expanded = false;
|
|
4052
|
-
/**
|
|
4053
|
-
* Panel title is editabled
|
|
4054
|
-
*/
|
|
4055
|
-
this.titleEditable = false;
|
|
4056
|
-
/**
|
|
4057
|
-
* Component classes
|
|
4058
|
-
*/
|
|
4059
|
-
this.classList = new ClassList(['mg-panel']);
|
|
4060
|
-
/**
|
|
4061
|
-
* Title is in edition mode
|
|
4062
|
-
*/
|
|
4063
|
-
this.isEditing = false;
|
|
4064
3788
|
/************
|
|
4065
3789
|
* Methods *
|
|
4066
3790
|
************/
|
|
@@ -4145,6 +3869,16 @@ const MgPanel = class {
|
|
|
4145
3869
|
}
|
|
4146
3870
|
return collapseButton();
|
|
4147
3871
|
};
|
|
3872
|
+
this.identifier = createID('mg-panel');
|
|
3873
|
+
this.panelTitle = undefined;
|
|
3874
|
+
this.titlePattern = undefined;
|
|
3875
|
+
this.titlePatternErrorMessage = undefined;
|
|
3876
|
+
this.expanded = false;
|
|
3877
|
+
this.expandToggleDisabled = undefined;
|
|
3878
|
+
this.titleEditable = false;
|
|
3879
|
+
this.classList = new ClassList(['mg-panel']);
|
|
3880
|
+
this.isEditing = false;
|
|
3881
|
+
this.updatedPanelTitle = undefined;
|
|
4148
3882
|
}
|
|
4149
3883
|
validatePanelTitle(newValue) {
|
|
4150
3884
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -4195,7 +3929,7 @@ const MgPanel = class {
|
|
|
4195
3929
|
* @returns {HTMLElement} html element
|
|
4196
3930
|
*/
|
|
4197
3931
|
render() {
|
|
4198
|
-
return (index.h("section", { class: this.classList.join(), id: this.identifier }, index.h("header", { class: "mg-panel__header", id: `${this.identifier}-header` }, index.h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()), index.h("div", { class: "mg-panel__header-right" }, index.h("slot", { name: "header-right" }))), index.h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded }, index.h("slot", null))));
|
|
3932
|
+
return (index.h("section", { class: this.classList.join(), id: this.identifier }, index.h("mg-card", null, index.h("header", { class: "mg-panel__header", id: `${this.identifier}-header` }, index.h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()), index.h("div", { class: "mg-panel__header-right" }, index.h("slot", { name: "header-right" }))), index.h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded }, index.h("slot", null)))));
|
|
4199
3933
|
}
|
|
4200
3934
|
get element() { return index.getElement(this); }
|
|
4201
3935
|
static get watchers() { return {
|
|
@@ -6004,34 +5738,13 @@ var createPopper = /*#__PURE__*/popperGenerator({
|
|
|
6004
5738
|
defaultModifiers: defaultModifiers
|
|
6005
5739
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
6006
5740
|
|
|
6007
|
-
const mgPopoverCss = "
|
|
5741
|
+
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}";
|
|
6008
5742
|
|
|
6009
5743
|
const MgPopover = class {
|
|
6010
5744
|
constructor(hostRef) {
|
|
6011
5745
|
index.registerInstance(this, hostRef);
|
|
6012
5746
|
this.displayChange = index.createEvent(this, "display-change", 7);
|
|
6013
5747
|
this.closeButtonId = '';
|
|
6014
|
-
/**
|
|
6015
|
-
* Sets an `id` attribute.
|
|
6016
|
-
* Needed by the input for accessibility `aria-decribedby`.
|
|
6017
|
-
*/
|
|
6018
|
-
this.identifier = createID('mg-popover');
|
|
6019
|
-
/**
|
|
6020
|
-
* Popover placement
|
|
6021
|
-
*/
|
|
6022
|
-
this.placement = 'bottom';
|
|
6023
|
-
/**
|
|
6024
|
-
* Define if popover has a cross button
|
|
6025
|
-
*/
|
|
6026
|
-
this.closeButton = false;
|
|
6027
|
-
/**
|
|
6028
|
-
* Display popover
|
|
6029
|
-
*/
|
|
6030
|
-
this.display = false;
|
|
6031
|
-
/**
|
|
6032
|
-
* Disable popover
|
|
6033
|
-
*/
|
|
6034
|
-
this.disabled = false;
|
|
6035
5748
|
/**
|
|
6036
5749
|
* Check if clicked outside of component
|
|
6037
5750
|
*
|
|
@@ -6082,6 +5795,11 @@ const MgPopover = class {
|
|
|
6082
5795
|
this.handleCloseButton = () => {
|
|
6083
5796
|
this.display = false;
|
|
6084
5797
|
};
|
|
5798
|
+
this.identifier = createID('mg-popover');
|
|
5799
|
+
this.placement = 'bottom';
|
|
5800
|
+
this.closeButton = false;
|
|
5801
|
+
this.display = false;
|
|
5802
|
+
this.disabled = false;
|
|
6085
5803
|
}
|
|
6086
5804
|
handleDisplay(newValue) {
|
|
6087
5805
|
if (newValue) {
|
|
@@ -6120,7 +5838,7 @@ const MgPopover = class {
|
|
|
6120
5838
|
this.closeButtonId = `${this.identifier}-close-button`;
|
|
6121
5839
|
}
|
|
6122
5840
|
// Get popover content
|
|
6123
|
-
this.popover = this.element.shadowRoot.
|
|
5841
|
+
this.popover = this.element.shadowRoot.getElementById(this.identifier);
|
|
6124
5842
|
//Get interactive element (first element without slot attribute)
|
|
6125
5843
|
const interactiveElement = this.element.querySelector(':not([slot])');
|
|
6126
5844
|
// Add aria attributes
|
|
@@ -6157,7 +5875,7 @@ const MgPopover = class {
|
|
|
6157
5875
|
* @returns {HTMLElement} HTML Element
|
|
6158
5876
|
*/
|
|
6159
5877
|
render() {
|
|
6160
|
-
return (index.h(index.Host, null, index.h("slot", null), index.h("div", { id: this.identifier, class: "mg-popover" }, this.closeButton && (index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, index.h("mg-icon", { icon: "cross" }))), index.h("div", { class: "mg-popover__title" }, index.h("slot", { name: "title" })), index.h("slot", { name: "content" }), index.h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
|
|
5878
|
+
return (index.h(index.Host, null, index.h("slot", null), index.h("div", { id: this.identifier, class: "mg-popover" }, index.h("mg-card", null, !this.disabled && this.closeButton && (index.h("mg-button", { identifier: this.closeButtonId, "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, index.h("mg-icon", { icon: "cross" }))), index.h("div", { class: "mg-popover__title" }, index.h("slot", { name: "title" })), index.h("slot", { name: "content" })), index.h("div", { class: "mg-popover__arrow", "data-popper-arrow": true }))));
|
|
6161
5879
|
}
|
|
6162
5880
|
get element() { return index.getElement(this); }
|
|
6163
5881
|
static get watchers() { return {
|
|
@@ -6166,6 +5884,47 @@ const MgPopover = class {
|
|
|
6166
5884
|
};
|
|
6167
5885
|
MgPopover.style = mgPopoverCss;
|
|
6168
5886
|
|
|
5887
|
+
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)}";
|
|
5888
|
+
|
|
5889
|
+
const MgSkipLinks = class {
|
|
5890
|
+
constructor(hostRef) {
|
|
5891
|
+
index.registerInstance(this, hostRef);
|
|
5892
|
+
this.links = undefined;
|
|
5893
|
+
}
|
|
5894
|
+
validateLinks(links) {
|
|
5895
|
+
if (links === undefined ||
|
|
5896
|
+
links.length === 0 ||
|
|
5897
|
+
links.some(link => link.href === undefined || !link.href.startsWith('#') || link.label === undefined || link.label.trim() === '')) {
|
|
5898
|
+
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.`);
|
|
5899
|
+
}
|
|
5900
|
+
}
|
|
5901
|
+
/*************
|
|
5902
|
+
* Lifecycle *
|
|
5903
|
+
*************/
|
|
5904
|
+
/**
|
|
5905
|
+
* Check if props are well configured on init
|
|
5906
|
+
*
|
|
5907
|
+
* @returns {void}
|
|
5908
|
+
*/
|
|
5909
|
+
componentWillLoad() {
|
|
5910
|
+
this.validateLinks(this.links);
|
|
5911
|
+
this.messages = initLocales(this.element).messages;
|
|
5912
|
+
}
|
|
5913
|
+
/**
|
|
5914
|
+
* Render
|
|
5915
|
+
*
|
|
5916
|
+
* @returns {HTMLElement} HTML Element
|
|
5917
|
+
*/
|
|
5918
|
+
render() {
|
|
5919
|
+
return (index.h("nav", { class: "mg-skip-links", role: "navigation", "aria-label": this.messages.skipLinks.navLabel }, index.h("ul", { class: "mg-skip-links__list" }, this.links.map(link => (index.h("li", null, index.h("a", { class: "mg-skip-links__link", href: link.href }, link.label)))))));
|
|
5920
|
+
}
|
|
5921
|
+
get element() { return index.getElement(this); }
|
|
5922
|
+
static get watchers() { return {
|
|
5923
|
+
"links": ["validateLinks"]
|
|
5924
|
+
}; }
|
|
5925
|
+
};
|
|
5926
|
+
MgSkipLinks.style = mgSkipLinksCss;
|
|
5927
|
+
|
|
6169
5928
|
/**
|
|
6170
5929
|
* Available tabs items status
|
|
6171
5930
|
*/
|
|
@@ -6197,31 +5956,11 @@ const MgTabs = class {
|
|
|
6197
5956
|
/************
|
|
6198
5957
|
* Internal *
|
|
6199
5958
|
************/
|
|
5959
|
+
// classes
|
|
6200
5960
|
this.tabPanel = 'panel';
|
|
6201
|
-
this.startIndex = 1;
|
|
6202
5961
|
this.buttonTabBaseClass = 'mg-tabs__navigation-button';
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
* If not set, it will be created.
|
|
6206
|
-
*/
|
|
6207
|
-
this.identifier = createID('mg-tabs');
|
|
6208
|
-
/**
|
|
6209
|
-
* Define tabs size
|
|
6210
|
-
*/
|
|
6211
|
-
this.size = 'regular';
|
|
6212
|
-
/**
|
|
6213
|
-
* Active tab number
|
|
6214
|
-
* default: first is 1
|
|
6215
|
-
*/
|
|
6216
|
-
this.activeTab = 1;
|
|
6217
|
-
/**
|
|
6218
|
-
* Component tabs
|
|
6219
|
-
*/
|
|
6220
|
-
this.tabs = [];
|
|
6221
|
-
/**
|
|
6222
|
-
* Component classes
|
|
6223
|
-
*/
|
|
6224
|
-
this.classList = new ClassList(['mg-tabs']);
|
|
5962
|
+
// variables
|
|
5963
|
+
this.startIndex = 1;
|
|
6225
5964
|
/**
|
|
6226
5965
|
* Method to set active tab
|
|
6227
5966
|
*
|
|
@@ -6312,6 +6051,13 @@ const MgTabs = class {
|
|
|
6312
6051
|
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
6313
6052
|
}
|
|
6314
6053
|
};
|
|
6054
|
+
this.identifier = createID('mg-tabs');
|
|
6055
|
+
this.label = undefined;
|
|
6056
|
+
this.size = 'regular';
|
|
6057
|
+
this.items = undefined;
|
|
6058
|
+
this.activeTab = 1;
|
|
6059
|
+
this.tabs = [];
|
|
6060
|
+
this.classList = new ClassList(['mg-tabs']);
|
|
6315
6061
|
}
|
|
6316
6062
|
validateLabel(newValue) {
|
|
6317
6063
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -6390,7 +6136,7 @@ MgTabs.style = mgTabsCss;
|
|
|
6390
6136
|
*/
|
|
6391
6137
|
const variants = ['primary', 'secondary', 'success', 'warning', 'danger', 'info'];
|
|
6392
6138
|
|
|
6393
|
-
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}";
|
|
6139
|
+
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}";
|
|
6394
6140
|
|
|
6395
6141
|
const MgTag = class {
|
|
6396
6142
|
constructor(hostRef) {
|
|
@@ -6400,16 +6146,10 @@ const MgTag = class {
|
|
|
6400
6146
|
************/
|
|
6401
6147
|
// Classes
|
|
6402
6148
|
this.classOutline = `mg-tag--outline`;
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
* Define button variant
|
|
6408
|
-
*/
|
|
6409
|
-
this.variant = variants[0]; // primary
|
|
6410
|
-
/**
|
|
6411
|
-
* Component classes
|
|
6412
|
-
*/
|
|
6149
|
+
this.classSoft = `mg-tag--soft`;
|
|
6150
|
+
this.variant = variants[0];
|
|
6151
|
+
this.outline = undefined;
|
|
6152
|
+
this.soft = undefined;
|
|
6413
6153
|
this.classList = new ClassList(['mg-tag']);
|
|
6414
6154
|
}
|
|
6415
6155
|
validateVariant(newValue, oldValue) {
|
|
@@ -6429,6 +6169,29 @@ const MgTag = class {
|
|
|
6429
6169
|
else
|
|
6430
6170
|
this.classList.delete(this.classOutline);
|
|
6431
6171
|
}
|
|
6172
|
+
validateSoft(newValue) {
|
|
6173
|
+
// usage validation
|
|
6174
|
+
if (newValue && this.outline)
|
|
6175
|
+
throw new Error('<mg-tag> prop "soft" can NOT be used with prop "outline".');
|
|
6176
|
+
// apply class
|
|
6177
|
+
if (newValue)
|
|
6178
|
+
this.classList.add(this.classSoft);
|
|
6179
|
+
else
|
|
6180
|
+
this.classList.delete(this.classSoft);
|
|
6181
|
+
}
|
|
6182
|
+
/*************
|
|
6183
|
+
* Methods *
|
|
6184
|
+
*************/
|
|
6185
|
+
/**
|
|
6186
|
+
* Validate the given textContent
|
|
6187
|
+
*
|
|
6188
|
+
* @param {string} textContent html element textContent property
|
|
6189
|
+
* @returns {void}
|
|
6190
|
+
*/
|
|
6191
|
+
validateTextContent(textContent) {
|
|
6192
|
+
if (!textContent || textContent.trim() === '')
|
|
6193
|
+
throw new Error('<mg-tag> slot must contain a text content.');
|
|
6194
|
+
}
|
|
6432
6195
|
/*************
|
|
6433
6196
|
* Lifecycle *
|
|
6434
6197
|
*************/
|
|
@@ -6440,6 +6203,8 @@ const MgTag = class {
|
|
|
6440
6203
|
componentWillLoad() {
|
|
6441
6204
|
this.validateVariant(this.variant);
|
|
6442
6205
|
this.validateOutline(this.outline);
|
|
6206
|
+
this.validateSoft(this.soft);
|
|
6207
|
+
this.validateTextContent(this.element.textContent);
|
|
6443
6208
|
}
|
|
6444
6209
|
/**
|
|
6445
6210
|
* Render
|
|
@@ -6449,9 +6214,11 @@ const MgTag = class {
|
|
|
6449
6214
|
render() {
|
|
6450
6215
|
return (index.h("span", { class: this.classList.join() }, index.h("slot", null)));
|
|
6451
6216
|
}
|
|
6217
|
+
get element() { return index.getElement(this); }
|
|
6452
6218
|
static get watchers() { return {
|
|
6453
6219
|
"variant": ["validateVariant"],
|
|
6454
|
-
"outline": ["validateOutline"]
|
|
6220
|
+
"outline": ["validateOutline"],
|
|
6221
|
+
"soft": ["validateSoft"]
|
|
6455
6222
|
}; }
|
|
6456
6223
|
};
|
|
6457
6224
|
MgTag.style = mgTagCss;
|
|
@@ -6468,23 +6235,6 @@ const mgTooltipCss = ":host{display:inline-block}.mg-tooltip{display:none;paddin
|
|
|
6468
6235
|
const MgTooltip = class {
|
|
6469
6236
|
constructor(hostRef) {
|
|
6470
6237
|
index.registerInstance(this, hostRef);
|
|
6471
|
-
/**
|
|
6472
|
-
* Sets an `id` attribute.
|
|
6473
|
-
* Needed by the input for accessibility `aria-decribedby`.
|
|
6474
|
-
*/
|
|
6475
|
-
this.identifier = createID('mg-tooltip');
|
|
6476
|
-
/**
|
|
6477
|
-
* Tooltip placement
|
|
6478
|
-
*/
|
|
6479
|
-
this.placement = 'bottom';
|
|
6480
|
-
/**
|
|
6481
|
-
* Display tooltip
|
|
6482
|
-
*/
|
|
6483
|
-
this.display = false;
|
|
6484
|
-
/**
|
|
6485
|
-
* Disable tooltip
|
|
6486
|
-
*/
|
|
6487
|
-
this.disabled = false;
|
|
6488
6238
|
/**
|
|
6489
6239
|
* Show tooltip
|
|
6490
6240
|
*
|
|
@@ -6630,6 +6380,11 @@ const MgTooltip = class {
|
|
|
6630
6380
|
});
|
|
6631
6381
|
});
|
|
6632
6382
|
};
|
|
6383
|
+
this.identifier = createID('mg-tooltip');
|
|
6384
|
+
this.message = undefined;
|
|
6385
|
+
this.placement = 'bottom';
|
|
6386
|
+
this.display = false;
|
|
6387
|
+
this.disabled = false;
|
|
6633
6388
|
}
|
|
6634
6389
|
validateMessage(newValue) {
|
|
6635
6390
|
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
@@ -6662,8 +6417,7 @@ const MgTooltip = class {
|
|
|
6662
6417
|
const slotElement = this.element.firstElementChild;
|
|
6663
6418
|
// Get interactive element
|
|
6664
6419
|
const interactiveElements = ['a', 'button', 'input', 'textarea', 'select']; //! Might needs updates
|
|
6665
|
-
const interactiveElement = this.element.shadowRoot.querySelector(interactiveElements.join(',')) ||
|
|
6666
|
-
((_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(interactiveElements.join(',')));
|
|
6420
|
+
const interactiveElement = this.element.shadowRoot.querySelector(interactiveElements.join(',')) || ((_a = slotElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(interactiveElements.join(',')));
|
|
6667
6421
|
// define selected element to become tooltip selector
|
|
6668
6422
|
this.tooltipedElement = interactiveElement || slotElement;
|
|
6669
6423
|
// Check if slotted element is a disabled mg-button
|
|
@@ -6724,6 +6478,7 @@ exports.mg_modal = MgModal;
|
|
|
6724
6478
|
exports.mg_pagination = MgPagination;
|
|
6725
6479
|
exports.mg_panel = MgPanel;
|
|
6726
6480
|
exports.mg_popover = MgPopover;
|
|
6481
|
+
exports.mg_skip_links = MgSkipLinks;
|
|
6727
6482
|
exports.mg_tabs = MgTabs;
|
|
6728
6483
|
exports.mg_tag = MgTag;
|
|
6729
6484
|
exports.mg_tooltip = MgTooltip;
|