@mgdis/mg-components 6.20.0 → 6.22.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-TUElr4Wv.js → index-BxB20_Vw.js} +54 -0
- package/dist/cjs/{index-Bp6wZzau.js → index-C2viYwrR.js} +1761 -80
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +761 -371
- package/dist/cjs/mg-alert.cjs.entry.js +17 -9
- package/dist/cjs/mg-breadcrumb.cjs.entry.js +63 -0
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-fieldset.cjs.entry.js +24 -7
- package/dist/cjs/mg-input-combobox.cjs.entry.js +49 -19
- package/dist/cjs/mg-input-file.cjs.entry.js +384 -0
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +40096 -15821
- package/dist/cjs/{mg-input.conf-D7jmj_lh.js → mg-input.conf-BNpeATnq.js} +7 -0
- package/dist/cjs/mg-loader.cjs.entry.js +8 -6
- package/dist/cjs/mg-progress.cjs.entry.js +19 -9
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/collection-manifest.json +5 -3
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +2 -2
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +877 -0
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +212 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.js +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +300 -94
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.js +29 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +163 -53
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +3 -36
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js +0 -4
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +21 -43
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +65 -38
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.js +1 -0
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +92 -0
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +12 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js +12 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-table/mg-table.js +37 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +0 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +13 -33
- package/dist/collection/locales/en/messages.json +14 -0
- package/dist/collection/locales/fr/messages.json +14 -0
- package/dist/components/events.utils.js +1 -23
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -408
- package/dist/components/index3.js +1 -476
- package/dist/components/mg-action-more.js +1 -254
- package/dist/components/mg-alert.js +1 -224
- package/dist/components/mg-badge.js +1 -6
- package/dist/components/mg-badge2.js +1 -113
- package/dist/components/mg-breadcrumb.d.ts +11 -0
- package/dist/components/mg-breadcrumb.js +1 -0
- package/dist/components/mg-button.js +1 -6
- package/dist/components/mg-button2.js +1 -275
- package/dist/components/mg-card.js +1 -6
- package/dist/components/mg-card2.js +1 -92
- package/dist/components/mg-character-left.js +1 -6
- package/dist/components/mg-character-left2.js +1 -75
- package/dist/components/mg-details.js +1 -104
- package/dist/components/mg-divider.js +1 -6
- package/dist/components/mg-divider2.js +1 -49
- package/dist/components/mg-fieldset.js +1 -209
- package/dist/components/mg-form.js +1 -302
- package/dist/components/mg-icon.js +1 -6
- package/dist/components/mg-icon2.js +1 -188
- package/dist/components/mg-illustrated-message.js +1 -129
- package/dist/components/mg-input-checkbox-paginated.js +1 -6
- package/dist/components/mg-input-checkbox-paginated2.js +1 -135
- package/dist/components/mg-input-checkbox.js +1 -762
- package/dist/components/mg-input-combobox.js +1 -940
- package/dist/components/mg-input-date.js +1 -463
- package/dist/components/mg-input-file.d.ts +11 -0
- package/dist/components/mg-input-file.js +1 -0
- package/dist/components/mg-input-numeric.js +1 -592
- package/dist/components/mg-input-password.js +1 -360
- package/dist/components/mg-input-radio.js +1 -392
- package/dist/components/mg-input-rich-text-editor.js +1663 -16797
- package/dist/components/mg-input-select.js +1 -6
- package/dist/components/mg-input-select2.js +1 -481
- package/dist/components/mg-input-text.js +1 -6
- package/dist/components/mg-input-text2.js +1 -514
- package/dist/components/mg-input-textarea.js +1 -412
- package/dist/components/mg-input-title.js +1 -6
- package/dist/components/mg-input-title2.js +1 -81
- package/dist/components/mg-input-toggle.js +1 -371
- package/dist/components/mg-input.conf.js +1 -0
- package/dist/components/mg-input.js +1 -6
- package/dist/components/mg-input2.js +1 -459
- package/dist/components/mg-item-more.js +1 -6
- package/dist/components/mg-item-more2.js +1 -505
- package/dist/components/mg-loader.js +1 -6
- package/dist/components/mg-loader2.js +1 -74
- package/dist/components/mg-menu-item.js +1 -6
- package/dist/components/mg-menu-item2.js +1 -485
- package/dist/components/mg-menu.js +1 -6
- package/dist/components/mg-message.js +1 -6
- package/dist/components/mg-message2.js +1 -146
- package/dist/components/mg-modal.js +1 -184
- package/dist/components/mg-pagination.js +1 -234
- package/dist/components/mg-panel.js +1 -350
- package/dist/components/mg-popover-content.js +1 -6
- package/dist/components/mg-popover-content2.js +1 -96
- package/dist/components/mg-popover.js +1 -6
- package/dist/components/mg-popover2.js +1 -312
- package/dist/components/mg-progress.js +1 -123
- package/dist/components/mg-skip-links.js +1 -78
- package/dist/components/mg-table.js +1 -319
- package/dist/components/mg-tabs.js +1 -6
- package/dist/components/mg-tabs2.js +1 -315
- package/dist/components/mg-tag.js +1 -133
- package/dist/components/mg-tooltip-content.js +1 -6
- package/dist/components/mg-tooltip-content2.js +1 -42
- package/dist/components/mg-tooltip.js +1 -6
- package/dist/components/mg-tooltip2.js +1 -421
- package/dist/components/popper.js +1 -1790
- package/dist/esm/{index-BluNKQ3L.js → index-DFwaH2hS.js} +1761 -80
- package/dist/esm/{index-CNX6lq0x.js → index-DSEloqPn.js} +54 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +761 -371
- package/dist/esm/mg-alert.entry.js +17 -9
- package/dist/esm/mg-breadcrumb.entry.js +61 -0
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-fieldset.entry.js +24 -7
- package/dist/esm/mg-input-combobox.entry.js +49 -19
- package/dist/esm/mg-input-file.entry.js +382 -0
- package/dist/esm/mg-input-rich-text-editor.entry.js +40083 -15808
- package/dist/esm/{mg-input.conf-DDnrE1hD.js → mg-input.conf-C9rmNQIL.js} +7 -1
- package/dist/esm/mg-loader.entry.js +8 -6
- package/dist/esm/mg-progress.entry.js +19 -9
- package/dist/mg-components/locales/en/messages.json +14 -0
- package/dist/mg-components/locales/fr/messages.json +14 -0
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-0482eb9f.entry.js +1 -0
- package/dist/mg-components/{p-7132bca1.entry.js → p-2ee92f38.entry.js} +1 -1
- package/dist/mg-components/{p-916dfb6d.entry.js → p-3b653226.entry.js} +1 -1
- package/dist/mg-components/p-5745fbea.entry.js +1 -0
- package/dist/mg-components/p-C9rmNQIL.js +1 -0
- package/dist/mg-components/p-DFwaH2hS.js +2 -0
- package/dist/mg-components/p-DSEloqPn.js +1 -0
- package/dist/mg-components/p-adec7fcc.entry.js +1 -0
- package/dist/mg-components/p-c63f97f0.entry.js +1658 -0
- package/dist/mg-components/p-c8c8cfc1.entry.js +1 -0
- package/dist/mg-components/p-cc793586.entry.js +1 -0
- package/dist/mg-components/p-d5e69c95.entry.js +1 -0
- package/dist/types/assets/icons/index.d.ts +2 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +7 -1
- package/dist/types/components/molecules/inputs/mg-input-file/mg-input-file.d.ts +210 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +17 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/index.d.ts +27 -19
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +3 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +50 -16
- package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.conf.d.ts +0 -5
- package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.d.ts +1 -6
- package/dist/types/components/molecules/menus/mg-menu/mg-menu.conf.d.ts +2 -10
- package/dist/types/components/molecules/menus/mg-menu/mg-menu.d.ts +7 -7
- package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +12 -8
- package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.d.ts +18 -0
- package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +34 -0
- package/dist/types/components/molecules/mg-table/mg-table.d.ts +6 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +1 -9
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +4 -4
- package/dist/types/components.d.ts +302 -46
- package/dist/types/stencil-public-runtime.d.ts +76 -12
- package/ide/intellij/web-types.json +483 -51
- package/ide/vscode/css-custom-data.json +10 -2
- package/ide/vscode/html-custom-data.json +445 -104
- package/package.json +24 -23
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.scss +0 -1
- package/dist/mg-components/p-016bd291.entry.js +0 -1
- package/dist/mg-components/p-186a6139.entry.js +0 -1
- package/dist/mg-components/p-BluNKQ3L.js +0 -2
- package/dist/mg-components/p-CNX6lq0x.js +0 -1
- package/dist/mg-components/p-DDnrE1hD.js +0 -1
- package/dist/mg-components/p-cd061b38.entry.js +0 -1
- package/dist/mg-components/p-d2c72f09.entry.js +0 -1
- package/dist/mg-components/p-d5a276eb.entry.js +0 -1
- package/ide/vscode/custom.css-data.json +0 -425
|
@@ -1,485 +1 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as createID, C as ClassList, i as isValidString, a as isValideID, t as toString, n as nextTick } from './index2.js';
|
|
3
|
-
import { i as initLocales } from './index3.js';
|
|
4
|
-
import { d as defineCustomElement$6 } from './mg-badge2.js';
|
|
5
|
-
import { d as defineCustomElement$5 } from './mg-button2.js';
|
|
6
|
-
import { d as defineCustomElement$4 } from './mg-card2.js';
|
|
7
|
-
import { d as defineCustomElement$3 } from './mg-icon2.js';
|
|
8
|
-
import { d as defineCustomElement$2 } from './mg-popover2.js';
|
|
9
|
-
import { d as defineCustomElement$1 } from './mg-popover-content2.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Available menu item status values
|
|
13
|
-
*/
|
|
14
|
-
const Status = {
|
|
15
|
-
VISIBLE: 'visible',
|
|
16
|
-
HIDDEN: 'hidden',
|
|
17
|
-
DISABLED: 'disabled',
|
|
18
|
-
ACTIVE: 'active',
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* List of all possibles target
|
|
22
|
-
*/
|
|
23
|
-
const targets = ['_blank', '_self', '_parent', '_top'];
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Menu direction values
|
|
27
|
-
*/
|
|
28
|
-
const directions = {
|
|
29
|
-
VERTICAL: 'vertical',
|
|
30
|
-
HORIZONTAL: 'horizontal',
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* List of all possibles sizes
|
|
34
|
-
*/
|
|
35
|
-
const sizes = ['medium', 'large', 'xlarge'];
|
|
36
|
-
|
|
37
|
-
const mgMenuItemCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}/*!\n * @prop --mg-c-menu-item-color: Defines menu item global color, used for bottom line and active tabs. Default value: `--mg-b-color-app`.\n * @prop --mg-c-menu-item-color-text: Defines the color of the menu item. Unset by default, fallback on `--mg-b-color-dark`.\n * @prop --mg-c-menu-item-navigation-button-max-width: Defines the max-width property for the navigation button. Unset by default.\n */.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{height:var(--mg-b-size-40);padding:var(--mg-b-size-12) var(--mg-b-size-16)}.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button,.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button ::slotted([slot=label]),.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button ::slotted([slot=metadata]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium ::slotted([slot=label]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium ::slotted([slot=metadata]){font-size:var(--mg-b-font-size)}.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--horizontal,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium.mg-c-menu-item__navigation-button--horizontal{padding-bottom:var(--mg-b-size-12)}.mg-c-menu-item.mg-c-menu-item--size-medium .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--vertical,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium.mg-c-menu-item__navigation-button--vertical{padding-left:var(--mg-b-size-16)}.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{height:var(--mg-b-size-48);padding:var(--mg-b-size-12) var(--mg-b-size-32)}.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button,.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button ::slotted([slot=label]),.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button ::slotted([slot=metadata]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large ::slotted([slot=label]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large ::slotted([slot=metadata]){font-size:var(--mg-b-font-size-h4)}.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--horizontal,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large.mg-c-menu-item__navigation-button--horizontal{padding-bottom:var(--mg-b-size-12)}.mg-c-menu-item.mg-c-menu-item--size-large .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--vertical,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large.mg-c-menu-item__navigation-button--vertical{padding-left:var(--mg-b-size-32)}.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{height:var(--mg-b-size-72);padding:var(--mg-b-size-12) var(--mg-b-size-40)}.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button,.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button ::slotted([slot=label]),.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button ::slotted([slot=metadata]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge ::slotted([slot=label]),.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge ::slotted([slot=metadata]){font-size:var(--mg-b-font-size-h4)}.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--horizontal,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge.mg-c-menu-item__navigation-button--horizontal{padding-bottom:var(--mg-b-size-12)}.mg-c-menu-item.mg-c-menu-item--size-xlarge .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--vertical,.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge.mg-c-menu-item__navigation-button--vertical{padding-left:var(--mg-b-size-40)}.mg-c-menu-item__navigation-button{display:flex;box-sizing:border-box;align-items:center;border:none;background-color:unset;color:var(--mg-c-menu-item-color-text, var(--mg-b-color-dark));column-gap:var(--mg-c-menu-item-navigation-button-column-gap, var(--mg-b-size-8));cursor:pointer;font-family:var(--mg-b-font-family);font-weight:400;line-height:var(--mg-b-line-height);text-decoration:none;white-space:nowrap}.mg-c-menu-item__navigation-button:disabled,.mg-c-menu-item__navigation-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-menu-item__navigation-button:focus-visible{z-index:10}.mg-c-menu-item__navigation-button:hover:not(.mg-c-menu-item__navigation-button--disabled),.mg-c-menu-item__navigation-button:focus-visible:not(.mg-c-menu-item__navigation-button--disabled){background-color:color-mix(in srgb, var(--mg-c-menu-item-color), transparent 90%)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active{color:var(--mg-c-menu-item-color);font-weight:600}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active.mg-c-menu-item__navigation-button--horizontal{box-shadow:inset 0 calc(-1*var(--mg-b-size-4)) var(--mg-c-menu-item-color)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active.mg-c-menu-item__navigation-button--vertical{box-shadow:inset var(--mg-b-size-4) 0 var(--mg-c-menu-item-color)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--hidden{display:none}:host([data-style-direction=vertical][data-level=\"1\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(1*var(--mg-b-size-16))}:host([data-level=\"1\"]) .mg-c-menu-item__collapse-container{z-index:10}:host([data-style-direction=vertical][data-level=\"2\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(2*var(--mg-b-size-16))}:host([data-level=\"2\"]) .mg-c-menu-item__collapse-container{z-index:20}:host([data-style-direction=vertical][data-level=\"3\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(3*var(--mg-b-size-16))}:host([data-level=\"3\"]) .mg-c-menu-item__collapse-container{z-index:30}:host([data-style-direction=vertical][data-level=\"4\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(4*var(--mg-b-size-16))}:host([data-level=\"4\"]) .mg-c-menu-item__collapse-container{z-index:40}:host([data-style-direction=vertical][data-level=\"5\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(5*var(--mg-b-size-16))}:host([data-level=\"5\"]) .mg-c-menu-item__collapse-container{z-index:50}:host([data-style-direction=vertical][data-level=\"6\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-medium{padding-left:calc(6*var(--mg-b-size-16))}:host([data-level=\"6\"]) .mg-c-menu-item__collapse-container{z-index:60}:host([data-style-direction=vertical][data-level=\"1\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(1*var(--mg-b-size-32))}:host([data-level=\"1\"]) .mg-c-menu-item__collapse-container{z-index:10}:host([data-style-direction=vertical][data-level=\"2\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(2*var(--mg-b-size-32))}:host([data-level=\"2\"]) .mg-c-menu-item__collapse-container{z-index:20}:host([data-style-direction=vertical][data-level=\"3\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(3*var(--mg-b-size-32))}:host([data-level=\"3\"]) .mg-c-menu-item__collapse-container{z-index:30}:host([data-style-direction=vertical][data-level=\"4\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(4*var(--mg-b-size-32))}:host([data-level=\"4\"]) .mg-c-menu-item__collapse-container{z-index:40}:host([data-style-direction=vertical][data-level=\"5\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(5*var(--mg-b-size-32))}:host([data-level=\"5\"]) .mg-c-menu-item__collapse-container{z-index:50}:host([data-style-direction=vertical][data-level=\"6\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-large{padding-left:calc(6*var(--mg-b-size-32))}:host([data-level=\"6\"]) .mg-c-menu-item__collapse-container{z-index:60}:host([data-style-direction=vertical][data-level=\"1\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(1*var(--mg-b-size-40))}:host([data-level=\"1\"]) .mg-c-menu-item__collapse-container{z-index:10}:host([data-style-direction=vertical][data-level=\"2\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(2*var(--mg-b-size-40))}:host([data-level=\"2\"]) .mg-c-menu-item__collapse-container{z-index:20}:host([data-style-direction=vertical][data-level=\"3\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(3*var(--mg-b-size-40))}:host([data-level=\"3\"]) .mg-c-menu-item__collapse-container{z-index:30}:host([data-style-direction=vertical][data-level=\"4\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(4*var(--mg-b-size-40))}:host([data-level=\"4\"]) .mg-c-menu-item__collapse-container{z-index:40}:host([data-style-direction=vertical][data-level=\"5\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(5*var(--mg-b-size-40))}:host([data-level=\"5\"]) .mg-c-menu-item__collapse-container{z-index:50}:host([data-style-direction=vertical][data-level=\"6\"]) .mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--size-xlarge{padding-left:calc(6*var(--mg-b-size-40))}:host([data-level=\"6\"]) .mg-c-menu-item__collapse-container{z-index:60}.mg-c-menu-item{max-width:var(--mg-c-menu-item-navigation-button-max-width)}.mg-c-menu-item__collapse-container{z-index:10;width:max-content}.mg-c-menu-item__navigation-button-center{min-width:0}.mg-c-menu-item__navigation-button-text-content{display:flex;width:100%;align-items:center}.mg-c-menu-item__navigation-button-text-content-notification,.mg-c-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:var(--mg-b-size-8);font-size:var(--mg-b-font-size)}.mg-c-menu-item__navigation-button-new-tab{margin-left:var(--mg-b-size-4)}.mg-c-menu-item__navigation-button-chevron{display:var(--mg-c-menu-item-chevron-display);margin-left:auto;transition:200ms}.mg-c-menu-item__navigation-button-chevron--rotate.mg-c-menu-item__navigation-button-chevron{transform:rotate(180deg)}:host{position:relative;display:flex;--mg-c-popover-padding-vertical:0;--mg-c-popover-padding-horizontal:0;--mg-c-popover-max-width:unset}:host([data-style-direction=vertical]){flex-direction:column}:host([data-style-direction=vertical]) .mg-c-menu-item__navigation-button{width:100%}:host([data-style-direction=vertical]) .mg-c-menu-item__collapse-container{position:unset;top:unset;left:unset;width:unset}:host([data-style-direction=vertical]) .mg-c-menu-item-chevron{margin-left:auto}:host([data-overflow-more]){--mg-c-menu-item-navigation-button-column-gap:0}:host([data-overflow-more]) .mg-c-menu-item__navigation-button-chevron{--mg-c-menu-item-chevron-display:none}:host([data-overflow-more]) .mg-c-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:0}:host([data-overflow-more]) ::slotted(mg-menu){--mg-c-menu-item-navigation-button-column-gap:var(--mg-b-size-8)}:host([data-style-direction=horizontal]) .mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level,:host([data-overflow-more]) .mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level{background-color:var(--mg-b-color-light)}:host([data-style-direction=horizontal]) .mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level ::slotted(mg-menu),:host([data-overflow-more]) .mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level ::slotted(mg-menu){padding:var(--mg-b-size-8) 0}::slotted([slot=label]),::slotted([slot=metadata]){display:block;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}::slotted(*){display:flex;flex-direction:column}:host([status=disabled]){pointer-events:none}:host([hidden]){display:none}";
|
|
38
|
-
|
|
39
|
-
const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTMLElement {
|
|
40
|
-
constructor(registerHost) {
|
|
41
|
-
super();
|
|
42
|
-
if (registerHost !== false) {
|
|
43
|
-
this.__registerHost();
|
|
44
|
-
}
|
|
45
|
-
this.__attachShadow();
|
|
46
|
-
this.itemLoaded = createEvent(this, "item-loaded", 7);
|
|
47
|
-
this.itemUpdated = createEvent(this, "item-updated", 7);
|
|
48
|
-
/************
|
|
49
|
-
* Internal *
|
|
50
|
-
************/
|
|
51
|
-
this.name = 'mg-menu-item';
|
|
52
|
-
this.navigationButton = 'mg-c-menu-item__navigation-button';
|
|
53
|
-
/************
|
|
54
|
-
* Props *
|
|
55
|
-
************/
|
|
56
|
-
/**
|
|
57
|
-
* Identifier is used to control mg-popover
|
|
58
|
-
*/
|
|
59
|
-
this.identifier = createID('mg-menu-item');
|
|
60
|
-
/**
|
|
61
|
-
* Define menu-item status.
|
|
62
|
-
*/
|
|
63
|
-
this.status = 'visible';
|
|
64
|
-
/**
|
|
65
|
-
* Define menu-item content expanded.
|
|
66
|
-
*/
|
|
67
|
-
this.expanded = false;
|
|
68
|
-
/**********
|
|
69
|
-
* States *
|
|
70
|
-
*********/
|
|
71
|
-
/**
|
|
72
|
-
* Define menu-item size.
|
|
73
|
-
*/
|
|
74
|
-
this.size = 'medium';
|
|
75
|
-
/**
|
|
76
|
-
* Component button classes
|
|
77
|
-
*/
|
|
78
|
-
this.navigationButtonClassList = new ClassList([this.navigationButton]);
|
|
79
|
-
/**
|
|
80
|
-
* Does component have children.
|
|
81
|
-
*/
|
|
82
|
-
this.hasChildren = false;
|
|
83
|
-
/***********
|
|
84
|
-
* Methods *
|
|
85
|
-
**********/
|
|
86
|
-
/**
|
|
87
|
-
* Get parent menu
|
|
88
|
-
* @returns parent menu
|
|
89
|
-
*/
|
|
90
|
-
this.getParentMenu = () => this.element.closest('mg-menu');
|
|
91
|
-
/**
|
|
92
|
-
* Does an Element have given Status
|
|
93
|
-
* @param mgMenuItemElement - to parse
|
|
94
|
-
* @param status - to check
|
|
95
|
-
* @returns true if element with status is found
|
|
96
|
-
*/
|
|
97
|
-
this.hasStatus = (mgMenuItemElement, status) => mgMenuItemElement.status === status;
|
|
98
|
-
/**
|
|
99
|
-
* Condition to know if component should display a mg-popover
|
|
100
|
-
* @returns truthy if component display popover
|
|
101
|
-
*/
|
|
102
|
-
this.hasPopover = () => this.isDirection(directions.HORIZONTAL) &&
|
|
103
|
-
((this.isInMainMenu() && Array.from(this.element.children).some(element => element.querySelector('[slot]') === null)) || this.isItemMore) &&
|
|
104
|
-
this.href === undefined;
|
|
105
|
-
/**
|
|
106
|
-
* Method to control if one of component children have active status
|
|
107
|
-
* @returns truthy if component has active child
|
|
108
|
-
*/
|
|
109
|
-
this.hasActiveChild = () => {
|
|
110
|
-
var _a;
|
|
111
|
-
return Array.from(((_a = this.element.querySelector('mg-menu')) === null || _a === void 0 ? void 0 : _a.children) || []).some((element) => element.nodeName === 'MG-MENU-ITEM' && this.hasStatus(element, Status.ACTIVE) && !element.hasAttribute('hidden'));
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Is component an interactive item
|
|
115
|
-
* @returns truthy if element is clickable
|
|
116
|
-
*/
|
|
117
|
-
this.isInteractiveItem = () => this.hasChildren || !isValidString(this.href);
|
|
118
|
-
/**
|
|
119
|
-
* Is component contextual direction match the given direction
|
|
120
|
-
* @param direction - in parent menu
|
|
121
|
-
* @param compareWith - direction to compare with. Default: `this.direction`
|
|
122
|
-
* @returns true is direction match the direction propertie
|
|
123
|
-
*/
|
|
124
|
-
this.isDirection = (direction, compareWith = this.direction) => direction === compareWith;
|
|
125
|
-
/**
|
|
126
|
-
* Does component is in main menu
|
|
127
|
-
* @returns true if component is in main menu
|
|
128
|
-
*/
|
|
129
|
-
this.isInMainMenu = () => this.getParentMenu() !== null && this.element.parentElement.closest('mg-menu-item') === null;
|
|
130
|
-
/**
|
|
131
|
-
* Update displayNotificationBadge
|
|
132
|
-
* current component notification badge have priority over the slot badge when submenu contain badge
|
|
133
|
-
*/
|
|
134
|
-
this.updateDisplayNotificationBadge = () => {
|
|
135
|
-
const childMenu = this.element.querySelector('mg-menu');
|
|
136
|
-
this.displayNotificationBadge =
|
|
137
|
-
childMenu !== null && Array.from(childMenu.children).some((subItem) => subItem.querySelector('mg-badge') !== null && !subItem.hasAttribute('hidden'));
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* Update expanded prop
|
|
141
|
-
* @param newValue - expanded new value
|
|
142
|
-
*/
|
|
143
|
-
this.updateExpanded = (newValue) => {
|
|
144
|
-
if (this.isInteractiveItem()) {
|
|
145
|
-
// item is always expanded in vertical menu when has active child
|
|
146
|
-
this.expanded = (this.isDirection(directions.VERTICAL) && this.hasActiveChild()) || newValue;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Update status
|
|
151
|
-
* @param guard - status to exclude from process in addition to [Status.HIDDEN, Status.DISABLED] . Default: [].
|
|
152
|
-
*/
|
|
153
|
-
this.updateStatus = (guard = []) => {
|
|
154
|
-
if (![Status.HIDDEN, Status.DISABLED, ...guard].includes(this.status)) {
|
|
155
|
-
this.status = this.hasActiveChild() ? Status.ACTIVE : Status.VISIBLE;
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Update slots
|
|
160
|
-
* @param guard - prevent action with guard. Default: false.
|
|
161
|
-
*/
|
|
162
|
-
this.updateSlot = (guard = false) => {
|
|
163
|
-
// slot title AND metadata validation
|
|
164
|
-
// add title on label AND metada slots due to text-overflow on these element
|
|
165
|
-
if (Array.from(this.element.children).find(child => child.getAttribute('slot') === 'label') === undefined) {
|
|
166
|
-
throw new Error(`<${this.name}> slot "label" is required.`);
|
|
167
|
-
}
|
|
168
|
-
['label', 'metadata'].forEach(slot => {
|
|
169
|
-
Array.from(this.element.querySelectorAll(`[slot="${slot}"]`)).forEach(element => {
|
|
170
|
-
if (!isValidString(element.textContent))
|
|
171
|
-
throw new Error(`<${this.name}> slot "${slot}" must have text content.`);
|
|
172
|
-
if ((guard && !element.hasAttribute('title')) || !guard)
|
|
173
|
-
element.setAttribute('title', element.textContent);
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* Update menu item
|
|
179
|
-
* @param guard - prevent action with guard
|
|
180
|
-
*/
|
|
181
|
-
this.updateItem = (guard) => {
|
|
182
|
-
const menu = this.getParentMenu();
|
|
183
|
-
// define element size
|
|
184
|
-
if ((menu === null || menu === void 0 ? void 0 : menu.size) !== undefined && !this.isItemMore)
|
|
185
|
-
this.size = menu.size;
|
|
186
|
-
else if (this.isItemMore)
|
|
187
|
-
this.size = this.element.dataset.size;
|
|
188
|
-
// when vertical main menu item contain an active item we force expanded
|
|
189
|
-
this.updateExpanded(this.expanded);
|
|
190
|
-
this.updateStatus(guard);
|
|
191
|
-
this.updatePopoverGuard();
|
|
192
|
-
this.updateDisplayNotificationBadge();
|
|
193
|
-
};
|
|
194
|
-
/************
|
|
195
|
-
* Handlers *
|
|
196
|
-
************/
|
|
197
|
-
/**
|
|
198
|
-
* Handle interacrtive element click
|
|
199
|
-
* @param event - click on element
|
|
200
|
-
*/
|
|
201
|
-
this.handleElementCLick = (event) => {
|
|
202
|
-
if (this.status === Status.DISABLED) {
|
|
203
|
-
event.preventDefault();
|
|
204
|
-
event.stopPropagation();
|
|
205
|
-
}
|
|
206
|
-
// for non "poperized" menu-item we toggle expanded manualy
|
|
207
|
-
this.updateExpanded(!this.expanded);
|
|
208
|
-
// when item is the last clickable item we close the parent popover
|
|
209
|
-
if (!this.isInteractiveItem()) {
|
|
210
|
-
const closePopover = (element) => {
|
|
211
|
-
if (element === null)
|
|
212
|
-
return;
|
|
213
|
-
else if (element !== this.element && element.expanded && element.shadowRoot.querySelector('mg-popover') !== null) {
|
|
214
|
-
element.expanded = false;
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
closePopover(element.parentElement.closest('mg-menu-item'));
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
closePopover(this.element);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
/**
|
|
224
|
-
* Handle popover element display-change event
|
|
225
|
-
* @param event - popover display event
|
|
226
|
-
*/
|
|
227
|
-
this.handlePopoverDisplay = (event) => {
|
|
228
|
-
this.updateExpanded(event.detail);
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* Render slot
|
|
232
|
-
* @returns HTML Element
|
|
233
|
-
*/
|
|
234
|
-
this.renderSlot = () => h("slot", null);
|
|
235
|
-
}
|
|
236
|
-
watchIdentifier(newValue) {
|
|
237
|
-
if (!isValideID(newValue)) {
|
|
238
|
-
console.error(`<mg-menu-item> prop "identifier" value is invalid. Passed value: ${toString(newValue)}.`);
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
this.popoverIdentifier = `${this.identifier}-popover`;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
watchTarget(newValue) {
|
|
245
|
-
if (newValue && !targets.includes(newValue)) {
|
|
246
|
-
throw new Error(`<mg-link> prop "target" must be one of: ${targets.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
watchStatus(newValue, oldValue) {
|
|
250
|
-
if (oldValue !== undefined)
|
|
251
|
-
this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);
|
|
252
|
-
this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);
|
|
253
|
-
}
|
|
254
|
-
watchExpanded(newValue) {
|
|
255
|
-
if (typeof newValue !== 'boolean') {
|
|
256
|
-
throw new Error(`<${this.name}> prop "expanded" must be a boolean. Passed value: ${toString(newValue)}.`);
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
this.updateExpanded(newValue);
|
|
260
|
-
// when expanded all actives sub-items need to be expanded and non active closed
|
|
261
|
-
Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {
|
|
262
|
-
if (item !== this.element)
|
|
263
|
-
item.expanded = newValue ? this.hasStatus(item, Status.ACTIVE) : false;
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
watchSize(newValue, oldValue) {
|
|
268
|
-
if (oldValue !== undefined)
|
|
269
|
-
this.navigationButtonClassList.delete(`${this.navigationButton}--size-${oldValue}`);
|
|
270
|
-
this.navigationButtonClassList.add(`${this.navigationButton}--size-${newValue}`);
|
|
271
|
-
}
|
|
272
|
-
validateDirection(newValue, oldValue) {
|
|
273
|
-
if (oldValue !== undefined)
|
|
274
|
-
this.navigationButtonClassList.delete(`${this.navigationButton}--${oldValue}`);
|
|
275
|
-
this.navigationButtonClassList.add(`${this.navigationButton}--${newValue}`);
|
|
276
|
-
// manage all sub levels child menu-items level with data-level attribut
|
|
277
|
-
Array.from(this.element.querySelectorAll('mg-menu-item')).forEach(item => {
|
|
278
|
-
if (this.isDirection(directions.VERTICAL, newValue)) {
|
|
279
|
-
item.dataset.level = `${(Number(item.dataset.level) || 1) + 1}`;
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
delete item.dataset.level;
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
validateHasChildren(newValue) {
|
|
287
|
-
if (newValue && this.element.href !== undefined) {
|
|
288
|
-
throw new Error(`<${this.name}> prop "href" is unauthorizied when element is a parent.`);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* direction value in dataset
|
|
293
|
-
* @param newValue - new direction value
|
|
294
|
-
*/
|
|
295
|
-
// eslint-disable-next-line @stencil-community/no-unused-watch
|
|
296
|
-
watchDataStyleDirection(newValue) {
|
|
297
|
-
this.direction = newValue;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* has focus value in dataset
|
|
301
|
-
* @param newValue - new direction value
|
|
302
|
-
*/
|
|
303
|
-
// eslint-disable-next-line @stencil-community/no-unused-watch
|
|
304
|
-
watchDataHasFocus(newValue) {
|
|
305
|
-
if (!isValidString(newValue))
|
|
306
|
-
this.updateExpanded(Boolean(newValue));
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Render popover clickoutside guard for content slot
|
|
310
|
-
*/
|
|
311
|
-
updatePopoverGuard() {
|
|
312
|
-
const subItem = this.element.querySelector('*:not([slot])');
|
|
313
|
-
if (subItem === null)
|
|
314
|
-
return;
|
|
315
|
-
if (this.hasPopover())
|
|
316
|
-
subItem.dataset.mgPopoverGuard = this.popoverIdentifier;
|
|
317
|
-
else
|
|
318
|
-
delete subItem.dataset.mgPopoverGuard;
|
|
319
|
-
}
|
|
320
|
-
/*************
|
|
321
|
-
* Lifecycle *
|
|
322
|
-
*************/
|
|
323
|
-
/**
|
|
324
|
-
* Validate props
|
|
325
|
-
*/
|
|
326
|
-
componentWillLoad() {
|
|
327
|
-
// has children items that is NOT [slot='image' | 'information' | 'label' | 'metadata'] element
|
|
328
|
-
// we store only matching elements
|
|
329
|
-
this.hasChildren = Array.from(this.element.children).some(child => !['image', 'information', 'label', 'metadata'].includes(child.getAttribute('slot')));
|
|
330
|
-
this.messages = initLocales(this.element).messages.menuItem;
|
|
331
|
-
this.isItemMore = this.element.dataset.overflowMore !== undefined;
|
|
332
|
-
// watchers
|
|
333
|
-
this.watchStatus(this.status);
|
|
334
|
-
this.watchExpanded(this.expanded);
|
|
335
|
-
this.watchTarget(this.target);
|
|
336
|
-
this.watchIdentifier(this.identifier);
|
|
337
|
-
this.watchSize(this.size);
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Check if component slots configuration
|
|
341
|
-
* @returns timeout
|
|
342
|
-
*/
|
|
343
|
-
componentDidLoad() {
|
|
344
|
-
// validation
|
|
345
|
-
this.updateSlot(true);
|
|
346
|
-
// update props and states after componentDidLoad hook
|
|
347
|
-
// return a promise to process action only in the FIRST render().
|
|
348
|
-
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
349
|
-
return setTimeout(() => {
|
|
350
|
-
this.watchDataStyleDirection(this.element.dataset.styleDirection);
|
|
351
|
-
this.watchDataHasFocus(this.element.dataset.hasFocus);
|
|
352
|
-
this.updateItem([Status.ACTIVE]);
|
|
353
|
-
// emit loaded event when component is fully loaded
|
|
354
|
-
this.itemLoaded.emit();
|
|
355
|
-
new MutationObserver(mutationsList => {
|
|
356
|
-
if (mutationsList.some(mutation => ['hidden', 'status'].includes(mutation.attributeName)))
|
|
357
|
-
this.updateStatus(this.hasChildren ? undefined : [Status.ACTIVE]);
|
|
358
|
-
if (mutationsList.some(mutation => mutation.type === 'characterData'))
|
|
359
|
-
this.updateSlot();
|
|
360
|
-
if (mutationsList.some(mutation => mutation.type === 'childList'))
|
|
361
|
-
this.updateItem();
|
|
362
|
-
this.itemUpdated.emit();
|
|
363
|
-
}).observe(this.element, { attributes: true, childList: true, characterData: true, subtree: true });
|
|
364
|
-
}, 0);
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Emit event when component is updated
|
|
368
|
-
* @returns promise process wich emit the 'item-updated' event
|
|
369
|
-
*/
|
|
370
|
-
componentShouldUpdate() {
|
|
371
|
-
return nextTick(() => {
|
|
372
|
-
this.itemUpdated.emit();
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* Render ineractive element
|
|
377
|
-
* @returns HTML Element
|
|
378
|
-
*/
|
|
379
|
-
renderInteractiveElement() {
|
|
380
|
-
const TagName = this.href !== undefined ? 'a' : 'button';
|
|
381
|
-
return (h(TagName, { href: this.href, class: this.navigationButtonClassList.join(), tabindex: [Status.DISABLED, Status.HIDDEN].includes(this.status) ? -1 : undefined, disabled: this.status === Status.DISABLED, hidden: this.status === Status.HIDDEN, target: this.href !== undefined && this.target !== undefined ? this.target : undefined, "aria-expanded": this.hasChildren && this.expanded.toString(), "aria-current": this.status === Status.ACTIVE && 'page', onClick: this.handleElementCLick }, h("slot", { name: "image" }), h("div", { class: `${this.navigationButton}-center` }, h("div", { class: `${this.navigationButton}-text-content` }, h("slot", { name: "label" }), !this.displayNotificationBadge && h("slot", { name: "information" }), this.displayNotificationBadge && (h("span", { class: `${this.navigationButton}-text-content-notification` }, h("mg-badge", { label: this.messages.badgeLabel, value: "!", variant: "text-color", slot: "information" }))), this.target === '_blank' && [
|
|
382
|
-
h("mg-icon", { key: "icon-new-tab", class: `${this.navigationButton}-new-tab`, icon: "arrow-up-right-square" }),
|
|
383
|
-
h("span", { key: "a11y-new-tab", class: "mg-u-visually-hidden" }, this.messages.openNewTab),
|
|
384
|
-
]), this.size !== 'medium' && h("slot", { name: "metadata" })), this.hasChildren && this.href === undefined && (h("span", { class: {
|
|
385
|
-
[`${this.navigationButton}-chevron`]: true,
|
|
386
|
-
[`${this.navigationButton}-chevron--rotate`]: this.expanded === true,
|
|
387
|
-
} }, h("mg-icon", { icon: "chevron-down" })))));
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Render
|
|
391
|
-
* @returns HTML Element
|
|
392
|
-
*/
|
|
393
|
-
render() {
|
|
394
|
-
const getContainerClasses = () => ({
|
|
395
|
-
['mg-c-menu-item__collapse-container']: true,
|
|
396
|
-
['mg-c-menu-item__collapse-container--first-level']: (this.isInMainMenu() || this.isItemMore) && this.isDirection(directions.HORIZONTAL),
|
|
397
|
-
});
|
|
398
|
-
return (h(Host, { key: '9476243af2ac82d34f91487a22b46ea07c282ebc', role: this.isItemMore ? 'presentation' : 'listitem' }, this.hasPopover() ? (h("mg-popover", { display: this.expanded, placement: "bottom-start", arrowHide: true, "onDisplay-change": this.handlePopoverDisplay, identifier: this.popoverIdentifier, "data-fallback-placement": "bottom-end" // use for the last element of the menu if it is placed on the right side
|
|
399
|
-
}, this.renderInteractiveElement(), h("div", { class: getContainerClasses(), slot: "content" }, this.renderSlot()))) : ([
|
|
400
|
-
this.renderInteractiveElement(),
|
|
401
|
-
h("div", { key: "vertical-container", class: getContainerClasses(), hidden: !this.expanded }, this.renderSlot()),
|
|
402
|
-
])));
|
|
403
|
-
}
|
|
404
|
-
get element() { return this; }
|
|
405
|
-
static get watchers() { return {
|
|
406
|
-
"identifier": ["watchIdentifier"],
|
|
407
|
-
"target": ["watchTarget"],
|
|
408
|
-
"status": ["watchStatus"],
|
|
409
|
-
"expanded": ["watchExpanded"],
|
|
410
|
-
"size": ["watchSize"],
|
|
411
|
-
"direction": ["validateDirection"],
|
|
412
|
-
"hasChildren": ["validateHasChildren"],
|
|
413
|
-
"data-style-direction": ["watchDataStyleDirection"],
|
|
414
|
-
"data-has-focus": ["watchDataHasFocus"]
|
|
415
|
-
}; }
|
|
416
|
-
static get style() { return mgMenuItemCss; }
|
|
417
|
-
}, [257, "mg-menu-item", {
|
|
418
|
-
"identifier": [513],
|
|
419
|
-
"href": [1],
|
|
420
|
-
"target": [1],
|
|
421
|
-
"status": [1537],
|
|
422
|
-
"expanded": [1028],
|
|
423
|
-
"size": [32],
|
|
424
|
-
"navigationButtonClassList": [32],
|
|
425
|
-
"direction": [32],
|
|
426
|
-
"isItemMore": [32],
|
|
427
|
-
"hasChildren": [32],
|
|
428
|
-
"displayNotificationBadge": [32]
|
|
429
|
-
}, undefined, {
|
|
430
|
-
"identifier": ["watchIdentifier"],
|
|
431
|
-
"target": ["watchTarget"],
|
|
432
|
-
"status": ["watchStatus"],
|
|
433
|
-
"expanded": ["watchExpanded"],
|
|
434
|
-
"size": ["watchSize"],
|
|
435
|
-
"direction": ["validateDirection"],
|
|
436
|
-
"hasChildren": ["validateHasChildren"],
|
|
437
|
-
"data-style-direction": ["watchDataStyleDirection"],
|
|
438
|
-
"data-has-focus": ["watchDataHasFocus"]
|
|
439
|
-
}]);
|
|
440
|
-
function defineCustomElement() {
|
|
441
|
-
if (typeof customElements === "undefined") {
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
const components = ["mg-menu-item", "mg-badge", "mg-button", "mg-card", "mg-icon", "mg-popover", "mg-popover-content"];
|
|
445
|
-
components.forEach(tagName => { switch (tagName) {
|
|
446
|
-
case "mg-menu-item":
|
|
447
|
-
if (!customElements.get(tagName)) {
|
|
448
|
-
customElements.define(tagName, MgMenuItem);
|
|
449
|
-
}
|
|
450
|
-
break;
|
|
451
|
-
case "mg-badge":
|
|
452
|
-
if (!customElements.get(tagName)) {
|
|
453
|
-
defineCustomElement$6();
|
|
454
|
-
}
|
|
455
|
-
break;
|
|
456
|
-
case "mg-button":
|
|
457
|
-
if (!customElements.get(tagName)) {
|
|
458
|
-
defineCustomElement$5();
|
|
459
|
-
}
|
|
460
|
-
break;
|
|
461
|
-
case "mg-card":
|
|
462
|
-
if (!customElements.get(tagName)) {
|
|
463
|
-
defineCustomElement$4();
|
|
464
|
-
}
|
|
465
|
-
break;
|
|
466
|
-
case "mg-icon":
|
|
467
|
-
if (!customElements.get(tagName)) {
|
|
468
|
-
defineCustomElement$3();
|
|
469
|
-
}
|
|
470
|
-
break;
|
|
471
|
-
case "mg-popover":
|
|
472
|
-
if (!customElements.get(tagName)) {
|
|
473
|
-
defineCustomElement$2();
|
|
474
|
-
}
|
|
475
|
-
break;
|
|
476
|
-
case "mg-popover-content":
|
|
477
|
-
if (!customElements.get(tagName)) {
|
|
478
|
-
defineCustomElement$1();
|
|
479
|
-
}
|
|
480
|
-
break;
|
|
481
|
-
} });
|
|
482
|
-
}
|
|
483
|
-
defineCustomElement();
|
|
484
|
-
|
|
485
|
-
export { MgMenuItem as M, Status as S, directions as a, defineCustomElement as d, sizes as s };
|
|
1
|
+
import{transformTag as t,proxyCustomElement as i,HTMLElement as e,createEvent as n,h as a,Host as o}from"@stencil/core/internal/client";import{c as m,C as s,i as r,a as c,t as l,n as h}from"./index2.js";import{i as g}from"./index3.js";import{d}from"./mg-badge2.js";import{d as u}from"./mg-button2.js";import{d as v}from"./mg-card2.js";import{d as b}from"./mg-icon2.js";import{d as p}from"./mg-popover2.js";import{d as _}from"./mg-popover-content2.js";const f={VISIBLE:"visible",HIDDEN:"hidden",DISABLED:"disabled",ACTIVE:"active"},z=["_blank","_self","_parent","_top"],w={VERTICAL:"vertical",HORIZONTAL:"horizontal"},x=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.itemLoaded=n(this,"item-loaded",7),this.itemUpdated=n(this,"item-updated",7),this.name="mg-menu-item",this.classNavigationButton="mg-c-menu-item__navigation-button",this.identifier=m("mg-menu-item"),this.status="visible",this.isIcon=!1,this.expanded=!1,this.classNavigationButtonClassList=new s([this.classNavigationButton]),this.hasChildren=!1,this.getParentMenu=()=>this.element.closest("mg-menu"),this.hasStatus=(t,i)=>t.status===i,this.hasPopover=()=>this.isDirection(w.HORIZONTAL)&&(this.isInMainMenu()&&Array.from(this.element.children).some((t=>null===t.querySelector("[slot]")))||this.isItemMore)&&void 0===this.href,this.hasActiveChild=()=>{var t;return Array.from((null===(t=this.element.querySelector("mg-menu"))||void 0===t?void 0:t.children)||[]).some((t=>"MG-MENU-ITEM"===t.nodeName&&this.hasStatus(t,f.ACTIVE)&&!t.hasAttribute("hidden")))},this.isInteractiveItem=()=>this.hasChildren||!r(this.href),this.isDirection=(t,i=this.direction)=>t===i,this.isInMainMenu=()=>null!==this.getParentMenu()&&null===this.element.parentElement.closest("mg-menu-item"),this.updateDisplayNotificationBadge=()=>{const t=this.element.querySelector("mg-menu");this.displayNotificationBadge=null!==t&&Array.from(t.children).some((t=>null!==t.querySelector("mg-badge")&&!t.hasAttribute("hidden")))},this.updateExpanded=t=>{this.isInteractiveItem()&&(this.expanded=this.isDirection(w.VERTICAL)&&this.hasActiveChild()||t)},this.updateStatus=(t=[])=>{[f.HIDDEN,f.DISABLED,...t].includes(this.status)||(this.status=this.hasActiveChild()?f.ACTIVE:f.VISIBLE)},this.updateSlot=(t=!1)=>{if(void 0===Array.from(this.element.children).find((t=>"label"===t.getAttribute("slot"))))throw new Error(`<${this.name}> slot "label" is required.`);["label","metadata"].forEach((i=>{Array.from(this.element.querySelectorAll(`[slot="${i}"]`)).forEach((e=>{if(!r(e.textContent))throw new Error(`<${this.name}> slot "${i}" must have text content.`);(t&&!e.hasAttribute("title")||!t)&&e.setAttribute("title",e.textContent)}))}))},this.updateItem=t=>{this.updateExpanded(this.expanded),this.updateStatus(t),this.updatePopoverGuard(),this.updateDisplayNotificationBadge()},this.handleElementCLick=t=>{if(this.status===f.DISABLED&&(t.preventDefault(),t.stopPropagation()),this.updateExpanded(!this.expanded),!this.isInteractiveItem()){const t=i=>{null!==i&&t(i.parentElement.closest("mg-menu-item"))};t(this.element)}},this.handlePopoverDisplay=t=>{this.updateExpanded(t.detail)},this.renderSlot=()=>a("slot",null)}watchIdentifier(t){c(t)?this.popoverIdentifier=`${this.identifier}-popover`:console.error(`<mg-menu-item> prop "identifier" value is invalid. Passed value: ${l(t)}.`)}watchTarget(t){if(t&&!z.includes(t))throw new Error(`<mg-link> prop "target" must be one of: ${z.join(", ")}. Passed value: ${l(t)}.`)}watchStatus(t,i){void 0!==i&&this.classNavigationButtonClassList.delete(`${this.classNavigationButton}--${i}`),this.classNavigationButtonClassList.add(`${this.classNavigationButton}--${t}`)}watchIsIcon(t){const i=`${this.classNavigationButton}--is-icon`;t?"vertical"===this.direction?this.isIcon=!1:this.classNavigationButtonClassList.add(i):this.classNavigationButtonClassList.delete(i)}watchExpanded(t){if("boolean"!=typeof t)throw new Error(`<${this.name}> prop "expanded" must be a boolean. Passed value: ${l(t)}.`);this.updateExpanded(t),Array.from(this.element.querySelectorAll("mg-menu-item")).forEach((i=>{i!==this.element&&(i.expanded=!!t&&this.hasStatus(i,f.ACTIVE))}))}validateDirection(t,i){void 0!==i&&this.classNavigationButtonClassList.delete(`${this.classNavigationButton}--${i}`),this.classNavigationButtonClassList.add(`${this.classNavigationButton}--${t}`),Array.from(this.element.querySelectorAll("mg-menu-item")).forEach((i=>{this.isDirection(w.VERTICAL,t)?i.dataset.level=`${(Number(i.dataset.level)||1)+1}`:delete i.dataset.level}))}validateHasChildren(t){if(t&&void 0!==this.element.href)throw new Error(`<${this.name}> prop "href" is unauthorizied when element is a parent.`)}watchDataStyleDirection(t){this.direction=t,this.watchIsIcon(this.isIcon)}watchDataHasFocus(t){r(t)||this.updateExpanded(Boolean(t))}updatePopoverGuard(){const t=this.element.querySelector("*:not([slot])");null!==t&&(this.hasPopover()?t.dataset.mgPopoverGuard=this.popoverIdentifier:delete t.dataset.mgPopoverGuard)}componentWillLoad(){this.hasChildren=Array.from(this.element.children).some((t=>!["image","information","label","metadata"].includes(t.getAttribute("slot")))),this.messages=g(this.element).messages.menuItem,this.isItemMore=void 0!==this.element.dataset.overflowMore,this.watchStatus(this.status),this.watchExpanded(this.expanded),this.watchTarget(this.target),this.watchIdentifier(this.identifier),this.watchIsIcon(this.isIcon)}componentDidLoad(){return this.updateSlot(!0),setTimeout((()=>{this.watchDataStyleDirection(this.element.dataset.styleDirection),this.updateItem([f.ACTIVE]),this.itemLoaded.emit(),new MutationObserver((t=>{t.some((t=>["hidden","status"].includes(t.attributeName)))&&this.updateStatus(this.hasChildren?void 0:[f.ACTIVE]),t.some((t=>"characterData"===t.type))&&this.updateSlot(),t.some((t=>"childList"===t.type))&&this.updateItem(),this.itemUpdated.emit()})).observe(this.element,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}),0)}componentShouldUpdate(){return h((()=>{this.itemUpdated.emit()}))}renderInformationSlotOrNotification(){return this.displayNotificationBadge?a("span",{class:`${this.classNavigationButton}-text-content-notification`},a("mg-badge",{label:this.messages.badgeLabel,value:"!",variant:"text-color",slot:"information"})):a("slot",{name:"information"})}renderInteractiveElement(){return a(void 0!==this.href?"a":"button",{href:this.href,class:this.classNavigationButtonClassList.join(),tabindex:[f.DISABLED,f.HIDDEN].includes(this.status)?-1:void 0,disabled:this.status===f.DISABLED,hidden:this.status===f.HIDDEN,target:void 0!==this.href&&void 0!==this.target?this.target:void 0,"aria-expanded":this.hasChildren&&this.expanded.toString(),"aria-current":this.status===f.ACTIVE&&"page",onClick:this.handleElementCLick},a("slot",{name:"image"}),a("div",{class:{[`${this.classNavigationButton}-center`]:!0,"mg-u-visually-hidden":this.isIcon}},a("div",{class:`${this.classNavigationButton}-text-content`},a("slot",{name:"label"}),!this.isIcon&&this.renderInformationSlotOrNotification(),"_blank"===this.target&&[a("mg-icon",{key:"icon-new-tab",class:`${this.classNavigationButton}-new-tab`,icon:"arrow-up-right-square"}),a("span",{key:"a11y-new-tab",class:"mg-u-visually-hidden"},this.messages.openNewTab)]),!this.isIcon&&a("slot",{name:"metadata"})),this.isIcon&&this.renderInformationSlotOrNotification(),this.hasChildren&&void 0===this.href&&!this.isIcon&&a("span",{class:{[`${this.classNavigationButton}-chevron`]:!0,[`${this.classNavigationButton}-chevron--rotate`]:!0===this.expanded}},a("mg-icon",{icon:"chevron-down",size:"small"})))}render(){const t=()=>({"mg-c-menu-item__collapse-container":!0,"mg-c-menu-item__collapse-container--first-level":(this.isInMainMenu()||this.isItemMore)&&this.isDirection(w.HORIZONTAL)});return a(o,{key:"374bf5cb625380973d15163b1088e7e743da5dd4",role:this.isItemMore?"presentation":"listitem"},this.hasPopover()?a("mg-popover",{display:this.expanded,placement:"bottom-start",arrowHide:!0,"onDisplay-change":this.handlePopoverDisplay,identifier:this.popoverIdentifier,"data-fallback-placement":"bottom-end"},this.renderInteractiveElement(),a("div",{class:t(),slot:"content"},this.renderSlot())):[this.renderInteractiveElement(),a("div",{key:"vertical-container",class:t(),hidden:!this.expanded},this.renderSlot())])}get element(){return this}static get watchers(){return{identifier:[{watchIdentifier:0}],target:[{watchTarget:0}],status:[{watchStatus:0}],isIcon:[{watchIsIcon:0}],expanded:[{watchExpanded:0}],direction:[{validateDirection:0}],hasChildren:[{validateHasChildren:0}],"data-style-direction":[{watchDataStyleDirection:0}],"data-has-focus":[{watchDataHasFocus:0}]}}static get style(){return'.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host([data-style-direction=vertical][data-level="1"]) .mg-c-menu-item__navigation-button{padding-left:calc(1*var(--mg-c-menu-item-button-padding-horizontal) + var(--mg-c-menu-item-button-margin-horizontal))}:host([data-level="1"]) .mg-c-menu-item__collapse-container{z-index:10}:host([data-style-direction=vertical][data-level="2"]) .mg-c-menu-item__navigation-button{padding-left:calc(2*var(--mg-c-menu-item-button-padding-horizontal) + var(--mg-c-menu-item-button-margin-horizontal))}:host([data-level="2"]) .mg-c-menu-item__collapse-container{z-index:20}:host([data-style-direction=vertical][data-level="3"]) .mg-c-menu-item__navigation-button{padding-left:calc(3*var(--mg-c-menu-item-button-padding-horizontal) + var(--mg-c-menu-item-button-margin-horizontal))}:host([data-level="3"]) .mg-c-menu-item__collapse-container{z-index:30}:host([data-style-direction=vertical][data-level="4"]) .mg-c-menu-item__navigation-button{padding-left:calc(4*var(--mg-c-menu-item-button-padding-horizontal) + var(--mg-c-menu-item-button-margin-horizontal))}:host([data-level="4"]) .mg-c-menu-item__collapse-container{z-index:40}:host([data-style-direction=vertical][data-level="5"]) .mg-c-menu-item__navigation-button{padding-left:calc(5*var(--mg-c-menu-item-button-padding-horizontal) + var(--mg-c-menu-item-button-margin-horizontal))}:host([data-level="5"]) .mg-c-menu-item__collapse-container{z-index:50}:host([data-style-direction=vertical][data-level="6"]) .mg-c-menu-item__navigation-button{padding-left:calc(6*var(--mg-c-menu-item-button-padding-horizontal) + var(--mg-c-menu-item-button-margin-horizontal))}:host([data-level="6"]) .mg-c-menu-item__collapse-container{z-index:60}.mg-c-menu-item__navigation-button{position:relative;display:flex;height:calc(var(--mg-c-menu-item-button-spacing-vertical)*2 + var(--mg-c-menu-item-height));box-sizing:border-box;align-items:center;padding:var(--mg-c-menu-item-button-spacing-vertical) calc(var(--mg-c-menu-item-button-margin-horizontal) + var(--mg-c-menu-item-button-padding-horizontal)) var(--mg-c-menu-item-button-spacing-vertical) calc(var(--mg-c-menu-item-button-margin-horizontal) + var(--mg-c-menu-item-button-padding-horizontal));border:none;border-radius:var(--mg-b-size-8);background-color:unset;color:var(--mg-c-menu-item-color-text, var(--mg-b-color-dark));column-gap:var(--mg-b-size-8);cursor:pointer;font-family:var(--mg-b-font-family);font-weight:400;line-height:var(--mg-b-line-height);text-decoration:none;white-space:nowrap}.mg-c-menu-item__navigation-button::after{position:absolute;background-color:var(--mg-c-menu-item-color);content:""}.mg-c-menu-item__navigation-button:disabled,.mg-c-menu-item__navigation-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-menu-item__navigation-button:hover,.mg-c-menu-item__navigation-button:focus-visible{z-index:10}.mg-c-menu-item__navigation-button:hover:not(.mg-c-menu-item__navigation-button--disabled)::before,.mg-c-menu-item__navigation-button:focus-visible:not(.mg-c-menu-item__navigation-button--disabled)::before{position:absolute;z-index:-1;top:0;left:0;width:stretch;height:var(--mg-c-menu-item-height);box-sizing:border-box;border-radius:var(--mg-b-size-8);margin-right:var(--mg-c-menu-item-button-margin-horizontal);margin-left:var(--mg-c-menu-item-button-margin-horizontal);background-color:color-mix(in srgb, var(--mg-c-menu-item-color-text, var(--mg-b-color-dark)), transparent 90%);content:""}.mg-c-menu-item__navigation-button,.mg-c-menu-item__navigation-button ::slotted([slot=label]),.mg-c-menu-item__navigation-button ::slotted([slot=metadata]){font-size:var(--mg-b-font-size)}.mg-c-menu-item__navigation-button:not(.mg-c-menu-item__navigation-button--disabled).mg-c-menu-item__navigation-button--horizontal::before{margin:var(--mg-c-menu-item-button-spacing-vertical) var(--mg-c-menu-item-button-margin-horizontal)}.mg-c-menu-item__navigation-button:not(.mg-c-menu-item__navigation-button--disabled).mg-c-menu-item__navigation-button--vertical::before{height:100%;margin:0 var(--mg-c-menu-item-button-margin-horizontal)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active{color:var(--mg-c-menu-item-color);font-weight:600}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active.mg-c-menu-item__navigation-button--horizontal::after{bottom:0;left:50%;width:calc(100% - var(--mg-b-size-12)*2);height:var(--mg-b-size-4);border-top-left-radius:var(--mg-b-size-8);border-top-right-radius:var(--mg-b-size-8);transform:translateX(-50%)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--active.mg-c-menu-item__navigation-button--vertical::after{top:50%;left:0;width:var(--mg-b-size-4);height:calc(100% - var(--mg-b-size-8)*2);border-bottom-right-radius:var(--mg-b-size-8);border-top-right-radius:var(--mg-b-size-8);transform:translateY(-50%)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--hidden{display:none}.mg-c-menu-item{max-width:var(--mg-c-menu-item-navigation-button-max-width)}.mg-c-menu-item__collapse-container{z-index:10;width:max-content}.mg-c-menu-item__navigation-button-center{min-width:0}.mg-c-menu-item__navigation-button-text-content{display:flex;width:100%;align-items:center}.mg-c-menu-item__navigation-button-text-content-notification,.mg-c-menu-item__navigation-button-text-content ::slotted([slot=information]){margin-left:var(--mg-b-size-8);font-size:var(--mg-b-font-size)}.mg-c-menu-item__navigation-button-new-tab{margin-left:var(--mg-b-size-4)}.mg-c-menu-item__navigation-button-chevron{display:var(--mg-c-menu-item-chevron-display);margin-left:auto;transition:200ms}.mg-c-menu-item__navigation-button-chevron--rotate.mg-c-menu-item__navigation-button-chevron{transform:rotate(180deg)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--is-icon{min-width:calc(var(--mg-c-menu-item-height) + var(--mg-c-menu-item-button-margin-horizontal)*2);justify-content:center;padding:.2rem;gap:var(--mg-b-size-4)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--is-icon::before{min-width:var(--mg-c-menu-item-height)}.mg-c-menu-item__navigation-button.mg-c-menu-item__navigation-button--is-icon .mg-c-menu-item__navigation-button-text-content-notification{margin-left:0}:host{position:relative;display:flex;--mg-c-popover-spacing-vertical:0;--mg-c-popover-spacing-horizontal:0;--mg-c-popover-max-width:unset;--mg-c-menu-item-height:var(--mg-b-size-40)}:host mg-popover{--mg-c-popover-overflow:hidden}:host mg-popover-content[data-popper-placement^=bottom][data-arrow-hide]{margin-top:.2rem !important}:host([data-style-direction=vertical]){--mg-c-menu-item-height:var(--mg-b-size-24);--mg-c-menu-item-button-margin-horizontal:var(--mg-b-size-8);--mg-c-menu-item-button-padding-horizontal:var(--mg-b-size-12);--mg-c-menu-item-button-spacing-vertical:var(--mg-b-size-8);flex-direction:column}:host([data-style-direction=vertical]) .mg-c-menu-item__collapse-container{position:unset;top:unset;left:unset;width:unset}:host([data-style-direction=vertical]) .mg-c-menu-item-chevron{margin-left:auto}:host([data-style-direction=horizontal]){--mg-c-menu-item-button-margin-horizontal:var(--mg-b-size-4);--mg-c-menu-item-button-padding-horizontal:var(--mg-b-size-12);--mg-c-menu-item-button-spacing-vertical:var(--mg-b-size-12)}:host([data-style-direction=horizontal]) ::slotted(mg-menu),.mg-c-menu-item__collapse-container.mg-c-menu-item__collapse-container--first-level ::slotted(mg-menu){padding:var(--mg-b-size-8) 0}::slotted([slot=label]),::slotted([slot=metadata]){display:block;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}::slotted([slot=metadata]){color:var(--mg-b-color-neutral-90)}::slotted(*){display:flex;flex-direction:column}::slotted([slot=image]){width:auto !important;max-width:calc(var(--mg-c-menu-item-height) - var(--mg-b-size-8)) !important;height:auto !important;max-height:calc(var(--mg-c-menu-item-height) - var(--mg-b-size-8)) !important}:host([status=disabled]){pointer-events:none}:host([hidden]){display:none}'}},[257,"mg-menu-item",{identifier:[513],href:[1],target:[1],status:[1537],isIcon:[1028,"is-icon"],expanded:[1028],classNavigationButtonClassList:[32],direction:[32],isItemMore:[32],hasChildren:[32],displayNotificationBadge:[32]},void 0,{identifier:[{watchIdentifier:0}],target:[{watchTarget:0}],status:[{watchStatus:0}],isIcon:[{watchIsIcon:0}],expanded:[{watchExpanded:0}],direction:[{validateDirection:0}],hasChildren:[{validateHasChildren:0}],"data-style-direction":[{watchDataStyleDirection:0}],"data-has-focus":[{watchDataHasFocus:0}]}]);function y(){"undefined"!=typeof customElements&&["mg-menu-item","mg-badge","mg-button","mg-card","mg-icon","mg-popover","mg-popover-content"].forEach((i=>{switch(i){case"mg-menu-item":customElements.get(t(i))||customElements.define(t(i),x);break;case"mg-badge":customElements.get(t(i))||d();break;case"mg-button":customElements.get(t(i))||u();break;case"mg-card":customElements.get(t(i))||v();break;case"mg-icon":customElements.get(t(i))||b();break;case"mg-popover":customElements.get(t(i))||p();break;case"mg-popover-content":customElements.get(t(i))||_()}}))}y();export{x as M,f as S,w as a,y as d}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const MgMenu = MgMenu$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { MgMenu, defineCustomElement };
|
|
1
|
+
import{a as m,b as o}from"./mg-item-more2.js";const r=m,s=o;export{r as MgMenu,s as defineCustomElement}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const MgMessage = MgMessage$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { MgMessage, defineCustomElement };
|
|
1
|
+
import{M as s,d as m}from"./mg-message2.js";const o=s,a=m;export{o as MgMessage,a as defineCustomElement}
|