@mgdis/mg-components 5.5.0 → 5.7.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-c3450336.js → index-5e7ede97.js} +120 -4
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{mg-badge_30.cjs.entry.js → mg-action-more_31.cjs.entry.js} +1223 -547
- package/dist/cjs/mg-components.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +6 -5
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +13 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +4 -4
- package/dist/collection/components/atoms/mg-button/mg-button.css +9 -22
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.css +13 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +38 -28
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +3 -3
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +6 -6
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +4 -4
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +2 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +14 -17
- package/dist/collection/components/molecules/inputs/MgInput.js +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +5 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +2 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +8 -4
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +4 -4
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +17 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.css +27 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +141 -19
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +0 -4
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +48 -21
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +139 -71
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js +1 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.css +38 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +252 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +2 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +4 -3
- package/dist/collection/components/molecules/mg-message/mg-message.css +7 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +54 -13
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +8 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +19 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +7 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +72 -15
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +64 -7
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +33 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +12 -7
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +105 -57
- package/dist/collection/locales/en/messages.json +10 -1
- package/dist/collection/locales/fr/messages.json +10 -1
- package/dist/collection/locales/index.js +3 -26
- package/dist/collection/styles/a11y.scss +32 -0
- package/dist/collection/styles/components.scss +3 -0
- package/dist/collection/styles/fonts.scss +21 -0
- package/dist/collection/styles/form.scss +3 -0
- package/dist/collection/styles/global.scss +87 -0
- package/dist/collection/styles/layout.scss +29 -0
- package/dist/collection/styles/main.scss +23 -0
- package/dist/collection/styles/mg-icon-animation.scss +6 -0
- package/dist/collection/styles/navigation-button.scss +77 -0
- package/dist/collection/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/collection/styles/typography.scss +75 -0
- package/dist/collection/styles/utilities.scss +21 -0
- package/dist/collection/utils/behaviors.utils.js +151 -0
- package/dist/collection/utils/components.utils.js +52 -0
- package/dist/collection/utils/locale.utils.js +28 -6
- package/dist/collection/utils/unit.test.utils.js +65 -32
- package/dist/collection/variables.css +11 -10
- package/dist/components/MgInput.js +6 -1
- package/dist/components/components.utils.js +53 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +2 -1
- package/dist/components/index2.js +79 -20
- package/dist/components/mg-action-more.d.ts +11 -0
- package/dist/components/mg-action-more.js +215 -0
- package/dist/components/mg-badge2.js +5 -5
- package/dist/components/mg-button2.js +2 -2
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-form.js +2 -2
- package/dist/components/mg-icon2.js +41 -31
- package/dist/components/mg-illustrated-message.js +4 -3
- package/dist/components/mg-input-checkbox.js +3 -3
- package/dist/components/mg-input-date.js +7 -5
- package/dist/components/mg-input-numeric.js +3 -4
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +2 -2
- package/dist/components/mg-input-select2.js +9 -5
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +2 -2
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-menu-item.js +1 -253
- package/dist/components/mg-menu-item2.js +520 -0
- package/dist/components/mg-menu.js +1 -129
- package/dist/components/mg-menu2.js +247 -0
- package/dist/components/mg-message.js +55 -14
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-pagination.js +3 -1
- package/dist/components/mg-panel.js +3 -3
- package/dist/components/mg-popover.js +1 -190
- package/dist/components/mg-popover2.js +226 -0
- package/dist/components/mg-skip-links.js +16 -2
- package/dist/components/mg-tabs.js +104 -55
- package/dist/components/mg-tag.js +5 -5
- package/dist/components/mg-tooltip2.js +15 -18
- package/dist/esm/{index-78edde1d.js → index-03cceb11.js} +120 -5
- package/dist/esm/loader.js +4 -3
- package/dist/esm/{mg-badge_30.entry.js → mg-action-more_31.entry.js} +1223 -548
- package/dist/esm/mg-components.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/mg-components/locales/en/messages.json +10 -1
- package/dist/mg-components/locales/fr/messages.json +10 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-4cfd5423.entry.js +1 -0
- package/dist/mg-components/p-e126dd84.js +2 -0
- package/dist/mg-components/styles/a11y.scss +32 -0
- package/dist/mg-components/styles/components.scss +3 -0
- package/dist/mg-components/styles/fonts.scss +21 -0
- package/dist/mg-components/styles/form.scss +3 -0
- package/dist/mg-components/styles/global.scss +87 -0
- package/dist/mg-components/styles/layout.scss +29 -0
- package/dist/mg-components/styles/main.scss +23 -0
- package/dist/mg-components/styles/mg-icon-animation.scss +6 -0
- package/dist/mg-components/styles/navigation-button.scss +77 -0
- package/dist/mg-components/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/mg-components/styles/typography.scss +75 -0
- package/dist/mg-components/styles/utilities.scss +21 -0
- package/dist/mg-components/variables.css +11 -10
- package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +1 -1
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +37 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +51 -3
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +0 -8
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +61 -15
- package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +42 -0
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +81 -0
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +21 -4
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +4 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +13 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +1 -1
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +15 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +5 -3
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +22 -12
- package/dist/types/components.d.ts +98 -12
- package/dist/types/locales/index.d.ts +21 -10
- package/dist/types/stencil-public-runtime.d.ts +48 -3
- package/dist/types/utils/behaviors.utils.d.ts +77 -0
- package/dist/types/utils/components.utils.d.ts +14 -0
- package/dist/types/utils/locale.utils.d.ts +16 -3
- package/dist/types/utils/unit.test.utils.d.ts +68 -14
- package/loader/index.d.ts +9 -0
- package/package.json +28 -27
- package/readme.md +22 -31
- package/dist/.storybook/utils.js +0 -24
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -27
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -38
- package/dist/collection/components/atoms/mg-card/doc/mg-card.stories.js +0 -18
- package/dist/collection/components/atoms/mg-character-left/doc/mg-character-left.stories.js +0 -20
- package/dist/collection/components/atoms/mg-divider/doc/mg-divider.stories.js +0 -18
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +0 -41
- package/dist/collection/components/atoms/mg-input-title/doc/mg-input-title.stories.js +0 -21
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +0 -22
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +0 -50
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.js +0 -50
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +0 -43
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +0 -68
- package/dist/collection/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.js +0 -46
- package/dist/collection/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.js +0 -59
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +0 -77
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +0 -110
- package/dist/collection/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.js +0 -54
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +0 -51
- package/dist/collection/components/molecules/menu/mg-menu/doc/mg-menu.stories.js +0 -87
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +0 -39
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +0 -24
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +0 -47
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +0 -19
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +0 -39
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +0 -39
- package/dist/collection/components/molecules/mg-pagination/doc/mg-pagination.stories.js +0 -20
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +0 -22
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +0 -34
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +0 -24
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +0 -51
- package/dist/collection/stories/grids.stories.js +0 -7
- package/dist/collection/stories/helpers.stories.js +0 -23
- package/dist/collection/stories/icons.stories.js +0 -25
- package/dist/collection/stories/typography.stories.js +0 -24
- package/dist/components/locale.utils.js +0 -40
- package/dist/components/mg-menu.conf.js +0 -10
- package/dist/mg-components/p-125c54ca.js +0 -2
- package/dist/mg-components/p-4961c96c.entry.js +0 -1
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -13
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -16
- package/dist/types/components/atoms/mg-card/doc/mg-card.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-character-left/doc/mg-character-left.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-divider/doc/mg-divider.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-icon/doc/mg-icon.stories.d.ts +0 -26
- package/dist/types/components/atoms/mg-input-title/doc/mg-input-title.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.d.ts +0 -11
- package/dist/types/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.d.ts +0 -12
- package/dist/types/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.d.ts +0 -32
- package/dist/types/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.d.ts +0 -22
- package/dist/types/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.d.ts +0 -20
- package/dist/types/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.d.ts +0 -34
- package/dist/types/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.d.ts +0 -39
- package/dist/types/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.d.ts +0 -19
- package/dist/types/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.d.ts +0 -12
- package/dist/types/components/molecules/menu/mg-menu/doc/mg-menu.stories.d.ts +0 -17
- package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +0 -12
- package/dist/types/components/molecules/mg-details/doc/mg-details.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-form/doc/mg-form.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.d.ts +0 -6
- package/dist/types/components/molecules/mg-message/doc/mg-message.stories.d.ts +0 -26
- package/dist/types/components/molecules/mg-modal/doc/mg-modal.stories.d.ts +0 -13
- package/dist/types/components/molecules/mg-pagination/doc/mg-pagination.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-panel/doc/mg-panel.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +0 -22
- package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-tabs/doc/mg-tabs.stories.d.ts +0 -20
- package/dist/types/home/runner/work/mg-components/mg-components/.stencil/.storybook/utils.d.ts +0 -1
- package/dist/types/stories/grids.stories.d.ts +0 -5
- package/dist/types/stories/helpers.stories.d.ts +0 -13
- package/dist/types/stories/icons.stories.d.ts +0 -13
- package/dist/types/stories/typography.stories.d.ts +0 -5
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/jsx-no-bind */
|
|
2
|
-
import { h } from '@stencil/core';
|
|
3
|
-
import { filterArgs } from '../../../../../.storybook/utils';
|
|
4
|
-
export default {
|
|
5
|
-
component: 'mg-modal',
|
|
6
|
-
title: 'Molecules/mg-modal',
|
|
7
|
-
parameters: { actions: { handles: ['component-show', 'component-hide'] } },
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Template
|
|
11
|
-
*
|
|
12
|
-
* @param {any} args component arguments
|
|
13
|
-
* @returns {HTMLElement} HTMLElement
|
|
14
|
-
*/
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
-
const Template = (args) => (h("div", null, h("mg-button", { "aria-controls": "identifier", "aria-haspopup": "dialog", onClick: () => {
|
|
17
|
-
const mgModal = document.querySelector('mg-modal');
|
|
18
|
-
const isHide = mgModal.hide === true;
|
|
19
|
-
if (isHide) {
|
|
20
|
-
mgModal.removeAttribute('hide'); // storybook first render is an attribute then we use property
|
|
21
|
-
mgModal.hide = false;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
mgModal.hide = true;
|
|
25
|
-
}
|
|
26
|
-
} }, "Open modal"), h("mg-modal", Object.assign({}, filterArgs(args)), args.slotContent && h("div", { slot: "content", innerHTML: args.slotContent }), args.slotActions && h("div", { slot: "actions", innerHTML: args.slotActions }))));
|
|
27
|
-
export const MgModal = Template.bind({});
|
|
28
|
-
MgModal.args = {
|
|
29
|
-
slotContent: `<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>`,
|
|
30
|
-
slotActions: ``,
|
|
31
|
-
modalTitle: 'Modal title',
|
|
32
|
-
identifier: 'identifier',
|
|
33
|
-
closeButton: false,
|
|
34
|
-
hide: true,
|
|
35
|
-
};
|
|
36
|
-
export const WithCloseButton = Template.bind({});
|
|
37
|
-
WithCloseButton.args = Object.assign(Object.assign({}, MgModal.args), { closeButton: true });
|
|
38
|
-
export const WithActions = Template.bind({});
|
|
39
|
-
WithActions.args = Object.assign(Object.assign({}, MgModal.args), { closeButton: true, slotActions: `<div class="mg-group-elements mg-group-elements--align-right"><mg-button>Primary</mg-button><mg-button variant="secondary">Secondary</mg-button></div>` });
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { filterArgs } from '../../../../../.storybook/utils';
|
|
3
|
-
export default {
|
|
4
|
-
component: 'mg-pagination',
|
|
5
|
-
title: 'Molecules/mg-pagination',
|
|
6
|
-
parameters: { actions: { handles: ['current-page-change'] } },
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Template
|
|
10
|
-
*
|
|
11
|
-
* @param {any} args component arguments
|
|
12
|
-
* @returns {HTMLElement} HTMLElement
|
|
13
|
-
*/
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
-
const Template = (args) => h("mg-pagination", Object.assign({}, filterArgs(args)));
|
|
16
|
-
export const MgPagination = Template.bind({});
|
|
17
|
-
MgPagination.args = {
|
|
18
|
-
totalPages: 5,
|
|
19
|
-
currentPage: 1,
|
|
20
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { filterArgs } from '../../../../../.storybook/utils';
|
|
3
|
-
export default {
|
|
4
|
-
component: 'mg-panel',
|
|
5
|
-
title: 'Molecules/mg-panel',
|
|
6
|
-
parameters: { actions: { handles: ['title-change', 'expanded-change'] } },
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Template
|
|
10
|
-
*
|
|
11
|
-
* @param {any} args component arguments
|
|
12
|
-
* @returns {HTMLElement} HTMLElement
|
|
13
|
-
*/
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
-
const Template = (args) => (h("mg-panel", Object.assign({}, filterArgs(args)), h("div", null, "Content"), h("div", { slot: "header-right", style: { width: '100%' } }, h("mg-badge", { label: "1", value: "1", style: { 'margin-right': 'auto' } }), h("mg-button", { variant: "secondary" }, h("mg-icon", { icon: "file-upload" }), " Upload"), h("mg-button", Object.assign({}, filterArgs({ isIcon: true }), { variant: "secondary", label: "delete" }), h("mg-icon", { icon: "trash" })))));
|
|
16
|
-
export const MgPanel = Template.bind({});
|
|
17
|
-
MgPanel.args = {
|
|
18
|
-
panelTitle: 'title',
|
|
19
|
-
expanded: false,
|
|
20
|
-
titleEditable: true,
|
|
21
|
-
expandToggleDisabled: false,
|
|
22
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { filterArgs } from '../../../../../.storybook/utils';
|
|
3
|
-
export default {
|
|
4
|
-
component: 'mg-popover',
|
|
5
|
-
title: 'Molecules/mg-popover',
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: 'centered',
|
|
8
|
-
docs: { iframeHeight: 600 },
|
|
9
|
-
actions: { handles: ['display-change'] },
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
placement: {
|
|
13
|
-
control: { type: 'select' },
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Template
|
|
19
|
-
*
|
|
20
|
-
* @param {any} args component arguments
|
|
21
|
-
* @returns {HTMLElement} HTMLElement
|
|
22
|
-
*/
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
-
const Template = (args) => (h("mg-popover", Object.assign({}, filterArgs(args, { placement: 'bottom' })), h("mg-button", null, "Button"), args.slotTitle && h("h2", { slot: "title" }, args.slotTitle), args.slotContent && h("p", { slot: "content" }, args.slotContent)));
|
|
25
|
-
export const MgPopover = Template.bind({});
|
|
26
|
-
MgPopover.args = {
|
|
27
|
-
slotTitle: `Blu bli blo bla`,
|
|
28
|
-
slotContent: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`,
|
|
29
|
-
identifier: 'identifier',
|
|
30
|
-
closeButton: false,
|
|
31
|
-
disabled: false,
|
|
32
|
-
display: false,
|
|
33
|
-
placement: undefined,
|
|
34
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { filterArgs } from '../../../../../.storybook/utils';
|
|
3
|
-
export default {
|
|
4
|
-
component: 'mg-skip-links',
|
|
5
|
-
title: 'Molecules/mg-skip-links',
|
|
6
|
-
parameters: { actions: { handles: ['expanded-change'] } },
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Template
|
|
10
|
-
*
|
|
11
|
-
* @param {any} args component arguments
|
|
12
|
-
* @returns {HTMLElement} HTMLElement
|
|
13
|
-
*/
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
-
const Template = (args) => h("mg-skip-links", Object.assign({}, filterArgs(args)));
|
|
16
|
-
export const MgSkipLinks = Template.bind({});
|
|
17
|
-
MgSkipLinks.args = {
|
|
18
|
-
links: [
|
|
19
|
-
{ href: '#content', label: 'Content' },
|
|
20
|
-
{ href: '#menu', label: 'Menu' },
|
|
21
|
-
{ href: '#search', label: 'Search' },
|
|
22
|
-
{ href: '#footer', label: 'Footer' },
|
|
23
|
-
],
|
|
24
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { filterArgs } from '../../../../../.storybook/utils';
|
|
3
|
-
import { sizes, Status } from '../mg-tabs.conf';
|
|
4
|
-
export default {
|
|
5
|
-
component: 'mg-tabs',
|
|
6
|
-
title: 'Molecules/mg-tabs',
|
|
7
|
-
argTypes: {
|
|
8
|
-
size: {
|
|
9
|
-
options: sizes,
|
|
10
|
-
control: { type: 'select' },
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
parameters: { actions: { handles: ['active-tab-change'] } },
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Template
|
|
17
|
-
*
|
|
18
|
-
* @param {any} args component arguments
|
|
19
|
-
* @returns {HTMLElement} HTMLElement
|
|
20
|
-
*/
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
const Template = (args) => (h("mg-tabs", Object.assign({}, filterArgs(args, { size: sizes[0], activeTab: 1 })), h("div", { slot: "tab_content-1" }, "Content 1"), h("div", { slot: "tab_content-2" }, "Content 2"), h("div", { slot: "tab_content-3" }, "Content 3"), h("div", { slot: "tab_content-4" }, "Content 4")));
|
|
23
|
-
export const MgTabs = Template.bind({});
|
|
24
|
-
MgTabs.args = {
|
|
25
|
-
items: ['Tab 1', 'Tab 2', 'Tab 3', 'Tab 4'],
|
|
26
|
-
label: 'Short tabs description. Needed for accessibility',
|
|
27
|
-
activeTab: undefined,
|
|
28
|
-
size: sizes[0], // regular
|
|
29
|
-
};
|
|
30
|
-
export const MgTabsItems = Template.bind({});
|
|
31
|
-
MgTabsItems.args = Object.assign(Object.assign({}, MgTabs.args), { activeTab: 3, items: [
|
|
32
|
-
{
|
|
33
|
-
label: 'Tab 1',
|
|
34
|
-
icon: 'check',
|
|
35
|
-
badge: { value: 1, label: 'message' },
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
label: 'Tab 2',
|
|
39
|
-
badge: { value: 5, label: 'messages' },
|
|
40
|
-
status: Status.DISABLED,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: 'Tab 3',
|
|
44
|
-
icon: 'cross',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: 'Tab 4',
|
|
48
|
-
icon: 'trash',
|
|
49
|
-
status: Status.HIDDEN,
|
|
50
|
-
},
|
|
51
|
-
] });
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
export default {
|
|
3
|
-
title: 'Style/Layout/Grid',
|
|
4
|
-
};
|
|
5
|
-
const Template = () => (h("main", { id: "demo" }, h("h1", null, "Grid"), h("p", null, "You can use grid classes by using the ", h("code", null, ".mg-grid"), " class in the container. This call will add flex properties to the container."), h("h2", null, "Auto layout"), h("p", null, "Default column class is ", h("code", null, "mg-grid__col"), ". The width will be defined by the number of element using the class."), h("div", { class: "mg-grid" }, h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col" }, ".mg-grid__col")), h("div", { class: "mg-grid" }, h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col" }, ".mg-grid__col")), h("div", { class: "mg-grid" }, h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col" }, ".mg-grid__col")), h("h2", null, "Sized column"), h("p", null, "Like Bootstrap, you can use sized colomn based on a 12 colomns grid."), h("p", null, "The library is using the BEM methodology, so to define a column width we need to set a modifier class, for exemple ", h("code", null, "mg-grid__col-2"), "."), [...Array.from(Array(12).keys())].map((_e, i) => (h("div", { class: "mg-grid" }, h("div", { class: `mg-grid__col mg-grid__col-${i + 1}` }, ".mg-grid__col.mg-grid__col-", i + 1)))), h("h2", null, "Mix"), h("p", null, "You can also mix unsized column with sized column."), h("div", { class: "mg-grid" }, h("div", { class: "mg-grid__col mg-grid__col-3" }, ".mg-grid__col.mg-grid__col-3"), h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col mg-grid__col-3" }, ".mg-grid__col.mg-grid__col-3")), h("div", { class: "mg-grid" }, h("div", { class: "mg-grid__col" }, ".mg-grid__col"), h("div", { class: "mg-grid__col mg-grid__col-5" }, ".mg-grid__col.mg-grid__col-5"), h("div", { class: "mg-grid__col" }, ".mg-grid__col"))));
|
|
6
|
-
export const Grid = Template.bind({});
|
|
7
|
-
Grid.args = {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { filterArgs } from '../../.storybook/utils';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Style/Helpers',
|
|
5
|
-
argTypes: {
|
|
6
|
-
align: {
|
|
7
|
-
options: ['left', 'right'],
|
|
8
|
-
control: { type: 'select' },
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Template
|
|
14
|
-
*
|
|
15
|
-
* @param {any} args component arguments
|
|
16
|
-
* @returns {HTMLElement} HTMLElement
|
|
17
|
-
*/
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
-
const Template = (args) => (h("div", null, h("h1", null, "Helpers"), h("h2", null, ".mg-group-elements"), h("p", null, "Buttons can be grouped in an HTMLelement using the ", h("code", null, ".mg-group-elements"), " class, it will ensure a 10px margin space between them, even verticaly. Above exemples are using it."), h("p", null, "By adding the ", h("code", null, ".mg-group-elements--align-right"), " class you 'll set a right alignment of the button, even when line breaks."), h("h3", null, "Demo"), h("div", { class: `mg-group-elements${args.align === 'right' ? ' mg-group-elements--align-right' : ''}` }, h("mg-button", null, "First Button"), h("mg-button", null, h("mg-icon", { icon: "info-circle" }), "Second Button"), h("mg-button", Object.assign({}, filterArgs({ isIcon: true }), { label: "Third button" }), h("mg-icon", { icon: "info-circle" })))));
|
|
20
|
-
export const Helpers = Template.bind({});
|
|
21
|
-
Helpers.args = {
|
|
22
|
-
align: 'left',
|
|
23
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { filterArgs } from '../../.storybook/utils';
|
|
3
|
-
import { icons, sizes } from '../components/atoms/mg-icon/mg-icon.conf';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Style/Icons',
|
|
6
|
-
argTypes: {
|
|
7
|
-
size: {
|
|
8
|
-
options: sizes,
|
|
9
|
-
control: { type: 'select' },
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Template
|
|
15
|
-
*
|
|
16
|
-
* @param {any} args component arguments
|
|
17
|
-
* @returns {HTMLElement} HTMLElement
|
|
18
|
-
*/
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
-
const Template = (args) => (h("ul", { style: { display: 'flex', flexWrap: 'wrap', margin: '0', padding: '0', listStyle: 'none', textAlign: 'center' } }, Object.keys(icons).map((icon) => (h("li", { style: { margin: '1rem', padding: '1rem', width: '100px' } }, h("div", { style: { color: args.color, margin: '1rem' } }, h("mg-icon", Object.assign({}, filterArgs({ icon, size: args.size }, { size: 'regular' })))), h("div", null, icon))))));
|
|
21
|
-
export const Icons = Template.bind({});
|
|
22
|
-
Icons.args = {
|
|
23
|
-
color: '',
|
|
24
|
-
size: sizes[0], // regular
|
|
25
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
export default {
|
|
3
|
-
title: 'Style/Typography',
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Template
|
|
7
|
-
*
|
|
8
|
-
* @param {any} args component arguments
|
|
9
|
-
* @returns {HTMLElement} HTMLElement
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
const Template = (args) => (h("div", null, h("h1", null, args.h1), h("h2", null, args.h2), h("h3", null, args.h3), h("h4", null, args.h4), h("h5", null, args.h5), h("h6", null, args.h6), h("p", null, args.p), h("p", null, h("strong", null, args.strong)), h("p", null, h("small", null, args.small))));
|
|
13
|
-
export const Typography = Template.bind({});
|
|
14
|
-
Typography.args = {
|
|
15
|
-
h1: 'The h1 heading element',
|
|
16
|
-
h2: 'The h2 heading element',
|
|
17
|
-
h3: 'The h3 heading element',
|
|
18
|
-
h4: 'The h4 heading element',
|
|
19
|
-
h5: 'The h5 heading element',
|
|
20
|
-
h6: 'The h6 heading element',
|
|
21
|
-
p: 'The Paragraph element',
|
|
22
|
-
strong: 'The Strong Importance element',
|
|
23
|
-
small: 'The side comment element',
|
|
24
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Format number to the locale currency
|
|
3
|
-
*
|
|
4
|
-
* @param {number} number number to format
|
|
5
|
-
* @param {string} locale locale to apply
|
|
6
|
-
* @param {string} currency currency to apply
|
|
7
|
-
* @returns {string} formatted currency
|
|
8
|
-
*/
|
|
9
|
-
function localeCurrency(number, locale, currency) {
|
|
10
|
-
return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Format number to locale
|
|
14
|
-
*
|
|
15
|
-
* @param {number} number number to format
|
|
16
|
-
* @param {string} locale locale to apply
|
|
17
|
-
* @returns {string} formatted number
|
|
18
|
-
*/
|
|
19
|
-
function localeNumber(number, locale) {
|
|
20
|
-
return new Intl.NumberFormat(locale).format(number);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Date RegExp
|
|
24
|
-
*/
|
|
25
|
-
const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
|
|
26
|
-
/**
|
|
27
|
-
* Locale date format
|
|
28
|
-
*
|
|
29
|
-
* @param {string} date date to format
|
|
30
|
-
* @param {string} locale locale to apply
|
|
31
|
-
* @returns {string} formatted date
|
|
32
|
-
*/
|
|
33
|
-
function localeDate(date, locale) {
|
|
34
|
-
if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {
|
|
35
|
-
return '';
|
|
36
|
-
}
|
|
37
|
-
return new Intl.DateTimeFormat(locale).format(new Date(date));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { localeCurrency as a, localeNumber as b, dateRegExp as d, localeDate as l };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
let t,e,n,l=!1,o=!1,s=!1,r=!1,c=!1;const i={},f=t=>"object"==(t=typeof t)||"function"===t,a=(t,e,...n)=>{let l=null,o=null,s=!1,r=!1;const c=[],i=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof t&&!f(l))&&(l+=""),s&&r?c[c.length-1].t+=l:c.push(s?u(null,l):l),r=s)};if(i(n),e){e.name&&(o=e.name);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,c,d);const a=u(t,null);return a.l=e,c.length>0&&(a.o=c),a.i=o,a},u=(t,e)=>({u:0,$:t,t:e,h:null,o:null,l:null,i:null}),$={},d={forEach:(t,e)=>t.map(h).forEach(e),map:(t,e)=>t.map(h).map(e).map(m)},h=t=>({vattrs:t.l,vchildren:t.o,vkey:t.m,vname:t.i,vtag:t.$,vtext:t.t}),m=t=>{if("function"==typeof t.vtag){const e=Object.assign({},t.vattrs);return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),a(t.vtag,e,...t.vchildren||[])}const e=u(t.vtag,t.vtext);return e.l=t.vattrs,e.o=t.vchildren,e.m=t.vkey,e.i=t.vname,e},p=t=>et(t).p,y=(t,e,n)=>{const l=p(t);return{emit:t=>b(l,e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t})}},b=(t,e,n)=>{const l=ut.ce(e,n);return t.dispatchEvent(l),l},w=new WeakMap,g=t=>"sc-"+t.g,v=(t,e,n,l,o,s)=>{if(n!==l){let r=ot(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,o=S(n),s=S(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("ref"===e)l&&l(t);else if(r||"o"!==e[0]||"n"!==e[1]){const c=f(l);if((r||c&&null!==l)&&!o)try{if(t.tagName.includes("-"))t[e]=l;else{const o=null==l?"":l;"list"===e?r=!1:null!=n&&t[e]==o||(t[e]=o)}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&s||o)&&!c&&t.setAttribute(e,l=!0===l?"":l)}else e="-"===e[2]?e.slice(3):ot(ft,c)?c.slice(2):c[2]+e.slice(3),n&&ut.rel(t,e,n,!1),l&&ut.ael(t,e,l,!1)}},j=/\s/,S=t=>t?t.split(j):[],O=(t,e,n,l)=>{const o=11===e.h.nodeType&&e.h.host?e.h.host:e.h,s=t&&t.l||i,r=e.l||i;for(l in s)l in r||v(o,l,s[l],void 0,n,e.u);for(l in r)v(o,l,s[l],r[l],n,e.u)},k=(o,c,i,f)=>{const a=c.o[i];let u,$,d,h=0;if(l||(s=!0,"slot"===a.$&&(t&&f.classList.add(t+"-s"),a.u|=a.o?2:1)),null!==a.t)u=a.h=at.createTextNode(a.t);else if(1&a.u)u=a.h=at.createTextNode("");else{if(r||(r="svg"===a.$),u=a.h=at.createElementNS(r?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&a.u?"slot-fb":a.$),r&&"foreignObject"===a.$&&(r=!1),O(null,a,r),null!=t&&u["s-si"]!==t&&u.classList.add(u["s-si"]=t),a.o)for(h=0;h<a.o.length;++h)$=k(o,a,h,u),$&&u.appendChild($);"svg"===a.$?r=!1:"foreignObject"===u.tagName&&(r=!0)}return u["s-hn"]=n,3&a.u&&(u["s-sr"]=!0,u["s-cr"]=e,u["s-sn"]=a.i||"",d=o&&o.o&&o.o[i],d&&d.$===a.$&&o.h&&M(o.h,!1)),u},M=(t,e)=>{ut.u|=1;const l=t.childNodes;for(let t=l.length-1;t>=0;t--){const o=l[t];o["s-hn"]!==n&&o["s-ol"]&&(T(o).insertBefore(o,P(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),e&&M(o,e)}ut.u&=-2},C=(t,e,l,o,s,r)=>{let c,i=t["s-cr"]&&t["s-cr"].parentNode||t;for(i.shadowRoot&&i.tagName===n&&(i=i.shadowRoot);s<=r;++s)o[s]&&(c=k(null,l,s,t),c&&(o[s].h=c,i.insertBefore(c,P(e))))},R=(t,e,n,l,s)=>{for(;e<=n;++e)(l=t[e])&&(s=l.h,D(l),o=!0,s["s-ol"]?s["s-ol"].remove():M(s,!0),s.remove())},x=(t,e)=>t.$===e.$&&("slot"!==t.$||t.i===e.i),P=t=>t&&t["s-ol"]||t,T=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,E=(t,e)=>{const n=e.h=t.h,l=t.o,o=e.o,s=e.$,c=e.t;let i;null===c?(r="svg"===s||"foreignObject"!==s&&r,"slot"===s||O(t,e,r),null!==l&&null!==o?((t,e,n,l)=>{let o,s=0,r=0,c=e.length-1,i=e[0],f=e[c],a=l.length-1,u=l[0],$=l[a];for(;s<=c&&r<=a;)null==i?i=e[++s]:null==f?f=e[--c]:null==u?u=l[++r]:null==$?$=l[--a]:x(i,u)?(E(i,u),i=e[++s],u=l[++r]):x(f,$)?(E(f,$),f=e[--c],$=l[--a]):x(i,$)?("slot"!==i.$&&"slot"!==$.$||M(i.h.parentNode,!1),E(i,$),t.insertBefore(i.h,f.h.nextSibling),i=e[++s],$=l[--a]):x(f,u)?("slot"!==i.$&&"slot"!==$.$||M(f.h.parentNode,!1),E(f,u),t.insertBefore(f.h,i.h),f=e[--c],u=l[++r]):(o=k(e&&e[r],n,r,t),u=l[++r],o&&T(i.h).insertBefore(o,P(i.h)));s>c?C(t,null==l[a+1]?null:l[a+1].h,n,l,r,a):r>a&&R(e,s,c)})(n,l,e,o):null!==o?(null!==t.t&&(n.textContent=""),C(n,null,e,o,0,o.length-1)):null!==l&&R(l,0,l.length-1),r&&"svg"===s&&(r=!1)):(i=n["s-cr"])?i.parentNode.textContent=c:t.t!==c&&(n.data=c)},L=t=>{const e=t.childNodes;let n,l,o,s,r,c;for(l=0,o=e.length;l<o;l++)if(n=e[l],1===n.nodeType){if(n["s-sr"])for(r=n["s-sn"],n.hidden=!1,s=0;s<o;s++)if(c=e[s].nodeType,e[s]["s-hn"]!==n["s-hn"]||""!==r){if(1===c&&r===e[s].getAttribute("slot")){n.hidden=!0;break}}else if(1===c||3===c&&""!==e[s].textContent.trim()){n.hidden=!0;break}L(n)}},N=[],W=t=>{let e,n,l,s,r,c,i=0;const f=t.childNodes,a=f.length;for(;i<a;i++){if(e=f[i],e["s-sr"]&&(n=e["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=e["s-sn"],c=l.length-1;c>=0;c--)n=l[c],n["s-cn"]||n["s-nr"]||n["s-hn"]===e["s-hn"]||(A(n,s)?(r=N.find((t=>t.v===n)),o=!0,n["s-sn"]=n["s-sn"]||s,r?r.j=e:N.push({j:e,v:n}),n["s-sr"]&&N.map((t=>{A(t.v,n["s-sn"])&&(r=N.find((t=>t.v===n)),r&&!t.j&&(t.j=r.j))}))):N.some((t=>t.v===n))||N.push({v:n}));1===e.nodeType&&W(e)}},A=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,D=t=>{t.l&&t.l.ref&&t.l.ref(null),t.o&&t.o.map(D)},F=(t,e)=>{e&&!t.S&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.S=e)))},H=(t,e)=>{if(t.u|=16,!(4&t.u))return F(t,t.O),gt((()=>U(t,e)));t.u|=512},U=(t,e)=>{const n=t.k;let l;return e&&(t.u|=256,t.M&&(t.M.map((([t,e])=>B(n,t,e))),t.M=null),l=B(n,"componentWillLoad")),G(l,(()=>q(t,n,e)))},q=async(t,e,n)=>{const l=t.p,o=l["s-rc"];n&&(t=>{const e=t.C,n=t.p,l=e.u,o=((t,e)=>{let n=g(e);const l=it.get(n);if(t=11===t.nodeType?t:at,l)if("string"==typeof l){let e,o=w.get(t=t.head||t);o||w.set(t,o=new Set),o.has(n)||(e=at.createElement("style"),e.innerHTML=l,t.insertBefore(e,t.querySelector("link")),o&&o.add(n))}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"),2&l&&n.classList.add(o+"-s"))})(t);V(t,e),o&&(o.map((t=>t())),l["s-rc"]=void 0);{const e=l["s-p"],n=()=>_(t);0===e.length?n():(Promise.all(e).then(n),t.u|=4,e.length=0)}},V=(r,c)=>{try{c=c.render(),r.u&=-17,r.u|=2,((r,c)=>{const i=r.p,f=r.C,d=r.R||u(null,null),h=(t=>t&&t.$===$)(c)?c:a(null,null,c);if(n=i.tagName,f.P&&(h.l=h.l||{},f.P.map((([t,e])=>h.l[e]=i[t]))),h.$=null,h.u|=4,r.R=h,h.h=d.h=i.shadowRoot||i,t=i["s-sc"],e=i["s-cr"],l=0!=(1&f.u),o=!1,E(d,h),ut.u|=1,s){let t,e,n,l,o,s;W(h.h);let r=0;for(;r<N.length;r++)t=N[r],e=t.v,e["s-ol"]||(n=at.createTextNode(""),n["s-nr"]=e,e.parentNode.insertBefore(e["s-ol"]=n,e));for(r=0;r<N.length;r++)if(t=N[r],e=t.v,t.j){for(l=t.j.parentNode,o=t.j.nextSibling,n=e["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===e["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==e.parentNode||e.nextSibling!==o)&&e!==o&&(!e["s-hn"]&&e["s-ol"]&&(e["s-hn"]=e["s-ol"].parentNode.nodeName),l.insertBefore(e,o))}else 1===e.nodeType&&(e.hidden=!0)}o&&L(h.h),ut.u&=-2,N.length=0})(r,c)}catch(t){st(t,r.p)}return null},_=t=>{const e=t.p,n=t.k,l=t.O;B(n,"componentDidRender"),64&t.u||(t.u|=64,I(e),B(n,"componentDidLoad"),t.T(e),l||z()),t.L(e),t.S&&(t.S(),t.S=void 0),512&t.u&&wt((()=>H(t,!1))),t.u&=-517},z=()=>{I(at.documentElement),wt((()=>b(ft,"appload",{detail:{namespace:"mg-components"}})))},B=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){st(t)}},G=(t,e)=>t&&t.then?t.then(e):e(),I=t=>t.classList.add("hydrated"),J=(t,e,n)=>{if(e.N){t.watchers&&(e.W=t.watchers);const l=Object.entries(e.N),o=t.prototype;if(l.map((([t,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,t,{get(){return((t,e)=>et(this).A.get(e))(0,t)},set(n){((t,e,n,l)=>{const o=et(t),s=o.p,r=o.A.get(e),c=o.u,i=o.k;if(n=((t,e)=>null==t||f(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t)(n,l.N[e][0]),(!(8&c)||void 0===r)&&n!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(o.A.set(e,n),i)){if(l.W&&128&c){const t=l.W[e];t&&t.map((t=>{try{i[t](n,r,e)}catch(t){st(t,s)}}))}2==(18&c)&&H(o,!1)}})(this,t,n,e)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,t,{value(...e){const n=et(this);return n.D.then((()=>n.k[t](...e)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(t,e,l){ut.jmp((()=>{const e=n.get(t);if(this.hasOwnProperty(e))l=this[e],delete this[e];else if(o.hasOwnProperty(e)&&"number"==typeof this[e]&&this[e]==l)return;this[e]=(null!==l||"boolean"!=typeof this[e])&&l}))},t.observedAttributes=l.filter((([t,e])=>15&e[0])).map((([t,l])=>{const o=l[1]||t;return n.set(o,t),512&l[0]&&e.P.push([t,o]),o}))}}return t},K=(t,e={})=>{const n=[],l=e.exclude||[],o=ft.customElements,s=at.head,r=s.querySelector("meta[charset]"),c=at.createElement("style"),i=[];let f,a=!0;Object.assign(ut,e),ut.F=new URL(e.resourcesUrl||"./",at.baseURI).href,t.map((t=>{t[1].map((e=>{const s={u:e[0],g:e[1],N:e[2],H:e[3]};s.N=e[2],s.H=e[3],s.P=[],s.W={};const r=s.g,c=class extends HTMLElement{constructor(t){super(t),lt(t=this,s),1&s.u&&t.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),a?i.push(this):ut.jmp((()=>(t=>{if(0==(1&ut.u)){const e=et(t),n=e.C,l=()=>{};if(1&e.u)Q(t,e,n.H);else{e.u|=1,12&n.u&&(t=>{const e=t["s-cr"]=at.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)})(t);{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){F(e,e.O=n);break}}n.N&&Object.entries(n.N).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n,l,o)=>{if(0==(32&e.u)){{if(e.u|=32,(o=ct(n)).then){const t=()=>{};o=await o,t()}o.isProxied||(n.W=o.watchers,J(o,n,2),o.isProxied=!0);const t=()=>{};e.u|=8;try{new o(e)}catch(t){st(t)}e.u&=-9,e.u|=128,t()}if(o.style){let t=o.style;const e=g(n);if(!it.has(e)){const l=()=>{};((t,e,n)=>{let l=it.get(t);dt&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,it.set(t,l)})(e,t,!!(1&n.u)),l()}}}const s=e.O,r=()=>H(e,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,e,n)}l()}})(this)))}disconnectedCallback(){ut.jmp((()=>(()=>{if(0==(1&ut.u)){const t=et(this);t.U&&(t.U.map((t=>t())),t.U=void 0)}})()))}componentOnReady(){return et(this).q}};s.V=t[0],l.includes(r)||o.get(r)||(n.push(r),o.define(r,J(c,s,1)))}))})),c.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",c.setAttribute("data-styles",""),s.insertBefore(c,r?r.nextSibling:s.firstChild),a=!1,i.length?i.map((t=>t.connectedCallback())):ut.jmp((()=>f=setTimeout(z,30)))},Q=(t,e,n)=>{n&&n.map((([n,l,o])=>{const s=Y(t,n),r=X(e,o),c=Z(n);ut.ael(s,l,r,c),(e.U=e.U||[]).push((()=>ut.rel(s,l,r,c)))}))},X=(t,e)=>n=>{try{256&t.u?t.k[e](n):(t.M=t.M||[]).push([e,n])}catch(t){st(t)}},Y=(t,e)=>8&e?ft:t,Z=t=>0!=(2&t),tt=new WeakMap,et=t=>tt.get(t),nt=(t,e)=>tt.set(e.k=t,e),lt=(t,e)=>{const n={u:0,p:t,C:e,A:new Map};return n.D=new Promise((t=>n.L=t)),n.q=new Promise((t=>n.T=t)),t["s-p"]=[],t["s-rc"]=[],Q(t,n,e.H),tt.set(t,n)},ot=(t,e)=>e in t,st=(t,e)=>(0,console.error)(t,e),rt=new Map,ct=t=>{const e=t.g.replace(/-/g,"_"),n=t.V,l=rt.get(n);return l?l[e]:import(`./${n}.entry.js`).then((t=>(rt.set(n,t),t[e])),st)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},it=new Map,ft="undefined"!=typeof window?window:{},at=ft.document||{head:{}},ut={u:0,F:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},$t=t=>Promise.resolve(t),dt=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),ht=[],mt=[],pt=(t,e)=>n=>{t.push(n),c||(c=!0,e&&4&ut.u?wt(bt):ut.raf(bt))},yt=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){st(t)}t.length=0},bt=()=>{yt(ht),yt(mt),(c=ht.length>0)&&ut.raf(bt)},wt=t=>$t().then(t),gt=pt(mt,!0);export{$ as H,K as b,y as c,p as g,a as h,$t as p,nt as r}
|