@mgdis/mg-components 6.10.0 → 6.11.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-CfIlskRh.js → index-B_WwxtkQ.js} +4 -4
- package/dist/cjs/{index-CfIlskRh.js.map → index-B_WwxtkQ.js.map} +1 -1
- package/dist/cjs/{index.es-BCLy9yYb.js → index.es-C-3Gv8Eu.js} +85 -81
- package/dist/cjs/index.es-C-3Gv8Eu.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_37.cjs.entry.js +1915 -1909
- package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-alert.cjs.entry.js +6 -6
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-input-combobox.cjs.entry.js +75 -72
- package/dist/cjs/mg-input-combobox.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-input-combobox.entry.cjs.js.map +1 -1
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +12 -12
- package/dist/cjs/mg-loader.cjs.entry.js +4 -4
- package/dist/cjs/mg-progress.cjs.entry.js +10 -10
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +0 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +43 -63
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +67 -45
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +25 -30
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +5 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +47 -97
- package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
- package/dist/components/index.es.js +71 -68
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/mg-action-more.js +6 -6
- package/dist/components/mg-alert.js +5 -5
- package/dist/components/mg-badge2.js +6 -6
- package/dist/components/mg-button2.js +7 -7
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-character-left2.js +4 -4
- package/dist/components/mg-details.js +8 -4
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-form.js +7 -7
- package/dist/components/mg-icon2.js +6 -6
- package/dist/components/mg-illustrated-message.js +5 -5
- package/dist/components/mg-input-checkbox.js +9 -9
- package/dist/components/mg-input-combobox.js +74 -71
- package/dist/components/mg-input-combobox.js.map +1 -1
- package/dist/components/mg-input-date.js +17 -17
- package/dist/components/mg-input-numeric.js +13 -13
- package/dist/components/mg-input-password.js +3 -3
- package/dist/components/mg-input-radio.js +7 -7
- package/dist/components/mg-input-rich-text-editor.js +11 -11
- package/dist/components/mg-input-select2.js +32 -37
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text2.js +9 -9
- package/dist/components/mg-input-textarea.js +7 -7
- package/dist/components/mg-input-title2.js +4 -4
- package/dist/components/mg-input-toggle.js +6 -6
- package/dist/components/mg-input2.js +8 -8
- package/dist/components/mg-item-more2.js +7 -7
- package/dist/components/mg-loader2.js +3 -3
- package/dist/components/mg-menu-item2.js +11 -11
- package/dist/components/mg-message2.js +4 -4
- package/dist/components/mg-modal.js +8 -8
- package/dist/components/mg-pagination2.js +6 -6
- package/dist/components/mg-panel.js +9 -9
- package/dist/components/mg-popover-content2.js +4 -4
- package/dist/components/mg-popover-content2.js.map +1 -1
- package/dist/components/mg-popover2.js +48 -96
- package/dist/components/mg-popover2.js.map +1 -1
- package/dist/components/mg-progress.js +10 -10
- package/dist/components/mg-skip-links.js +2 -2
- package/dist/components/mg-table.js +6 -6
- package/dist/components/mg-tabs.js +12 -12
- package/dist/components/mg-tag.js +4 -4
- package/dist/components/mg-tooltip-content2.js +1 -1
- package/dist/components/mg-tooltip-content2.js.map +1 -1
- package/dist/components/mg-tooltip2.js +47 -66
- package/dist/components/mg-tooltip2.js.map +1 -1
- package/dist/components/popper.js +1793 -0
- package/dist/components/popper.js.map +1 -0
- package/dist/esm/{index-DmsGewMC.js → index-DHpyFawS.js} +4 -4
- package/dist/esm/{index-DmsGewMC.js.map → index-DHpyFawS.js.map} +1 -1
- package/dist/esm/{index.es-rLV3KFPd.js → index.es-lyrZ9KRh.js} +73 -70
- package/dist/esm/index.es-lyrZ9KRh.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_37.entry.js +1915 -1909
- package/dist/esm/mg-action-more_37.entry.js.map +1 -1
- package/dist/esm/mg-alert.entry.js +6 -6
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-input-combobox.entry.js +75 -72
- package/dist/esm/mg-input-combobox.entry.js.map +1 -1
- package/dist/esm/mg-input-rich-text-editor.entry.js +12 -12
- package/dist/esm/mg-loader.entry.js +4 -4
- package/dist/esm/mg-progress.entry.js +10 -10
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-input-combobox.entry.esm.js.map +1 -1
- package/dist/mg-components/{p-ad66e7b3.entry.js → p-596c0e08.entry.js} +2 -2
- package/dist/mg-components/p-8a3bd8ad.entry.js +2 -0
- package/dist/mg-components/p-8a3bd8ad.entry.js.map +1 -0
- package/dist/mg-components/p-98a74b62.entry.js +2 -0
- package/dist/mg-components/{p-cdbe689e.entry.js.map → p-98a74b62.entry.js.map} +1 -1
- package/dist/mg-components/{p-DK9teKTo.js → p-C-vIqOyI.js} +2 -2
- package/dist/mg-components/{p-DK9teKTo.js.map → p-C-vIqOyI.js.map} +1 -1
- package/dist/mg-components/{p-73099ed7.entry.js → p-d4ed3aad.entry.js} +2 -2
- package/dist/mg-components/p-e822bd96.entry.js +2 -0
- package/dist/mg-components/{p-88f77de2.entry.js.map → p-e822bd96.entry.js.map} +1 -1
- package/dist/mg-components/p-fc7b96e6.entry.js +2 -0
- package/dist/mg-components/p-fc7b96e6.entry.js.map +1 -0
- package/dist/mg-components/p-lyrZ9KRh.js +2 -0
- package/dist/mg-components/p-lyrZ9KRh.js.map +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +0 -6
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +6 -8
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +5 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -9
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +1 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +8 -22
- package/dist/types/components.d.ts +11 -8
- package/ide/intellij/web-types.json +6 -2
- package/ide/vscode/html-custom-data.json +1 -1
- package/package.json +12 -12
- package/dist/cjs/index.es-BCLy9yYb.js.map +0 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +0 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js.map +0 -1
- package/dist/collection/utils/floating-ui.utils.js +0 -74
- package/dist/collection/utils/floating-ui.utils.js.map +0 -1
- package/dist/components/floating-ui.utils.js +0 -1721
- package/dist/components/floating-ui.utils.js.map +0 -1
- package/dist/esm/index.es-rLV3KFPd.js.map +0 -1
- package/dist/mg-components/p-0f761c6c.entry.js +0 -2
- package/dist/mg-components/p-0f761c6c.entry.js.map +0 -1
- package/dist/mg-components/p-88f77de2.entry.js +0 -2
- package/dist/mg-components/p-cdbe689e.entry.js +0 -2
- package/dist/mg-components/p-d3a868f0.entry.js +0 -2
- package/dist/mg-components/p-d3a868f0.entry.js.map +0 -1
- package/dist/mg-components/p-rLV3KFPd.js +0 -2
- package/dist/mg-components/p-rLV3KFPd.js.map +0 -1
- package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +0 -6
- package/dist/types/utils/floating-ui.utils.d.ts +0 -28
- /package/dist/mg-components/{p-ad66e7b3.entry.js.map → p-596c0e08.entry.js.map} +0 -0
- /package/dist/mg-components/{p-73099ed7.entry.js.map → p-d4ed3aad.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { a as qt, Y as Yt, G as Gt, q as qe } from './index.es.js';
|
|
3
3
|
import { d as defineCustomElement$5, c as classReadonly, a as classDisabled } from './mg-input2.js';
|
|
4
4
|
import { d as defineCustomElement$6 } from './mg-icon2.js';
|
|
5
5
|
import { d as defineCustomElement$4 } from './mg-input-title2.js';
|
|
@@ -64,7 +64,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
64
64
|
/**
|
|
65
65
|
* Component classes
|
|
66
66
|
*/
|
|
67
|
-
this.classCollection = new
|
|
67
|
+
this.classCollection = new qt(['mg-c-input--toggle']);
|
|
68
68
|
/**
|
|
69
69
|
* Checked internal value
|
|
70
70
|
*/
|
|
@@ -125,10 +125,10 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
125
125
|
}
|
|
126
126
|
validateItems(newValue) {
|
|
127
127
|
if (typeof newValue === 'object' && this.items.length !== 2) {
|
|
128
|
-
throw new Error(`<mg-input-toggle> prop "items" require 2 items. Passed value: ${
|
|
128
|
+
throw new Error(`<mg-input-toggle> prop "items" require 2 items. Passed value: ${Yt(newValue)}.`);
|
|
129
129
|
}
|
|
130
130
|
// String array
|
|
131
|
-
else if (
|
|
131
|
+
else if (Gt(newValue)) {
|
|
132
132
|
this.options = newValue.map(item => ({ title: item, value: item }));
|
|
133
133
|
}
|
|
134
134
|
// Object array
|
|
@@ -136,7 +136,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
136
136
|
this.options = newValue;
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
throw new Error(`<mg-input-toggle> prop "items" is required and all items must be the same type: ToggleValue. Passed value: ${
|
|
139
|
+
throw new Error(`<mg-input-toggle> prop "items" is required and all items must be the same type: ToggleValue. Passed value: ${Yt(newValue)}.`);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
watchIsOnOff(newValue) {
|
|
@@ -184,7 +184,7 @@ const MgInputToggle$1 = /*@__PURE__*/ proxyCustomElement(class MgInputToggle ext
|
|
|
184
184
|
if (typeof valid !== 'boolean') {
|
|
185
185
|
throw new Error('<mg-input-toggle> method "setError()" param "valid" must be a boolean.');
|
|
186
186
|
}
|
|
187
|
-
else if (!
|
|
187
|
+
else if (!qe(errorMessage)) {
|
|
188
188
|
throw new Error('<mg-input-toggle> method "setError()" param "errorMessage" must be a string.');
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { q as qe, Y as Yt, B as Bt } from './index.es.js';
|
|
3
3
|
import { d as defineCustomElement$4 } from './mg-icon2.js';
|
|
4
4
|
import { d as defineCustomElement$3 } from './mg-input-title2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './mg-tooltip2.js';
|
|
@@ -71,11 +71,11 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
71
71
|
this.renderTooltip = () => (h("mg-tooltip", { identifier: `${this.identifier}-tooltip`, message: this.tooltip }, h("mg-icon", { icon: "info-circle" })));
|
|
72
72
|
}
|
|
73
73
|
watchIdentifier(newValue) {
|
|
74
|
-
if (!
|
|
75
|
-
throw new Error(`<mg-input> prop "identifier" is required and must be a string. Passed value: ${
|
|
74
|
+
if (!qe(newValue)) {
|
|
75
|
+
throw new Error(`<mg-input> prop "identifier" is required and must be a string. Passed value: ${Yt(newValue)}.`);
|
|
76
76
|
}
|
|
77
|
-
else if (!
|
|
78
|
-
console.error(`<mg-input> prop "identifier" value is invalid. Passed value: ${
|
|
77
|
+
else if (!Bt(newValue)) {
|
|
78
|
+
console.error(`<mg-input> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
81
|
this.helpTextId = `${this.identifier}-help-text`;
|
|
@@ -97,7 +97,7 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
97
97
|
}
|
|
98
98
|
watchTooltipPosition(newValue) {
|
|
99
99
|
if (!tooltipPositions.includes(newValue)) {
|
|
100
|
-
throw new Error(`<mg-input> prop "tooltipPosition" must be one of: ${tooltipPositions.join(', ')}. Passed value: ${
|
|
100
|
+
throw new Error(`<mg-input> prop "tooltipPosition" must be one of: ${tooltipPositions.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
watchErrorMessage(newValue) {
|
|
@@ -166,8 +166,8 @@ const MgInput = /*@__PURE__*/ proxyCustomElement(class MgInput extends HTMLEleme
|
|
|
166
166
|
*/
|
|
167
167
|
// eslint-disable-next-line @stencil-community/no-unused-watch
|
|
168
168
|
watchLabel() {
|
|
169
|
-
if (!
|
|
170
|
-
throw new Error(`<mg-input> prop "label" is required and must be a string. Passed value: ${
|
|
169
|
+
if (!qe(this.label)) {
|
|
170
|
+
throw new Error(`<mg-input> prop "label" is required and must be a string. Passed value: ${Yt(this.label)}.`);
|
|
171
171
|
}
|
|
172
172
|
else {
|
|
173
173
|
this.watchAriaDescribedbyIDs();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { Y as Yt } from './index.es.js';
|
|
3
3
|
import { d as defineCustomElement$4, a as directions, s as sizes } from './mg-menu-item2.js';
|
|
4
4
|
import { i as initLocales } from './index2.js';
|
|
5
5
|
import { d as defineCustomElement$8 } from './mg-badge2.js';
|
|
@@ -163,12 +163,12 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class MgMenu extends HTMLElement
|
|
|
163
163
|
}
|
|
164
164
|
validateLabel(newValue) {
|
|
165
165
|
if (newValue === undefined && !this.element.hasAttribute('aria-label')) {
|
|
166
|
-
throw new Error(`<${this.name}> prop "label" is required. Passed value: ${
|
|
166
|
+
throw new Error(`<${this.name}> prop "label" is required. Passed value: ${Yt(newValue)}.`);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
validateDirection(newValue) {
|
|
170
170
|
if (![directions.VERTICAL, directions.HORIZONTAL].includes(newValue)) {
|
|
171
|
-
throw new Error(`<${this.name}> prop "direction" must be one of: ${directions.HORIZONTAL}, ${directions.VERTICAL}. Passed value: ${
|
|
171
|
+
throw new Error(`<${this.name}> prop "direction" must be one of: ${directions.HORIZONTAL}, ${directions.VERTICAL}. Passed value: ${Yt(newValue)}.`);
|
|
172
172
|
}
|
|
173
173
|
else {
|
|
174
174
|
this.updateMenuItems();
|
|
@@ -184,7 +184,7 @@ const MgMenu = /*@__PURE__*/ proxyCustomElement(class MgMenu extends HTMLElement
|
|
|
184
184
|
}
|
|
185
185
|
validateSize(newValue) {
|
|
186
186
|
if (!sizes.includes(newValue)) {
|
|
187
|
-
throw new Error(`<${this.name}> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${
|
|
187
|
+
throw new Error(`<${this.name}> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
@@ -355,17 +355,17 @@ const MgItemMore = /*@__PURE__*/ proxyCustomElement(class MgItemMore extends HTM
|
|
|
355
355
|
}
|
|
356
356
|
validateIcon(newValue) {
|
|
357
357
|
if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.icon !== 'string'))
|
|
358
|
-
throw new Error(`<${this.name}> prop "icon" must match MgItemMore['icon'] type. Passed value: ${
|
|
358
|
+
throw new Error(`<${this.name}> prop "icon" must match MgItemMore['icon'] type. Passed value: ${Yt(newValue)}.`);
|
|
359
359
|
}
|
|
360
360
|
validateSlotLabel(newValue) {
|
|
361
361
|
if (typeof newValue !== 'object' || (typeof newValue === 'object' && typeof newValue.display !== 'boolean'))
|
|
362
|
-
throw new Error(`<${this.name}> prop "slotlabel" must match MgItemMore['slotlabel'] type. Passed value: ${
|
|
362
|
+
throw new Error(`<${this.name}> prop "slotlabel" must match MgItemMore['slotlabel'] type. Passed value: ${Yt(newValue)}.`);
|
|
363
363
|
else if (typeof newValue.label !== 'string')
|
|
364
364
|
this.slotlabel.label = this.messages.menuLabel;
|
|
365
365
|
}
|
|
366
366
|
validateSize(newValue) {
|
|
367
367
|
if (newValue && !sizes.includes(newValue))
|
|
368
|
-
throw new Error(`<${this.name}> prop "size" must match MgItemMore['size'] type. Passed value: ${
|
|
368
|
+
throw new Error(`<${this.name}> prop "size" must match MgItemMore['size'] type. Passed value: ${Yt(newValue)}.`);
|
|
369
369
|
}
|
|
370
370
|
/*************
|
|
371
371
|
* Lifecycle *
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { i as initLocales } from './index2.js';
|
|
3
|
-
import {
|
|
3
|
+
import { q as qe, Y as Yt } from './index.es.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './mg-icon2.js';
|
|
5
5
|
|
|
6
6
|
const mgLoaderCss = ".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{display:block}.mg-c-loader{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--mg-b-size-4);text-align:center}";
|
|
@@ -16,8 +16,8 @@ const MgLoader = /*@__PURE__*/ proxyCustomElement(class MgLoader extends HTMLEle
|
|
|
16
16
|
this.messageHide = false;
|
|
17
17
|
}
|
|
18
18
|
watchMessage(newValue) {
|
|
19
|
-
if (newValue && !
|
|
20
|
-
throw new Error(`<mg-loader> prop "message" must be a valid string. Passed value: ${
|
|
19
|
+
if (newValue && !qe(newValue))
|
|
20
|
+
throw new Error(`<mg-loader> prop "message" must be a valid string. Passed value: ${Yt(newValue)}.`);
|
|
21
21
|
}
|
|
22
22
|
/*************
|
|
23
23
|
* Lifecycle *
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { D as Dt, a as qt, q as qe, B as Bt, Y as Yt, e as er } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$6 } from './mg-badge2.js';
|
|
5
5
|
import { d as defineCustomElement$5 } from './mg-button2.js';
|
|
@@ -54,7 +54,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
54
54
|
/**
|
|
55
55
|
* Identifier is used to control mg-popover
|
|
56
56
|
*/
|
|
57
|
-
this.identifier =
|
|
57
|
+
this.identifier = Dt('mg-menu-item');
|
|
58
58
|
/**
|
|
59
59
|
* Define menu-item status.
|
|
60
60
|
*/
|
|
@@ -73,7 +73,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
73
73
|
/**
|
|
74
74
|
* Component button classes
|
|
75
75
|
*/
|
|
76
|
-
this.navigationButtonClassList = new
|
|
76
|
+
this.navigationButtonClassList = new qt([this.navigationButton]);
|
|
77
77
|
/**
|
|
78
78
|
* Does component have children.
|
|
79
79
|
*/
|
|
@@ -112,7 +112,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
112
112
|
* Is component an interactive item
|
|
113
113
|
* @returns truthy if element is clickable
|
|
114
114
|
*/
|
|
115
|
-
this.isInteractiveItem = () => this.hasChildren || !
|
|
115
|
+
this.isInteractiveItem = () => this.hasChildren || !qe(this.href);
|
|
116
116
|
/**
|
|
117
117
|
* Is component contextual direction match the given direction
|
|
118
118
|
* @param direction - in parent menu
|
|
@@ -165,7 +165,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
165
165
|
}
|
|
166
166
|
['label', 'metadata'].forEach(slot => {
|
|
167
167
|
Array.from(this.element.querySelectorAll(`[slot="${slot}"]`)).forEach(element => {
|
|
168
|
-
if (!
|
|
168
|
+
if (!qe(element.textContent))
|
|
169
169
|
throw new Error(`<${this.name}> slot "${slot}" must have text content.`);
|
|
170
170
|
if ((guard && !element.hasAttribute('title')) || !guard)
|
|
171
171
|
element.setAttribute('title', element.textContent);
|
|
@@ -232,8 +232,8 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
232
232
|
this.renderSlot = () => h("slot", null);
|
|
233
233
|
}
|
|
234
234
|
watchIdentifier(newValue) {
|
|
235
|
-
if (!
|
|
236
|
-
console.error(`<mg-menu-item> prop "identifier" value is invalid. Passed value: ${
|
|
235
|
+
if (!Bt(newValue)) {
|
|
236
|
+
console.error(`<mg-menu-item> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
237
237
|
}
|
|
238
238
|
else {
|
|
239
239
|
this.popoverIdentifier = `${this.identifier}-popover`;
|
|
@@ -241,7 +241,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
241
241
|
}
|
|
242
242
|
watchTarget(newValue) {
|
|
243
243
|
if (newValue && !targets.includes(newValue)) {
|
|
244
|
-
throw new Error(`<mg-link> prop "target" must be one of: ${targets.join(', ')}. Passed value: ${
|
|
244
|
+
throw new Error(`<mg-link> prop "target" must be one of: ${targets.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
watchStatus(newValue, oldValue) {
|
|
@@ -251,7 +251,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
251
251
|
}
|
|
252
252
|
watchExpanded(newValue) {
|
|
253
253
|
if (typeof newValue !== 'boolean') {
|
|
254
|
-
throw new Error(`<${this.name}> prop "expanded" must be a boolean. Passed value: ${
|
|
254
|
+
throw new Error(`<${this.name}> prop "expanded" must be a boolean. Passed value: ${Yt(newValue)}.`);
|
|
255
255
|
}
|
|
256
256
|
else {
|
|
257
257
|
this.updateExpanded(newValue);
|
|
@@ -300,7 +300,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
300
300
|
*/
|
|
301
301
|
// eslint-disable-next-line @stencil-community/no-unused-watch
|
|
302
302
|
watchDataHasFocus(newValue) {
|
|
303
|
-
if (!
|
|
303
|
+
if (!qe(newValue))
|
|
304
304
|
this.updateExpanded(Boolean(newValue));
|
|
305
305
|
}
|
|
306
306
|
/**
|
|
@@ -366,7 +366,7 @@ const MgMenuItem = /*@__PURE__*/ proxyCustomElement(class MgMenuItem extends HTM
|
|
|
366
366
|
* @returns promise process wich emit the 'item-updated' event
|
|
367
367
|
*/
|
|
368
368
|
componentShouldUpdate() {
|
|
369
|
-
return
|
|
369
|
+
return er(() => {
|
|
370
370
|
this.itemUpdated.emit();
|
|
371
371
|
});
|
|
372
372
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { a as qt, Y as Yt } from './index.es.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './mg-card2.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './mg-icon2.js';
|
|
5
5
|
|
|
@@ -34,7 +34,7 @@ const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLE
|
|
|
34
34
|
/**
|
|
35
35
|
* Component classes
|
|
36
36
|
*/
|
|
37
|
-
this.classCollection = new
|
|
37
|
+
this.classCollection = new qt(['mg-c-message']);
|
|
38
38
|
/**
|
|
39
39
|
* Define if component is using actions slot
|
|
40
40
|
*/
|
|
@@ -58,7 +58,7 @@ const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLE
|
|
|
58
58
|
}
|
|
59
59
|
watchVariant(newValue, oldValue) {
|
|
60
60
|
if (!variants.includes(newValue)) {
|
|
61
|
-
throw new Error(`<mg-message> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${
|
|
61
|
+
throw new Error(`<mg-message> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
64
|
if (newValue !== undefined)
|
|
@@ -69,7 +69,7 @@ const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLE
|
|
|
69
69
|
}
|
|
70
70
|
watchVariantStyle(newValue, oldValue) {
|
|
71
71
|
if (!variantStyles.includes(newValue)) {
|
|
72
|
-
throw new Error(`<mg-message> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${
|
|
72
|
+
throw new Error(`<mg-message> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
75
|
if (newValue !== undefined)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { D as Dt, a as qt, B as Bt, Y as Yt, q as qe } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$4 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$3 } from './mg-card2.js';
|
|
@@ -26,7 +26,7 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
26
26
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
27
27
|
* If not set, it will be created.
|
|
28
28
|
*/
|
|
29
|
-
this.identifier =
|
|
29
|
+
this.identifier = Dt('mg-modal');
|
|
30
30
|
/**
|
|
31
31
|
* Modal dialog role.
|
|
32
32
|
*/
|
|
@@ -46,7 +46,7 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
46
46
|
/**
|
|
47
47
|
* Component classes
|
|
48
48
|
*/
|
|
49
|
-
this.classCollection = new
|
|
49
|
+
this.classCollection = new qt(['mg-c-modal']);
|
|
50
50
|
/***********
|
|
51
51
|
* Handles *
|
|
52
52
|
***********/
|
|
@@ -59,17 +59,17 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
watchIdentifier(newValue) {
|
|
62
|
-
if (!
|
|
63
|
-
throw new Error(`<mg-modal> prop "identifier" value is invalid. Passed value: ${
|
|
62
|
+
if (!Bt(newValue)) {
|
|
63
|
+
throw new Error(`<mg-modal> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
validateDialogRole(newValue) {
|
|
67
67
|
if (!dialogRoles.includes(newValue))
|
|
68
|
-
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}. Passed value: ${
|
|
68
|
+
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
69
69
|
}
|
|
70
70
|
validateModalTitle(newValue) {
|
|
71
|
-
if (!
|
|
72
|
-
throw new Error(`<mg-modal> prop "modalTitle" is required. Passed value: ${
|
|
71
|
+
if (!qe(newValue)) {
|
|
72
|
+
throw new Error(`<mg-modal> prop "modalTitle" is required. Passed value: ${Yt(newValue)}.`);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
watchOpen(newValue) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { D as Dt, B as Bt, Y as Yt } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$7 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$6 } from './mg-icon2.js';
|
|
@@ -48,7 +48,7 @@ const MgPagination = /*@__PURE__*/ proxyCustomElement(class MgPagination extends
|
|
|
48
48
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
49
49
|
* If not set, it will be created.
|
|
50
50
|
*/
|
|
51
|
-
this.identifier =
|
|
51
|
+
this.identifier = Dt('mg-pagination');
|
|
52
52
|
/**
|
|
53
53
|
* Hide navigation label
|
|
54
54
|
*/
|
|
@@ -93,18 +93,18 @@ const MgPagination = /*@__PURE__*/ proxyCustomElement(class MgPagination extends
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
watchIdentifier(newValue) {
|
|
96
|
-
if (!
|
|
97
|
-
console.error(`<mg-pagination> prop "identifier" value is invalid. Passed value: ${
|
|
96
|
+
if (!Bt(newValue)) {
|
|
97
|
+
console.error(`<mg-pagination> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
validateTotalPages(newValue) {
|
|
101
101
|
if (newValue < 1) {
|
|
102
|
-
throw new Error(`<mg-pagination> prop "totalPages" must be greater than 0. Passed value: ${
|
|
102
|
+
throw new Error(`<mg-pagination> prop "totalPages" must be greater than 0. Passed value: ${Yt(newValue)}.`);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
validateCurrentPage(newValue) {
|
|
106
106
|
if (newValue < 1) {
|
|
107
|
-
throw new Error(`<mg-pagination> prop "currentPage" must be greater than 0. Passed value: ${
|
|
107
|
+
throw new Error(`<mg-pagination> prop "currentPage" must be greater than 0. Passed value: ${Yt(newValue)}.`);
|
|
108
108
|
}
|
|
109
109
|
else if (newValue > this.totalPages) {
|
|
110
110
|
throw new Error('<mg-pagination> prop "currentPage" can not be greater than total page.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { D as Dt, a as qt, B as Bt, Y as Yt, q as qe } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$a } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$9 } from './mg-card2.js';
|
|
@@ -33,7 +33,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
33
33
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
34
34
|
* If not set, it will be created.
|
|
35
35
|
*/
|
|
36
|
-
this.identifier =
|
|
36
|
+
this.identifier = Dt('mg-panel');
|
|
37
37
|
/**
|
|
38
38
|
* Define if panel title is editable
|
|
39
39
|
*/
|
|
@@ -57,7 +57,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
57
57
|
/**
|
|
58
58
|
* Component classes
|
|
59
59
|
*/
|
|
60
|
-
this.classCollection = new
|
|
60
|
+
this.classCollection = new qt(['mg-c-panel']);
|
|
61
61
|
/**
|
|
62
62
|
* Title is in edition mode
|
|
63
63
|
*/
|
|
@@ -156,13 +156,13 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
watchIdentifier(newValue) {
|
|
159
|
-
if (!
|
|
160
|
-
console.error(`<mg-panel> prop "identifier" value is invalid. Passed value: ${
|
|
159
|
+
if (!Bt(newValue)) {
|
|
160
|
+
console.error(`<mg-panel> prop "identifier" value is invalid. Passed value: ${Yt(newValue)}.`);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
validatePanelTitle(newValue) {
|
|
164
|
-
if (!
|
|
165
|
-
throw new Error(`<mg-panel> prop "panelTitle" is required and must be a string. Passed value: ${
|
|
164
|
+
if (!qe(newValue))
|
|
165
|
+
throw new Error(`<mg-panel> prop "panelTitle" is required and must be a string. Passed value: ${Yt(newValue)}.`);
|
|
166
166
|
this.titleChange.emit(newValue);
|
|
167
167
|
}
|
|
168
168
|
validateTitlePattern(newValue) {
|
|
@@ -171,14 +171,14 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
171
171
|
}
|
|
172
172
|
validateTitlePosition(newValue) {
|
|
173
173
|
if (!titlePositions.includes(newValue))
|
|
174
|
-
throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}. Passed value: ${
|
|
174
|
+
throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
175
175
|
}
|
|
176
176
|
handleExpanded(newValue) {
|
|
177
177
|
this.expandedChange.emit(newValue);
|
|
178
178
|
}
|
|
179
179
|
validateExpandToggleDisplay(newValue) {
|
|
180
180
|
if (!expandToggleDisplays.includes(newValue))
|
|
181
|
-
throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${
|
|
181
|
+
throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${Yt(newValue)}.`);
|
|
182
182
|
if (newValue === 'icon' && this.titleEditable)
|
|
183
183
|
this.titleEditable = false;
|
|
184
184
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { a as qt, J as Jt } from './index.es.js';
|
|
3
3
|
import { i as initLocales } from './index2.js';
|
|
4
4
|
import { d as defineCustomElement$3 } from './mg-button2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './mg-card2.js';
|
|
6
6
|
import { d as defineCustomElement$1 } from './mg-icon2.js';
|
|
7
7
|
|
|
8
|
-
const mgPopoverContentCss = ":host{position:
|
|
8
|
+
const mgPopoverContentCss = ":host{position:relative;z-index:2000;display:none;padding:var(--mg-b-size-8);color:var(--mg-c-popover-color-text)}:host([data-show]){display:block}:host([data-popper-placement^=left-start]),:host([data-popper-placement^=left-end]),:host([data-popper-placement^=right-start]),:host([data-popper-placement^=right-end]){padding:0 var(--mg-b-size-8)}.mg-c-popover-content{--mg-c-card-max-width:var(--mg-c-popover-max-width);--mg-c-card-min-width:var(--mg-c-popover-min-width)}.mg-c-popover-content mg-button{margin-top:calc(-1*(var(--mg-b-size-min-height) - var(--mg-c-popover-title-font-size)*var(--mg-b-line-height))/2);margin-right:calc(-1*(var(--mg-b-size-min-height) - var(--mg-b-size-16))/2);margin-left:var(--mg-b-size-32);float:right}.mg-c-popover-content__title ::slotted([slot=title]){margin:0 0 var(--mg-b-size-8) !important;font-size:var(--mg-c-popover-title-font-size) !important;font-weight:600 !important}.mg-c-popover-content ::slotted(*:not(mg-panel,mg-message,mg-modal)){--mg-c-card-border:var(--mg-c-card-border-default);--mg-c-card-spacing:var(--mg-c-card-spacing-default);--mg-c-card-border-radius:var(--mg-c-card-border-radius-default);--mg-c-card-color-background:var(--mg-c-card-color-background-default);--mg-c-card-box-shadow:var(--mg-c-card-box-shadow-default);--mg-c-card-max-width:unset;--mg-c-card-min-width:unset}:host([data-popper-placement^=top][data-arrow-hide]){padding-bottom:0}:host([data-popper-placement^=bottom][data-arrow-hide]){padding-top:0}:host([data-popper-placement$=end][data-arrow-hide]),:host([data-popper-placement^=left][data-arrow-hide]){padding-right:0}:host([data-popper-placement$=start][data-arrow-hide]),:host([data-popper-placement^=right][data-arrow-hide]){padding-left:0}::slotted([slot=arrow]){position:absolute;width:calc(var(--mg-b-size-24) + 2*var(--mg-c-card-border-radius) + 2*var(--mg-b-size-8));height:calc(var(--mg-b-size-24) + 2*var(--mg-c-card-border-radius) + 2*var(--mg-b-size-8));visibility:hidden}::slotted([slot=arrow])::before{position:absolute;content:\"\";visibility:visible}:host([data-arrow-hide]) ::slotted([slot=arrow]){display:none}:host([data-popper-placement^=top]) ::slotted([slot=arrow]),:host([data-popper-placement^=bottom]) ::slotted([slot=arrow]){height:var(--mg-b-size-8)}:host([data-popper-placement^=top]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=bottom]) ::slotted([slot=arrow])::before{left:calc(var(--mg-c-card-border-radius) + var(--mg-b-size-8));border-right:calc(var(--mg-b-size-24)/2) solid rgba(0,0,0,0);border-left:calc(var(--mg-b-size-24)/2) solid rgba(0,0,0,0)}:host([data-popper-placement^=top]) ::slotted([slot=arrow]){bottom:var(--mg-b-size-border);filter:drop-shadow(0 0.5rem 0.25rem color-mix(in srgb, var(--mg-b-color-dark), transparent 85%))}:host([data-popper-placement^=top]) ::slotted([slot=arrow])::before{border-top:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-popper-placement^=bottom]) ::slotted([slot=arrow]){top:var(--mg-b-size-border);filter:drop-shadow(0 -0.5rem 0.25rem color-mix(in srgb, var(--mg-b-color-dark), transparent 85%))}:host([data-popper-placement^=bottom]) ::slotted([slot=arrow])::before{border-bottom:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-popper-placement^=left]) ::slotted([slot=arrow]),:host([data-popper-placement^=right]) ::slotted([slot=arrow]){width:var(--mg-b-size-8)}:host([data-popper-placement^=left]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=right]) ::slotted([slot=arrow])::before{top:calc(var(--mg-c-card-border-radius) + var(--mg-b-size-8));border-top:calc(var(--mg-b-size-24)/2) solid rgba(0,0,0,0);border-bottom:calc(var(--mg-b-size-24)/2) solid rgba(0,0,0,0)}:host([data-popper-placement^=left]) ::slotted([slot=arrow]){right:var(--mg-b-size-border);filter:drop-shadow(0.5rem 0 0.25rem color-mix(in srgb, var(--mg-b-color-dark), transparent 85%))}:host([data-popper-placement^=left]) ::slotted([slot=arrow])::before{border-left:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-popper-placement^=right]) ::slotted([slot=arrow]){left:var(--mg-b-size-border);filter:drop-shadow(-0.5rem 0 0.25rem color-mix(in srgb, var(--mg-b-color-dark), transparent 85%))}:host([data-popper-placement^=right]) ::slotted([slot=arrow])::before{border-right:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-popper-placement^=left-start]) ::slotted([slot=arrow]),:host([data-popper-placement^=left-end]) ::slotted([slot=arrow]),:host([data-popper-placement^=right-start]) ::slotted([slot=arrow]),:host([data-popper-placement^=right-end]) ::slotted([slot=arrow]){height:calc(var(--mg-b-size-24) + 2*var(--mg-c-card-border-radius))}:host([data-popper-placement^=left-start]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=left-end]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=right-start]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=right-end]) ::slotted([slot=arrow])::before{top:var(--mg-c-card-border-radius)}";
|
|
9
9
|
|
|
10
10
|
const MgPopoverContent = /*@__PURE__*/ proxyCustomElement(class MgPopoverContent extends HTMLElement {
|
|
11
11
|
constructor() {
|
|
@@ -20,7 +20,7 @@ const MgPopoverContent = /*@__PURE__*/ proxyCustomElement(class MgPopoverContent
|
|
|
20
20
|
/**
|
|
21
21
|
* Component classes
|
|
22
22
|
*/
|
|
23
|
-
this.classCollection = new
|
|
23
|
+
this.classCollection = new qt(['mg-c-popover-content']);
|
|
24
24
|
/**
|
|
25
25
|
* Handle action for close button
|
|
26
26
|
*/
|
|
@@ -44,7 +44,7 @@ const MgPopoverContent = /*@__PURE__*/ proxyCustomElement(class MgPopoverContent
|
|
|
44
44
|
componentDidLoad() {
|
|
45
45
|
const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
46
46
|
const slottedTitleElement = this.element.querySelector('[slot="title"]');
|
|
47
|
-
if (slottedTitleElement && !
|
|
47
|
+
if (slottedTitleElement && !Jt(slottedTitleElement, headingTags)) {
|
|
48
48
|
throw new Error(`<mg-popover> Slotted title must be a heading: ${headingTags.join(', ')}.`);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"mg-popover-content2.js","mappings":";;;;;;;AAAA,MAAM,mBAAmB,GAAG,
|
|
1
|
+
{"file":"mg-popover-content2.js","mappings":";;;;;;;AAAA,MAAM,mBAAmB,GAAG,87JAA87J;;MCY78J,gBAAgB,iBAAAA,kBAAA,CAAA,MAAA,gBAAA,SAAA,WAAA,CAAA;AAL7B,IAAA,WAAA,GAAA;;;;;AAsBE;;AAEG;AACK,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AAE3B;;AAEG;QACM,IAAe,CAAA,eAAA,GAAc,IAAIC,EAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAO7E;;AAEG;AACK,QAAA,IAAiB,CAAA,iBAAA,GAAG,MAAW;AACrC,YAAA,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE;AACzB,SAAC;AAgDF;AA9CC;;AAEe;AAEf;;AAEG;IACH,iBAAiB,GAAA;;QAEf,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ;;AAGpD;;AAEG;IACH,gBAAgB,GAAA;AACd,QAAA,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QAExD,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC;QACxE,IAAI,mBAAmB,IAAI,CAACC,EAAS,CAAC,mBAAmB,EAAE,WAAW,CAAC,EAAE;AACvE,YAAA,MAAM,IAAI,KAAK,CAAC,CAAA,8CAAA,EAAiD,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAG,CAAA,CAAA,CAAC;;;AAI/F;;;AAGG;IACH,MAAM,GAAA;AACJ,QAAA,QACE,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACH,CAAA,CAAA,SAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAS,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,EAAA,EACxC,IAAI,CAAC,WAAW,KACf,mFAAmB,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAA,EACnG,CAAA,CAAA,SAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAS,IAAI,EAAC,OAAO,EAAA,CAAW,CACtB,CACb,EACD,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,6BAA6B,EAAA,EACtC,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,OAAO,EAAA,CAAQ,CACtB,EACN,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAA,CAAQ,CACpB,EACV,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,OAAO,EAAQ,CAAA,CACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","ClassList","isTagName"],"sources":["../styles/dist/components/mg-popover-content.css?tag=mg-popover-content&encapsulation=shadow","src/components/molecules/mg-popover/mg-popover-content/mg-popover-content.tsx"],"sourcesContent":[":host{position:relative;z-index:2000;display:none;padding:var(--mg-b-size-8);color:var(--mg-c-popover-color-text)}:host([data-show]){display:block}:host([data-popper-placement^=left-start]),:host([data-popper-placement^=left-end]),:host([data-popper-placement^=right-start]),:host([data-popper-placement^=right-end]){padding:0 var(--mg-b-size-8)}.mg-c-popover-content{--mg-c-card-max-width: var(--mg-c-popover-max-width);--mg-c-card-min-width: var(--mg-c-popover-min-width)}.mg-c-popover-content mg-button{margin-top:calc(-1*(var(--mg-b-size-min-height) - var(--mg-c-popover-title-font-size)*var(--mg-b-line-height))/2);margin-right:calc(-1*(var(--mg-b-size-min-height) - var(--mg-b-size-16))/2);margin-left:var(--mg-b-size-32);float:right}.mg-c-popover-content__title ::slotted([slot=title]){margin:0 0 var(--mg-b-size-8) !important;font-size:var(--mg-c-popover-title-font-size) !important;font-weight:600 !important}.mg-c-popover-content ::slotted(*:not(mg-panel,mg-message,mg-modal)){--mg-c-card-border: var(--mg-c-card-border-default);--mg-c-card-spacing: var(--mg-c-card-spacing-default);--mg-c-card-border-radius: var(--mg-c-card-border-radius-default);--mg-c-card-color-background: var(--mg-c-card-color-background-default);--mg-c-card-box-shadow: var(--mg-c-card-box-shadow-default);--mg-c-card-max-width: unset;--mg-c-card-min-width: unset}:host([data-popper-placement^=top][data-arrow-hide]){padding-bottom:0}:host([data-popper-placement^=bottom][data-arrow-hide]){padding-top:0}:host([data-popper-placement$=end][data-arrow-hide]),:host([data-popper-placement^=left][data-arrow-hide]){padding-right:0}:host([data-popper-placement$=start][data-arrow-hide]),:host([data-popper-placement^=right][data-arrow-hide]){padding-left:0}::slotted([slot=arrow]){position:absolute;width:calc(var(--mg-b-size-24) + 2*var(--mg-c-card-border-radius) + 2*var(--mg-b-size-8));height:calc(var(--mg-b-size-24) + 2*var(--mg-c-card-border-radius) + 2*var(--mg-b-size-8));visibility:hidden}::slotted([slot=arrow])::before{position:absolute;content:\"\";visibility:visible}:host([data-arrow-hide]) ::slotted([slot=arrow]){display:none}:host([data-popper-placement^=top]) ::slotted([slot=arrow]),:host([data-popper-placement^=bottom]) ::slotted([slot=arrow]){height:var(--mg-b-size-8)}:host([data-popper-placement^=top]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=bottom]) ::slotted([slot=arrow])::before{left:calc(var(--mg-c-card-border-radius) + var(--mg-b-size-8));border-right:calc(var(--mg-b-size-24)/2) solid rgba(0,0,0,0);border-left:calc(var(--mg-b-size-24)/2) solid rgba(0,0,0,0)}:host([data-popper-placement^=top]) ::slotted([slot=arrow]){bottom:var(--mg-b-size-border);filter:drop-shadow(0 0.5rem 0.25rem color-mix(in srgb, var(--mg-b-color-dark), transparent 85%))}:host([data-popper-placement^=top]) ::slotted([slot=arrow])::before{border-top:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-popper-placement^=bottom]) ::slotted([slot=arrow]){top:var(--mg-b-size-border);filter:drop-shadow(0 -0.5rem 0.25rem color-mix(in srgb, var(--mg-b-color-dark), transparent 85%))}:host([data-popper-placement^=bottom]) ::slotted([slot=arrow])::before{border-bottom:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-popper-placement^=left]) ::slotted([slot=arrow]),:host([data-popper-placement^=right]) ::slotted([slot=arrow]){width:var(--mg-b-size-8)}:host([data-popper-placement^=left]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=right]) ::slotted([slot=arrow])::before{top:calc(var(--mg-c-card-border-radius) + var(--mg-b-size-8));border-top:calc(var(--mg-b-size-24)/2) solid rgba(0,0,0,0);border-bottom:calc(var(--mg-b-size-24)/2) solid rgba(0,0,0,0)}:host([data-popper-placement^=left]) ::slotted([slot=arrow]){right:var(--mg-b-size-border);filter:drop-shadow(0.5rem 0 0.25rem color-mix(in srgb, var(--mg-b-color-dark), transparent 85%))}:host([data-popper-placement^=left]) ::slotted([slot=arrow])::before{border-left:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-popper-placement^=right]) ::slotted([slot=arrow]){left:var(--mg-b-size-border);filter:drop-shadow(-0.5rem 0 0.25rem color-mix(in srgb, var(--mg-b-color-dark), transparent 85%))}:host([data-popper-placement^=right]) ::slotted([slot=arrow])::before{border-right:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-popper-placement^=left-start]) ::slotted([slot=arrow]),:host([data-popper-placement^=left-end]) ::slotted([slot=arrow]),:host([data-popper-placement^=right-start]) ::slotted([slot=arrow]),:host([data-popper-placement^=right-end]) ::slotted([slot=arrow]){height:calc(var(--mg-b-size-24) + 2*var(--mg-c-card-border-radius))}:host([data-popper-placement^=left-start]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=left-end]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=right-start]) ::slotted([slot=arrow])::before,:host([data-popper-placement^=right-end]) ::slotted([slot=arrow])::before{top:var(--mg-c-card-border-radius)}/*# sourceMappingURL=mg-popover-content.css.map */\n","import { Component, Element, Host, h, Prop, EventEmitter, Event, State } from '@stencil/core';\nimport { isTagName, ClassList } from '@mgdis/stencil-helpers';\nimport { initLocales } from '../../../../locales';\n\n/**\n * @internal\n */\n@Component({\n tag: 'mg-popover-content',\n styleUrl: '../../../../../node_modules/@mgdis/styles/dist/components/mg-popover-content.css',\n shadow: true,\n})\nexport class MgPopoverContent {\n /************\n * Internal *\n ************/\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPopoverContentElement;\n\n /**\n * Define if popover has a cross button\n */\n @Prop() closeButton = false;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-popover-content']);\n\n /**\n * Emited event when close button is clicked\n */\n @Event({ eventName: 'hide-content' }) hideContent: EventEmitter<void>;\n\n /**\n * Handle action for close button\n */\n private handleCloseButton = (): void => {\n this.hideContent.emit();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are valide\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n }\n\n /**\n * Check if component slots are valide\n */\n componentDidLoad(): void {\n const headingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n const slottedTitleElement = this.element.querySelector('[slot=\"title\"]');\n if (slottedTitleElement && !isTagName(slottedTitleElement, headingTags)) {\n throw new Error(`<mg-popover> Slotted title must be a heading: ${headingTags.join(', ')}.`);\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host>\n <mg-card class={this.classCollection.join()}>\n {this.closeButton && (\n <mg-button is-icon variant=\"flat\" label={this.messages.general.close} onClick={this.handleCloseButton}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n )}\n <div class=\"mg-c-popover-content__title\">\n <slot name=\"title\"></slot>\n </div>\n <slot name=\"content\"></slot>\n </mg-card>\n <slot name=\"arrow\"></slot>\n </Host>\n );\n }\n}\n"],"version":3}
|