@mgdis/mg-components 6.14.0 → 6.16.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.
Files changed (128) hide show
  1. package/dist/cjs/{index-DUJwxnoi.js → index-CpENFzEo.js} +2 -2
  2. package/dist/cjs/{index-DzBkSgSK.js → index-T3-qWqFE.js} +8 -2
  3. package/dist/cjs/{index-CwjAofQ1.js → index-YM1EJx9X.js} +43 -31
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/mg-action-more_37.cjs.entry.js +136 -150
  6. package/dist/cjs/mg-alert.cjs.entry.js +4 -4
  7. package/dist/cjs/mg-components.cjs.js +3 -3
  8. package/dist/cjs/mg-input-combobox.cjs.entry.js +15 -13
  9. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +1247 -16003
  10. package/dist/cjs/mg-loader.cjs.entry.js +4 -4
  11. package/dist/cjs/mg-progress.cjs.entry.js +3 -3
  12. package/dist/collection/assets/icons/index.js +1 -1
  13. package/dist/collection/collection-manifest.json +2 -2
  14. package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
  15. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +1 -1
  16. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +49 -106
  17. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +55 -36
  18. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +11 -9
  19. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
  20. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +6 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
  22. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +1 -1
  24. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
  26. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
  28. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
  29. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +2 -2
  30. package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
  31. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  32. package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
  33. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  34. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  35. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  36. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  37. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  38. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  39. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  40. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  41. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  42. package/dist/collection/components/molecules/mg-table/mg-table.js +2 -2
  43. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
  44. package/dist/collection/locales/en/messages.json +19 -15
  45. package/dist/collection/locales/fr/messages.json +20 -16
  46. package/dist/components/index2.js +3 -3
  47. package/dist/components/index3.js +43 -31
  48. package/dist/components/mg-action-more.js +2 -2
  49. package/dist/components/mg-alert.js +2 -2
  50. package/dist/components/mg-badge2.js +1 -1
  51. package/dist/components/mg-button2.js +1 -1
  52. package/dist/components/mg-card2.js +1 -1
  53. package/dist/components/mg-character-left2.js +1 -1
  54. package/dist/components/mg-details.js +2 -2
  55. package/dist/components/mg-divider2.js +1 -1
  56. package/dist/components/mg-form.js +2 -2
  57. package/dist/components/mg-icon2.js +1 -1
  58. package/dist/components/mg-illustrated-message.js +2 -2
  59. package/dist/components/mg-input-checkbox-paginated2.js +42 -124
  60. package/dist/components/mg-input-checkbox.js +89 -59
  61. package/dist/components/mg-input-combobox.js +14 -12
  62. package/dist/components/mg-input-date.js +2 -2
  63. package/dist/components/mg-input-numeric.js +7 -2
  64. package/dist/components/mg-input-password.js +2 -2
  65. package/dist/components/mg-input-radio.js +2 -2
  66. package/dist/components/mg-input-rich-text-editor.js +1247 -16003
  67. package/dist/components/mg-input-select2.js +2 -2
  68. package/dist/components/mg-input-text2.js +2 -2
  69. package/dist/components/mg-input-textarea.js +2 -2
  70. package/dist/components/mg-input-title2.js +1 -1
  71. package/dist/components/mg-input-toggle.js +2 -2
  72. package/dist/components/mg-input2.js +1 -1
  73. package/dist/components/mg-item-more2.js +2 -2
  74. package/dist/components/mg-loader2.js +2 -2
  75. package/dist/components/mg-menu-item2.js +1 -1
  76. package/dist/components/mg-message2.js +3 -3
  77. package/dist/components/mg-modal.js +3 -3
  78. package/dist/components/mg-pagination.js +227 -1
  79. package/dist/components/mg-panel.js +3 -3
  80. package/dist/components/mg-popover-content2.js +2 -2
  81. package/dist/components/mg-popover2.js +2 -2
  82. package/dist/components/mg-progress.js +2 -2
  83. package/dist/components/mg-skip-links.js +2 -2
  84. package/dist/components/mg-table.js +3 -3
  85. package/dist/components/mg-tabs.js +1 -311
  86. package/dist/components/mg-tabs2.js +313 -0
  87. package/dist/components/mg-tag.js +1 -1
  88. package/dist/components/mg-tooltip-content2.js +1 -1
  89. package/dist/components/mg-tooltip2.js +2 -2
  90. package/dist/esm/{index-Bv7NHR-W.js → index-Bab8_u8S.js} +43 -31
  91. package/dist/esm/{index-Degtjvph.js → index-JHj_9FSs.js} +8 -2
  92. package/dist/esm/{index-Dr7GYvIz.js → index-WtiuOkLj.js} +2 -2
  93. package/dist/esm/loader.js +3 -3
  94. package/dist/esm/mg-action-more_37.entry.js +136 -150
  95. package/dist/esm/mg-alert.entry.js +4 -4
  96. package/dist/esm/mg-components.js +4 -4
  97. package/dist/esm/mg-input-combobox.entry.js +15 -13
  98. package/dist/esm/mg-input-rich-text-editor.entry.js +1248 -16004
  99. package/dist/esm/mg-loader.entry.js +4 -4
  100. package/dist/esm/mg-progress.entry.js +3 -3
  101. package/dist/mg-components/locales/en/messages.json +19 -15
  102. package/dist/mg-components/locales/fr/messages.json +20 -16
  103. package/dist/mg-components/mg-components.esm.js +1 -1
  104. package/dist/mg-components/{p-056ba467.entry.js → p-42a90251.entry.js} +1 -1
  105. package/dist/mg-components/p-54156253.entry.js +1 -0
  106. package/dist/mg-components/{p-d13a6fdc.entry.js → p-658f828c.entry.js} +1 -1
  107. package/dist/mg-components/{p-c522f3c1.entry.js → p-82455ac7.entry.js} +1 -1
  108. package/dist/mg-components/p-Bab8_u8S.js +1 -0
  109. package/dist/mg-components/p-JHj_9FSs.js +2 -0
  110. package/dist/mg-components/p-WtiuOkLj.js +1 -0
  111. package/dist/mg-components/p-abbd151c.entry.js +1 -0
  112. package/dist/mg-components/p-c85b5d10.entry.js +1 -0
  113. package/dist/types/assets/icons/index.d.ts +6 -0
  114. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +17 -40
  115. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +1 -2
  116. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +15 -6
  117. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +1 -1
  118. package/dist/types/components.d.ts +6 -33
  119. package/ide/intellij/web-types.json +13 -13
  120. package/ide/vscode/html-custom-data.json +39 -3
  121. package/package.json +23 -23
  122. package/dist/components/mg-pagination2.js +0 -229
  123. package/dist/mg-components/p-625c463c.entry.js +0 -1
  124. package/dist/mg-components/p-Bv7NHR-W.js +0 -1
  125. package/dist/mg-components/p-Degtjvph.js +0 -2
  126. package/dist/mg-components/p-Dr7GYvIz.js +0 -1
  127. package/dist/mg-components/p-cac23bd7.entry.js +0 -1
  128. package/dist/mg-components/p-e75f5383.entry.js +0 -10
@@ -90,7 +90,7 @@ const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgIllustra
90
90
  * @returns HTML Element
91
91
  */
92
92
  render() {
93
- return (h("div", { key: 'f2bcf91e8d639736514a55a73d0182339eda1455', class: this.classCollection.join() }, h("div", { key: '46f862fc2a3daf2f217c55feebd41abb76252de2', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: 'e2a0e9752a6739a684fd2668a8e8f0f792a0c38b', name: "illustration" })), h("div", { key: 'b037dd43ae59c07ca122b68b56dc3230a7aa94f2', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '3a99f08cfb68bd51fbd015d213bb462acbfdda1a', name: "title" }), h("slot", { key: '14490ee1e7f9470f433c6249d502bd0a4dd77ca3', name: "details" }))));
93
+ return (h("div", { key: 'b7cea46c2fad219e02009fa44c772c0a09a5234f', class: this.classCollection.join() }, h("div", { key: '56b956ee405886ef2de2ef413ac1bc6902f287b3', class: "mg-c-illustrated-message__illustration" }, h("slot", { key: '33183d226a2443ccf1763ebff4c48f670d1d77ec', name: "illustration" })), h("div", { key: '69a7e034da7e2aef8dc488f9275b4546e905513c', class: "mg-c-illustrated-message__slots" }, h("slot", { key: '0eb9d5126f3d13380ea0a13a9eb754a7543e4178', name: "title" }), h("slot", { key: '088d3bae3be0d5e5d9fc8c07fee42dda39177fd6', name: "details" }))));
94
94
  }
95
95
  get element() { return this; }
96
96
  static get watchers() { return {
@@ -98,7 +98,7 @@ const MgIllustratedMessage$1 = /*@__PURE__*/ proxyCustomElement(class MgIllustra
98
98
  "direction": ["watchDirection"]
99
99
  }; }
100
100
  static get style() { return mgIllustratedMessageCss; }
101
- }, [1, "mg-illustrated-message", {
101
+ }, [257, "mg-illustrated-message", {
102
102
  "size": [1],
103
103
  "direction": [1],
104
104
  "classCollection": [32]
@@ -1,31 +1,14 @@
1
- import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$8 } from './mg-button2.js';
3
- import { d as defineCustomElement$7 } from './mg-icon2.js';
4
- import { d as defineCustomElement$6 } from './mg-input2.js';
5
- import { d as defineCustomElement$5 } from './mg-input-select2.js';
6
- import { d as defineCustomElement$4 } from './mg-input-title2.js';
7
- import { d as defineCustomElement$3 } from './mg-pagination2.js';
8
- import { d as defineCustomElement$2 } from './mg-tooltip2.js';
9
- import { d as defineCustomElement$1 } from './mg-tooltip-content2.js';
10
-
11
- /**
12
- * List of all availables checkbox type
13
- */
14
- const checkboxTypes = ['checkbox', 'multi'];
15
- /**
16
- * mg-input-checkbox-paginated section kind value
17
- */
18
- const SectionKind = {
19
- SELECTED: 'selected',
20
- NOT_SELECTED: 'not-selected',
21
- };
1
+ import { h, proxyCustomElement, HTMLElement, Host } from '@stencil/core/internal/client';
2
+ import { f as formatID } from './index2.js';
3
+ import { d as defineCustomElement$2 } from './mg-button2.js';
4
+ import { d as defineCustomElement$1 } from './mg-icon2.js';
22
5
 
23
6
  /**
24
7
  * Get checkboxes list template
25
8
  * @param props - MgInputCheckboxList Interface Props
26
9
  * @returns input template
27
10
  */
28
- const MgInputCheckboxList = (props) => (h("ul", { class: "mg-c-input__input-group-container", role: "list", "aria-describedby": props.displaySearchInput ? 'search-results' : undefined, "aria-label": props.displaySearchInput ? props.messages.searchResults : undefined, "aria-live": props.displaySearchInput ? 'polite' : undefined, id: props.id }, props.checkboxes.map(input => {
11
+ const MgInputCheckboxList = (props) => (h("ul", { class: "mg-c-input__input-group-container", role: "list", "aria-labelledby": props.labelledby, id: props.id }, props.checkboxes.map(input => {
29
12
  var _a, _b;
30
13
  return (h("li", { key: input._id, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': props.disabled || input.disabled } },
31
14
  h("input", { type: "checkbox", id: input._id, name: props.name, value: (_a = input.value) === null || _a === void 0 ? void 0 : _a.toString(), checked: Boolean(input.value), required: input.required, "aria-invalid": ((_b = props.invalid) === null || _b === void 0 ? void 0 : _b.toString()) || 'false', disabled: props.disabled || input.disabled, indeterminate: input.value === null, onInput: input._handleInput, onBlur: input._handleBlur, onKeyDown: input._handleKeydown }),
@@ -36,11 +19,7 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
36
19
  constructor() {
37
20
  super();
38
21
  this.__registerHost();
39
- this.massAction = createEvent(this, "mass-action", 7);
40
- /*************
41
- * Constantes *
42
- *************/
43
- this.offset = 10;
22
+ this.step = 10;
44
23
  /*************
45
24
  * Decorators *
46
25
  *************/
@@ -53,76 +32,45 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
53
32
  */
54
33
  this.disabled = false;
55
34
  /**
56
- * Current page
35
+ * Page items limit to display
57
36
  */
58
- this.currentPage = 1;
59
- /**
60
- * Define checkboxes to paginate
61
- */
62
- this.checkboxes = [];
63
- /**
64
- * Is checked items values expanded
65
- */
66
- this.expanded = true;
37
+ this.limit = this.step;
67
38
  /***********
68
39
  * Methods *
69
40
  ***********/
70
41
  /**
71
- * Mass action handler
42
+ * Component has next checkboxes to display
43
+ * @returns truthy if have next elements
72
44
  */
73
- this.massActionHandler = () => {
74
- this.massAction.emit(this.sectionKind);
45
+ this.hasNext = () => {
46
+ return this.checkboxes.length > this.limit;
75
47
  };
76
48
  /**
77
- * Toggle items button handler
49
+ * Set items from checkboxes and limit
78
50
  */
79
- this.handleToggleClick = () => {
80
- this.expanded = !this.expanded;
51
+ this.setItems = () => {
52
+ this.items = this.checkboxes.slice(0, this.limit);
81
53
  };
82
54
  /**
83
- * Method to get a array range
84
- * @param from - array start index
85
- * @param to - array end index
86
- * @returns array's range
87
- */
88
- this.getArrayRange = (array, from, to) => array.slice(from, to);
89
- /**
90
- * Method to get page count from items
91
- * @param items - items to count
92
- * @returns page count from items
93
- */
94
- this.getPageCount = (items) => ((items === null || items === void 0 ? void 0 : items.length) > 0 ? Math.ceil(items.length / this.offset) : 0);
95
- /**
96
- * Handle mg-pagination current page change event
97
- * @param event - pagination current page change event
55
+ * Handle load-more <mg-button> click event
98
56
  */
99
- this.handleCurrentPageChange = (event) => {
100
- this.currentPage = Number(event.detail);
57
+ this.handleLoadMore = () => {
58
+ if (this.hasNext()) {
59
+ this.limit += this.step;
60
+ }
101
61
  };
102
62
  }
103
- watchCheckboxes(newValue, oldValue) {
104
- const pageCountNewValue = this.getPageCount(newValue);
105
- const pageCountOldValue = this.getPageCount(oldValue);
106
- // after each array.length update we reset pagination
107
- // when items fill on page, we set current page to 1
108
- if (pageCountNewValue === 1 || (pageCountNewValue !== 0 && this.currentPage === 0)) {
109
- this.currentPage = 1;
110
- }
111
- // when old items page numbers match the current page AND new items page number is lower than current page, we set the new last page
112
- else if (pageCountOldValue === this.currentPage && pageCountNewValue < this.currentPage) {
113
- this.currentPage--;
114
- }
115
- this.sectionKind = newValue[0].value ? SectionKind.SELECTED : SectionKind.NOT_SELECTED;
63
+ watchCheckboxes() {
64
+ this.setItems();
65
+ }
66
+ watchLimit() {
67
+ this.setItems();
116
68
  }
117
69
  /**
118
- * Get from and to index
119
- * @returns [from,to] index
70
+ * Method to reset limit
120
71
  */
121
- getFromToIndexes() {
122
- const isFirstPage = this.currentPage === 1;
123
- const from = isFirstPage ? 0 : (this.currentPage - 1) * this.offset;
124
- const to = isFirstPage ? this.offset : this.currentPage * this.offset;
125
- return [from, to];
72
+ async resetLimit() {
73
+ this.limit = this.step;
126
74
  }
127
75
  /*************
128
76
  * Lifecycle *
@@ -131,39 +79,39 @@ const MgInputCheckboxPaginated = /*@__PURE__*/ proxyCustomElement(class MgInputC
131
79
  * Validate props
132
80
  */
133
81
  componentWillLoad() {
134
- this.watchCheckboxes(this.checkboxes);
82
+ this.watchCheckboxes();
135
83
  }
136
84
  /**
137
85
  * Render
138
86
  * @returns HTML Element
139
87
  */
140
88
  render() {
141
- const getText = (checkboxes) => (h("em", { key: '0bf489a95090b519c85a4649d6c3b9a0e97bf0d8', class: "mg-c-input__section-header-title-label" }, `${this.messages[checkboxes.length > 1 ? 'titlePlural' : 'title']} (${checkboxes.length})`));
142
- const [from, to] = this.getFromToIndexes();
143
- const itemsContainerId = `items-${this.sectionKind}-container`;
144
- return (h(Host, { key: 'ee67aa1705efa2b88010748b6978e0c1dec6e4de', hidden: this.checkboxes.length < 1 }, h("div", { key: 'b713e2a0e21f57d3b238b72163f3d7a4781b7026', class: "mg-c-input__section-header" }, this.sectionKind === SectionKind.SELECTED ? (h("mg-button", { variant: "flat", onClick: this.handleToggleClick, "aria-controls": itemsContainerId, "aria-expanded": this.expanded.toString() }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), h("span", { class: "mg-c-input__section-header-title" }, getText(this.checkboxes)))) : (h("p", { class: "mg-c-input__section-header-title mg-c-input__section-header-title--static" }, getText(this.checkboxes))), ((this.sectionKind === SectionKind.SELECTED && this.expanded && this.checkboxes.some(checkbox => checkbox.value === true && checkbox.disabled !== true)) ||
145
- (this.sectionKind === SectionKind.NOT_SELECTED && this.checkboxes.some(checkbox => checkbox.value === false && checkbox.disabled !== true))) && (h("mg-tooltip", { key: '7e5cba3b03cdc7bab68650b9aed36c195ca4dfe6', class: "mg-c-input__section-header-tootlip", message: this.messages.tooltip }, h("mg-button", { key: '4980f26ade12cbfaa6ef6041fa84918900cb652a', variant: "link", onClick: this.massActionHandler }, this.messages.action))), this.expanded && this.getPageCount(this.checkboxes) > 1 && (h("mg-pagination", { key: "search-pagination", totalPages: this.getPageCount(this.checkboxes), currentPage: this.currentPage, "onCurrent-page-change": this.handleCurrentPageChange, hideNavigationLabels: true, hidePageCount: true, identifier: `input-checkbox-pagination-${this.sectionKind}` }))), h("div", { key: '950b07ea9c59e8bc21e236bf32e3bf0a9318a008', hidden: !this.expanded, id: itemsContainerId, class: "mg-c-input__section-content" }, h(MgInputCheckboxList, { key: '276f679e01756d6d60f043dc1c04807b5058750a', checkboxes: this.getArrayRange(this.checkboxes, from, to), displaySearchInput: true, messages: this.messages, id: `items-${this.sectionKind}`, disabled: this.disabled, name: this.name, invalid: this.invalid }))));
89
+ const listId = formatID(this.messages.label);
90
+ const tabId = 'tab-info';
91
+ return (h(Host, { key: '8e58037e78fcd7990bbd681053758b0ec4d0c4e0' }, h("slot", { key: 'c64e9c8f65a526b2289d3663fff64df02a282c96', name: "header-action" }), h("div", { key: 'c5953bb7e970384b231865d7fa4708fe2da4b407', class: "mg-c-input__tabs-content" }, h("p", { key: 'c0899cb7e7a6dea282f05aacf0fb05acd60a9d20', id: tabId, class: { 'mg-c-input__popover-info': true, 'mg-u-visually-hidden': this.items.length !== 0 }, "aria-live": this.items.length !== 0 ? 'polite' : undefined }, this.items.length === 0 ? this.messages.noValue : this.messages.values.replace('{count}', this.items.length.toString())), this.items.length > 0 && (h(MgInputCheckboxList, { key: '0bb1b4160d75b00d3fb5d9c08f3a560a16105e57', checkboxes: this.items, labelledby: tabId, id: listId, disabled: this.disabled, name: this.name, invalid: this.invalid })), this.hasNext() && (h("mg-button", { key: "load-more", variant: "flat", class: "mg-c-input__load-more", tabIndex: -1, "full-width": true, onClick: this.handleLoadMore, "aria-controls": listId }, h("mg-icon", { key: 'fd1560d7254f437f284925427130f69539b5fd3b', icon: "chevron-down" }), this.messages.showMore)))));
146
92
  }
147
93
  static get watchers() { return {
148
- "checkboxes": ["watchCheckboxes"]
94
+ "checkboxes": ["watchCheckboxes"],
95
+ "limit": ["watchLimit"]
149
96
  }; }
150
- }, [2, "mg-input-checkbox-paginated", {
97
+ }, [262, "mg-input-checkbox-paginated", {
151
98
  "readonly": [4],
152
99
  "disabled": [4],
153
100
  "name": [1],
154
101
  "invalid": [4],
155
- "currentPage": [1026, "current-page"],
156
102
  "checkboxes": [16],
157
103
  "messages": [16],
158
- "expanded": [32]
104
+ "limit": [32],
105
+ "resetLimit": [64]
159
106
  }, undefined, {
160
- "checkboxes": ["watchCheckboxes"]
107
+ "checkboxes": ["watchCheckboxes"],
108
+ "limit": ["watchLimit"]
161
109
  }]);
162
110
  function defineCustomElement() {
163
111
  if (typeof customElements === "undefined") {
164
112
  return;
165
113
  }
166
- const components = ["mg-input-checkbox-paginated", "mg-button", "mg-icon", "mg-input", "mg-input-select", "mg-input-title", "mg-pagination", "mg-tooltip", "mg-tooltip-content"];
114
+ const components = ["mg-input-checkbox-paginated", "mg-button", "mg-icon"];
167
115
  components.forEach(tagName => { switch (tagName) {
168
116
  case "mg-input-checkbox-paginated":
169
117
  if (!customElements.get(tagName)) {
@@ -171,41 +119,11 @@ function defineCustomElement() {
171
119
  }
172
120
  break;
173
121
  case "mg-button":
174
- if (!customElements.get(tagName)) {
175
- defineCustomElement$8();
176
- }
177
- break;
178
- case "mg-icon":
179
- if (!customElements.get(tagName)) {
180
- defineCustomElement$7();
181
- }
182
- break;
183
- case "mg-input":
184
- if (!customElements.get(tagName)) {
185
- defineCustomElement$6();
186
- }
187
- break;
188
- case "mg-input-select":
189
- if (!customElements.get(tagName)) {
190
- defineCustomElement$5();
191
- }
192
- break;
193
- case "mg-input-title":
194
- if (!customElements.get(tagName)) {
195
- defineCustomElement$4();
196
- }
197
- break;
198
- case "mg-pagination":
199
- if (!customElements.get(tagName)) {
200
- defineCustomElement$3();
201
- }
202
- break;
203
- case "mg-tooltip":
204
122
  if (!customElements.get(tagName)) {
205
123
  defineCustomElement$2();
206
124
  }
207
125
  break;
208
- case "mg-tooltip-content":
126
+ case "mg-icon":
209
127
  if (!customElements.get(tagName)) {
210
128
  defineCustomElement$1();
211
129
  }
@@ -214,4 +132,4 @@ function defineCustomElement() {
214
132
  }
215
133
  defineCustomElement();
216
134
 
217
- export { MgInputCheckboxPaginated as M, SectionKind as S, MgInputCheckboxList as a, checkboxTypes as c, defineCustomElement as d };
135
+ export { MgInputCheckboxPaginated as M, MgInputCheckboxList as a, defineCustomElement as d };
@@ -1,22 +1,34 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { C as ClassList, e as cleanString, i as isValidString, t as toString } from './index2.js';
3
- import { d as defineCustomElement$a, S as SectionKind, a as MgInputCheckboxList, c as checkboxTypes } from './mg-input-checkbox-paginated2.js';
4
- import { d as defineCustomElement$b, b as classFieldset, e as classVerticalList, c as classReadonly, a as classDisabled } from './mg-input2.js';
2
+ import { C as ClassList, m as cleanString, i as isValidString, t as toString } from './index2.js';
3
+ import { d as defineCustomElement$9, a as MgInputCheckboxList } from './mg-input-checkbox-paginated2.js';
4
+ import { d as defineCustomElement$a, b as classFieldset, e as classVerticalList, c as classReadonly, a as classDisabled } from './mg-input2.js';
5
5
  import { i as initLocales } from './index3.js';
6
- import { d as defineCustomElement$f } from './mg-button2.js';
7
- import { d as defineCustomElement$e } from './mg-card2.js';
8
- import { d as defineCustomElement$d } from './mg-character-left2.js';
9
- import { d as defineCustomElement$c } from './mg-icon2.js';
10
- import { d as defineCustomElement$9 } from './mg-input-select2.js';
6
+ import { d as defineCustomElement$4, S as Status } from './mg-tabs2.js';
7
+ import { d as defineCustomElement$f } from './mg-badge2.js';
8
+ import { d as defineCustomElement$e } from './mg-button2.js';
9
+ import { d as defineCustomElement$d } from './mg-card2.js';
10
+ import { d as defineCustomElement$c } from './mg-character-left2.js';
11
+ import { d as defineCustomElement$b } from './mg-icon2.js';
11
12
  import { d as defineCustomElement$8 } from './mg-input-text2.js';
12
13
  import { d as defineCustomElement$7 } from './mg-input-title2.js';
13
- import { d as defineCustomElement$6 } from './mg-pagination2.js';
14
- import { d as defineCustomElement$5 } from './mg-popover2.js';
15
- import { d as defineCustomElement$4 } from './mg-popover-content2.js';
14
+ import { d as defineCustomElement$6 } from './mg-popover2.js';
15
+ import { d as defineCustomElement$5 } from './mg-popover-content2.js';
16
16
  import { d as defineCustomElement$3 } from './mg-tooltip2.js';
17
17
  import { d as defineCustomElement$2 } from './mg-tooltip-content2.js';
18
18
 
19
- const mgInputCheckboxCss = ".mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);overflow-wrap:anywhere}.mg-c-input.mg-c-input--fieldset{padding:0;border:0;margin-right:0;margin-left:0}.mg-c-input.mg-c-input--fieldset input[type=radio],.mg-c-input.mg-c-input--fieldset input[type=checkbox]{width:var(--mg-c-input-check-size);height:var(--mg-c-input-check-size);flex-shrink:0;margin:calc((var(--mg-b-font-size)*var(--mg-b-line-height) - var(--mg-c-input-check-size))/2) var(--mg-b-size-8) 0 0}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group{display:flex;align-items:start}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group-container{display:flex;flex-wrap:wrap;padding:0;margin:0;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);gap:var(--mg-b-size-12) var(--mg-b-size-24);list-style:none}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group.mg-c-input__input-group--disabled label{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--fieldset.mg-c-input--vertical-list .mg-c-input__input-group-container,.mg-c-input.mg-c-input--fieldset.mg-c-input--checkbox-multi .mg-c-input__input-group-container{flex-direction:column}.mg-c-input.mg-c-input--fieldset.mg-c-input--label-on-top .mg-c-input__input-group-container{margin-top:var(--mg-b-size-8)}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-group-container{padding:var(--mg-b-size-4) var(--mg-b-size-8);margin:0}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-container{display:flex;width:unset;flex:unset;flex-wrap:wrap;column-gap:var(--mg-b-size-8)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-container-list{display:flex;flex-flow:row wrap;padding:0;margin:0;gap:var(--mg-b-size-4);list-style:none}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__sections{max-height:100%;padding-right:var(--mg-b-size-8);overflow-y:auto}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__section-header{display:flex;min-height:var(--mg-b-size-min-height);flex-wrap:wrap;flex-wrap:nowrap;align-items:center;gap:var(--mg-b-size-8);text-wrap:nowrap}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__section-header-tootlip{display:inline-block;width:auto;height:auto;margin:0}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__section-header-title{display:inline;margin:0;color:var(--mg-b-color-neutral-80)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__section-header-title-label{font-size:var(--mg-b-font-size)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__section-header-title--static.mg-c-input__section-header-title{margin:0 var(--mg-b-size-12)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-value{display:inline-flex;min-width:var(--mg-b-size-min-height);min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;justify-content:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-radius:var(--mg-b-size-4);background-color:var(--mg-b-color-neutral-20);font-size:var(--mg-b-font-size)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-no-result{text-align:center}.mg-c-input.mg-c-input--checkbox-multi b{margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--disabled .mg-c-input__input-container b{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--with-values .mg-c-input__input-container{gap:var(--mg-b-size-4)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--search-mode .mg-c-input__content{display:flex;width:calc(var(--mg-b-size-floating-element-max-width) - var(--mg-b-size-16));height:calc(50*var(--mg-b-size-8));max-height:calc(100vh - var(--mg-b-size-32));flex-direction:column;gap:var(--mg-b-size-8)}.mg-c-input.mg-c-input--checkbox-multi:not(.mg-c-input--label-on-top) mg-tooltip:not(.mg-c-input__section-header-tootlip){margin-left:var(--mg-b-size-8)}.mg-c-input.mg-c-input--checkbox-multi mg-popover{--mg-c-card-spacing:var(--mg-b-size-8)}.mg-c-input.mg-c-input--readonly ul{display:flex;min-height:var(--mg-b-font-size);flex-flow:column wrap;padding:0;margin:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) 0 0;list-style:none;row-gap:var(--mg-b-size-8)}";
19
+ /**
20
+ * List of all availables checkbox type
21
+ */
22
+ const checkboxTypes = ['checkbox', 'multi'];
23
+ /**
24
+ * mg-input-checkbox-paginated section kind value
25
+ */
26
+ const SectionKind = {
27
+ SELECTED: 'selected',
28
+ NOT_SELECTED: 'not-selected',
29
+ };
30
+
31
+ const mgInputCheckboxCss = ".mg-c-input__readonly-value{min-height:var(--mg-b-font-size);align-self:flex-start;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);overflow-wrap:anywhere}.mg-c-input.mg-c-input--fieldset{padding:0;border:0;margin-right:0;margin-left:0}.mg-c-input.mg-c-input--fieldset input[type=radio],.mg-c-input.mg-c-input--fieldset input[type=checkbox]{width:var(--mg-c-input-check-size);height:var(--mg-c-input-check-size);flex-shrink:0;margin:calc((var(--mg-b-font-size)*var(--mg-b-line-height) - var(--mg-c-input-check-size))/2) var(--mg-b-size-8) 0 0}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group{display:flex;align-items:start}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group-container{display:flex;flex-wrap:wrap;padding:0;margin:0;margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2);gap:var(--mg-b-size-12) var(--mg-b-size-24);list-style:none}.mg-c-input.mg-c-input--fieldset .mg-c-input__input-group.mg-c-input__input-group--disabled label{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--fieldset.mg-c-input--vertical-list .mg-c-input__input-group-container,.mg-c-input.mg-c-input--fieldset.mg-c-input--checkbox-multi .mg-c-input__input-group-container{flex-direction:column}.mg-c-input.mg-c-input--fieldset.mg-c-input--label-on-top .mg-c-input__input-group-container{margin-top:var(--mg-b-size-8)}.mg-c-input__popover-info{padding:var(--mg-b-size-8);margin:0;color:var(--mg-b-color-neutral-90);text-align:center}.mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-group-container{padding:var(--mg-b-size-4) var(--mg-b-size-8);margin:0}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-container{display:flex;width:unset;flex:unset;flex-wrap:wrap;column-gap:var(--mg-b-size-8)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-container-list{display:flex;flex-flow:row wrap;padding:0;margin:0;gap:var(--mg-b-size-4);list-style:none}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__tab{display:block;min-height:calc(var(--mg-b-size-4)*55)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__tabs{min-height:0;flex-shrink:1}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__tabs-action{padding-top:var(--mg-b-size-16);padding-bottom:var(--mg-b-size-12)}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__tabs-content{height:calc(24*var(--mg-b-size-8) - 2*var(--mg-b-size-8));overflow-y:auto}.mg-c-input.mg-c-input--checkbox-multi .mg-c-input__input-value{display:inline-flex;min-width:var(--mg-b-size-min-height);min-height:var(--mg-b-size-min-height);box-sizing:border-box;align-items:center;justify-content:center;padding:calc((var(--mg-b-size-min-height) - 2*var(--mg-b-size-border) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) var(--mg-b-size-12);border-radius:var(--mg-b-size-4);background-color:var(--mg-b-color-neutral-20);font-size:var(--mg-b-font-size)}.mg-c-input.mg-c-input--checkbox-multi b{margin-top:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--disabled .mg-c-input__input-container b{opacity:var(--mg-b-opacity-element-disabled)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--with-values .mg-c-input__input-container{gap:var(--mg-b-size-4)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--search-mode .mg-c-input__content{display:flex;width:calc(var(--mg-b-size-floating-element-max-width) - var(--mg-b-size-16));flex-direction:column;gap:var(--mg-b-size-4)}.mg-c-input.mg-c-input--checkbox-multi.mg-c-input--search-mode .mg-c-input__content .mg-c-input__tabs-content{min-height:calc(var(--mg-b-size-4)*55)}.mg-c-input.mg-c-input--checkbox-multi:not(.mg-c-input--label-on-top) mg-tooltip:not(.mg-c-input__section-header-tootlip){margin-left:var(--mg-b-size-8)}.mg-c-input.mg-c-input--checkbox-multi mg-popover{--mg-c-card-spacing:var(--mg-b-size-8)}.mg-c-input.mg-c-input--readonly ul{display:flex;min-height:var(--mg-b-font-size);flex-flow:column wrap;padding:0;margin:calc((var(--mg-b-size-min-height) - var(--mg-b-font-size)*var(--mg-b-line-height))/2) 0 0;list-style:none;row-gap:var(--mg-b-size-8)}";
20
32
 
21
33
  /**
22
34
  * type CheckboxItem validation function
@@ -45,6 +57,7 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
45
57
  this.searchStart = 10;
46
58
  // popover variables
47
59
  this.hasOpenedPopover = false;
60
+ this.checkboxesId = 'checkboxes-list';
48
61
  /**
49
62
  * Define input name
50
63
  * If not set the value equals the identifier
@@ -103,6 +116,10 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
103
116
  * Select values button text local key
104
117
  */
105
118
  this.selectValuesButtonKey = 'editButton';
119
+ /**
120
+ * Define <mg-tabs> active-tab
121
+ */
122
+ this.activeTab = 1;
106
123
  /**
107
124
  * Handle input event
108
125
  * @param event - input event
@@ -151,6 +168,14 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
151
168
  this.searchValue = event.detail;
152
169
  event.stopPropagation();
153
170
  };
171
+ /**
172
+ * Handle <mg-tabs> tab-change event
173
+ * @param event - tab change event
174
+ */
175
+ this.handleActiveTabChange = (event) => {
176
+ this.activeTab = event.detail;
177
+ this.resetTabsLimit();
178
+ };
154
179
  /**
155
180
  * popover display-change handler
156
181
  * @param event - mg-popover display-change custom event
@@ -164,26 +189,11 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
164
189
  if (!event.detail) {
165
190
  // reset search value
166
191
  this.searchValue = '';
167
- // reset pagintated section current page
168
- Array.from(this.element.shadowRoot.querySelectorAll('mg-input-checkbox-paginated')).forEach(element => {
169
- element.currentPage = 1;
170
- });
192
+ this.resetTabsLimit();
171
193
  this.checkValidity();
172
194
  }
173
- };
174
- /**
175
- * Handle select all button
176
- * @param event - mass action event trigger a global select/unselect on values
177
- */
178
- this.handleMassAction = (event) => {
179
- const displayItems = this.getDisplayItems();
180
- // update only displayed items
181
- displayItems.forEach(item => {
182
- if (item.disabled !== true) {
183
- item.value = event.detail !== SectionKind.SELECTED;
184
- }
185
- });
186
- this.updateValues();
195
+ // init active tab to selected if some values are checked
196
+ this.activeTab = this.checkboxItems.some(items => items.value) ? 2 : 1;
187
197
  };
188
198
  /**
189
199
  * Update values
@@ -281,6 +291,14 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
281
291
  * @returns selected checkboxItems
282
292
  */
283
293
  this.getSelectedItems = () => this.checkboxItems.filter(({ value }) => value);
294
+ /**
295
+ * Reset <mg-input-checkbox-paginated> limit state
296
+ */
297
+ this.resetTabsLimit = () => {
298
+ Array.from(this.element.shadowRoot.querySelectorAll('mg-input-checkbox-paginated')).forEach(component => {
299
+ component.resetLimit();
300
+ });
301
+ };
284
302
  /**
285
303
  * Renders the readonly value of the input.
286
304
  * @returns The rendered readonly value.
@@ -292,7 +310,7 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
292
310
  * Renders the MgInputCheckboxList component.
293
311
  * @returns The rendered MgInputCheckboxList component.
294
312
  */
295
- this.renderMgInputCheckboxList = () => (h(MgInputCheckboxList, { checkboxes: this.checkboxItems, displaySearchInput: this.displaySearchInput, messages: this.messages.input.checkbox, id: "checkboxes-list", disabled: this.disabled, name: this.name, invalid: this.invalid }));
313
+ this.renderMgInputCheckboxList = () => (h(MgInputCheckboxList, { checkboxes: this.checkboxItems, id: this.checkboxesId, disabled: this.disabled, name: this.name, invalid: this.invalid }));
296
314
  }
297
315
  validateValue(newValue) {
298
316
  if (isCheckboxItems(newValue)) {
@@ -516,23 +534,30 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
516
534
  * @param checkboxes - checkboxes to render
517
535
  * @returns render sections of checkboxes
518
536
  */
519
- renderCheckboxBySection(checkboxes) {
537
+ renderCheckboxTabs(checkboxes, checkboxPaginatedProps) {
538
+ const handleMassAction = (kind) => () => {
539
+ const displayItems = this.getDisplayItems();
540
+ // update only displayed items
541
+ displayItems.forEach(item => {
542
+ if (!item.disabled) {
543
+ item.value = kind !== SectionKind.SELECTED;
544
+ }
545
+ });
546
+ this.updateValues();
547
+ };
520
548
  const [checkedValues, notCheckedValues] = checkboxes.reduce((acc, curr) => {
521
549
  acc[curr.value ? 0 : 1].push(curr);
522
550
  return acc;
523
551
  }, [[], []]);
524
- const baseSection = {
525
- readonly: this.readonly,
526
- disabled: this.disabled,
527
- identifier: this.identifier,
528
- };
529
552
  const sections = [
530
- Object.assign(Object.assign({}, baseSection), { checkboxes: checkedValues, messages: this.messages.input.checkbox.sections.selected }),
531
- Object.assign(Object.assign({}, baseSection), { checkboxes: notCheckedValues, messages: this.messages.input.checkbox.sections.notSelected }),
553
+ Object.assign(Object.assign({}, checkboxPaginatedProps), { checkboxes: notCheckedValues, messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.notSelected), { showMore: this.messages.input.showMore }), handleMassAction: handleMassAction(SectionKind.NOT_SELECTED) }),
554
+ Object.assign(Object.assign({}, checkboxPaginatedProps), { checkboxes: checkedValues, messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.selected), { showMore: this.messages.input.showMore }), handleMassAction: handleMassAction(SectionKind.SELECTED) }),
532
555
  ];
533
- return sections
534
- .filter(section => section.checkboxes.length)
535
- .map(section => h("mg-input-checkbox-paginated", Object.assign({}, section, { "onMass-action": this.handleMassAction, key: section.messages })));
556
+ return (h("mg-tabs", { identifier: `${this.identifier}-tabs`, class: "mg-c-input__tabs", label: this.messages.input.checkbox.sections.label, items: sections.map((section, key) => ({
557
+ label: section.messages.title,
558
+ badge: { value: section.checkboxes.length, label: this.messages.input.checkbox.sections.badge.label, role: 'information' },
559
+ status: key + 1 === this.activeTab ? Status.ACTIVE : Status.VISIBLE,
560
+ })), activeTab: this.activeTab, "onActive-tab-change": this.handleActiveTabChange }, sections.map((section, key) => (h("mg-input-checkbox-paginated", Object.assign({ class: "mg-c-input__tab", slot: `tab_content-${key + 1}` }, section, { key: section.messages.title }), section.checkboxes.length > 0 && section.checkboxes.some(checkbox => checkbox.disabled !== true) && (h("mg-tooltip", { slot: "header-action", class: "mg-c-input__tabs-action", message: section.messages.tooltip }, h("mg-button", { variant: "link", onClick: section.handleMassAction }, section.messages.action))))))));
536
561
  }
537
562
  /**
538
563
  * render checkbox multi element
@@ -541,14 +566,18 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
541
566
  renderCheckboxMulti() {
542
567
  const selectedValuesNb = this.getSelectedItems().length;
543
568
  const checkboxes = this.getDisplayItems();
569
+ const checkboxPaginatedProps = {
570
+ readonly: this.readonly,
571
+ disabled: this.disabled,
572
+ identifier: this.identifier,
573
+ };
544
574
  return (h("div", { class: "mg-c-input__input-container" }, h("mg-popover", { arrowHide: true, identifier: this.getMgPopoverIdentifier(), display: this.hasOpenedPopover, "onDisplay-change": this.handleMgPopoverDisplayChange, ref: (el) => {
545
575
  if (el !== null)
546
576
  this.mgPopover = el;
547
577
  } }, h("mg-button", { variant: "secondary", "aria-describedby": `${this.identifier}-title` }, h("mg-icon", { icon: "list" }), this.getSelectValuesButtonMessage()), h("div", { slot: "content", class: "mg-c-input__content" }, this.displaySearchInput ? ([
548
- h("mg-input-text", { key: "input-search", identifier: `${this.identifier}-input-search`, icon: "magnifying-glass", type: "search", placeholder: this.messages.input.checkbox.label, label: this.messages.input.checkbox.label, mgWidth: "full", value: this.searchValue, labelHide: true, characterLeftHide: true, name: "q", "onValue-change": this.handleSearchChange, "aria-controls": "search-results items-list" }),
549
- h("p", { key: "search-results", role: "status", class: "mg-u-visually-hidden", id: "search-results" }, `${checkboxes.length} ${this.messages.input.checkbox[checkboxes.length > 0 ? 'results' : 'result']}`),
550
- h("div", { key: "sections-container", class: "mg-c-input__sections" }, this.renderCheckboxBySection(checkboxes)),
551
- ]) : (h(MgInputCheckboxList, { checkboxes: checkboxes, displaySearchInput: this.displaySearchInput, messages: this.messages.input.checkbox, id: "checkboxes-list", disabled: this.disabled, name: this.name, invalid: this.invalid })), this.displaySearchInput && checkboxes.length === 0 && h("p", { class: "mg-c-input__input-no-result" }, this.messages.input.checkbox.noResult))), this.displaySelectedValues ? (selectedValuesNb > 0 && (h("ul", { role: "list", class: "mg-c-input__input-container-list" }, this.getSelectedItems().map(({ title }) => (h("li", { class: "mg-c-input__input-value", key: title }, title)))))) : (h("b", null, this.messages.input.checkbox[selectedValuesNb > 1 ? 'selectedValues' : 'selectedValue'].replace('{nb}', selectedValuesNb)))));
578
+ h("mg-input-text", { key: "input-search", identifier: `${this.identifier}-input-search`, icon: "magnifying-glass", type: "search", placeholder: this.messages.input.checkbox.sections.search.label, label: this.messages.input.checkbox.sections.search.label, mgWidth: "full", value: this.searchValue, labelHide: true, characterLeftHide: true, name: "q", "onValue-change": this.handleSearchChange }),
579
+ this.searchValue.length > 0 ? (h("mg-input-checkbox-paginated", Object.assign({ class: "mg-c-input__tab" }, checkboxPaginatedProps, { messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.search), { showMore: this.messages.input.showMore }), checkboxes: checkboxes, key: "search" }))) : (this.renderCheckboxTabs(checkboxes, checkboxPaginatedProps)),
580
+ ]) : (h(MgInputCheckboxList, { checkboxes: checkboxes, id: this.checkboxesId, disabled: this.disabled, name: this.name, invalid: this.invalid })))), this.displaySelectedValues ? (selectedValuesNb > 0 && (h("ul", { role: "list", class: "mg-c-input__input-container-list" }, this.getSelectedItems().map(({ title }) => (h("li", { class: "mg-c-input__input-value", key: title }, title)))))) : (h("b", null, this.messages.input.checkbox[selectedValuesNb > 1 ? 'selectedValues' : 'selectedValue'].replace('{nb}', selectedValuesNb)))));
552
581
  }
553
582
  /**
554
583
  * Render
@@ -566,7 +595,7 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
566
595
  else {
567
596
  inputContent = this.renderCheckboxMulti();
568
597
  }
569
- return (h("mg-input", { key: 'a6afc33b5c437000945fca2d825526123a7c4fdf', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue.length === 0 ? 'label' : this.tooltipPosition, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined }, inputContent));
598
+ return (h("mg-input", { key: '84d13ac702497773013daa72357e4d1dcf4ebb30', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, tooltip: this.tooltip, tooltipPosition: this.readonly && readonlyValue.length === 0 ? 'label' : this.tooltipPosition, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined }, inputContent));
570
599
  }
571
600
  get element() { return this; }
572
601
  static get watchers() { return {
@@ -582,7 +611,7 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
582
611
  "searchValue": ["validateSearchValue"]
583
612
  }; }
584
613
  static get style() { return mgInputCheckboxCss; }
585
- }, [1, "mg-input-checkbox", {
614
+ }, [257, "mg-input-checkbox", {
586
615
  "value": [1040],
587
616
  "type": [1025],
588
617
  "identifier": [1],
@@ -610,6 +639,7 @@ const MgInputCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class MgInputCheckbox
610
639
  "searchValue": [32],
611
640
  "searchResults": [32],
612
641
  "selectValuesButtonKey": [32],
642
+ "activeTab": [32],
613
643
  "setFocus": [64],
614
644
  "displayError": [64],
615
645
  "setError": [64],
@@ -630,44 +660,44 @@ function defineCustomElement$1() {
630
660
  if (typeof customElements === "undefined") {
631
661
  return;
632
662
  }
633
- const components = ["mg-input-checkbox", "mg-button", "mg-card", "mg-character-left", "mg-icon", "mg-input", "mg-input-checkbox-paginated", "mg-input-select", "mg-input-text", "mg-input-title", "mg-pagination", "mg-popover", "mg-popover-content", "mg-tooltip", "mg-tooltip-content"];
663
+ const components = ["mg-input-checkbox", "mg-badge", "mg-button", "mg-card", "mg-character-left", "mg-icon", "mg-input", "mg-input-checkbox-paginated", "mg-input-text", "mg-input-title", "mg-popover", "mg-popover-content", "mg-tabs", "mg-tooltip", "mg-tooltip-content"];
634
664
  components.forEach(tagName => { switch (tagName) {
635
665
  case "mg-input-checkbox":
636
666
  if (!customElements.get(tagName)) {
637
667
  customElements.define(tagName, MgInputCheckbox$1);
638
668
  }
639
669
  break;
640
- case "mg-button":
670
+ case "mg-badge":
641
671
  if (!customElements.get(tagName)) {
642
672
  defineCustomElement$f();
643
673
  }
644
674
  break;
645
- case "mg-card":
675
+ case "mg-button":
646
676
  if (!customElements.get(tagName)) {
647
677
  defineCustomElement$e();
648
678
  }
649
679
  break;
650
- case "mg-character-left":
680
+ case "mg-card":
651
681
  if (!customElements.get(tagName)) {
652
682
  defineCustomElement$d();
653
683
  }
654
684
  break;
655
- case "mg-icon":
685
+ case "mg-character-left":
656
686
  if (!customElements.get(tagName)) {
657
687
  defineCustomElement$c();
658
688
  }
659
689
  break;
660
- case "mg-input":
690
+ case "mg-icon":
661
691
  if (!customElements.get(tagName)) {
662
692
  defineCustomElement$b();
663
693
  }
664
694
  break;
665
- case "mg-input-checkbox-paginated":
695
+ case "mg-input":
666
696
  if (!customElements.get(tagName)) {
667
697
  defineCustomElement$a();
668
698
  }
669
699
  break;
670
- case "mg-input-select":
700
+ case "mg-input-checkbox-paginated":
671
701
  if (!customElements.get(tagName)) {
672
702
  defineCustomElement$9();
673
703
  }
@@ -682,17 +712,17 @@ function defineCustomElement$1() {
682
712
  defineCustomElement$7();
683
713
  }
684
714
  break;
685
- case "mg-pagination":
715
+ case "mg-popover":
686
716
  if (!customElements.get(tagName)) {
687
717
  defineCustomElement$6();
688
718
  }
689
719
  break;
690
- case "mg-popover":
720
+ case "mg-popover-content":
691
721
  if (!customElements.get(tagName)) {
692
722
  defineCustomElement$5();
693
723
  }
694
724
  break;
695
- case "mg-popover-content":
725
+ case "mg-tabs":
696
726
  if (!customElements.get(tagName)) {
697
727
  defineCustomElement$4();
698
728
  }