@eui/tools 6.16.31 → 6.16.32

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.
@@ -1 +1 @@
1
- 6.16.31
1
+ 6.16.32
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.16.32 (2024-07-02)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * add missing locales of Moment.JS - EUI-9579 [EUI-9579](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9579) ([04bc32f7](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/04bc32f7e956271e918e59b75b68ec06fe173618))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.16.31 (2024-07-02)
2
11
 
3
12
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.16.31",
3
+ "version": "6.16.32",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -79,36 +79,39 @@ registerLocaleData(localeFR_LU, localeFRExtra_LU);
79
79
  registerLocaleData(localeFR_CH, localeFRExtra_CH);
80
80
  registerLocaleData(localeFR_BE, localeFRExtra_BE);
81
81
 
82
+ const longDateFormat = {
83
+ /** LTS: Specifies the format for displaying time with seconds. */
84
+ LT: 'HH:mm',
85
+ /** LT: Specifies the format for displaying time without seconds. */
86
+ LTS: 'HH:mm:ss',
87
+ /** L: Specifies the format for displaying the date in short format. */
88
+ L: 'DD/MM/YYYY',
89
+ /** LL: Specifies the format for displaying the date in long format. */
90
+ LL: 'D MMMM YYYY',
91
+ /** LLL: Specifies the format for displaying the date and time. */
92
+ LLL: 'D MMMM YYYY HH:mm',
93
+ /** LLLL: Specifies the format for displaying the full date and time with the day of the week. */
94
+ LLLL: 'dddd, D MMMM YYYY HH:mm',
95
+ }
82
96
 
83
- moment.defineLocale('en-be', {
84
- parentLocale: 'en',
85
- longDateFormat: {
86
- /** LTS: Specifies the format for displaying time with seconds. */
87
- LT: 'HH:mm',
88
- /** LT: Specifies the format for displaying time without seconds. */
89
- LTS: 'HH:mm:ss',
90
- /** L: Specifies the format for displaying the date in short format. */
91
- L: 'DD/MM/YYYY',
92
- /** LL: Specifies the format for displaying the date in long format. */
93
- LL: 'D MMMM YYYY',
94
- /** LLL: Specifies the format for displaying the date and time. */
95
- LLL: 'D MMMM YYYY HH:mm',
96
- /** LLLL: Specifies the format for displaying the full date and time with the day of the week. */
97
- LLLL: 'dddd, D MMMM YYYY HH:mm',
98
- }
99
- });
100
-
101
- moment.defineLocale('en-fr', {
102
- parentLocale: 'en',
103
- longDateFormat: {
104
- LT: 'HH:mm',
105
- LTS: 'HH:mm:ss',
106
- L: 'DD/MM/YYYY',
107
- LL: 'D MMMM YYYY',
108
- LLL: 'D MMMM YYYY HH:mm',
109
- LLLL: 'dddd, D MMMM YYYY HH:mm'
110
- }
111
- });
97
+ moment.defineLocale('en-at', { parentLocale: 'en', longDateFormat });
98
+ moment.defineLocale('en-be', { parentLocale: 'en', longDateFormat });
99
+ moment.defineLocale('en-ch', { parentLocale: 'en', longDateFormat });
100
+ moment.defineLocale('en-cy', { parentLocale: 'en', longDateFormat });
101
+ moment.defineLocale('en-de', { parentLocale: 'en', longDateFormat });
102
+ moment.defineLocale('en-dk', { parentLocale: 'en', longDateFormat });
103
+ moment.defineLocale('en-fi', { parentLocale: 'en', longDateFormat });
104
+ moment.defineLocale('en-gg', { parentLocale: 'en', longDateFormat });
105
+ moment.defineLocale('en-gi', { parentLocale: 'en', longDateFormat });
106
+ moment.defineLocale('en-im', { parentLocale: 'en', longDateFormat });
107
+ moment.defineLocale('en-je', { parentLocale: 'en', longDateFormat });
108
+ moment.defineLocale('en-mt', { parentLocale: 'en', longDateFormat });
109
+ moment.defineLocale('en-nl', { parentLocale: 'en', longDateFormat });
110
+ moment.defineLocale('en-se', { parentLocale: 'en', longDateFormat });
111
+ moment.defineLocale('en-si', { parentLocale: 'en', longDateFormat });
112
+ moment.defineLocale('fr-be', { parentLocale: 'fr', longDateFormat });
113
+ moment.defineLocale('fr-lu', { parentLocale: 'fr', longDateFormat });
114
+ moment.defineLocale('fr-mc', { parentLocale: 'fr', longDateFormat });
112
115
 
113
116
  /**
114
117
  * Internationalization Configuration
@@ -0,0 +1,154 @@
1
+ import { registerLocaleData } from '@angular/common';
2
+
3
+ // import and register locale manually
4
+ import localeEn from '@angular/common/locales/en';
5
+ import localeEN_150 from '@angular/common/locales/en-150';
6
+ import localeEN_AT from '@angular/common/locales/en-AT';
7
+ import localeEN_BE from '@angular/common/locales/en-BE';
8
+ import localeEN_CH from '@angular/common/locales/en-CH';
9
+ import localeEN_CY from '@angular/common/locales/en-CY';
10
+ import localeEN_DE from '@angular/common/locales/en-DE';
11
+ import localeEN_DK from '@angular/common/locales/en-DK';
12
+ import localeEN_FI from '@angular/common/locales/en-FI';
13
+ import localeEN_GG from '@angular/common/locales/en-GG';
14
+ import localeEN_GI from '@angular/common/locales/en-GI';
15
+ import localeEN_IE from '@angular/common/locales/en-IE';
16
+ import localeEN_IM from '@angular/common/locales/en-IM';
17
+ import localeEN_JE from '@angular/common/locales/en-JE';
18
+ import localeEN_MT from '@angular/common/locales/en-MT';
19
+ import localeEN_NL from '@angular/common/locales/en-NL';
20
+ import localeEN_SE from '@angular/common/locales/en-SE';
21
+ import localeEN_SI from '@angular/common/locales/en-SI';
22
+ import localeEnExtra from '@angular/common/locales/extra/en';
23
+ import localeEnExtra_150 from '@angular/common/locales/extra/en-150';
24
+ import localeEnExtra_AT from '@angular/common/locales/extra/en-AT';
25
+ import localeEnExtra_BE from '@angular/common/locales/extra/en-BE';
26
+ import localeEnExtra_CH from '@angular/common/locales/extra/en-CH';
27
+ import localeEnExtra_CY from '@angular/common/locales/extra/en-CY';
28
+ import localeEnExtra_DE from '@angular/common/locales/extra/en-DE';
29
+ import localeEnExtra_DK from '@angular/common/locales/extra/en-DK';
30
+ import localeEnExtra_FI from '@angular/common/locales/extra/en-FI';
31
+ import localeEnExtra_GG from '@angular/common/locales/extra/en-GG';
32
+ import localeEnExtra_GI from '@angular/common/locales/extra/en-GI';
33
+ import localeEnExtra_IE from '@angular/common/locales/extra/en-IE';
34
+ import localeEnExtra_IM from '@angular/common/locales/extra/en-IM';
35
+ import localeEnExtra_JE from '@angular/common/locales/extra/en-JE';
36
+ import localeEnExtra_MT from '@angular/common/locales/extra/en-MT';
37
+ import localeEnExtra_NL from '@angular/common/locales/extra/en-NL';
38
+ import localeEnExtra_SE from '@angular/common/locales/extra/en-SE';
39
+ import localeEnExtra_SI from '@angular/common/locales/extra/en-SI';
40
+ import localeFr from '@angular/common/locales/fr';
41
+ import localeFR_MC from '@angular/common/locales/fr-MC';
42
+ import localeFR_LU from '@angular/common/locales/fr-LU';
43
+ import localeFR_CH from '@angular/common/locales/fr-CH';
44
+ import localeFR_BE from '@angular/common/locales/fr-BE';
45
+ import localeFRExtra_BE from '@angular/common/locales/extra/fr-BE';
46
+ import localeFRExtra_CH from '@angular/common/locales/extra/fr-CH';
47
+ import localeFRExtra_LU from '@angular/common/locales/extra/fr-LU';
48
+ import localeFRExtra_MC from '@angular/common/locales/extra/fr-MC';
49
+ import localeFrExtra from '@angular/common/locales/extra/fr';
50
+
51
+ import { GlobalConfig, I18nConfig, LocaleServiceConfig } from '@eui/core';
52
+
53
+ import * as moment from 'moment';
54
+
55
+ /**
56
+ * import and register locales (currently MWP uses only French and English)
57
+ */
58
+ registerLocaleData(localeEn, 'en', localeEnExtra);
59
+ registerLocaleData(localeFr, 'fr', localeFrExtra);
60
+ registerLocaleData(localeEN_150, localeEnExtra_150);
61
+ registerLocaleData(localeEN_AT, localeEnExtra_AT);
62
+ registerLocaleData(localeEN_BE, localeEnExtra_BE);
63
+ registerLocaleData(localeEN_CH, localeEnExtra_CH);
64
+ registerLocaleData(localeEN_CY, localeEnExtra_CY);
65
+ registerLocaleData(localeEN_DE, localeEnExtra_DE);
66
+ registerLocaleData(localeEN_DK, localeEnExtra_DK);
67
+ registerLocaleData(localeEN_FI, localeEnExtra_FI);
68
+ registerLocaleData(localeEN_GG, localeEnExtra_GG);
69
+ registerLocaleData(localeEN_GI, localeEnExtra_GI);
70
+ registerLocaleData(localeEN_IE, localeEnExtra_IE);
71
+ registerLocaleData(localeEN_IM, localeEnExtra_IM);
72
+ registerLocaleData(localeEN_JE, localeEnExtra_JE);
73
+ registerLocaleData(localeEN_MT, localeEnExtra_MT);
74
+ registerLocaleData(localeEN_NL, localeEnExtra_NL);
75
+ registerLocaleData(localeEN_SE, localeEnExtra_SE);
76
+ registerLocaleData(localeEN_SI, localeEnExtra_SI);
77
+ registerLocaleData(localeFR_MC, localeFRExtra_MC);
78
+ registerLocaleData(localeFR_LU, localeFRExtra_LU);
79
+ registerLocaleData(localeFR_CH, localeFRExtra_CH);
80
+ registerLocaleData(localeFR_BE, localeFRExtra_BE);
81
+
82
+ const longDateFormat = {
83
+ /** LTS: Specifies the format for displaying time with seconds. */
84
+ LT: 'HH:mm',
85
+ /** LT: Specifies the format for displaying time without seconds. */
86
+ LTS: 'HH:mm:ss',
87
+ /** L: Specifies the format for displaying the date in short format. */
88
+ L: 'DD/MM/YYYY',
89
+ /** LL: Specifies the format for displaying the date in long format. */
90
+ LL: 'D MMMM YYYY',
91
+ /** LLL: Specifies the format for displaying the date and time. */
92
+ LLL: 'D MMMM YYYY HH:mm',
93
+ /** LLLL: Specifies the format for displaying the full date and time with the day of the week. */
94
+ LLLL: 'dddd, D MMMM YYYY HH:mm',
95
+ }
96
+
97
+ moment.defineLocale('en-at', { parentLocale: 'en', longDateFormat });
98
+ moment.defineLocale('en-be', { parentLocale: 'en', longDateFormat });
99
+ moment.defineLocale('en-ch', { parentLocale: 'en', longDateFormat });
100
+ moment.defineLocale('en-cy', { parentLocale: 'en', longDateFormat });
101
+ moment.defineLocale('en-de', { parentLocale: 'en', longDateFormat });
102
+ moment.defineLocale('en-dk', { parentLocale: 'en', longDateFormat });
103
+ moment.defineLocale('en-fi', { parentLocale: 'en', longDateFormat });
104
+ moment.defineLocale('en-gg', { parentLocale: 'en', longDateFormat });
105
+ moment.defineLocale('en-gi', { parentLocale: 'en', longDateFormat });
106
+ moment.defineLocale('en-im', { parentLocale: 'en', longDateFormat });
107
+ moment.defineLocale('en-je', { parentLocale: 'en', longDateFormat });
108
+ moment.defineLocale('en-mt', { parentLocale: 'en', longDateFormat });
109
+ moment.defineLocale('en-nl', { parentLocale: 'en', longDateFormat });
110
+ moment.defineLocale('en-se', { parentLocale: 'en', longDateFormat });
111
+ moment.defineLocale('en-si', { parentLocale: 'en', longDateFormat });
112
+ moment.defineLocale('fr-be', { parentLocale: 'fr', longDateFormat });
113
+ moment.defineLocale('fr-lu', { parentLocale: 'fr', longDateFormat });
114
+ moment.defineLocale('fr-mc', { parentLocale: 'fr', longDateFormat });
115
+
116
+ /**
117
+ * Internationalization Configuration
118
+ */
119
+ const i18nConfig: I18nConfig = {
120
+ i18nLoader: {
121
+ i18nFolders: ['elements/@remote.name@/bundles/assets/i18n-compiled'],
122
+ },
123
+ i18nService: {
124
+ languages: ['en', 'fr'],
125
+ defaultLanguage: 'en',
126
+ },
127
+ };
128
+
129
+ /**
130
+ * Locale Configuration
131
+ */
132
+ const localeConfig: LocaleServiceConfig = {
133
+ id: 'en',
134
+ available: ['en', 'fr'],
135
+ bindWithTranslate: true,
136
+ affectGlobalLocale: true,
137
+ };
138
+
139
+ /**
140
+ * Global Configuration
141
+ */
142
+ export const GLOBAL: GlobalConfig = {
143
+ /* URL that needs to be used in the appRouting of the MWP */
144
+ baseUrl: '@base.url@',
145
+ /* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
146
+ elementName: '@element.name@',
147
+ /* in case you are using NgRx give it a unique name (mostly for debugging) */
148
+ storeName: '@store.name@',
149
+ i18n: i18nConfig,
150
+ locale: localeConfig,
151
+ eui: {
152
+ assetsBaseUrl: 'assets/elements/@remote.name@/bundles/assets',
153
+ },
154
+ };