@mgdis/mg-components 5.9.1 → 5.10.1
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/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_31.cjs.entry.js +345 -648
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +19 -43
- package/dist/cjs/{mg-menu.conf-9afe6571.js → mg-menu.conf-196151fe.js} +16 -21
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +9 -12
- package/dist/collection/components/atoms/mg-button/mg-button.js +18 -27
- package/dist/collection/components/atoms/mg-card/mg-card.js +22 -15
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +1 -4
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +26 -23
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +1 -4
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +11 -16
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +12 -34
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +4 -1
- package/dist/collection/components/molecules/inputs/MgInput.js +26 -24
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +10 -20
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +7 -17
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +14 -34
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +6 -13
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +10 -27
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +21 -45
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +17 -43
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +14 -22
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +17 -28
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +11 -29
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +20 -47
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +11 -23
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -6
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -27
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -4
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +4 -12
- package/dist/collection/components/molecules/mg-message/mg-message.js +12 -20
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -17
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +11 -19
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -30
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +8 -21
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +3 -8
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +20 -36
- package/dist/collection/locales/index.js +2 -3
- package/dist/collection/utils/behaviors.utils.js +16 -32
- package/dist/collection/utils/components.utils.js +22 -33
- package/dist/collection/utils/locale.utils.js +14 -18
- package/dist/collection/utils/unit.test.utils.js +7 -15
- package/dist/components/MgInput.js +30 -24
- package/dist/components/components.utils.js +22 -33
- package/dist/components/index2.js +16 -21
- package/dist/components/mg-action-more.js +9 -21
- package/dist/components/mg-badge2.js +9 -12
- package/dist/components/mg-button2.js +18 -27
- package/dist/components/mg-card2.js +20 -13
- package/dist/components/mg-character-left2.js +1 -4
- package/dist/components/mg-details.js +1 -6
- package/dist/components/mg-divider.js +1 -2
- package/dist/components/mg-form.js +7 -23
- package/dist/components/mg-icon2.js +26 -23
- package/dist/components/mg-illustrated-message.js +1 -4
- package/dist/components/mg-input-checkbox.js +9 -16
- package/dist/components/mg-input-date.js +6 -13
- package/dist/components/mg-input-numeric.js +13 -30
- package/dist/components/mg-input-password.js +5 -9
- package/dist/components/mg-input-radio.js +9 -23
- package/dist/components/mg-input-select2.js +20 -41
- package/dist/components/mg-input-text2.js +15 -35
- package/dist/components/mg-input-textarea.js +13 -18
- package/dist/components/mg-input-title2.js +1 -4
- package/dist/components/mg-input-toggle.js +16 -24
- package/dist/components/mg-item-more.js +18 -42
- package/dist/components/mg-menu-item2.js +17 -44
- package/dist/components/mg-menu2.js +9 -27
- package/dist/components/mg-message.js +12 -20
- package/dist/components/mg-modal.js +8 -17
- package/dist/components/mg-pagination.js +11 -19
- package/dist/components/mg-panel.js +11 -30
- package/dist/components/mg-popover2.js +8 -21
- package/dist/components/mg-skip-links.js +3 -8
- package/dist/components/mg-tabs.js +20 -36
- package/dist/components/mg-tag.js +11 -16
- package/dist/components/mg-tooltip2.js +12 -34
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_31.entry.js +345 -648
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-item-more.entry.js +19 -43
- package/dist/esm/{mg-menu.conf-881fbd82.js → mg-menu.conf-9ca023ee.js} +16 -21
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-67ce7cb8.entry.js → p-97aaca3e.entry.js} +1 -1
- package/dist/mg-components/p-d891e707.entry.js +1 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +2 -5
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +5 -14
- package/dist/types/components/atoms/mg-card/mg-card.d.ts +11 -8
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +1 -4
- package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +1 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +8 -7
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -4
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +3 -8
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +11 -33
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -1
- package/dist/types/components/molecules/inputs/MgInput.d.ts +5 -6
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +5 -11
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +4 -11
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +7 -26
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +3 -7
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -18
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +9 -22
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +3 -23
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -9
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -11
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +10 -29
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +21 -49
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +3 -15
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +1 -6
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +3 -19
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +1 -4
- package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +2 -12
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +4 -12
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +3 -12
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +5 -14
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +4 -23
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +3 -16
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +2 -7
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +15 -30
- package/dist/types/components.d.ts +22 -34
- package/dist/types/locales/index.d.ts +2 -3
- package/dist/types/utils/behaviors.utils.d.ts +14 -29
- package/dist/types/utils/components.utils.d.ts +19 -29
- package/dist/types/utils/locale.utils.d.ts +14 -18
- package/dist/types/utils/unit.test.utils.d.ts +11 -24
- package/package.json +11 -12
- package/dist/mg-components/p-9a93b7af.entry.js +0 -1
- /package/dist/mg-components/{p-367f92d2.js → p-0d3146d9.js} +0 -0
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["mg-action-more_31.cjs",[[1,"mg-action-more",{"icon":[16],"button":[16],"items":[16],"displayChevron":[4,"display-chevron"],"expanded":[32]}],[1,"mg-panel",{"identifier":[1],"panelTitle":[1025,"panel-title"],"titlePattern":[
|
|
20
|
+
return index.bootstrapLazy([["mg-action-more_31.cjs",[[1,"mg-action-more",{"icon":[16],"button":[16],"items":[16],"displayChevron":[4,"display-chevron"],"expanded":[32]}],[1,"mg-panel",{"identifier":[1],"panelTitle":[1025,"panel-title"],"titlePattern":[1,"title-pattern"],"titlePatternErrorMessage":[1,"title-pattern-error-message"],"expanded":[1028],"expandToggleDisabled":[4,"expand-toggle-disabled"],"titleEditable":[4,"title-editable"],"classCollection":[32],"isEditing":[32],"updatedPanelTitle":[32]}],[1,"mg-pagination",{"identifier":[1],"label":[1025],"hideNavigationLabels":[4,"hide-navigation-labels"],"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],"classCollection":[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],"classCollection":[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],"classCollection":[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],"classCollection":[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],"classCollection":[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],"classCollection":[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"],"classCollection":[32],"options":[32],"checked":[32]}],[1,"mg-message",{"identifier":[1],"delay":[2],"variant":[1],"closeButton":[1028,"close-button"],"hide":[1028],"classCollection":[32],"hasActions":[32]}],[1,"mg-modal",{"identifier":[1],"modalTitle":[1,"modal-title"],"closeButton":[4,"close-button"],"hide":[1028],"hasActions":[32],"hasContent":[32],"classCollection":[32]},[[8,"keydown","handleKeyDown"]]],[1,"mg-tabs",{"identifier":[1],"label":[1],"size":[1],"items":[16],"activeTab":[1538,"active-tab"],"tabs":[32],"classCollection":[32]}],[1,"mg-details",{"toggleClosed":[1,"toggle-closed"],"toggleOpened":[1,"toggle-opened"],"hideSummary":[4,"hide-summary"],"expanded":[1028]}],[1,"mg-divider",{"size":[1]}],[1,"mg-form",{"identifier":[1],"name":[1],"readonly":[4],"disabled":[4],"valid":[1028],"invalid":[1028],"classCollection":[32],"requiredMessage":[32],"displayError":[64]}],[1,"mg-illustrated-message",{"size":[1],"direction":[1]}],[1,"mg-skip-links",{"links":[16]}],[1,"mg-tag",{"variant":[1],"outline":[4],"soft":[4],"classCollection":[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],"classCollection":[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],"classCollection":[32],"errorMessage":[32],"options":[32],"valueExist":[32],"readonlyValue":[32],"displayError":[64]}],[1,"mg-menu-item",{"identifier":[1],"href":[1],"status":[1537],"expanded":[1028],"size":[32],"navigationButtonClassList":[32],"direction":[32],"isInMainMenu":[32],"isItemMore":[32],"hasChildren":[32],"displayNotificationBadge":[32]}],[1,"mg-menu",{"label":[1],"direction":[513],"itemmore":[16],"size":[1],"isChildMenu":[32]}],[1,"mg-popover",{"identifier":[1],"placement":[1],"arrowHide":[4,"arrow-hide"],"closeButton":[4,"close-button"],"display":[1028],"disabled":[4],"classCollection":[32]}],[2,"mg-character-left",{"identifier":[1],"characters":[1],"maxlength":[2]}],[1,"mg-badge",{"value":[8],"label":[1],"variant":[1],"outline":[4],"classCollection":[32]}],[1,"mg-card",{"variant":[1],"variantStyle":[1025,"variant-style"],"classCollection":[32]}],[1,"mg-button",{"variant":[1],"identifier":[1],"label":[1],"type":[1],"fullWidth":[4,"full-width"],"form":[1],"disabled":[1028],"isIcon":[4,"is-icon"],"disableOnClick":[4,"disable-on-click"],"loading":[32],"classCollection":[32]}],[6,"mg-input-title",{"identifier":[1],"required":[4],"isLegend":[4,"is-legend"],"tagName":[32]}],[1,"mg-tooltip",{"identifier":[1],"message":[1],"placement":[1],"display":[1028],"disabled":[4]}],[1,"mg-icon",{"icon":[1],"size":[1],"variant":[1],"variantStyle":[1025,"variant-style"],"spin":[4],"classCollection":[32]}]]],["mg-item-more.cjs",[[1,"mg-item-more",{"icon":[16],"slotlabel":[16],"size":[1],"parentMenu":[32]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-9e1091ab.js');
|
|
6
|
-
const mgMenu_conf = require('./mg-menu.conf-
|
|
6
|
+
const mgMenu_conf = require('./mg-menu.conf-196151fe.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* MgItemMore type guard
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
12
|
-
* @returns {boolean} truthy if element is mg-item-more
|
|
10
|
+
* @param element - element to control type
|
|
11
|
+
* @returns truthy if element is mg-item-more
|
|
13
12
|
*/
|
|
14
13
|
const isMgItemMore = (element) => element.nodeName === 'MG-ITEM-MORE';
|
|
15
14
|
var OverflowBehaviorElements;
|
|
@@ -26,8 +25,6 @@ class OverflowBehavior {
|
|
|
26
25
|
**********/
|
|
27
26
|
/**
|
|
28
27
|
* Disconnect ResizeObserver
|
|
29
|
-
*
|
|
30
|
-
* @returns {void}
|
|
31
28
|
*/
|
|
32
29
|
this.disconnect = () => {
|
|
33
30
|
this._resizeObserver.disconnect();
|
|
@@ -37,9 +34,7 @@ class OverflowBehavior {
|
|
|
37
34
|
************/
|
|
38
35
|
/**
|
|
39
36
|
* run overflow behavior
|
|
40
|
-
*
|
|
41
|
-
* @param {number} width width of the container. Optional.
|
|
42
|
-
* @returns {void}
|
|
37
|
+
* @param width - width of the container. Optional.
|
|
43
38
|
*/
|
|
44
39
|
this.run = (width) => {
|
|
45
40
|
if (this._moreElement === undefined) {
|
|
@@ -62,16 +57,13 @@ class OverflowBehavior {
|
|
|
62
57
|
};
|
|
63
58
|
/**
|
|
64
59
|
* Get interactive children filtred by authorized nodeName ['MG-MENU-ITEM', 'MG-BUTTON']
|
|
65
|
-
*
|
|
66
|
-
* @
|
|
67
|
-
* @returns {Element[]} children
|
|
60
|
+
* @param element - element to parse
|
|
61
|
+
* @returns children
|
|
68
62
|
*/
|
|
69
63
|
this.getInteractiveItems = (element) => { var _a; return (((_a = element.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? Array.from(element.children) : []).filter(element => ['MG-MENU-ITEM', 'MG-BUTTON'].includes(element.nodeName)); };
|
|
70
64
|
/**
|
|
71
65
|
* Update displayed items in container from a given available space
|
|
72
|
-
*
|
|
73
|
-
* @param {number} availableWidth available width in container to display child items
|
|
74
|
-
* @returns {void}
|
|
66
|
+
* @param availableWidth - available width in container to display child items
|
|
75
67
|
*/
|
|
76
68
|
this.updateDisplayedItems = (availableWidth) => {
|
|
77
69
|
this.restoreItems();
|
|
@@ -90,11 +82,10 @@ class OverflowBehavior {
|
|
|
90
82
|
};
|
|
91
83
|
/**
|
|
92
84
|
* Utility method to know if item overflow partialy or totaly in the container
|
|
93
|
-
*
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
96
|
-
* @
|
|
97
|
-
* @returns {boolean} truthy if element is overflow
|
|
85
|
+
* @param cumulateWidth - previous sibling elements cumulate width + item width
|
|
86
|
+
* @param item - item HTML element
|
|
87
|
+
* @param availableWidth - container available width
|
|
88
|
+
* @returns truthy if element is overflow
|
|
98
89
|
*/
|
|
99
90
|
this.isOverflowElement = (cumulateWidth, item, availableWidth) => {
|
|
100
91
|
if (item.previousElementSibling === null || this.isMoreElement(item))
|
|
@@ -106,17 +97,14 @@ class OverflowBehavior {
|
|
|
106
97
|
};
|
|
107
98
|
/**
|
|
108
99
|
* Utility method to know if a given element is the 'MORE' element
|
|
109
|
-
*
|
|
110
|
-
* @
|
|
111
|
-
* @returns {boolean} truthy if element is the 'MORE' element
|
|
100
|
+
* @param element - element to match with 'MORE' element
|
|
101
|
+
* @returns truthy if element is the 'MORE' element
|
|
112
102
|
*/
|
|
113
103
|
this.isMoreElement = (element) => element.nodeName === 'MG-ITEM-MORE';
|
|
114
104
|
/**
|
|
115
105
|
* Toggle display item element
|
|
116
|
-
*
|
|
117
|
-
* @param
|
|
118
|
-
* @param {boolean} isHidden is item hidden
|
|
119
|
-
* @returns {void}
|
|
106
|
+
* @param item - item to control
|
|
107
|
+
* @param isHidden - is item hidden
|
|
120
108
|
*/
|
|
121
109
|
this.toggleItem = (item, isHidden) => {
|
|
122
110
|
const mgActionMenuindex = Number(item.getAttribute(OverflowBehaviorElements.BASE_INDEX));
|
|
@@ -129,10 +117,8 @@ class OverflowBehavior {
|
|
|
129
117
|
};
|
|
130
118
|
/**
|
|
131
119
|
* Toggle element's hidde attribute
|
|
132
|
-
*
|
|
133
|
-
* @param
|
|
134
|
-
* @param {boolean} isHidden element is hidden
|
|
135
|
-
* @returns {void}
|
|
120
|
+
* @param element - element to toggle
|
|
121
|
+
* @param isHidden - element is hidden
|
|
136
122
|
*/
|
|
137
123
|
this.toggleElement = (element, isHidden) => {
|
|
138
124
|
if (isHidden)
|
|
@@ -142,8 +128,6 @@ class OverflowBehavior {
|
|
|
142
128
|
};
|
|
143
129
|
/**
|
|
144
130
|
* Remove hidden attributes on all items
|
|
145
|
-
*
|
|
146
|
-
* @returns {void}
|
|
147
131
|
*/
|
|
148
132
|
this.restoreItems = () => {
|
|
149
133
|
[...this._baseChildren, this._moreElement].forEach(item => item.removeAttribute('hidden'));
|
|
@@ -175,8 +159,7 @@ const MgItemMore = class {
|
|
|
175
159
|
***********/
|
|
176
160
|
/**
|
|
177
161
|
* render mg-item-more overflow element
|
|
178
|
-
*
|
|
179
|
-
* @returns {HTMLMgItemMoreElement} mg-item-more element
|
|
162
|
+
* @returns mg-item-more element
|
|
180
163
|
*/
|
|
181
164
|
this.renderMgMenuItemOverflowElement = () => {
|
|
182
165
|
// create menu items proxy element from item clones
|
|
@@ -225,16 +208,12 @@ const MgItemMore = class {
|
|
|
225
208
|
*************/
|
|
226
209
|
/**
|
|
227
210
|
* Disconnect overflow ResizeObserver
|
|
228
|
-
*
|
|
229
|
-
* @returns {void} run overflow resize obeserver disconnexion
|
|
230
211
|
*/
|
|
231
212
|
disconnectedCallback() {
|
|
232
213
|
this.overflowBehavior.disconnect();
|
|
233
214
|
}
|
|
234
215
|
/**
|
|
235
216
|
* Set variables and validate props
|
|
236
|
-
*
|
|
237
|
-
* @returns {void}
|
|
238
217
|
*/
|
|
239
218
|
componentWillLoad() {
|
|
240
219
|
// init variables
|
|
@@ -248,16 +227,13 @@ const MgItemMore = class {
|
|
|
248
227
|
}
|
|
249
228
|
/**
|
|
250
229
|
* Add overflow behavior
|
|
251
|
-
*
|
|
252
|
-
* @returns {void}
|
|
253
230
|
*/
|
|
254
231
|
componentDidLoad() {
|
|
255
232
|
this.overflowBehavior = new OverflowBehavior(this.parentMenu, this.renderMgMenuItemOverflowElement);
|
|
256
233
|
}
|
|
257
234
|
/**
|
|
258
235
|
* Render
|
|
259
|
-
*
|
|
260
|
-
* @returns {HTMLElement} HTML Element
|
|
236
|
+
* @returns HTML Element
|
|
261
237
|
*/
|
|
262
238
|
render() {
|
|
263
239
|
return (index.h(index.Host, { role: "menuitem", "aria-haspopup": "true" }, index.h("mg-menu-item", { "data-overflow-more": true, "data-size": this.parentMenu.size }, index.h("mg-icon", { icon: this.icon.icon, slot: "image" }), index.h("span", { class: { 'sr-only': !this.slotlabel.display }, slot: "label" }, this.slotlabel.label), index.h("mg-menu", { direction: mgMenu_conf.Direction.VERTICAL, label: this.messages.moreLabel, size: this.size }))));
|
|
@@ -152,21 +152,19 @@ const fr = {
|
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
154
|
* Format number to the locale currency
|
|
155
|
-
*
|
|
156
|
-
* @param
|
|
157
|
-
* @param
|
|
158
|
-
* @
|
|
159
|
-
* @returns {string} formatted currency
|
|
155
|
+
* @param number - number to format
|
|
156
|
+
* @param locale - locale to apply
|
|
157
|
+
* @param currency - currency to apply
|
|
158
|
+
* @returns formatted currency
|
|
160
159
|
*/
|
|
161
160
|
const localeCurrency = (number, locale, currency) => {
|
|
162
161
|
return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);
|
|
163
162
|
};
|
|
164
163
|
/**
|
|
165
164
|
* Format number to locale
|
|
166
|
-
*
|
|
167
|
-
* @param
|
|
168
|
-
* @
|
|
169
|
-
* @returns {string} formatted number
|
|
165
|
+
* @param number - number to format
|
|
166
|
+
* @param locale - locale to apply
|
|
167
|
+
* @returns formatted number
|
|
170
168
|
*/
|
|
171
169
|
const localeNumber = (number, locale) => {
|
|
172
170
|
return new Intl.NumberFormat(locale).format(number);
|
|
@@ -177,10 +175,9 @@ const localeNumber = (number, locale) => {
|
|
|
177
175
|
const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
|
|
178
176
|
/**
|
|
179
177
|
* Locale date format
|
|
180
|
-
*
|
|
181
|
-
* @param
|
|
182
|
-
* @
|
|
183
|
-
* @returns {string} formatted date
|
|
178
|
+
* @param date - date to format
|
|
179
|
+
* @param locale - locale to apply
|
|
180
|
+
* @returns formatted date
|
|
184
181
|
*/
|
|
185
182
|
const localeDate = (date, locale) => {
|
|
186
183
|
if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {
|
|
@@ -191,11 +188,10 @@ const localeDate = (date, locale) => {
|
|
|
191
188
|
/**
|
|
192
189
|
* Get locale and messages
|
|
193
190
|
* We load the defined locale but for now we only support the first subtag for messages
|
|
194
|
-
*
|
|
195
|
-
* @param
|
|
196
|
-
* @param
|
|
197
|
-
* @
|
|
198
|
-
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
191
|
+
* @param element - element we need to get the language
|
|
192
|
+
* @param messages - messages to use
|
|
193
|
+
* @param defaultLocale - default messages locale
|
|
194
|
+
* @returns messages object
|
|
199
195
|
*/
|
|
200
196
|
const getLocaleMessages = (element, messages, defaultLocale) => {
|
|
201
197
|
// Get local
|
|
@@ -215,9 +211,8 @@ const defaultLocale = 'en';
|
|
|
215
211
|
const messages = { en, fr };
|
|
216
212
|
/**
|
|
217
213
|
* Get Intl object
|
|
218
|
-
*
|
|
219
|
-
* @
|
|
220
|
-
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
214
|
+
* @param element - element we need to get the language
|
|
215
|
+
* @returns messages object
|
|
221
216
|
*/
|
|
222
217
|
const initLocales = (element) => getLocaleMessages(element, messages, defaultLocale);
|
|
223
218
|
|
|
@@ -12,7 +12,7 @@ export class MgBadge {
|
|
|
12
12
|
this.label = undefined;
|
|
13
13
|
this.variant = variants[0];
|
|
14
14
|
this.outline = undefined;
|
|
15
|
-
this.
|
|
15
|
+
this.classCollection = new ClassList(['mg-badge']);
|
|
16
16
|
}
|
|
17
17
|
validateValue(newValue) {
|
|
18
18
|
if (`${newValue}`.match(/^(\d+\+*|[?*!a-z])$/i) === null) {
|
|
@@ -30,21 +30,19 @@ export class MgBadge {
|
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
32
|
if (oldValue !== undefined) {
|
|
33
|
-
this.
|
|
33
|
+
this.classCollection.delete(`mg-badge--${oldValue}`);
|
|
34
34
|
}
|
|
35
|
-
this.
|
|
35
|
+
this.classCollection.add(`mg-badge--${newValue}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
validateOutline(newValue) {
|
|
39
39
|
if (newValue)
|
|
40
|
-
this.
|
|
40
|
+
this.classCollection.add(this.classOutline);
|
|
41
41
|
else
|
|
42
|
-
this.
|
|
42
|
+
this.classCollection.delete(this.classOutline);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Check if props are well configured on init
|
|
46
|
-
*
|
|
47
|
-
* @returns {void}
|
|
48
46
|
*/
|
|
49
47
|
componentWillLoad() {
|
|
50
48
|
this.validateValue(this.value);
|
|
@@ -54,11 +52,10 @@ export class MgBadge {
|
|
|
54
52
|
}
|
|
55
53
|
/**
|
|
56
54
|
* Render
|
|
57
|
-
*
|
|
58
|
-
* @returns {HTMLElement} HTML Element
|
|
55
|
+
* @returns HTML Element
|
|
59
56
|
*/
|
|
60
57
|
render() {
|
|
61
|
-
return (h("span", { class: this.
|
|
58
|
+
return (h("span", { class: this.classCollection.join() }, h("span", { class: "mg-badge__value" }, this.value), h("span", { class: "sr-only" }, this.label)));
|
|
62
59
|
}
|
|
63
60
|
static get is() { return "mg-badge"; }
|
|
64
61
|
static get encapsulation() { return "shadow"; }
|
|
@@ -76,7 +73,7 @@ export class MgBadge {
|
|
|
76
73
|
return {
|
|
77
74
|
"value": {
|
|
78
75
|
"type": "any",
|
|
79
|
-
"mutable":
|
|
76
|
+
"mutable": false,
|
|
80
77
|
"complexType": {
|
|
81
78
|
"original": "string | number",
|
|
82
79
|
"resolved": "number | string",
|
|
@@ -152,7 +149,7 @@ export class MgBadge {
|
|
|
152
149
|
}
|
|
153
150
|
static get states() {
|
|
154
151
|
return {
|
|
155
|
-
"
|
|
152
|
+
"classCollection": {}
|
|
156
153
|
};
|
|
157
154
|
}
|
|
158
155
|
static get watchers() {
|
|
@@ -12,9 +12,7 @@ export class MgButton {
|
|
|
12
12
|
this.classFullWidth = 'mg-button--full-width';
|
|
13
13
|
/**
|
|
14
14
|
* Trigger actions onClick event
|
|
15
|
-
*
|
|
16
|
-
* @param {MouseEvent} event click event
|
|
17
|
-
* @returns {void}
|
|
15
|
+
* @param event - click event
|
|
18
16
|
*/
|
|
19
17
|
this.handleClick = (event) => {
|
|
20
18
|
if (this.disabled)
|
|
@@ -27,9 +25,7 @@ export class MgButton {
|
|
|
27
25
|
};
|
|
28
26
|
/**
|
|
29
27
|
* Handle onKeydown event
|
|
30
|
-
*
|
|
31
|
-
* @param {KeyboardEvent} event keyboard event
|
|
32
|
-
* @returns {void}
|
|
28
|
+
* @param event - keyboard event
|
|
33
29
|
*/
|
|
34
30
|
this.handleKeydown = (event) => {
|
|
35
31
|
if (!this.disabled && event.key === ' ') {
|
|
@@ -42,9 +38,7 @@ export class MgButton {
|
|
|
42
38
|
};
|
|
43
39
|
/**
|
|
44
40
|
* Handle onKeyup event
|
|
45
|
-
*
|
|
46
|
-
* @param {KeyboardEvent} event keyboard event
|
|
47
|
-
* @returns {void}
|
|
41
|
+
* @param event - keyboard event
|
|
48
42
|
*/
|
|
49
43
|
this.handleKeyup = (event) => {
|
|
50
44
|
if (!this.disabled && event.key === ' ') {
|
|
@@ -62,7 +56,7 @@ export class MgButton {
|
|
|
62
56
|
this.isIcon = false;
|
|
63
57
|
this.disableOnClick = false;
|
|
64
58
|
this.loading = false;
|
|
65
|
-
this.
|
|
59
|
+
this.classCollection = new ClassList(['mg-button']);
|
|
66
60
|
}
|
|
67
61
|
validateVariant(newValue, oldValue) {
|
|
68
62
|
if (!variants.includes(newValue)) {
|
|
@@ -70,9 +64,9 @@ export class MgButton {
|
|
|
70
64
|
}
|
|
71
65
|
else {
|
|
72
66
|
if (oldValue !== undefined) {
|
|
73
|
-
this.
|
|
67
|
+
this.classCollection.delete(`mg-button--${oldValue}`);
|
|
74
68
|
}
|
|
75
|
-
this.
|
|
69
|
+
this.classCollection.add(`mg-button--${newValue}`);
|
|
76
70
|
}
|
|
77
71
|
}
|
|
78
72
|
validateFullWidth(newValue) {
|
|
@@ -80,10 +74,10 @@ export class MgButton {
|
|
|
80
74
|
throw new Error('<mg-button> prop "fullWidth" cannot be used with prop "isIcon".');
|
|
81
75
|
}
|
|
82
76
|
else if (newValue) {
|
|
83
|
-
this.
|
|
77
|
+
this.classCollection.add(this.classFullWidth);
|
|
84
78
|
}
|
|
85
79
|
else {
|
|
86
|
-
this.
|
|
80
|
+
this.classCollection.delete(this.classFullWidth);
|
|
87
81
|
}
|
|
88
82
|
}
|
|
89
83
|
disabledHandler(isDisabled) {
|
|
@@ -96,10 +90,10 @@ export class MgButton {
|
|
|
96
90
|
this.element.onclick = isDisabled ? undefined : this.onClickElementFn;
|
|
97
91
|
// apply style
|
|
98
92
|
if (isDisabled) {
|
|
99
|
-
this.
|
|
93
|
+
this.classCollection.add(this.classDisabled);
|
|
100
94
|
}
|
|
101
95
|
else {
|
|
102
|
-
this.
|
|
96
|
+
this.classCollection.delete(this.classDisabled);
|
|
103
97
|
}
|
|
104
98
|
// emit value update
|
|
105
99
|
this.disabledChange.emit(isDisabled);
|
|
@@ -107,22 +101,20 @@ export class MgButton {
|
|
|
107
101
|
loadingHandler(newValue) {
|
|
108
102
|
// we add loading style if it newvalue is true else we remove it
|
|
109
103
|
if (newValue) {
|
|
110
|
-
this.
|
|
104
|
+
this.classCollection.add(this.classLoading);
|
|
111
105
|
}
|
|
112
106
|
else {
|
|
113
|
-
this.
|
|
107
|
+
this.classCollection.delete(this.classLoading);
|
|
114
108
|
}
|
|
115
109
|
}
|
|
116
110
|
/**
|
|
117
111
|
* Check if props are well configured on init
|
|
118
|
-
*
|
|
119
|
-
* @returns {void}
|
|
120
112
|
*/
|
|
121
113
|
componentWillLoad() {
|
|
122
114
|
this.validateVariant(this.variant);
|
|
123
115
|
this.validateFullWidth(this.fullWidth);
|
|
124
116
|
if (this.isIcon) {
|
|
125
|
-
this.
|
|
117
|
+
this.classCollection.add(`mg-button--icon`);
|
|
126
118
|
if (typeof this.label !== 'string' || this.label.trim() === '') {
|
|
127
119
|
throw new Error(`<mg-button> prop "label" is mandatory when prop "isIcon" is set to true.`);
|
|
128
120
|
}
|
|
@@ -133,11 +125,10 @@ export class MgButton {
|
|
|
133
125
|
}
|
|
134
126
|
/**
|
|
135
127
|
* Render component
|
|
136
|
-
*
|
|
137
|
-
* @returns {HTMLElement} html element
|
|
128
|
+
* @returns html element
|
|
138
129
|
*/
|
|
139
130
|
render() {
|
|
140
|
-
return (h(Host, { role: "button", tabIndex: 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, h("div", { class: this.
|
|
131
|
+
return (h(Host, { role: "button", tabIndex: 0, type: this.type, form: this.form, "full-width": this.fullWidth, "aria-label": this.label, "aria-disabled": this.disabled !== undefined && this.disabled.toString(), onClick: this.handleClick, onKeyup: this.handleKeyup, onKeydown: this.handleKeydown }, h("div", { class: this.classCollection.join(), id: this.identifier }, this.loading && h("mg-icon", { icon: "loader", spin: true }), h("div", { class: "mg-button__content" }, h("slot", null)))));
|
|
141
132
|
}
|
|
142
133
|
static get is() { return "mg-button"; }
|
|
143
134
|
static get encapsulation() { return "shadow"; }
|
|
@@ -234,7 +225,7 @@ export class MgButton {
|
|
|
234
225
|
},
|
|
235
226
|
"fullWidth": {
|
|
236
227
|
"type": "boolean",
|
|
237
|
-
"mutable":
|
|
228
|
+
"mutable": false,
|
|
238
229
|
"complexType": {
|
|
239
230
|
"original": "boolean",
|
|
240
231
|
"resolved": "boolean",
|
|
@@ -252,7 +243,7 @@ export class MgButton {
|
|
|
252
243
|
},
|
|
253
244
|
"form": {
|
|
254
245
|
"type": "string",
|
|
255
|
-
"mutable":
|
|
246
|
+
"mutable": false,
|
|
256
247
|
"complexType": {
|
|
257
248
|
"original": "string",
|
|
258
249
|
"resolved": "string",
|
|
@@ -325,7 +316,7 @@ export class MgButton {
|
|
|
325
316
|
static get states() {
|
|
326
317
|
return {
|
|
327
318
|
"loading": {},
|
|
328
|
-
"
|
|
319
|
+
"classCollection": {}
|
|
329
320
|
};
|
|
330
321
|
}
|
|
331
322
|
static get events() {
|
|
@@ -8,20 +8,27 @@ export class MgCard {
|
|
|
8
8
|
*************/
|
|
9
9
|
this.name = 'mg-card';
|
|
10
10
|
this.baseClass = this.name;
|
|
11
|
+
/**
|
|
12
|
+
* Methode to set default varianStyle props
|
|
13
|
+
* needeed has stencil doesn't know that props is mutated when updated in prop watcher
|
|
14
|
+
*/
|
|
15
|
+
this.setDefaultVariantStyle = () => {
|
|
16
|
+
if (this.variantStyle === undefined)
|
|
17
|
+
this.variantStyle = 'bar-left';
|
|
18
|
+
};
|
|
11
19
|
this.variant = undefined;
|
|
12
20
|
this.variantStyle = undefined;
|
|
13
|
-
this.
|
|
21
|
+
this.classCollection = new ClassList([this.baseClass]);
|
|
14
22
|
}
|
|
15
23
|
validateVariant(newValue, oldValue) {
|
|
16
24
|
if (newValue && !variants.includes(newValue))
|
|
17
25
|
throw new Error(`<${this.name}> prop "variant" must match VariantType type.`);
|
|
18
26
|
if (Boolean(newValue)) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.classList.add(`${this.baseClass}--${newValue}`);
|
|
27
|
+
this.setDefaultVariantStyle();
|
|
28
|
+
this.classCollection.add(`${this.baseClass}--${newValue}`);
|
|
22
29
|
}
|
|
23
30
|
if (Boolean(oldValue))
|
|
24
|
-
this.
|
|
31
|
+
this.classCollection.delete(`${this.baseClass}--${oldValue}`);
|
|
25
32
|
}
|
|
26
33
|
validateVariantStyle(newValue, oldValue) {
|
|
27
34
|
if (newValue && !variantStyles.includes(newValue))
|
|
@@ -29,14 +36,15 @@ export class MgCard {
|
|
|
29
36
|
else if (Boolean(newValue) && !variants.includes(this.variant))
|
|
30
37
|
throw new Error(`<${this.name}> prop "variantStyle" must be paired with ${JSON.stringify(variants)} "variant" prop.`);
|
|
31
38
|
if (Boolean(newValue))
|
|
32
|
-
this.
|
|
39
|
+
this.classCollection.add(`${this.baseClass}--${newValue}`);
|
|
33
40
|
if (Boolean(oldValue))
|
|
34
|
-
this.
|
|
41
|
+
this.classCollection.delete(`${this.baseClass}--${oldValue}`);
|
|
35
42
|
}
|
|
43
|
+
/*************
|
|
44
|
+
* Lifecycle *
|
|
45
|
+
*************/
|
|
36
46
|
/**
|
|
37
47
|
* Check if props are well configured on init
|
|
38
|
-
*
|
|
39
|
-
* @returns {void}
|
|
40
48
|
*/
|
|
41
49
|
componentWillLoad() {
|
|
42
50
|
this.validateVariant(this.variant);
|
|
@@ -44,12 +52,11 @@ export class MgCard {
|
|
|
44
52
|
}
|
|
45
53
|
/**
|
|
46
54
|
* Render
|
|
47
|
-
*
|
|
48
|
-
* @returns {HTMLElement} HTML Element
|
|
55
|
+
* @returns HTML Element
|
|
49
56
|
*/
|
|
50
57
|
render() {
|
|
51
58
|
var _a;
|
|
52
|
-
return (h("div", { class: this.
|
|
59
|
+
return (h("div", { class: this.classCollection.join() }, ((_a = this.variantStyle) === null || _a === void 0 ? void 0 : _a.startsWith('bar-')) && h("span", { class: "mg-card__bar" }), h("slot", null)));
|
|
53
60
|
}
|
|
54
61
|
static get is() { return "mg-card"; }
|
|
55
62
|
static get encapsulation() { return "shadow"; }
|
|
@@ -82,7 +89,7 @@ export class MgCard {
|
|
|
82
89
|
"optional": false,
|
|
83
90
|
"docs": {
|
|
84
91
|
"tags": [],
|
|
85
|
-
"text": "Define variant prop
|
|
92
|
+
"text": "Define variant prop"
|
|
86
93
|
},
|
|
87
94
|
"attribute": "variant",
|
|
88
95
|
"reflect": false
|
|
@@ -104,7 +111,7 @@ export class MgCard {
|
|
|
104
111
|
"optional": false,
|
|
105
112
|
"docs": {
|
|
106
113
|
"tags": [],
|
|
107
|
-
"text": "Define variantStyle prop
|
|
114
|
+
"text": "Define variantStyle prop"
|
|
108
115
|
},
|
|
109
116
|
"attribute": "variant-style",
|
|
110
117
|
"reflect": false
|
|
@@ -113,7 +120,7 @@ export class MgCard {
|
|
|
113
120
|
}
|
|
114
121
|
static get states() {
|
|
115
122
|
return {
|
|
116
|
-
"
|
|
123
|
+
"classCollection": {}
|
|
117
124
|
};
|
|
118
125
|
}
|
|
119
126
|
static get watchers() {
|
|
@@ -16,8 +16,6 @@ export class MgCharacterLeft {
|
|
|
16
16
|
*************/
|
|
17
17
|
/**
|
|
18
18
|
* Check if props are well configured on init
|
|
19
|
-
*
|
|
20
|
-
* @returns {void}
|
|
21
19
|
*/
|
|
22
20
|
componentWillLoad() {
|
|
23
21
|
this.validateMaxlength(this.maxlength);
|
|
@@ -25,8 +23,7 @@ export class MgCharacterLeft {
|
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* Render component
|
|
28
|
-
*
|
|
29
|
-
* @returns {HTMLElement} HTML Element
|
|
26
|
+
* @returns HTML Element
|
|
30
27
|
*/
|
|
31
28
|
render() {
|
|
32
29
|
return (h("span", { id: this.identifier, "aria-live": "polite" }, h("span", { "aria-hidden": "true" }, this.maxlength - this.characters.length, "/", this.maxlength), h("span", { class: "sr-only" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
|