@mgdis/mg-components 3.1.0 → 4.0.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-85a4a0b6.js → index-88560a66.js} +123 -48
- package/dist/cjs/index-a39c5567.js +233 -0
- package/dist/cjs/loader.cjs.js +3 -17
- package/dist/cjs/mg-badge_21.cjs.entry.js +3538 -0
- package/dist/cjs/mg-components.cjs.js +3 -7
- package/dist/cjs/mg-modal.cjs.entry.js +117 -0
- package/dist/cjs/mg-popover.cjs.entry.js +170 -0
- package/dist/cjs/popper-71bf3058.js +1790 -0
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/atoms/mg-badge/{mg-badge.stories.js → doc/mg-badge.stories.js} +4 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +0 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +26 -10
- package/dist/collection/components/atoms/mg-button/{mg-button.stories.js → doc/mg-button.stories.js} +7 -2
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +46 -49
- package/dist/collection/components/atoms/mg-button/mg-button.js +78 -4
- package/dist/collection/components/atoms/mg-character-left/{mg-character-left.stories.js → doc/mg-character-left.stories.js} +8 -0
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +20 -46
- package/dist/collection/components/atoms/mg-icon/{mg-icon.stories.js → doc/mg-icon.stories.js} +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +104 -9
- package/dist/collection/components/atoms/mg-icon/mg-icon.css +9 -7
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +33 -7
- package/dist/collection/components/atoms/mg-input-title/{mg-input-title.stories.js → doc/mg-input-title.stories.js} +0 -0
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.css +4 -4
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +14 -3
- package/dist/collection/components/atoms/mg-tag/{mg-tag.stories.js → doc/mg-tag.stories.js} +4 -1
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +28 -6
- package/dist/collection/components/atoms/mg-tooltip/{mg-tooltip.stories.js → doc/mg-tooltip.stories.js} +14 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.conf.js +20 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +16 -2
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +1 -7
- package/dist/collection/components/molecules/inputs/MgInput.js +25 -29
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.js → doc/mg-input-checkbox.stories.js} +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +25 -11
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +102 -52
- package/dist/collection/components/molecules/inputs/mg-input-date/{mg-input-date.stories.js → doc/mg-input-date.stories.js} +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +37 -9
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +136 -66
- package/dist/collection/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.js → doc/mg-input-numeric.stories.js} +15 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +38 -10
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +180 -80
- package/dist/collection/components/molecules/inputs/mg-input-password/{mg-input-password.stories.js → doc/mg-input-password.stories.js} +16 -2
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +37 -9
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +108 -47
- package/dist/collection/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.js → doc/mg-input-radio.stories.js} +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +25 -11
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +113 -42
- package/dist/collection/components/molecules/inputs/mg-input-select/{mg-input-select.stories.js → doc/mg-input-select.stories.js} +22 -2
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +39 -10
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +145 -71
- package/dist/collection/components/molecules/inputs/mg-input-text/{mg-input-text.stories.js → doc/mg-input-text.stories.js} +17 -8
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +69 -19
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +184 -83
- package/dist/collection/components/molecules/inputs/mg-input-textarea/{mg-input-textarea.stories.js → doc/mg-input-textarea.stories.js} +16 -5
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +69 -13
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +163 -70
- package/dist/collection/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.js → doc/mg-input-toggle.stories.js} +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +22 -10
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +68 -33
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +58 -0
- package/dist/collection/components/molecules/mg-form/mg-form.css +19 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +271 -0
- package/dist/collection/components/molecules/mg-message/{mg-message.stories.js → doc/mg-message.stories.js} +6 -2
- package/dist/collection/components/molecules/mg-message/mg-message.css +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +26 -11
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +51 -0
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +52 -0
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +240 -0
- package/dist/collection/components/molecules/mg-pagination/{mg-pagination.stories.js → doc/mg-pagination.stories.js} +1 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +47 -28
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +39 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +53 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +356 -0
- package/dist/collection/components/molecules/mg-popover/{mg-popover.stories.js → doc/mg-popover.stories.js} +10 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.conf.js +20 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +37 -12
- package/dist/collection/components/molecules/mg-tabs/{mg-tabs.stories.js → doc/mg-tabs.stories.js} +20 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +11 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +17 -3
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +139 -26
- package/dist/collection/locales/index.js +33 -4
- package/dist/collection/stories/helpers.stories.js +33 -0
- package/dist/collection/utils/components.utils.js +16 -9
- package/dist/collection/utils/locale.utils.js +13 -7
- package/dist/collection/utils/test.utils.js +27 -15
- package/dist/collection/variables.css +39 -5
- package/dist/collection/variables.scss +39 -5
- package/dist/components/MgInput.js +26 -37
- package/dist/components/components.utils.js +16 -9
- package/dist/components/index.d.ts +24 -6
- package/dist/components/index.js +23 -0
- package/dist/components/index2.js +116 -17
- package/dist/components/locale.utils.js +13 -8
- package/dist/components/mg-badge2.js +25 -9
- package/dist/components/mg-button2.js +29 -5
- package/dist/components/mg-character-left2.js +14 -26
- package/dist/components/mg-form.d.ts +11 -0
- package/dist/components/mg-form.js +148 -0
- package/dist/components/mg-icon2.js +138 -17
- package/dist/components/mg-input-checkbox.js +66 -53
- package/dist/components/mg-input-date.js +100 -69
- package/dist/components/mg-input-numeric.js +125 -81
- package/dist/components/mg-input-password.js +69 -48
- package/dist/components/mg-input-radio.js +74 -46
- package/dist/components/mg-input-select2.js +103 -71
- package/dist/components/mg-input-text.js +1 -237
- package/dist/components/mg-input-text2.js +300 -0
- package/dist/components/mg-input-textarea.js +100 -46
- package/dist/components/mg-input-title2.js +13 -4
- package/dist/components/mg-input-toggle.js +39 -31
- package/dist/components/mg-message.js +25 -10
- package/dist/components/mg-modal.d.ts +11 -0
- package/dist/components/mg-modal.js +153 -0
- package/dist/components/mg-pagination.js +45 -31
- package/dist/components/mg-panel.d.ts +11 -0
- package/dist/components/mg-panel.js +244 -0
- package/dist/components/mg-popover.js +31 -11
- package/dist/components/mg-tabs.js +113 -23
- package/dist/components/mg-tag.js +27 -5
- package/dist/components/mg-tooltip2.js +10 -1
- package/dist/components/popper.js +6 -2
- package/dist/esm/{index-e3e84606.js → index-bca81100.js} +124 -46
- package/dist/esm/index-e51ae032.js +228 -0
- package/dist/esm/loader.js +3 -17
- package/dist/esm/mg-badge_21.entry.js +3514 -0
- package/dist/esm/mg-components.js +3 -7
- package/dist/esm/mg-modal.entry.js +113 -0
- package/dist/esm/mg-popover.entry.js +166 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/popper-93ecb064.js +1788 -0
- package/dist/index.js +1 -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-003a1344.entry.js +1 -0
- package/dist/mg-components/p-462d648a.entry.js +1 -0
- package/dist/mg-components/p-4c66f794.js +1 -0
- package/dist/mg-components/p-5126ab10.entry.js +1 -0
- package/dist/mg-components/p-780bd52d.js +1 -0
- package/dist/mg-components/p-b14a3443.js +2 -0
- package/dist/mg-components/variables.css +39 -5
- package/dist/mg-components/variables.scss +39 -5
- package/dist/types/components/atoms/mg-badge/{mg-badge.stories.d.ts → doc/mg-badge.stories.d.ts} +5 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +16 -5
- package/dist/types/components/atoms/mg-button/{mg-button.stories.d.ts → doc/mg-button.stories.d.ts} +5 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +23 -3
- package/dist/types/components/atoms/mg-character-left/{mg-character-left.stories.d.ts → doc/mg-character-left.stories.d.ts} +9 -0
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +16 -13
- package/dist/types/components/atoms/mg-icon/{mg-icon.stories.d.ts → doc/mg-icon.stories.d.ts} +0 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +1 -1
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +14 -4
- package/dist/types/components/atoms/mg-input-title/{mg-input-title.stories.d.ts → doc/mg-input-title.stories.d.ts} +0 -0
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +11 -1
- package/dist/types/components/atoms/mg-tag/{mg-tag.stories.d.ts → doc/mg-tag.stories.d.ts} +5 -0
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +18 -4
- package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +29 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.conf.d.ts +8 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +13 -3
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +6 -4
- package/dist/types/components/molecules/inputs/MgInput.d.ts +7 -8
- package/dist/types/components/molecules/inputs/mg-input-checkbox/{mg-input-checkbox.stories.d.ts → doc/mg-input-checkbox.stories.d.ts} +5 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +36 -13
- package/dist/types/components/molecules/inputs/mg-input-date/{mg-input-date.stories.d.ts → doc/mg-input-date.stories.d.ts} +5 -0
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +46 -15
- package/dist/types/components/molecules/inputs/mg-input-numeric/{mg-input-numeric.stories.d.ts → doc/mg-input-numeric.stories.d.ts} +11 -0
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +61 -16
- package/dist/types/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.d.ts +22 -0
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +35 -11
- package/dist/types/components/molecules/inputs/mg-input-radio/{mg-input-radio.stories.d.ts → doc/mg-input-radio.stories.d.ts} +5 -0
- 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-radio/mg-input-radio.d.ts +42 -9
- package/dist/types/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.d.ts +34 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +37 -9
- package/dist/types/components/molecules/inputs/mg-input-text/{mg-input-text.stories.d.ts → doc/mg-input-text.stories.d.ts} +13 -0
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +52 -16
- package/dist/types/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.d.ts +19 -0
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +45 -17
- package/dist/types/components/molecules/inputs/mg-input-toggle/{mg-input-toggle.stories.d.ts → doc/mg-input-toggle.stories.d.ts} +5 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +29 -12
- package/dist/types/components/molecules/{mg-popover/mg-popover.stories.d.ts → mg-form/doc/mg-form.stories.d.ts} +3 -4
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +83 -0
- package/dist/types/components/molecules/mg-message/{mg-message.stories.d.ts → doc/mg-message.stories.d.ts} +10 -0
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +13 -4
- package/dist/types/components/molecules/mg-modal/doc/mg-modal.stories.d.ts +13 -0
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +85 -0
- package/dist/types/components/molecules/mg-pagination/{mg-pagination.stories.d.ts → doc/mg-pagination.stories.d.ts} +5 -0
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +31 -7
- package/dist/types/components/molecules/mg-panel/doc/mg-panel.stories.d.ts +11 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +139 -0
- package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +25 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.conf.d.ts +8 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +27 -4
- package/dist/types/components/molecules/mg-tabs/doc/mg-tabs.stories.d.ts +20 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +11 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +70 -6
- package/dist/types/components.d.ts +528 -211
- package/dist/types/locales/index.d.ts +108 -38
- package/dist/types/stories/{buttons.stories.d.ts → helpers.stories.d.ts} +1 -1
- package/dist/types/utils/components.utils.d.ts +16 -9
- package/dist/types/utils/locale.utils.d.ts +13 -6
- package/dist/types/utils/test.utils.d.ts +13 -1
- package/loader/index.js +1 -1
- package/package.json +45 -14
- package/readme.md +9 -35
- package/dist/cjs/css-shim-a22512c4.js +0 -6
- package/dist/cjs/mg-badge_20.cjs.entry.js +0 -4661
- package/dist/cjs/shadow-css-8940f82d.js +0 -390
- package/dist/collection/stories/buttons.stories.js +0 -43
- package/dist/collection/stories/messages.stories.js +0 -44
- package/dist/collection/stories/tags.stories.js +0 -13
- package/dist/esm/css-shim-7c240feb.js +0 -4
- package/dist/esm/mg-badge_20.entry.js +0 -4638
- package/dist/esm/shadow-css-5d2d01ce.js +0 -388
- package/dist/esm-es5/css-shim-7c240feb.js +0 -1
- package/dist/esm-es5/index-e3e84606.js +0 -1
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +0 -1
- package/dist/esm-es5/mg-badge_20.entry.js +0 -2
- package/dist/esm-es5/mg-components.js +0 -1
- package/dist/esm-es5/shadow-css-5d2d01ce.js +0 -12
- package/dist/mg-components/mg-components.js +0 -132
- package/dist/mg-components/p-1cd24462.system.js +0 -1
- package/dist/mg-components/p-2e2f6b27.system.entry.js +0 -2
- package/dist/mg-components/p-366a224e.js +0 -1
- package/dist/mg-components/p-422c429b.system.js +0 -1
- package/dist/mg-components/p-50ea2036.system.js +0 -1
- package/dist/mg-components/p-62fa3797.js +0 -1
- package/dist/mg-components/p-71d57b8b.system.js +0 -13
- package/dist/mg-components/p-9a215712.system.js +0 -1
- package/dist/mg-components/p-cbf0464b.entry.js +0 -1
- package/dist/mg-components/p-f6455ab3.js +0 -12
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.stories.d.ts +0 -11
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.stories.d.ts +0 -9
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.stories.d.ts +0 -14
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.stories.d.ts +0 -6
- package/dist/types/components/molecules/mg-tabs/mg-tabs.stories.d.ts +0 -7
- package/dist/types/stories/messages.stories.d.ts +0 -13
- package/dist/types/stories/tags.stories.d.ts +0 -5
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
import { c as createID } from './components.utils.js';
|
|
3
3
|
import { c as createPopper } from './popper.js';
|
|
4
4
|
|
|
5
|
-
const mgTooltipCss = ".sc-mg-tooltip-h{display:inline-block}.mg-tooltip.sc-mg-tooltip{display:none;padding:0.5rem 0.8rem;z-index:9999;border-radius:var(--mg-tooltip-border-radius);background-color:hsl(var(--mg-tooltip-background-color));color:hsl(var(--mg-tooltip-font-color));text-align:start}.mg-tooltip[data-show].sc-mg-tooltip{display:block}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip,.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{position:absolute;width:0.8rem;height:0.8rem;z-index:9999;background:inherit}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip{visibility:hidden}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{visibility:visible;content:\"\"
|
|
5
|
+
const mgTooltipCss = ".sc-mg-tooltip-h{display:inline-block}.mg-tooltip.sc-mg-tooltip{display:none;padding:0.5rem 0.8rem;z-index:9999;border-radius:var(--mg-tooltip-border-radius);background-color:hsl(var(--mg-tooltip-background-color));color:hsl(var(--mg-tooltip-font-color));text-align:start}.mg-tooltip[data-show].sc-mg-tooltip{display:block}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip,.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{position:absolute;width:0.8rem;height:0.8rem;z-index:9999;background:inherit}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip{visibility:hidden}.mg-tooltip.sc-mg-tooltip .mg-tooltip__arrow.sc-mg-tooltip::before{visibility:visible;content:\"\";transform:rotate(45deg)}.mg-tooltip[data-popper-placement^=top].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{bottom:-4px}.mg-tooltip[data-popper-placement^=bottom].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{top:-4px}.mg-tooltip[data-popper-placement^=left].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{right:-4px}.mg-tooltip[data-popper-placement^=right].sc-mg-tooltip>.mg-tooltip__arrow.sc-mg-tooltip{left:-4px}";
|
|
6
6
|
|
|
7
7
|
const MgTooltip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
@@ -27,6 +27,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
27
27
|
this.disabled = false;
|
|
28
28
|
/**
|
|
29
29
|
* Show tooltip
|
|
30
|
+
*
|
|
30
31
|
* @returns {void}
|
|
31
32
|
*/
|
|
32
33
|
this.show = () => {
|
|
@@ -39,6 +40,7 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
39
40
|
};
|
|
40
41
|
/**
|
|
41
42
|
* Hide tooltip
|
|
43
|
+
*
|
|
42
44
|
* @returns {void}
|
|
43
45
|
*/
|
|
44
46
|
this.hide = () => {
|
|
@@ -63,6 +65,8 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
63
65
|
* Get slotted element
|
|
64
66
|
* Check if it already contain an interactive element, if not we need to add a tabIndex attribute
|
|
65
67
|
* We need to attach the focused element to the tooltip (aria-describedby)
|
|
68
|
+
*
|
|
69
|
+
* @returns {void}
|
|
66
70
|
*/
|
|
67
71
|
componentDidLoad() {
|
|
68
72
|
var _a;
|
|
@@ -117,6 +121,11 @@ const MgTooltip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
117
121
|
});
|
|
118
122
|
this.handleDisplay(this.display);
|
|
119
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Render
|
|
126
|
+
*
|
|
127
|
+
* @returns {HTMLElement} HTML Element
|
|
128
|
+
*/
|
|
120
129
|
render() {
|
|
121
130
|
return (h(Host, null, h("slot", null), h("div", { role: "tooltip", id: this.identifier, class: "mg-tooltip", innerHTML: this.message }, h("div", { class: "mg-tooltip__arrow", "data-popper-arrow": true }))));
|
|
122
131
|
}
|
|
@@ -298,6 +298,10 @@ function getContainingBlock(element) {
|
|
|
298
298
|
|
|
299
299
|
var currentNode = getParentNode(element);
|
|
300
300
|
|
|
301
|
+
if (isShadowRoot(currentNode)) {
|
|
302
|
+
currentNode = currentNode.host;
|
|
303
|
+
}
|
|
304
|
+
|
|
301
305
|
while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
|
|
302
306
|
var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
|
|
303
307
|
// create a containing block.
|
|
@@ -521,7 +525,7 @@ function mapToStyles(_ref2) {
|
|
|
521
525
|
|
|
522
526
|
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
523
527
|
sideY = bottom;
|
|
524
|
-
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
528
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
|
|
525
529
|
offsetParent[heightProp];
|
|
526
530
|
y -= offsetY - popperRect.height;
|
|
527
531
|
y *= gpuAcceleration ? 1 : -1;
|
|
@@ -529,7 +533,7 @@ function mapToStyles(_ref2) {
|
|
|
529
533
|
|
|
530
534
|
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
531
535
|
sideX = right;
|
|
532
|
-
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
536
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
|
|
533
537
|
offsetParent[widthProp];
|
|
534
538
|
x -= offsetX - popperRect.width;
|
|
535
539
|
x *= gpuAcceleration ? 1 : -1;
|
|
@@ -9,7 +9,6 @@ let checkSlotRelocate = false;
|
|
|
9
9
|
let isSvgMode = false;
|
|
10
10
|
let queuePending = false;
|
|
11
11
|
const win = typeof window !== 'undefined' ? window : {};
|
|
12
|
-
const CSS = win.CSS ;
|
|
13
12
|
const doc = win.document || { head: {} };
|
|
14
13
|
const plt = {
|
|
15
14
|
$flags$: 0,
|
|
@@ -20,18 +19,50 @@ const plt = {
|
|
|
20
19
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
21
20
|
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
22
21
|
};
|
|
23
|
-
const supportsShadow = /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
|
|
24
|
-
;
|
|
25
22
|
const promiseResolve = (v) => Promise.resolve(v);
|
|
26
|
-
const
|
|
23
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
27
24
|
try {
|
|
28
25
|
new CSSStyleSheet();
|
|
29
|
-
return typeof new CSSStyleSheet().
|
|
26
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
30
27
|
}
|
|
31
28
|
catch (e) { }
|
|
32
29
|
return false;
|
|
33
30
|
})()
|
|
34
31
|
;
|
|
32
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
33
|
+
if (listeners) {
|
|
34
|
+
listeners.map(([flags, name, method]) => {
|
|
35
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
36
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
37
|
+
const opts = hostListenerOpts(flags);
|
|
38
|
+
plt.ael(target, name, handler, opts);
|
|
39
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
44
|
+
try {
|
|
45
|
+
{
|
|
46
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
47
|
+
// instance is ready, let's call it's member method for this event
|
|
48
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
consoleError(e);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
60
|
+
if (flags & 8 /* TargetWindow */)
|
|
61
|
+
return win;
|
|
62
|
+
return elm;
|
|
63
|
+
};
|
|
64
|
+
// prettier-ignore
|
|
65
|
+
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
35
66
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
36
67
|
const createTime = (fnName, tagName = '') => {
|
|
37
68
|
{
|
|
@@ -50,9 +81,14 @@ const uniqueTime = (key, measureText) => {
|
|
|
50
81
|
const rootAppliedStyles = new WeakMap();
|
|
51
82
|
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
52
83
|
let style = styles.get(scopeId);
|
|
53
|
-
if (
|
|
84
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
54
85
|
style = (style || new CSSStyleSheet());
|
|
55
|
-
style
|
|
86
|
+
if (typeof style === 'string') {
|
|
87
|
+
style = cssText;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
style.replaceSync(cssText);
|
|
91
|
+
}
|
|
56
92
|
}
|
|
57
93
|
else {
|
|
58
94
|
style = cssText;
|
|
@@ -61,7 +97,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
61
97
|
};
|
|
62
98
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
63
99
|
let scopeId = getScopeId(cmpMeta);
|
|
64
|
-
|
|
100
|
+
const style = styles.get(scopeId);
|
|
65
101
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
66
102
|
// so the fallback is to always use the document for the root node in those cases
|
|
67
103
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -75,18 +111,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
75
111
|
}
|
|
76
112
|
if (!appliedStyles.has(scopeId)) {
|
|
77
113
|
{
|
|
78
|
-
|
|
79
|
-
styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */));
|
|
80
|
-
const newScopeId = styleElm['s-sc'];
|
|
81
|
-
if (newScopeId) {
|
|
82
|
-
scopeId = newScopeId;
|
|
83
|
-
// we don't want to add this styleID to the appliedStyles Set
|
|
84
|
-
// since the cssVarShim might need to apply several different
|
|
85
|
-
// stylesheets for the same component
|
|
86
|
-
appliedStyles = null;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
114
|
+
{
|
|
90
115
|
styleElm = doc.createElement('style');
|
|
91
116
|
styleElm.innerHTML = style;
|
|
92
117
|
}
|
|
@@ -108,7 +133,7 @@ const attachStyles = (hostRef) => {
|
|
|
108
133
|
const elm = hostRef.$hostElement$;
|
|
109
134
|
const flags = cmpMeta.$flags$;
|
|
110
135
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
111
|
-
const scopeId = addStyle(
|
|
136
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
112
137
|
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
113
138
|
// only required when we're NOT using native shadow dom (slot)
|
|
114
139
|
// or this browser doesn't support native shadow dom
|
|
@@ -161,7 +186,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
161
186
|
let slotName = null;
|
|
162
187
|
let simple = false;
|
|
163
188
|
let lastSimple = false;
|
|
164
|
-
|
|
189
|
+
const vNodeChildren = [];
|
|
165
190
|
const walk = (c) => {
|
|
166
191
|
for (let i = 0; i < c.length; i++) {
|
|
167
192
|
child = c[i];
|
|
@@ -282,6 +307,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
282
307
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
283
308
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
284
309
|
}
|
|
310
|
+
else if (memberName === 'style') {
|
|
311
|
+
// update style attribute, css properties and values
|
|
312
|
+
{
|
|
313
|
+
for (const prop in oldValue) {
|
|
314
|
+
if (!newValue || newValue[prop] == null) {
|
|
315
|
+
if (prop.includes('-')) {
|
|
316
|
+
elm.style.removeProperty(prop);
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
elm.style[prop] = '';
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
for (const prop in newValue) {
|
|
325
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
326
|
+
if (prop.includes('-')) {
|
|
327
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
elm.style[prop] = newValue[prop];
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
285
335
|
else if (memberName === 'ref') {
|
|
286
336
|
// minifier will clean this up
|
|
287
337
|
if (newValue) {
|
|
@@ -333,7 +383,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
333
383
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
334
384
|
try {
|
|
335
385
|
if (!elm.tagName.includes('-')) {
|
|
336
|
-
|
|
386
|
+
const n = newValue == null ? '' : newValue;
|
|
337
387
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
338
388
|
if (memberName === 'list') {
|
|
339
389
|
isProp = false;
|
|
@@ -390,7 +440,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
390
440
|
};
|
|
391
441
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
392
442
|
// tslint:disable-next-line: prefer-const
|
|
393
|
-
|
|
443
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
394
444
|
let i = 0;
|
|
395
445
|
let elm;
|
|
396
446
|
let childNode;
|
|
@@ -696,7 +746,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
696
746
|
};
|
|
697
747
|
const updateFallbackSlotVisibility = (elm) => {
|
|
698
748
|
// tslint:disable-next-line: prefer-const
|
|
699
|
-
|
|
749
|
+
const childNodes = elm.childNodes;
|
|
700
750
|
let childNode;
|
|
701
751
|
let i;
|
|
702
752
|
let ilen;
|
|
@@ -749,8 +799,8 @@ const relocateSlotContent = (elm) => {
|
|
|
749
799
|
let relocateNodeData;
|
|
750
800
|
let j;
|
|
751
801
|
let i = 0;
|
|
752
|
-
|
|
753
|
-
|
|
802
|
+
const childNodes = elm.childNodes;
|
|
803
|
+
const ilen = childNodes.length;
|
|
754
804
|
for (; i < ilen; i++) {
|
|
755
805
|
childNode = childNodes[i];
|
|
756
806
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -850,7 +900,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
850
900
|
}
|
|
851
901
|
{
|
|
852
902
|
contentRef = hostElm['s-cr'];
|
|
853
|
-
useNativeShadowDom =
|
|
903
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
854
904
|
// always reset
|
|
855
905
|
checkSlotFallbackVisibility = false;
|
|
856
906
|
}
|
|
@@ -984,6 +1034,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
984
1034
|
const instance = hostRef.$lazyInstance$ ;
|
|
985
1035
|
let promise;
|
|
986
1036
|
if (isInitialLoad) {
|
|
1037
|
+
{
|
|
1038
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1039
|
+
if (hostRef.$queuedListeners$) {
|
|
1040
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1041
|
+
hostRef.$queuedListeners$ = null;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
987
1044
|
{
|
|
988
1045
|
promise = safeCall(instance, 'componentWillLoad');
|
|
989
1046
|
}
|
|
@@ -1004,9 +1061,6 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1004
1061
|
{
|
|
1005
1062
|
callRender(hostRef, instance);
|
|
1006
1063
|
}
|
|
1007
|
-
if (plt.$cssShim$) {
|
|
1008
|
-
plt.$cssShim$.updateHost(elm);
|
|
1009
|
-
}
|
|
1010
1064
|
if (rc) {
|
|
1011
1065
|
// ok, so turns out there are some child host elements
|
|
1012
1066
|
// waiting on this parent element to load
|
|
@@ -1060,6 +1114,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1060
1114
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1061
1115
|
const instance = hostRef.$lazyInstance$ ;
|
|
1062
1116
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1117
|
+
{
|
|
1118
|
+
safeCall(instance, 'componentDidRender');
|
|
1119
|
+
}
|
|
1063
1120
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1064
1121
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1065
1122
|
{
|
|
@@ -1080,6 +1137,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1080
1137
|
else {
|
|
1081
1138
|
endPostUpdate();
|
|
1082
1139
|
}
|
|
1140
|
+
{
|
|
1141
|
+
hostRef.$onInstanceResolve$(elm);
|
|
1142
|
+
}
|
|
1083
1143
|
// load events fire from bottom to top
|
|
1084
1144
|
// the deepest elements load first then bubbles up
|
|
1085
1145
|
{
|
|
@@ -1235,6 +1295,16 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1235
1295
|
enumerable: true,
|
|
1236
1296
|
});
|
|
1237
1297
|
}
|
|
1298
|
+
else if (flags & 1 /* isElementConstructor */ &&
|
|
1299
|
+
memberFlags & 64 /* Method */) {
|
|
1300
|
+
// proxyComponent - method
|
|
1301
|
+
Object.defineProperty(prototype, memberName, {
|
|
1302
|
+
value(...args) {
|
|
1303
|
+
const ref = getHostRef(this);
|
|
1304
|
+
return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
|
|
1305
|
+
},
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1238
1308
|
});
|
|
1239
1309
|
if ((flags & 1 /* isElementConstructor */)) {
|
|
1240
1310
|
const attrNameToPropName = new Map();
|
|
@@ -1362,9 +1432,6 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1362
1432
|
const scopeId = getScopeId(cmpMeta);
|
|
1363
1433
|
if (!styles.has(scopeId)) {
|
|
1364
1434
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1365
|
-
if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
1366
|
-
style = await import('./shadow-css-5d2d01ce.js').then((m) => m.scopeCss(style, scopeId, false));
|
|
1367
|
-
}
|
|
1368
1435
|
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1369
1436
|
endRegisterStyles();
|
|
1370
1437
|
}
|
|
@@ -1433,6 +1500,12 @@ const connectedCallback = (elm) => {
|
|
|
1433
1500
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1434
1501
|
}
|
|
1435
1502
|
}
|
|
1503
|
+
else {
|
|
1504
|
+
// not the first time this has connected
|
|
1505
|
+
// reattach any event listeners to the host
|
|
1506
|
+
// since they would have been removed when disconnected
|
|
1507
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1508
|
+
}
|
|
1436
1509
|
endConnected();
|
|
1437
1510
|
}
|
|
1438
1511
|
};
|
|
@@ -1449,10 +1522,12 @@ const setContentReference = (elm) => {
|
|
|
1449
1522
|
};
|
|
1450
1523
|
const disconnectedCallback = (elm) => {
|
|
1451
1524
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1452
|
-
getHostRef(elm);
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1525
|
+
const hostRef = getHostRef(elm);
|
|
1526
|
+
{
|
|
1527
|
+
if (hostRef.$rmListeners$) {
|
|
1528
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1529
|
+
hostRef.$rmListeners$ = undefined;
|
|
1530
|
+
}
|
|
1456
1531
|
}
|
|
1457
1532
|
}
|
|
1458
1533
|
};
|
|
@@ -1480,15 +1555,15 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1480
1555
|
{
|
|
1481
1556
|
cmpMeta.$members$ = compactMeta[2];
|
|
1482
1557
|
}
|
|
1558
|
+
{
|
|
1559
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1560
|
+
}
|
|
1483
1561
|
{
|
|
1484
1562
|
cmpMeta.$attrsToReflect$ = [];
|
|
1485
1563
|
}
|
|
1486
1564
|
{
|
|
1487
1565
|
cmpMeta.$watchers$ = {};
|
|
1488
1566
|
}
|
|
1489
|
-
if (!supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1490
|
-
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
1491
|
-
}
|
|
1492
1567
|
const tagName = cmpMeta.$tagName$;
|
|
1493
1568
|
const HostElement = class extends HTMLElement {
|
|
1494
1569
|
// StencilLazyHost
|
|
@@ -1502,14 +1577,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1502
1577
|
// and this browser supports shadow dom
|
|
1503
1578
|
// add the read-only property "shadowRoot" to the host element
|
|
1504
1579
|
// adding the shadow root build conditionals to minimize runtime
|
|
1505
|
-
|
|
1580
|
+
{
|
|
1506
1581
|
{
|
|
1507
1582
|
self.attachShadow({ mode: 'open' });
|
|
1508
1583
|
}
|
|
1509
1584
|
}
|
|
1510
|
-
else if (!('shadowRoot' in self)) {
|
|
1511
|
-
self.shadowRoot = self;
|
|
1512
|
-
}
|
|
1513
1585
|
}
|
|
1514
1586
|
}
|
|
1515
1587
|
connectedCallback() {
|
|
@@ -1567,11 +1639,15 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1567
1639
|
$cmpMeta$: cmpMeta,
|
|
1568
1640
|
$instanceValues$: new Map(),
|
|
1569
1641
|
};
|
|
1642
|
+
{
|
|
1643
|
+
hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
|
|
1644
|
+
}
|
|
1570
1645
|
{
|
|
1571
1646
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
1572
1647
|
elm['s-p'] = [];
|
|
1573
1648
|
elm['s-rc'] = [];
|
|
1574
1649
|
}
|
|
1650
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1575
1651
|
return hostRefs.set(elm, hostRef);
|
|
1576
1652
|
};
|
|
1577
1653
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
@@ -1585,7 +1661,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1585
1661
|
if (module) {
|
|
1586
1662
|
return module[exportName];
|
|
1587
1663
|
}
|
|
1664
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
1588
1665
|
return import(
|
|
1666
|
+
/* @vite-ignore */
|
|
1589
1667
|
/* webpackInclude: /\.entry\.js$/ */
|
|
1590
1668
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1591
1669
|
/* webpackMode: "lazy" */
|
|
@@ -1640,4 +1718,4 @@ const flush = () => {
|
|
|
1640
1718
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1641
1719
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1642
1720
|
|
|
1643
|
-
export {
|
|
1721
|
+
export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create random ID
|
|
3
|
+
*
|
|
4
|
+
* @param {string} prefix add prefix to created ID
|
|
5
|
+
* @param {number} length ID length
|
|
6
|
+
* @returns {string} ID
|
|
7
|
+
*/
|
|
8
|
+
function createID(prefix = '', length = 10) {
|
|
9
|
+
let ID = '';
|
|
10
|
+
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
11
|
+
const charsLength = chars.length;
|
|
12
|
+
for (let i = 0; i < length; i++) {
|
|
13
|
+
ID += chars.charAt(Math.floor(Math.random() * charsLength));
|
|
14
|
+
}
|
|
15
|
+
return (prefix !== '' ? `${prefix}-` : '') + ID;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Class to manage component classlist
|
|
19
|
+
* Set() are not working when imported in project
|
|
20
|
+
*/
|
|
21
|
+
class ClassList {
|
|
22
|
+
constructor(classlist = []) {
|
|
23
|
+
/**
|
|
24
|
+
* Add class
|
|
25
|
+
*
|
|
26
|
+
* @param {string} className class name to add
|
|
27
|
+
* @returns {void}
|
|
28
|
+
*/
|
|
29
|
+
this.add = (className) => {
|
|
30
|
+
if (!this.has(className)) {
|
|
31
|
+
this.classes.push(className);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Delete class
|
|
36
|
+
*
|
|
37
|
+
* @param {string} className class name to delete
|
|
38
|
+
* @returns {void}
|
|
39
|
+
*/
|
|
40
|
+
this.delete = (className) => {
|
|
41
|
+
const index = this.classes.indexOf(className);
|
|
42
|
+
if (index > -1) {
|
|
43
|
+
this.classes.splice(index, 1);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Check if class exist in list
|
|
48
|
+
*
|
|
49
|
+
* @param {string} className class name to check
|
|
50
|
+
* @returns {boolean} class name is in the list
|
|
51
|
+
*/
|
|
52
|
+
this.has = (className) => {
|
|
53
|
+
return this.classes.includes(className);
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Join classes seperated by spaces
|
|
57
|
+
*
|
|
58
|
+
* @returns {string} joined values
|
|
59
|
+
*/
|
|
60
|
+
this.join = () => {
|
|
61
|
+
return this.classes.join(' ');
|
|
62
|
+
};
|
|
63
|
+
this.classes = classlist;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Check if all items are string
|
|
68
|
+
*
|
|
69
|
+
* @param {string[]} items items to check
|
|
70
|
+
* @returns {boolean} all items are string
|
|
71
|
+
*/
|
|
72
|
+
function allItemsAreString(items) {
|
|
73
|
+
return items && items.every(item => typeof item === 'string');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const errors$1 = {
|
|
77
|
+
required: "This field is required.",
|
|
78
|
+
date: {
|
|
79
|
+
badInput: "The date format must be <span aria-hidden=\"true\">mm/dd/yyyy</span><span class=\"sr-only\">m m / d d / y y y y</span> and the date must be greater than {min}",
|
|
80
|
+
min: "The date cannot be earlier than {min}",
|
|
81
|
+
max: "The date cannot be later than {max}",
|
|
82
|
+
minMax: "The date must be between {min} and {max}"
|
|
83
|
+
},
|
|
84
|
+
numeric: {
|
|
85
|
+
min: "The value cannot be less than {min}",
|
|
86
|
+
max: "The value cannot be greater than {max}",
|
|
87
|
+
minMax: "The value must be between {min} et {max}"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const nbCharLeft$1 = "{counter} characters left.";
|
|
91
|
+
const input$1 = {
|
|
92
|
+
select: {
|
|
93
|
+
placeholder: "Select a value"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const form$1 = {
|
|
97
|
+
required: "Fields with a <strong class=\"is-asterisk\">*</strong> are required",
|
|
98
|
+
allRequired: "All fields are required"
|
|
99
|
+
};
|
|
100
|
+
const message$1 = {
|
|
101
|
+
closeButton: "Close message"
|
|
102
|
+
};
|
|
103
|
+
const modal$1 = {
|
|
104
|
+
closeButton: "Close modal"
|
|
105
|
+
};
|
|
106
|
+
const pagination$1 = {
|
|
107
|
+
label: "Pagination",
|
|
108
|
+
page: "page",
|
|
109
|
+
pages: "pages",
|
|
110
|
+
nextPage: "Next page",
|
|
111
|
+
previousPage: "Previous page",
|
|
112
|
+
selectPage: "Select the page to display."
|
|
113
|
+
};
|
|
114
|
+
const panel$1 = {
|
|
115
|
+
editLabel: "Edit section title."
|
|
116
|
+
};
|
|
117
|
+
const general$1 = {
|
|
118
|
+
confirm: "Confirm",
|
|
119
|
+
cancel: "Cancel",
|
|
120
|
+
close: "Close",
|
|
121
|
+
next: "next",
|
|
122
|
+
previous: "previous"
|
|
123
|
+
};
|
|
124
|
+
const en = {
|
|
125
|
+
errors: errors$1,
|
|
126
|
+
nbCharLeft: nbCharLeft$1,
|
|
127
|
+
input: input$1,
|
|
128
|
+
form: form$1,
|
|
129
|
+
message: message$1,
|
|
130
|
+
modal: modal$1,
|
|
131
|
+
pagination: pagination$1,
|
|
132
|
+
panel: panel$1,
|
|
133
|
+
general: general$1
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const errors = {
|
|
137
|
+
required: "Ce champ est obligatoire.",
|
|
138
|
+
date: {
|
|
139
|
+
badInput: "Le format de la date doit être du type <span aria-hidden=\"true\">jj/mm/aaaa</span><span class=\"sr-only\">j j / m m / a a a a</span> et la date supérieure au {min}",
|
|
140
|
+
min: "La date ne peut pas être antérieure au {min}",
|
|
141
|
+
max: "La date ne peut pas être postérieure au {max}",
|
|
142
|
+
minMax: "La date doit être comprise entre le {min} et le {max}"
|
|
143
|
+
},
|
|
144
|
+
numeric: {
|
|
145
|
+
min: "La valeur ne peut pas être inférieure à {min}",
|
|
146
|
+
max: "La valeur ne peut pas être supérieure à {max}",
|
|
147
|
+
minMax: "La valeur doit être comprise entre {min} et {max}"
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const nbCharLeft = "{counter} caractères disponibles.";
|
|
151
|
+
const input = {
|
|
152
|
+
select: {
|
|
153
|
+
placeholder: "Sélectionnez une valeur"
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const form = {
|
|
157
|
+
required: "Les champs marqués d'un <strong class=\"is-asterisk\">*</strong> sont obligatoires",
|
|
158
|
+
allRequired: "Tous les champs sont obligatoires"
|
|
159
|
+
};
|
|
160
|
+
const message = {
|
|
161
|
+
closeButton: "Fermer le message"
|
|
162
|
+
};
|
|
163
|
+
const modal = {
|
|
164
|
+
closeButton: "Fermer la modale"
|
|
165
|
+
};
|
|
166
|
+
const pagination = {
|
|
167
|
+
label: "Pagination",
|
|
168
|
+
page: "page",
|
|
169
|
+
pages: "pages",
|
|
170
|
+
nextPage: "Page suivante",
|
|
171
|
+
previousPage: "Page précédente",
|
|
172
|
+
selectPage: "Sélectionner la page à afficher."
|
|
173
|
+
};
|
|
174
|
+
const panel = {
|
|
175
|
+
editLabel: "Modifier le titre de la section."
|
|
176
|
+
};
|
|
177
|
+
const general = {
|
|
178
|
+
confirm: "Valider",
|
|
179
|
+
cancel: "Annuler",
|
|
180
|
+
close: "Fermer",
|
|
181
|
+
next: "suivant",
|
|
182
|
+
previous: "précédent"
|
|
183
|
+
};
|
|
184
|
+
const fr = {
|
|
185
|
+
errors: errors,
|
|
186
|
+
nbCharLeft: nbCharLeft,
|
|
187
|
+
input: input,
|
|
188
|
+
form: form,
|
|
189
|
+
message: message,
|
|
190
|
+
modal: modal,
|
|
191
|
+
pagination: pagination,
|
|
192
|
+
panel: panel,
|
|
193
|
+
general: general
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const defaultLocale = 'en';
|
|
197
|
+
const messages = { en, fr };
|
|
198
|
+
/**
|
|
199
|
+
* Get locale
|
|
200
|
+
*
|
|
201
|
+
* @param {HTMLElement} element element that needs to know the locale to use
|
|
202
|
+
* @returns {string} locale
|
|
203
|
+
*/
|
|
204
|
+
const getLocale = (element) => {
|
|
205
|
+
var _a;
|
|
206
|
+
return ((_a = element.closest('[lang]')) === null || _a === void 0 ? void 0 : _a.lang) || navigator.language || defaultLocale;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Get Intl object
|
|
210
|
+
* We load the defined locale but for now we only support the first subtag for messages
|
|
211
|
+
*
|
|
212
|
+
* @param {HTMLElement} element element we need to get the language
|
|
213
|
+
* @returns {{ locale: string; messages: unknown }} messages object
|
|
214
|
+
*/
|
|
215
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
216
|
+
const initLocales = (element) => {
|
|
217
|
+
// Get local
|
|
218
|
+
const locale = getLocale(element);
|
|
219
|
+
// Only keep first subtag
|
|
220
|
+
const localeSubtag = locale.split('-').shift();
|
|
221
|
+
// Return
|
|
222
|
+
return {
|
|
223
|
+
locale,
|
|
224
|
+
messages: messages[localeSubtag] || messages[defaultLocale],
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export { ClassList as C, allItemsAreString as a, createID as c, initLocales as i };
|