@mgdis/mg-components 6.14.0 → 6.15.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-DzBkSgSK.js → index-BGxkpQwi.js} +7 -1
- package/dist/cjs/{index-DUJwxnoi.js → index-CpENFzEo.js} +2 -2
- package/dist/cjs/{index-CwjAofQ1.js → index-iUZvsp-F.js} +55 -31
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +431 -208
- package/dist/cjs/mg-alert.cjs.entry.js +4 -4
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-input-combobox.cjs.entry.js +145 -81
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +1248 -16004
- package/dist/cjs/{mg-input.conf-WTsvDfpC.js → mg-input.conf-CwjEAih3.js} +7 -0
- package/dist/cjs/mg-input.utils-D-ASK4ua.js +49 -0
- package/dist/cjs/mg-loader.cjs.entry.js +4 -4
- package/dist/cjs/mg-progress.cjs.entry.js +3 -3
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.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 +93 -22
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.utils.js +21 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +49 -106
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +123 -48
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +140 -56
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +63 -10
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +54 -6
- 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 +142 -9
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
- 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-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
- 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 +2 -2
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
- package/dist/collection/locales/en/messages.json +23 -14
- package/dist/collection/locales/fr/messages.json +24 -15
- package/dist/components/index2.js +3 -3
- package/dist/components/index3.js +55 -31
- package/dist/components/mg-action-more.js +2 -2
- package/dist/components/mg-alert.js +2 -2
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-character-left2.js +1 -1
- package/dist/components/mg-details.js +1 -97
- package/dist/components/mg-details2.js +99 -0
- package/dist/components/mg-divider2.js +1 -1
- package/dist/components/mg-form.js +2 -2
- package/dist/components/mg-icon2.js +1 -1
- package/dist/components/mg-illustrated-message.js +2 -2
- package/dist/components/mg-input-checkbox-paginated2.js +43 -124
- package/dist/components/mg-input-checkbox.js +136 -62
- package/dist/components/mg-input-combobox.js +135 -63
- package/dist/components/mg-input-date.js +9 -3
- package/dist/components/mg-input-numeric.js +14 -3
- package/dist/components/mg-input-password.js +10 -4
- package/dist/components/mg-input-radio.js +54 -13
- package/dist/components/mg-input-rich-text-editor.js +1266 -16016
- package/dist/components/mg-input-select2.js +45 -9
- package/dist/components/mg-input-text2.js +10 -4
- package/dist/components/mg-input-textarea.js +10 -4
- package/dist/components/mg-input-title2.js +1 -1
- package/dist/components/mg-input-toggle.js +97 -12
- package/dist/components/mg-input.utils.js +24 -0
- package/dist/components/mg-input2.js +100 -23
- package/dist/components/mg-item-more2.js +2 -2
- package/dist/components/mg-loader2.js +2 -2
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-message2.js +3 -3
- package/dist/components/mg-modal.js +3 -3
- package/dist/components/mg-pagination.js +233 -1
- package/dist/components/mg-panel.js +14 -8
- package/dist/components/mg-popover-content2.js +2 -2
- package/dist/components/mg-popover2.js +2 -2
- package/dist/components/mg-progress.js +2 -2
- package/dist/components/mg-skip-links.js +2 -2
- package/dist/components/mg-table.js +3 -3
- package/dist/components/mg-tabs.js +1 -311
- package/dist/components/mg-tabs2.js +313 -0
- package/dist/components/mg-tag.js +1 -1
- package/dist/components/mg-tooltip-content2.js +1 -1
- package/dist/components/mg-tooltip2.js +2 -2
- package/dist/esm/{index-Bv7NHR-W.js → index-CKB-AnCZ.js} +55 -31
- package/dist/esm/{index-Degtjvph.js → index-DhAOnZJn.js} +7 -1
- package/dist/esm/{index-Dr7GYvIz.js → index-WtiuOkLj.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +426 -203
- package/dist/esm/mg-alert.entry.js +4 -4
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-input-combobox.entry.js +125 -61
- package/dist/esm/mg-input-rich-text-editor.entry.js +1249 -16005
- package/dist/esm/{mg-input.conf-CNgv8hc5.js → mg-input.conf-BAUTlb6r.js} +7 -1
- package/dist/esm/mg-input.utils-BYI03zSi.js +46 -0
- package/dist/esm/mg-loader.entry.js +4 -4
- package/dist/esm/mg-progress.entry.js +3 -3
- package/dist/mg-components/locales/en/messages.json +23 -14
- package/dist/mg-components/locales/fr/messages.json +24 -15
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-31856cff.entry.js +1 -0
- package/dist/mg-components/{p-056ba467.entry.js → p-420daa1e.entry.js} +1 -1
- package/dist/mg-components/{p-d13a6fdc.entry.js → p-47e19783.entry.js} +1 -1
- package/dist/mg-components/p-67af6274.entry.js +1 -0
- package/dist/mg-components/p-698dfc6c.entry.js +1 -0
- package/dist/mg-components/p-BAUTlb6r.js +1 -0
- package/dist/mg-components/p-CKB-AnCZ.js +1 -0
- package/dist/mg-components/p-DhAOnZJn.js +2 -0
- package/dist/mg-components/p-PuX-pdL4.js +1 -0
- package/dist/mg-components/p-WtiuOkLj.js +1 -0
- package/dist/mg-components/p-a0fa44cf.entry.js +1 -0
- package/dist/types/assets/icons/index.d.ts +6 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +13 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +15 -4
- package/dist/types/components/molecules/inputs/mg-input/mg-input.utils.d.ts +8 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +17 -40
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +1 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +36 -9
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +17 -3
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +18 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +18 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +40 -4
- package/dist/types/components.d.ts +69 -40
- package/ide/intellij/web-types.json +148 -22
- package/ide/vscode/html-custom-data.json +143 -9
- package/package.json +15 -15
- package/dist/cjs/events.utils-D5SAtkpQ.js +0 -25
- package/dist/components/mg-pagination2.js +0 -229
- package/dist/esm/events.utils-yMGqY8YG.js +0 -23
- package/dist/mg-components/p-625c463c.entry.js +0 -1
- package/dist/mg-components/p-Bv7NHR-W.js +0 -1
- package/dist/mg-components/p-CNgv8hc5.js +0 -1
- package/dist/mg-components/p-Degtjvph.js +0 -2
- package/dist/mg-components/p-Dr7GYvIz.js +0 -1
- package/dist/mg-components/p-c522f3c1.entry.js +0 -1
- package/dist/mg-components/p-cac23bd7.entry.js +0 -1
- package/dist/mg-components/p-e75f5383.entry.js +0 -10
- package/dist/mg-components/p-yMGqY8YG.js +0 -1
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as createID, C as ClassList, n as nextTick, a as isValideID, t as toString, i as isValidString, d as allItemsAreString } from './index2.js';
|
|
3
|
+
import { K as Keys } from './events.utils.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './mg-badge2.js';
|
|
5
|
+
import { d as defineCustomElement$1 } from './mg-icon2.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Available tabs items status
|
|
9
|
+
*/
|
|
10
|
+
const Status = {
|
|
11
|
+
VISIBLE: 'visible',
|
|
12
|
+
HIDDEN: 'hidden',
|
|
13
|
+
DISABLED: 'disabled',
|
|
14
|
+
ACTIVE: 'active',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* List of all possibles sizes
|
|
18
|
+
*/
|
|
19
|
+
const sizes = ['medium', 'large'];
|
|
20
|
+
|
|
21
|
+
const mgTabsCss = "/*!\n * @prop --mg-c-tabs-color: Defines tabs global color, used for bottom line and active tabs. Default value: `--mg-b-color-app`.\n * @prop --mg-c-tabs-color-text: Defines tabs text color. Unset by default, fallback on `--mg-b-color-dark`.\n */.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium{padding:var(--mg-b-size-12) var(--mg-b-size-16)}.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button,.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button ::slotted([slot=label]),.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button ::slotted([slot=metadata]),.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium ::slotted([slot=label]),.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium ::slotted([slot=metadata]){font-size:var(--mg-b-font-size)}.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--horizontal,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium.mg-c-tabs__navigation-button--horizontal{padding-bottom:var(--mg-b-size-12)}.mg-c-tabs.mg-c-tabs--size-medium .mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--vertical,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-medium.mg-c-tabs__navigation-button--vertical{padding-left:var(--mg-b-size-16)}.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large{padding:var(--mg-b-size-16) var(--mg-b-size-32)}.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button,.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button ::slotted([slot=label]),.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button ::slotted([slot=metadata]),.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large ::slotted([slot=label]),.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large ::slotted([slot=metadata]){font-size:var(--mg-b-font-size-h4)}.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--horizontal,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large.mg-c-tabs__navigation-button--horizontal{padding-bottom:var(--mg-b-size-16)}.mg-c-tabs.mg-c-tabs--size-large .mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--vertical,.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--size-large.mg-c-tabs__navigation-button--vertical{padding-left:var(--mg-b-size-32)}.mg-c-tabs__navigation-button{display:flex;box-sizing:border-box;align-items:center;border:none;background-color:unset;color:var(--mg-c-tabs-color-text, var(--mg-b-color-dark));column-gap:var(--mg-c-tabs-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-tabs__navigation-button:disabled,.mg-c-tabs__navigation-button--disabled{cursor:default;opacity:var(--mg-b-opacity-element-disabled)}.mg-c-tabs__navigation-button:focus-visible{z-index:10}.mg-c-tabs__navigation-button:hover:not(.mg-c-tabs__navigation-button--disabled),.mg-c-tabs__navigation-button:focus-visible:not(.mg-c-tabs__navigation-button--disabled){background-color:color-mix(in srgb, var(--mg-c-tabs-color), transparent 90%)}.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--active{color:var(--mg-c-tabs-color);font-weight:600}.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--active.mg-c-tabs__navigation-button--horizontal{box-shadow:inset 0 calc(-1*var(--mg-b-size-4)) var(--mg-c-tabs-color)}.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--active.mg-c-tabs__navigation-button--vertical{box-shadow:inset var(--mg-b-size-4) 0 var(--mg-c-tabs-color)}.mg-c-tabs__navigation-button.mg-c-tabs__navigation-button--hidden{display:none}.mg-c-tabs__header{display:flex;flex-flow:row wrap;border-bottom:var(--mg-b-size-border) solid color-mix(in srgb, var(--mg-c-tabs-color), transparent 90%)}.mg-c-tabs__content-container:focus-visible{outline:none}.mg-c-tabs__navigation-button-text{flex:0 0 content}";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* type TabItem validation function
|
|
25
|
+
* @param tab - tab item
|
|
26
|
+
* @returns tab item type is valid
|
|
27
|
+
*/
|
|
28
|
+
const isTabItem = (tab) => typeof tab === 'object' && typeof tab.label === 'string';
|
|
29
|
+
const MgTabs = /*@__PURE__*/ proxyCustomElement(class MgTabs extends HTMLElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.__registerHost();
|
|
33
|
+
this.__attachShadow();
|
|
34
|
+
this.activeTabChange = createEvent(this, "active-tab-change", 7);
|
|
35
|
+
/************
|
|
36
|
+
* Internal *
|
|
37
|
+
************/
|
|
38
|
+
// classes
|
|
39
|
+
this.tabPanel = 'panel';
|
|
40
|
+
this.buttonTabBaseClass = 'mg-c-tabs__navigation-button';
|
|
41
|
+
this.startIndex = 1;
|
|
42
|
+
/**
|
|
43
|
+
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
44
|
+
* If not set, it will be created.
|
|
45
|
+
*/
|
|
46
|
+
this.identifier = createID('mg-tabs');
|
|
47
|
+
/**
|
|
48
|
+
* Define tabs size
|
|
49
|
+
*/
|
|
50
|
+
this.size = 'medium';
|
|
51
|
+
/**
|
|
52
|
+
* Component tabs
|
|
53
|
+
*/
|
|
54
|
+
this.tabs = [];
|
|
55
|
+
/**
|
|
56
|
+
* Component classes
|
|
57
|
+
*/
|
|
58
|
+
this.classCollection = new ClassList(['mg-c-tabs']);
|
|
59
|
+
/**
|
|
60
|
+
* Validate that new tab status can be `Status.ACTIVE`
|
|
61
|
+
* @param tab - tab item
|
|
62
|
+
* @returns true when tab match condition to get a `Status.ACTIVE`
|
|
63
|
+
*/
|
|
64
|
+
this.isActivableTab = (tab) => [undefined, Status.ACTIVE, Status.VISIBLE].includes(tab.status);
|
|
65
|
+
/**
|
|
66
|
+
* Method to know if given tab has the given status
|
|
67
|
+
* @param tab - item tab key to set to ACTIVE status
|
|
68
|
+
* @param status - status to valide
|
|
69
|
+
* @returns status comparaison
|
|
70
|
+
*/
|
|
71
|
+
this.tabHasStatus = (tab, status) => tab.status === status;
|
|
72
|
+
/**
|
|
73
|
+
* Method to get element id from index
|
|
74
|
+
* @param element - to get id
|
|
75
|
+
* @param index - to generate id
|
|
76
|
+
* @returns generated element id
|
|
77
|
+
*/
|
|
78
|
+
this.getElementId = (element, index) => `${element}-${this.getTabItemIndex(index)}`;
|
|
79
|
+
/**
|
|
80
|
+
* Method to get tab item index
|
|
81
|
+
* @param index - to get
|
|
82
|
+
* @returns index
|
|
83
|
+
*/
|
|
84
|
+
this.getTabItemIndex = (index) => index + this.startIndex;
|
|
85
|
+
/**
|
|
86
|
+
* Handle click events on tabs
|
|
87
|
+
* @param event - mouse event
|
|
88
|
+
*/
|
|
89
|
+
this.handleClick = (event) => {
|
|
90
|
+
const tabId = event.currentTarget.dataset.index;
|
|
91
|
+
if (!this.isActivableTab(this.tabs[Number(tabId) - this.startIndex])) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this.activeTab = Number(tabId);
|
|
96
|
+
this.tabFocus = undefined;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* get navigation button class from given status
|
|
101
|
+
* @param status - button tab status
|
|
102
|
+
* @returns button class/selector variant
|
|
103
|
+
*/
|
|
104
|
+
this.getNavigationButtonClass = (status) => `${this.buttonTabBaseClass}--${status}`;
|
|
105
|
+
/**
|
|
106
|
+
* Handle keyboard event on tabs
|
|
107
|
+
* @param event - mouse event
|
|
108
|
+
*/
|
|
109
|
+
this.handleKeydown = (event) => {
|
|
110
|
+
const parent = event.target.parentElement;
|
|
111
|
+
if ([Keys.ARROWLEFT, Keys.ARROWRIGHT].includes(event.key)) {
|
|
112
|
+
this.tabFocus = Number(event.target.dataset.index);
|
|
113
|
+
parent.querySelector(`[data-index="${this.tabFocus}"]`).setAttribute('tabindex', '-1');
|
|
114
|
+
// Move right
|
|
115
|
+
if (event.key === Keys.ARROWRIGHT) {
|
|
116
|
+
this.tabFocus++;
|
|
117
|
+
// If we're at the end, go to the start
|
|
118
|
+
if (this.tabFocus > this.tabs.length)
|
|
119
|
+
this.tabFocus = this.startIndex;
|
|
120
|
+
// Move left
|
|
121
|
+
}
|
|
122
|
+
else if (event.key === Keys.ARROWLEFT) {
|
|
123
|
+
this.tabFocus--;
|
|
124
|
+
// If we're at the start, move to the end
|
|
125
|
+
if (this.tabFocus < this.startIndex)
|
|
126
|
+
this.tabFocus = this.tabs.length;
|
|
127
|
+
}
|
|
128
|
+
const parentButtonElement = parent.querySelector(`[data-index="${this.tabFocus}"]`);
|
|
129
|
+
// if focus item is ['hidden'] we recursively repeat action
|
|
130
|
+
if (this.tabHasStatus(this.tabs[this.tabFocus - 1], Status.HIDDEN)) {
|
|
131
|
+
parentButtonElement.dispatchEvent(new KeyboardEvent('keydown', { key: event.key, bubbles: true }));
|
|
132
|
+
// else run focus methods on tabFocus element
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
parentButtonElement.setAttribute('tabindex', '0');
|
|
136
|
+
parentButtonElement.focus();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else if (event.key === Keys.TAB) {
|
|
140
|
+
this.resetFocus();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Reset focus on document click
|
|
145
|
+
* @param event - mouse event
|
|
146
|
+
*/
|
|
147
|
+
this.handleDocumentClick = (event) => {
|
|
148
|
+
if (event.target.closest('mg-tabs') !== this.element)
|
|
149
|
+
this.resetFocus();
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Method to reset focus behavior
|
|
153
|
+
*/
|
|
154
|
+
this.resetFocus = () => {
|
|
155
|
+
// update asynchronously tabindex to prevent get focus on new tabindex at then end of event process
|
|
156
|
+
nextTick(() => {
|
|
157
|
+
this.tabFocus = undefined;
|
|
158
|
+
Array.from(this.element.shadowRoot.querySelectorAll('[data-index]')).forEach((tab, index) => {
|
|
159
|
+
tab.setAttribute('tabindex', this.activeTab - this.startIndex !== index ? '-1' : '0');
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Validate slots setting
|
|
165
|
+
*/
|
|
166
|
+
this.validateSlots = () => {
|
|
167
|
+
const slots = Array.from(this.element.children).filter(slot => { var _a; return (_a = slot.getAttribute('slot')) === null || _a === void 0 ? void 0 : _a.includes('tab_content-'); });
|
|
168
|
+
if (slots.length !== this.tabs.length)
|
|
169
|
+
throw new Error('<mg-tabs> Must have slots counts equal to tabs count.');
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
watchIdentifier(newValue) {
|
|
173
|
+
if (!isValideID(newValue)) {
|
|
174
|
+
console.error(`<mg-tabs> prop "identifier" value is invalid. Passed value: ${toString(newValue)}.`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
validateLabel(newValue) {
|
|
178
|
+
if (!isValidString(newValue)) {
|
|
179
|
+
throw new Error(`<mg-tabs> prop "label" is required and must be a string. Passed value: ${toString(newValue)}.`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
validateSize(newValue) {
|
|
183
|
+
if (!sizes.includes(newValue)) {
|
|
184
|
+
throw new Error(`<mg-tabs> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);
|
|
185
|
+
}
|
|
186
|
+
this.classCollection.add(`mg-c-tabs--size-${this.size}`);
|
|
187
|
+
}
|
|
188
|
+
validateItems(newValue) {
|
|
189
|
+
// String array
|
|
190
|
+
if (allItemsAreString(newValue))
|
|
191
|
+
this.tabs = newValue.map(item => ({ label: item, status: Status.VISIBLE }));
|
|
192
|
+
// Object array
|
|
193
|
+
else if (Array.isArray(newValue) && newValue.length > 0 && newValue.every(isTabItem))
|
|
194
|
+
this.tabs = newValue;
|
|
195
|
+
else
|
|
196
|
+
throw new Error(`<mg-tabs> prop "items" is required and all items must be the same type: TabItem. Passed value: ${toString(newValue)}.`);
|
|
197
|
+
}
|
|
198
|
+
validateActiveTab(newValue) {
|
|
199
|
+
// when `active-tab` is undefined we set default value by searching an item with `Status.ACTIVE` or we use the `startIndex` has fallback value
|
|
200
|
+
// after setting new value to `active-tab` the validate will be triggered again with the updated value and process the tab update
|
|
201
|
+
if (newValue === undefined) {
|
|
202
|
+
this.activeTab = this.tabs.some(tab => this.tabHasStatus(tab, Status.ACTIVE))
|
|
203
|
+
? this.getTabItemIndex(this.tabs.findIndex(tab => this.tabHasStatus(tab, Status.ACTIVE)))
|
|
204
|
+
: this.startIndex;
|
|
205
|
+
}
|
|
206
|
+
else if (typeof newValue === 'number' && newValue >= this.startIndex && newValue <= this.tabs.length && this.isActivableTab(this.tabs[newValue - this.startIndex])) {
|
|
207
|
+
// if new 'active-tab' is activable we update tab status to ACTIVE and toggle past ACTIVE to VISIBLE
|
|
208
|
+
this.tabs.forEach((tab, index) => {
|
|
209
|
+
const isNewActiveTab = index === newValue - this.startIndex;
|
|
210
|
+
// reset active tabs
|
|
211
|
+
if (this.tabHasStatus(tab, Status.ACTIVE) && !isNewActiveTab)
|
|
212
|
+
tab.status = Status.VISIBLE;
|
|
213
|
+
// set active tab from given tab key
|
|
214
|
+
else if (this.isActivableTab(tab) && isNewActiveTab)
|
|
215
|
+
tab.status = Status.ACTIVE;
|
|
216
|
+
});
|
|
217
|
+
// emit change active tab key event
|
|
218
|
+
this.activeTabChange.emit(newValue);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
throw new Error(`<mg-tabs> prop "activeTab" must be a number between ${this.startIndex} and ${this.tabs.length} and new value must be "activable". Passed value: ${toString(newValue)}.`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/*************
|
|
225
|
+
* Lifecycle *
|
|
226
|
+
*************/
|
|
227
|
+
/**
|
|
228
|
+
* Check if component props are well configured on init
|
|
229
|
+
*/
|
|
230
|
+
componentWillLoad() {
|
|
231
|
+
// Check tabs format
|
|
232
|
+
this.watchIdentifier(this.identifier);
|
|
233
|
+
this.validateLabel(this.label);
|
|
234
|
+
this.validateItems(this.items);
|
|
235
|
+
this.validateActiveTab(this.activeTab);
|
|
236
|
+
this.validateSize(this.size);
|
|
237
|
+
this.validateSlots();
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* add listners
|
|
241
|
+
*/
|
|
242
|
+
componentDidLoad() {
|
|
243
|
+
document.addEventListener('click', this.handleDocumentClick, false);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* remove listeners
|
|
247
|
+
*/
|
|
248
|
+
disconnectedCallback() {
|
|
249
|
+
document.removeEventListener('keydown', this.handleDocumentClick);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Render
|
|
253
|
+
* @returns HTML Element
|
|
254
|
+
*/
|
|
255
|
+
render() {
|
|
256
|
+
return (h("div", { key: '97f18baca4ae45b85401fd38570fe16d8df46c2b', class: this.classCollection.join() }, h("header", { key: '46cffaf2e14dde2a4994e894358caee7553b3bd6', role: "tablist", "aria-label": this.label, class: "mg-c-tabs__header" }, this.tabs.map((tab, index) => (h("button", { key: tab.label, role: "tab", id: this.getElementId(this.identifier, index), class: {
|
|
257
|
+
[`${this.buttonTabBaseClass}`]: true,
|
|
258
|
+
[`${this.buttonTabBaseClass}--horizontal`]: true,
|
|
259
|
+
[`${this.getNavigationButtonClass(Status.ACTIVE)}`]: this.tabHasStatus(tab, Status.ACTIVE),
|
|
260
|
+
[`${this.getNavigationButtonClass(Status.DISABLED)}`]: this.tabHasStatus(tab, Status.DISABLED),
|
|
261
|
+
[`${this.getNavigationButtonClass(Status.HIDDEN)}`]: this.tabHasStatus(tab, Status.HIDDEN),
|
|
262
|
+
}, tabindex: this.tabHasStatus(tab, Status.ACTIVE) ? 0 : -1, "aria-selected": this.tabHasStatus(tab, Status.ACTIVE).toString(), "aria-controls": this.getElementId(this.tabPanel, index), "aria-disabled": this.tabHasStatus(tab, Status.DISABLED), onClick: this.handleClick, onKeyDown: this.handleKeydown, "data-index": this.getTabItemIndex(index) }, tab.icon !== undefined && h("mg-icon", { icon: tab.icon }), tab.label, tab.badge !== undefined && h("mg-badge", { variant: "text-color", value: tab.badge.value, label: tab.badge.label, outline: tab.badge.role === 'information' }))))), this.tabs.map((tab, index) => (h("article", { key: tab.label, role: "tabpanel", id: this.getElementId(this.tabPanel, index), hidden: !this.tabHasStatus(tab, Status.ACTIVE), "aria-labelledby": this.getElementId(this.identifier, index), tabindex: this.tabHasStatus(tab, Status.ACTIVE) ? 0 : -1, class: "mg-c-tabs__content-container" }, h("slot", { name: this.getElementId('tab_content', index) }))))));
|
|
263
|
+
}
|
|
264
|
+
get element() { return this; }
|
|
265
|
+
static get watchers() { return {
|
|
266
|
+
"identifier": ["watchIdentifier"],
|
|
267
|
+
"label": ["validateLabel"],
|
|
268
|
+
"size": ["validateSize"],
|
|
269
|
+
"items": ["validateItems"],
|
|
270
|
+
"activeTab": ["validateActiveTab"]
|
|
271
|
+
}; }
|
|
272
|
+
static get style() { return mgTabsCss; }
|
|
273
|
+
}, [257, "mg-tabs", {
|
|
274
|
+
"identifier": [1],
|
|
275
|
+
"label": [1],
|
|
276
|
+
"size": [1],
|
|
277
|
+
"items": [16],
|
|
278
|
+
"activeTab": [1538, "active-tab"],
|
|
279
|
+
"tabs": [32],
|
|
280
|
+
"classCollection": [32]
|
|
281
|
+
}, undefined, {
|
|
282
|
+
"identifier": ["watchIdentifier"],
|
|
283
|
+
"label": ["validateLabel"],
|
|
284
|
+
"size": ["validateSize"],
|
|
285
|
+
"items": ["validateItems"],
|
|
286
|
+
"activeTab": ["validateActiveTab"]
|
|
287
|
+
}]);
|
|
288
|
+
function defineCustomElement() {
|
|
289
|
+
if (typeof customElements === "undefined") {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const components = ["mg-tabs", "mg-badge", "mg-icon"];
|
|
293
|
+
components.forEach(tagName => { switch (tagName) {
|
|
294
|
+
case "mg-tabs":
|
|
295
|
+
if (!customElements.get(tagName)) {
|
|
296
|
+
customElements.define(tagName, MgTabs);
|
|
297
|
+
}
|
|
298
|
+
break;
|
|
299
|
+
case "mg-badge":
|
|
300
|
+
if (!customElements.get(tagName)) {
|
|
301
|
+
defineCustomElement$2();
|
|
302
|
+
}
|
|
303
|
+
break;
|
|
304
|
+
case "mg-icon":
|
|
305
|
+
if (!customElements.get(tagName)) {
|
|
306
|
+
defineCustomElement$1();
|
|
307
|
+
}
|
|
308
|
+
break;
|
|
309
|
+
} });
|
|
310
|
+
}
|
|
311
|
+
defineCustomElement();
|
|
312
|
+
|
|
313
|
+
export { MgTabs as M, Status as S, defineCustomElement as d };
|
|
@@ -100,7 +100,7 @@ const MgTag$1 = /*@__PURE__*/ proxyCustomElement(class MgTag extends HTMLElement
|
|
|
100
100
|
"soft": ["validateSoft"]
|
|
101
101
|
}; }
|
|
102
102
|
static get style() { return mgTagCss; }
|
|
103
|
-
}, [
|
|
103
|
+
}, [257, "mg-tag", {
|
|
104
104
|
"variant": [1],
|
|
105
105
|
"outline": [4],
|
|
106
106
|
"soft": [4],
|
|
@@ -19,7 +19,7 @@ const MgTooltipContent = /*@__PURE__*/ proxyCustomElement(class MgTooltipContent
|
|
|
19
19
|
return (h(Host, { key: '2221de3ca0ef7c9d6e46e24b19c69007fababf81', role: "tooltip" }, h("span", { key: '9e14f7f5b3f5e5060ed9f42e8d7259b17575168e', innerHTML: this.message, class: "mg-tooltip-content__message" }), h("slot", { key: 'bc083567d77e8f4ffccee98b96036ba8ac494fb6', name: "arrow" })));
|
|
20
20
|
}
|
|
21
21
|
static get style() { return mgTooltipContentCss; }
|
|
22
|
-
}, [
|
|
22
|
+
}, [257, "mg-tooltip-content", {
|
|
23
23
|
"message": [1]
|
|
24
24
|
}]);
|
|
25
25
|
function defineCustomElement() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as createID, n as nextTick, a as isValideID, t as toString, i as isValidString, g as getWindows,
|
|
2
|
+
import { c as createID, n as nextTick, a as isValideID, t as toString, i as isValidString, g as getWindows, l as focusableElements } from './index2.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './mg-tooltip-content2.js';
|
|
4
4
|
import { c as createPopper } from './popper.js';
|
|
5
5
|
|
|
@@ -384,7 +384,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class MgTooltip extends HTMLE
|
|
|
384
384
|
"disabled": ["watchDisabled"]
|
|
385
385
|
}; }
|
|
386
386
|
static get style() { return mgTooltipCss; }
|
|
387
|
-
}, [
|
|
387
|
+
}, [257, "mg-tooltip", {
|
|
388
388
|
"identifier": [1],
|
|
389
389
|
"message": [1],
|
|
390
390
|
"placement": [1],
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const errors$1 = {
|
|
2
|
-
required: "This field is required."
|
|
2
|
+
required: "This field is required.",
|
|
3
|
+
noValue: "No value."
|
|
3
4
|
};
|
|
4
5
|
const nbCharLeft$1 = "{counter} characters left.";
|
|
5
6
|
const input$1 = {
|
|
7
|
+
showMore: "Show more",
|
|
6
8
|
select: {
|
|
7
9
|
placeholder: "Select a value"
|
|
8
10
|
},
|
|
@@ -12,23 +14,29 @@ const input$1 = {
|
|
|
12
14
|
editButton: "Edit",
|
|
13
15
|
selectButton: "Select values",
|
|
14
16
|
showButton: "Show",
|
|
15
|
-
label: "Enter a value",
|
|
16
|
-
result: "result",
|
|
17
|
-
results: "results",
|
|
18
|
-
searchResults: "Search result(s) list.",
|
|
19
|
-
noResult: "No result.",
|
|
20
17
|
sections: {
|
|
18
|
+
label: "Values grouped by: \"Selected\" or \"Available\"",
|
|
19
|
+
badge: {
|
|
20
|
+
label: "value(s)"
|
|
21
|
+
},
|
|
22
|
+
search: {
|
|
23
|
+
label: "Enter a value",
|
|
24
|
+
values: "{count} value(s) found",
|
|
25
|
+
noValue: "No values found"
|
|
26
|
+
},
|
|
21
27
|
selected: {
|
|
22
28
|
title: "Selected",
|
|
23
|
-
titlePlural: "Selected",
|
|
24
29
|
action: "Unselect all",
|
|
25
|
-
tooltip: "Unselect all current
|
|
30
|
+
tooltip: "Unselect all current values",
|
|
31
|
+
values: "{count} value(s) selected",
|
|
32
|
+
noValue: "No value selected"
|
|
26
33
|
},
|
|
27
34
|
notSelected: {
|
|
28
|
-
title: "
|
|
29
|
-
titlePlural: "Not selected",
|
|
35
|
+
title: "Available",
|
|
30
36
|
action: "Select all",
|
|
31
|
-
tooltip: "Select all current
|
|
37
|
+
tooltip: "Select all current values",
|
|
38
|
+
values: "{count} value(s) available",
|
|
39
|
+
noValue: "All values are selected"
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
42
|
},
|
|
@@ -60,9 +68,8 @@ const input$1 = {
|
|
|
60
68
|
hide: "Hide password value"
|
|
61
69
|
},
|
|
62
70
|
combobox: {
|
|
63
|
-
notFound: "No
|
|
64
|
-
notAvailable: "No
|
|
65
|
-
loadMore: "Load more",
|
|
71
|
+
notFound: "No value matches your input",
|
|
72
|
+
notAvailable: "No value available",
|
|
66
73
|
search: "Search…"
|
|
67
74
|
},
|
|
68
75
|
text: {
|
|
@@ -130,6 +137,10 @@ const loader$1 = {
|
|
|
130
137
|
const table$1 = {
|
|
131
138
|
sortableCaption: "(column headers with buttons are sortable)"
|
|
132
139
|
};
|
|
140
|
+
const details$1 = {
|
|
141
|
+
toggleClosed: "Show details",
|
|
142
|
+
toggleOpened: "Hide details"
|
|
143
|
+
};
|
|
133
144
|
var en = {
|
|
134
145
|
errors: errors$1,
|
|
135
146
|
nbCharLeft: nbCharLeft$1,
|
|
@@ -145,14 +156,17 @@ var en = {
|
|
|
145
156
|
itemMore: itemMore$1,
|
|
146
157
|
actionMore: actionMore$1,
|
|
147
158
|
loader: loader$1,
|
|
148
|
-
table: table$1
|
|
159
|
+
table: table$1,
|
|
160
|
+
details: details$1
|
|
149
161
|
};
|
|
150
162
|
|
|
151
163
|
const errors = {
|
|
152
|
-
required: "Ce champ est obligatoire."
|
|
164
|
+
required: "Ce champ est obligatoire.",
|
|
165
|
+
noValue: "Aucune valeur."
|
|
153
166
|
};
|
|
154
167
|
const nbCharLeft = "{counter} caractères disponibles.";
|
|
155
168
|
const input = {
|
|
169
|
+
showMore: "Afficher plus",
|
|
156
170
|
select: {
|
|
157
171
|
placeholder: "Sélectionnez une valeur"
|
|
158
172
|
},
|
|
@@ -162,23 +176,29 @@ const input = {
|
|
|
162
176
|
editButton: "Modifier",
|
|
163
177
|
selectButton: "Sélectionner des valeurs",
|
|
164
178
|
showButton: "Voir",
|
|
165
|
-
label: "Saisissez une valeur",
|
|
166
|
-
result: "résultat",
|
|
167
|
-
results: "résultats",
|
|
168
|
-
searchResults: "Liste de résultat(s) de la recherche.",
|
|
169
|
-
noResult: "Aucun résultat.",
|
|
170
179
|
sections: {
|
|
180
|
+
label: "Valeurs regroupées par: \"Sélectionnées\" ou \"Disponibles\"",
|
|
181
|
+
badge: {
|
|
182
|
+
label: "valeur(s)"
|
|
183
|
+
},
|
|
184
|
+
search: {
|
|
185
|
+
label: "Saisissez une valeur",
|
|
186
|
+
values: "{count} résultat(s)",
|
|
187
|
+
noValue: "Aucune valeur n'a été trouvée."
|
|
188
|
+
},
|
|
171
189
|
selected: {
|
|
172
|
-
title: "
|
|
173
|
-
titlePlural: "Sélectionnés",
|
|
190
|
+
title: "Sélectionnées",
|
|
174
191
|
action: "Tout désélectionner",
|
|
175
|
-
tooltip: "Désélectionne
|
|
192
|
+
tooltip: "Désélectionne toutes les valeurs de la section",
|
|
193
|
+
values: "{count} valeur(s) sélectionnée(s)",
|
|
194
|
+
noValue: "Aucune valeur sélectionnée"
|
|
176
195
|
},
|
|
177
196
|
notSelected: {
|
|
178
|
-
title: "
|
|
179
|
-
titlePlural: "Non sélectionnés",
|
|
197
|
+
title: "Disponibles",
|
|
180
198
|
action: "Tout sélectionner",
|
|
181
|
-
tooltip: "Sélectionne
|
|
199
|
+
tooltip: "Sélectionne toutes les valeurs de la section",
|
|
200
|
+
values: "{count} valeur(s) disponible(s)",
|
|
201
|
+
noValue: "Toutes les valeurs sont sélectionnées"
|
|
182
202
|
}
|
|
183
203
|
}
|
|
184
204
|
},
|
|
@@ -210,9 +230,8 @@ const input = {
|
|
|
210
230
|
hide: "Masquer le mot de passe"
|
|
211
231
|
},
|
|
212
232
|
combobox: {
|
|
213
|
-
notFound: "
|
|
214
|
-
notAvailable: "
|
|
215
|
-
loadMore: "Afficher plus",
|
|
233
|
+
notFound: "Aucune valeur ne correspondont à votre saisie",
|
|
234
|
+
notAvailable: "Aucune valeur disponible",
|
|
216
235
|
search: "Recherche…"
|
|
217
236
|
},
|
|
218
237
|
text: {
|
|
@@ -280,6 +299,10 @@ const loader = {
|
|
|
280
299
|
const table = {
|
|
281
300
|
sortableCaption: "(les en-têtes de colonnes avec des boutons peuvent être triés)"
|
|
282
301
|
};
|
|
302
|
+
const details = {
|
|
303
|
+
toggleClosed: "Voir le detail",
|
|
304
|
+
toggleOpened: "Masquer le detail"
|
|
305
|
+
};
|
|
283
306
|
var fr = {
|
|
284
307
|
errors: errors,
|
|
285
308
|
nbCharLeft: nbCharLeft,
|
|
@@ -295,7 +318,8 @@ var fr = {
|
|
|
295
318
|
itemMore: itemMore,
|
|
296
319
|
actionMore: actionMore,
|
|
297
320
|
loader: loader,
|
|
298
|
-
table: table
|
|
321
|
+
table: table,
|
|
322
|
+
details: details
|
|
299
323
|
};
|
|
300
324
|
|
|
301
325
|
/**
|
|
@@ -5,7 +5,7 @@ const globalScripts = () => {};
|
|
|
5
5
|
const globalStyles = ":root{--mg-b-size-4:0.4rem;--mg-b-size-8:0.8rem;--mg-b-size-12:1.2rem;--mg-b-size-16:1.6rem;--mg-b-size-20:2rem;--mg-b-size-24:2.4rem;--mg-b-size-32:3.2rem;--mg-b-size-40:4rem;--mg-b-size-48:4.8rem;--mg-b-size-56:5.6rem;--mg-b-size-64:6.4rem;--mg-b-size-72:7.2rem;--mg-b-size-120:12rem;--mg-b-size-border:0.1rem;--mg-b-size-radius:var(--mg-b-size-4);--mg-b-size-floating-element-max-width:40rem;--mg-b-size-min-height:3.5rem;--mg-b-spacing-actions:var(--mg-b-size-8);--mg-b-color-blue-10:rgb(227, 244, 255);--mg-b-color-blue-20:rgb(209, 237, 255);--mg-b-color-blue-30:rgb(166, 219, 255);--mg-b-color-blue-40:rgb(106, 195, 255);--mg-b-color-blue-50:rgb(64, 179, 255);--mg-b-color-blue-60:rgb(22, 162, 255);--mg-b-color-blue-70:rgb(0, 132, 220);--mg-b-color-blue-80:rgb(0, 94, 156);--mg-b-color-blue-90:rgb(0, 67, 111);--mg-b-color-blue-100:rgb(0, 39, 66);--mg-b-color-green-10:rgb(234, 251, 244);--mg-b-color-green-20:rgb(212, 247, 234);--mg-b-color-green-30:rgb(181, 240, 219);--mg-b-color-green-40:rgb(144, 232, 202);--mg-b-color-green-50:rgb(97, 223, 179);--mg-b-color-green-60:rgb(50, 213, 156);--mg-b-color-green-70:rgb(46, 194, 142);--mg-b-color-green-80:rgb(36, 151, 111);--mg-b-color-green-90:rgb(21, 89, 66);--mg-b-color-green-100:rgb(13, 54, 40);--mg-b-color-red-10:rgb(251, 233, 234);--mg-b-color-red-20:rgb(248, 216, 217);--mg-b-color-red-30:rgb(242, 174, 178);--mg-b-color-red-40:rgb(236, 134, 139);--mg-b-color-red-50:rgb(229, 96, 103);--mg-b-color-red-60:rgb(221, 42, 52);--mg-b-color-red-70:rgb(219, 31, 41);--mg-b-color-red-80:rgb(152, 21, 28);--mg-b-color-red-90:rgb(120, 17, 23);--mg-b-color-red-100:rgb(92, 13, 13);--mg-b-color-yellow-10:rgb(255, 247, 230);--mg-b-color-yellow-20:rgb(255, 240, 207);--mg-b-color-yellow-30:rgb(255, 226, 162);--mg-b-color-yellow-40:rgb(255, 212, 118);--mg-b-color-yellow-50:rgb(255, 195, 62);--mg-b-color-yellow-60:rgb(232, 177, 56);--mg-b-color-yellow-70:rgb(181, 138, 44);--mg-b-color-yellow-80:rgb(140, 107, 34);--mg-b-color-yellow-90:rgb(86, 66, 21);--mg-b-color-yellow-100:rgb(53, 41, 13);--mg-b-color-neutral-0:rgb(255, 255, 255);--mg-b-color-neutral-10:rgb(250, 251, 251);--mg-b-color-neutral-20:rgb(236, 238, 238);--mg-b-color-neutral-30:rgb(225, 227, 228);--mg-b-color-neutral-40:rgb(197, 201, 203);--mg-b-color-neutral-50:rgb(182, 188, 190);--mg-b-color-neutral-60:rgb(157, 165, 167);--mg-b-color-neutral-70:rgb(129, 139, 142);--mg-b-color-neutral-80:rgb(101, 113, 117);--mg-b-color-neutral-90:rgb(75, 89, 94);--mg-b-color-neutral-100:rgb(47, 64, 69);--mg-b-color-neutral-110:rgb(21, 40, 46);--mg-b-color-neutral-120:rgb(5, 9, 11);--mg-b-color-dark:var(--mg-b-color-neutral-110);--mg-b-color-light:var(--mg-b-color-neutral-0);--mg-b-color-danger:var(--mg-b-color-red-70);--mg-b-color-text-on-danger:var(--mg-b-color-light);--mg-b-color-info:var(--mg-b-color-blue-80);--mg-b-color-text-on-info:var(--mg-b-color-light);--mg-b-color-success:var(--mg-b-color-green-60);--mg-b-color-text-on-success:var(--mg-b-color-dark);--mg-b-color-warning:var(--mg-b-color-yellow-50);--mg-b-color-text-on-warning:var(--mg-b-color-dark);--mg-b-color-app:var(--mg-b-color-blue-80);--mg-b-color-primary:var(--mg-b-color-neutral-110);--mg-b-color-text-on-primary:var(--mg-b-color-light);--mg-b-color-secondary:var(--mg-b-color-neutral-10);--mg-b-color-text-on-secondary:var(--mg-b-color-dark);--mg-b-font-size:1.3rem;--mg-b-font-size-small:1.17rem;--mg-b-font-size-h1:calc(var(--mg-b-font-size) * 1.85);--mg-b-font-size-h2:calc(var(--mg-b-font-size) * 1.65);--mg-b-font-size-h3:calc(var(--mg-b-font-size) * 1.35);--mg-b-font-size-h4:calc(var(--mg-b-font-size) * 1.2);--mg-b-font-size-h5:calc(var(--mg-b-font-size) * 1.1);--mg-b-font-size-h6:calc(var(--mg-b-font-size) * 0.8);--mg-b-small-font-size:0.9em;--mg-b-font-family:\"Open Sans\", sans-serif;--mg-b-font-family-heading:var(--mg-b-font-family);--mg-b-line-height:1.4;--mg-b-box-shadow:0 0.3rem 0.8rem 0 color-mix(in srgb, var(--mg-b-color-dark), transparent 85%);--mg-b-opacity-element-disabled:0.4}:root{--mg-c-badge-size:var(--mg-b-size-16);--mg-c-badge-font-size:var(--mg-b-font-size-small);--mg-c-button-border-radius:var(--mg-b-size-radius);--mg-c-button-icon-border-radius:var(--mg-b-size-min-height);--mg-c-button-color-background-danger:var(--mg-b-color-danger);--mg-c-button-color-border-danger:var(--mg-b-color-red-80);--mg-c-button-color-gradient-danger:var(--mg-b-color-red-80);--mg-c-button-color-text-danger:var(--mg-b-color-text-on-danger);--mg-c-button-color-background-info:var(--mg-b-color-info);--mg-c-button-color-border-info:var(--mg-b-color-blue-90);--mg-c-button-color-gradient-info:var(--mg-b-color-blue-90);--mg-c-button-color-text-info:var(--mg-b-color-text-on-info);--mg-c-button-color-background-success:var(--mg-b-color-success);--mg-c-button-color-border-success:var(--mg-b-color-green-70);--mg-c-button-color-gradient-success:var(--mg-b-color-green-70);--mg-c-button-color-text-success:var(--mg-b-color-text-on-success);--mg-c-button-color-background-warning:var(--mg-b-color-warning);--mg-c-button-color-border-warning:var(--mg-b-color-yellow-60);--mg-c-button-color-gradient-warning:var(--mg-b-color-yellow-60);--mg-c-button-color-text-warning:var(--mg-b-color-text-on-warning);--mg-c-button-color-background-primary:var(--mg-b-color-primary);--mg-c-button-color-border-primary:var(--mg-b-color-neutral-120);--mg-c-button-color-gradient-primary:var(--mg-b-color-neutral-120);--mg-c-button-color-text-primary:var(--mg-b-color-text-on-primary);--mg-c-button-color-background-secondary:var(--mg-b-color-secondary);--mg-c-button-color-border-secondary:var(--mg-b-color-neutral-20);--mg-c-button-color-gradient-secondary:var(--mg-b-color-neutral-20);--mg-c-button-color-text-secondary:var(--mg-b-color-text-on-secondary);--mg-c-button-color-background-danger-alt:var(--mg-b-color-neutral-10);--mg-c-button-color-border-danger-alt:var(--mg-b-color-neutral-20);--mg-c-button-color-gradient-danger-alt:var(--mg-b-color-neutral-20);--mg-c-button-color-text-danger-alt:var(--mg-b-color-danger);--mg-c-card-spacing-default:var(--mg-b-size-16);--mg-c-card-border-radius-default:var(--mg-b-size-12);--mg-c-card-color-background-default:var(--mg-b-color-light);--mg-c-card-border-default:var(--mg-b-size-border) solid var(--mg-b-color-neutral-30);--mg-c-card-box-shadow-default:var(--mg-b-box-shadow);--mg-c-divider-color-background:color-mix(in srgb, var(--mg-b-color-dark), transparent 85%);--mg-c-divider-thickness:var(--mg-b-size-border);--mg-c-divider-spacing-vertical:var(--mg-b-size-40);--mg-c-icon-border-radius:50%;--mg-c-tag-height:var(--mg-b-size-24);--mg-c-tag-border-radius:var(--mg-b-size-radius);--mg-c-tag-font-size:var(--mg-b-font-size-small);--mg-c-tooltip-border-radius:var(--mg-b-size-radius);--mg-c-tooltip-color-background:var(--mg-b-color-dark);--mg-c-tooltip-color-text:var(--mg-b-color-light);--mg-c-details-spacing:var(--mg-b-size-8);--mg-c-illustrated-message-spacing-vertical:var(--mg-b-size-40);--mg-c-input-border-width:var(--mg-b-size-border);--mg-c-input-border-radius:var(--mg-b-size-radius);--mg-c-input-color-border:rgb(181 194 201);--mg-c-input-placeholder-color-text:rgb(181 194 201);--mg-c-input-color-icon:rgb(181 194 201);--mg-c-input-color-box-shadow-focus:rgb(0 221 255 / 50%);--mg-c-input-error-color-background:color-mix(in srgb, var(--mg-b-color-danger), white 95%);--mg-c-input-toggle-border-radius-ratio:2;--mg-c-input-check-size:var(--mg-b-size-16);--mg-c-menu-item-color:var(--mg-b-color-app);--mg-c-message-border-radius:var(--mg-b-size-radius);--mg-c-modal-border-radius:var(--mg-b-size-radius);--mg-c-modal-title-font-size:var(--mg-b-font-size-h3);--mg-c-panel-border-radius:var(--mg-b-size-radius);--mg-c-panel-box-shadow:var(--mg-b-box-shadow);--mg-c-panel-content-spacing:var(--mg-b-size-16);--mg-c-popover-color-background:var(--mg-b-color-light);--mg-c-popover-color-text:var(--mg-b-color-dark);--mg-c-popover-title-font-size:var(--mg-b-font-size-h5);--mg-c-popover-max-width:var(--mg-b-size-floating-element-max-width);--mg-c-progress-size:var(--mg-b-size-8);--mg-c-progress-border-color:var(--mg-b-color-neutral-80);--mg-c-progress-bar-color-background:var(--mg-b-color-neutral-30);--mg-c-progress-fill-color-background:var(--mg-b-color-app);--mg-c-tabs-color:var(--mg-b-color-app)}html{font-size:62.5%}body{font-family:var(--mg-b-font-family);font-size:var(--mg-b-font-size);-webkit-font-smoothing:antialiased;line-height:var(--mg-b-line-height)}:root{--mg-b-font-family:system-ui, sans-serif}";
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Platform v4.36.
|
|
8
|
+
Stencil Client Platform v4.36.2 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
11
11
|
var __export = (target, all) => {
|
|
@@ -626,6 +626,12 @@ createSupportsRuleRe("::slotted");
|
|
|
626
626
|
createSupportsRuleRe(":host");
|
|
627
627
|
createSupportsRuleRe(":host-context");
|
|
628
628
|
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
629
|
+
if (typeof propValue === "string" && (propType & 16 /* Unknown */ || propType & 8 /* Any */) && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
630
|
+
try {
|
|
631
|
+
return JSON.parse(propValue);
|
|
632
|
+
} catch (e) {
|
|
633
|
+
}
|
|
634
|
+
}
|
|
629
635
|
if (propValue != null && !isComplexType(propValue)) {
|
|
630
636
|
if (propType & 4 /* Boolean */) {
|
|
631
637
|
{
|
|
@@ -65,10 +65,10 @@ const getObjectValueFromKey = (object, path, defaultValue) => {
|
|
|
65
65
|
}
|
|
66
66
|
const [current, ...next] = path.split(separator);
|
|
67
67
|
if (next.length) {
|
|
68
|
-
return getObjectValueFromKey(object[current], next.join(separator));
|
|
68
|
+
return getObjectValueFromKey(object[current], next.join(separator), defaultValue);
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
|
-
return object[current];
|
|
71
|
+
return object[current] ?? defaultValue;
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
|