@mgdis/mg-components 6.7.0 → 6.8.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 (115) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/index-1a5a1081.js +2 -2
  3. package/dist/cjs/{index-b7923724.js → index-234e834a.js} +75 -39
  4. package/dist/cjs/index-234e834a.js.map +1 -0
  5. package/dist/cjs/{index.es-903492c5.js → index.es-b90f74d4.js} +2 -2
  6. package/dist/cjs/index.es-b90f74d4.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{mg-action-more_36.cjs.entry.js → mg-action-more_37.cjs.entry.js} +477 -91
  9. package/dist/cjs/mg-action-more_37.cjs.entry.js.map +1 -0
  10. package/dist/cjs/mg-alert.cjs.entry.js +2 -2
  11. package/dist/cjs/mg-components.cjs.js +1 -1
  12. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +2 -2
  13. package/dist/cjs/mg-loader.cjs.entry.js +3 -3
  14. package/dist/cjs/mg-loader.cjs.entry.js.map +1 -1
  15. package/dist/cjs/mg-progress.cjs.entry.js +1 -1
  16. package/dist/collection/collection-manifest.json +1 -0
  17. package/dist/collection/components/atoms/mg-button/mg-button.js +10 -10
  18. package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
  19. package/dist/collection/components/atoms/mg-icon/mg-icon.js +21 -6
  20. package/dist/collection/components/atoms/mg-icon/mg-icon.js.map +1 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +2 -2
  22. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js +1 -1
  24. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.conf.js.map +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +46 -19
  26. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +57 -28
  28. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
  29. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js +7 -1
  30. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.conf.js.map +1 -1
  31. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +43 -12
  32. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
  33. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  34. package/dist/collection/components/molecules/mg-loader/mg-loader.js.map +1 -1
  35. package/dist/collection/components/molecules/mg-table/mg-table.conf.js +13 -0
  36. package/dist/collection/components/molecules/mg-table/mg-table.conf.js.map +1 -0
  37. package/dist/collection/components/molecules/mg-table/mg-table.js +364 -0
  38. package/dist/collection/components/molecules/mg-table/mg-table.js.map +1 -0
  39. package/dist/collection/locales/en/messages.json +33 -16
  40. package/dist/collection/locales/fr/messages.json +36 -19
  41. package/dist/components/index.es.js +1 -1
  42. package/dist/components/index.es.js.map +1 -1
  43. package/dist/components/index2.js +73 -37
  44. package/dist/components/index2.js.map +1 -1
  45. package/dist/components/mg-button2.js +10 -10
  46. package/dist/components/mg-button2.js.map +1 -1
  47. package/dist/components/mg-icon2.js +21 -6
  48. package/dist/components/mg-icon2.js.map +1 -1
  49. package/dist/components/mg-input-checkbox-paginated2.js +2 -2
  50. package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
  51. package/dist/components/mg-input-date.js +47 -19
  52. package/dist/components/mg-input-date.js.map +1 -1
  53. package/dist/components/mg-input-numeric.js +58 -29
  54. package/dist/components/mg-input-numeric.js.map +1 -1
  55. package/dist/components/mg-input-text2.js +50 -14
  56. package/dist/components/mg-input-text2.js.map +1 -1
  57. package/dist/components/mg-loader.js +1 -1
  58. package/dist/components/mg-loader.js.map +1 -1
  59. package/dist/components/mg-table.d.ts +11 -0
  60. package/dist/components/mg-table.js +320 -0
  61. package/dist/components/mg-table.js.map +1 -0
  62. package/dist/esm/index-5059254f.js +2 -2
  63. package/dist/esm/{index-a58f8b91.js → index-544778a7.js} +75 -39
  64. package/dist/esm/index-544778a7.js.map +1 -0
  65. package/dist/esm/{index.es-b80b758c.js → index.es-517b1bf2.js} +2 -2
  66. package/dist/esm/index.es-517b1bf2.js.map +1 -0
  67. package/dist/esm/loader.js +1 -1
  68. package/dist/esm/{mg-action-more_36.entry.js → mg-action-more_37.entry.js} +477 -92
  69. package/dist/esm/mg-action-more_37.entry.js.map +1 -0
  70. package/dist/esm/mg-alert.entry.js +2 -2
  71. package/dist/esm/mg-components.js +1 -1
  72. package/dist/esm/mg-input-rich-text-editor.entry.js +2 -2
  73. package/dist/esm/mg-loader.entry.js +3 -3
  74. package/dist/esm/mg-loader.entry.js.map +1 -1
  75. package/dist/esm/mg-progress.entry.js +1 -1
  76. package/dist/mg-components/locales/en/messages.json +33 -16
  77. package/dist/mg-components/locales/fr/messages.json +36 -19
  78. package/dist/mg-components/mg-components.esm.js +1 -1
  79. package/dist/mg-components/mg-components.esm.js.map +1 -1
  80. package/dist/mg-components/{p-3c6710be.js → p-12a1edee.js} +2 -2
  81. package/dist/mg-components/p-12a1edee.js.map +1 -0
  82. package/dist/mg-components/p-9bc53279.js +2 -0
  83. package/dist/mg-components/{p-ac8a5083.js.map → p-9bc53279.js.map} +1 -1
  84. package/dist/mg-components/{p-bc6ec847.entry.js → p-ad98f3d8.entry.js} +2 -2
  85. package/dist/mg-components/p-ad98f3d8.entry.js.map +1 -0
  86. package/dist/mg-components/{p-2a633b29.entry.js → p-c10433db.entry.js} +2 -2
  87. package/dist/mg-components/{p-f2e6e7ae.entry.js → p-c67e4934.entry.js} +2 -2
  88. package/dist/mg-components/p-f72efb64.entry.js +2 -0
  89. package/dist/mg-components/p-f72efb64.entry.js.map +1 -0
  90. package/dist/mg-components/{p-361cc090.entry.js → p-fd4a7980.entry.js} +2 -2
  91. package/dist/types/components/atoms/mg-button/mg-button.d.ts +1 -1
  92. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.conf.d.ts +1 -0
  93. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +6 -5
  94. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.conf.d.ts +4 -2
  95. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +8 -2
  96. package/dist/types/components/molecules/mg-table/mg-table.conf.d.ts +19 -0
  97. package/dist/types/components/molecules/mg-table/mg-table.d.ts +58 -0
  98. package/dist/types/components.d.ts +39 -0
  99. package/ide/intellij/web-types.json +69 -5
  100. package/ide/vscode/html-custom-data.json +85 -1
  101. package/package.json +22 -22
  102. package/dist/cjs/index-b7923724.js.map +0 -1
  103. package/dist/cjs/index.es-903492c5.js.map +0 -1
  104. package/dist/cjs/mg-action-more_36.cjs.entry.js.map +0 -1
  105. package/dist/esm/index-a58f8b91.js.map +0 -1
  106. package/dist/esm/index.es-b80b758c.js.map +0 -1
  107. package/dist/esm/mg-action-more_36.entry.js.map +0 -1
  108. package/dist/mg-components/p-3afebdab.entry.js +0 -2
  109. package/dist/mg-components/p-3afebdab.entry.js.map +0 -1
  110. package/dist/mg-components/p-3c6710be.js.map +0 -1
  111. package/dist/mg-components/p-ac8a5083.js +0 -2
  112. package/dist/mg-components/p-bc6ec847.entry.js.map +0 -1
  113. /package/dist/mg-components/{p-2a633b29.entry.js.map → p-c10433db.entry.js.map} +0 -0
  114. /package/dist/mg-components/{p-f2e6e7ae.entry.js.map → p-c67e4934.entry.js.map} +0 -0
  115. /package/dist/mg-components/{p-361cc090.entry.js.map → p-fd4a7980.entry.js.map} +0 -0
@@ -0,0 +1,320 @@
1
+ import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
2
+ import { Z as Ze, V as Ve, m as me, G as Ge } from './index.es.js';
3
+ import { i as initLocales } from './index2.js';
4
+ import { d as defineCustomElement$2 } from './mg-icon2.js';
5
+
6
+ /**
7
+ * Sizes
8
+ */
9
+ // Define possible sizes
10
+ const sizes = ['small', 'medium', 'large', 'xlarge'];
11
+ /**
12
+ * Columns
13
+ */
14
+ // Define possible text alignments
15
+ const textAlignments = ['left', 'center', 'right'];
16
+ // Define possible data types
17
+ const dataTypes = ['string', 'numeric', 'date'];
18
+
19
+ const mgTableCss = ".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}@font-face{font-family:\"Open Sans\";src:url(\"fonts/OpenSans-Regular.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:600;src:url(\"fonts/OpenSans-SemiBold.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:700;src:url(\"fonts/OpenSans-Bold.ttf\") format(\"truetype\")}p{margin:0}p+p{margin-top:var(--mg-b-size-8)}h1,.mg-u-h1{font-family:var(--mg-b-font-family-heading);font-weight:bold}h2,.mg-u-h2{font-family:var(--mg-b-font-family-heading);font-weight:bold}h3,.mg-u-h3{font-family:var(--mg-b-font-family-heading);font-weight:bold}h4,.mg-u-h4{font-family:var(--mg-b-font-family-heading);font-weight:bold}h5,.mg-u-h5{font-family:var(--mg-b-font-family-heading);font-weight:bold}h6,.mg-u-h6{font-family:var(--mg-b-font-family-heading);font-weight:bold}h1,.mg-u-h1{font-size:var(--mg-b-font-size-h1)}h2,.mg-u-h2{font-size:var(--mg-b-font-size-h2)}h3,.mg-u-h3{font-size:var(--mg-b-font-size-h3)}h4,.mg-u-h4{font-size:var(--mg-b-font-size-h4)}h5,.mg-u-h5{font-size:var(--mg-b-font-size-h5)}h6,.mg-u-h6{font-size:var(--mg-b-font-size-h6)}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}small{font-size:var(--mg-b-small-font-size)}.mg-u-text-left{text-align:left !important}.mg-u-text-center{text-align:center !important}.mg-u-text-right{text-align:right !important}.mg-c-table{--mg-c-table-cell-spacing:var(--mg-b-size-8) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-40);--mg-c-table-header-cell-height:calc(var(--mg-b-size-min-height) + 2 * var(--mg-b-size-8));overflow:hidden;border:none;border-radius:var(--mg-b-size-8);background:var(--mg-b-color-light);border-collapse:separate;border-spacing:0;color:var(--mg-b-color-dark)}.mg-c-table td,.mg-c-table th{height:var(--mg-c-table-cell-height);box-sizing:border-box;padding:var(--mg-c-table-cell-spacing);text-align:start}.mg-c-table thead td,.mg-c-table th{font-weight:600}.mg-c-table thead{height:var(--mg-c-table-header-cell-height);background-color:var(--mg-b-color-app);color:var(--mg-b-color-light)}.mg-c-table :not(thead) tr:nth-child(even){background:color-mix(in srgb, var(--mg-b-color-app), transparent 80%)}.mg-c-table.mg-c-table--size-small{--mg-c-table-cell-spacing:var(--mg-b-size-4) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-32);--mg-c-table-header-cell-height:var(--mg-b-size-32)}.mg-c-table.mg-c-table--size-large{--mg-c-table-cell-height:var(--mg-c-table-header-cell-height)}.mg-c-table.mg-c-table--size-xlarge{--mg-c-table-cell-spacing:var(--mg-b-size-12) var(--mg-b-size-16);--mg-c-table-cell-height:var(--mg-b-size-64);--mg-c-table-header-cell-height:var(--mg-b-size-64)}.mg-c-table.mg-c-table--full-width{width:100%}.mg-c-table-wrapper{overflow:auto}.mg-c-table thead td,.mg-c-table thead th{position:relative}.mg-c-table thead td .mg-c-table__sort-button,.mg-c-table thead th .mg-c-table__sort-button{padding:0;border:none;margin:0;background:none;color:inherit;font-size:inherit;font-weight:600}.mg-c-table thead td .mg-c-table__sort-button::after,.mg-c-table thead th .mg-c-table__sort-button::after{position:absolute;content:\"\";inset:0}.mg-c-table thead td .mg-c-table__sort-button:hover,.mg-c-table thead th .mg-c-table__sort-button:hover{cursor:pointer}.mg-c-table thead td .mg-c-table__sort-button mg-icon,.mg-c-table thead th .mg-c-table__sort-button mg-icon{margin-left:var(--mg-b-size-4)}.mg-c-table thead td:has(.mg-c-table__sort-button):hover,.mg-c-table thead td[aria-sort=descending],.mg-c-table thead td[aria-sort=ascending],.mg-c-table thead th:has(.mg-c-table__sort-button):hover,.mg-c-table thead th[aria-sort=descending],.mg-c-table thead th[aria-sort=ascending]{background-color:color-mix(in srgb, var(--mg-b-color-app), black 10%)}";
20
+ const MgTableStyle0 = mgTableCss;
21
+
22
+ /**
23
+ * Check if value is a valid align object
24
+ * @param newValue - New value
25
+ * @returns True if value is a valid align object
26
+ */
27
+ const isValidColumnsObject = (newValue) =>
28
+ // ensure newValue is an object
29
+ typeof newValue === 'object' &&
30
+ !Array.isArray(newValue) &&
31
+ // Ensure every property is well formatted
32
+ Object.entries(newValue).every(([key, value]) =>
33
+ // ensure key is a number
34
+ !isNaN(parseInt(key)) &&
35
+ // ensure value is an object
36
+ typeof value === 'object' &&
37
+ !Array.isArray(value) &&
38
+ // ensure value has at least one of the following properties
39
+ ((value.align !== undefined && textAlignments.includes(value.align)) ||
40
+ (value.sortable !== undefined && typeof value.sortable === 'boolean') ||
41
+ (value.datatype !== undefined && dataTypes.includes(value.datatype))) &&
42
+ // ensure no extra properties are present
43
+ Object.keys(value).every(key => ['align', 'sortable', 'datatype'].includes(key)));
44
+ /**
45
+ * Compare values
46
+ * @param firstValue - First value
47
+ * @param secondValue - Second value
48
+ * @param descending - Define descending order
49
+ * @param datatype - Data type
50
+ * @returns Comparison result
51
+ * @example
52
+ * compareValues('a', 'b', false, 'string'); // -1
53
+ */
54
+ const compareValues = (firstValue, secondValue, descending, datatype) => {
55
+ if (descending) {
56
+ const temp = firstValue;
57
+ firstValue = secondValue;
58
+ secondValue = temp;
59
+ }
60
+ if (datatype === 'date') {
61
+ return new Date(firstValue).getTime() - new Date(secondValue).getTime();
62
+ }
63
+ return firstValue.localeCompare(secondValue, undefined, { numeric: datatype === 'numeric' });
64
+ };
65
+ const MgTable$1 = /*@__PURE__*/ proxyCustomElement(class MgTable extends HTMLElement {
66
+ constructor() {
67
+ super();
68
+ this.__registerHost();
69
+ this.__attachShadow();
70
+ // Classes
71
+ this.componentClass = 'mg-c-table';
72
+ this.componentWrapperClass = 'mg-c-table-wrapper';
73
+ this.classFullWidth = 'mg-c-table--full-width';
74
+ // Alignment stylesheet
75
+ this.alignmentStylesheet = new CSSStyleSheet();
76
+ /**
77
+ * Define table size
78
+ */
79
+ this.size = 'medium';
80
+ /**
81
+ * Define if table fits its parent element
82
+ */
83
+ this.fullWidth = false;
84
+ /**
85
+ * Class collection
86
+ */
87
+ this.classCollection = new Ze([this.componentClass]);
88
+ }
89
+ watchSize(newValue, oldValue) {
90
+ if (!sizes.includes(newValue)) {
91
+ throw new Error(`<mg-table> prop "size" must be one of: ${sizes.join(', ')}. Passed value: ${Ve(newValue)}.`);
92
+ }
93
+ else {
94
+ if (oldValue !== undefined) {
95
+ this.classCollection.delete(`mg-c-table--size-${oldValue}`);
96
+ }
97
+ this.classCollection.add(`mg-c-table--size-${newValue}`);
98
+ }
99
+ }
100
+ watchFullWidth(newValue) {
101
+ if (newValue) {
102
+ this.classCollection.add(this.classFullWidth);
103
+ }
104
+ else {
105
+ this.classCollection.delete(this.classFullWidth);
106
+ }
107
+ }
108
+ watchColumns(newValue) {
109
+ if (newValue !== undefined && !isValidColumnsObject(newValue)) {
110
+ throw new Error(`<mg-table> prop "columns" must be a ColumnsType object. Passed value: ${Ve(newValue)}.`);
111
+ }
112
+ }
113
+ /**
114
+ * Render Table
115
+ * @param table - Table element
116
+ */
117
+ renderTable(table) {
118
+ let isSortable = false;
119
+ // Remove table classes
120
+ table.className = '';
121
+ // Add table classes
122
+ table.classList.add(...this.classCollection.classes);
123
+ // Set columns based on columns prop
124
+ if (this.columns !== undefined) {
125
+ // Store original rows
126
+ const rowsDefault = Array.from(table.querySelectorAll('tbody tr'));
127
+ // Apply columns settings
128
+ Object.entries(this.columns).forEach(([key, value]) => {
129
+ // Add alignment to stylesheet
130
+ if (value.align !== undefined) {
131
+ this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:${value.align}}}`);
132
+ }
133
+ // if align is not defined and datatype is number, align right
134
+ else if (value.datatype === 'numeric') {
135
+ this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:right}}`);
136
+ }
137
+ // Define if column is sortable
138
+ if (value.sortable) {
139
+ isSortable = true;
140
+ // Add sortable class to table header
141
+ const sortableHeader = table.querySelector(`thead td:nth-child(${key}),thead th:nth-child(${key})`);
142
+ // Create button
143
+ const button = document.createElement('button');
144
+ button.classList.add('mg-c-table__sort-button');
145
+ // Append button to header
146
+ const sortableHeaderContent = sortableHeader.innerHTML;
147
+ sortableHeader.innerHTML = '';
148
+ button.innerHTML = sortableHeaderContent;
149
+ // Set icon
150
+ const icon = document.createElement('mg-icon');
151
+ icon.setAttribute('icon', 'arrows-up-down');
152
+ // Append icon to button
153
+ button.append(icon);
154
+ sortableHeader.append(button);
155
+ // Add event listener
156
+ button.addEventListener('click', () => {
157
+ // Reset aria pressed
158
+ table.querySelectorAll(`thead td:not(:nth-child(${key})) [aria-pressed],thead th:not(:nth-child(${key})) [aria-pressed]`).forEach(ariaPressed => {
159
+ ariaPressed.removeAttribute('aria-pressed');
160
+ ariaPressed.querySelector('mg-icon').setAttribute('icon', 'arrows-up-down');
161
+ });
162
+ // Reset aria sort
163
+ table.querySelectorAll(`thead td:not(:nth-child(${key}))[aria-sort],thead th:not(:nth-child(${key}))[aria-sort]`).forEach(ariaSort => {
164
+ ariaSort.removeAttribute('aria-sort');
165
+ });
166
+ // Set aria pressed
167
+ button.setAttribute('aria-pressed', 'true');
168
+ // Manage sort order
169
+ // Get sort order
170
+ let sortOrder = sortableHeader.getAttribute('aria-sort');
171
+ // First click sort asc
172
+ if ([null, 'none'].includes(sortOrder)) {
173
+ sortableHeader.setAttribute('aria-sort', 'ascending');
174
+ }
175
+ // Second click sort desc
176
+ else if (sortOrder === 'ascending') {
177
+ sortableHeader.setAttribute('aria-sort', 'descending');
178
+ }
179
+ // Third click remove sort
180
+ else {
181
+ sortableHeader.setAttribute('aria-sort', 'none');
182
+ }
183
+ // Update sort order
184
+ sortOrder = sortableHeader.getAttribute('aria-sort');
185
+ // Update button icon
186
+ const icon = button.querySelector('mg-icon');
187
+ let iconType = 'arrows-up-down';
188
+ if (sortOrder === 'ascending') {
189
+ iconType = 'arrow-up';
190
+ }
191
+ else if (sortOrder === 'descending') {
192
+ iconType = 'arrow-down';
193
+ }
194
+ icon.setAttribute('icon', iconType);
195
+ // If sort order is none, return to original order
196
+ if (sortOrder === 'none') {
197
+ // Append rows to table
198
+ rowsDefault.forEach(row => table.querySelector('tbody').append(row));
199
+ return;
200
+ }
201
+ // Set a copy of rows
202
+ const rows = Array.from(table.querySelectorAll('tbody tr'));
203
+ // Sort rows
204
+ rows.sort((a, b) => {
205
+ var _a, _b;
206
+ // Get cells
207
+ const cellA = a.querySelector(`td:nth-child(${key}),th:nth-child(${key})`);
208
+ const cellB = b.querySelector(`td:nth-child(${key}),th:nth-child(${key})`);
209
+ // Get cell values
210
+ const cellValueA = (_a = cellA.dataset.sort) !== null && _a !== void 0 ? _a : cellA.textContent;
211
+ const cellValueB = (_b = cellB.dataset.sort) !== null && _b !== void 0 ? _b : cellB.textContent;
212
+ // Sort cells based on sort order
213
+ return compareValues(cellValueA, cellValueB, sortOrder === 'descending', value.datatype);
214
+ });
215
+ // Append rows to table
216
+ rows.forEach(row => table.querySelector('tbody').append(row));
217
+ });
218
+ }
219
+ });
220
+ }
221
+ // Add alignment to columns
222
+ this.element.shadowRoot.adoptedStyleSheets = [...this.element.shadowRoot.adoptedStyleSheets, this.alignmentStylesheet];
223
+ // Create div wrapper for responsive behavior
224
+ const divWrapper = document.createElement('div');
225
+ divWrapper.setAttribute('class', this.componentWrapperClass);
226
+ divWrapper.setAttribute('tabindex', '0');
227
+ divWrapper.setAttribute('role', 'region');
228
+ // Get table title
229
+ let captionTable = table.querySelector('caption');
230
+ // If table is sortable we must add a caption
231
+ if (captionTable === null && isSortable) {
232
+ captionTable = document.createElement('caption');
233
+ table.prepend(captionTable);
234
+ }
235
+ if (captionTable !== null) {
236
+ // Ensure caption is not visible (otherwhise the table does not have rounded corners)
237
+ captionTable.className = 'mg-u-visually-hidden';
238
+ // Link caption to div
239
+ if (!me(captionTable.id)) {
240
+ captionTable.setAttribute('id', Ge(`${this.componentClass}-caption`));
241
+ }
242
+ divWrapper.setAttribute('aria-labelledby', captionTable.id);
243
+ // Add sortable caption if neeeded
244
+ if (isSortable) {
245
+ captionTable.innerHTML = `${captionTable.innerHTML} ${this.messages.table.sortableCaption}`.trim();
246
+ }
247
+ }
248
+ divWrapper.append(table);
249
+ // Remove existing table from shadow root
250
+ const existingTable = this.element.shadowRoot.querySelector(`.${this.componentWrapperClass}`);
251
+ if (existingTable !== null) {
252
+ existingTable.remove();
253
+ }
254
+ // Append table
255
+ this.element.shadowRoot.append(divWrapper);
256
+ }
257
+ /*************
258
+ * Lifecycle *
259
+ *************/
260
+ componentWillLoad() {
261
+ this.messages = initLocales(this.element).messages;
262
+ }
263
+ /**
264
+ * Set variables and validate props
265
+ */
266
+ componentDidLoad() {
267
+ this.watchSize(this.size);
268
+ this.watchFullWidth(this.fullWidth);
269
+ this.watchColumns(this.columns);
270
+ this.renderTable(this.element.querySelector('table'));
271
+ }
272
+ /**
273
+ * Update table
274
+ */
275
+ componentWillUpdate() {
276
+ this.renderTable(this.element.shadowRoot.querySelector('table'));
277
+ }
278
+ get element() { return this; }
279
+ static get watchers() { return {
280
+ "size": ["watchSize"],
281
+ "fullWidth": ["watchFullWidth"],
282
+ "columns": ["watchColumns"]
283
+ }; }
284
+ static get style() { return MgTableStyle0; }
285
+ }, [1, "mg-table", {
286
+ "size": [1],
287
+ "fullWidth": [4, "full-width"],
288
+ "columns": [16],
289
+ "classCollection": [32]
290
+ }, undefined, {
291
+ "size": ["watchSize"],
292
+ "fullWidth": ["watchFullWidth"],
293
+ "columns": ["watchColumns"]
294
+ }]);
295
+ function defineCustomElement$1() {
296
+ if (typeof customElements === "undefined") {
297
+ return;
298
+ }
299
+ const components = ["mg-table", "mg-icon"];
300
+ components.forEach(tagName => { switch (tagName) {
301
+ case "mg-table":
302
+ if (!customElements.get(tagName)) {
303
+ customElements.define(tagName, MgTable$1);
304
+ }
305
+ break;
306
+ case "mg-icon":
307
+ if (!customElements.get(tagName)) {
308
+ defineCustomElement$2();
309
+ }
310
+ break;
311
+ } });
312
+ }
313
+ defineCustomElement$1();
314
+
315
+ const MgTable = MgTable$1;
316
+ const defineCustomElement = defineCustomElement$1;
317
+
318
+ export { MgTable, defineCustomElement };
319
+
320
+ //# sourceMappingURL=mg-table.js.map
@@ -0,0 +1 @@
1
+ {"file":"mg-table.js","mappings":";;;;;AACA;;;AAGA;AACO,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAGrE;;;AAGA;AACO,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AACnE;AACO,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAU;;ACd/D,MAAM,UAAU,GAAG,gmIAAgmI,CAAC;AACpnI,sBAAe,UAAU;;ACIzB;;;;;AAKA,MAAM,oBAAoB,GAAG,CAAC,QAAqB;AACjD;AACA,OAAO,QAAQ,KAAK,QAAQ;IAC5B,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;;IAExB,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAC5B,CAAC,CAAC,GAAG,EAAE,KAAK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;SACF;QACD,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;;QAGzB,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAC9F,IAAI,aAAa,KAAK,IAAI,EAAE;YAC1B,aAAa,CAAC,MAAM,EAAE,CAAC;SACxB;;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;KAC5C;;;;IAMD,iBAAiB;QACf,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;KACpD;;;;IAKD,gBAAgB;QACd,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;KACvD;;;;IAKD,mBAAmB;QACjB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;KAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["MgTable","ClassList","toString","isValidString","createID"],"sources":["src/components/molecules/mg-table/mg-table.conf.ts","../styles/dist/components/mg-table.css?tag=mg-table&encapsulation=shadow","src/components/molecules/mg-table/mg-table.tsx"],"sourcesContent":["import type { Size } from '../../../types';\n/**\n * Sizes\n */\n// Define possible sizes\nexport const sizes = ['small', 'medium', 'large', 'xlarge'] as const;\n// Define Table size type and ensure it is a valid size\nexport type TableSizeType = Size & (typeof sizes)[number];\n/**\n * Columns\n */\n// Define possible text alignments\nexport const textAlignments = ['left', 'center', 'right'] as const;\n// Define possible data types\nexport const dataTypes = ['string', 'numeric', 'date'] as const;\n// Define possible data types\nexport type datatypesType = (typeof dataTypes)[number];\n// Define columns type\nexport type ColumnsType = {\n [key: number]: { align?: (typeof textAlignments)[number]; sortable?: boolean; datatype?: datatypesType };\n};\n",".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media(prefers-reduced-motion){*{animation:none !important;transition:none !important}}@font-face{font-family:\"Open Sans\";src:url(\"fonts/OpenSans-Regular.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:600;src:url(\"fonts/OpenSans-SemiBold.ttf\") format(\"truetype\")}@font-face{font-family:\"Open Sans\";font-weight:700;src:url(\"fonts/OpenSans-Bold.ttf\") format(\"truetype\")}p{margin:0}p+p{margin-top:var(--mg-b-size-8)}h1,.mg-u-h1{font-family:var(--mg-b-font-family-heading);font-weight:bold}h2,.mg-u-h2{font-family:var(--mg-b-font-family-heading);font-weight:bold}h3,.mg-u-h3{font-family:var(--mg-b-font-family-heading);font-weight:bold}h4,.mg-u-h4{font-family:var(--mg-b-font-family-heading);font-weight:bold}h5,.mg-u-h5{font-family:var(--mg-b-font-family-heading);font-weight:bold}h6,.mg-u-h6{font-family:var(--mg-b-font-family-heading);font-weight:bold}h1,.mg-u-h1{font-size:var(--mg-b-font-size-h1)}h2,.mg-u-h2{font-size:var(--mg-b-font-size-h2)}h3,.mg-u-h3{font-size:var(--mg-b-font-size-h3)}h4,.mg-u-h4{font-size:var(--mg-b-font-size-h4)}h5,.mg-u-h5{font-size:var(--mg-b-font-size-h5)}h6,.mg-u-h6{font-size:var(--mg-b-font-size-h6)}a{color:inherit;text-decoration:underline}a:hover,a:focus,a:active{text-decoration:none}small{font-size:var(--mg-b-small-font-size)}.mg-u-text-left{text-align:left !important}.mg-u-text-center{text-align:center !important}.mg-u-text-right{text-align:right !important}.mg-c-table{--mg-c-table-cell-spacing: var(--mg-b-size-8) var(--mg-b-size-16);--mg-c-table-cell-height: var(--mg-b-size-40);--mg-c-table-header-cell-height: calc(var(--mg-b-size-min-height) + 2 * var(--mg-b-size-8));overflow:hidden;border:none;border-radius:var(--mg-b-size-8);background:var(--mg-b-color-light);border-collapse:separate;border-spacing:0;color:var(--mg-b-color-dark)}.mg-c-table td,.mg-c-table th{height:var(--mg-c-table-cell-height);box-sizing:border-box;padding:var(--mg-c-table-cell-spacing);text-align:start}.mg-c-table thead td,.mg-c-table th{font-weight:600}.mg-c-table thead{height:var(--mg-c-table-header-cell-height);background-color:var(--mg-b-color-app);color:var(--mg-b-color-light)}.mg-c-table :not(thead) tr:nth-child(even){background:color-mix(in srgb, var(--mg-b-color-app), transparent 80%)}.mg-c-table.mg-c-table--size-small{--mg-c-table-cell-spacing: var(--mg-b-size-4) var(--mg-b-size-16);--mg-c-table-cell-height: var(--mg-b-size-32);--mg-c-table-header-cell-height: var(--mg-b-size-32)}.mg-c-table.mg-c-table--size-large{--mg-c-table-cell-height: var(--mg-c-table-header-cell-height)}.mg-c-table.mg-c-table--size-xlarge{--mg-c-table-cell-spacing: var(--mg-b-size-12) var(--mg-b-size-16);--mg-c-table-cell-height: var(--mg-b-size-64);--mg-c-table-header-cell-height: var(--mg-b-size-64)}.mg-c-table.mg-c-table--full-width{width:100%}.mg-c-table-wrapper{overflow:auto}.mg-c-table thead td,.mg-c-table thead th{position:relative}.mg-c-table thead td .mg-c-table__sort-button,.mg-c-table thead th .mg-c-table__sort-button{padding:0;border:none;margin:0;background:none;color:inherit;font-size:inherit;font-weight:600}.mg-c-table thead td .mg-c-table__sort-button::after,.mg-c-table thead th .mg-c-table__sort-button::after{position:absolute;content:\"\";inset:0}.mg-c-table thead td .mg-c-table__sort-button:hover,.mg-c-table thead th .mg-c-table__sort-button:hover{cursor:pointer}.mg-c-table thead td .mg-c-table__sort-button mg-icon,.mg-c-table thead th .mg-c-table__sort-button mg-icon{margin-left:var(--mg-b-size-4)}.mg-c-table thead td:has(.mg-c-table__sort-button):hover,.mg-c-table thead td[aria-sort=descending],.mg-c-table thead td[aria-sort=ascending],.mg-c-table thead th:has(.mg-c-table__sort-button):hover,.mg-c-table thead th[aria-sort=descending],.mg-c-table thead th[aria-sort=ascending]{background-color:color-mix(in srgb, var(--mg-b-color-app), black 10%)}/*# sourceMappingURL=mg-table.css.map */\n","import { Component, Element, State, Prop, Watch } from '@stencil/core';\nimport { ClassList, toString, createID, isValidString } from '@mgdis/stencil-helpers';\nimport { type TableSizeType, type ColumnsType, type datatypesType, textAlignments, dataTypes, sizes } from './mg-table.conf';\nimport { initLocales } from '../../../locales';\n\n/**\n * Check if value is a valid align object\n * @param newValue - New value\n * @returns True if value is a valid align object\n */\nconst isValidColumnsObject = (newValue: ColumnsType): boolean =>\n // ensure newValue is an object\n typeof newValue === 'object' &&\n !Array.isArray(newValue) &&\n // Ensure every property is well formatted\n Object.entries(newValue).every(\n ([key, value]) =>\n // ensure key is a number\n !isNaN(parseInt(key)) &&\n // ensure value is an object\n typeof value === 'object' &&\n !Array.isArray(value) &&\n // ensure value has at least one of the following properties\n ((value.align !== undefined && textAlignments.includes(value.align)) ||\n (value.sortable !== undefined && typeof value.sortable === 'boolean') ||\n (value.datatype !== undefined && dataTypes.includes(value.datatype))) &&\n // ensure no extra properties are present\n Object.keys(value).every(key => ['align', 'sortable', 'datatype'].includes(key)),\n );\n\n/**\n * Compare values\n * @param firstValue - First value\n * @param secondValue - Second value\n * @param descending - Define descending order\n * @param datatype - Data type\n * @returns Comparison result\n * @example\n * compareValues('a', 'b', false, 'string'); // -1\n */\nconst compareValues = (firstValue: string, secondValue: string, descending: boolean, datatype: datatypesType): number => {\n if (descending) {\n const temp = firstValue;\n firstValue = secondValue;\n secondValue = temp;\n }\n if (datatype === 'date') {\n return new Date(firstValue).getTime() - new Date(secondValue).getTime();\n }\n return firstValue.localeCompare(secondValue, undefined, { numeric: datatype === 'numeric' });\n};\n\n/**\n * @slot - Table content\n */\n@Component({\n tag: 'mg-table',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-table.css',\n shadow: true,\n})\nexport class MgTable {\n /************\n * Internal *\n ************/\n\n private messages;\n\n // Classes\n private readonly componentClass = 'mg-c-table';\n private readonly componentWrapperClass = 'mg-c-table-wrapper';\n private readonly classFullWidth = 'mg-c-table--full-width';\n\n // Alignment stylesheet\n private alignmentStylesheet = new CSSStyleSheet();\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgTableElement;\n\n /**\n * Define table size\n */\n @Prop() size: TableSizeType = 'medium';\n @Watch('size')\n watchSize(newValue: MgTable['size'], oldValue?: MgTable['size']): void {\n if (!sizes.includes(newValue)) {\n throw new Error(`<mg-table> prop \"size\" must be one of: ${sizes.join(', ')}. Passed value: ${toString(newValue)}.`);\n } else {\n if (oldValue !== undefined) {\n this.classCollection.delete(`mg-c-table--size-${oldValue}`);\n }\n this.classCollection.add(`mg-c-table--size-${newValue}`);\n }\n }\n\n /**\n * Define if table fits its parent element\n */\n @Prop() fullWidth = false;\n @Watch('fullWidth')\n watchFullWidth(newValue: MgTable['fullWidth']): void {\n if (newValue) {\n this.classCollection.add(this.classFullWidth);\n } else {\n this.classCollection.delete(this.classFullWidth);\n }\n }\n\n /**\n * Define column properties\n */\n @Prop() columns: ColumnsType;\n @Watch('columns')\n watchColumns(newValue: ColumnsType): void {\n if (newValue !== undefined && !isValidColumnsObject(newValue)) {\n throw new Error(`<mg-table> prop \"columns\" must be a ColumnsType object. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Class collection\n */\n @State() classCollection: ClassList = new ClassList([this.componentClass]);\n\n /**\n * Render Table\n * @param table - Table element\n */\n private renderTable(table: HTMLTableElement): void {\n let isSortable = false;\n // Remove table classes\n table.className = '';\n // Add table classes\n table.classList.add(...this.classCollection.classes);\n\n // Set columns based on columns prop\n if (this.columns !== undefined) {\n // Store original rows\n const rowsDefault = Array.from(table.querySelectorAll('tbody tr'));\n\n // Apply columns settings\n Object.entries(this.columns).forEach(([key, value]) => {\n // Add alignment to stylesheet\n if (value.align !== undefined) {\n this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:${value.align}}}`);\n }\n // if align is not defined and datatype is number, align right\n else if (value.datatype === 'numeric') {\n this.alignmentStylesheet.insertRule(`.${this.componentClass}{th:nth-child(${key}),td:nth-child(${key}){text-align:right}}`);\n }\n\n // Define if column is sortable\n if (value.sortable) {\n isSortable = true;\n // Add sortable class to table header\n const sortableHeader = table.querySelector(`thead td:nth-child(${key}),thead th:nth-child(${key})`);\n\n // Create button\n const button = document.createElement('button');\n button.classList.add('mg-c-table__sort-button');\n\n // Append button to header\n const sortableHeaderContent = sortableHeader.innerHTML;\n sortableHeader.innerHTML = '';\n button.innerHTML = sortableHeaderContent;\n\n // Set icon\n const icon = document.createElement('mg-icon');\n icon.setAttribute('icon', 'arrows-up-down');\n\n // Append icon to button\n button.append(icon);\n sortableHeader.append(button);\n\n // Add event listener\n button.addEventListener('click', (): void => {\n // Reset aria pressed\n table.querySelectorAll(`thead td:not(:nth-child(${key})) [aria-pressed],thead th:not(:nth-child(${key})) [aria-pressed]`).forEach(ariaPressed => {\n ariaPressed.removeAttribute('aria-pressed');\n ariaPressed.querySelector('mg-icon').setAttribute('icon', 'arrows-up-down');\n });\n // Reset aria sort\n table.querySelectorAll(`thead td:not(:nth-child(${key}))[aria-sort],thead th:not(:nth-child(${key}))[aria-sort]`).forEach(ariaSort => {\n ariaSort.removeAttribute('aria-sort');\n });\n\n // Set aria pressed\n button.setAttribute('aria-pressed', 'true');\n\n // Manage sort order\n // Get sort order\n let sortOrder = sortableHeader.getAttribute('aria-sort');\n\n // First click sort asc\n if ([null, 'none'].includes(sortOrder)) {\n sortableHeader.setAttribute('aria-sort', 'ascending');\n }\n // Second click sort desc\n else if (sortOrder === 'ascending') {\n sortableHeader.setAttribute('aria-sort', 'descending');\n }\n // Third click remove sort\n else {\n sortableHeader.setAttribute('aria-sort', 'none');\n }\n\n // Update sort order\n sortOrder = sortableHeader.getAttribute('aria-sort');\n\n // Update button icon\n const icon = button.querySelector('mg-icon');\n let iconType = 'arrows-up-down';\n if (sortOrder === 'ascending') {\n iconType = 'arrow-up';\n } else if (sortOrder === 'descending') {\n iconType = 'arrow-down';\n }\n icon.setAttribute('icon', iconType);\n\n // If sort order is none, return to original order\n if (sortOrder === 'none') {\n // Append rows to table\n rowsDefault.forEach(row => table.querySelector('tbody').append(row));\n return;\n }\n\n // Set a copy of rows\n const rows = Array.from(table.querySelectorAll('tbody tr'));\n\n // Sort rows\n rows.sort((a, b) => {\n // Get cells\n const cellA: HTMLTableCellElement = a.querySelector(`td:nth-child(${key}),th:nth-child(${key})`);\n const cellB: HTMLTableCellElement = b.querySelector(`td:nth-child(${key}),th:nth-child(${key})`);\n\n // Get cell values\n const cellValueA = cellA.dataset.sort ?? cellA.textContent;\n const cellValueB = cellB.dataset.sort ?? cellB.textContent;\n\n // Sort cells based on sort order\n return compareValues(cellValueA, cellValueB, sortOrder === 'descending', value.datatype);\n });\n\n // Append rows to table\n rows.forEach(row => table.querySelector('tbody').append(row));\n });\n }\n });\n }\n\n // Add alignment to columns\n this.element.shadowRoot.adoptedStyleSheets = [...this.element.shadowRoot.adoptedStyleSheets, this.alignmentStylesheet];\n\n // Create div wrapper for responsive behavior\n const divWrapper = document.createElement('div');\n divWrapper.setAttribute('class', this.componentWrapperClass);\n divWrapper.setAttribute('tabindex', '0');\n divWrapper.setAttribute('role', 'region');\n\n // Get table title\n let captionTable = table.querySelector('caption');\n\n // If table is sortable we must add a caption\n if (captionTable === null && isSortable) {\n captionTable = document.createElement('caption');\n table.prepend(captionTable);\n }\n\n if (captionTable !== null) {\n // Ensure caption is not visible (otherwhise the table does not have rounded corners)\n captionTable.className = 'mg-u-visually-hidden';\n\n // Link caption to div\n if (!isValidString(captionTable.id)) {\n captionTable.setAttribute('id', createID(`${this.componentClass}-caption`));\n }\n divWrapper.setAttribute('aria-labelledby', captionTable.id);\n\n // Add sortable caption if neeeded\n if (isSortable) {\n captionTable.innerHTML = `${captionTable.innerHTML} ${this.messages.table.sortableCaption}`.trim();\n }\n }\n divWrapper.append(table);\n\n // Remove existing table from shadow root\n const existingTable = this.element.shadowRoot.querySelector(`.${this.componentWrapperClass}`);\n if (existingTable !== null) {\n existingTable.remove();\n }\n // Append table\n this.element.shadowRoot.append(divWrapper);\n }\n\n /*************\n * Lifecycle *\n *************/\n\n componentWillLoad(): void {\n this.messages = initLocales(this.element).messages;\n }\n\n /**\n * Set variables and validate props\n */\n componentDidLoad(): void {\n this.watchSize(this.size);\n this.watchFullWidth(this.fullWidth);\n this.watchColumns(this.columns);\n this.renderTable(this.element.querySelector('table'));\n }\n\n /**\n * Update table\n */\n componentWillUpdate(): void {\n this.renderTable(this.element.shadowRoot.querySelector('table'));\n }\n}\n"],"version":3}
@@ -57,10 +57,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
57
57
  }
58
58
  switch(bundleId) {
59
59
 
60
- case 'mg-action-more_36':
60
+ case 'mg-action-more_37':
61
61
  return import(
62
62
  /* webpackMode: "lazy" */
63
- './mg-action-more_36.entry.js').then(processMod, consoleError);
63
+ './mg-action-more_37.entry.js').then(processMod, consoleError);
64
64
  case 'mg-alert':
65
65
  return import(
66
66
  /* webpackMode: "lazy" */
@@ -1,18 +1,7 @@
1
- import { h as ht } from './index.es-b80b758c.js';
1
+ import { h as ht } from './index.es-517b1bf2.js';
2
2
 
3
3
  const errors$1 = {
4
- required: "This field is required.",
5
- date: {
6
- badInput: "The date is incorrect, the format must be {pattern}",
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} and {max}"
15
- }
4
+ required: "This field is required."
16
5
  };
17
6
  const nbCharLeft$1 = "{counter} characters left.";
18
7
  const input$1 = {
@@ -33,29 +22,54 @@ const input$1 = {
33
22
  sections: {
34
23
  selected: {
35
24
  title: "Selected",
36
- titlePlurial: "Selected",
25
+ titlePlural: "Selected",
37
26
  action: "Unselect all",
38
27
  tooltip: "Unselect all current search results"
39
28
  },
40
29
  notSelected: {
41
30
  title: "Not selected",
42
- titlePlurial: "Not selected",
31
+ titlePlural: "Not selected",
43
32
  action: "Select all",
44
33
  tooltip: "Select all current search results"
45
34
  }
46
35
  }
47
36
  },
48
37
  date: {
49
- helpText: "Expected format: {pattern} (ex: {date})",
50
38
  pattern: {
51
39
  dd: "dd",
52
40
  mm: "mm",
53
41
  yyyy: "yyyy"
42
+ },
43
+ helpText: {
44
+ expectedFormat: "Expected format: {pattern} (ex: {date})",
45
+ min: "The date must be after {min}",
46
+ max: "The date must be before {max}",
47
+ minMax: "The date must be between {min} and {max}"
48
+ },
49
+ error: {
50
+ badInput: "The date is incorrect, the format must be {pattern} (ex: {date})"
51
+ }
52
+ },
53
+ numeric: {
54
+ helpText: {
55
+ min: "The value must be greater than {min}",
56
+ max: "The value must be less than {max}",
57
+ minMax: "The value must be between {min} and {max}"
54
58
  }
55
59
  },
56
60
  password: {
57
61
  display: "Display password value",
58
62
  hide: "Hide password value"
63
+ },
64
+ text: {
65
+ helpText: {
66
+ email: "Expected format: name@example.com",
67
+ emails: "Expected format: first@example.com, second@example.com",
68
+ url: "Expected format: https://example.com"
69
+ },
70
+ errors: {
71
+ typeMismatch: "The value is incorrect."
72
+ }
59
73
  }
60
74
  };
61
75
  const form$1 = {
@@ -102,7 +116,10 @@ const actionMore$1 = {
102
116
  label: "Actions"
103
117
  };
104
118
  const loader$1 = {
105
- inProgess: "Loading in progress…"
119
+ inProgress: "Loading in progress…"
120
+ };
121
+ const table$1 = {
122
+ sortableCaption: "(column headers with buttons are sortable)"
106
123
  };
107
124
  const en = {
108
125
  errors: errors$1,
@@ -118,22 +135,12 @@ const en = {
118
135
  menuItem: menuItem$1,
119
136
  itemMore: itemMore$1,
120
137
  actionMore: actionMore$1,
121
- loader: loader$1
138
+ loader: loader$1,
139
+ table: table$1
122
140
  };
123
141
 
124
142
  const errors = {
125
- required: "Ce champ est obligatoire.",
126
- date: {
127
- badInput: "La date est incorrecte, le format doit être du type {pattern}",
128
- min: "La date ne peut pas être antérieure au {min}",
129
- max: "La date ne peut pas être postérieure au {max}",
130
- minMax: "La date doit être comprise entre le {min} et le {max}"
131
- },
132
- numeric: {
133
- min: "La valeur ne peut pas être inférieure à {min}",
134
- max: "La valeur ne peut pas être supérieure à {max}",
135
- minMax: "La valeur doit être comprise entre {min} et {max}"
136
- }
143
+ required: "Ce champ est obligatoire."
137
144
  };
138
145
  const nbCharLeft = "{counter} caractères disponibles.";
139
146
  const input = {
@@ -141,42 +148,67 @@ const input = {
141
148
  placeholder: "Sélectionnez une valeur"
142
149
  },
143
150
  checkbox: {
144
- selectedValues: "{nb} valeurs selectionnées",
145
- selectedValue: "{nb} valeur selectionnée",
151
+ selectedValues: "{nb} valeurs sélectionnées",
152
+ selectedValue: "{nb} valeur sélectionnée",
146
153
  editButton: "Modifier",
147
154
  selectButton: "Sélectionner des valeurs",
148
155
  showButton: "Voir",
149
156
  label: "Saisissez une valeur",
150
157
  result: "résultat",
151
158
  results: "résultats",
152
- searchResults: "List de résultat(s) de la recherche.",
159
+ searchResults: "Liste de résultat(s) de la recherche.",
153
160
  noResult: "Aucun résultat.",
154
161
  sections: {
155
162
  selected: {
156
163
  title: "Sélectionné",
157
- titlePlurial: "Sélectionnés",
164
+ titlePlural: "Sélectionnés",
158
165
  action: "Tout désélectionner",
159
166
  tooltip: "Désélectionne tous les résultats de la recherche en cours"
160
167
  },
161
168
  notSelected: {
162
169
  title: "Non sélectionné",
163
- titlePlurial: "Non sélectionnés",
170
+ titlePlural: "Non sélectionnés",
164
171
  action: "Tout sélectionner",
165
172
  tooltip: "Sélectionne tous les résultats de la recherche en cours"
166
173
  }
167
174
  }
168
175
  },
169
176
  date: {
170
- helpText: "Format attendu&nbsp;: {pattern} (ex&nbsp;: {date})",
171
177
  pattern: {
172
178
  dd: "jj",
173
179
  mm: "mm",
174
180
  yyyy: "aaaa"
181
+ },
182
+ helpText: {
183
+ expectedFormat: "Format attendu&nbsp;: {pattern} (ex&nbsp;: {date})",
184
+ min: "La date doit être postérieure au {min}",
185
+ max: "La date doit être antérieure au {max}",
186
+ minMax: "La date doit être comprise entre le {min} et le {max}"
187
+ },
188
+ error: {
189
+ badInput: "La date est incorrecte, le format doit être du type {pattern} (ex&nbsp;: {date})"
190
+ }
191
+ },
192
+ numeric: {
193
+ helpText: {
194
+ min: "La valeur doit être supérieure à {min}",
195
+ max: "La valeur doit être inférieure à {max}",
196
+ minMax: "La valeur doit être comprise entre {min} et {max}"
175
197
  }
176
198
  },
177
199
  password: {
178
200
  display: "Afficher le mot de passe",
179
201
  hide: "Masquer le mot de passe"
202
+ },
203
+ text: {
204
+ helpText: {
205
+ email: "Format attendu&nbsp;: nom@exemple.fr",
206
+ emails: "Format attendu&nbsp;: premier@exemple.fr, second@exemple.fr",
207
+ url: "Format attendu&nbsp;: https://exemple.fr"
208
+ },
209
+ errors: {
210
+ typeMismatch: "La valeur est incorrecte."
211
+ }
180
212
  }
181
213
  };
182
214
  const form = {
@@ -223,7 +255,10 @@ const actionMore = {
223
255
  label: "Actions"
224
256
  };
225
257
  const loader = {
226
- inProgess: "Chargement en cours…"
258
+ inProgress: "Chargement en cours…"
259
+ };
260
+ const table = {
261
+ sortableCaption: "(les en-têtes de colonnes avec des boutons peuvent être triés)"
227
262
  };
228
263
  const fr = {
229
264
  errors: errors,
@@ -239,7 +274,8 @@ const fr = {
239
274
  menuItem: menuItem,
240
275
  itemMore: itemMore,
241
276
  actionMore: actionMore,
242
- loader: loader
277
+ loader: loader,
278
+ table: table
243
279
  };
244
280
 
245
281
  const defaultLocale = 'en';
@@ -253,4 +289,4 @@ const initLocales = ht(messages, defaultLocale);
253
289
 
254
290
  export { initLocales as i };
255
291
 
256
- //# sourceMappingURL=index-a58f8b91.js.map
292
+ //# sourceMappingURL=index-544778a7.js.map
@@ -0,0 +1 @@
1
+ {"file":"index-544778a7.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,QAAQ,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAE5B;;;;;MAKa,WAAW,GAAGA,EAAa,CAAC,QAAQ,EAAE,aAAa;;;;","names":["defineLocales"],"sources":["src/locales/index.ts"],"sourcesContent":["import en from './en/messages.json';\nimport fr from './fr/messages.json';\nimport { defineLocales } from '@mgdis/stencil-helpers';\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 = defineLocales(messages, defaultLocale);\n"],"version":3}
@@ -112,7 +112,7 @@ const ft = (e) => {
112
112
  locale: i,
113
113
  messages: t[o] || t[s] || { lang: s }
114
114
  };
115
- }, ut = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), dt = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), gt = (e, t, s = 0) => new Intl.NumberFormat(t, {
115
+ }, ut = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), dt = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(Number(e)), gt = (e, t, s = 0) => new Intl.NumberFormat(t, {
116
116
  style: "percent",
117
117
  minimumFractionDigits: s,
118
118
  maximumFractionDigits: s
@@ -126,4 +126,4 @@ const ft = (e) => {
126
126
 
127
127
  export { $t as $, Ge as G, Je as J, Ke as K, Qe as Q, Ve as V, Xe as X, Ye as Y, Ze as Z, dt as d, et as e, ft as f, gt as g, ht as h, me as m, pt as p, st as s, tt as t, ut as u, we as w, ze as z };
128
128
 
129
- //# sourceMappingURL=index.es-b80b758c.js.map
129
+ //# sourceMappingURL=index.es-517b1bf2.js.map