@mgdis/mg-components 5.12.1 → 5.13.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/loader.cjs.js +1 -1
- package/dist/cjs/{mg-action-more_31.cjs.entry.js → mg-action-more_32.cjs.entry.js} +324 -136
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +1 -1
- package/dist/cjs/{mg-menu.conf-79f0c761.js → mg-menu.conf-857748e1.js} +20 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +15 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +259 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +16 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +41 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +106 -100
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +1 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +3 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +19 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.conf.js +8 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +9 -5
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +133 -47
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
- package/dist/collection/locales/en/messages.json +13 -1
- package/dist/collection/locales/fr/messages.json +7 -1
- package/dist/collection/stories/icon-gallery.js +9 -0
- package/dist/collection/variables.css +7 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +20 -2
- package/dist/components/mg-input-checkbox-paginated.d.ts +11 -0
- package/dist/components/mg-input-checkbox-paginated.js +6 -0
- package/dist/components/mg-input-checkbox-paginated2.js +205 -0
- package/dist/components/mg-input-checkbox.js +114 -108
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-menu2.js +1 -1
- package/dist/components/mg-pagination2.js +4 -2
- package/dist/components/mg-panel.js +83 -37
- package/dist/components/mg-tabs.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mg-action-more_31.entry.js → mg-action-more_32.entry.js} +324 -137
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-item-more.entry.js +1 -1
- package/dist/esm/{mg-menu.conf-850d4c6e.js → mg-menu.conf-c31828ca.js} +20 -2
- package/dist/mg-components/locales/en/messages.json +13 -1
- package/dist/mg-components/locales/fr/messages.json +7 -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-622e2323.js +1 -0
- package/dist/mg-components/p-bda0b795.entry.js +1 -0
- package/dist/mg-components/{p-67ba5d05.entry.js → p-d37b29bb.entry.js} +1 -1
- package/dist/mg-components/variables.css +7 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.d.ts +8 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +103 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +50 -12
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +48 -53
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +0 -1
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +4 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.conf.d.ts +16 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +44 -10
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +0 -1
- package/dist/types/components.d.ts +125 -19
- package/dist/types/locales/index.d.ts +18 -0
- package/dist/types/stories/icon-gallery.d.ts +6 -0
- package/package.json +23 -13
- package/dist/mg-components/p-689503fc.js +0 -1
- package/dist/mg-components/p-ec5a0dd6.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,g as e}from"./p-3bf533f7.js";import{i as o,D as h}from"./p-
|
|
1
|
+
import{r as t,h as i,H as s,g as e}from"./p-3bf533f7.js";import{i as o,D as h}from"./p-622e2323.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}
|
|
@@ -74,9 +74,13 @@
|
|
|
74
74
|
--color-dark-s: 37.3%;
|
|
75
75
|
--color-dark-l: 13.1%;
|
|
76
76
|
--color-dark: var(--color-dark-h), var(--color-dark-s), var(--color-dark-l);
|
|
77
|
-
|
|
77
|
+
|
|
78
|
+
/* dark-40 */
|
|
79
|
+
--mg-color-dark-40-hsl: var(--color-dark-h), 7%, 43%;
|
|
78
80
|
/* dark-5 */
|
|
79
|
-
--mg-color-dark-5-hsl:
|
|
81
|
+
--mg-color-dark-5-hsl: var(--color-dark-h), 9%, 96%;
|
|
82
|
+
/* dark-soft */
|
|
83
|
+
--mg-color-dark-soft-hsl: var(--color-dark-h), var(--color-dark-s), 90%;
|
|
80
84
|
|
|
81
85
|
/* Light */
|
|
82
86
|
/* white; (#ffffff) */
|
|
@@ -262,6 +266,7 @@
|
|
|
262
266
|
--mg-tabs-focused-background-color-hsl: var(--mg-color-app-hsl);
|
|
263
267
|
--mg-tabs-border-color-active-hsl: var(--mg-color-app-hsl);
|
|
264
268
|
--mg-tabs-color-active-hsl: var(--mg-color-app-hsl);
|
|
269
|
+
--mg-tabs-border-bottom: solid 0.1rem hsl(var(--mg-color-dark-soft-hsl));
|
|
265
270
|
|
|
266
271
|
/*
|
|
267
272
|
<mg-details>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../../../../stencil-public-runtime';
|
|
2
|
+
import { MgInputCheckboxListProps } from './mg-input-checkbox.conf';
|
|
3
|
+
/**
|
|
4
|
+
* Get checkboxes list template
|
|
5
|
+
* @param props - MgInputCheckboxList Interface Props
|
|
6
|
+
* @returns input template
|
|
7
|
+
*/
|
|
8
|
+
export declare const MgInputCheckboxList: FunctionalComponent<MgInputCheckboxListProps>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../../../stencil-public-runtime';
|
|
2
|
+
import { CheckboxItem, IMgInputCheckboxBase, SectionKind, SectionTitleKind } from '../mg-input-checkbox.conf';
|
|
3
|
+
/**
|
|
4
|
+
* Internal component use to manage sections instances
|
|
5
|
+
*/
|
|
6
|
+
export declare class MgInputCheckboxPaginated implements IMgInputCheckboxBase {
|
|
7
|
+
/*************
|
|
8
|
+
* Constantes *
|
|
9
|
+
*************/
|
|
10
|
+
private readonly offset;
|
|
11
|
+
/*************
|
|
12
|
+
* Decorators *
|
|
13
|
+
*************/
|
|
14
|
+
/**
|
|
15
|
+
* Define if mg-input-checkbox-list is readonly
|
|
16
|
+
*/
|
|
17
|
+
readonly: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Define if mg-input-checkbox-list is disabled
|
|
20
|
+
*/
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Define mg-input-checkbox input name
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* Define checkboxes to paginate
|
|
28
|
+
*/
|
|
29
|
+
checkboxes: CheckboxItem[];
|
|
30
|
+
validateCheckboxes(newValue: MgInputCheckboxPaginated['checkboxes'], oldValue: MgInputCheckboxPaginated['checkboxes']): void;
|
|
31
|
+
/**
|
|
32
|
+
* Define section kind
|
|
33
|
+
*/
|
|
34
|
+
sectionKind: SectionKind;
|
|
35
|
+
validateSectionKind(newValue: MgInputCheckboxPaginated['sectionKind']): void;
|
|
36
|
+
/**
|
|
37
|
+
* Define component message
|
|
38
|
+
*/
|
|
39
|
+
messages: Record<string, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Emit 'mass-action' event
|
|
42
|
+
* used to informe that select-all/unselect-all button listner is triggered
|
|
43
|
+
*/
|
|
44
|
+
massAction: EventEmitter<MgInputCheckboxPaginated['sectionKind']>;
|
|
45
|
+
/**
|
|
46
|
+
* Define section title
|
|
47
|
+
*/
|
|
48
|
+
titleKind: SectionTitleKind;
|
|
49
|
+
/**
|
|
50
|
+
* Current page
|
|
51
|
+
*/
|
|
52
|
+
currentPage: number;
|
|
53
|
+
/**
|
|
54
|
+
* Is checked items values expanded
|
|
55
|
+
*/
|
|
56
|
+
itemsExpanded: boolean;
|
|
57
|
+
/***********
|
|
58
|
+
* Methods *
|
|
59
|
+
***********/
|
|
60
|
+
/**
|
|
61
|
+
* Mass action handler
|
|
62
|
+
*/
|
|
63
|
+
private massActionHandler;
|
|
64
|
+
/**
|
|
65
|
+
* Toogle items button handler
|
|
66
|
+
*/
|
|
67
|
+
private handleToggleClick;
|
|
68
|
+
/**
|
|
69
|
+
* Method to get a array range
|
|
70
|
+
* @param from - array start index
|
|
71
|
+
* @param to - array end index
|
|
72
|
+
* @returns array's range
|
|
73
|
+
*/
|
|
74
|
+
private getArrayRange;
|
|
75
|
+
/**
|
|
76
|
+
* Get from and to index
|
|
77
|
+
* @returns [from,to] index
|
|
78
|
+
*/
|
|
79
|
+
private getFromToIndexes;
|
|
80
|
+
/**
|
|
81
|
+
* Method to get page count from items
|
|
82
|
+
* @param items - items to count
|
|
83
|
+
* @returns page count from items
|
|
84
|
+
*/
|
|
85
|
+
private getPageCount;
|
|
86
|
+
/**
|
|
87
|
+
* Handle mg-pagination current page change event
|
|
88
|
+
* @param event - pagination current page change event
|
|
89
|
+
*/
|
|
90
|
+
private handleCurrentPageChange;
|
|
91
|
+
/*************
|
|
92
|
+
* Lifecycle *
|
|
93
|
+
*************/
|
|
94
|
+
/**
|
|
95
|
+
* Check if component props are well configured on init
|
|
96
|
+
*/
|
|
97
|
+
componentWillLoad(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Render
|
|
100
|
+
* @returns HTML Element
|
|
101
|
+
*/
|
|
102
|
+
render(): HTMLElement;
|
|
103
|
+
}
|
package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* use to match
|
|
2
|
+
* interface CheckboxValue
|
|
3
|
+
* use to match returned value
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
6
|
-
id: string;
|
|
5
|
+
export interface CheckboxValue {
|
|
7
6
|
title: string;
|
|
8
7
|
value: boolean | null;
|
|
9
8
|
disabled?: boolean;
|
|
10
|
-
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* use to match
|
|
12
|
+
* interface CheckboxItem
|
|
13
|
+
* use to match checkbox attributes
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
15
|
+
export interface CheckboxItem extends CheckboxValue {
|
|
16
|
+
id: string;
|
|
17
|
+
handleInput: (event: InputEvent & {
|
|
18
|
+
target: HTMLInputElement;
|
|
19
|
+
}) => void;
|
|
20
|
+
handleBlur: () => void;
|
|
21
|
+
handleKeydown: (event: KeyboardEvent & {
|
|
22
|
+
target: HTMLElement;
|
|
23
|
+
}) => void;
|
|
24
|
+
}
|
|
20
25
|
/**
|
|
21
26
|
* List of all availables checkbox type
|
|
22
27
|
*/
|
|
@@ -29,3 +34,36 @@ export type CheckboxType = (typeof checkboxTypes)[number];
|
|
|
29
34
|
* Search value type
|
|
30
35
|
*/
|
|
31
36
|
export type SearchValueType = string;
|
|
37
|
+
/**
|
|
38
|
+
* mg-input-checkbox-paginated section kind
|
|
39
|
+
*/
|
|
40
|
+
export declare enum SectionKind {
|
|
41
|
+
SELECTED = "selected",
|
|
42
|
+
NOT_SELECTED = "not-selected"
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* mg-input-checkbox-paginated section title kind
|
|
46
|
+
*/
|
|
47
|
+
export declare enum SectionTitleKind {
|
|
48
|
+
BUTTON = "button",
|
|
49
|
+
TEXT = "text"
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Base mg-input-checkbox interface
|
|
53
|
+
*/
|
|
54
|
+
export interface IMgInputCheckboxBase {
|
|
55
|
+
readonly: boolean;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
name: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* mg-input-checkbox-list interface
|
|
61
|
+
*/
|
|
62
|
+
export interface MgInputCheckboxListProps extends IMgInputCheckboxBase {
|
|
63
|
+
inputVerticalList: boolean;
|
|
64
|
+
type: CheckboxType;
|
|
65
|
+
displaySearchInput: boolean;
|
|
66
|
+
messages: Record<string, unknown>;
|
|
67
|
+
checkboxes: CheckboxItem[];
|
|
68
|
+
id: string;
|
|
69
|
+
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../../stencil-public-runtime';
|
|
2
2
|
import { ClassList } from '../../../../utils/components.utils';
|
|
3
|
-
import { CheckboxItem, CheckboxType, CheckboxValue, SearchValueType } from './mg-input-checkbox.conf';
|
|
4
|
-
export declare class MgInputCheckbox {
|
|
3
|
+
import { CheckboxItem, CheckboxType, CheckboxValue, SearchValueType, MgInputCheckboxListProps } from './mg-input-checkbox.conf';
|
|
4
|
+
export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, 'id' | 'checkboxes' | 'messages'> {
|
|
5
5
|
/************
|
|
6
6
|
* Internal *
|
|
7
7
|
************/
|
|
8
|
-
private inputs;
|
|
9
8
|
private mgPopover;
|
|
9
|
+
private searchInput;
|
|
10
10
|
private messages;
|
|
11
11
|
private hasDisplayedError;
|
|
12
|
-
private baseClassName;
|
|
13
|
-
private multiStart;
|
|
14
|
-
private searchStart;
|
|
15
|
-
private searchOffset;
|
|
12
|
+
private readonly baseClassName;
|
|
13
|
+
private readonly multiStart;
|
|
14
|
+
private readonly searchStart;
|
|
16
15
|
/**************
|
|
17
16
|
* Decorators *
|
|
18
17
|
**************/
|
|
@@ -23,7 +22,6 @@ export declare class MgInputCheckbox {
|
|
|
23
22
|
/**
|
|
24
23
|
* Component value
|
|
25
24
|
* If item.value is `null`, checkbox will be indeterminate by default
|
|
26
|
-
* Required
|
|
27
25
|
*/
|
|
28
26
|
value: CheckboxValue[];
|
|
29
27
|
validateValue(newValue: MgInputCheckbox['value']): void;
|
|
@@ -37,12 +35,12 @@ export declare class MgInputCheckbox {
|
|
|
37
35
|
*/
|
|
38
36
|
identifier: string;
|
|
39
37
|
/**
|
|
40
|
-
*
|
|
38
|
+
* Define input name
|
|
41
39
|
* If not set the value equals the identifier
|
|
42
40
|
*/
|
|
43
41
|
name: string;
|
|
44
42
|
/**
|
|
45
|
-
*
|
|
43
|
+
* Define input label
|
|
46
44
|
*/
|
|
47
45
|
label: string;
|
|
48
46
|
/**
|
|
@@ -58,11 +56,11 @@ export declare class MgInputCheckbox {
|
|
|
58
56
|
*/
|
|
59
57
|
inputVerticalList: boolean;
|
|
60
58
|
/**
|
|
61
|
-
* Define if input is required
|
|
59
|
+
* Define if mg-input-checkbox is required
|
|
62
60
|
*/
|
|
63
61
|
required: boolean;
|
|
64
62
|
/**
|
|
65
|
-
* Define if input is readonly
|
|
63
|
+
* Define if mg-input-checkbox is readonly
|
|
66
64
|
*/
|
|
67
65
|
readonly: boolean;
|
|
68
66
|
/**
|
|
@@ -101,7 +99,7 @@ export declare class MgInputCheckbox {
|
|
|
101
99
|
*/
|
|
102
100
|
errorMessage: string;
|
|
103
101
|
/**
|
|
104
|
-
* Formated value
|
|
102
|
+
* Formated value to display in list
|
|
105
103
|
*/
|
|
106
104
|
checkboxItems: CheckboxItem[];
|
|
107
105
|
validateCheckboxItems(newValue: MgInputCheckbox['checkboxItems']): void;
|
|
@@ -110,14 +108,10 @@ export declare class MgInputCheckbox {
|
|
|
110
108
|
*/
|
|
111
109
|
displaySearchInput: boolean;
|
|
112
110
|
/**
|
|
113
|
-
* Search
|
|
114
|
-
*/
|
|
115
|
-
currentSearchPage: number;
|
|
116
|
-
/**
|
|
117
|
-
* Search value
|
|
111
|
+
* Search value query
|
|
118
112
|
*/
|
|
119
113
|
searchValue: SearchValueType;
|
|
120
|
-
validateSearchValue(
|
|
114
|
+
validateSearchValue(): void;
|
|
121
115
|
/**
|
|
122
116
|
* Search current page
|
|
123
117
|
*/
|
|
@@ -144,10 +138,6 @@ export declare class MgInputCheckbox {
|
|
|
144
138
|
* @param event - to trak "tab" key
|
|
145
139
|
*/
|
|
146
140
|
private handleKeydown;
|
|
147
|
-
/**
|
|
148
|
-
* Reset current-search-page prop
|
|
149
|
-
*/
|
|
150
|
-
private setCurrentSearchPage;
|
|
151
141
|
/**
|
|
152
142
|
* Handle blur event
|
|
153
143
|
*/
|
|
@@ -158,16 +148,40 @@ export declare class MgInputCheckbox {
|
|
|
158
148
|
*/
|
|
159
149
|
private handleSearchChange;
|
|
160
150
|
/**
|
|
161
|
-
*
|
|
162
|
-
* @param event -
|
|
151
|
+
* popover display-change handler
|
|
152
|
+
* @param event - mg-popover display-change custom event
|
|
163
153
|
*/
|
|
164
|
-
private handleCurrentPageChange;
|
|
165
154
|
private handleMgPopoverDisplayChange;
|
|
155
|
+
/**
|
|
156
|
+
* Handle select all button
|
|
157
|
+
* @param event - mass action event trigger a global select/unselect on values
|
|
158
|
+
*/
|
|
159
|
+
private handleMassAction;
|
|
160
|
+
/**
|
|
161
|
+
* Update values
|
|
162
|
+
*/
|
|
163
|
+
private updateValues;
|
|
164
|
+
/**
|
|
165
|
+
* Update ckecboxes item
|
|
166
|
+
* @param key - property to update
|
|
167
|
+
* @param newValue - value to update with
|
|
168
|
+
* @param condition - condtion to applu change on item
|
|
169
|
+
*/
|
|
170
|
+
private updateCheckboxItems;
|
|
166
171
|
/**
|
|
167
172
|
* get invalid element
|
|
168
173
|
* @returns element
|
|
169
174
|
*/
|
|
170
175
|
private getInvalidElement;
|
|
176
|
+
/**
|
|
177
|
+
* Method to update searchResults
|
|
178
|
+
*/
|
|
179
|
+
private updateSearchResults;
|
|
180
|
+
/**
|
|
181
|
+
* Methode to validate if one of inputs value is checked id required
|
|
182
|
+
* @returns truthy if condition is valid
|
|
183
|
+
*/
|
|
184
|
+
private validateRequired;
|
|
171
185
|
/**
|
|
172
186
|
* Check if input is valid
|
|
173
187
|
*/
|
|
@@ -180,6 +194,7 @@ export declare class MgInputCheckbox {
|
|
|
180
194
|
private renderButtonText;
|
|
181
195
|
/**
|
|
182
196
|
* Set input error message
|
|
197
|
+
* @param displayError - dispay error condition
|
|
183
198
|
*/
|
|
184
199
|
private setErrorMessage;
|
|
185
200
|
/**
|
|
@@ -192,24 +207,6 @@ export declare class MgInputCheckbox {
|
|
|
192
207
|
* @returns items to display
|
|
193
208
|
*/
|
|
194
209
|
private getDisplayItems;
|
|
195
|
-
/**
|
|
196
|
-
* Method to get a array range
|
|
197
|
-
* @param from - array start index
|
|
198
|
-
* @param to - array end index
|
|
199
|
-
* @returns array's range
|
|
200
|
-
*/
|
|
201
|
-
private getArrayRange;
|
|
202
|
-
/**
|
|
203
|
-
* Get from and to index
|
|
204
|
-
* @returns [from,to] index
|
|
205
|
-
*/
|
|
206
|
-
private getFromToIndexes;
|
|
207
|
-
/**
|
|
208
|
-
* Method to get pagination total-page
|
|
209
|
-
* @param checkboxes - checkboxes to paginate
|
|
210
|
-
* @returns total page number for pagination
|
|
211
|
-
*/
|
|
212
|
-
private getPaginationTotalPages;
|
|
213
210
|
/*************
|
|
214
211
|
* Lifecycle *
|
|
215
212
|
*************/
|
|
@@ -218,6 +215,10 @@ export declare class MgInputCheckbox {
|
|
|
218
215
|
* @returns timeout
|
|
219
216
|
*/
|
|
220
217
|
componentWillLoad(): ReturnType<typeof setTimeout>;
|
|
218
|
+
/**
|
|
219
|
+
* add listeners
|
|
220
|
+
*/
|
|
221
|
+
componentDidLoad(): void;
|
|
221
222
|
/**
|
|
222
223
|
* Render checkbox multi display values
|
|
223
224
|
* @param selectedValuesNb - selected values length
|
|
@@ -225,22 +226,16 @@ export declare class MgInputCheckbox {
|
|
|
225
226
|
*/
|
|
226
227
|
private renderCheckboxMultiDisplaySelectedValues;
|
|
227
228
|
/**
|
|
228
|
-
* Render
|
|
229
|
+
* Render checkboxes by section
|
|
229
230
|
* @param checkboxes - checkboxes to render
|
|
230
|
-
* @returns
|
|
231
|
+
* @returns render sections of checkboxes
|
|
231
232
|
*/
|
|
232
|
-
private
|
|
233
|
+
private renderCheckboxBySection;
|
|
233
234
|
/**
|
|
234
235
|
* render checkbox multi element
|
|
235
236
|
* @returns html element
|
|
236
237
|
*/
|
|
237
238
|
private renderCheckboxMulti;
|
|
238
|
-
/**
|
|
239
|
-
* Render checkbox element
|
|
240
|
-
* @param checkboxes - checkboxes to render
|
|
241
|
-
* @returns HTML Element
|
|
242
|
-
*/
|
|
243
|
-
private renderCheckboxes;
|
|
244
239
|
/**
|
|
245
240
|
* Render
|
|
246
241
|
* @returns HTML Element
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available expand toggle display options
|
|
3
|
+
*/
|
|
4
|
+
export declare const expandToggleDisplays: readonly ["text", "icon"];
|
|
5
|
+
/**
|
|
6
|
+
* Generated expand toggle display type from available expand toggle display options
|
|
7
|
+
*/
|
|
8
|
+
export type ExpandToggleDisplayType = (typeof expandToggleDisplays)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Available title positions
|
|
11
|
+
*/
|
|
12
|
+
export declare const titlePositions: readonly ["left", "right"];
|
|
13
|
+
/**
|
|
14
|
+
* Generated title positions type from available title positions
|
|
15
|
+
*/
|
|
16
|
+
export type TitlePositionType = (typeof titlePositions)[number];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
import { ClassList } from '../../../utils/components.utils';
|
|
3
|
+
import { type ExpandToggleDisplayType, type TitlePositionType } from './mg-panel.conf';
|
|
3
4
|
export declare class MgPanel {
|
|
4
5
|
/************
|
|
5
6
|
* Internal *
|
|
@@ -32,19 +33,29 @@ export declare class MgPanel {
|
|
|
32
33
|
* Panel title pattern error message
|
|
33
34
|
*/
|
|
34
35
|
titlePatternErrorMessage: string;
|
|
36
|
+
/**
|
|
37
|
+
* Define if panel title is editable
|
|
38
|
+
*/
|
|
39
|
+
titleEditable: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Define title position
|
|
42
|
+
*/
|
|
43
|
+
titlePosition: TitlePositionType;
|
|
44
|
+
validateTitlePosition(newValue: MgPanel['titlePosition']): void;
|
|
35
45
|
/**
|
|
36
46
|
* Panel is opened
|
|
37
47
|
*/
|
|
38
48
|
expanded: boolean;
|
|
39
49
|
handleExpanded(newValue: boolean): void;
|
|
40
50
|
/**
|
|
41
|
-
*
|
|
51
|
+
* Define expand toggle button display
|
|
42
52
|
*/
|
|
43
|
-
|
|
53
|
+
expandToggleDisplay: ExpandToggleDisplayType;
|
|
54
|
+
validateExpandToggleDisplay(newValue: MgPanel['expandToggleDisplay']): void;
|
|
44
55
|
/**
|
|
45
|
-
*
|
|
56
|
+
* Disable possibility to toggle expand
|
|
46
57
|
*/
|
|
47
|
-
|
|
58
|
+
expandToggleDisabled: boolean;
|
|
48
59
|
/**
|
|
49
60
|
* Component classes
|
|
50
61
|
*/
|
|
@@ -103,18 +114,41 @@ export declare class MgPanel {
|
|
|
103
114
|
* Check if props are well configured on init
|
|
104
115
|
*/
|
|
105
116
|
componentWillLoad(): void;
|
|
106
|
-
/**
|
|
107
|
-
* Header left conditional render
|
|
108
|
-
* @returns header left element
|
|
109
|
-
*/
|
|
110
|
-
private headerLeft;
|
|
111
117
|
/**
|
|
112
118
|
* Edit DOM after render
|
|
113
119
|
*/
|
|
114
120
|
componentDidRender(): void;
|
|
121
|
+
/*************
|
|
122
|
+
* Render *
|
|
123
|
+
*************/
|
|
124
|
+
/**
|
|
125
|
+
* Render collapse button
|
|
126
|
+
* @returns collpase button
|
|
127
|
+
*/
|
|
128
|
+
private renderCollapseButton;
|
|
129
|
+
/**
|
|
130
|
+
* Render edit button
|
|
131
|
+
* @returns edit Button
|
|
132
|
+
*/
|
|
133
|
+
private renderEditButton;
|
|
134
|
+
/**
|
|
135
|
+
* Render input button
|
|
136
|
+
* @returns edit title input
|
|
137
|
+
*/
|
|
138
|
+
private renderEditInput;
|
|
139
|
+
/**
|
|
140
|
+
* Render title
|
|
141
|
+
* @returns title element
|
|
142
|
+
*/
|
|
143
|
+
private renderTitle;
|
|
144
|
+
/**
|
|
145
|
+
* Render header children
|
|
146
|
+
* @returns header child
|
|
147
|
+
*/
|
|
148
|
+
private renderHeaderChildren;
|
|
115
149
|
/**
|
|
116
150
|
* Render component
|
|
117
|
-
* @returns
|
|
151
|
+
* @returns rendered component
|
|
118
152
|
*/
|
|
119
153
|
render(): HTMLElement;
|
|
120
154
|
}
|