@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
|
@@ -31,7 +31,6 @@ let checkSlotRelocate = false;
|
|
|
31
31
|
let isSvgMode = false;
|
|
32
32
|
let queuePending = false;
|
|
33
33
|
const win = typeof window !== 'undefined' ? window : {};
|
|
34
|
-
const CSS = win.CSS ;
|
|
35
34
|
const doc = win.document || { head: {} };
|
|
36
35
|
const plt = {
|
|
37
36
|
$flags$: 0,
|
|
@@ -42,18 +41,50 @@ const plt = {
|
|
|
42
41
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
43
42
|
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
44
43
|
};
|
|
45
|
-
const supportsShadow = /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
|
|
46
|
-
;
|
|
47
44
|
const promiseResolve = (v) => Promise.resolve(v);
|
|
48
|
-
const
|
|
45
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
49
46
|
try {
|
|
50
47
|
new CSSStyleSheet();
|
|
51
|
-
return typeof new CSSStyleSheet().
|
|
48
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
52
49
|
}
|
|
53
50
|
catch (e) { }
|
|
54
51
|
return false;
|
|
55
52
|
})()
|
|
56
53
|
;
|
|
54
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
55
|
+
if (listeners) {
|
|
56
|
+
listeners.map(([flags, name, method]) => {
|
|
57
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
58
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
59
|
+
const opts = hostListenerOpts(flags);
|
|
60
|
+
plt.ael(target, name, handler, opts);
|
|
61
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
66
|
+
try {
|
|
67
|
+
{
|
|
68
|
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
69
|
+
// instance is ready, let's call it's member method for this event
|
|
70
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
consoleError(e);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
82
|
+
if (flags & 8 /* TargetWindow */)
|
|
83
|
+
return win;
|
|
84
|
+
return elm;
|
|
85
|
+
};
|
|
86
|
+
// prettier-ignore
|
|
87
|
+
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
57
88
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
58
89
|
const createTime = (fnName, tagName = '') => {
|
|
59
90
|
{
|
|
@@ -72,9 +103,14 @@ const uniqueTime = (key, measureText) => {
|
|
|
72
103
|
const rootAppliedStyles = new WeakMap();
|
|
73
104
|
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
74
105
|
let style = styles.get(scopeId);
|
|
75
|
-
if (
|
|
106
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
76
107
|
style = (style || new CSSStyleSheet());
|
|
77
|
-
style
|
|
108
|
+
if (typeof style === 'string') {
|
|
109
|
+
style = cssText;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
style.replaceSync(cssText);
|
|
113
|
+
}
|
|
78
114
|
}
|
|
79
115
|
else {
|
|
80
116
|
style = cssText;
|
|
@@ -83,7 +119,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
|
|
|
83
119
|
};
|
|
84
120
|
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
85
121
|
let scopeId = getScopeId(cmpMeta);
|
|
86
|
-
|
|
122
|
+
const style = styles.get(scopeId);
|
|
87
123
|
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
88
124
|
// so the fallback is to always use the document for the root node in those cases
|
|
89
125
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -97,18 +133,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
|
97
133
|
}
|
|
98
134
|
if (!appliedStyles.has(scopeId)) {
|
|
99
135
|
{
|
|
100
|
-
|
|
101
|
-
styleElm = plt.$cssShim$.createHostStyle(hostElm, scopeId, style, !!(cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */));
|
|
102
|
-
const newScopeId = styleElm['s-sc'];
|
|
103
|
-
if (newScopeId) {
|
|
104
|
-
scopeId = newScopeId;
|
|
105
|
-
// we don't want to add this styleID to the appliedStyles Set
|
|
106
|
-
// since the cssVarShim might need to apply several different
|
|
107
|
-
// stylesheets for the same component
|
|
108
|
-
appliedStyles = null;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
136
|
+
{
|
|
112
137
|
styleElm = doc.createElement('style');
|
|
113
138
|
styleElm.innerHTML = style;
|
|
114
139
|
}
|
|
@@ -130,7 +155,7 @@ const attachStyles = (hostRef) => {
|
|
|
130
155
|
const elm = hostRef.$hostElement$;
|
|
131
156
|
const flags = cmpMeta.$flags$;
|
|
132
157
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
133
|
-
const scopeId = addStyle(
|
|
158
|
+
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
|
134
159
|
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
135
160
|
// only required when we're NOT using native shadow dom (slot)
|
|
136
161
|
// or this browser doesn't support native shadow dom
|
|
@@ -183,7 +208,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
183
208
|
let slotName = null;
|
|
184
209
|
let simple = false;
|
|
185
210
|
let lastSimple = false;
|
|
186
|
-
|
|
211
|
+
const vNodeChildren = [];
|
|
187
212
|
const walk = (c) => {
|
|
188
213
|
for (let i = 0; i < c.length; i++) {
|
|
189
214
|
child = c[i];
|
|
@@ -304,6 +329,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
304
329
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
305
330
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
306
331
|
}
|
|
332
|
+
else if (memberName === 'style') {
|
|
333
|
+
// update style attribute, css properties and values
|
|
334
|
+
{
|
|
335
|
+
for (const prop in oldValue) {
|
|
336
|
+
if (!newValue || newValue[prop] == null) {
|
|
337
|
+
if (prop.includes('-')) {
|
|
338
|
+
elm.style.removeProperty(prop);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
elm.style[prop] = '';
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
for (const prop in newValue) {
|
|
347
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
348
|
+
if (prop.includes('-')) {
|
|
349
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
elm.style[prop] = newValue[prop];
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
307
357
|
else if (memberName === 'ref') {
|
|
308
358
|
// minifier will clean this up
|
|
309
359
|
if (newValue) {
|
|
@@ -355,7 +405,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
355
405
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
356
406
|
try {
|
|
357
407
|
if (!elm.tagName.includes('-')) {
|
|
358
|
-
|
|
408
|
+
const n = newValue == null ? '' : newValue;
|
|
359
409
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
360
410
|
if (memberName === 'list') {
|
|
361
411
|
isProp = false;
|
|
@@ -412,7 +462,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
412
462
|
};
|
|
413
463
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
414
464
|
// tslint:disable-next-line: prefer-const
|
|
415
|
-
|
|
465
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
416
466
|
let i = 0;
|
|
417
467
|
let elm;
|
|
418
468
|
let childNode;
|
|
@@ -718,7 +768,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
718
768
|
};
|
|
719
769
|
const updateFallbackSlotVisibility = (elm) => {
|
|
720
770
|
// tslint:disable-next-line: prefer-const
|
|
721
|
-
|
|
771
|
+
const childNodes = elm.childNodes;
|
|
722
772
|
let childNode;
|
|
723
773
|
let i;
|
|
724
774
|
let ilen;
|
|
@@ -771,8 +821,8 @@ const relocateSlotContent = (elm) => {
|
|
|
771
821
|
let relocateNodeData;
|
|
772
822
|
let j;
|
|
773
823
|
let i = 0;
|
|
774
|
-
|
|
775
|
-
|
|
824
|
+
const childNodes = elm.childNodes;
|
|
825
|
+
const ilen = childNodes.length;
|
|
776
826
|
for (; i < ilen; i++) {
|
|
777
827
|
childNode = childNodes[i];
|
|
778
828
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -872,7 +922,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
872
922
|
}
|
|
873
923
|
{
|
|
874
924
|
contentRef = hostElm['s-cr'];
|
|
875
|
-
useNativeShadowDom =
|
|
925
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
876
926
|
// always reset
|
|
877
927
|
checkSlotFallbackVisibility = false;
|
|
878
928
|
}
|
|
@@ -1006,6 +1056,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1006
1056
|
const instance = hostRef.$lazyInstance$ ;
|
|
1007
1057
|
let promise;
|
|
1008
1058
|
if (isInitialLoad) {
|
|
1059
|
+
{
|
|
1060
|
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1061
|
+
if (hostRef.$queuedListeners$) {
|
|
1062
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1063
|
+
hostRef.$queuedListeners$ = null;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1009
1066
|
{
|
|
1010
1067
|
promise = safeCall(instance, 'componentWillLoad');
|
|
1011
1068
|
}
|
|
@@ -1026,9 +1083,6 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1026
1083
|
{
|
|
1027
1084
|
callRender(hostRef, instance);
|
|
1028
1085
|
}
|
|
1029
|
-
if (plt.$cssShim$) {
|
|
1030
|
-
plt.$cssShim$.updateHost(elm);
|
|
1031
|
-
}
|
|
1032
1086
|
if (rc) {
|
|
1033
1087
|
// ok, so turns out there are some child host elements
|
|
1034
1088
|
// waiting on this parent element to load
|
|
@@ -1082,6 +1136,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1082
1136
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
1083
1137
|
const instance = hostRef.$lazyInstance$ ;
|
|
1084
1138
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1139
|
+
{
|
|
1140
|
+
safeCall(instance, 'componentDidRender');
|
|
1141
|
+
}
|
|
1085
1142
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1086
1143
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1087
1144
|
{
|
|
@@ -1102,6 +1159,9 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1102
1159
|
else {
|
|
1103
1160
|
endPostUpdate();
|
|
1104
1161
|
}
|
|
1162
|
+
{
|
|
1163
|
+
hostRef.$onInstanceResolve$(elm);
|
|
1164
|
+
}
|
|
1105
1165
|
// load events fire from bottom to top
|
|
1106
1166
|
// the deepest elements load first then bubbles up
|
|
1107
1167
|
{
|
|
@@ -1257,6 +1317,16 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1257
1317
|
enumerable: true,
|
|
1258
1318
|
});
|
|
1259
1319
|
}
|
|
1320
|
+
else if (flags & 1 /* isElementConstructor */ &&
|
|
1321
|
+
memberFlags & 64 /* Method */) {
|
|
1322
|
+
// proxyComponent - method
|
|
1323
|
+
Object.defineProperty(prototype, memberName, {
|
|
1324
|
+
value(...args) {
|
|
1325
|
+
const ref = getHostRef(this);
|
|
1326
|
+
return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
|
|
1327
|
+
},
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1260
1330
|
});
|
|
1261
1331
|
if ((flags & 1 /* isElementConstructor */)) {
|
|
1262
1332
|
const attrNameToPropName = new Map();
|
|
@@ -1384,9 +1454,6 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1384
1454
|
const scopeId = getScopeId(cmpMeta);
|
|
1385
1455
|
if (!styles.has(scopeId)) {
|
|
1386
1456
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1387
|
-
if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
1388
|
-
style = await Promise.resolve().then(function () { return require('./shadow-css-8940f82d.js'); }).then((m) => m.scopeCss(style, scopeId, false));
|
|
1389
|
-
}
|
|
1390
1457
|
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1391
1458
|
endRegisterStyles();
|
|
1392
1459
|
}
|
|
@@ -1455,6 +1522,12 @@ const connectedCallback = (elm) => {
|
|
|
1455
1522
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1456
1523
|
}
|
|
1457
1524
|
}
|
|
1525
|
+
else {
|
|
1526
|
+
// not the first time this has connected
|
|
1527
|
+
// reattach any event listeners to the host
|
|
1528
|
+
// since they would have been removed when disconnected
|
|
1529
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1530
|
+
}
|
|
1458
1531
|
endConnected();
|
|
1459
1532
|
}
|
|
1460
1533
|
};
|
|
@@ -1471,10 +1544,12 @@ const setContentReference = (elm) => {
|
|
|
1471
1544
|
};
|
|
1472
1545
|
const disconnectedCallback = (elm) => {
|
|
1473
1546
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1474
|
-
getHostRef(elm);
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1547
|
+
const hostRef = getHostRef(elm);
|
|
1548
|
+
{
|
|
1549
|
+
if (hostRef.$rmListeners$) {
|
|
1550
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1551
|
+
hostRef.$rmListeners$ = undefined;
|
|
1552
|
+
}
|
|
1478
1553
|
}
|
|
1479
1554
|
}
|
|
1480
1555
|
};
|
|
@@ -1502,15 +1577,15 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1502
1577
|
{
|
|
1503
1578
|
cmpMeta.$members$ = compactMeta[2];
|
|
1504
1579
|
}
|
|
1580
|
+
{
|
|
1581
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1582
|
+
}
|
|
1505
1583
|
{
|
|
1506
1584
|
cmpMeta.$attrsToReflect$ = [];
|
|
1507
1585
|
}
|
|
1508
1586
|
{
|
|
1509
1587
|
cmpMeta.$watchers$ = {};
|
|
1510
1588
|
}
|
|
1511
|
-
if (!supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1512
|
-
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
1513
|
-
}
|
|
1514
1589
|
const tagName = cmpMeta.$tagName$;
|
|
1515
1590
|
const HostElement = class extends HTMLElement {
|
|
1516
1591
|
// StencilLazyHost
|
|
@@ -1524,14 +1599,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1524
1599
|
// and this browser supports shadow dom
|
|
1525
1600
|
// add the read-only property "shadowRoot" to the host element
|
|
1526
1601
|
// adding the shadow root build conditionals to minimize runtime
|
|
1527
|
-
|
|
1602
|
+
{
|
|
1528
1603
|
{
|
|
1529
1604
|
self.attachShadow({ mode: 'open' });
|
|
1530
1605
|
}
|
|
1531
1606
|
}
|
|
1532
|
-
else if (!('shadowRoot' in self)) {
|
|
1533
|
-
self.shadowRoot = self;
|
|
1534
|
-
}
|
|
1535
1607
|
}
|
|
1536
1608
|
}
|
|
1537
1609
|
connectedCallback() {
|
|
@@ -1589,11 +1661,15 @@ const registerHost = (elm, cmpMeta) => {
|
|
|
1589
1661
|
$cmpMeta$: cmpMeta,
|
|
1590
1662
|
$instanceValues$: new Map(),
|
|
1591
1663
|
};
|
|
1664
|
+
{
|
|
1665
|
+
hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
|
|
1666
|
+
}
|
|
1592
1667
|
{
|
|
1593
1668
|
hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
|
|
1594
1669
|
elm['s-p'] = [];
|
|
1595
1670
|
elm['s-rc'] = [];
|
|
1596
1671
|
}
|
|
1672
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1597
1673
|
return hostRefs.set(elm, hostRef);
|
|
1598
1674
|
};
|
|
1599
1675
|
const isMemberInElement = (elm, memberName) => memberName in elm;
|
|
@@ -1607,7 +1683,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1607
1683
|
if (module) {
|
|
1608
1684
|
return module[exportName];
|
|
1609
1685
|
}
|
|
1686
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
1610
1687
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1688
|
+
/* @vite-ignore */
|
|
1611
1689
|
/* webpackInclude: /\.entry\.js$/ */
|
|
1612
1690
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1613
1691
|
/* webpackMode: "lazy" */
|
|
@@ -1662,13 +1740,10 @@ const flush = () => {
|
|
|
1662
1740
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1663
1741
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1664
1742
|
|
|
1665
|
-
exports.CSS = CSS;
|
|
1666
1743
|
exports.Host = Host;
|
|
1667
1744
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1668
1745
|
exports.createEvent = createEvent;
|
|
1669
1746
|
exports.getElement = getElement;
|
|
1670
1747
|
exports.h = h;
|
|
1671
|
-
exports.plt = plt;
|
|
1672
1748
|
exports.promiseResolve = promiseResolve;
|
|
1673
1749
|
exports.registerInstance = registerInstance;
|
|
1674
|
-
exports.win = win;
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create random ID
|
|
5
|
+
*
|
|
6
|
+
* @param {string} prefix add prefix to created ID
|
|
7
|
+
* @param {number} length ID length
|
|
8
|
+
* @returns {string} ID
|
|
9
|
+
*/
|
|
10
|
+
function createID(prefix = '', length = 10) {
|
|
11
|
+
let ID = '';
|
|
12
|
+
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
13
|
+
const charsLength = chars.length;
|
|
14
|
+
for (let i = 0; i < length; i++) {
|
|
15
|
+
ID += chars.charAt(Math.floor(Math.random() * charsLength));
|
|
16
|
+
}
|
|
17
|
+
return (prefix !== '' ? `${prefix}-` : '') + ID;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Class to manage component classlist
|
|
21
|
+
* Set() are not working when imported in project
|
|
22
|
+
*/
|
|
23
|
+
class ClassList {
|
|
24
|
+
constructor(classlist = []) {
|
|
25
|
+
/**
|
|
26
|
+
* Add class
|
|
27
|
+
*
|
|
28
|
+
* @param {string} className class name to add
|
|
29
|
+
* @returns {void}
|
|
30
|
+
*/
|
|
31
|
+
this.add = (className) => {
|
|
32
|
+
if (!this.has(className)) {
|
|
33
|
+
this.classes.push(className);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Delete class
|
|
38
|
+
*
|
|
39
|
+
* @param {string} className class name to delete
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
42
|
+
this.delete = (className) => {
|
|
43
|
+
const index = this.classes.indexOf(className);
|
|
44
|
+
if (index > -1) {
|
|
45
|
+
this.classes.splice(index, 1);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Check if class exist in list
|
|
50
|
+
*
|
|
51
|
+
* @param {string} className class name to check
|
|
52
|
+
* @returns {boolean} class name is in the list
|
|
53
|
+
*/
|
|
54
|
+
this.has = (className) => {
|
|
55
|
+
return this.classes.includes(className);
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Join classes seperated by spaces
|
|
59
|
+
*
|
|
60
|
+
* @returns {string} joined values
|
|
61
|
+
*/
|
|
62
|
+
this.join = () => {
|
|
63
|
+
return this.classes.join(' ');
|
|
64
|
+
};
|
|
65
|
+
this.classes = classlist;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Check if all items are string
|
|
70
|
+
*
|
|
71
|
+
* @param {string[]} items items to check
|
|
72
|
+
* @returns {boolean} all items are string
|
|
73
|
+
*/
|
|
74
|
+
function allItemsAreString(items) {
|
|
75
|
+
return items && items.every(item => typeof item === 'string');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const errors$1 = {
|
|
79
|
+
required: "This field is required.",
|
|
80
|
+
date: {
|
|
81
|
+
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}",
|
|
82
|
+
min: "The date cannot be earlier than {min}",
|
|
83
|
+
max: "The date cannot be later than {max}",
|
|
84
|
+
minMax: "The date must be between {min} and {max}"
|
|
85
|
+
},
|
|
86
|
+
numeric: {
|
|
87
|
+
min: "The value cannot be less than {min}",
|
|
88
|
+
max: "The value cannot be greater than {max}",
|
|
89
|
+
minMax: "The value must be between {min} et {max}"
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const nbCharLeft$1 = "{counter} characters left.";
|
|
93
|
+
const input$1 = {
|
|
94
|
+
select: {
|
|
95
|
+
placeholder: "Select a value"
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const form$1 = {
|
|
99
|
+
required: "Fields with a <strong class=\"is-asterisk\">*</strong> are required",
|
|
100
|
+
allRequired: "All fields are required"
|
|
101
|
+
};
|
|
102
|
+
const message$1 = {
|
|
103
|
+
closeButton: "Close message"
|
|
104
|
+
};
|
|
105
|
+
const modal$1 = {
|
|
106
|
+
closeButton: "Close modal"
|
|
107
|
+
};
|
|
108
|
+
const pagination$1 = {
|
|
109
|
+
label: "Pagination",
|
|
110
|
+
page: "page",
|
|
111
|
+
pages: "pages",
|
|
112
|
+
nextPage: "Next page",
|
|
113
|
+
previousPage: "Previous page",
|
|
114
|
+
selectPage: "Select the page to display."
|
|
115
|
+
};
|
|
116
|
+
const panel$1 = {
|
|
117
|
+
editLabel: "Edit section title."
|
|
118
|
+
};
|
|
119
|
+
const general$1 = {
|
|
120
|
+
confirm: "Confirm",
|
|
121
|
+
cancel: "Cancel",
|
|
122
|
+
close: "Close",
|
|
123
|
+
next: "next",
|
|
124
|
+
previous: "previous"
|
|
125
|
+
};
|
|
126
|
+
const en = {
|
|
127
|
+
errors: errors$1,
|
|
128
|
+
nbCharLeft: nbCharLeft$1,
|
|
129
|
+
input: input$1,
|
|
130
|
+
form: form$1,
|
|
131
|
+
message: message$1,
|
|
132
|
+
modal: modal$1,
|
|
133
|
+
pagination: pagination$1,
|
|
134
|
+
panel: panel$1,
|
|
135
|
+
general: general$1
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const errors = {
|
|
139
|
+
required: "Ce champ est obligatoire.",
|
|
140
|
+
date: {
|
|
141
|
+
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}",
|
|
142
|
+
min: "La date ne peut pas être antérieure au {min}",
|
|
143
|
+
max: "La date ne peut pas être postérieure au {max}",
|
|
144
|
+
minMax: "La date doit être comprise entre le {min} et le {max}"
|
|
145
|
+
},
|
|
146
|
+
numeric: {
|
|
147
|
+
min: "La valeur ne peut pas être inférieure à {min}",
|
|
148
|
+
max: "La valeur ne peut pas être supérieure à {max}",
|
|
149
|
+
minMax: "La valeur doit être comprise entre {min} et {max}"
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const nbCharLeft = "{counter} caractères disponibles.";
|
|
153
|
+
const input = {
|
|
154
|
+
select: {
|
|
155
|
+
placeholder: "Sélectionnez une valeur"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const form = {
|
|
159
|
+
required: "Les champs marqués d'un <strong class=\"is-asterisk\">*</strong> sont obligatoires",
|
|
160
|
+
allRequired: "Tous les champs sont obligatoires"
|
|
161
|
+
};
|
|
162
|
+
const message = {
|
|
163
|
+
closeButton: "Fermer le message"
|
|
164
|
+
};
|
|
165
|
+
const modal = {
|
|
166
|
+
closeButton: "Fermer la modale"
|
|
167
|
+
};
|
|
168
|
+
const pagination = {
|
|
169
|
+
label: "Pagination",
|
|
170
|
+
page: "page",
|
|
171
|
+
pages: "pages",
|
|
172
|
+
nextPage: "Page suivante",
|
|
173
|
+
previousPage: "Page précédente",
|
|
174
|
+
selectPage: "Sélectionner la page à afficher."
|
|
175
|
+
};
|
|
176
|
+
const panel = {
|
|
177
|
+
editLabel: "Modifier le titre de la section."
|
|
178
|
+
};
|
|
179
|
+
const general = {
|
|
180
|
+
confirm: "Valider",
|
|
181
|
+
cancel: "Annuler",
|
|
182
|
+
close: "Fermer",
|
|
183
|
+
next: "suivant",
|
|
184
|
+
previous: "précédent"
|
|
185
|
+
};
|
|
186
|
+
const fr = {
|
|
187
|
+
errors: errors,
|
|
188
|
+
nbCharLeft: nbCharLeft,
|
|
189
|
+
input: input,
|
|
190
|
+
form: form,
|
|
191
|
+
message: message,
|
|
192
|
+
modal: modal,
|
|
193
|
+
pagination: pagination,
|
|
194
|
+
panel: panel,
|
|
195
|
+
general: general
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const defaultLocale = 'en';
|
|
199
|
+
const messages = { en, fr };
|
|
200
|
+
/**
|
|
201
|
+
* Get locale
|
|
202
|
+
*
|
|
203
|
+
* @param {HTMLElement} element element that needs to know the locale to use
|
|
204
|
+
* @returns {string} locale
|
|
205
|
+
*/
|
|
206
|
+
const getLocale = (element) => {
|
|
207
|
+
var _a;
|
|
208
|
+
return ((_a = element.closest('[lang]')) === null || _a === void 0 ? void 0 : _a.lang) || navigator.language || defaultLocale;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Get Intl object
|
|
212
|
+
* We load the defined locale but for now we only support the first subtag for messages
|
|
213
|
+
*
|
|
214
|
+
* @param {HTMLElement} element element we need to get the language
|
|
215
|
+
* @returns {{ locale: string; messages: unknown }} messages object
|
|
216
|
+
*/
|
|
217
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
218
|
+
const initLocales = (element) => {
|
|
219
|
+
// Get local
|
|
220
|
+
const locale = getLocale(element);
|
|
221
|
+
// Only keep first subtag
|
|
222
|
+
const localeSubtag = locale.split('-').shift();
|
|
223
|
+
// Return
|
|
224
|
+
return {
|
|
225
|
+
locale,
|
|
226
|
+
messages: messages[localeSubtag] || messages[defaultLocale],
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
exports.ClassList = ClassList;
|
|
231
|
+
exports.allItemsAreString = allItemsAreString;
|
|
232
|
+
exports.createID = createID;
|
|
233
|
+
exports.initLocales = initLocales;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,33 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-88560a66.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Esm v2.
|
|
8
|
+
Stencil Client Patch Esm v2.17.1 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
const patchEsm = () => {
|
|
11
|
-
// NOTE!! This fn cannot use async/await!
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
if (!(index.CSS && index.CSS.supports && index.CSS.supports('color', 'var(--c)'))) {
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "polyfills-css-shim" */ './css-shim-a22512c4.js'); }).then(() => {
|
|
16
|
-
if ((index.plt.$cssShim$ = index.win.__cssshim)) {
|
|
17
|
-
return index.plt.$cssShim$.i();
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
// for better minification
|
|
21
|
-
return 0;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
11
|
return index.promiseResolve();
|
|
26
12
|
};
|
|
27
13
|
|
|
28
14
|
const defineCustomElements = (win, options) => {
|
|
29
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
30
16
|
return patchEsm().then(() => {
|
|
31
|
-
return index.bootstrapLazy([["mg-
|
|
17
|
+
return index.bootstrapLazy([["mg-badge_21.cjs",[[1,"mg-panel",{"identifier":[1],"panelTitle":[1025,"panel-title"],"titlePattern":[1025,"title-pattern"],"titlePatternErrorMessage":[1025,"title-pattern-error-message"],"expanded":[1028],"expandToggleDisabled":[1028,"expand-toggle-disabled"],"titleEditable":[4,"title-editable"],"classList":[32],"isEditing":[32],"updatedPanelTitle":[32]}],[1,"mg-pagination",{"identifier":[1],"label":[1025],"totalPages":[2,"total-pages"],"currentPage":[1538,"current-page"]}],[1,"mg-input-textarea",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"maxlength":[2],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"pattern":[1],"patternErrorMessage":[1,"pattern-error-message"],"rows":[2],"tooltip":[1],"displayCharacterLeft":[4,"display-character-left"],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"resizable":[1],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-checkbox",{"value":[1040],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"inputVerticalList":[4,"input-vertical-list"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"checkboxItems":[32],"displayError":[64]}],[1,"mg-input-date",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"min":[1],"max":[1],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-numeric",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"type":[1],"currency":[1],"max":[2],"min":[2],"integerLength":[2,"integer-length"],"decimalLength":[2,"decimal-length"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"hasFocus":[32],"displayError":[64]}],[1,"mg-input-password",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"displayError":[64]}],[1,"mg-input-radio",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"inputVerticalList":[4,"input-vertical-list"],"required":[4],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"options":[32],"displayError":[64]}],[1,"mg-input-toggle",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"isOnOff":[4,"is-on-off"],"isIcon":[4,"is-icon"],"readonly":[4],"disabled":[4],"tooltip":[1],"helpText":[1,"help-text"],"classList":[32],"options":[32],"checked":[32]}],[1,"mg-message",{"identifier":[1],"delay":[2],"variant":[1],"closeButton":[1028,"close-button"],"hide":[1028],"classList":[32],"hasActions":[32]}],[4,"mg-tabs",{"identifier":[1],"label":[1],"size":[1],"items":[16],"activeTab":[1538,"active-tab"],"tabs":[32],"classList":[32]}],[1,"mg-form",{"identifier":[1],"name":[1],"readonly":[4],"disabled":[4],"valid":[1028],"invalid":[1028],"classList":[32],"displayError":[64]}],[1,"mg-tag",{"variant":[1],"outline":[4],"classList":[32]}],[1,"mg-input-text",{"value":[1537],"identifier":[1],"name":[1],"label":[1],"type":[1],"icon":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1],"maxlength":[2],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"pattern":[1],"patternErrorMessage":[1,"pattern-error-message"],"tooltip":[1],"displayCharacterLeft":[4,"display-character-left"],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"setFocus":[64],"displayError":[64]}],[1,"mg-input-select",{"value":[1032],"items":[16],"identifier":[1],"name":[1],"label":[1],"labelOnTop":[4,"label-on-top"],"labelHide":[4,"label-hide"],"placeholder":[1025],"placeholderHide":[4,"placeholder-hide"],"placeholderDisabled":[4,"placeholder-disabled"],"required":[4],"readonly":[4],"disabled":[4],"mgWidth":[8,"mg-width"],"tooltip":[1],"helpText":[1,"help-text"],"valid":[1028],"invalid":[1028],"classList":[32],"errorMessage":[32],"options":[32],"valueExist":[32],"readonlyValue":[32],"displayError":[64]}],[1,"mg-badge",{"value":[1032],"label":[1],"variant":[1],"outline":[4],"classList":[32]}],[2,"mg-character-left",{"identifier":[1],"characters":[1],"maxlength":[2]}],[6,"mg-button",{"variant":[1],"identifier":[1],"label":[1],"disabled":[1028],"isIcon":[4,"is-icon"],"disableOnClick":[4,"disable-on-click"],"expanded":[4],"controls":[1],"haspopup":[8],"loading":[32],"classList":[32]}],[6,"mg-input-title",{"identifier":[1],"required":[4],"isLegend":[4,"is-legend"],"tagName":[32]}],[6,"mg-tooltip",{"identifier":[1],"message":[1],"placement":[1],"display":[1028],"disabled":[1028]}],[1,"mg-icon",{"icon":[1],"size":[1],"variant":[1],"spin":[4],"classList":[32]}]]],["mg-modal.cjs",[[1,"mg-modal",{"identifier":[1],"modalTitle":[1,"modal-title"],"closeButton":[1028,"close-button"],"hide":[1028],"hasActions":[32],"hasContent":[32],"classList":[32]},[[8,"keydown","handleKeyDown"]]]]],["mg-popover.cjs",[[6,"mg-popover",{"identifier":[1],"placement":[1],"closeButton":[4,"close-button"],"display":[1028],"disabled":[1028]}]]]], options);
|
|
32
18
|
});
|
|
33
19
|
};
|
|
34
20
|
|