@mgdis/mg-components 5.8.0 → 5.8.2

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.
Files changed (39) hide show
  1. package/dist/cjs/loader.cjs.js +2 -2
  2. package/dist/cjs/mg-action-more_31.cjs.entry.js +148 -48
  3. package/dist/cjs/mg-components.cjs.js +2 -2
  4. package/dist/cjs/mg-item-more.cjs.entry.js +3 -2
  5. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +14 -10
  6. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +91 -21
  7. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +52 -20
  8. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +4 -2
  9. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +18 -1
  10. package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
  11. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +2 -1
  12. package/dist/collection/utils/components.utils.js +2 -4
  13. package/dist/collection/utils/unit.test.utils.js +25 -0
  14. package/dist/components/components.utils.js +2 -4
  15. package/dist/components/mg-form.js +1 -1
  16. package/dist/components/mg-input-checkbox.js +5 -4
  17. package/dist/components/mg-input-select2.js +83 -17
  18. package/dist/components/mg-item-more.js +2 -1
  19. package/dist/components/mg-menu-item2.js +5 -2
  20. package/dist/components/mg-menu2.js +52 -20
  21. package/dist/esm/loader.js +3 -3
  22. package/dist/esm/mg-action-more_31.entry.js +148 -48
  23. package/dist/esm/mg-components.js +3 -3
  24. package/dist/esm/mg-item-more.entry.js +3 -2
  25. package/dist/mg-components/mg-components.esm.js +1 -1
  26. package/dist/mg-components/p-0b68c4b4.entry.js +1 -0
  27. package/dist/mg-components/{p-1221773c.entry.js → p-67ce7cb8.entry.js} +1 -1
  28. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +3 -3
  29. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +39 -4
  30. package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +31 -5
  31. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +4 -0
  32. package/dist/types/components.d.ts +11 -7
  33. package/dist/types/utils/components.utils.d.ts +2 -2
  34. package/dist/types/utils/unit.test.utils.d.ts +11 -0
  35. package/package.json +9 -14
  36. package/dist/mg-components/p-6aeded97.entry.js +0 -1
  37. /package/dist/cjs/{index-5e7ede97.js → index-9e1091ab.js} +0 -0
  38. /package/dist/esm/{index-03cceb11.js → index-3249671d.js} +0 -0
  39. /package/dist/mg-components/{p-e126dd84.js → p-8fbc0d87.js} +0 -0
@@ -1 +1 @@
1
- import{r as t,h as i,H as s,g as e}from"./p-e126dd84.js";import{i as o,D as h}from"./p-367f92d2.js";var n;!function(t){t.BASE_INDEX="data-overflow-base-index",t.PROXY_INDEX="data-overflow-proxy-index"}(n||(n={}));class r{constructor(t,i){this.element=t,this.render=i,this.disconnect=()=>{this._resizeObserver.disconnect()},this.run=t=>{void 0===this._moreElement&&(this._moreElement=this.render(),this._baseChildren=this.getInteractiveItems(this.element),(()=>"MG-ITEM-MORE"===this._moreElement.nodeName)()&&(this._proxyChildren=this.getInteractiveItems(this._moreElement.shadowRoot.querySelector("mg-menu"))),this._baseChildren.forEach(((t,i)=>{t.setAttribute(n.BASE_INDEX,`${i}`),this._proxyChildren[i].setAttribute(n.PROXY_INDEX,`${i}`)}))),void 0!==t&&this.updateDisplayedItems(t)},this.getInteractiveItems=t=>{var i;return((null===(i=t.children)||void 0===i?void 0:i.length)>0?Array.from(t.children):[]).filter((t=>["MG-MENU-ITEM","MG-BUTTON"].includes(t.nodeName)))},this.updateDisplayedItems=t=>{this.restoreItems();const i={accWidth:0,previousItem:null};[...this._baseChildren,this._moreElement].forEach((s=>{i.accWidth+=s.offsetWidth;const e=null!==i.previousItem&&null!==i.previousItem.getAttribute("hidden");this.toggleItem(s,e&&!this.isMoreElement(s)||this.isOverflowElement(i.accWidth,s,t)||this.isMoreElement(s)&&!e),i.previousItem=s}))},this.isOverflowElement=(t,i,s)=>null!==i.previousElementSibling&&!this.isMoreElement(i)&&(this.isMoreElement(i.nextElementSibling)?t>s:t+this._moreElement.offsetWidth>s),this.isMoreElement=t=>"MG-ITEM-MORE"===t.nodeName,this.toggleItem=(t,i)=>{const s=Number(t.getAttribute(n.BASE_INDEX));this.isMoreElement(t)?this.toggleElement(this._moreElement,i):s>=0&&(this.toggleElement(t,i),this.toggleElement(this._proxyChildren[s],!i))},this.toggleElement=(t,i)=>{i?t.setAttribute("hidden",""):t.removeAttribute("hidden")},this.restoreItems=()=>{[...this._baseChildren,this._moreElement].forEach((t=>t.removeAttribute("hidden")))},void 0===this._resizeObserver&&(this._resizeObserver=new ResizeObserver((t=>{t.forEach((t=>{this.run(t.contentRect.width)}))})),this._resizeObserver.observe(this.element)),this.run()}}const a=class{constructor(i){t(this,i),this.name="mg-item-more",this.renderMgMenuItemOverflowElement=()=>{const t=this.element.shadowRoot.querySelector("mg-menu-item");this.menuItems.forEach((i=>{t.querySelector("mg-menu").appendChild(i.cloneNode(!0))}));const i=Array.from(this.parentMenu.querySelectorAll("mg-menu-item:not([data-overflow-more])"));return Array.from(t.querySelectorAll("mg-menu-item:not([data-overflow-more])")).forEach(((t,s)=>{t.addEventListener("click",(()=>{(i[s].shadowRoot.querySelector("a")||i[s].shadowRoot.querySelector("button")).dispatchEvent(new MouseEvent("click",{bubbles:!0}))})),""!==t.id.trim()&&(t.id=`${t.id}-proxy`),i[s].addEventListener("status-change",(i=>{t.setAttribute("status",i.detail)}))})),this.element},this.icon={icon:"ellipsis-vertical"},this.slotlabel={display:!1},this.size=void 0,this.parentMenu=void 0}validateIcon(t){if("object"!=typeof t||"object"==typeof t&&"string"!=typeof t.icon)throw new Error(`<${this.name}> prop "icon" must match MgItemMore['icon'] type.`)}validateSlotLabel(t){if("object"!=typeof t||"object"==typeof t&&"boolean"!=typeof t.display)throw new Error(`<${this.name}> prop "slotlabel" must match MgItemMore['slotlabel'] type.`);"string"!=typeof t.label&&(this.slotlabel.label=this.messages.moreLabel)}validateSize(t){if(t&&"string"!=typeof t)throw new Error(`<${this.name}> prop "size" must match MgItemMore['size'] type.`)}disconnectedCallback(){this.overflowBehavior.disconnect()}componentWillLoad(){this.messages=o(this.element).messages.plusMenu,this.parentMenu=this.element.closest("mg-menu"),this.menuItems=Array.from(this.parentMenu.children).filter((t=>"MG-MENU-ITEM"===t.nodeName)),this.validateIcon(this.icon),this.validateSlotLabel(this.slotlabel),this.validateSize(this.size)}componentDidLoad(){this.overflowBehavior=new r(this.parentMenu,this.renderMgMenuItemOverflowElement)}render(){return i(s,{role:"menuitem","aria-haspopup":"true"},i("mg-menu-item",{"data-overflow-more":!0,"data-size":this.parentMenu.size},i("mg-icon",{icon:this.icon.icon,slot:"image"}),i("span",{class:{"sr-only":!this.slotlabel.display},slot:"label"},this.slotlabel.label),i("mg-menu",{direction:h.VERTICAL,label:this.messages.moreLabel,size:this.size})))}get element(){return e(this)}static get watchers(){return{icon:["validateIcon"],slotlabel:["validateSlotLabel"],size:["validateSize"]}}};a.style=".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}:host{display:flex}";export{a as mg_item_more}
1
+ import{r as t,h as i,H as s,g as e}from"./p-8fbc0d87.js";import{i as o,D as h}from"./p-367f92d2.js";var n;!function(t){t.BASE_INDEX="data-overflow-base-index",t.PROXY_INDEX="data-overflow-proxy-index"}(n||(n={}));class r{constructor(t,i){this.element=t,this.render=i,this.disconnect=()=>{this._resizeObserver.disconnect()},this.run=t=>{void 0===this._moreElement&&(this._moreElement=this.render(),this._baseChildren=this.getInteractiveItems(this.element),(()=>"MG-ITEM-MORE"===this._moreElement.nodeName)()&&(this._proxyChildren=this.getInteractiveItems(this._moreElement.shadowRoot.querySelector("mg-menu"))),this._baseChildren.forEach(((t,i)=>{t.setAttribute(n.BASE_INDEX,`${i}`),this._proxyChildren[i].setAttribute(n.PROXY_INDEX,`${i}`)}))),void 0!==t&&this.updateDisplayedItems(t)},this.getInteractiveItems=t=>{var i;return((null===(i=t.children)||void 0===i?void 0:i.length)>0?Array.from(t.children):[]).filter((t=>["MG-MENU-ITEM","MG-BUTTON"].includes(t.nodeName)))},this.updateDisplayedItems=t=>{this.restoreItems();const i={accWidth:0,previousItem:null};[...this._baseChildren,this._moreElement].forEach((s=>{i.accWidth+=s.offsetWidth;const e=null!==i.previousItem&&null!==i.previousItem.getAttribute("hidden");this.toggleItem(s,e&&!this.isMoreElement(s)||this.isOverflowElement(i.accWidth,s,t)||this.isMoreElement(s)&&!e),i.previousItem=s}))},this.isOverflowElement=(t,i,s)=>null!==i.previousElementSibling&&!this.isMoreElement(i)&&(this.isMoreElement(i.nextElementSibling)?t>s:t+this._moreElement.offsetWidth>s),this.isMoreElement=t=>"MG-ITEM-MORE"===t.nodeName,this.toggleItem=(t,i)=>{const s=Number(t.getAttribute(n.BASE_INDEX));this.isMoreElement(t)?this.toggleElement(this._moreElement,i):s>=0&&(this.toggleElement(t,i),this.toggleElement(this._proxyChildren[s],!i))},this.toggleElement=(t,i)=>{i?t.setAttribute("hidden",""):t.removeAttribute("hidden")},this.restoreItems=()=>{[...this._baseChildren,this._moreElement].forEach((t=>t.removeAttribute("hidden")))},void 0===this._resizeObserver&&(this._resizeObserver=new ResizeObserver((t=>{t.forEach((t=>{this.run(t.contentRect.width)}))})),this._resizeObserver.observe(this.element)),this.run()}}const a=class{constructor(i){t(this,i),this.name="mg-item-more",this.renderMgMenuItemOverflowElement=()=>{const t=this.element.shadowRoot.querySelector("mg-menu-item");this.menuItems.forEach((i=>{t.querySelector("mg-menu").appendChild(i.cloneNode(!0))}));const i=Array.from(this.parentMenu.querySelectorAll("mg-menu-item:not([data-overflow-more])"));return Array.from(t.querySelectorAll("mg-menu-item:not([data-overflow-more])")).forEach(((t,s)=>{t.addEventListener("click",(()=>{i[s].shadowRoot.querySelector("a, button").click()})),""!==t.id.trim()&&(t.id=`${t.id}-proxy`),i[s].addEventListener("status-change",(i=>{t.setAttribute("status",i.detail)}))})),this.element},this.icon={icon:"ellipsis-vertical"},this.slotlabel={display:!1},this.size=void 0,this.parentMenu=void 0}validateIcon(t){if("object"!=typeof t||"object"==typeof t&&"string"!=typeof t.icon)throw new Error(`<${this.name}> prop "icon" must match MgItemMore['icon'] type.`)}validateSlotLabel(t){if("object"!=typeof t||"object"==typeof t&&"boolean"!=typeof t.display)throw new Error(`<${this.name}> prop "slotlabel" must match MgItemMore['slotlabel'] type.`);"string"!=typeof t.label&&(this.slotlabel.label=this.messages.moreLabel)}validateSize(t){if(t&&"string"!=typeof t)throw new Error(`<${this.name}> prop "size" must match MgItemMore['size'] type.`)}disconnectedCallback(){this.overflowBehavior.disconnect()}componentWillLoad(){this.messages=o(this.element).messages.plusMenu,this.parentMenu=this.element.closest("mg-menu"),this.menuItems=Array.from(this.parentMenu.children).filter((t=>"MG-MENU-ITEM"===t.nodeName)),this.validateIcon(this.icon),this.validateSlotLabel(this.slotlabel),this.validateSize(this.size)}componentDidLoad(){this.overflowBehavior=new r(this.parentMenu,this.renderMgMenuItemOverflowElement)}render(){return i(s,{role:"menuitem","aria-haspopup":"true"},i("mg-menu-item",{"data-overflow-more":!0,"data-size":this.parentMenu.size},i("mg-icon",{icon:this.icon.icon,slot:"image"}),i("span",{class:{"sr-only":!this.slotlabel.display},slot:"label"},this.slotlabel.label),i("mg-menu",{direction:h.VERTICAL,label:this.messages.moreLabel,size:this.size})))}get element(){return e(this)}static get watchers(){return{icon:["validateIcon"],slotlabel:["validateSlotLabel"],size:["validateSize"]}}};a.style=".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}:host{display:flex}";export{a as mg_item_more}
@@ -21,7 +21,7 @@ export declare class MgInputCheckbox {
21
21
  * Required
22
22
  */
23
23
  value: CheckboxValue[];
24
- validateValue(newValue: CheckboxValue[]): void;
24
+ validateValue(newValue: MgInputCheckbox['value']): void;
25
25
  /**
26
26
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
27
27
  */
@@ -91,11 +91,11 @@ export declare class MgInputCheckbox {
91
91
  /**
92
92
  * Emitted event when value change
93
93
  */
94
- valueChange: EventEmitter<CheckboxValue[]>;
94
+ valueChange: EventEmitter<MgInputCheckbox['value']>;
95
95
  /**
96
96
  * Emited event when checking validity
97
97
  */
98
- inputValid: EventEmitter<boolean>;
98
+ inputValid: EventEmitter<MgInputCheckbox['valid']>;
99
99
  /**
100
100
  * Public method to display errors
101
101
  *
@@ -20,12 +20,12 @@ export declare class MgInputSelect {
20
20
  * Component value
21
21
  */
22
22
  value: any;
23
- handleValue(newValue: any): void;
23
+ validateValue(newValue: MgInputSelect['value']): void;
24
24
  /**
25
25
  * Items are the possible options to select
26
26
  */
27
- items: string[] | SelectOption[];
28
- validateItems(newValue: string[] | SelectOption[]): void;
27
+ items: (string | SelectOption)[];
28
+ validateItems(newValue: MgInputSelect['items']): void;
29
29
  /**
30
30
  * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
31
31
  */
@@ -116,7 +116,7 @@ export declare class MgInputSelect {
116
116
  /**
117
117
  * Emited event when value change
118
118
  */
119
- valueChange: EventEmitter<any>;
119
+ valueChange: EventEmitter<MgInputSelect['value']>;
120
120
  /**
121
121
  * Emited event when checking validity
122
122
  */
@@ -129,12 +129,40 @@ export declare class MgInputSelect {
129
129
  displayError(): Promise<void>;
130
130
  /**
131
131
  * Handle input event
132
+ *
133
+ * @returns {void}
132
134
  */
133
135
  private handleInput;
136
+ /**
137
+ * Method to compare item.title with input.value
138
+ *
139
+ * @param {SelectOption} item item to compare with
140
+ * @returns {boolean} truthy if input.value is an item
141
+ */
142
+ private isInputValue;
143
+ /**
144
+ * value props setter
145
+ *
146
+ * @param {MgInputSelect['value']} newValue value to update with
147
+ * @returns {void}
148
+ */
149
+ private setValue;
150
+ /**
151
+ * Update value from input.value
152
+ *
153
+ * @returns {void}
154
+ */
155
+ private updateValue;
134
156
  /**
135
157
  * Handle blur event
136
158
  */
137
159
  private handleBlur;
160
+ /**
161
+ * Input value is disabled
162
+ *
163
+ * @returns {boolean} truthy if input value is disabled
164
+ */
165
+ private isDisabledValue;
138
166
  /**
139
167
  * Check if input is valid
140
168
  */
@@ -152,6 +180,13 @@ export declare class MgInputSelect {
152
180
  * @returns {ReturnType<typeof setTimeout>} timeout
153
181
  */
154
182
  componentWillLoad(): ReturnType<typeof setTimeout>;
183
+ /**
184
+ * Render option
185
+ *
186
+ * @param {SelectOption} option to render
187
+ * @returns {HTMLElement} render option
188
+ */
189
+ private renderOption;
155
190
  /**
156
191
  * Render
157
192
  *
@@ -29,8 +29,8 @@ export declare class MgMenu {
29
29
  * Customize "mg-item-more" element
30
30
  * Used with direction: 'vertical' to manage overflow
31
31
  */
32
- itemMore: ItemMoreType;
33
- validateItemMore(newValue: MgMenu['itemMore']): void;
32
+ itemmore: ItemMoreType;
33
+ validateItemMore(newValue: MgMenu['itemmore']): void;
34
34
  /**
35
35
  * Define mg-menu size
36
36
  * Default: 'regular'
@@ -41,6 +41,9 @@ export declare class MgMenu {
41
41
  * is this menu a child menu. Used for conditional render.
42
42
  */
43
43
  isChildMenu: boolean;
44
+ /*************
45
+ * Methods *
46
+ *************/
44
47
  /**
45
48
  * Close matching menu-item
46
49
  *
@@ -49,15 +52,38 @@ export declare class MgMenu {
49
52
  * @returns {void}
50
53
  */
51
54
  private closeMenuItem;
52
- /*************
53
- * Methods *
54
- *************/
55
+ /**
56
+ * get mg-item-more element
57
+ *
58
+ * @returns {HTMLMgItemMoreElement} mg-item-more element
59
+ */
60
+ private getItemMore;
61
+ /**
62
+ * get mg-item-more >>> mg-menu-item element
63
+ *
64
+ * @returns {HTMLMgMenuItemElement} mg-item-more >>> mg-menu-item element
65
+ */
66
+ private getItemMoreMenuItem;
67
+ /**
68
+ * Set item listend
69
+ *
70
+ * @param {HTMLMgMenuItemElement} item mg-menu-item element
71
+ * @param {MgMenu['focusedMenuItem']} index number
72
+ * @returns {void}
73
+ */
74
+ private setItemListener;
55
75
  /**
56
76
  * Store menu-items on component init and add listeners
57
77
  *
58
78
  * @returns {void}
59
79
  */
60
80
  private initMenuItemsListeners;
81
+ /**
82
+ * Handle item-loaded event on mg-item-more element
83
+ *
84
+ * @returns {void}
85
+ */
86
+ private handleItemLoaded;
61
87
  /**
62
88
  * render mg-item-more
63
89
  *
@@ -47,6 +47,10 @@ export declare class MgMenuItem {
47
47
  * Emited event when status change
48
48
  */
49
49
  statusChange: EventEmitter<MgMenuItem['status']>;
50
+ /**
51
+ * Emited event when item is loaded
52
+ */
53
+ itemLoaded: EventEmitter<void>;
50
54
  /**********
51
55
  * States *
52
56
  *********/
@@ -575,7 +575,7 @@ export namespace Components {
575
575
  /**
576
576
  * Items are the possible options to select
577
577
  */
578
- "items": string[] | SelectOption[];
578
+ "items": (string | SelectOption)[];
579
579
  /**
580
580
  * Input label
581
581
  */
@@ -907,7 +907,7 @@ export namespace Components {
907
907
  /**
908
908
  * Customize "mg-item-more" element Used with direction: 'vertical' to manage overflow
909
909
  */
910
- "itemMore": ItemMoreType;
910
+ "itemmore": ItemMoreType;
911
911
  /**
912
912
  * Menu label. Include short menu description. Required for accessibility
913
913
  */
@@ -1651,11 +1651,11 @@ declare namespace LocalJSX {
1651
1651
  /**
1652
1652
  * Emited event when checking validity
1653
1653
  */
1654
- "onInput-valid"?: (event: MgInputCheckboxCustomEvent<boolean>) => void;
1654
+ "onInput-valid"?: (event: MgInputCheckboxCustomEvent<MgInputCheckbox['valid']>) => void;
1655
1655
  /**
1656
1656
  * Emitted event when value change
1657
1657
  */
1658
- "onValue-change"?: (event: MgInputCheckboxCustomEvent<CheckboxValue[]>) => void;
1658
+ "onValue-change"?: (event: MgInputCheckboxCustomEvent<MgInputCheckbox['value']>) => void;
1659
1659
  /**
1660
1660
  * Define if input is readonly
1661
1661
  */
@@ -2001,7 +2001,7 @@ declare namespace LocalJSX {
2001
2001
  /**
2002
2002
  * Items are the possible options to select
2003
2003
  */
2004
- "items": string[] | SelectOption[];
2004
+ "items": (string | SelectOption)[];
2005
2005
  /**
2006
2006
  * Input label
2007
2007
  */
@@ -2029,7 +2029,7 @@ declare namespace LocalJSX {
2029
2029
  /**
2030
2030
  * Emited event when value change
2031
2031
  */
2032
- "onValue-change"?: (event: MgInputSelectCustomEvent<any>) => void;
2032
+ "onValue-change"?: (event: MgInputSelectCustomEvent<MgInputSelect['value']>) => void;
2033
2033
  /**
2034
2034
  * Input placeholder. It should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.
2035
2035
  */
@@ -2350,7 +2350,7 @@ declare namespace LocalJSX {
2350
2350
  /**
2351
2351
  * Customize "mg-item-more" element Used with direction: 'vertical' to manage overflow
2352
2352
  */
2353
- "itemMore"?: ItemMoreType;
2353
+ "itemmore"?: ItemMoreType;
2354
2354
  /**
2355
2355
  * Menu label. Include short menu description. Required for accessibility
2356
2356
  */
@@ -2373,6 +2373,10 @@ declare namespace LocalJSX {
2373
2373
  * Identifier is used to control mg-popover Default: createID('mg-menu-item');
2374
2374
  */
2375
2375
  "identifier"?: string;
2376
+ /**
2377
+ * Emited event when item is loaded
2378
+ */
2379
+ "onItem-loaded"?: (event: MgMenuItemCustomEvent<void>) => void;
2376
2380
  /**
2377
2381
  * Emited event when status change
2378
2382
  */
@@ -44,10 +44,10 @@ export declare class ClassList {
44
44
  /**
45
45
  * Check if all items are string
46
46
  *
47
- * @param {string[]} items items to check
47
+ * @param {unknown} items items to check
48
48
  * @returns {boolean} all items are string
49
49
  */
50
- export declare const allItemsAreString: (items: string[]) => boolean;
50
+ export declare const allItemsAreString: (items: unknown) => items is string[];
51
51
  /**
52
52
  * Check if element is a heading
53
53
  *
@@ -1,3 +1,4 @@
1
+ import { MockCustomEvent } from '@stencil/core/mock-doc';
1
2
  /**
2
3
  * Clone Deep function
3
4
  *
@@ -67,6 +68,16 @@ type setupResizeObserverMockParams = {
67
68
  observe: ResizeObserver['observe'];
68
69
  };
69
70
  export declare const setupResizeObserverMock: ({ disconnect, observe }: setupResizeObserverMockParams) => typeof ResizeObserver;
71
+ /**
72
+ * Utility function that mocks the `SubmitEvent` API. Recommended to execute inside `beforeEach`.
73
+ *
74
+ * @returns {void}
75
+ * @example
76
+ * ```
77
+ * setupSubmitEventMock();
78
+ * ```
79
+ */
80
+ export declare const setupSubmitEventMock: () => typeof MockCustomEvent;
70
81
  /**
71
82
  * force popover id when component use randomed identifier
72
83
  *
package/package.json CHANGED
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "name": "@mgdis/mg-components",
3
- "version": "5.8.0",
3
+ "version": "5.8.2",
4
4
  "description": "MG Components",
5
- "packageManager": "pnpm@7.17.1",
6
- "engineStrict": true,
7
- "engines": {
8
- "pnpm": ">=7"
9
- },
10
5
  "main": "dist/index.cjs.js",
11
6
  "module": "dist/index.js",
12
7
  "es2015": "dist/esm/index.mjs",
@@ -59,21 +54,20 @@
59
54
  "eslint-plugin-jsx-a11y": "^6.7.1",
60
55
  "eslint-plugin-react": "^7.32.2",
61
56
  "eslint-plugin-storybook": "^0.6.10",
62
- "husky": "^7.0.4",
63
- "jest": "^26.6.3",
57
+ "jest": "^27.0.3",
64
58
  "jest-cli": "^26.6.3",
65
59
  "jest-image-snapshot": "^4.5.1",
66
- "jest-junit": "^13.2.0",
60
+ "jest-junit": "^14.0.1",
67
61
  "jsx-dom": "^8.0.4",
68
62
  "npm-run-all": "^4.1.5",
69
- "prettier": "^2.8.3",
63
+ "prettier": "^2.8.4",
70
64
  "puppeteer": "^13.7.0",
71
65
  "sass": "^1.58.0",
72
66
  "sass-loader": "^10.4.1",
73
67
  "style-loader": "^2.0.0",
74
68
  "ts-node": "^10.9.1",
75
69
  "turbo": "^1.8.1",
76
- "typescript": "~4.4.4"
70
+ "typescript": "^4.9.5"
77
71
  },
78
72
  "license": "BSD-3-Clause",
79
73
  "scripts": {
@@ -86,11 +80,12 @@
86
80
  "lint:prettier": "prettier --check **/*.{ts,tsx,scss,html,mdx,json}",
87
81
  "lint:prettier:fix": "prettier --write **/*.{ts,tsx,scss,html,mdx,json}",
88
82
  "test": "TZ=UTC stencil test --spec --e2e",
89
- "test:unit": "TZ=UTC stencil test --spec --collectCoverage --reporters=\"default\" --reporters=\"jest-junit\"",
83
+ "test:unit": "TZ=UTC stencil test --spec --collectCoverage",
90
84
  "test:e2e": "stencil test --e2e",
91
- "test.watch": "stencil test --spec --e2e --watchAll",
85
+ "test:watch": "stencil test --spec --e2e --watchAll",
92
86
  "generate": "stencil generate",
93
87
  "storybook": "NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 6006",
94
- "storybook:build": "NODE_OPTIONS=--openssl-legacy-provider build-storybook"
88
+ "storybook:build": "NODE_OPTIONS=--openssl-legacy-provider build-storybook",
89
+ "coverage": "TZ=UTC stencil test --spec --collectCoverage --reporters=\"default\" --reporters=\"jest-junit\""
95
90
  }
96
91
  }