@mgdis/mg-components 6.4.0 → 6.6.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-a3269bfc.js → index-019dd5c0.js} +3 -3
- package/dist/cjs/{index-a3269bfc.js.map → index-019dd5c0.js.map} +1 -1
- package/dist/cjs/{index-911898e4.js → index-1a5a1081.js} +270 -241
- package/dist/cjs/index-1a5a1081.js.map +1 -0
- package/dist/cjs/{index.es-325100d7.js → index.es-903492c5.js} +43 -44
- package/dist/cjs/index.es-903492c5.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_36.cjs.entry.js +2418 -1996
- package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-alert.cjs.entry.js +8 -8
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-components.cjs.js.map +1 -1
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +16790 -0
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js.map +1 -0
- package/dist/cjs/mg-input.conf-5bbcea79.js +23 -0
- package/dist/cjs/mg-input.conf-5bbcea79.js.map +1 -0
- package/dist/cjs/mg-loader.cjs.entry.js +6 -6
- package/dist/cjs/mg-progress.cjs.entry.js +12 -12
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +1 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js.map +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +68 -38
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +2 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +110 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +846 -0
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js.map +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +3 -5
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +4 -4
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +16 -17
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +19 -9
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +3 -3
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +6 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +2 -2
- package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js +5 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js.map +1 -1
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +74 -17
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +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-pagination/mg-pagination.js +3 -3
- 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.conf.js +2 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +90 -46
- package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +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-tabs/mg-tabs.js +1 -1
- package/dist/collection/types/index.js.map +1 -1
- package/dist/collection/utils/behaviors.utils.js +4 -1
- package/dist/collection/utils/behaviors.utils.js.map +1 -1
- package/dist/collection/utils/floating-ui.utils.js +28 -0
- package/dist/collection/utils/floating-ui.utils.js.map +1 -0
- package/dist/components/floating-ui.utils.js +2094 -0
- package/dist/components/floating-ui.utils.js.map +1 -0
- package/dist/components/index.es.js +37 -38
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/mg-action-more.js +8 -8
- package/dist/components/mg-action-more.js.map +1 -1
- package/dist/components/mg-alert.js +6 -6
- package/dist/components/mg-badge2.js +6 -6
- package/dist/components/mg-button2.js +6 -6
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-card2.js.map +1 -1
- package/dist/components/mg-character-left2.js +4 -4
- package/dist/components/mg-details.js +8 -3
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-form.js +9 -9
- package/dist/components/mg-form.js.map +1 -1
- package/dist/components/mg-icon2.js +7 -7
- package/dist/components/mg-icon2.js.map +1 -1
- package/dist/components/mg-illustrated-message.js +69 -16
- package/dist/components/mg-illustrated-message.js.map +1 -1
- package/dist/components/mg-input-checkbox.js +11 -11
- package/dist/components/mg-input-checkbox.js.map +1 -1
- package/dist/components/mg-input-date.js +13 -13
- package/dist/components/mg-input-date.js.map +1 -1
- package/dist/components/mg-input-numeric.js +14 -14
- package/dist/components/mg-input-numeric.js.map +1 -1
- package/dist/components/mg-input-password.js +4 -4
- package/dist/components/mg-input-password.js.map +1 -1
- package/dist/components/mg-input-radio.js +8 -8
- package/dist/components/mg-input-radio.js.map +1 -1
- package/dist/components/mg-input-rich-text-editor.d.ts +11 -0
- package/dist/components/mg-input-rich-text-editor.js +16866 -0
- package/dist/components/mg-input-rich-text-editor.js.map +1 -0
- package/dist/components/mg-input-select2.js +8 -8
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text2.js +11 -13
- package/dist/components/mg-input-text2.js.map +1 -1
- package/dist/components/mg-input-textarea.js +8 -8
- package/dist/components/mg-input-textarea.js.map +1 -1
- package/dist/components/mg-input-title2.js +4 -4
- package/dist/components/mg-input-toggle.js +7 -7
- package/dist/components/mg-input2.js +9 -9
- package/dist/components/mg-input2.js.map +1 -1
- package/dist/components/mg-item-more2.js +24 -22
- package/dist/components/mg-item-more2.js.map +1 -1
- package/dist/components/mg-loader.js +4 -4
- package/dist/components/mg-menu-item2.js +30 -20
- package/dist/components/mg-menu-item2.js.map +1 -1
- package/dist/components/mg-message2.js +7 -7
- package/dist/components/mg-message2.js.map +1 -1
- package/dist/components/mg-modal.js +11 -11
- package/dist/components/mg-modal.js.map +1 -1
- package/dist/components/mg-pagination2.js +9 -9
- package/dist/components/mg-panel.js +11 -11
- package/dist/components/mg-panel.js.map +1 -1
- 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 +89 -47
- package/dist/components/mg-popover2.js.map +1 -1
- package/dist/components/mg-progress.js +11 -11
- package/dist/components/mg-skip-links.js +3 -3
- package/dist/components/mg-tabs.js +13 -13
- 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 +70 -41
- package/dist/components/mg-tooltip2.js.map +1 -1
- package/dist/esm/{index-1f32332a.js → index-5059254f.js} +270 -241
- package/dist/esm/index-5059254f.js.map +1 -0
- package/dist/esm/{index-9bd10f5d.js → index-6b7bdd63.js} +3 -3
- package/dist/esm/{index-9bd10f5d.js.map → index-6b7bdd63.js.map} +1 -1
- package/dist/esm/{index.es-a2587b72.js → index.es-b80b758c.js} +38 -39
- package/dist/esm/index.es-b80b758c.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_36.entry.js +2370 -1948
- package/dist/esm/mg-action-more_36.entry.js.map +1 -1
- package/dist/esm/mg-alert.entry.js +8 -8
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-components.js.map +1 -1
- package/dist/esm/mg-input-rich-text-editor.entry.js +16786 -0
- package/dist/esm/mg-input-rich-text-editor.entry.js.map +1 -0
- package/dist/esm/mg-input.conf-712c7bb6.js +16 -0
- package/dist/esm/mg-input.conf-712c7bb6.js.map +1 -0
- package/dist/esm/mg-loader.entry.js +6 -6
- package/dist/esm/mg-progress.entry.js +12 -12
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-components.esm.js.map +1 -1
- package/dist/mg-components/{p-f48d964f.entry.js → p-0ae49cc4.entry.js} +2 -2
- package/dist/mg-components/p-17f0b7eb.entry.js +2 -0
- package/dist/mg-components/p-17f0b7eb.entry.js.map +1 -0
- package/dist/mg-components/p-1c126a81.entry.js +2 -0
- package/dist/mg-components/p-1c126a81.entry.js.map +1 -0
- package/dist/mg-components/p-2884f369.js +2 -0
- package/dist/mg-components/p-2884f369.js.map +1 -0
- package/dist/mg-components/{p-3b052ac0.entry.js → p-361cc090.entry.js} +2 -2
- package/dist/mg-components/p-3c6710be.js +2 -0
- package/dist/mg-components/p-3c6710be.js.map +1 -0
- package/dist/mg-components/{p-dc436f3c.js → p-4049bd40.js} +2 -2
- package/dist/mg-components/{p-0ead5317.entry.js → p-c4f37d1f.entry.js} +2 -2
- package/dist/mg-components/p-e39791fa.js +3 -0
- package/dist/mg-components/p-e39791fa.js.map +1 -0
- package/dist/types/assets/icons/index.d.ts +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +6 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +7 -6
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/index.d.ts +21 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +202 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +2 -6
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +3 -2
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +14 -7
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +4 -0
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.d.ts +10 -3
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +17 -3
- package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +6 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +13 -8
- package/dist/types/components.d.ts +225 -14
- package/dist/types/types/index.d.ts +4 -0
- package/dist/types/utils/floating-ui.utils.d.ts +19 -0
- package/ide/intellij/web-types.json +374 -17
- package/ide/vscode/css-custom-data.json +4 -0
- package/ide/vscode/html-custom-data.json +289 -4
- package/package.json +25 -24
- package/dist/cjs/index-911898e4.js.map +0 -1
- package/dist/cjs/index.es-325100d7.js.map +0 -1
- package/dist/components/popper.js +0 -1794
- package/dist/components/popper.js.map +0 -1
- package/dist/esm/index-1f32332a.js.map +0 -1
- package/dist/esm/index.es-a2587b72.js.map +0 -1
- package/dist/mg-components/p-35898742.js +0 -3
- package/dist/mg-components/p-35898742.js.map +0 -1
- package/dist/mg-components/p-6810a565.entry.js +0 -2
- package/dist/mg-components/p-6810a565.entry.js.map +0 -1
- package/dist/mg-components/p-b986c107.js +0 -2
- package/dist/mg-components/p-b986c107.js.map +0 -1
- /package/dist/mg-components/{p-f48d964f.entry.js.map → p-0ae49cc4.entry.js.map} +0 -0
- /package/dist/mg-components/{p-3b052ac0.entry.js.map → p-361cc090.entry.js.map} +0 -0
- /package/dist/mg-components/{p-dc436f3c.js.map → p-4049bd40.js.map} +0 -0
- /package/dist/mg-components/{p-0ead5317.entry.js.map → p-c4f37d1f.entry.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { Z as Ze, V as Ve } 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
|
|
|
@@ -12,7 +12,7 @@ const variants = ['info', 'warning', 'success', 'danger'];
|
|
|
12
12
|
*/
|
|
13
13
|
const variantStyles = ['bar-left', 'background'];
|
|
14
14
|
|
|
15
|
-
const mgMessageCss = "/*!\n * @prop --mg-c-message-border-radius: Defines the border radius of the message. Default value: `--mg-b-size-radius`.\n */:host{--mg-c-card-spacing:0;--mg-c-card-border-radius:var(--mg-c-message-border-radius);--mg-c-card-border:none;--mg-c-card-overflow:hidden}.mg-c-message{display:inline-block;min-height:var(--mg-b-size-min-height)}.mg-c-message.mg-c-message--danger .mg-c-message__icon{color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-red-20, color-mix(in srgb, var(--mg-b-color-danger), white 80%))}.mg-c-message.mg-c-message--info .mg-c-message__icon{color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-blue-20, color-mix(in srgb, var(--mg-b-color-info), white 80%))}.mg-c-message.mg-c-message--success .mg-c-message__icon{color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-green-20, color-mix(in srgb, var(--mg-b-color-success), white 80%))}.mg-c-message.mg-c-message--warning .mg-c-message__icon{color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-yellow-20, color-mix(in srgb, var(--mg-b-color-warning), white 80%))}.mg-c-message ::slotted(*){padding:0;margin:0}.mg-c-message__icon{position:absolute;top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2);left:calc(var(--mg-b-size-4) + var(--mg-b-size-8));line-height:1}.mg-c-message__content{display:flex;flex-wrap:wrap;padding:0 var(--mg-b-size-8) 0 calc(var(--mg-b-size-4) + var(--mg-b-size-8) + var(--mg-b-size-16) + var(--mg-b-size-8));place-content:stretch flex-end}.mg-c-message__content-slot{flex-grow:1;margin:var(--mg-b-size-8) 0}.mg-c-message__content-separator{display:inline-block;width:var(--mg-b-size-40);height:0}.mg-c-message__content-actions-slot{padding:var(--mg-b-size-8) 0;text-align:right}.mg-c-message__bar{position:absolute;top:0;left:0;width:var(--mg-b-size-4);height:100%}.mg-c-message ::slotted(
|
|
15
|
+
const mgMessageCss = "/*!\n * @prop --mg-c-message-border-radius: Defines the border radius of the message. Default value: `--mg-b-size-radius`.\n */:host{--mg-c-card-spacing:0;--mg-c-card-border-radius:var(--mg-c-message-border-radius);--mg-c-card-border:none;--mg-c-card-overflow:hidden}.mg-c-message{display:inline-block;min-height:var(--mg-b-size-min-height)}.mg-c-message.mg-c-message--danger .mg-c-message__icon{color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-red-20, color-mix(in srgb, var(--mg-b-color-danger), white 80%))}.mg-c-message.mg-c-message--info .mg-c-message__icon{color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-blue-20, color-mix(in srgb, var(--mg-b-color-info), white 80%))}.mg-c-message.mg-c-message--success .mg-c-message__icon{color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-green-20, color-mix(in srgb, var(--mg-b-color-success), white 80%))}.mg-c-message.mg-c-message--warning .mg-c-message__icon{color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--background{--mg-c-card-color-background:var(--mg-b-color-yellow-20, color-mix(in srgb, var(--mg-b-color-warning), white 80%))}.mg-c-message ::slotted(*){padding:0;margin:0}.mg-c-message__icon{position:absolute;top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2);left:calc(var(--mg-b-size-4) + var(--mg-b-size-8));line-height:1}.mg-c-message__content{display:flex;flex-wrap:wrap;padding:0 var(--mg-b-size-8) 0 calc(var(--mg-b-size-4) + var(--mg-b-size-8) + var(--mg-b-size-16) + var(--mg-b-size-8));place-content:stretch flex-end}.mg-c-message__content-slot{flex-grow:1;margin:var(--mg-b-size-8) 0}.mg-c-message__content-separator{display:inline-block;width:var(--mg-b-size-40);height:0}.mg-c-message__content-actions-slot{padding:var(--mg-b-size-8) 0;text-align:right}.mg-c-message__bar{position:absolute;top:0;left:0;width:var(--mg-b-size-4);height:100%}.mg-c-message ::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}.mg-c-message,.mg-c-message mg-message{max-width:100%}";
|
|
16
16
|
const MgMessageStyle0 = mgMessageCss;
|
|
17
17
|
|
|
18
18
|
const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLElement {
|
|
@@ -35,7 +35,7 @@ const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLE
|
|
|
35
35
|
/**
|
|
36
36
|
* Component classes
|
|
37
37
|
*/
|
|
38
|
-
this.classCollection = new
|
|
38
|
+
this.classCollection = new Ze(['mg-c-message']);
|
|
39
39
|
/**
|
|
40
40
|
* Define if component is using actions slot
|
|
41
41
|
*/
|
|
@@ -59,7 +59,7 @@ const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLE
|
|
|
59
59
|
}
|
|
60
60
|
watchVariant(newValue, oldValue) {
|
|
61
61
|
if (!variants.includes(newValue)) {
|
|
62
|
-
throw new Error(`<mg-message> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${
|
|
62
|
+
throw new Error(`<mg-message> prop "variant" must be one of: ${variants.join(', ')}. Passed value: ${Ve(newValue)}.`);
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
65
65
|
if (newValue !== undefined)
|
|
@@ -70,7 +70,7 @@ const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLE
|
|
|
70
70
|
}
|
|
71
71
|
watchVariantStyle(newValue, oldValue) {
|
|
72
72
|
if (!variantStyles.includes(newValue)) {
|
|
73
|
-
throw new Error(`<mg-message> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${
|
|
73
|
+
throw new Error(`<mg-message> prop "variantStyle" must be one of: ${variantStyles.join(', ')}. Passed value: ${Ve(newValue)}.`);
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
76
|
if (newValue !== undefined)
|
|
@@ -97,9 +97,9 @@ const MgMessage = /*@__PURE__*/ proxyCustomElement(class MgMessage extends HTMLE
|
|
|
97
97
|
* @returns HTML Element
|
|
98
98
|
*/
|
|
99
99
|
render() {
|
|
100
|
-
return (h("div", { key: '
|
|
100
|
+
return (h("div", { key: 'd0a2c215951c0ef62588b5c1d13879a1ff9f8d1f', class: this.classCollection.join() }, h("mg-card", { key: '171d1c0452561a4a2729aea0a32d47e6831b1f50' }, this.variantStyle === 'bar-left' && h("span", { key: '482d2e6c2f51aafa1b434b24aab0fe9c3cb8141e', class: "mg-c-message__bar" }), h("span", { key: 'd6ec954a4eb499458bbdd0c7ba5fb5686c3afc0b', class: "mg-c-message__icon" }, h("mg-icon", { key: '32daba88c0c32cea0012ee6e80b97445aed3533c', icon: this.getIcon() })), h("div", { key: 'fc77d6745f2ae8d0c8de393598dad8d4c3b7f074', class: "mg-c-message__content" }, h("span", { key: 'e73d7327e259c457c66b2faf2ff26b3ca07bf24d', class: "mg-c-message__content-slot" }, h("slot", { key: 'c15d52b9cf7b4f974f0d92c7eceaeecba7708f37' })), this.hasActions && [
|
|
101
101
|
h("span", { class: "mg-c-message__content-separator", key: "content-separator" }),
|
|
102
|
-
h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '
|
|
102
|
+
h("span", { class: "mg-c-message__content-actions-slot", key: "content-actions-slot" }, h("slot", { key: '0ebf36c9be1bed739bede04f4cf8352f0580f53f', name: "actions" })),
|
|
103
103
|
]))));
|
|
104
104
|
}
|
|
105
105
|
get element() { return this; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"mg-message2.js","mappings":";;;;;AAEA;;;AAGO,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAO1E;;;AAGO,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU;;ACfhE,MAAM,YAAY,GAAG,s9FAAs9F,CAAC;AAC5+F,wBAAe,YAAY;;MCad,SAAS;IALtB;;;;;;;QAUmB,cAAS,GAAG,cAAc,CAAC;;;;QAcpC,YAAO,GAAgB,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eAAe,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC;YACvF,IAAI,QAAQ,KAAK,SAAS;gBAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC;SAC3F;KACF;;;;;;;IAsCD,iBAAiB;;QAEf,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;;QAE1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;KAC3E;;;;;IAMD,MAAM;QACJ,QACE,4DAAK,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,IACrC,kEACG,IAAI,CAAC,YAAY,KAAK,UAAU,IAAI,6DAAM,KAAK,EAAC,mBAAmB,GAAQ,EAC5E,6DAAM,KAAK,EAAC,oBAAoB,IAC9B,gEAAS,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,GAAY,CACpC,EACP,4DAAK,KAAK,EAAC,uBAAuB,IAChC,6DAAM,KAAK,EAAC,4BAA4B,IACtC,8DAAa,CACR,EACN,IAAI,CAAC,UAAU,IAAI;YAClB,YAAM,KAAK,EAAC,iCAAiC,EAAC,GAAG,EAAC,mBAAmB,GAAQ;YAC7E,YAAM,KAAK,EAAC,oCAAoC,EAAC,GAAG,EAAC,sBAAsB,IACzE,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACvB;SACR,CACG,CACE,CACN,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ClassList","toString"],"sources":["src/components/molecules/mg-message/mg-message.conf.ts","../styles/dist/components/mg-message.css?tag=mg-message&encapsulation=shadow","src/components/molecules/mg-message/mg-message.tsx"],"sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n","/*!\n * @prop --mg-c-message-border-radius: Defines the border radius of the message. Default value: `--mg-b-size-radius`.\n */:host{--mg-c-card-spacing: 0;--mg-c-card-border-radius: var(--mg-c-message-border-radius);--mg-c-card-border: none;--mg-c-card-overflow: hidden}.mg-c-message{display:inline-block;min-height:var(--mg-b-size-min-height)}.mg-c-message.mg-c-message--danger .mg-c-message__icon{color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--background{--mg-c-card-color-background: var(--mg-b-color-red-20, color-mix(in srgb, var(--mg-b-color-danger), white 80%))}.mg-c-message.mg-c-message--info .mg-c-message__icon{color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--background{--mg-c-card-color-background: var(--mg-b-color-blue-20, color-mix(in srgb, var(--mg-b-color-info), white 80%))}.mg-c-message.mg-c-message--success .mg-c-message__icon{color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--background{--mg-c-card-color-background: var(--mg-b-color-green-20, color-mix(in srgb, var(--mg-b-color-success), white 80%))}.mg-c-message.mg-c-message--warning .mg-c-message__icon{color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--background{--mg-c-card-color-background: var(--mg-b-color-yellow-20, color-mix(in srgb, var(--mg-b-color-warning), white 80%))}.mg-c-message ::slotted(*){padding:0;margin:0}.mg-c-message__icon{position:absolute;top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2);left:calc(var(--mg-b-size-4) + var(--mg-b-size-8));line-height:1}.mg-c-message__content{display:flex;flex-wrap:wrap;padding:0 var(--mg-b-size-8) 0 calc(var(--mg-b-size-4) + var(--mg-b-size-8) + var(--mg-b-size-16) + var(--mg-b-size-8));place-content:stretch flex-end}.mg-c-message__content-slot{flex-grow:1;margin:var(--mg-b-size-8) 0}.mg-c-message__content-separator{display:inline-block;width:var(--mg-b-size-40);height:0}.mg-c-message__content-actions-slot{padding:var(--mg-b-size-8) 0;text-align:right}.mg-c-message__bar{position:absolute;top:0;left:0;width:var(--mg-b-size-4);height:100%}.mg-c-message ::slotted(*){--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}.mg-c-message,.mg-c-message mg-message{max-width:100%}/*# sourceMappingURL=mg-message.css.map */\n","import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-message.conf';\nimport { type MgIcon } from '../../atoms/mg-icon/mg-icon';\n\n/**\n * @slot - Message content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-message',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-message.css',\n shadow: true,\n})\nexport class MgMessage {\n /************\n * Internal *\n ************/\n\n private readonly classBase = 'mg-c-message';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMessageElement;\n\n /**\n * Define variant\n */\n @Prop() variant: VariantType = 'info';\n @Watch('variant')\n watchVariant(newValue: MgMessage['variant'], oldValue?: MgMessage['variant']): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (newValue !== undefined) this.classCollection.add(`${this.classBase}--${newValue}`);\n if (oldValue !== undefined) this.classCollection.delete(`${this.classBase}--${oldValue}`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle: VariantStyleType = 'bar-left';\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgMessage['variantStyle'], oldValue?: MgMessage['variantStyle']): void {\n if (!variantStyles.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (newValue !== undefined) this.classCollection.add(`${this.classBase}--${newValue}`);\n if (oldValue !== undefined) this.classCollection.delete(`${this.classBase}--${oldValue}`);\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-message']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Get icon corresponding to variant\n * @returns icon\n */\n private getIcon = (): MgIcon['icon'] => {\n switch (this.variant) {\n case 'info':\n return 'info-circle';\n case 'warning':\n return 'exclamation-triangle';\n case 'success':\n return 'check-circle';\n case 'danger':\n return 'exclamation-circle';\n default:\n break;\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <div class={this.classCollection.join()}>\n <mg-card>\n {this.variantStyle === 'bar-left' && <span class=\"mg-c-message__bar\"></span>}\n <span class=\"mg-c-message__icon\">\n <mg-icon icon={this.getIcon()}></mg-icon>\n </span>\n <div class=\"mg-c-message__content\">\n <span class=\"mg-c-message__content-slot\">\n <slot></slot>\n </span>\n {this.hasActions && [\n <span class=\"mg-c-message__content-separator\" key=\"content-separator\"></span>,\n <span class=\"mg-c-message__content-actions-slot\" key=\"content-actions-slot\">\n <slot name=\"actions\"></slot>\n </span>,\n ]}\n </div>\n </mg-card>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"mg-message2.js","mappings":";;;;;AAEA;;;AAGO,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAO1E;;;AAGO,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU;;ACfhE,MAAM,YAAY,GAAG,w/FAAw/F,CAAC;AAC9gG,wBAAe,YAAY;;MCad,SAAS;IALtB;;;;;;;QAUmB,cAAS,GAAG,cAAc,CAAC;;;;QAcpC,YAAO,GAAgB,MAAM,CAAC;;;;QAc9B,iBAAY,GAAqB,UAAU,CAAC;;;;QAc3C,oBAAe,GAAc,IAAIA,EAAS,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;;;;QAK7D,eAAU,GAAG,KAAK,CAAC;;;;;QAMpB,YAAO,GAAG;YAChB,QAAQ,IAAI,CAAC,OAAO;gBAClB,KAAK,MAAM;oBACT,OAAO,aAAa,CAAC;gBACvB,KAAK,SAAS;oBACZ,OAAO,sBAAsB,CAAC;gBAChC,KAAK,SAAS;oBACZ,OAAO,cAAc,CAAC;gBACxB,KAAK,QAAQ;oBACX,OAAO,oBAAoB,CAAC;aAG/B;SACF,CAAC;KA4CH;IA9FC,YAAY,CAAC,QAA8B,EAAE,QAA+B;QAC1E,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,+CAA+C,QAAQ,CAAC,IAAI,CA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AAY,KAAK,UAAU,IAAI,6DAAM,KAAK,EAAC,mBAAmB,GAAQ,EAC5E,6DAAM,KAAK,EAAC,oBAAoB,IAC9B,gEAAS,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,GAAY,CACpC,EACP,4DAAK,KAAK,EAAC,uBAAuB,IAChC,6DAAM,KAAK,EAAC,4BAA4B,IACtC,8DAAa,CACR,EACN,IAAI,CAAC,UAAU,IAAI;YAClB,YAAM,KAAK,EAAC,iCAAiC,EAAC,GAAG,EAAC,mBAAmB,GAAQ;YAC7E,YAAM,KAAK,EAAC,oCAAoC,EAAC,GAAG,EAAC,sBAAsB,IACzE,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACvB;SACR,CACG,CACE,CACN,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["ClassList","toString"],"sources":["src/components/molecules/mg-message/mg-message.conf.ts","../styles/dist/components/mg-message.css?tag=mg-message&encapsulation=shadow","src/components/molecules/mg-message/mg-message.tsx"],"sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n","/*!\n * @prop --mg-c-message-border-radius: Defines the border radius of the message. Default value: `--mg-b-size-radius`.\n */:host{--mg-c-card-spacing: 0;--mg-c-card-border-radius: var(--mg-c-message-border-radius);--mg-c-card-border: none;--mg-c-card-overflow: hidden}.mg-c-message{display:inline-block;min-height:var(--mg-b-size-min-height)}.mg-c-message.mg-c-message--danger .mg-c-message__icon{color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-danger)}.mg-c-message.mg-c-message--danger.mg-c-message--background{--mg-c-card-color-background: var(--mg-b-color-red-20, color-mix(in srgb, var(--mg-b-color-danger), white 80%))}.mg-c-message.mg-c-message--info .mg-c-message__icon{color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-info)}.mg-c-message.mg-c-message--info.mg-c-message--background{--mg-c-card-color-background: var(--mg-b-color-blue-20, color-mix(in srgb, var(--mg-b-color-info), white 80%))}.mg-c-message.mg-c-message--success .mg-c-message__icon{color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-success)}.mg-c-message.mg-c-message--success.mg-c-message--background{--mg-c-card-color-background: var(--mg-b-color-green-20, color-mix(in srgb, var(--mg-b-color-success), white 80%))}.mg-c-message.mg-c-message--warning .mg-c-message__icon{color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--bar-left .mg-c-message__bar{background-color:var(--mg-b-color-warning)}.mg-c-message.mg-c-message--warning.mg-c-message--background{--mg-c-card-color-background: var(--mg-b-color-yellow-20, color-mix(in srgb, var(--mg-b-color-warning), white 80%))}.mg-c-message ::slotted(*){padding:0;margin:0}.mg-c-message__icon{position:absolute;top:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2);left:calc(var(--mg-b-size-4) + var(--mg-b-size-8));line-height:1}.mg-c-message__content{display:flex;flex-wrap:wrap;padding:0 var(--mg-b-size-8) 0 calc(var(--mg-b-size-4) + var(--mg-b-size-8) + var(--mg-b-size-16) + var(--mg-b-size-8));place-content:stretch flex-end}.mg-c-message__content-slot{flex-grow:1;margin:var(--mg-b-size-8) 0}.mg-c-message__content-separator{display:inline-block;width:var(--mg-b-size-40);height:0}.mg-c-message__content-actions-slot{padding:var(--mg-b-size-8) 0;text-align:right}.mg-c-message__bar{position:absolute;top:0;left:0;width:var(--mg-b-size-4);height:100%}.mg-c-message ::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}.mg-c-message,.mg-c-message mg-message{max-width:100%}/*# sourceMappingURL=mg-message.css.map */\n","import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-message.conf';\nimport { type MgIcon } from '../../atoms/mg-icon/mg-icon';\n\n/**\n * @slot - Message content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-message',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-message.css',\n shadow: true,\n})\nexport class MgMessage {\n /************\n * Internal *\n ************/\n\n private readonly classBase = 'mg-c-message';\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgMessageElement;\n\n /**\n * Define variant\n */\n @Prop() variant: VariantType = 'info';\n @Watch('variant')\n watchVariant(newValue: MgMessage['variant'], oldValue?: MgMessage['variant']): void {\n if (!variants.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (newValue !== undefined) this.classCollection.add(`${this.classBase}--${newValue}`);\n if (oldValue !== undefined) this.classCollection.delete(`${this.classBase}--${oldValue}`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle: VariantStyleType = 'bar-left';\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgMessage['variantStyle'], oldValue?: MgMessage['variantStyle']): void {\n if (!variantStyles.includes(newValue)) {\n throw new Error(`<mg-message> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (newValue !== undefined) this.classCollection.add(`${this.classBase}--${newValue}`);\n if (oldValue !== undefined) this.classCollection.delete(`${this.classBase}--${oldValue}`);\n }\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-message']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Get icon corresponding to variant\n * @returns icon\n */\n private getIcon = (): MgIcon['icon'] => {\n switch (this.variant) {\n case 'info':\n return 'info-circle';\n case 'warning':\n return 'exclamation-triangle';\n case 'success':\n return 'check-circle';\n case 'danger':\n return 'exclamation-circle';\n default:\n break;\n }\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <div class={this.classCollection.join()}>\n <mg-card>\n {this.variantStyle === 'bar-left' && <span class=\"mg-c-message__bar\"></span>}\n <span class=\"mg-c-message__icon\">\n <mg-icon icon={this.getIcon()}></mg-icon>\n </span>\n <div class=\"mg-c-message__content\">\n <span class=\"mg-c-message__content-slot\">\n <slot></slot>\n </span>\n {this.hasActions && [\n <span class=\"mg-c-message__content-separator\" key=\"content-separator\"></span>,\n <span class=\"mg-c-message__content-actions-slot\" key=\"content-actions-slot\">\n <slot name=\"actions\"></slot>\n </span>,\n ]}\n </div>\n </mg-card>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { G as Ge, Z as Ze, X as Xe, V as Ve, m as me } 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';
|
|
@@ -10,7 +10,7 @@ import { d as defineCustomElement$2 } from './mg-icon2.js';
|
|
|
10
10
|
*/
|
|
11
11
|
const dialogRoles = ['dialog', 'alertdialog'];
|
|
12
12
|
|
|
13
|
-
const mgModalCss = "/*!\n * @prop --mg-c-modal-border-radius: Defines the border radius of the modal. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-modal-title-font-size: Defines the font size of the modal title. Default value: `--mg-b-font-size-h3`.\n */:host{--mg-c-card-border-radius:var(--mg-c-modal-border-radius);--mg-c-card-spacing:var(--mg-b-size-16) var(--mg-b-size-24);--mg-c-card-border:none}.mg-c-modal{border:none;background:none}.mg-c-modal[open]{display:flex;padding:var(--mg-b-size-24) var(--mg-b-size-8)}.mg-c-modal::backdrop{background-color:var(--mg-b-color-light);opacity:.85}.mg-c-modal mg-card{display:flex;width:calc(75*var(--mg-b-size-8));max-width:100%;max-height:100%}.mg-c-modal__dialog{position:relative;display:flex;height:fit-content;max-height:100%;flex-direction:column;align-self:center;row-gap:var(--mg-b-size-24)}.mg-c-modal__title{margin:0;font-family:var(--mg-b-font-family-heading);font-size:var(--mg-c-modal-title-font-size);font-weight:600}.mg-c-modal__close-button{height:var(--mg-c-modal-title-font-size);margin-top:calc((var(--mg-b-size-min-height) - var(--mg-c-modal-title-font-size)*var(--mg-b-line-height))/2*-1);margin-right:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2*-1);margin-left:var(--mg-b-size-16);float:right}.mg-c-modal__content{padding:var(--mg-b-size-16);margin:calc(var(--mg-b-size-16)*-1);overflow-y:auto}.mg-c-modal ::slotted(
|
|
13
|
+
const mgModalCss = "/*!\n * @prop --mg-c-modal-border-radius: Defines the border radius of the modal. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-modal-title-font-size: Defines the font size of the modal title. Default value: `--mg-b-font-size-h3`.\n */:host{--mg-c-card-border-radius:var(--mg-c-modal-border-radius);--mg-c-card-spacing:var(--mg-b-size-16) var(--mg-b-size-24);--mg-c-card-border:none}.mg-c-modal{border:none;background:none}.mg-c-modal[open]{display:flex;padding:var(--mg-b-size-24) var(--mg-b-size-8)}.mg-c-modal::backdrop{background-color:var(--mg-b-color-light);opacity:.85}.mg-c-modal mg-card{display:flex;width:calc(75*var(--mg-b-size-8));max-width:100%;max-height:100%}.mg-c-modal__dialog{position:relative;display:flex;height:fit-content;max-height:100%;flex-direction:column;align-self:center;row-gap:var(--mg-b-size-24)}.mg-c-modal__title{margin:0;font-family:var(--mg-b-font-family-heading);font-size:var(--mg-c-modal-title-font-size);font-weight:600}.mg-c-modal__close-button{height:var(--mg-c-modal-title-font-size);margin-top:calc((var(--mg-b-size-min-height) - var(--mg-c-modal-title-font-size)*var(--mg-b-line-height))/2*-1);margin-right:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2*-1);margin-left:var(--mg-b-size-16);float:right}.mg-c-modal__content{padding:var(--mg-b-size-16);margin:calc(var(--mg-b-size-16)*-1);overflow-y:auto}.mg-c-modal ::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}";
|
|
14
14
|
const MgModalStyle0 = mgModalCss;
|
|
15
15
|
|
|
16
16
|
const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLElement {
|
|
@@ -27,7 +27,7 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
27
27
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
28
28
|
* If not set, it will be created.
|
|
29
29
|
*/
|
|
30
|
-
this.identifier =
|
|
30
|
+
this.identifier = Ge('mg-modal');
|
|
31
31
|
/**
|
|
32
32
|
* Modal dialog role.
|
|
33
33
|
*/
|
|
@@ -47,7 +47,7 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
47
47
|
/**
|
|
48
48
|
* Component classes
|
|
49
49
|
*/
|
|
50
|
-
this.classCollection = new
|
|
50
|
+
this.classCollection = new Ze(['mg-c-modal']);
|
|
51
51
|
/***********
|
|
52
52
|
* Handles *
|
|
53
53
|
***********/
|
|
@@ -60,17 +60,17 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
watchIdentifier(newValue) {
|
|
63
|
-
if (!
|
|
64
|
-
throw new Error(`<mg-modal> prop "identifier" value is invalid. Passed value: ${
|
|
63
|
+
if (!Xe(newValue)) {
|
|
64
|
+
throw new Error(`<mg-modal> prop "identifier" value is invalid. Passed value: ${Ve(newValue)}.`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
validateDialogRole(newValue) {
|
|
68
68
|
if (!dialogRoles.includes(newValue))
|
|
69
|
-
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}. Passed value: ${
|
|
69
|
+
throw new Error(`<mg-modal> prop "dialogRole" must be one of: ${dialogRoles.join(', ')}. Passed value: ${Ve(newValue)}.`);
|
|
70
70
|
}
|
|
71
71
|
validateModalTitle(newValue) {
|
|
72
|
-
if (!
|
|
73
|
-
throw new Error(`<mg-modal> prop "modalTitle" is required. Passed value: ${
|
|
72
|
+
if (!me(newValue)) {
|
|
73
|
+
throw new Error(`<mg-modal> prop "modalTitle" is required. Passed value: ${Ve(newValue)}.`);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
watchOpen(newValue) {
|
|
@@ -119,11 +119,11 @@ const MgModal$1 = /*@__PURE__*/ proxyCustomElement(class MgModal extends HTMLEle
|
|
|
119
119
|
* @returns HTML Element
|
|
120
120
|
*/
|
|
121
121
|
render() {
|
|
122
|
-
return (h("dialog", { key: '
|
|
122
|
+
return (h("dialog", { key: 'd9bc9c48122e4a607122ad62afb1229061860e70', role: this.dialogRole, id: this.identifier, class: this.classCollection.join(), "aria-labelledby": this.titleId, ref: (el) => {
|
|
123
123
|
if (el !== null) {
|
|
124
124
|
this.dialog = el;
|
|
125
125
|
}
|
|
126
|
-
} }, h("mg-card", { key: '
|
|
126
|
+
} }, h("mg-card", { key: 'fdddd50b0d87d50025eb65297ffdde890db84daa' }, h("div", { key: 'a168d0ec2be896b381ed6079f2f50f0e06fbef0c', class: "mg-c-modal__dialog" }, h("header", { key: 'f6c902fb1c424d14a0cf36fbe6904137e1f25a77', class: "mg-c-modal__header" }, this.closeButton && (h("span", { key: '3bfd0399c679cd4695b7ec6baf93852f551f500f', class: "mg-c-modal__close-button" }, h("mg-button", { key: '65d9a1001c74869bde17c5b10e4d7f6d40927d5c', "is-icon": true, variant: "flat", label: this.messages.modal.closeButton, onClick: this.handleClose }, h("mg-icon", { key: '4afd89c06bb4667d03dc8f57cafc2de937989539', icon: "cross" })))), h("h1", { key: '0e8714311653249fc9f567072bb83a82f40be657', class: "mg-c-modal__title", id: this.titleId }, this.modalTitle)), h("article", { key: '8bea86261d774672f59161b8356d88bb8ce6934f', class: "mg-c-modal__content" }, h("slot", { key: 'e1be91919ea7c4c6564bdab5fd4637a1f70670af' })), this.hasActions && (h("footer", { key: 'ed52ba51f38a5638e8ab525863631304ec32e4f8', class: "mg-c-modal__footer" }, h("slot", { key: '2ea047455de5f22876a0fc97e95321360aa55b33', name: "actions" })))))));
|
|
127
127
|
}
|
|
128
128
|
get element() { return this; }
|
|
129
129
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"mg-modal.js","mappings":";;;;;;;AAAA;;;AAGO,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAU;;ACH7D,MAAM,UAAU,GAAG,stDAAstD,CAAC;AAC1uD,sBAAe,UAAU;;MCaZA,SAAO;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CAAC,EAAqB;gBACzB,IAAI,EAAE,KAAK,IAAI,EAAE;oBACf,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;iBAClB;aACF,IAED,kEACE,4DAAK,KAAK,EAAC,oBAAoB,IAC7B,+DAAQ,KAAK,EAAC,oBAAoB,IAC/B,IAAI,CAAC,WAAW,KACf,6DAAM,KAAK,EAAC,0BAA0B,IACpC,mFAAmB,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,IACjG,gEAAS,IAAI,EAAC,OAAO,GAAW,CACtB,CACP,CACR,EACD,2DAAI,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,IAC3C,IAAI,CAAC,UAAU,CACb,CACE,EACT,gEAAS,KAAK,EAAC,qBAAqB,IAClC,8DAAa,CACL,EACT,IAAI,CAAC,UAAU,KACd,+DAAQ,KAAK,EAAC,oBAAoB,IAChC,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACrB,CACV,CACG,CACE,CACH,EACT;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgModal","createID","ClassList","isValideID","toString","isValidString"],"sources":["src/components/molecules/mg-modal/mg-modal.conf.ts","../styles/dist/components/mg-modal.css?tag=mg-modal&encapsulation=shadow","src/components/molecules/mg-modal/mg-modal.tsx"],"sourcesContent":["/**\n * List of all possibles dialog roles\n */\nexport const dialogRoles = ['dialog', 'alertdialog'] as const;\n\n/**\n * DialogRole type from dialog roles\n */\nexport type DialogRoleType = (typeof dialogRoles)[number];\n","/*!\n * @prop --mg-c-modal-border-radius: Defines the border radius of the modal. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-modal-title-font-size: Defines the font size of the modal title. Default value: `--mg-b-font-size-h3`.\n */:host{--mg-c-card-border-radius: var(--mg-c-modal-border-radius);--mg-c-card-spacing: var(--mg-b-size-16) var(--mg-b-size-24);--mg-c-card-border: none}.mg-c-modal{border:none;background:none}.mg-c-modal[open]{display:flex;padding:var(--mg-b-size-24) var(--mg-b-size-8)}.mg-c-modal::backdrop{background-color:var(--mg-b-color-light);opacity:.85}.mg-c-modal mg-card{display:flex;width:calc(75*var(--mg-b-size-8));max-width:100%;max-height:100%}.mg-c-modal__dialog{position:relative;display:flex;height:fit-content;max-height:100%;flex-direction:column;align-self:center;row-gap:var(--mg-b-size-24)}.mg-c-modal__title{margin:0;font-family:var(--mg-b-font-family-heading);font-size:var(--mg-c-modal-title-font-size);font-weight:600}.mg-c-modal__close-button{height:var(--mg-c-modal-title-font-size);margin-top:calc((var(--mg-b-size-min-height) - var(--mg-c-modal-title-font-size)*var(--mg-b-line-height))/2*-1);margin-right:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2*-1);margin-left:var(--mg-b-size-16);float:right}.mg-c-modal__content{padding:var(--mg-b-size-16);margin:calc(var(--mg-b-size-16)*-1);overflow-y:auto}.mg-c-modal ::slotted(*){--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}/*# sourceMappingURL=mg-modal.css.map */\n","import { Component, h, Prop, State, Watch, Element, Event, EventEmitter } from '@stencil/core';\nimport { createID, ClassList, isValidString, toString, isValideID } from '@mgdis/stencil-helpers';\nimport { initLocales } from '../../../locales';\nimport { DialogRoleType, dialogRoles } from './mg-modal.conf';\n\n/**\n * @slot - Modal content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-modal',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-modal.css',\n shadow: true,\n})\nexport class MgModal {\n /************\n * Internal *\n ************/\n\n // Modal focusable elements\n private dialog: HTMLDialogElement;\n\n // IDs\n private titleId = '';\n\n // Locales\n private messages;\n\n // body overflow default\n private bodyOverflow: string;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgModalElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-modal');\n @Watch('identifier')\n watchIdentifier(newValue: MgModal['identifier']): void {\n if (!isValideID(newValue)) {\n throw new Error(`<mg-modal> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Modal dialog role.\n */\n @Prop() dialogRole: DialogRoleType = dialogRoles[0];\n @Watch('dialogRole')\n validateDialogRole(newValue: MgModal['dialogRole']): void {\n if (!dialogRoles.includes(newValue)) throw new Error(`<mg-modal> prop \"dialogRole\" must be one of: ${dialogRoles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Displayed modal title\n */\n @Prop() modalTitle!: string;\n @Watch('modalTitle')\n validateModalTitle(newValue: MgModal['modalTitle']): void {\n if (!isValidString(newValue)) {\n throw new Error(`<mg-modal> prop \"modalTitle\" is required. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define if modal has a cross button\n */\n @Prop() closeButton = false;\n\n /**\n * Define if modal is open\n */\n @Prop({ mutable: true }) open = false;\n @Watch('open')\n watchOpen(newValue: boolean): void {\n if (newValue) {\n this.dialog.showModal();\n this.componentShow.emit();\n document.body.style.overflow = 'hidden';\n } else {\n this.dialog.close();\n this.componentHide.emit();\n document.body.style.overflow = this.bodyOverflow;\n }\n }\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-modal']);\n\n /**\n * Emmited event when modal is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emmited event when modal is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Emmited event when modal is closed\n */\n @Event({ eventName: 'component-close' }) componentClose: EventEmitter<void>;\n\n /***********\n * Handles *\n ***********/\n\n /**\n * Closes the modal.\n */\n private handleClose = (): void => {\n this.open = false;\n this.componentClose.emit();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Store body overflow\n this.bodyOverflow = document.body.style.overflow;\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n this.titleId = `${this.identifier}-title`;\n this.watchIdentifier(this.identifier);\n this.validateModalTitle(this.modalTitle);\n this.validateDialogRole(this.dialogRole);\n }\n\n /**\n * Define open state on component load\n */\n componentDidLoad(): void {\n this.watchOpen(this.open);\n // update open prop when use escape key\n this.dialog.addEventListener('close', () => {\n this.open = false;\n this.componentClose.emit();\n });\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <dialog\n role={this.dialogRole}\n id={this.identifier}\n class={this.classCollection.join()}\n aria-labelledby={this.titleId}\n ref={(el: HTMLDialogElement) => {\n if (el !== null) {\n this.dialog = el;\n }\n }}\n >\n <mg-card>\n <div class=\"mg-c-modal__dialog\">\n <header class=\"mg-c-modal__header\">\n {this.closeButton && (\n <span class=\"mg-c-modal__close-button\">\n <mg-button is-icon variant=\"flat\" label={this.messages.modal.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n <h1 class=\"mg-c-modal__title\" id={this.titleId}>\n {this.modalTitle}\n </h1>\n </header>\n <article class=\"mg-c-modal__content\">\n <slot></slot>\n </article>\n {this.hasActions && (\n <footer class=\"mg-c-modal__footer\">\n <slot name=\"actions\"></slot>\n </footer>\n )}\n </div>\n </mg-card>\n </dialog>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"mg-modal.js","mappings":";;;;;;;AAAA;;;AA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rB,EAAE,EAAE,IAAI,CAAC,UAAU,EACnB,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,qBACjB,IAAI,CAAC,OAAO,EAC7B,GAAG,EAAE,CAAC,EAAqB;gBACzB,IAAI,EAAE,KAAK,IAAI,EAAE;oBACf,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;iBAClB;aACF,IAED,kEACE,4DAAK,KAAK,EAAC,oBAAoB,IAC7B,+DAAQ,KAAK,EAAC,oBAAoB,IAC/B,IAAI,CAAC,WAAW,KACf,6DAAM,KAAK,EAAC,0BAA0B,IACpC,mFAAmB,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,IACjG,gEAAS,IAAI,EAAC,OAAO,GAAW,CACtB,CACP,CACR,EACD,2DAAI,KAAK,EAAC,mBAAmB,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,IAC3C,IAAI,CAAC,UAAU,CACb,CACE,EACT,gEAAS,KAAK,EAAC,qBAAqB,IAClC,8DAAa,CACL,EACT,IAAI,CAAC,UAAU,KACd,+DAAQ,KAAK,EAAC,oBAAoB,IAChC,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACrB,CACV,CACG,CACE,CACH,EACT;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgModal","createID","ClassList","isValideID","toString","isValidString"],"sources":["src/components/molecules/mg-modal/mg-modal.conf.ts","../styles/dist/components/mg-modal.css?tag=mg-modal&encapsulation=shadow","src/components/molecules/mg-modal/mg-modal.tsx"],"sourcesContent":["/**\n * List of all possibles dialog roles\n */\nexport const dialogRoles = ['dialog', 'alertdialog'] as const;\n\n/**\n * DialogRole type from dialog roles\n */\nexport type DialogRoleType = (typeof dialogRoles)[number];\n","/*!\n * @prop --mg-c-modal-border-radius: Defines the border radius of the modal. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-modal-title-font-size: Defines the font size of the modal title. Default value: `--mg-b-font-size-h3`.\n */:host{--mg-c-card-border-radius: var(--mg-c-modal-border-radius);--mg-c-card-spacing: var(--mg-b-size-16) var(--mg-b-size-24);--mg-c-card-border: none}.mg-c-modal{border:none;background:none}.mg-c-modal[open]{display:flex;padding:var(--mg-b-size-24) var(--mg-b-size-8)}.mg-c-modal::backdrop{background-color:var(--mg-b-color-light);opacity:.85}.mg-c-modal mg-card{display:flex;width:calc(75*var(--mg-b-size-8));max-width:100%;max-height:100%}.mg-c-modal__dialog{position:relative;display:flex;height:fit-content;max-height:100%;flex-direction:column;align-self:center;row-gap:var(--mg-b-size-24)}.mg-c-modal__title{margin:0;font-family:var(--mg-b-font-family-heading);font-size:var(--mg-c-modal-title-font-size);font-weight:600}.mg-c-modal__close-button{height:var(--mg-c-modal-title-font-size);margin-top:calc((var(--mg-b-size-min-height) - var(--mg-c-modal-title-font-size)*var(--mg-b-line-height))/2*-1);margin-right:calc((var(--mg-b-size-min-height) - var(--mg-b-size-16))/2*-1);margin-left:var(--mg-b-size-16);float:right}.mg-c-modal__content{padding:var(--mg-b-size-16);margin:calc(var(--mg-b-size-16)*-1);overflow-y:auto}.mg-c-modal ::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}/*# sourceMappingURL=mg-modal.css.map */\n","import { Component, h, Prop, State, Watch, Element, Event, EventEmitter } from '@stencil/core';\nimport { createID, ClassList, isValidString, toString, isValideID } from '@mgdis/stencil-helpers';\nimport { initLocales } from '../../../locales';\nimport { DialogRoleType, dialogRoles } from './mg-modal.conf';\n\n/**\n * @slot - Modal content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-modal',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-modal.css',\n shadow: true,\n})\nexport class MgModal {\n /************\n * Internal *\n ************/\n\n // Modal focusable elements\n private dialog: HTMLDialogElement;\n\n // IDs\n private titleId = '';\n\n // Locales\n private messages;\n\n // body overflow default\n private bodyOverflow: string;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgModalElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-modal');\n @Watch('identifier')\n watchIdentifier(newValue: MgModal['identifier']): void {\n if (!isValideID(newValue)) {\n throw new Error(`<mg-modal> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Modal dialog role.\n */\n @Prop() dialogRole: DialogRoleType = dialogRoles[0];\n @Watch('dialogRole')\n validateDialogRole(newValue: MgModal['dialogRole']): void {\n if (!dialogRoles.includes(newValue)) throw new Error(`<mg-modal> prop \"dialogRole\" must be one of: ${dialogRoles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Displayed modal title\n */\n @Prop() modalTitle!: string;\n @Watch('modalTitle')\n validateModalTitle(newValue: MgModal['modalTitle']): void {\n if (!isValidString(newValue)) {\n throw new Error(`<mg-modal> prop \"modalTitle\" is required. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define if modal has a cross button\n */\n @Prop() closeButton = false;\n\n /**\n * Define if modal is open\n */\n @Prop({ mutable: true }) open = false;\n @Watch('open')\n watchOpen(newValue: boolean): void {\n if (newValue) {\n this.dialog.showModal();\n this.componentShow.emit();\n document.body.style.overflow = 'hidden';\n } else {\n this.dialog.close();\n this.componentHide.emit();\n document.body.style.overflow = this.bodyOverflow;\n }\n }\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-modal']);\n\n /**\n * Emmited event when modal is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emmited event when modal is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Emmited event when modal is closed\n */\n @Event({ eventName: 'component-close' }) componentClose: EventEmitter<void>;\n\n /***********\n * Handles *\n ***********/\n\n /**\n * Closes the modal.\n */\n private handleClose = (): void => {\n this.open = false;\n this.componentClose.emit();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Store body overflow\n this.bodyOverflow = document.body.style.overflow;\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n this.titleId = `${this.identifier}-title`;\n this.watchIdentifier(this.identifier);\n this.validateModalTitle(this.modalTitle);\n this.validateDialogRole(this.dialogRole);\n }\n\n /**\n * Define open state on component load\n */\n componentDidLoad(): void {\n this.watchOpen(this.open);\n // update open prop when use escape key\n this.dialog.addEventListener('close', () => {\n this.open = false;\n this.componentClose.emit();\n });\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <dialog\n role={this.dialogRole}\n id={this.identifier}\n class={this.classCollection.join()}\n aria-labelledby={this.titleId}\n ref={(el: HTMLDialogElement) => {\n if (el !== null) {\n this.dialog = el;\n }\n }}\n >\n <mg-card>\n <div class=\"mg-c-modal__dialog\">\n <header class=\"mg-c-modal__header\">\n {this.closeButton && (\n <span class=\"mg-c-modal__close-button\">\n <mg-button is-icon variant=\"flat\" label={this.messages.modal.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n <h1 class=\"mg-c-modal__title\" id={this.titleId}>\n {this.modalTitle}\n </h1>\n </header>\n <article class=\"mg-c-modal__content\">\n <slot></slot>\n </article>\n {this.hasActions && (\n <footer class=\"mg-c-modal__footer\">\n <slot name=\"actions\"></slot>\n </footer>\n )}\n </div>\n </mg-card>\n </dialog>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { G as Ge, X as Xe, V as Ve } 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';
|
|
@@ -49,7 +49,7 @@ const MgPagination = /*@__PURE__*/ proxyCustomElement(class MgPagination extends
|
|
|
49
49
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
50
50
|
* If not set, it will be created.
|
|
51
51
|
*/
|
|
52
|
-
this.identifier =
|
|
52
|
+
this.identifier = Ge('mg-pagination');
|
|
53
53
|
/**
|
|
54
54
|
* Component total pages
|
|
55
55
|
*/
|
|
@@ -86,18 +86,18 @@ const MgPagination = /*@__PURE__*/ proxyCustomElement(class MgPagination extends
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
watchIdentifier(newValue) {
|
|
89
|
-
if (!
|
|
90
|
-
console.error(`<mg-pagination> prop "identifier" value is invalid. Passed value: ${
|
|
89
|
+
if (!Xe(newValue)) {
|
|
90
|
+
console.error(`<mg-pagination> prop "identifier" value is invalid. Passed value: ${Ve(newValue)}.`);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
validateTotalPages(newValue) {
|
|
94
94
|
if (newValue < 1) {
|
|
95
|
-
throw new Error(`<mg-pagination> prop "totalPages" must be greater than 0. Passed value: ${
|
|
95
|
+
throw new Error(`<mg-pagination> prop "totalPages" must be greater than 0. Passed value: ${Ve(newValue)}.`);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
validateCurrentPage(newValue) {
|
|
99
99
|
if (newValue < 1) {
|
|
100
|
-
throw new Error(`<mg-pagination> prop "currentPage" must be greater than 0. Passed value: ${
|
|
100
|
+
throw new Error(`<mg-pagination> prop "currentPage" must be greater than 0. Passed value: ${Ve(newValue)}.`);
|
|
101
101
|
}
|
|
102
102
|
else if (newValue > this.totalPages) {
|
|
103
103
|
throw new Error('<mg-pagination> prop "currentPage" can not be greater than total page.');
|
|
@@ -127,10 +127,10 @@ const MgPagination = /*@__PURE__*/ proxyCustomElement(class MgPagination extends
|
|
|
127
127
|
* @returns HTML Element
|
|
128
128
|
*/
|
|
129
129
|
render() {
|
|
130
|
-
const navigationActionButton = (disabled, action) => (h("mg-button", { key: '
|
|
130
|
+
const navigationActionButton = (disabled, action) => (h("mg-button", { key: 'adf311f317e6d071e73e6ee11f323f2957a6c7c5', label: this.messages.pagination[`${action}Page`],
|
|
131
131
|
// eslint-disable-next-line react/jsx-no-bind
|
|
132
|
-
onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && h("mg-icon", { key: '
|
|
133
|
-
return (h(Host, { key: '
|
|
132
|
+
onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && h("mg-icon", { key: '23cd025ff4d5085f60a762ca02bec7ea4d08b47a', icon: "chevron-left" }), !this.hideNavigationLabels && this.messages.general[action], action === NavigationAction.NEXT && h("mg-icon", { key: '5e178d7571d840b691349999a0dc9986ea9a97d1', icon: "chevron-right" })));
|
|
133
|
+
return (h(Host, { key: '549c2a5e08db08ff4db40f283dc941e3c918aa48', hidden: this.totalPages < 2 }, h("nav", { key: '6dad6fcdc86313bd8a89a253bf8b34417b5d7a9b', role: "navigation", "aria-label": this.label, id: this.identifier, class: { 'mg-c-pagination': true, 'mg-c-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (h("div", { key: '779c725432c4e35c82a25c9b48619b30d94aa3fd', class: "mg-c-pagination__page-count" }, h("mg-input-select", { key: '9ebbb2eb315ceb906b87c1866a2230a07fc456eb', identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true }), h("span", { key: '562ef9a11ec557bf498ac4d62be095cbc4c71d22', class: "mg-u-visually-hidden" }, this.messages.pagination.page, " ", this.currentPage), "/ ", this.totalPages, " ", this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page)), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT))));
|
|
134
134
|
}
|
|
135
135
|
get element() { return this; }
|
|
136
136
|
static get watchers() { return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { G as Ge, Z as Ze, X as Xe, V as Ve, m as me } 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';
|
|
@@ -20,7 +20,7 @@ const expandToggleDisplays = ['text', 'icon'];
|
|
|
20
20
|
*/
|
|
21
21
|
const titlePositions = ['left', 'right'];
|
|
22
22
|
|
|
23
|
-
const mgPanelCss = "/*!\n * @prop --mg-c-panel-border-radius: Defines the border radius of the panel. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-panel-color-background: Defines the background of the panel. Default value: `color-mix(in srgb, var(--mg-b-color-info), white 97%)`.\n * @prop --mg-c-panel-box-shadow: Defines the box shadow of the panel. Default value: `--mg-b-box-shadow`.\n * @prop --mg-c-panel-content-spacing: Defines the padding of the panel content. Default value: `--mg-b-size-16`.\n */:host{--mg-c-card-border:none;--mg-c-card-spacing:0;--mg-c-card-border-radius:var(--mg-c-panel-border-radius);--mg-c-card-color-background:var(--mg-c-panel-color-background);--mg-c-card-box-shadow:var(--mg-c-panel-box-shadow)}.mg-c-panel__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;padding:0 var(--mg-b-size-4)}.mg-c-panel__header-title,.mg-c-panel__header-content{display:flex;margin:var(--mg-b-size-4) 0}.mg-c-panel__header-content{min-height:var(--mg-b-size-min-height);flex:1 auto;align-items:center;padding-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-input-text{flex-grow:1;margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title.mg-c-panel__header-title--full{flex:1 1 auto}.mg-c-panel__collapse-button-content{--mg-b-font-size:var(--mg-b-font-size-h5);--mg-c-button-font-weight:600}.mg-c-panel__collapse-button-icon.mg-c-panel__collapse-button-icon--reverse{transform:rotate(180deg)}.mg-c-panel__content{padding:var(--mg-c-panel-content-spacing)}.mg-c-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;margin-left:auto;gap:var(--mg-b-spacing-actions)}.mg-c-panel ::slotted(
|
|
23
|
+
const mgPanelCss = "/*!\n * @prop --mg-c-panel-border-radius: Defines the border radius of the panel. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-panel-color-background: Defines the background of the panel. Default value: `color-mix(in srgb, var(--mg-b-color-info), white 97%)`.\n * @prop --mg-c-panel-box-shadow: Defines the box shadow of the panel. Default value: `--mg-b-box-shadow`.\n * @prop --mg-c-panel-content-spacing: Defines the padding of the panel content. Default value: `--mg-b-size-16`.\n */:host{--mg-c-card-border:none;--mg-c-card-spacing:0;--mg-c-card-border-radius:var(--mg-c-panel-border-radius);--mg-c-card-color-background:var(--mg-c-panel-color-background);--mg-c-card-box-shadow:var(--mg-c-panel-box-shadow)}.mg-c-panel__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;padding:0 var(--mg-b-size-4)}.mg-c-panel__header-title,.mg-c-panel__header-content{display:flex;margin:var(--mg-b-size-4) 0}.mg-c-panel__header-content{min-height:var(--mg-b-size-min-height);flex:1 auto;align-items:center;padding-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-input-text{flex-grow:1;margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title.mg-c-panel__header-title--full{flex:1 1 auto}.mg-c-panel__collapse-button-content{--mg-b-font-size:var(--mg-b-font-size-h5);--mg-c-button-font-weight:600}.mg-c-panel__collapse-button-icon.mg-c-panel__collapse-button-icon--reverse{transform:rotate(180deg)}.mg-c-panel__content{padding:var(--mg-c-panel-content-spacing)}.mg-c-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;margin-left:auto;gap:var(--mg-b-spacing-actions)}.mg-c-panel ::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}";
|
|
24
24
|
const MgPanelStyle0 = mgPanelCss;
|
|
25
25
|
|
|
26
26
|
const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLElement {
|
|
@@ -34,7 +34,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
34
34
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
35
35
|
* If not set, it will be created.
|
|
36
36
|
*/
|
|
37
|
-
this.identifier =
|
|
37
|
+
this.identifier = Ge('mg-panel');
|
|
38
38
|
/**
|
|
39
39
|
* Define if panel title is editable
|
|
40
40
|
*/
|
|
@@ -54,7 +54,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
54
54
|
/**
|
|
55
55
|
* Component classes
|
|
56
56
|
*/
|
|
57
|
-
this.classCollection = new
|
|
57
|
+
this.classCollection = new Ze(['mg-c-panel']);
|
|
58
58
|
/**
|
|
59
59
|
* Title is in edition mode
|
|
60
60
|
*/
|
|
@@ -153,13 +153,13 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
watchIdentifier(newValue) {
|
|
156
|
-
if (!
|
|
157
|
-
console.error(`<mg-panel> prop "identifier" value is invalid. Passed value: ${
|
|
156
|
+
if (!Xe(newValue)) {
|
|
157
|
+
console.error(`<mg-panel> prop "identifier" value is invalid. Passed value: ${Ve(newValue)}.`);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
validatePanelTitle(newValue) {
|
|
161
|
-
if (!
|
|
162
|
-
throw new Error(`<mg-panel> prop "panelTitle" is required and must be a string. Passed value: ${
|
|
161
|
+
if (!me(newValue))
|
|
162
|
+
throw new Error(`<mg-panel> prop "panelTitle" is required and must be a string. Passed value: ${Ve(newValue)}.`);
|
|
163
163
|
this.titleChange.emit(newValue);
|
|
164
164
|
}
|
|
165
165
|
validateTitlePattern(newValue) {
|
|
@@ -168,14 +168,14 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
168
168
|
}
|
|
169
169
|
validateTitlePosition(newValue) {
|
|
170
170
|
if (!titlePositions.includes(newValue))
|
|
171
|
-
throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}. Passed value: ${
|
|
171
|
+
throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}. Passed value: ${Ve(newValue)}.`);
|
|
172
172
|
}
|
|
173
173
|
handleExpanded(newValue) {
|
|
174
174
|
this.expandedChange.emit(newValue);
|
|
175
175
|
}
|
|
176
176
|
validateExpandToggleDisplay(newValue) {
|
|
177
177
|
if (!expandToggleDisplays.includes(newValue))
|
|
178
|
-
throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${
|
|
178
|
+
throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${Ve(newValue)}.`);
|
|
179
179
|
if (newValue === 'icon' && this.titleEditable)
|
|
180
180
|
this.titleEditable = false;
|
|
181
181
|
}
|
|
@@ -210,7 +210,7 @@ const MgPanel$1 = /*@__PURE__*/ proxyCustomElement(class MgPanel extends HTMLEle
|
|
|
210
210
|
*/
|
|
211
211
|
render() {
|
|
212
212
|
const headerId = `${this.identifier}-header`;
|
|
213
|
-
return (h("section", { key: '
|
|
213
|
+
return (h("section", { key: 'ffe1c2453e1247f8a5a3c439f6f87fc1ceefe06b', class: this.classCollection.join(), id: this.identifier }, h("mg-card", { key: '77dfb890d2090af6eca0f332aaff07f737946f50' }, h("header", { key: '2c20eab45a175c8f176dd7c003fc336b4f98d058', class: { 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), h("article", { key: '2c359205023c9b25c2b88ae6aad404663330d3a5', class: "mg-c-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, h("slot", { key: 'f4c5ce16b3709529d5808a51c1d1f7a0677d82f2' })))));
|
|
214
214
|
}
|
|
215
215
|
get element() { return this; }
|
|
216
216
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"mg-panel.js","mappings":";;;;;;;;;;;;;AAAA;;;AAGO,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAO9D;;;AAGO,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;;ACbxD,MAAM,UAAU,GAAG,4jEAA4jE,CAAC;AAChlE,sBAAe,UAAU;;MCaZA,SAAO;I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","ClassList","isValideID","toString","isValidString"],"sources":["src/components/molecules/mg-panel/mg-panel.conf.ts","../styles/dist/components/mg-panel.css?tag=mg-panel&encapsulation=shadow","src/components/molecules/mg-panel/mg-panel.tsx"],"sourcesContent":["/**\n * Available expand toggle display options\n */\nexport const expandToggleDisplays = ['text', 'icon'] as const;\n\n/**\n * Generated expand toggle display type from available expand toggle display options\n */\nexport type ExpandToggleDisplayType = (typeof expandToggleDisplays)[number];\n\n/**\n * Available title positions\n */\nexport const titlePositions = ['left', 'right'] as const;\n\n/**\n * Generated title positions type from available title positions\n */\nexport type TitlePositionType = (typeof titlePositions)[number];\n","/*!\n * @prop --mg-c-panel-border-radius: Defines the border radius of the panel. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-panel-color-background: Defines the background of the panel. Default value: `color-mix(in srgb, var(--mg-b-color-info), white 97%)`.\n * @prop --mg-c-panel-box-shadow: Defines the box shadow of the panel. Default value: `--mg-b-box-shadow`.\n * @prop --mg-c-panel-content-spacing: Defines the padding of the panel content. Default value: `--mg-b-size-16`.\n */:host{--mg-c-card-border: none;--mg-c-card-spacing: 0;--mg-c-card-border-radius: var(--mg-c-panel-border-radius);--mg-c-card-color-background: var(--mg-c-panel-color-background);--mg-c-card-box-shadow: var(--mg-c-panel-box-shadow)}.mg-c-panel__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;padding:0 var(--mg-b-size-4)}.mg-c-panel__header-title,.mg-c-panel__header-content{display:flex;margin:var(--mg-b-size-4) 0}.mg-c-panel__header-content{min-height:var(--mg-b-size-min-height);flex:1 auto;align-items:center;padding-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-input-text{flex-grow:1;margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title.mg-c-panel__header-title--full{flex:1 1 auto}.mg-c-panel__collapse-button-content{--mg-b-font-size: var(--mg-b-font-size-h5);--mg-c-button-font-weight: 600}.mg-c-panel__collapse-button-icon.mg-c-panel__collapse-button-icon--reverse{transform:rotate(180deg)}.mg-c-panel__content{padding:var(--mg-c-panel-content-spacing)}.mg-c-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;margin-left:auto;gap:var(--mg-b-spacing-actions)}.mg-c-panel ::slotted(*){--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}/*# sourceMappingURL=mg-panel.css.map */\n","import { Component, Element, h, Prop, State, EventEmitter, Watch, Event } from '@stencil/core';\nimport { createID, ClassList, isValidString, toString, isValideID } from '@mgdis/stencil-helpers';\nimport { initLocales } from '../../../locales';\nimport { type ExpandToggleDisplayType, type TitlePositionType, expandToggleDisplays, titlePositions } from './mg-panel.conf';\n\n/**\n * @slot - Panel content\n * @slot header-right - Header right panel content\n */\n@Component({\n tag: 'mg-panel',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-panel.css',\n shadow: true,\n})\nexport class MgPanel {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private editInputElement: HTMLMgInputTextElement;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPanelElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-panel');\n @Watch('identifier')\n watchIdentifier(newValue: MgPanel['identifier']): void {\n if (!isValideID(newValue)) {\n console.error(`<mg-panel> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Panel title\n */\n @Prop({ mutable: true }) panelTitle!: string;\n @Watch('panelTitle')\n validatePanelTitle(newValue: MgPanel['panelTitle']): void {\n if (!isValidString(newValue)) throw new Error(`<mg-panel> prop \"panelTitle\" is required and must be a string. Passed value: ${toString(newValue)}.`);\n this.titleChange.emit(newValue);\n }\n\n /**\n * Panel title pattern\n */\n @Prop() titlePattern?: string;\n\n /**\n * Panel title pattern error message\n */\n @Prop() titlePatternErrorMessage?: string;\n @Watch('titlePattern')\n @Watch('titlePatternErrorMessage')\n validateTitlePattern(newValue: string): void {\n if (newValue !== undefined && !this.titleEditable) throw new Error(`<mg-panel> prop \"titleEditable\" must be set to \"true\".`);\n }\n\n /**\n * Define if panel title is editable\n */\n @Prop({ mutable: true }) titleEditable = false;\n\n /**\n * Define title position\n */\n @Prop() titlePosition: TitlePositionType = titlePositions[0];\n @Watch('titlePosition')\n validateTitlePosition(newValue: MgPanel['titlePosition']) {\n if (!titlePositions.includes(newValue)) throw new Error(`<mg-panel> prop \"titlePosition\" must be one of: ${titlePositions.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Panel is opened\n */\n @Prop({ mutable: true }) expanded = false;\n @Watch('expanded')\n handleExpanded(newValue: MgPanel['expanded']): void {\n this.expandedChange.emit(newValue);\n }\n\n /**\n * Define expand toggle button display\n */\n @Prop() expandToggleDisplay: ExpandToggleDisplayType = expandToggleDisplays[0];\n @Watch('expandToggleDisplay')\n validateExpandToggleDisplay(newValue: MgPanel['expandToggleDisplay']) {\n if (!expandToggleDisplays.includes(newValue))\n throw new Error(`<mg-panel> prop \"expandToggleDisplay\" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${toString(newValue)}.`);\n if (newValue === 'icon' && this.titleEditable) this.titleEditable = false;\n }\n\n /**\n * Disable possibility to toggle expand\n */\n @Prop() expandToggleDisabled?: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-panel']);\n\n /**\n * Title is in edition mode\n */\n @State() isEditing = false;\n\n /**\n * Cache for updated panel title before validation\n */\n @State() updatedPanelTitle: string;\n\n /**\n * Emmited event when title change\n */\n @Event({ eventName: 'title-change' }) titleChange: EventEmitter<HTMLMgPanelElement['panelTitle']>;\n\n /**\n * Emmited event when expanded change\n */\n @Event({ eventName: 'expanded-change' }) expandedChange: EventEmitter<HTMLMgPanelElement['expanded']>;\n\n /************\n * Methods *\n ************/\n\n /**\n * Toggle is editing state\n */\n private toggleIsEditing = (): void => {\n this.isEditing = !this.isEditing;\n };\n\n /************\n * Handlers *\n ************/\n\n /**\n * Collapse button click handler\n */\n private handleCollapseButton = (): void => {\n if (!this.expandToggleDisabled) this.expanded = !this.expanded;\n };\n\n /**\n * Edit button click handler\n */\n private handleEditButton = (): void => {\n this.toggleIsEditing();\n };\n\n /**\n * Update title handler\n * @param event - input value change event\n */\n private handleUpdateTitle = (event: CustomEvent<HTMLMgInputTextElement['value']>): void => {\n this.updatedPanelTitle = event.detail;\n };\n\n /**\n * Cancel edition button handler\n */\n private handleCancelEditButton = (): void => {\n this.updatedPanelTitle = undefined;\n this.toggleIsEditing();\n };\n\n /**\n * Validate edition button handler\n */\n private handleValidateEditButton = (): void => {\n if (!this.editInputElement.valid) return;\n if (this.updatedPanelTitle !== undefined) this.panelTitle = this.updatedPanelTitle;\n this.toggleIsEditing();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchIdentifier(this.identifier);\n this.validateTitlePattern(this.titlePattern);\n this.validateTitlePattern(this.titlePatternErrorMessage);\n this.validatePanelTitle(this.panelTitle);\n this.validateExpandToggleDisplay(this.expandToggleDisplay);\n this.validateTitlePosition(this.titlePosition);\n }\n\n /**\n * Edit DOM after render\n */\n componentDidRender(): void {\n // when we are editing we get focus on edition input\n if (this.isEditing) this.editInputElement.setFocus();\n }\n\n /*************\n * Render *\n *************/\n\n /**\n * Render collapse button\n * @returns collpase button\n */\n private renderCollapseButton = (): HTMLMgButtonElement => (\n <mg-button\n onClick={this.handleCollapseButton}\n variant=\"flat\"\n aria-expanded={this.expanded.toString()}\n aria-controls={`${this.identifier}-content`}\n disabled={this.expandToggleDisabled}\n isIcon={this.expandToggleDisplay === 'icon'}\n label={this.panelTitle}\n >\n <span class=\"mg-c-panel__collapse-button-content\">\n <mg-icon icon=\"chevron-up\" class={{ 'mg-c-panel__collapse-button-icon': true, 'mg-c-panel__collapse-button-icon--reverse': !this.expanded }}></mg-icon>\n {!this.isEditing && this.expandToggleDisplay !== 'icon' && this.panelTitle}\n </span>\n </mg-button>\n );\n\n /**\n * Render edit button\n * @returns edit Button\n */\n private renderEditButton = (): HTMLMgButtonElement => (\n <mg-button key=\"edit-button\" is-icon variant=\"flat\" label={this.messages.panel.editLabel} onClick={this.handleEditButton}>\n <mg-icon icon=\"pen\"></mg-icon>\n </mg-button>\n );\n\n /**\n * Render input button\n * @returns edit title input\n */\n private renderEditInput = (): HTMLMgInputTextElement => (\n <mg-input-text\n key=\"edition-input\"\n label={this.messages.panel.editLabel}\n label-hide\n value={this.panelTitle}\n onValue-change={this.handleUpdateTitle}\n characterLeftHide={true}\n pattern={this.titlePattern}\n pattern-error-message={this.titlePatternErrorMessage}\n identifier={`${this.identifier}-edition-input`}\n ref={(el: HTMLMgInputTextElement) => (this.editInputElement = el)}\n >\n <mg-button slot=\"append-input\" label={this.messages.general.cancel} is-icon variant=\"secondary\" onClick={this.handleCancelEditButton}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n <mg-button slot=\"append-input\" label={this.messages.general.confirm} is-icon variant=\"secondary\" onClick={this.handleValidateEditButton}>\n <mg-icon icon=\"check\"></mg-icon>\n </mg-button>\n </mg-input-text>\n );\n\n /**\n * Render title\n * @returns title element\n */\n private renderTitle = (): HTMLElement[] => {\n const elementsToRender: HTMLElement[] = [this.renderCollapseButton()];\n if (this.titleEditable) {\n if (!this.isEditing) elementsToRender.push(this.renderEditButton());\n else elementsToRender.push(this.renderEditInput());\n }\n\n return this.titlePosition === 'right' ? elementsToRender.reverse() : elementsToRender;\n };\n\n /**\n * Render header children\n * @returns header child\n */\n private renderHeaderChildren = (): HTMLElement[] => {\n const children = [\n <div\n class={{ 'mg-c-panel__header-title': true, 'mg-c-panel__header-title--full': this.isEditing, 'mg-c-panel__header-title--reverse': this.titlePosition === 'right' }}\n key={this.panelTitle}\n >\n {this.renderTitle()}\n </div>,\n <div class=\"mg-c-panel__header-content\" key=\"slot-header\">\n <slot name=\"header-right\"></slot>\n </div>,\n ];\n return this.titlePosition === 'right' ? children.reverse() : children;\n };\n\n /**\n * Render component\n * @returns rendered component\n */\n render(): HTMLElement {\n const headerId = `${this.identifier}-header`;\n return (\n <section class={this.classCollection.join()} id={this.identifier}>\n <mg-card>\n <header class={{ 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }} id={headerId}>\n {this.renderHeaderChildren()}\n </header>\n <article class=\"mg-c-panel__content\" id={`${this.identifier}-content`} aria-labelledby={headerId} hidden={!this.expanded}>\n <slot></slot>\n </article>\n </mg-card>\n </section>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"mg-panel.js","mappings":";;;;;;;;;;;;;AAAA;;;AAGO,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAO9D;;;AAGO,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;;ACbxD,MAAM,UAAU,GAAG,8lEAA8lE,CAAC;AAClnE,sBAAe,UAAU;;MCaZA,SAAO;IALpB;;;;;;;;;;QA6BU,eAAU,GAAWC,EAAQ,CAAC,UAAU,CAAC,CAAC;;;;QAoCzB,kBAAa,GAAG,KAAK,CAAC;;;;QAKvC,kBAAa,GAAsB,cAAc,CAAC,CAAC,CAAC,CAAC;;;;QASpC,aAAQ,GAAG,KAAK,CAAC;;;;QASlC,wBAAmB,GAA4B,oBAAoB,CAAC,CAAC,CAAC,CAAC;;;;QAgBtE,oBAAe,GAAc,IAAIC,EAAS,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;;;;Q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C,2BAA2B,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC3D,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAChD;;;;IAKD,kBAAkB;;QAEhB,IAAI,IAAI,CAAC,SAAS;YAAE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC;KACtD;;;;;IAoGD,MAAM;QACJ,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,UAAU,SAAS,CAAC;QAC7C,QACE,gEAAS,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,IAC9D,kEACE,+DAAQ,KAAK,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,CAAC,aAAa,KAAK,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,IACvH,IAAI,CAAC,oBAAoB,EAAE,CACrB,EACT,gEAAS,KAAK,EAAC,qBAAqB,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,UAAU,qBAAmB,QAAQ,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,IACtH,8DAAa,CACL,CACF,CACF,EACV;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgPanel","createID","ClassList","isValideID","toString","isValidString"],"sources":["src/components/molecules/mg-panel/mg-panel.conf.ts","../styles/dist/components/mg-panel.css?tag=mg-panel&encapsulation=shadow","src/components/molecules/mg-panel/mg-panel.tsx"],"sourcesContent":["/**\n * Available expand toggle display options\n */\nexport const expandToggleDisplays = ['text', 'icon'] as const;\n\n/**\n * Generated expand toggle display type from available expand toggle display options\n */\nexport type ExpandToggleDisplayType = (typeof expandToggleDisplays)[number];\n\n/**\n * Available title positions\n */\nexport const titlePositions = ['left', 'right'] as const;\n\n/**\n * Generated title positions type from available title positions\n */\nexport type TitlePositionType = (typeof titlePositions)[number];\n","/*!\n * @prop --mg-c-panel-border-radius: Defines the border radius of the panel. Default value: `--mg-b-size-radius`.\n * @prop --mg-c-panel-color-background: Defines the background of the panel. Default value: `color-mix(in srgb, var(--mg-b-color-info), white 97%)`.\n * @prop --mg-c-panel-box-shadow: Defines the box shadow of the panel. Default value: `--mg-b-box-shadow`.\n * @prop --mg-c-panel-content-spacing: Defines the padding of the panel content. Default value: `--mg-b-size-16`.\n */:host{--mg-c-card-border: none;--mg-c-card-spacing: 0;--mg-c-card-border-radius: var(--mg-c-panel-border-radius);--mg-c-card-color-background: var(--mg-c-panel-color-background);--mg-c-card-box-shadow: var(--mg-c-panel-box-shadow)}.mg-c-panel__header{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;padding:0 var(--mg-b-size-4)}.mg-c-panel__header-title,.mg-c-panel__header-content{display:flex;margin:var(--mg-b-size-4) 0}.mg-c-panel__header-content{min-height:var(--mg-b-size-min-height);flex:1 auto;align-items:center;padding-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-input-text{flex-grow:1;margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:var(--mg-b-size-4)}.mg-c-panel__header-title.mg-c-panel__header-title--full{flex:1 1 auto}.mg-c-panel__collapse-button-content{--mg-b-font-size: var(--mg-b-font-size-h5);--mg-c-button-font-weight: 600}.mg-c-panel__collapse-button-icon.mg-c-panel__collapse-button-icon--reverse{transform:rotate(180deg)}.mg-c-panel__content{padding:var(--mg-c-panel-content-spacing)}.mg-c-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;margin-left:auto;gap:var(--mg-b-spacing-actions)}.mg-c-panel ::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}/*# sourceMappingURL=mg-panel.css.map */\n","import { Component, Element, h, Prop, State, EventEmitter, Watch, Event } from '@stencil/core';\nimport { createID, ClassList, isValidString, toString, isValideID } from '@mgdis/stencil-helpers';\nimport { initLocales } from '../../../locales';\nimport { type ExpandToggleDisplayType, type TitlePositionType, expandToggleDisplays, titlePositions } from './mg-panel.conf';\n\n/**\n * @slot - Panel content\n * @slot header-right - Header right panel content\n */\n@Component({\n tag: 'mg-panel',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-panel.css',\n shadow: true,\n})\nexport class MgPanel {\n /************\n * Internal *\n ************/\n\n // HTML selector\n private editInputElement: HTMLMgInputTextElement;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgPanelElement;\n\n /**\n * Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n * If not set, it will be created.\n */\n @Prop() identifier: string = createID('mg-panel');\n @Watch('identifier')\n watchIdentifier(newValue: MgPanel['identifier']): void {\n if (!isValideID(newValue)) {\n console.error(`<mg-panel> prop \"identifier\" value is invalid. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Panel title\n */\n @Prop({ mutable: true }) panelTitle!: string;\n @Watch('panelTitle')\n validatePanelTitle(newValue: MgPanel['panelTitle']): void {\n if (!isValidString(newValue)) throw new Error(`<mg-panel> prop \"panelTitle\" is required and must be a string. Passed value: ${toString(newValue)}.`);\n this.titleChange.emit(newValue);\n }\n\n /**\n * Panel title pattern\n */\n @Prop() titlePattern?: string;\n\n /**\n * Panel title pattern error message\n */\n @Prop() titlePatternErrorMessage?: string;\n @Watch('titlePattern')\n @Watch('titlePatternErrorMessage')\n validateTitlePattern(newValue: string): void {\n if (newValue !== undefined && !this.titleEditable) throw new Error(`<mg-panel> prop \"titleEditable\" must be set to \"true\".`);\n }\n\n /**\n * Define if panel title is editable\n */\n @Prop({ mutable: true }) titleEditable = false;\n\n /**\n * Define title position\n */\n @Prop() titlePosition: TitlePositionType = titlePositions[0];\n @Watch('titlePosition')\n validateTitlePosition(newValue: MgPanel['titlePosition']) {\n if (!titlePositions.includes(newValue)) throw new Error(`<mg-panel> prop \"titlePosition\" must be one of: ${titlePositions.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Panel is opened\n */\n @Prop({ mutable: true }) expanded = false;\n @Watch('expanded')\n handleExpanded(newValue: MgPanel['expanded']): void {\n this.expandedChange.emit(newValue);\n }\n\n /**\n * Define expand toggle button display\n */\n @Prop() expandToggleDisplay: ExpandToggleDisplayType = expandToggleDisplays[0];\n @Watch('expandToggleDisplay')\n validateExpandToggleDisplay(newValue: MgPanel['expandToggleDisplay']) {\n if (!expandToggleDisplays.includes(newValue))\n throw new Error(`<mg-panel> prop \"expandToggleDisplay\" must be one of: ${expandToggleDisplays.join(', ')}. Passed value: ${toString(newValue)}.`);\n if (newValue === 'icon' && this.titleEditable) this.titleEditable = false;\n }\n\n /**\n * Disable possibility to toggle expand\n */\n @Prop() expandToggleDisabled?: boolean;\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-panel']);\n\n /**\n * Title is in edition mode\n */\n @State() isEditing = false;\n\n /**\n * Cache for updated panel title before validation\n */\n @State() updatedPanelTitle: string;\n\n /**\n * Emmited event when title change\n */\n @Event({ eventName: 'title-change' }) titleChange: EventEmitter<HTMLMgPanelElement['panelTitle']>;\n\n /**\n * Emmited event when expanded change\n */\n @Event({ eventName: 'expanded-change' }) expandedChange: EventEmitter<HTMLMgPanelElement['expanded']>;\n\n /************\n * Methods *\n ************/\n\n /**\n * Toggle is editing state\n */\n private toggleIsEditing = (): void => {\n this.isEditing = !this.isEditing;\n };\n\n /************\n * Handlers *\n ************/\n\n /**\n * Collapse button click handler\n */\n private handleCollapseButton = (): void => {\n if (!this.expandToggleDisabled) this.expanded = !this.expanded;\n };\n\n /**\n * Edit button click handler\n */\n private handleEditButton = (): void => {\n this.toggleIsEditing();\n };\n\n /**\n * Update title handler\n * @param event - input value change event\n */\n private handleUpdateTitle = (event: CustomEvent<HTMLMgInputTextElement['value']>): void => {\n this.updatedPanelTitle = event.detail;\n };\n\n /**\n * Cancel edition button handler\n */\n private handleCancelEditButton = (): void => {\n this.updatedPanelTitle = undefined;\n this.toggleIsEditing();\n };\n\n /**\n * Validate edition button handler\n */\n private handleValidateEditButton = (): void => {\n if (!this.editInputElement.valid) return;\n if (this.updatedPanelTitle !== undefined) this.panelTitle = this.updatedPanelTitle;\n this.toggleIsEditing();\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchIdentifier(this.identifier);\n this.validateTitlePattern(this.titlePattern);\n this.validateTitlePattern(this.titlePatternErrorMessage);\n this.validatePanelTitle(this.panelTitle);\n this.validateExpandToggleDisplay(this.expandToggleDisplay);\n this.validateTitlePosition(this.titlePosition);\n }\n\n /**\n * Edit DOM after render\n */\n componentDidRender(): void {\n // when we are editing we get focus on edition input\n if (this.isEditing) this.editInputElement.setFocus();\n }\n\n /*************\n * Render *\n *************/\n\n /**\n * Render collapse button\n * @returns collpase button\n */\n private renderCollapseButton = (): HTMLMgButtonElement => (\n <mg-button\n onClick={this.handleCollapseButton}\n variant=\"flat\"\n aria-expanded={this.expanded.toString()}\n aria-controls={`${this.identifier}-content`}\n disabled={this.expandToggleDisabled}\n isIcon={this.expandToggleDisplay === 'icon'}\n label={this.panelTitle}\n >\n <span class=\"mg-c-panel__collapse-button-content\">\n <mg-icon icon=\"chevron-up\" class={{ 'mg-c-panel__collapse-button-icon': true, 'mg-c-panel__collapse-button-icon--reverse': !this.expanded }}></mg-icon>\n {!this.isEditing && this.expandToggleDisplay !== 'icon' && this.panelTitle}\n </span>\n </mg-button>\n );\n\n /**\n * Render edit button\n * @returns edit Button\n */\n private renderEditButton = (): HTMLMgButtonElement => (\n <mg-button key=\"edit-button\" is-icon variant=\"flat\" label={this.messages.panel.editLabel} onClick={this.handleEditButton}>\n <mg-icon icon=\"pen\"></mg-icon>\n </mg-button>\n );\n\n /**\n * Render input button\n * @returns edit title input\n */\n private renderEditInput = (): HTMLMgInputTextElement => (\n <mg-input-text\n key=\"edition-input\"\n label={this.messages.panel.editLabel}\n label-hide\n value={this.panelTitle}\n onValue-change={this.handleUpdateTitle}\n characterLeftHide={true}\n pattern={this.titlePattern}\n pattern-error-message={this.titlePatternErrorMessage}\n identifier={`${this.identifier}-edition-input`}\n ref={(el: HTMLMgInputTextElement) => (this.editInputElement = el)}\n >\n <mg-button slot=\"append-input\" label={this.messages.general.cancel} is-icon variant=\"secondary\" onClick={this.handleCancelEditButton}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n <mg-button slot=\"append-input\" label={this.messages.general.confirm} is-icon variant=\"secondary\" onClick={this.handleValidateEditButton}>\n <mg-icon icon=\"check\"></mg-icon>\n </mg-button>\n </mg-input-text>\n );\n\n /**\n * Render title\n * @returns title element\n */\n private renderTitle = (): HTMLElement[] => {\n const elementsToRender: HTMLElement[] = [this.renderCollapseButton()];\n if (this.titleEditable) {\n if (!this.isEditing) elementsToRender.push(this.renderEditButton());\n else elementsToRender.push(this.renderEditInput());\n }\n\n return this.titlePosition === 'right' ? elementsToRender.reverse() : elementsToRender;\n };\n\n /**\n * Render header children\n * @returns header child\n */\n private renderHeaderChildren = (): HTMLElement[] => {\n const children = [\n <div\n class={{ 'mg-c-panel__header-title': true, 'mg-c-panel__header-title--full': this.isEditing, 'mg-c-panel__header-title--reverse': this.titlePosition === 'right' }}\n key={this.panelTitle}\n >\n {this.renderTitle()}\n </div>,\n <div class=\"mg-c-panel__header-content\" key=\"slot-header\">\n <slot name=\"header-right\"></slot>\n </div>,\n ];\n return this.titlePosition === 'right' ? children.reverse() : children;\n };\n\n /**\n * Render component\n * @returns rendered component\n */\n render(): HTMLElement {\n const headerId = `${this.identifier}-header`;\n return (\n <section class={this.classCollection.join()} id={this.identifier}>\n <mg-card>\n <header class={{ 'mg-c-panel__header': true, 'mg-c-panel__header--reverse': this.titlePosition === 'right' }} id={headerId}>\n {this.renderHeaderChildren()}\n </header>\n <article class=\"mg-c-panel__content\" id={`${this.identifier}-content`} aria-labelledby={headerId} hidden={!this.expanded}>\n <slot></slot>\n </article>\n </mg-card>\n </section>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { Z as Ze, K as Ke } 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: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-
|
|
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-placement^=left-start]),:host([data-placement^=left-end]),:host([data-placement^=right-start]),:host([data-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-placement^=top][data-arrow-hide]){padding-bottom:0}:host([data-placement^=bottom][data-arrow-hide]){padding-top:0}:host([data-placement$=end][data-arrow-hide]),:host([data-placement^=left][data-arrow-hide]){padding-right:0}:host([data-placement$=start][data-arrow-hide]),:host([data-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-placement^=top]) ::slotted([slot=arrow]),:host([data-placement^=bottom]) ::slotted([slot=arrow]){height:var(--mg-b-size-8)}:host([data-placement^=top]) ::slotted([slot=arrow])::before,:host([data-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-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-placement^=top]) ::slotted([slot=arrow])::before{border-top:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-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-placement^=bottom]) ::slotted([slot=arrow])::before{border-bottom:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-placement^=left]) ::slotted([slot=arrow]),:host([data-placement^=right]) ::slotted([slot=arrow]){width:var(--mg-b-size-8)}:host([data-placement^=left]) ::slotted([slot=arrow])::before,:host([data-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-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-placement^=left]) ::slotted([slot=arrow])::before{border-left:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-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-placement^=right]) ::slotted([slot=arrow])::before{border-right:var(--mg-b-size-8) solid var(--mg-c-popover-color-background)}:host([data-placement^=left-start]) ::slotted([slot=arrow]),:host([data-placement^=left-end]) ::slotted([slot=arrow]),:host([data-placement^=right-start]) ::slotted([slot=arrow]),:host([data-placement^=right-end]) ::slotted([slot=arrow]){height:calc(var(--mg-b-size-24) + 2*var(--mg-c-card-border-radius))}:host([data-placement^=left-start]) ::slotted([slot=arrow])::before,:host([data-placement^=left-end]) ::slotted([slot=arrow])::before,:host([data-placement^=right-start]) ::slotted([slot=arrow])::before,:host([data-placement^=right-end]) ::slotted([slot=arrow])::before{top:var(--mg-c-card-border-radius)}";
|
|
9
9
|
const MgPopoverContentStyle0 = mgPopoverContentCss;
|
|
10
10
|
|
|
11
11
|
const MgPopoverContent = /*@__PURE__*/ proxyCustomElement(class MgPopoverContent extends HTMLElement {
|
|
@@ -21,7 +21,7 @@ const MgPopoverContent = /*@__PURE__*/ proxyCustomElement(class MgPopoverContent
|
|
|
21
21
|
/**
|
|
22
22
|
* Component classes
|
|
23
23
|
*/
|
|
24
|
-
this.classCollection = new
|
|
24
|
+
this.classCollection = new Ze(['mg-c-popover-content']);
|
|
25
25
|
/**
|
|
26
26
|
* Handle action for close button
|
|
27
27
|
*/
|
|
@@ -54,7 +54,7 @@ const MgPopoverContent = /*@__PURE__*/ proxyCustomElement(class MgPopoverContent
|
|
|
54
54
|
* @returns HTML Element
|
|
55
55
|
*/
|
|
56
56
|
render() {
|
|
57
|
-
return (h(Host, { key: '
|
|
57
|
+
return (h(Host, { key: '44aa95d34a4c4beeb5c6d1a59e7e7df999393e52' }, h("mg-card", { key: '483195ec364eaaf78df768993706129cb0ce268e', class: this.classCollection.join() }, this.closeButton && (h("mg-button", { key: '4e2b4f7b563c591120ba208e74c501b0bee7497b', "is-icon": true, variant: "flat", label: this.messages.general.close, onClick: this.handleCloseButton }, h("mg-icon", { key: '58a678df3947e4dbfb718c588ccdc97e611915b9', icon: "cross" }))), h("div", { key: 'e7a9debe373ea8947cde108732f635f39b5305a6', class: "mg-c-popover-content__title" }, h("slot", { key: '15fb949256a5f31e8776cdbd7465f46a73db4876', name: "title" })), h("slot", { key: 'ee914630e089763ec3a059cdd6b4c3eba0c2cfa0', name: "content" })), h("slot", { key: '9c25549d1543a77b3cc459caf8bd8df0b279a036', name: "arrow" })));
|
|
58
58
|
}
|
|
59
59
|
get element() { return this; }
|
|
60
60
|
static get style() { return MgPopoverContentStyle0; }
|