@mgdis/mg-components 6.21.0 → 6.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/cjs/{index-CCsGMNyq.js → index-BxB20_Vw.js} +8 -0
  2. package/dist/cjs/{index-C2viYwrR.js → index-Dz2LAZQT.js} +329 -1789
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/{mg-action-more_37.cjs.entry.js → mg-action-more_36.cjs.entry.js} +200 -242
  5. package/dist/cjs/mg-alert.cjs.entry.js +3 -3
  6. package/dist/cjs/mg-breadcrumb.cjs.entry.js +63 -0
  7. package/dist/cjs/mg-components.cjs.js +3 -3
  8. package/dist/cjs/mg-fieldset.cjs.entry.js +2 -2
  9. package/dist/cjs/mg-input-combobox.cjs.entry.js +4 -4
  10. package/dist/cjs/mg-input-file.cjs.entry.js +4 -4
  11. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +40095 -15808
  12. package/dist/cjs/mg-loader.cjs.entry.js +3 -3
  13. package/dist/cjs/mg-progress.cjs.entry.js +2 -2
  14. package/dist/collection/assets/icons/index.js +1 -1
  15. package/dist/collection/collection-manifest.json +4 -3
  16. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
  17. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
  18. package/dist/collection/components/atoms/mg-badge/mg-badge.js +2 -1
  19. package/dist/collection/components/atoms/mg-button/mg-button.js +6 -3
  20. package/dist/collection/components/atoms/mg-card/mg-card.js +3 -2
  21. package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
  22. package/dist/collection/components/atoms/mg-icon/mg-icon.js +10 -6
  23. package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -2
  24. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
  25. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +3 -2
  26. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +5 -3
  27. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +2 -2
  28. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.js +38 -0
  29. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +3 -2
  30. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +47 -26
  31. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +13 -7
  32. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +3 -2
  33. package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +4 -3
  34. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +9 -5
  35. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +6 -4
  36. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +5 -3
  37. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +212 -0
  38. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.js +1 -0
  39. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +300 -94
  40. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.js +29 -0
  41. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +164 -51
  42. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +22 -8
  43. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +12 -7
  44. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +5 -3
  45. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +7 -4
  46. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +7 -38
  47. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.conf.js +0 -4
  48. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +24 -44
  49. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +69 -40
  50. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +11 -7
  51. package/dist/collection/components/molecules/mg-alert/mg-alert.js +5 -3
  52. package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.js +1 -0
  53. package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +93 -0
  54. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  55. package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +3 -2
  56. package/dist/collection/components/molecules/mg-form/mg-form.js +5 -3
  57. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +5 -3
  58. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  59. package/dist/collection/components/molecules/mg-message/mg-message.js +6 -4
  60. package/dist/collection/components/molecules/mg-modal/mg-modal.js +4 -3
  61. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +2 -1
  62. package/dist/collection/components/molecules/mg-panel/mg-panel.js +5 -3
  63. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  64. package/dist/collection/components/molecules/mg-popover/mg-popover.js +3 -2
  65. package/dist/collection/components/molecules/mg-progress/mg-progress.js +3 -2
  66. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +3 -2
  67. package/dist/collection/components/molecules/mg-table/mg-table.js +41 -2
  68. package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +0 -4
  69. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +15 -34
  70. package/dist/collection/locales/en/messages.json +3 -0
  71. package/dist/collection/locales/fr/messages.json +3 -0
  72. package/dist/components/index2.js +1 -1
  73. package/dist/components/index3.js +1 -1
  74. package/dist/components/mg-action-more.js +1 -1
  75. package/dist/components/mg-alert.js +1 -1
  76. package/dist/components/mg-breadcrumb.d.ts +11 -0
  77. package/dist/components/mg-breadcrumb.js +1 -0
  78. package/dist/components/mg-card2.js +1 -1
  79. package/dist/components/mg-character-left2.js +1 -1
  80. package/dist/components/mg-details.js +1 -1
  81. package/dist/components/mg-divider2.js +1 -1
  82. package/dist/components/mg-fieldset.js +1 -1
  83. package/dist/components/mg-form.js +1 -1
  84. package/dist/components/mg-icon2.js +1 -1
  85. package/dist/components/mg-illustrated-message.js +1 -1
  86. package/dist/components/mg-input-checkbox.js +1 -1
  87. package/dist/components/mg-input-combobox.js +1 -1
  88. package/dist/components/mg-input-date.js +1 -1
  89. package/dist/components/mg-input-file.js +1 -1
  90. package/dist/components/mg-input-numeric.js +1 -1
  91. package/dist/components/mg-input-password.js +1 -1
  92. package/dist/components/mg-input-radio.js +1 -1
  93. package/dist/components/mg-input-rich-text-editor.js +1663 -1
  94. package/dist/components/mg-input-select2.js +1 -1
  95. package/dist/components/mg-input-text2.js +1 -1
  96. package/dist/components/mg-input-textarea.js +1 -1
  97. package/dist/components/mg-input-title2.js +1 -1
  98. package/dist/components/mg-input-toggle.js +1 -1
  99. package/dist/components/mg-input2.js +1 -1
  100. package/dist/components/mg-item-more2.js +1 -1
  101. package/dist/components/mg-loader2.js +1 -1
  102. package/dist/components/mg-menu-item2.js +1 -1
  103. package/dist/components/mg-message2.js +1 -1
  104. package/dist/components/mg-modal.js +1 -1
  105. package/dist/components/mg-panel.js +1 -1
  106. package/dist/components/mg-popover-content2.js +1 -1
  107. package/dist/components/mg-popover2.js +1 -1
  108. package/dist/components/mg-progress.js +1 -1
  109. package/dist/components/mg-skip-links.js +1 -1
  110. package/dist/components/mg-table.js +1 -1
  111. package/dist/components/mg-tabs2.js +1 -1
  112. package/dist/components/mg-tag.js +1 -1
  113. package/dist/components/mg-tooltip-content2.js +1 -1
  114. package/dist/components/mg-tooltip2.js +1 -1
  115. package/dist/esm/{index-DFwaH2hS.js → index-C3jUhxdI.js} +329 -1789
  116. package/dist/esm/{index-D-uaxCxH.js → index-DSEloqPn.js} +8 -0
  117. package/dist/esm/loader.js +3 -3
  118. package/dist/esm/{mg-action-more_37.entry.js → mg-action-more_36.entry.js} +202 -243
  119. package/dist/esm/mg-alert.entry.js +3 -3
  120. package/dist/esm/mg-breadcrumb.entry.js +61 -0
  121. package/dist/esm/mg-components.js +4 -4
  122. package/dist/esm/mg-fieldset.entry.js +2 -2
  123. package/dist/esm/mg-input-combobox.entry.js +4 -4
  124. package/dist/esm/mg-input-file.entry.js +4 -4
  125. package/dist/esm/mg-input-rich-text-editor.entry.js +40082 -15795
  126. package/dist/esm/mg-loader.entry.js +3 -3
  127. package/dist/esm/mg-progress.entry.js +2 -2
  128. package/dist/mg-components/locales/en/messages.json +3 -0
  129. package/dist/mg-components/locales/fr/messages.json +3 -0
  130. package/dist/mg-components/mg-components.esm.js +1 -1
  131. package/dist/mg-components/{p-6b57f249.entry.js → p-06fbdb2f.entry.js} +1 -1
  132. package/dist/mg-components/{p-c3d116b9.entry.js → p-188b9ca9.entry.js} +1 -1
  133. package/dist/mg-components/p-4667078d.entry.js +1 -0
  134. package/dist/mg-components/p-5a859ecf.entry.js +1658 -0
  135. package/dist/mg-components/p-661da56b.entry.js +1 -0
  136. package/dist/mg-components/{p-988c282e.entry.js → p-8e256086.entry.js} +1 -1
  137. package/dist/mg-components/p-C3jUhxdI.js +2 -0
  138. package/dist/mg-components/p-DSEloqPn.js +1 -0
  139. package/dist/mg-components/{p-6b655830.entry.js → p-b0b8c58f.entry.js} +1 -1
  140. package/dist/mg-components/{p-dd1934f4.entry.js → p-bbcef41c.entry.js} +1 -1
  141. package/dist/mg-components/{p-4175dcbe.entry.js → p-c1aeb277.entry.js} +1 -1
  142. package/dist/types/assets/icons/index.d.ts +2 -0
  143. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +1 -1
  144. package/dist/types/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.d.ts +2 -2
  145. package/dist/types/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.d.ts +8 -0
  146. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +16 -8
  147. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +15 -5
  148. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +17 -0
  149. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/index.d.ts +27 -19
  150. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +3 -0
  151. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +48 -14
  152. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -1
  153. package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.conf.d.ts +0 -5
  154. package/dist/types/components/molecules/internals/mg-item-more/mg-item-more.d.ts +1 -6
  155. package/dist/types/components/molecules/menus/mg-menu/mg-menu.conf.d.ts +2 -10
  156. package/dist/types/components/molecules/menus/mg-menu/mg-menu.d.ts +7 -7
  157. package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +12 -8
  158. package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.conf.d.ts +18 -0
  159. package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +34 -0
  160. package/dist/types/components/molecules/mg-table/mg-table.d.ts +6 -0
  161. package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +1 -9
  162. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +4 -4
  163. package/dist/types/components.d.ts +617 -207
  164. package/dist/types/stencil-public-runtime.d.ts +52 -2
  165. package/ide/intellij/web-types.json +143 -55
  166. package/ide/vscode/css-custom-data.json +10 -2
  167. package/ide/vscode/html-custom-data.json +113 -34
  168. package/package.json +24 -23
  169. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +0 -245
  170. package/dist/components/mg-input-checkbox-paginated.d.ts +0 -11
  171. package/dist/components/mg-input-checkbox-paginated.js +0 -1
  172. package/dist/components/mg-input-checkbox-paginated2.js +0 -1
  173. package/dist/mg-components/p-08fa327b.entry.js +0 -1
  174. package/dist/mg-components/p-D-uaxCxH.js +0 -1
  175. package/dist/mg-components/p-DFwaH2hS.js +0 -2
  176. package/dist/mg-components/p-a79b1f19.entry.js +0 -1
  177. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +0 -77
@@ -3,7 +3,6 @@
3
3
  "components/atoms/mg-badge/mg-badge.js",
4
4
  "components/atoms/mg-button/mg-button.js",
5
5
  "components/atoms/mg-icon/mg-icon.js",
6
- "components/molecules/menus/mg-menu/mg-menu.js",
7
6
  "components/molecules/internals/mg-item-more/mg-item-more.js",
8
7
  "components/molecules/menus/mg-menu-item/mg-menu-item.js",
9
8
  "components/atoms/internals/mg-character-left/mg-character-left.js",
@@ -14,7 +13,6 @@
14
13
  "components/atoms/mg-tooltip/mg-tooltip.js",
15
14
  "components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js",
16
15
  "components/molecules/inputs/mg-input/mg-input.js",
17
- "components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js",
18
16
  "components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js",
19
17
  "components/molecules/inputs/mg-input-combobox/mg-input-combobox.js",
20
18
  "components/molecules/inputs/mg-input-date/mg-input-date.js",
@@ -27,8 +25,10 @@
27
25
  "components/molecules/inputs/mg-input-text/mg-input-text.js",
28
26
  "components/molecules/inputs/mg-input-textarea/mg-input-textarea.js",
29
27
  "components/molecules/inputs/mg-input-toggle/mg-input-toggle.js",
28
+ "components/molecules/menus/mg-menu/mg-menu.js",
30
29
  "components/molecules/mg-action-more/mg-action-more.js",
31
30
  "components/molecules/mg-alert/mg-alert.js",
31
+ "components/molecules/mg-breadcrumb/mg-breadcrumb.js",
32
32
  "components/molecules/mg-details/mg-details.js",
33
33
  "components/molecules/mg-fieldset/mg-fieldset.js",
34
34
  "components/molecules/mg-form/mg-form.js",
@@ -45,9 +45,10 @@
45
45
  "components/molecules/mg-table/mg-table.js",
46
46
  "components/molecules/mg-tabs/mg-tabs.js"
47
47
  ],
48
+ "mixins": [],
48
49
  "compiler": {
49
50
  "name": "@stencil/core",
50
- "version": "4.40.1",
51
+ "version": "4.43.4",
51
52
  "typescriptVersion": "5.8.3"
52
53
  },
53
54
  "collections": [],
@@ -37,7 +37,7 @@ export class MgCharacterLeft {
37
37
  * @returns HTML Element
38
38
  */
39
39
  render() {
40
- return (h("span", { key: '22f23b636aaebc8857e4efa2fdb87a85977c59bf', id: this.identifier, "aria-live": "polite" }, h("span", { key: '55addb97bc00800b1ec644b0eff68e779a03528a', "aria-hidden": "true" }, this.maxlength - this.characters.length, "/", this.maxlength), h("span", { key: 'd5bd60b48b6a02cdaff4166f14e4ea6cf921f749', class: "mg-u-visually-hidden" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
40
+ return (h("span", { key: '41b489eafc25e9fe2e32b54a72542090d79e1052', id: this.identifier, "aria-live": "polite" }, h("span", { key: 'c9dd3eb15ebc866333d4e911e1a560cac1c07ef7', "aria-hidden": "true" }, this.maxlength - this.characters.length, "/", this.maxlength), h("span", { key: '0e4664f577b8db68f0355fc92f9df251f945dedd', class: "mg-u-visually-hidden" }, this.messages.nbCharLeft.replace('{counter}', this.maxlength - this.characters.length))));
41
41
  }
42
42
  static get is() { return "mg-character-left"; }
43
43
  static get encapsulation() { return "scoped"; }
@@ -42,7 +42,7 @@ export class MgInputTitle {
42
42
  render() {
43
43
  const TagName = this.readonly ? 'span' : this.tagName;
44
44
  // \u00A0 represent a  
45
- return (h(TagName, { key: '860f74509c87626d4af51641f0f48db99fa194b0', class: "mg-c-input-title", htmlFor: !this.isLegend && this.identifier, id: this.isLegend ? `${this.identifier}-title` : undefined }, h("slot", { key: '5eb0ca4d7f4061c0cff01e2de3adb9c98c42955a' }), this.required && !this.readonly && (h("span", { key: '0637de0d0dca9b7f87c9bb04fd44eadc6d0606cc', class: "mg-c-input-title__required" }, "\u00A0", h("span", { key: 'b5736467e3fd759eeabe9cf8ee6ed3cf73b8ebfc', class: "mg-u-is-asterisk" }, "*")))));
45
+ return (h(TagName, { key: 'd61ed048e1b2bb124281eb4067894d9a35abf778', class: "mg-c-input-title", htmlFor: !this.isLegend && this.identifier, id: this.isLegend ? `${this.identifier}-title` : undefined }, h("slot", { key: '3bad02b10f8e9bb536c5eba9bf85d4b4967a9d97' }), this.required && !this.readonly && (h("span", { key: 'f0fd90a79f4449a1a3b7ec76a3eeb96bcc2e4ee6', class: "mg-c-input-title__required" }, "\u00A0", h("span", { key: '7ea29cfc494c5c5c2b65b62ea27caee5a41062ca', class: "mg-u-is-asterisk" }, "*")))));
46
46
  }
47
47
  static get is() { return "mg-input-title"; }
48
48
  static get encapsulation() { return "scoped"; }
@@ -126,7 +126,8 @@ export class MgBadge {
126
126
  "BadgeVariantType": {
127
127
  "location": "import",
128
128
  "path": "./mg-badge.conf",
129
- "id": "src/components/atoms/mg-badge/mg-badge.conf.ts::BadgeVariantType"
129
+ "id": "src/components/atoms/mg-badge/mg-badge.conf.ts::BadgeVariantType",
130
+ "referenceLocation": "BadgeVariantType"
130
131
  }
131
132
  }
132
133
  },
@@ -231,7 +231,8 @@ export class MgButton {
231
231
  "VariantType": {
232
232
  "location": "import",
233
233
  "path": "./mg-button.conf",
234
- "id": "src/components/atoms/mg-button/mg-button.conf.ts::VariantType"
234
+ "id": "src/components/atoms/mg-button/mg-button.conf.ts::VariantType",
235
+ "referenceLocation": "VariantType"
235
236
  }
236
237
  }
237
238
  },
@@ -276,7 +277,8 @@ export class MgButton {
276
277
  "ButtonType": {
277
278
  "location": "import",
278
279
  "path": "./mg-button.conf",
279
- "id": "src/components/atoms/mg-button/mg-button.conf.ts::ButtonType"
280
+ "id": "src/components/atoms/mg-button/mg-button.conf.ts::ButtonType",
281
+ "referenceLocation": "ButtonType"
280
282
  }
281
283
  }
282
284
  },
@@ -301,7 +303,8 @@ export class MgButton {
301
303
  "SizeType": {
302
304
  "location": "import",
303
305
  "path": "./mg-button.conf",
304
- "id": "src/components/atoms/mg-button/mg-button.conf.ts::SizeType"
306
+ "id": "src/components/atoms/mg-button/mg-button.conf.ts::SizeType",
307
+ "referenceLocation": "SizeType"
305
308
  }
306
309
  }
307
310
  },
@@ -50,7 +50,7 @@ export class MgCard {
50
50
  * @returns HTML Element
51
51
  */
52
52
  render() {
53
- return (h("div", { key: '6f83c5f7f9e0aacf502e407450cfdf039635a1f1', class: this.classCollection.join() }, h("slot", { key: '6bf8c02d3c3c9d0719e45af96b41f54289e31961' })));
53
+ return (h("div", { key: 'fe5eff1e1d7c533cd533e27d3fb070a4e57194a8', class: this.classCollection.join() }, h("slot", { key: 'ca27dc4039d7bcaa21284714b7820de257625009' })));
54
54
  }
55
55
  static get is() { return "mg-card"; }
56
56
  static get encapsulation() { return "shadow"; }
@@ -96,7 +96,8 @@ export class MgCard {
96
96
  "RadiusSizeType": {
97
97
  "location": "import",
98
98
  "path": "./mg-card.conf",
99
- "id": "src/components/atoms/mg-card/mg-card.conf.ts::RadiusSizeType"
99
+ "id": "src/components/atoms/mg-card/mg-card.conf.ts::RadiusSizeType",
100
+ "referenceLocation": "RadiusSizeType"
100
101
  }
101
102
  }
102
103
  },
@@ -14,7 +14,7 @@ export class MgDivider {
14
14
  * @returns HTML Element
15
15
  */
16
16
  render() {
17
- return (h("div", { key: '60b987cb329c6db14c2cc4a665e7f32b2696a3ee', class: {
17
+ return (h("div", { key: 'a1b0e3b95ed9f52febab9f8d50b4053d1c13f7fb', class: {
18
18
  'mg-c-divider': true,
19
19
  'mg-c-divider--full-width': this.fullWidth,
20
20
  } }));
@@ -28,7 +28,7 @@ export class MgIcon {
28
28
  svgContainer.innerHTML = icons[icon];
29
29
  this.element.shadowRoot.append(svgContainer.firstChild);
30
30
  svgContainer.remove();
31
- // update svg attributes
31
+ // Update svg attributes
32
32
  this.svg = this.element.shadowRoot.querySelector('svg');
33
33
  this.svg.setAttribute('aria-hidden', 'true');
34
34
  this.svg.setAttribute('focusable', 'false');
@@ -144,12 +144,13 @@ export class MgIcon {
144
144
  "mutable": false,
145
145
  "complexType": {
146
146
  "original": "IconType",
147
- "resolved": "\"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"table\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"",
147
+ "resolved": "\"address-card\" | \"address-card-outline\" | \"align-center\" | \"align-justify\" | \"align-left\" | \"align-right\" | \"api\" | \"archive\" | \"archive-outline\" | \"arrow-clock\" | \"arrow-down\" | \"arrow-down-a-z\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-rotate\" | \"arrow-rotate-backward\" | \"arrow-up\" | \"arrow-up-right\" | \"arrow-up-right-square\" | \"arrow-up-z-a\" | \"arrows-compare\" | \"arrows-right-down\" | \"arrows-right-left\" | \"arrows-rotate\" | \"arrows-rotate-backward\" | \"arrows-up-down\" | \"ban\" | \"bell\" | \"bell-outline\" | \"book\" | \"book-outline\" | \"briefcase\" | \"briefcase-outline\" | \"building\" | \"building-outline\" | \"calculator\" | \"calculator-outline\" | \"calendar\" | \"calendar-euro\" | \"calendar-euro-outline\" | \"calendar-outline\" | \"check\" | \"check-circle\" | \"check-circle-outline\" | \"chevron-down\" | \"chevron-down-circle\" | \"chevron-left\" | \"chevron-left-circle\" | \"chevron-right\" | \"chevron-right-circle\" | \"chevron-up\" | \"chevron-up-circle\" | \"circle\" | \"clock\" | \"clock-outline\" | \"code-square-outline\" | \"cog\" | \"cog-outline\" | \"comment\" | \"comment-exclamation\" | \"comment-exclamation-outline\" | \"comment-outline\" | \"comment-question\" | \"comment-question-outline\" | \"comment-sms\" | \"comment-sms-outline\" | \"conversation\" | \"conversation-outline\" | \"copy\" | \"copy-file\" | \"copy-file-outline\" | \"copy-outline\" | \"credit-card\" | \"cross\" | \"cross-circle\" | \"cross-circle-outline\" | \"dashboard\" | \"dashboard-outline\" | \"download\" | \"earth\" | \"earth-outline\" | \"ellipsis\" | \"ellipsis-vertical\" | \"euro\" | \"euro-circle\" | \"exclamation-circle\" | \"exclamation-circle-outline\" | \"exclamation-stamp\" | \"exclamation-triangle\" | \"exclamation-triangle-outline\" | \"eye\" | \"eye-outline\" | \"eye-slash\" | \"eye-slash-outline\" | \"fax\" | \"fax-outline\" | \"file\" | \"file-cog\" | \"file-cog-outline\" | \"file-download\" | \"file-download-outline\" | \"file-excel\" | \"file-excel-outline\" | \"file-outline\" | \"file-pdf\" | \"file-pdf-outline\" | \"file-text\" | \"file-text-outline\" | \"file-upload\" | \"file-upload-outline\" | \"file-word\" | \"file-word-outline\" | \"filter\" | \"filter-outline\" | \"floppy-disk\" | \"floppy-disk-checked\" | \"floppy-disk-checked-outline\" | \"floppy-disk-outline\" | \"folder\" | \"folder-check\" | \"folder-check-outline\" | \"folder-lines\" | \"folder-lines-outline\" | \"folder-link\" | \"folder-link-outline\" | \"folder-outline\" | \"folder-star\" | \"folder-star-outline\" | \"folders\" | \"folders-outline\" | \"gavel\" | \"gavel-outline\" | \"graduation-cap\" | \"graduation-cap-outline\" | \"hand-euro\" | \"hand-euro-outline\" | \"hand-up\" | \"history\" | \"home\" | \"home-outline\" | \"info-circle\" | \"info-circle-outline\" | \"interrogation-circle\" | \"interrogation-circle-outline\" | \"key\" | \"laptop\" | \"layers\" | \"life-ring\" | \"lines-rectangle\" | \"lines-rectangle-outline\" | \"link\" | \"list\" | \"loader\" | \"location\" | \"location-outline\" | \"lock\" | \"lock-outline\" | \"log-in\" | \"log-out\" | \"magnifying-glass\" | \"mail\" | \"mail-open\" | \"mail-open-outline\" | \"mail-outline\" | \"messages-square\" | \"messages-square-outline\" | \"mobile\" | \"mobile-outline\" | \"notes\" | \"notes-outline\" | \"paper-plane\" | \"paper-plane-outline\" | \"paper-plane-slash\" | \"paper-plane-slash-outline\" | \"paperclip\" | \"pause\" | \"pause-outline\" | \"pen\" | \"pen-circle\" | \"pen-fancy\" | \"pen-fancy-files-outline\" | \"pen-fancy-outline\" | \"pen-outline\" | \"phone\" | \"phone-outline\" | \"picture\" | \"picture-outline\" | \"play-circle\" | \"plus\" | \"plus-circle\" | \"plus-circle-outline\" | \"share\" | \"share-outline\" | \"shuffle\" | \"sidebar-arrow-left\" | \"sidebar-arrow-right\" | \"sitemap\" | \"sliders\" | \"sliders-outline\" | \"squares\" | \"star\" | \"star-outline\" | \"table\" | \"tag\" | \"tag-outline\" | \"tags\" | \"tags-outline\" | \"thumb-down\" | \"thumb-down-outline\" | \"thumb-up\" | \"thumb-up-outline\" | \"thumbtack\" | \"thumbtack-outline\" | \"trash\" | \"trash-outline\" | \"universal-access\" | \"universal-access-outline\" | \"unlink\" | \"unlock\" | \"unlock-outline\" | \"upload\" | \"user\" | \"user-circle\" | \"user-group\" | \"user-group-outline\" | \"user-lock\" | \"user-outline\" | \"user-pen-fancy-outline\" | \"user-plus\" | \"user-question-outline\" | \"user-shield\" | \"user-shield-outline\" | \"users\" | \"users-outline\" | \"wallet\" | \"wallet-outline\"",
148
148
  "references": {
149
149
  "IconType": {
150
150
  "location": "import",
151
151
  "path": "./mg-icon.conf",
152
- "id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconType"
152
+ "id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconType",
153
+ "referenceLocation": "IconType"
153
154
  }
154
155
  }
155
156
  },
@@ -174,7 +175,8 @@ export class MgIcon {
174
175
  "IconSizeType": {
175
176
  "location": "import",
176
177
  "path": "./mg-icon.conf",
177
- "id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconSizeType"
178
+ "id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconSizeType",
179
+ "referenceLocation": "IconSizeType"
178
180
  }
179
181
  }
180
182
  },
@@ -200,7 +202,8 @@ export class MgIcon {
200
202
  "IconVariantType": {
201
203
  "location": "import",
202
204
  "path": "./mg-icon.conf",
203
- "id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconVariantType"
205
+ "id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconVariantType",
206
+ "referenceLocation": "IconVariantType"
204
207
  }
205
208
  }
206
209
  },
@@ -225,7 +228,8 @@ export class MgIcon {
225
228
  "IconVariantStyleType": {
226
229
  "location": "import",
227
230
  "path": "./mg-icon.conf",
228
- "id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconVariantStyleType"
231
+ "id": "src/components/atoms/mg-icon/mg-icon.conf.ts::IconVariantStyleType",
232
+ "referenceLocation": "IconVariantStyleType"
229
233
  }
230
234
  }
231
235
  },
@@ -84,7 +84,7 @@ export class MgTag {
84
84
  * @returns HTML Element
85
85
  */
86
86
  render() {
87
- return (h("span", { key: '8edd72c80d7179fdb5c1c37caeaecb54c086df8c', class: this.classCollection.join() }, h("slot", { key: 'e6bf4574a943f83856a6a61cba480d54ff153cb3' })));
87
+ return (h("span", { key: '3604851191691e002f8f7a701e37abe0059238e3', class: this.classCollection.join() }, h("slot", { key: 'c51e18e61908772878f380d1ae798e5e5f43ca02' })));
88
88
  }
89
89
  static get is() { return "mg-tag"; }
90
90
  static get encapsulation() { return "shadow"; }
@@ -110,7 +110,8 @@ export class MgTag {
110
110
  "TagVariantType": {
111
111
  "location": "import",
112
112
  "path": "./mg-tag.conf",
113
- "id": "src/components/atoms/mg-tag/mg-tag.conf.ts::TagVariantType"
113
+ "id": "src/components/atoms/mg-tag/mg-tag.conf.ts::TagVariantType",
114
+ "referenceLocation": "TagVariantType"
114
115
  }
115
116
  }
116
117
  },
@@ -11,7 +11,7 @@ export class MgTooltipContent {
11
11
  * @returns HTML Element
12
12
  */
13
13
  render() {
14
- return (h(Host, { key: '2221de3ca0ef7c9d6e46e24b19c69007fababf81', role: "tooltip" }, h("span", { key: '9e14f7f5b3f5e5060ed9f42e8d7259b17575168e', innerHTML: this.message, class: "mg-tooltip-content__message" }), h("slot", { key: 'bc083567d77e8f4ffccee98b96036ba8ac494fb6', name: "arrow" })));
14
+ return (h(Host, { key: 'efe7a2b2622713929caf9a2e114e7a1267643f5e', role: "tooltip" }, h("span", { key: '00f0066cfa058e55a88533f8b6daaa8ab283b29c', innerHTML: this.message, class: "mg-tooltip-content__message" }), h("slot", { key: 'fd952c4db7b77b54591bf2c58012096579de45c2', name: "arrow" })));
15
15
  }
16
16
  static get is() { return "mg-tooltip-content"; }
17
17
  static get encapsulation() { return "shadow"; }
@@ -364,7 +364,7 @@ export class MgTooltip {
364
364
  * @returns HTML Element
365
365
  */
366
366
  render() {
367
- return (h(Host, { key: '1f5ee653d58185c2ab15b213ad323adaabca605f' }, h("slot", { key: 'd0c615db4429e84a295d01269c268f9239da85c5' }), h("slot", { key: 'e6c6deb2f94ab883da2a62fa53cb299f5ec83a06', name: "content" })));
367
+ return (h(Host, { key: '8d1a0690f0b44381de181c2ea1f9e4c883a1af57' }, h("slot", { key: 'ae45df312e6a251a72b8ace11eb154c5ad13b4ae' }), h("slot", { key: 'fdbb17e42291cd785ff188df14029bcd59ba4c13', name: "content" })));
368
368
  }
369
369
  static get is() { return "mg-tooltip"; }
370
370
  static get encapsulation() { return "shadow"; }
@@ -429,7 +429,8 @@ export class MgTooltip {
429
429
  "Placement": {
430
430
  "location": "import",
431
431
  "path": "@popperjs/core",
432
- "id": "../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/index.d.ts::Placement"
432
+ "id": "../../node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/index.d.ts::Placement",
433
+ "referenceLocation": "Placement"
433
434
  }
434
435
  }
435
436
  },
@@ -339,7 +339,7 @@ export class MgInput {
339
339
  */
340
340
  render() {
341
341
  const isGroup = this.isFieldset && !this.isReadonly;
342
- return (h(Host, { key: 'fbab18280a709407c83f324127e8de6cbb05fe7c', class: this.element.classList.toString(), role: isGroup ? 'group' : undefined, "aria-labelledby": isGroup ? `${this.identifier}-title` : undefined }, h("div", { key: 'ac0924c244b9fa87d02e659a5710ee93d12a202f', class: { 'mg-c-input__title': true, 'mg-u-visually-hidden': this.labelHide } }, h("slot", { key: 'c825af33ba0a6c209d02d6487422347f7d8acfed', name: this.slotLabel }), this.tooltip && (this.tooltipPosition === 'label' || this.labelOnTop) && !this.labelHide && this.renderTooltip()), h("div", { key: '805e1eedfdea132f3ea4fd11da761810a3d7c939', class: "mg-c-input__input-container" }, this.inputContainerElements())));
342
+ return (h(Host, { key: 'a1db280d19eead30e7ae27eb6e395e58b35baa63', class: this.element.classList.toString(), role: isGroup ? 'group' : undefined, "aria-labelledby": isGroup ? `${this.identifier}-title` : undefined }, h("div", { key: '282f5776a9269272507f3e00f5dce690c9a604f4', class: { 'mg-c-input__title': true, 'mg-u-visually-hidden': this.labelHide } }, h("slot", { key: 'b122979a159912d9c34bb024021257f9f88e6ff4', name: this.slotLabel }), this.tooltip && (this.tooltipPosition === 'label' || this.labelOnTop) && !this.labelHide && this.renderTooltip()), h("div", { key: '098d3a7329fa0b5f37534fdf2df89e0468dcbe2a', class: "mg-c-input__input-container" }, this.inputContainerElements())));
343
343
  }
344
344
  static get is() { return "mg-input"; }
345
345
  static get encapsulation() { return "shadow"; }
@@ -443,7 +443,8 @@ export class MgInput {
443
443
  "labelHeading": {
444
444
  "location": "import",
445
445
  "path": "./mg-input.conf",
446
- "id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::labelHeading"
446
+ "id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::labelHeading",
447
+ "referenceLocation": "labelHeading"
447
448
  }
448
449
  }
449
450
  },
@@ -507,7 +508,8 @@ export class MgInput {
507
508
  "TooltipPosition": {
508
509
  "location": "import",
509
510
  "path": "./mg-input.conf",
510
- "id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::TooltipPosition"
511
+ "id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::TooltipPosition",
512
+ "referenceLocation": "TooltipPosition"
511
513
  }
512
514
  }
513
515
  },
@@ -4,7 +4,7 @@ import { h } from "@stencil/core";
4
4
  * @param props - MgInputCheckboxList Interface Props
5
5
  * @returns input template
6
6
  */
7
- export 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 => {
7
+ export const MgInputCheckboxList = (props) => (h("div", { class: "mg-c-input__input-group-container", "aria-labelledby": props.labelledby, id: props.id }, props.checkboxes.map(input => {
8
8
  var _a, _b;
9
- return (h("li", { key: input._id, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': props.disabled || input.disabled } }, 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 }), h("label", { htmlFor: input._id }, input.title)));
9
+ return (h("div", { key: input._id, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': props.disabled || input.disabled } }, 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 }), h("label", { htmlFor: input._id }, input.title)));
10
10
  })));
@@ -0,0 +1,38 @@
1
+ import { h } from "@stencil/core";
2
+ import { MgInputCheckboxList } from "./MgInputCheckboxList";
3
+ import { formatID } from "@mgdis/core-ui-helpers/dist/utils";
4
+ /**
5
+ * Get items from checkboxes and limit
6
+ * @param checkboxes - checkboxes to slice
7
+ * @param limit - number of items to return
8
+ * @returns list of items to display in section
9
+ */
10
+ const getItems = (checkboxes, limit) => [...checkboxes].slice(0, limit);
11
+ /**
12
+ * Component has next checkboxes to display
13
+ * @param checkboxes - checkboxes to check
14
+ * @param limit - number of items to display
15
+ * @returns truthy if have next elements
16
+ */
17
+ const hasNext = (checkboxes, limit) => checkboxes.length > limit;
18
+ /**
19
+ * Internal component use to manage sections instances
20
+ * @param props - MgInputCheckboxList Interface Props
21
+ * @returns input template
22
+ */
23
+ export const MgInputCheckboxPaginated = (props) => {
24
+ const items = getItems(props.checkboxes, props.limit);
25
+ const listId = formatID(props.messages.label);
26
+ const tabId = `tab-info-${props.key}`;
27
+ /**
28
+ * Handle load-more <mg-button> click event
29
+ */
30
+ const handleLoadMoreClick = () => {
31
+ if (hasNext(props.checkboxes, props.limit)) {
32
+ props.handleLoadMore();
33
+ }
34
+ };
35
+ return (h("div", { class: "mg-input-checkbox-paginated mg-c-input__tab", slot: `tab_content-${props.key + 1}` },
36
+ // Mass action depends on all checkboxes list, not only displayed items
37
+ typeof props.handleMassAction === 'function' && props.checkboxes.length > 0 && props.checkboxes.some(checkbox => checkbox.disabled !== true) && (h("mg-tooltip", { slot: "header-action", class: "mg-c-input__tabs-action", message: props.messages.tooltip }, h("mg-button", { variant: "link", onClick: props.handleMassAction }, props.messages.action))), h("div", { class: "mg-c-input__tabs-content" }, h("p", { id: tabId, class: { 'mg-c-input__popover-info': true, 'mg-u-visually-hidden': items.length !== 0 }, "aria-live": items.length !== 0 ? 'polite' : undefined }, items.length === 0 ? props.messages.noValue : props.messages.values.replace('{count}', items.length.toString())), items.length > 0 && (h(MgInputCheckboxList, { checkboxes: items, labelledby: tabId, id: listId, disabled: props.disabled, name: props.name, invalid: props.invalid })), hasNext(props.checkboxes, props.limit) && (h("mg-button", { key: "load-more", variant: "flat", class: "mg-c-input__load-more", tabIndex: -1, "full-width": true, onClick: handleLoadMoreClick, "aria-controls": listId }, h("mg-icon", { icon: "chevron-down" }), props.messages.showMore)))));
38
+ };
@@ -6,6 +6,7 @@ export const checkboxTypes = ['checkbox', 'multi'];
6
6
  * mg-input-checkbox-paginated section kind value
7
7
  */
8
8
  export const SectionKind = {
9
- SELECTED: 'selected',
10
- NOT_SELECTED: 'not-selected',
9
+ NOT_SELECTED: 0,
10
+ SELECTED: 1,
11
+ SEARCH: 2,
11
12
  };
@@ -1,12 +1,13 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, cleanString, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
- import { checkboxTypes, SectionKind } from "./mg-input-checkbox.conf";
3
+ import { checkboxTypes, SectionKind, } from "./mg-input-checkbox.conf";
4
4
  import { MgInputCheckboxList } from "./MgInputCheckboxList";
5
5
  import { classDisabled, classReadonly, classFieldset, classVerticalList } from "../mg-input/mg-input.conf";
6
6
  import { initLocales } from "../../../../locales";
7
7
  import { Status } from "../../mg-tabs/mg-tabs.conf";
8
+ import { MgInputCheckboxPaginated } from "./MgInputCheckboxPaginated";
8
9
  /**
9
- * type CheckboxItem validation function
10
+ * type ICheckboxItem validation function
10
11
  * @param items - Checkbox item
11
12
  * @returns match item type
12
13
  */
@@ -26,6 +27,7 @@ export class MgInputCheckbox {
26
27
  // "multi" setup
27
28
  this.multiStart = 5;
28
29
  this.searchStart = 10;
30
+ this.paginatedStep = 10;
29
31
  // popover variables
30
32
  this.hasOpenedPopover = false;
31
33
  this.checkboxesId = 'checkboxes-list';
@@ -91,6 +93,10 @@ export class MgInputCheckbox {
91
93
  * Define <mg-tabs> active-tab
92
94
  */
93
95
  this.activeTab = 1;
96
+ /**
97
+ * Paginated sections limit per key
98
+ */
99
+ this.paginatedLimits = {};
94
100
  /**
95
101
  * Handle input event
96
102
  * @param event - input event
@@ -136,8 +142,9 @@ export class MgInputCheckbox {
136
142
  * @param event - input value-change event
137
143
  */
138
144
  this.handleSearchChange = (event) => {
139
- this.searchValue = event.detail;
140
145
  event.stopPropagation();
146
+ event.preventDefault();
147
+ this.searchValue = event.detail;
141
148
  };
142
149
  /**
143
150
  * Handle <mg-tabs> tab-change event
@@ -269,9 +276,15 @@ export class MgInputCheckbox {
269
276
  * Reset <mg-input-checkbox-paginated> limit state
270
277
  */
271
278
  this.resetTabsLimit = () => {
272
- Array.from(this.element.shadowRoot.querySelectorAll('mg-input-checkbox-paginated')).forEach(component => {
273
- component.resetLimit();
274
- });
279
+ this.paginatedLimits = {};
280
+ };
281
+ /**
282
+ * Handle load-more action for a paginated section
283
+ * @param key - section key
284
+ */
285
+ this.handlePaginatedLoadMore = (key) => {
286
+ var _a;
287
+ this.paginatedLimits = Object.assign(Object.assign({}, this.paginatedLimits), { [key]: ((_a = this.paginatedLimits[key]) !== null && _a !== void 0 ? _a : this.paginatedStep) + this.paginatedStep });
275
288
  };
276
289
  /**
277
290
  * Renders the readonly value of the input.
@@ -292,7 +305,7 @@ export class MgInputCheckbox {
292
305
  this.valueChange.emit(newValue);
293
306
  }
294
307
  else {
295
- throw new Error(`<mg-input-checkbox> prop "value" is required and all values must be the same type, CheckboxItem. Passed value: ${toString(newValue)}.`);
308
+ throw new Error(`<mg-input-checkbox> prop "value" is required and all values must be the same type, ICheckboxItem. Passed value: ${toString(newValue)}.`);
296
309
  }
297
310
  }
298
311
  validateType(newValue) {
@@ -517,7 +530,7 @@ export class MgInputCheckbox {
517
530
  * @param checkboxes - checkboxes to render
518
531
  * @returns render sections of checkboxes
519
532
  */
520
- renderCheckboxTabs(checkboxes, checkboxPaginatedProps) {
533
+ renderCheckboxTabs(props) {
521
534
  const handleMassAction = (kind) => () => {
522
535
  const displayItems = this.getDisplayItems();
523
536
  // update only displayed items
@@ -528,39 +541,43 @@ export class MgInputCheckbox {
528
541
  });
529
542
  this.updateValues();
530
543
  };
531
- const [checkedValues, notCheckedValues] = checkboxes.reduce((acc, curr) => {
544
+ const [checkedValues, notCheckedValues] = props.checkboxes.reduce((acc, curr) => {
532
545
  acc[curr.value ? 0 : 1].push(curr);
533
546
  return acc;
534
547
  }, [[], []]);
535
548
  const sections = [
536
- 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) }),
537
- 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) }),
549
+ Object.assign(Object.assign({}, props), { checkboxes: notCheckedValues, messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.notSelected), { showMore: this.messages.input.showMore }), key: SectionKind.NOT_SELECTED, handleMassAction: handleMassAction(SectionKind.NOT_SELECTED) }),
550
+ Object.assign(Object.assign({}, props), { checkboxes: checkedValues, messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.selected), { showMore: this.messages.input.showMore }), key: SectionKind.SELECTED, handleMassAction: handleMassAction(SectionKind.SELECTED) }),
538
551
  ];
539
552
  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) => ({
540
553
  label: section.messages.title,
541
554
  badge: { value: section.checkboxes.length, label: this.messages.input.checkbox.sections.badge.label, role: 'information' },
542
555
  status: key + 1 === this.activeTab ? Status.ACTIVE : Status.VISIBLE,
543
- })), 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))))))));
556
+ })), activeTab: this.activeTab, "onActive-tab-change": this.handleActiveTabChange }, sections.map(section => {
557
+ var _a;
558
+ return (h(MgInputCheckboxPaginated, Object.assign({}, section, { limit: (_a = this.paginatedLimits[section.key]) !== null && _a !== void 0 ? _a : this.paginatedStep, handleLoadMore: () => this.handlePaginatedLoadMore(section.key) })));
559
+ })));
544
560
  }
545
561
  /**
546
562
  * render checkbox multi element
547
563
  * @returns html element
548
564
  */
549
565
  renderCheckboxMulti() {
566
+ var _a;
550
567
  const selectedValuesNb = this.getSelectedItems().length;
551
- const checkboxes = this.getDisplayItems();
552
- const checkboxPaginatedProps = {
568
+ const props = {
553
569
  readonly: this.readonly,
554
570
  disabled: this.disabled,
555
- identifier: this.identifier,
571
+ checkboxes: this.getDisplayItems(),
556
572
  };
573
+ const checkboxesPaginatedSearchProps = Object.assign(Object.assign({}, props), { messages: Object.assign(Object.assign({}, this.messages.input.checkbox.sections.search), { showMore: this.messages.input.showMore }), key: SectionKind.SEARCH, limit: (_a = this.paginatedLimits[SectionKind.SEARCH]) !== null && _a !== void 0 ? _a : this.paginatedStep, handleLoadMore: () => this.handlePaginatedLoadMore(SectionKind.SEARCH) });
557
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) => {
558
575
  if (el !== null)
559
576
  this.mgPopover = el;
560
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 ? ([
561
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 }),
562
- 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)),
563
- ]) : (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)))));
579
+ this.searchValue.length > 0 ? h(MgInputCheckboxPaginated, Object.assign({}, checkboxesPaginatedSearchProps)) : this.renderCheckboxTabs(props),
580
+ ]) : (h(MgInputCheckboxList, Object.assign({}, props, { id: this.checkboxesId, 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)))));
564
581
  }
565
582
  /**
566
583
  * Render
@@ -578,7 +595,7 @@ export class MgInputCheckbox {
578
595
  else {
579
596
  inputContent = this.renderCheckboxMulti();
580
597
  }
581
- return (h("mg-input", { key: '5addea288b5c87fec33a56449d14f861aefd465d', 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: '11b725ebb111707aaf7dc39d191fe6a9efb25ea6', 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));
582
599
  }
583
600
  static get is() { return "mg-input-checkbox"; }
584
601
  static get encapsulation() { return "shadow"; }
@@ -598,13 +615,14 @@ export class MgInputCheckbox {
598
615
  "type": "unknown",
599
616
  "mutable": true,
600
617
  "complexType": {
601
- "original": "CheckboxValue[]",
602
- "resolved": "CheckboxValue[]",
618
+ "original": "ICheckboxValue[]",
619
+ "resolved": "ICheckboxValue[]",
603
620
  "references": {
604
- "CheckboxValue": {
621
+ "ICheckboxValue": {
605
622
  "location": "import",
606
623
  "path": "./mg-input-checkbox.conf",
607
- "id": "src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.ts::CheckboxValue"
624
+ "id": "src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.ts::ICheckboxValue",
625
+ "referenceLocation": "ICheckboxValue"
608
626
  }
609
627
  }
610
628
  },
@@ -627,7 +645,8 @@ export class MgInputCheckbox {
627
645
  "CheckboxType": {
628
646
  "location": "import",
629
647
  "path": "./mg-input-checkbox.conf",
630
- "id": "src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.ts::CheckboxType"
648
+ "id": "src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.ts::CheckboxType",
649
+ "referenceLocation": "CheckboxType"
631
650
  }
632
651
  }
633
652
  },
@@ -869,7 +888,8 @@ export class MgInputCheckbox {
869
888
  "TooltipPosition": {
870
889
  "location": "import",
871
890
  "path": "../mg-input/mg-input.conf",
872
- "id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::TooltipPosition"
891
+ "id": "src/components/molecules/inputs/mg-input/mg-input.conf.ts::TooltipPosition",
892
+ "referenceLocation": "TooltipPosition"
873
893
  }
874
894
  }
875
895
  },
@@ -1010,7 +1030,8 @@ export class MgInputCheckbox {
1010
1030
  "searchValue": {},
1011
1031
  "searchResults": {},
1012
1032
  "selectValuesButtonKey": {},
1013
- "activeTab": {}
1033
+ "activeTab": {},
1034
+ "paginatedLimits": {}
1014
1035
  };
1015
1036
  }
1016
1037
  static get events() {
@@ -1026,7 +1047,7 @@ export class MgInputCheckbox {
1026
1047
  },
1027
1048
  "complexType": {
1028
1049
  "original": "HTMLMgInputCheckboxElement['value']",
1029
- "resolved": "CheckboxValue[]",
1050
+ "resolved": "ICheckboxValue[]",
1030
1051
  "references": {
1031
1052
  "HTMLMgInputCheckboxElement": {
1032
1053
  "location": "global",