@mgdis/mg-components 5.22.0 → 5.23.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 (238) hide show
  1. package/dist/cjs/{index-28bf9033.js → index-0cf3e6d5.js} +22 -13
  2. package/dist/cjs/index-0cf3e6d5.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/mg-action-more_34.cjs.entry.js +225 -158
  5. package/dist/cjs/mg-action-more_34.cjs.entry.js.map +1 -1
  6. package/dist/cjs/mg-components.cjs.js +2 -2
  7. package/dist/cjs/mg-components.cjs.js.map +1 -1
  8. package/dist/cjs/mg-item-more.cjs.entry.js +7 -6
  9. package/dist/cjs/mg-item-more.cjs.entry.js.map +1 -1
  10. package/dist/cjs/mg-menu.conf-0229bb75.js +333 -0
  11. package/dist/cjs/mg-menu.conf-0229bb75.js.map +1 -0
  12. package/dist/collection/collection-manifest.json +2 -2
  13. package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -1
  14. package/dist/collection/components/atoms/mg-badge/mg-badge.js.map +1 -1
  15. package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
  16. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  17. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
  18. package/dist/collection/components/atoms/mg-card/mg-card.js.map +1 -1
  19. package/dist/collection/components/atoms/mg-character-left/mg-character-left.js.map +1 -1
  20. package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
  21. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  22. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +1 -1
  23. package/dist/collection/components/atoms/mg-input-title/mg-input-title.js.map +1 -1
  24. package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
  25. package/dist/collection/components/atoms/mg-tag/mg-tag.js.map +1 -1
  26. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +1 -1
  27. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
  28. package/dist/collection/components/molecules/inputs/MgInput.js +1 -1
  29. package/dist/collection/components/molecules/inputs/MgInput.js.map +1 -1
  30. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +10 -7
  32. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
  33. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +35 -6
  34. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  35. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -2
  36. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  37. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
  38. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
  39. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
  40. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
  41. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
  42. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
  43. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +1 -1
  44. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  45. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
  46. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
  47. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
  48. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
  49. package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js.map +1 -1
  50. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +1 -1
  51. package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
  52. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
  53. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
  54. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  55. package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
  56. package/dist/collection/components/molecules/mg-form/mg-form.js +1 -1
  57. package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
  58. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  59. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js.map +1 -1
  60. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +1 -1
  61. package/dist/collection/components/molecules/mg-item-more/mg-item-more.js.map +1 -1
  62. package/dist/collection/components/molecules/mg-message/mg-message.js +1 -1
  63. package/dist/collection/components/molecules/mg-message/mg-message.js.map +1 -1
  64. package/dist/collection/components/molecules/mg-modal/mg-modal.js +6 -5
  65. package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
  66. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +1 -1
  67. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
  68. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  69. package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
  70. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  71. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js.map +1 -1
  72. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  73. package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
  74. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  75. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js.map +1 -1
  76. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
  77. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
  78. package/dist/collection/locales/en/messages.json +9 -1
  79. package/dist/collection/locales/fr/messages.json +9 -1
  80. package/dist/collection/locales/index.js +2 -2
  81. package/dist/collection/locales/index.js.map +1 -1
  82. package/dist/collection/utils/behaviors.utils.js.map +1 -1
  83. package/dist/collection/utils/behaviors.utils.spec.js +1 -1
  84. package/dist/collection/utils/behaviors.utils.spec.js.map +1 -1
  85. package/dist/collection/utils/unit.test.utils.js +0 -104
  86. package/dist/collection/utils/unit.test.utils.js.map +1 -1
  87. package/dist/components/MgInput.js +3 -3
  88. package/dist/components/MgInput.js.map +1 -1
  89. package/dist/components/index.es.js +75 -0
  90. package/dist/components/index.es.js.map +1 -0
  91. package/dist/components/index2.js +22 -61
  92. package/dist/components/index2.js.map +1 -1
  93. package/dist/components/mg-action-more.js +5 -4
  94. package/dist/components/mg-action-more.js.map +1 -1
  95. package/dist/components/mg-badge2.js +5 -4
  96. package/dist/components/mg-badge2.js.map +1 -1
  97. package/dist/components/mg-button2.js +6 -5
  98. package/dist/components/mg-button2.js.map +1 -1
  99. package/dist/components/mg-card2.js +4 -3
  100. package/dist/components/mg-card2.js.map +1 -1
  101. package/dist/components/mg-character-left2.js +2 -1
  102. package/dist/components/mg-character-left2.js.map +1 -1
  103. package/dist/components/mg-details.js +4 -3
  104. package/dist/components/mg-details.js.map +1 -1
  105. package/dist/components/mg-divider.js +2 -1
  106. package/dist/components/mg-divider.js.map +1 -1
  107. package/dist/components/mg-form.js +5 -4
  108. package/dist/components/mg-form.js.map +1 -1
  109. package/dist/components/mg-icon2.js +4 -3
  110. package/dist/components/mg-icon2.js.map +1 -1
  111. package/dist/components/mg-illustrated-message.js +4 -3
  112. package/dist/components/mg-illustrated-message.js.map +1 -1
  113. package/dist/components/mg-input-checkbox.js +16 -12
  114. package/dist/components/mg-input-checkbox.js.map +1 -1
  115. package/dist/components/mg-input-date.js +41 -10
  116. package/dist/components/mg-input-date.js.map +1 -1
  117. package/dist/components/mg-input-numeric.js +7 -6
  118. package/dist/components/mg-input-numeric.js.map +1 -1
  119. package/dist/components/mg-input-password.js +5 -4
  120. package/dist/components/mg-input-password.js.map +1 -1
  121. package/dist/components/mg-input-radio.js +6 -5
  122. package/dist/components/mg-input-radio.js.map +1 -1
  123. package/dist/components/mg-input-select2.js +8 -7
  124. package/dist/components/mg-input-select2.js.map +1 -1
  125. package/dist/components/mg-input-text2.js +8 -7
  126. package/dist/components/mg-input-text2.js.map +1 -1
  127. package/dist/components/mg-input-textarea.js +8 -7
  128. package/dist/components/mg-input-textarea.js.map +1 -1
  129. package/dist/components/mg-input-title2.js +4 -3
  130. package/dist/components/mg-input-title2.js.map +1 -1
  131. package/dist/components/mg-input-toggle.js +6 -5
  132. package/dist/components/mg-input-toggle.js.map +1 -1
  133. package/dist/components/mg-item-more.js +4 -3
  134. package/dist/components/mg-item-more.js.map +1 -1
  135. package/dist/components/mg-menu-item2.js +6 -5
  136. package/dist/components/mg-menu-item2.js.map +1 -1
  137. package/dist/components/mg-menu2.js +2 -1
  138. package/dist/components/mg-menu2.js.map +1 -1
  139. package/dist/components/mg-message.js +5 -4
  140. package/dist/components/mg-message.js.map +1 -1
  141. package/dist/components/mg-modal.js +12 -10
  142. package/dist/components/mg-modal.js.map +1 -1
  143. package/dist/components/mg-pagination2.js +4 -3
  144. package/dist/components/mg-pagination2.js.map +1 -1
  145. package/dist/components/mg-panel.js +6 -5
  146. package/dist/components/mg-panel.js.map +1 -1
  147. package/dist/components/mg-popover-content2.js +5 -4
  148. package/dist/components/mg-popover-content2.js.map +1 -1
  149. package/dist/components/mg-popover2.js +5 -4
  150. package/dist/components/mg-popover2.js.map +1 -1
  151. package/dist/components/mg-skip-links.js +4 -3
  152. package/dist/components/mg-skip-links.js.map +1 -1
  153. package/dist/components/mg-tabs.js +8 -7
  154. package/dist/components/mg-tabs.js.map +1 -1
  155. package/dist/components/mg-tag.js +5 -4
  156. package/dist/components/mg-tag.js.map +1 -1
  157. package/dist/components/mg-tooltip-content2.js +2 -1
  158. package/dist/components/mg-tooltip-content2.js.map +1 -1
  159. package/dist/components/mg-tooltip2.js +8 -7
  160. package/dist/components/mg-tooltip2.js.map +1 -1
  161. package/dist/esm/{index-93dafb06.js → index-91977c3d.js} +22 -13
  162. package/dist/esm/index-91977c3d.js.map +1 -0
  163. package/dist/esm/loader.js +2 -2
  164. package/dist/esm/mg-action-more_34.entry.js +193 -126
  165. package/dist/esm/mg-action-more_34.entry.js.map +1 -1
  166. package/dist/esm/mg-components.js +3 -3
  167. package/dist/esm/mg-components.js.map +1 -1
  168. package/dist/esm/mg-item-more.entry.js +5 -4
  169. package/dist/esm/mg-item-more.entry.js.map +1 -1
  170. package/dist/esm/mg-menu.conf-4b2d2eab.js +315 -0
  171. package/dist/esm/mg-menu.conf-4b2d2eab.js.map +1 -0
  172. package/dist/mg-components/locales/en/messages.json +9 -1
  173. package/dist/mg-components/locales/fr/messages.json +9 -1
  174. package/dist/mg-components/mg-components.esm.js +1 -1
  175. package/dist/mg-components/mg-components.esm.js.map +1 -1
  176. package/dist/mg-components/p-1564df7a.js +2 -0
  177. package/dist/mg-components/p-1564df7a.js.map +1 -0
  178. package/dist/mg-components/p-49e1ffcb.js +3 -0
  179. package/dist/mg-components/p-49e1ffcb.js.map +1 -0
  180. package/dist/mg-components/p-6c68c7eb.entry.js +2 -0
  181. package/dist/mg-components/p-6c68c7eb.entry.js.map +1 -0
  182. package/dist/mg-components/p-d6d71404.entry.js +2 -0
  183. package/dist/mg-components/p-d6d71404.entry.js.map +1 -0
  184. package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -1
  185. package/dist/types/components/atoms/mg-button/mg-button.d.ts +1 -1
  186. package/dist/types/components/atoms/mg-card/mg-card.d.ts +1 -1
  187. package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +1 -1
  188. package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +1 -1
  189. package/dist/types/components/molecules/inputs/MgInput.d.ts +1 -1
  190. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +1 -1
  191. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +18 -1
  192. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +1 -1
  193. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +1 -1
  194. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +1 -1
  195. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +1 -1
  196. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +1 -1
  197. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +1 -1
  198. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +1 -1
  199. package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +1 -1
  200. package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
  201. package/dist/types/components/molecules/mg-message/mg-message.d.ts +1 -1
  202. package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -1
  203. package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
  204. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +1 -1
  205. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -1
  206. package/dist/types/components.d.ts +2 -2
  207. package/dist/types/locales/index.d.ts +1 -180
  208. package/dist/types/utils/unit.test.utils.d.ts +0 -82
  209. package/package.json +33 -32
  210. package/dist/cjs/components.utils-637c479d.js +0 -447
  211. package/dist/cjs/components.utils-637c479d.js.map +0 -1
  212. package/dist/cjs/index-28bf9033.js.map +0 -1
  213. package/dist/collection/utils/components.utils.js +0 -147
  214. package/dist/collection/utils/components.utils.js.map +0 -1
  215. package/dist/collection/utils/components.utils.spec.js +0 -156
  216. package/dist/collection/utils/components.utils.spec.js.map +0 -1
  217. package/dist/collection/utils/e2e.test.utils.js +0 -46
  218. package/dist/collection/utils/e2e.test.utils.js.map +0 -1
  219. package/dist/collection/utils/locale.utils.js +0 -57
  220. package/dist/collection/utils/locale.utils.js.map +0 -1
  221. package/dist/collection/utils/locale.utils.spec.js +0 -52
  222. package/dist/collection/utils/locale.utils.spec.js.map +0 -1
  223. package/dist/components/components.utils.js +0 -150
  224. package/dist/components/components.utils.js.map +0 -1
  225. package/dist/esm/components.utils-f7c073a0.js +0 -431
  226. package/dist/esm/components.utils-f7c073a0.js.map +0 -1
  227. package/dist/esm/index-93dafb06.js.map +0 -1
  228. package/dist/mg-components/p-457dd62a.entry.js +0 -2
  229. package/dist/mg-components/p-457dd62a.entry.js.map +0 -1
  230. package/dist/mg-components/p-4fa40a8f.entry.js +0 -2
  231. package/dist/mg-components/p-4fa40a8f.entry.js.map +0 -1
  232. package/dist/mg-components/p-721c4571.js +0 -2
  233. package/dist/mg-components/p-721c4571.js.map +0 -1
  234. package/dist/mg-components/p-8155d0e2.js +0 -3
  235. package/dist/mg-components/p-8155d0e2.js.map +0 -1
  236. package/dist/types/utils/components.utils.d.ts +0 -87
  237. package/dist/types/utils/e2e.test.utils.d.ts +0 -22
  238. package/dist/types/utils/locale.utils.d.ts +0 -38
@@ -1,447 +0,0 @@
1
- 'use strict';
2
-
3
- const errors$1 = {
4
- required: "This field is required.",
5
- date: {
6
- badInput: "The date format must be <span aria-hidden=\"true\">mm/dd/yyyy</span><span class=\"mg-u-visually-hidden\">m m / d d / y y y y</span> and the date must be greater than {min}",
7
- min: "The date cannot be earlier than {min}",
8
- max: "The date cannot be later than {max}",
9
- minMax: "The date must be between {min} and {max}"
10
- },
11
- numeric: {
12
- min: "The value cannot be less than {min}",
13
- max: "The value cannot be greater than {max}",
14
- minMax: "The value must be between {min} et {max}"
15
- }
16
- };
17
- const nbCharLeft$1 = "{counter} characters left.";
18
- const input$1 = {
19
- select: {
20
- placeholder: "Select a value"
21
- },
22
- checkbox: {
23
- selectedValues: "{nb} selected values",
24
- selectedValue: "{nb} selected value",
25
- editButton: "Edit",
26
- selectButton: "Select values",
27
- showButton: "Show",
28
- label: "Enter a value",
29
- result: "result",
30
- results: "results",
31
- searchResults: "Search result(s) list.",
32
- noResult: "No result.",
33
- sections: {
34
- selected: {
35
- title: "Selected",
36
- titlePlurial: "Selected",
37
- action: "Unselect all",
38
- tooltip: "Unselect all current search results"
39
- },
40
- notSelected: {
41
- title: "Not selected",
42
- titlePlurial: "Not selected",
43
- action: "Select all",
44
- tooltip: "Select all current search results"
45
- }
46
- }
47
- }
48
- };
49
- const form$1 = {
50
- required: "Fields with a <strong class=\"mg-u-is-asterisk\">*</strong> are required",
51
- requiredSingle: "Field with a <strong class=\"mg-u-is-asterisk\">*</strong> is required",
52
- allRequired: "All fields are required",
53
- allRequiredSingle: "The field is required"
54
- };
55
- const message$1 = {
56
- closeButton: "Close message"
57
- };
58
- const modal$1 = {
59
- closeButton: "Close modal"
60
- };
61
- const pagination$1 = {
62
- label: "Pagination",
63
- page: "page",
64
- pages: "pages",
65
- nextPage: "Next page",
66
- previousPage: "Previous page",
67
- selectPage: "Select the page to display."
68
- };
69
- const panel$1 = {
70
- editLabel: "Edit section title."
71
- };
72
- const skipLinks$1 = {
73
- navLabel: "Quick access"
74
- };
75
- const general$1 = {
76
- confirm: "Confirm",
77
- cancel: "Cancel",
78
- close: "Close",
79
- next: "next",
80
- previous: "previous"
81
- };
82
- const plusMenu$1 = {
83
- moreLabel: "Additional menu",
84
- badgeLabel: "Include notification(s)"
85
- };
86
- const actionMore$1 = {
87
- label: "Actions"
88
- };
89
- const en = {
90
- errors: errors$1,
91
- nbCharLeft: nbCharLeft$1,
92
- input: input$1,
93
- form: form$1,
94
- message: message$1,
95
- modal: modal$1,
96
- pagination: pagination$1,
97
- panel: panel$1,
98
- skipLinks: skipLinks$1,
99
- general: general$1,
100
- plusMenu: plusMenu$1,
101
- actionMore: actionMore$1
102
- };
103
-
104
- const errors = {
105
- required: "Ce champ est obligatoire.",
106
- date: {
107
- badInput: "Le format de la date doit être du type <span aria-hidden=\"true\">jj/mm/aaaa</span><span class=\"mg-u-visually-hidden\">j j / m m / a a a a</span> et la date supérieure au {min}",
108
- min: "La date ne peut pas être antérieure au {min}",
109
- max: "La date ne peut pas être postérieure au {max}",
110
- minMax: "La date doit être comprise entre le {min} et le {max}"
111
- },
112
- numeric: {
113
- min: "La valeur ne peut pas être inférieure à {min}",
114
- max: "La valeur ne peut pas être supérieure à {max}",
115
- minMax: "La valeur doit être comprise entre {min} et {max}"
116
- }
117
- };
118
- const nbCharLeft = "{counter} caractères disponibles.";
119
- const input = {
120
- select: {
121
- placeholder: "Sélectionnez une valeur"
122
- },
123
- checkbox: {
124
- selectedValues: "{nb} valeurs selectionnées",
125
- selectedValue: "{nb} valeur selectionnée",
126
- editButton: "Modifier",
127
- selectButton: "Sélectionner des valeurs",
128
- showButton: "Voir",
129
- label: "Saisissez une valeur",
130
- result: "résultat",
131
- results: "résultats",
132
- searchResults: "List de résultat(s) de la recherche.",
133
- noResult: "Aucun résultat.",
134
- sections: {
135
- selected: {
136
- title: "Sélectionné",
137
- titlePlurial: "Sélectionnés",
138
- action: "Tout désélectionner",
139
- tooltip: "Désélectionne tous les résultats de la recherche en cours"
140
- },
141
- notSelected: {
142
- title: "Non sélectionné",
143
- titlePlurial: "Non sélectionnés",
144
- action: "Tout sélectionner",
145
- tooltip: "Sélectionne tous les résultats de la recherche en cours"
146
- }
147
- }
148
- }
149
- };
150
- const form = {
151
- required: "Les champs marqués d'un <strong class=\"mg-u-is-asterisk\">*</strong> sont obligatoires",
152
- requiredSingle: "Le champ marqué d'un <strong class=\"mg-u-is-asterisk\">*</strong> est obligatoire",
153
- allRequired: "Tous les champs sont obligatoires",
154
- allRequiredSingle: "Le champ est obligatoire"
155
- };
156
- const message = {
157
- closeButton: "Fermer le message"
158
- };
159
- const modal = {
160
- closeButton: "Fermer la modale"
161
- };
162
- const pagination = {
163
- label: "Pagination",
164
- page: "page",
165
- pages: "pages",
166
- nextPage: "Page suivante",
167
- previousPage: "Page précédente",
168
- selectPage: "Sélectionner la page à afficher."
169
- };
170
- const panel = {
171
- editLabel: "Modifier le titre de la section."
172
- };
173
- const skipLinks = {
174
- navLabel: "Accès rapide"
175
- };
176
- const general = {
177
- confirm: "Valider",
178
- cancel: "Annuler",
179
- close: "Fermer",
180
- next: "suivant",
181
- previous: "précédent"
182
- };
183
- const plusMenu = {
184
- moreLabel: "Menu complémentaire",
185
- badgeLabel: "Notification(s) incluse(s)"
186
- };
187
- const actionMore = {
188
- label: "Actions"
189
- };
190
- const fr = {
191
- errors: errors,
192
- nbCharLeft: nbCharLeft,
193
- input: input,
194
- form: form,
195
- message: message,
196
- modal: modal,
197
- pagination: pagination,
198
- panel: panel,
199
- skipLinks: skipLinks,
200
- general: general,
201
- plusMenu: plusMenu,
202
- actionMore: actionMore
203
- };
204
-
205
- /**
206
- * Format number to the locale currency
207
- * @param number - number to format
208
- * @param locale - locale to apply
209
- * @param currency - currency to apply
210
- * @returns formatted currency
211
- */
212
- const localeCurrency = (number, locale, currency) => {
213
- return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);
214
- };
215
- /**
216
- * Format number to locale
217
- * @param number - number to format
218
- * @param locale - locale to apply
219
- * @returns formatted number
220
- */
221
- const localeNumber = (number, locale) => {
222
- return new Intl.NumberFormat(locale).format(number);
223
- };
224
- /**
225
- * Date RegExp
226
- */
227
- const dateRegExp = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
228
- /**
229
- * Locale date format
230
- * @param date - date to format
231
- * @param locale - locale to apply
232
- * @returns formatted date
233
- */
234
- const localeDate = (date, locale) => {
235
- if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {
236
- return '';
237
- }
238
- return new Intl.DateTimeFormat(locale).format(new Date(date));
239
- };
240
- /**
241
- * Get locale and messages
242
- * We load the defined locale but for now we only support the first subtag for messages
243
- * @param element - element we need to get the language
244
- * @param messages - messages to use
245
- * @param defaultLocale - default messages locale
246
- * @returns messages object
247
- */
248
- const getLocaleMessages = (element, messages, defaultLocale) => {
249
- // Get local
250
- const closestLangAttribute = element.closest('[lang]');
251
- const closestLang = Intl.NumberFormat.supportedLocalesOf(closestLangAttribute === null || closestLangAttribute === void 0 ? void 0 : closestLangAttribute.lang);
252
- const locale = closestLang.length > 0 ? closestLang[0] : navigator.language || defaultLocale;
253
- // Only keep first subtag
254
- const localeSubtag = locale.split('-').shift();
255
- // Return
256
- return {
257
- locale,
258
- messages: messages[localeSubtag] || messages[defaultLocale],
259
- };
260
- };
261
-
262
- const defaultLocale = 'en';
263
- const messages = { en, fr };
264
- /**
265
- * Get Intl object
266
- * @param element - element we need to get the language
267
- * @returns messages object
268
- */
269
- const initLocales = (element) => getLocaleMessages(element, messages, defaultLocale);
270
-
271
- /**
272
- * Menu direction type
273
- */
274
- exports.Direction = void 0;
275
- (function (Direction) {
276
- Direction["VERTICAL"] = "vertical";
277
- Direction["HORIZONTAL"] = "horizontal";
278
- })(exports.Direction || (exports.Direction = {}));
279
- /**
280
- * List of all possibles sizes
281
- */
282
- const sizes = ['regular', 'medium', 'large'];
283
-
284
- /**
285
- * Create random ID
286
- * @param prefix - add prefix to created ID
287
- * @param length - ID length
288
- * @returns ID
289
- */
290
- const createID = (prefix = '', length = 10) => {
291
- const randomBytes = new Uint8Array(length);
292
- crypto.getRandomValues(randomBytes);
293
- const hexString = Array.from(randomBytes)
294
- .map(byte => byte.toString(16).padStart(2, '0'))
295
- .join('')
296
- .slice(0, length);
297
- return prefix !== '' ? `${prefix}-${hexString}` : hexString;
298
- };
299
- /**
300
- * Class to manage component classlist
301
- * Set() are not working when imported in project
302
- */
303
- class ClassList {
304
- constructor(classlist = []) {
305
- /**
306
- * Add class
307
- * @param className - class name to add
308
- */
309
- this.add = (className) => {
310
- if (!this.has(className)) {
311
- this.classes.push(className);
312
- }
313
- };
314
- /**
315
- * Delete class
316
- * @param className - class name to delete
317
- */
318
- this.delete = (className) => {
319
- const index = this.classes.indexOf(className);
320
- if (index > -1) {
321
- this.classes.splice(index, 1);
322
- }
323
- };
324
- /**
325
- * Check if class exist in list
326
- * @param className - class name to check
327
- * @returns class name is in the list
328
- */
329
- this.has = (className) => {
330
- return this.classes.includes(className);
331
- };
332
- /**
333
- * Join classes seperated by spaces
334
- * @returns joined values
335
- */
336
- this.join = () => {
337
- return this.classes.join(' ');
338
- };
339
- this.classes = classlist;
340
- }
341
- }
342
- /**
343
- * Check if all items are string
344
- * @param items - items to check
345
- * @returns all items are string
346
- */
347
- const allItemsAreString = (items) => Array.isArray(items) && items.every(item => typeof item === 'string');
348
- /**
349
- * Check if element is a heading
350
- * @param element - slotted element
351
- * @param tagNames - allowed tag names list
352
- * @returns element is a heading
353
- */
354
- const isTagName = (element, tagNames) => {
355
- return tagNames.includes(element === null || element === void 0 ? void 0 : element.tagName.toLowerCase());
356
- };
357
- /**
358
- * Focusable elements query selector
359
- */
360
- const focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier]';
361
- /**
362
- * Get windows
363
- * @param localWindow - the window we are lookink for other windows
364
- * @returns The list of windows found
365
- */
366
- const getWindows = (localWindow) => {
367
- const parentWindows = getParentWindows(localWindow);
368
- const childWindows = getChildWindows(localWindow);
369
- return [localWindow, ...parentWindows, ...childWindows];
370
- };
371
- /**
372
- * Get parent windows
373
- * @param localWindow - the window we are lookink for parents
374
- * @param windows - The list of allready found windows
375
- * @returns The list of windows found
376
- */
377
- const getParentWindows = (localWindow, windows = []) => {
378
- // Check if is in iframe
379
- if (localWindow.self !== localWindow.top) {
380
- // Check if we have permission to access parent
381
- try {
382
- const parentWindow = localWindow.parent;
383
- windows.push(parentWindow);
384
- return getParentWindows(parentWindow, windows);
385
- }
386
- catch (err) {
387
- console.error('Different hosts between iframes:', err);
388
- return windows;
389
- }
390
- }
391
- return windows;
392
- };
393
- /**
394
- * Get child windows
395
- * @param localWindow - the window we are lookink for children
396
- * @param windows - The list of allready found windows
397
- * @returns The list of windows found
398
- */
399
- const getChildWindows = (localWindow, windows = []) => {
400
- if (localWindow.frames.length > 0) {
401
- for (const childWindow of Array.from(localWindow.frames)) {
402
- windows.push(childWindow);
403
- getChildWindows(childWindow, windows);
404
- }
405
- }
406
- return windows;
407
- };
408
- /**
409
- * Validate string
410
- * @param value - value to check
411
- * @returns if string is valid
412
- */
413
- const isValidString = (value) => typeof value === 'string' && value.trim() !== '';
414
- /**
415
- * Clean string caraters
416
- * @param text - text to cliean
417
- * @returns cleanded string
418
- */
419
- const cleanString = (text) => typeof text === 'string' &&
420
- text
421
- .toLocaleLowerCase()
422
- .normalize('NFD')
423
- .replaceAll(/[\u0300-\u036f]/g, '');
424
- /**
425
- * Use to process code next tick in the event loop
426
- * @param callback - code to excute on next tick
427
- * @returns differed code excution
428
- */
429
- const nextTick = async (callback) => callback();
430
-
431
- exports.ClassList = ClassList;
432
- exports.allItemsAreString = allItemsAreString;
433
- exports.cleanString = cleanString;
434
- exports.createID = createID;
435
- exports.dateRegExp = dateRegExp;
436
- exports.focusableElements = focusableElements;
437
- exports.getWindows = getWindows;
438
- exports.initLocales = initLocales;
439
- exports.isTagName = isTagName;
440
- exports.isValidString = isValidString;
441
- exports.localeCurrency = localeCurrency;
442
- exports.localeDate = localeDate;
443
- exports.localeNumber = localeNumber;
444
- exports.nextTick = nextTick;
445
- exports.sizes = sizes;
446
-
447
- //# sourceMappingURL=components.utils-637c479d.js.map
@@ -1 +0,0 @@
1
- {"file":"components.utils-637c479d.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;MAOa,c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/components.utils.ts"],"sourcesContent":["/**\n * Format number to the locale currency\n * @param number - number to format\n * @param locale - locale to apply\n * @param currency - currency to apply\n * @returns formatted currency\n */\nexport const localeCurrency = (number: number, locale: string, currency: string): string => {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(number);\n};\n\n/**\n * Format number to locale\n * @param number - number to format\n * @param locale - locale to apply\n * @returns formatted number\n */\nexport const localeNumber = (number: number, locale: string): string => {\n return new Intl.NumberFormat(locale).format(number);\n};\n\n/**\n * Date RegExp\n */\nexport const dateRegExp = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\n\n/**\n * Locale date format\n * @param date - date to format\n * @param locale - locale to apply\n * @returns formatted date\n */\nexport const localeDate = (date: string, locale: string): string => {\n if (typeof date !== 'string' || date === '' || !dateRegExp.test(date)) {\n return '';\n }\n return new Intl.DateTimeFormat(locale).format(new Date(date));\n};\n\n/**\n * Get locale and messages\n * We load the defined locale but for now we only support the first subtag for messages\n * @param element - element we need to get the language\n * @param messages - messages to use\n * @param defaultLocale - default messages locale\n * @returns messages object\n */\nexport const getLocaleMessages = (element: HTMLElement, messages: unknown, defaultLocale: string): { locale: string; messages: Record<string, unknown> } => {\n // Get local\n const closestLangAttribute: HTMLElement = element.closest('[lang]');\n const closestLang: string[] = Intl.NumberFormat.supportedLocalesOf(closestLangAttribute?.lang);\n const locale = closestLang.length > 0 ? closestLang[0] : navigator.language || defaultLocale;\n // Only keep first subtag\n const localeSubtag = locale.split('-').shift();\n // Return\n return {\n locale,\n messages: messages[localeSubtag] || messages[defaultLocale],\n };\n};\n","import en from './en/messages.json';\nimport fr from './fr/messages.json';\nimport { getLocaleMessages } from '../utils/locale.utils';\n\nconst defaultLocale = 'en';\nconst messages = { en, fr };\n\n/**\n * Get Intl object\n * @param element - element we need to get the language\n * @returns messages object\n */\nexport const initLocales = (element: HTMLElement): { locale: string; messages: Record<string, unknown> } => getLocaleMessages(element, messages, defaultLocale);\n","import { MgItemMore } from '../../mg-item-more/mg-item-more';\n\n/**\n * Menu direction type\n */\nexport enum Direction {\n VERTICAL = 'vertical',\n HORIZONTAL = 'horizontal',\n}\n\n/**\n * ItemMore prop type\n */\nexport type ItemMoreType = Pick<MgItemMore, 'icon' | 'slotlabel' | 'size'>;\n\n/**\n * List of all possibles sizes\n */\nexport const sizes = ['regular', 'medium', 'large'] as const;\n\n/**\n * item Size from sizes\n */\nexport type MenuSizeType = (typeof sizes)[number];\n","/**\n * Create random ID\n * @param prefix - add prefix to created ID\n * @param length - ID length\n * @returns ID\n */\nexport const createID = (prefix = '', length = 10): string => {\n const randomBytes = new Uint8Array(length);\n\n crypto.getRandomValues(randomBytes);\n\n const hexString = Array.from(randomBytes)\n .map(byte => byte.toString(16).padStart(2, '0'))\n .join('')\n .slice(0, length);\n\n return prefix !== '' ? `${prefix}-${hexString}` : hexString;\n};\n\n/**\n * Class to manage component classlist\n * Set() are not working when imported in project\n */\nexport class ClassList {\n /**\n * Available classes\n */\n classes: string[];\n\n constructor(classlist: string[] = []) {\n this.classes = classlist;\n }\n\n /**\n * Add class\n * @param className - class name to add\n */\n add = (className: string): void => {\n if (!this.has(className)) {\n this.classes.push(className);\n }\n };\n\n /**\n * Delete class\n * @param className - class name to delete\n */\n delete = (className: string): void => {\n const index = this.classes.indexOf(className);\n if (index > -1) {\n this.classes.splice(index, 1);\n }\n };\n\n /**\n * Check if class exist in list\n * @param className - class name to check\n * @returns class name is in the list\n */\n has = (className: string): boolean => {\n return this.classes.includes(className);\n };\n\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n join = (): string => {\n return this.classes.join(' ');\n };\n}\n\n/**\n * Check if all items are string\n * @param items - items to check\n * @returns all items are string\n */\nexport const allItemsAreString = (items: unknown): items is string[] => Array.isArray(items) && items.every(item => typeof item === 'string');\n\n/**\n * Check if element is a heading\n * @param element - slotted element\n * @param tagNames - allowed tag names list\n * @returns element is a heading\n */\nexport const isTagName = (element: Element, tagNames: string[]): boolean => {\n return tagNames.includes(element?.tagName.toLowerCase());\n};\n\n/**\n * Focusable elements query selector\n */\nexport const focusableElements = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier]';\n\n/**\n * Get windows\n * @param localWindow - the window we are lookink for other windows\n * @returns The list of windows found\n */\nexport const getWindows = (localWindow: Window): Window[] => {\n const parentWindows = getParentWindows(localWindow);\n const childWindows = getChildWindows(localWindow);\n return [localWindow, ...parentWindows, ...childWindows];\n};\n\n/**\n * Get parent windows\n * @param localWindow - the window we are lookink for parents\n * @param windows - The list of allready found windows\n * @returns The list of windows found\n */\nexport const getParentWindows = (localWindow: Window, windows: Window[] = []): Window[] => {\n // Check if is in iframe\n if (localWindow.self !== localWindow.top) {\n // Check if we have permission to access parent\n try {\n const parentWindow: Window = localWindow.parent;\n windows.push(parentWindow);\n return getParentWindows(parentWindow, windows);\n } catch (err) {\n console.error('Different hosts between iframes:', err);\n return windows;\n }\n }\n return windows;\n};\n\n/**\n * Get child windows\n * @param localWindow - the window we are lookink for children\n * @param windows - The list of allready found windows\n * @returns The list of windows found\n */\nconst getChildWindows = (localWindow: Window, windows: Window[] = []): Window[] => {\n if (localWindow.frames.length > 0) {\n for (const childWindow of Array.from(localWindow.frames)) {\n windows.push(childWindow);\n getChildWindows(childWindow, windows);\n }\n }\n return windows;\n};\n\n/**\n * Validate string\n * @param value - value to check\n * @returns if string is valid\n */\nexport const isValidString = (value: unknown): boolean => typeof value === 'string' && value.trim() !== '';\n\n/**\n * Clean string caraters\n * @param text - text to cliean\n * @returns cleanded string\n */\nexport const cleanString = (text: string): string =>\n typeof text === 'string' &&\n text\n .toLocaleLowerCase()\n .normalize('NFD')\n .replaceAll(/[\\u0300-\\u036f]/g, '');\n\n/**\n * Use to process code next tick in the event loop\n * @param callback - code to excute on next tick\n * @returns differed code excution\n */\nexport const nextTick = async (callback: () => void): Promise<void> => callback();\n"],"version":3}