@eui/tools 6.21.29 → 6.21.31

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 (41) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +18 -0
  3. package/package.json +1 -1
  4. package/scripts/csdr/init/remotes/19.x/base/angular.esbuild.json +73 -0
  5. package/scripts/csdr/init/remotes/19.x/base/angular.json +86 -0
  6. package/scripts/csdr/init/remotes/19.x/base/browserslist +6 -0
  7. package/scripts/csdr/init/remotes/19.x/base/package.json_TO_REPLACE +18 -0
  8. package/scripts/csdr/init/remotes/19.x/base/tsconfig.app.json +37 -0
  9. package/scripts/csdr/init/remotes/19.x/base/tsconfig.app.standalone.json +28 -0
  10. package/scripts/csdr/init/remotes/19.x/base/yarn.lock.old +14275 -0
  11. package/scripts/csdr/init/remotes/19.x/base/yarn.lock.old-2 +15691 -0
  12. package/scripts/csdr/init/remotes/19.x/full/common/app/eui-components.ts +9 -0
  13. package/scripts/csdr/init/remotes/19.x/full/common/app/fallback.component.ts +12 -0
  14. package/scripts/csdr/init/remotes/19.x/full/common/app/module.component.ts +91 -0
  15. package/scripts/csdr/init/remotes/19.x/full/common/app/module.ts +96 -0
  16. package/scripts/csdr/init/remotes/19.x/full/common/app/reducers/custom-route-serializer.ts +28 -0
  17. package/scripts/csdr/init/remotes/19.x/full/common/app/reducers/index.ts +51 -0
  18. package/scripts/csdr/init/remotes/19.x/full/common/app/routing.module.ts +29 -0
  19. package/scripts/csdr/init/remotes/19.x/full/common/assets/.gitkeep +0 -0
  20. package/scripts/csdr/init/remotes/19.x/full/common/config/global.ts +118 -0
  21. package/scripts/csdr/init/remotes/19.x/full/common/config/index.ts +10 -0
  22. package/scripts/csdr/init/remotes/19.x/full/common/config/modules.ts +3 -0
  23. package/scripts/csdr/init/remotes/19.x/full/common/environments/environment.prod.ts +3 -0
  24. package/scripts/csdr/init/remotes/19.x/full/common/environments/environment.ts +3 -0
  25. package/scripts/csdr/init/remotes/19.x/full/common/favicon.ico +0 -0
  26. package/scripts/csdr/init/remotes/19.x/full/common/index.html +10 -0
  27. package/scripts/csdr/init/remotes/19.x/full/common/main.ts +12 -0
  28. package/scripts/csdr/init/remotes/19.x/full/common/polyfills.ts +88 -0
  29. package/scripts/csdr/init/remotes/19.x/full/options/ag-grid/main.ts +17 -0
  30. package/scripts/csdr/init/remotes/19.x/full/options/all-locales/config/global.ts +122 -0
  31. package/scripts/csdr/init/remotes/19.x/full/options/definitions/dynamic-forms.json +4 -0
  32. package/scripts/csdr/init/remotes/19.x/full/options/definitions/dynatrace.json +4 -0
  33. package/scripts/csdr/init/remotes/19.x/full/options/definitions/participant.json +3 -0
  34. package/scripts/csdr/init/remotes/19.x/full/options/definitions/user-reducers.json +3 -0
  35. package/scripts/csdr/init/remotes/19.x/full/options/definitions/zipkin.json +5 -0
  36. package/scripts/csdr/init/remotes/19.x/full/options/extra-locales/config/global.ts +215 -0
  37. package/scripts/csdr/init/remotes/19.x/full/options/participant/app/module.component.ts +94 -0
  38. package/scripts/csdr/init/remotes/19.x/full/options/participant/app/routing.module.ts +21 -0
  39. package/scripts/csdr/init/remotes/19.x/full/options/participant/config/index.ts +10 -0
  40. package/scripts/csdr/init/remotes/19.x/full/options/user-reducers/app/reducers/index.ts +75 -0
  41. package/scripts/utils/build/package/element.js +5 -1
@@ -0,0 +1,122 @@
1
+ import { registerLocaleData } from '@angular/common';
2
+ import { GlobalConfig, I18nConfig, LocaleServiceConfig } from '@eui/core';
3
+
4
+ import localeBg from '@angular/common/locales/bg';
5
+ import localeBgExtra from '@angular/common/locales/extra/bg';
6
+ import localeEs from '@angular/common/locales/es';
7
+ import localeEsExtra from '@angular/common/locales/extra/es';
8
+ import localeCs from '@angular/common/locales/cs';
9
+ import localeCsExtra from '@angular/common/locales/extra/cs';
10
+ import localeDa from '@angular/common/locales/da';
11
+ import localeDaExtra from '@angular/common/locales/extra/da';
12
+ import localeDe from '@angular/common/locales/de';
13
+ import localeDeExtra from '@angular/common/locales/extra/de';
14
+ import localeEt from '@angular/common/locales/et';
15
+ import localeEtExtra from '@angular/common/locales/extra/et';
16
+ import localeEl from '@angular/common/locales/el';
17
+ import localeElExtra from '@angular/common/locales/extra/el';
18
+ import localeEn from '@angular/common/locales/en';
19
+ import localeEnExtra from '@angular/common/locales/extra/en';
20
+ import localeFr from '@angular/common/locales/fr';
21
+ import localeFrExtra from '@angular/common/locales/extra/fr';
22
+ import localeGa from '@angular/common/locales/ga';
23
+ import localeGaExtra from '@angular/common/locales/extra/ga';
24
+ import localeHr from '@angular/common/locales/hr';
25
+ import localeHrExtra from '@angular/common/locales/extra/hr';
26
+ import localeIt from '@angular/common/locales/it';
27
+ import localeItExtra from '@angular/common/locales/extra/it';
28
+ import localeLv from '@angular/common/locales/lv';
29
+ import localeLvExtra from '@angular/common/locales/extra/lv';
30
+ import localeLt from '@angular/common/locales/lt';
31
+ import localeLtExtra from '@angular/common/locales/extra/lt';
32
+ import localeHu from '@angular/common/locales/hu';
33
+ import localeHuExtra from '@angular/common/locales/extra/hu';
34
+ import localeMt from '@angular/common/locales/mt';
35
+ import localeMtExtra from '@angular/common/locales/extra/mt';
36
+ import localeNl from '@angular/common/locales/nl';
37
+ import localeNlExtra from '@angular/common/locales/extra/nl';
38
+ import localePl from '@angular/common/locales/pl';
39
+ import localePlExtra from '@angular/common/locales/extra/pl';
40
+ import localePt from '@angular/common/locales/pt';
41
+ import localePtExtra from '@angular/common/locales/extra/pt';
42
+ import localeRo from '@angular/common/locales/ro';
43
+ import localeRoExtra from '@angular/common/locales/extra/ro';
44
+ import localeSk from '@angular/common/locales/sk';
45
+ import localeSkExtra from '@angular/common/locales/extra/sk';
46
+ import localeSl from '@angular/common/locales/sl';
47
+ import localeSlExtra from '@angular/common/locales/extra/sl';
48
+ import localeFi from '@angular/common/locales/fi';
49
+ import localeFiExtra from '@angular/common/locales/extra/fi';
50
+ import localeSv from '@angular/common/locales/sv';
51
+ import localeSvExtra from '@angular/common/locales/extra/sv';
52
+
53
+ /**
54
+ * import and register locales (currently MWP uses only French and English)
55
+ */
56
+ registerLocaleData(localeBg, 'bg', localeBgExtra);
57
+ registerLocaleData(localeEs, 'es', localeEsExtra);
58
+ registerLocaleData(localeCs, 'cs', localeCsExtra);
59
+ registerLocaleData(localeDa, 'da', localeDaExtra);
60
+ registerLocaleData(localeDe, 'de', localeDeExtra);
61
+ registerLocaleData(localeEt, 'et', localeEtExtra);
62
+ registerLocaleData(localeEl, 'el', localeElExtra);
63
+ registerLocaleData(localeEn, 'en', localeEnExtra);
64
+ registerLocaleData(localeFr, 'fr', localeFrExtra);
65
+ registerLocaleData(localeGa, 'ga', localeGaExtra);
66
+ registerLocaleData(localeHr, 'hr', localeHrExtra);
67
+ registerLocaleData(localeIt, 'it', localeItExtra);
68
+ registerLocaleData(localeLv, 'lv', localeLvExtra);
69
+ registerLocaleData(localeLt, 'lt', localeLtExtra);
70
+ registerLocaleData(localeHu, 'hu', localeHuExtra);
71
+ registerLocaleData(localeMt, 'mt', localeMtExtra);
72
+ registerLocaleData(localeNl, 'nl', localeNlExtra);
73
+ registerLocaleData(localePl, 'pl', localePlExtra);
74
+ registerLocaleData(localePt, 'pt', localePtExtra);
75
+ registerLocaleData(localeRo, 'ro', localeRoExtra);
76
+ registerLocaleData(localeSk, 'sk', localeSkExtra);
77
+ registerLocaleData(localeSl, 'sl', localeSlExtra);
78
+ registerLocaleData(localeFi, 'fi', localeFiExtra);
79
+ registerLocaleData(localeSv, 'sv', localeSvExtra);
80
+
81
+ const languages = ['bg', 'es', 'cs', 'da', 'de', 'et', 'el', 'en', 'fr', 'ga', 'hr', 'it', 'lv', 'lt', 'hu', 'mt', 'nl', 'pl',
82
+ 'pt', 'ro', 'sk', 'sl', 'fi', 'sv'];
83
+
84
+ /**
85
+ * Internationalization Configuration
86
+ */
87
+ const i18nConfig: I18nConfig = {
88
+ i18nLoader: {
89
+ i18nFolders: ['elements/@remote.name@/bundles/assets/i18n-compiled'],
90
+ },
91
+ i18nService: {
92
+ languages: languages,
93
+ defaultLanguage: 'en',
94
+ },
95
+ };
96
+
97
+ /**
98
+ * Locale Configuration
99
+ */
100
+ const localeConfig: LocaleServiceConfig = {
101
+ id: 'en',
102
+ available: languages,
103
+ bindWithTranslate: true,
104
+ affectGlobalLocale: true,
105
+ };
106
+
107
+ /**
108
+ * Global Configuration
109
+ */
110
+ export const GLOBAL: GlobalConfig = {
111
+ /* URL that needs to be used in the appRouting of the MWP */
112
+ baseUrl: '@base.url@',
113
+ /* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
114
+ elementName: '@element.name@',
115
+ /* in case you are using NgRx give it a unique name (mostly for debugging) */
116
+ storeName: '@store.name@',
117
+ i18n: i18nConfig,
118
+ locale: localeConfig,
119
+ eui: {
120
+ assetsBaseUrl: 'assets/elements/@remote.name@/bundles/assets',
121
+ },
122
+ };
@@ -0,0 +1,4 @@
1
+ {
2
+ "imports": "import { DynamicFormsModule } from '@eui/dynamic-forms'; import { dynMapConfig } from '@root.npm.pkg@'; ",
3
+ "definitions": "DynamicFormsModule.forRoot(dynMapConfig)"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "declarations": "declare const window: { dT_: { initAngularNg?: any } | undefined };",
3
+ "constructorDeclarations": "if (window?.dT_?.initAngularNg) { window.dT_.initAngularNg(http, HttpHeaders); }"
4
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "providers": "...CONTAINER_MAPPED_PROVIDERS"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "providers": "{ provide: USER_PROVIDED_META_REDUCERS, deps: [CONFIG_TOKEN, ElementStorageService], useFactory: metaReducers }"
3
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "imports": "import { getZipkinConfig, TRACE_MODULE_CONFIGURATION, ZipkinModule } from '@csdr/zipkin-tracing';",
3
+ "definitions": "ZipkinModule.forRoot()",
4
+ "providers": "{ provide: TRACE_MODULE_CONFIGURATION, useFactory: getZipkinConfig, deps: [CONFIG_TOKEN] }"
5
+ }
@@ -0,0 +1,215 @@
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
+ /**
83
+ * Within the MyWP environment, the 'L' and 'l' date formats have been modified to align with each other
84
+ * and to adhere to the CLDR-based date formats utilized by Angular.
85
+ * For instance, the 'shortDate' format now corresponds to 'DD/MM/YY' instead of the default
86
+ * Moment.js format of 'DD/MM/YYYY'.
87
+ */
88
+ const longDateFormat = {
89
+ /** LTS: Specifies the format for displaying time with seconds. */
90
+ LT: 'HH:mm',
91
+ /** LT: Specifies the format for displaying time without seconds. */
92
+ LTS: 'HH:mm:ss',
93
+ /**
94
+ * This format typically produces a localized short date format that is more complete,
95
+ * often including the full month name and day of the month without any abbreviations.
96
+ * e.g. moment().format('L'); // Output: 09/03/2024
97
+ */
98
+ /** L: Specifies the format for displaying the date in short format. */
99
+ L: 'DD/MM/YY',
100
+ /** LL: Specifies the format for displaying the date in long format. */
101
+ LL: 'D MMMM YYYY',
102
+ /** LLL: Specifies the format for displaying the date and time. */
103
+ LLL: 'D MMMM YYYY HH:mm',
104
+ /** LLLL: Specifies the format for displaying the full date and time with the day of the week. */
105
+ LLLL: 'dddd, D MMMM YYYY HH:mm',
106
+ /**
107
+ * This format usually renders a localized short date format that is even shorter,
108
+ * potentially using abbreviations for the month and/or day of the month.
109
+ * e.g. moment().format('l'); // Output: 9/3/2024
110
+ */
111
+ /** l: Specifies the format for displaying the date in short format. */
112
+ l: 'DD/MM/YY',
113
+ /** ll: Specifies the format for displaying the date in long format. */
114
+ ll: 'D MMMM YYYY',
115
+ /** lll: Specifies the format for displaying the date and time. */
116
+ lll: 'D MMMM YYYY HH:mm',
117
+ /** llll: Specifies the format for displaying the full date and time with the day of the week. */
118
+ llll: 'dddd, D MMMM YYYY HH:mm',
119
+ }
120
+
121
+ const longDateFormat_Common = {
122
+ LT: 'HH:mm',
123
+ LTS: 'HH:mm:ss',
124
+ L: 'DD/MM/YYYY',
125
+ LL: 'D MMMM YYYY',
126
+ LLL: 'D MMMM YYYY HH:mm',
127
+ LLLL: 'dddd, D MMMM YYYY HH:mm',
128
+ l: 'DD/MM/YYYY',
129
+ ll: 'D MMMM YYYY',
130
+ lll: 'D MMMM YYYY HH:mm',
131
+ llll: 'dddd, D MMMM YYYY HH:mm',
132
+ }
133
+
134
+ moment.defineLocale('en-at', { parentLocale: 'en', longDateFormat_Common });
135
+ moment.defineLocale('en-be', { parentLocale: 'en', longDateFormat });
136
+ moment.defineLocale('en-ch', { parentLocale: 'en', longDateFormat_Common });
137
+ moment.defineLocale('en-cy', { parentLocale: 'en', longDateFormat_Common });
138
+ moment.defineLocale('en-de', { parentLocale: 'en', longDateFormat_Common });
139
+ moment.defineLocale('en-dk', { parentLocale: 'en', longDateFormat_Common });
140
+ moment.defineLocale('en-fi', { parentLocale: 'en', longDateFormat_Common });
141
+ moment.defineLocale('en-gg', { parentLocale: 'en', longDateFormat_Common });
142
+ moment.defineLocale('en-gi', { parentLocale: 'en', longDateFormat_Common });
143
+ moment.defineLocale('en-im', { parentLocale: 'en', longDateFormat_Common });
144
+ moment.defineLocale('en-je', { parentLocale: 'en', longDateFormat_Common });
145
+ moment.defineLocale('en-mt', { parentLocale: 'en', longDateFormat_Common });
146
+ moment.defineLocale('en-nl', { parentLocale: 'en', longDateFormat_Common });
147
+ moment.defineLocale('en-se', {
148
+ parentLocale: 'en',
149
+ longDateFormat: {
150
+ /** LTS: Specifies the format for displaying time with seconds. */
151
+ LT: 'HH:mm',
152
+ /** LT: Specifies the format for displaying time without seconds. */
153
+ LTS: 'HH:mm:ss',
154
+ /** L: Specifies the format for displaying the date in short format. */
155
+ L: 'Y-MM-DD',
156
+ /** LL: Specifies the format for displaying the date in long format. */
157
+ LL: 'D MMMM YYYY',
158
+ /** LLL: Specifies the format for displaying the date and time. */
159
+ LLL: 'D MMMM YYYY HH:mm',
160
+ /** LLLL: Specifies the format for displaying the full date and time with the day of the week. */
161
+ LLLL: 'dddd, D MMMM YYYY HH:mm',
162
+ /** l: Specifies the format for displaying the date in short format. */
163
+ l: 'Y-MM-DD',
164
+ /** ll: Specifies the format for displaying the date in long format. */
165
+ ll: 'D MMMM YYYY',
166
+ /** lll: Specifies the format for displaying the date and time. */
167
+ lll: 'D MMMM YYYY HH:mm',
168
+ /** llll: Specifies the format for displaying the full date and time with the day of the week. */
169
+ llll: 'dddd, D MMMM YYYY HH:mm',
170
+ }
171
+ });
172
+ moment.defineLocale('en-si', { parentLocale: 'en', longDateFormat_Common });
173
+ moment.defineLocale('fr-be', { parentLocale: 'fr', longDateFormat });
174
+ moment.defineLocale('fr-lu', { parentLocale: 'fr', longDateFormat });
175
+ moment.defineLocale('fr-mc', { parentLocale: 'fr', longDateFormat });
176
+
177
+ /**
178
+ * Internationalization Configuration
179
+ */
180
+ const i18nConfig: I18nConfig = {
181
+ i18nLoader: {
182
+ i18nFolders: ['elements/@remote.name@/bundles/assets/i18n-compiled'],
183
+ },
184
+ i18nService: {
185
+ languages: ['en', 'fr'],
186
+ defaultLanguage: 'en',
187
+ },
188
+ };
189
+
190
+ /**
191
+ * Locale Configuration
192
+ */
193
+ const localeConfig: LocaleServiceConfig = {
194
+ id: 'en',
195
+ available: ['en', 'fr'],
196
+ bindWithTranslate: true,
197
+ affectGlobalLocale: true,
198
+ };
199
+
200
+ /**
201
+ * Global Configuration
202
+ */
203
+ export const GLOBAL: GlobalConfig = {
204
+ /* URL that needs to be used in the appRouting of the MWP */
205
+ baseUrl: '@base.url@',
206
+ /* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
207
+ elementName: '@element.name@',
208
+ /* in case you are using NgRx give it a unique name (mostly for debugging) */
209
+ storeName: '@store.name@',
210
+ i18n: i18nConfig,
211
+ locale: localeConfig,
212
+ eui: {
213
+ assetsBaseUrl: 'assets/elements/@remote.name@/bundles/assets',
214
+ },
215
+ };
@@ -0,0 +1,94 @@
1
+ import { ChangeDetectionStrategy, Component, ElementRef, inject, OnDestroy, OnInit, signal } from '@angular/core';
2
+
3
+ import { Subscription } from 'rxjs';
4
+ import { first } from 'rxjs/operators';
5
+
6
+ import { CONFIG_TOKEN } from '@eui/core';
7
+ import { ElementLifeCycleService, ElementSetupService } from '@csdr/integration/element';
8
+
9
+ type StatusType = 'Loading' | 'Loaded' | 'Failed';
10
+
11
+ @Component({
12
+ changeDetection: ChangeDetectionStrategy.OnPush,
13
+ template: `
14
+ @if (status() === 'Loaded') {
15
+ <!-- BLOCK_CONTAINER_PLACEHOLDER -->
16
+ }
17
+ @if (status() === 'Loading') {
18
+ <eui-block-content [isBlocked]="true">
19
+ <div style="height: 100%"></div>
20
+ </eui-block-content>
21
+ }
22
+ @if (status() === 'Failed') {
23
+ <div class="error-container">
24
+ <div>
25
+ <h1>Translations or user data for this module failed to load.</h1>
26
+ <p>Do you want to try again?</p>
27
+ <button euiButton euiPrimary (click)="loadData()">
28
+ <span euiLabel>{{ 'global.RELOAD' | translate }}</span>
29
+ </button>
30
+ </div>
31
+ </div>
32
+ }`,
33
+ styles: [`
34
+ .error-container {
35
+ width: 50vw;
36
+ height: 50vh;
37
+ position: absolute;
38
+ top: 50%;
39
+ left: 50%;
40
+ transform: translate(-50%, -50%);
41
+ }
42
+
43
+ .error-container div {
44
+ text-align: center
45
+ }
46
+ `],
47
+ standalone: false,
48
+ })
49
+ export class ModuleComponent implements OnInit, OnDestroy {
50
+ status = signal<StatusType | undefined>(undefined);
51
+
52
+ block: any;
53
+
54
+ private initSubscription: Subscription | undefined = undefined;
55
+
56
+ private elRef = inject(ElementRef);
57
+ private config = inject(CONFIG_TOKEN);
58
+ private elementLifeCycleService = inject(ElementLifeCycleService);
59
+ private elementSetupService = inject(ElementSetupService);
60
+
61
+ ngOnInit() {
62
+ this.block = this.elRef.nativeElement.block;
63
+ const elementData = this.elementLifeCycleService.getElementData(this.elRef);
64
+ this.elementLifeCycleService.setup(elementData);
65
+ this.loadData();
66
+ }
67
+
68
+ ngOnDestroy(): void {
69
+ this.initSubscription?.unsubscribe();
70
+ this.elementLifeCycleService.cleanup();
71
+ }
72
+
73
+ loadData() {
74
+ this.status.set('Loading');
75
+ try {
76
+ this.initSubscription?.unsubscribe();
77
+
78
+ this.initSubscription = this.elementSetupService
79
+ .init()
80
+ .pipe(first())
81
+ .subscribe((loadStatus: { success: boolean, error?: string }) => {
82
+ if (!loadStatus.success) {
83
+ this.status.set('Failed');
84
+ console.error(`[ELEMENT: ${this.config.global.elementName}] `, loadStatus.error);
85
+ } else {
86
+ this.status.set('Loaded');
87
+ }
88
+ });
89
+ } catch (e) {
90
+ console.log(e);
91
+ this.status.set('Failed');
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,21 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { RouterModule, Routes } from '@angular/router';
3
+
4
+ import { appConfig } from '../config/index'; // tslint:disable-line
5
+ import { FallbackComponent } from './fallback.component'; // tslint:disable-line
6
+ import { ModuleComponent } from './module.component';
7
+
8
+ const elementRoutes: Routes = [
9
+ { path: '**', component: ModuleComponent },
10
+ ];
11
+
12
+ @NgModule({
13
+ imports: [
14
+ RouterModule.forRoot(elementRoutes),
15
+ ],
16
+ exports: [
17
+ RouterModule,
18
+ ],
19
+ })
20
+ export class RoutingModule {
21
+ }
@@ -0,0 +1,10 @@
1
+ import { GLOBAL } from './global';
2
+ import { MODULES } from './modules';
3
+
4
+ import { EuiAppConfig } from '@eui/core';
5
+ import { configMapping } from '@csdr/integration/element';
6
+
7
+ export const appConfig: EuiAppConfig = configMapping({
8
+ global: GLOBAL,
9
+ modules: MODULES,
10
+ });
@@ -0,0 +1,75 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ActionReducer, ActionReducerMap, MetaReducer, INIT, RuntimeChecks } from '@ngrx/store';
3
+ import * as fromRouter from '@ngrx/router-store';
4
+ import { storeFreeze } from 'ngrx-store-freeze';
5
+
6
+ import { reducers as coreReducers, CoreState } from '@eui/core';
7
+ import { ElementStorageService } from '@csdr/core';
8
+
9
+ import { environment } from '../../environments/environment';
10
+
11
+ export interface AppState extends CoreState {
12
+ router: fromRouter.RouterReducerState<any>;
13
+ }
14
+
15
+ // -----------------
16
+ // ------------ AOT
17
+ export const TOKEN = new InjectionToken<any>('AppReducers');
18
+
19
+ export function getReducers(): ActionReducerMap<AppState, any> {
20
+ return {
21
+ router: fromRouter.routerReducer,
22
+ ...coreReducers,
23
+ };
24
+ }
25
+
26
+ export const reducerProvider = [
27
+ { provide: TOKEN, useFactory: getReducers },
28
+ ];
29
+
30
+ // console.log all actions
31
+ export function logger(reducer: ActionReducer<AppState>): ActionReducer<AppState> {
32
+ return (state, action) => {
33
+ const result = reducer(state, action);
34
+ console.groupCollapsed(action.type);
35
+ console.log('prev state', state);
36
+ console.log('action', action);
37
+ console.log('next state', result);
38
+ console.groupEnd();
39
+
40
+ return result;
41
+ };
42
+ }
43
+
44
+ export function hydrationFactory(config: any, elementStorage: ElementStorageService): MetaReducer<AppState> {
45
+ return (reducer: ActionReducer<AppState>): ActionReducer<any> => {
46
+ return (state, action) => {
47
+ const key = `NgRx store: ${config.global.elementName}`;
48
+ if (action.type === INIT && elementStorage.hasData(key)) {
49
+ const cachedState = elementStorage.getData(key);
50
+ const nextStateFromCache = reducer(cachedState as AppState, action);
51
+ elementStorage.setData(key, nextStateFromCache);
52
+ return nextStateFromCache;
53
+ }
54
+ const nextState = reducer(state, action);
55
+ elementStorage.setData(key, nextState);
56
+ return nextState;
57
+ };
58
+ };
59
+ }
60
+
61
+ export function metaReducers(config: any, elementStorage: ElementStorageService): MetaReducer<AppState>[] {
62
+ if (!environment.production) {
63
+ return [logger, storeFreeze, hydrationFactory(config, elementStorage)];
64
+ }
65
+ return [hydrationFactory(config, elementStorage)];
66
+ }
67
+
68
+ export const runtimeChecks: RuntimeChecks = {
69
+ strictStateSerializability: false,
70
+ strictActionSerializability: false,
71
+ strictStateImmutability: false,
72
+ strictActionImmutability: false,
73
+ strictActionWithinNgZone: false,
74
+ strictActionTypeUniqueness: false,
75
+ };
@@ -42,7 +42,11 @@ module.exports.build = (pkg, isMaster) => {
42
42
  if (versionNumber <= 10) {
43
43
  args = ['--max_old_space_size=8096', ng, 'build', pkgName, '--prod'];
44
44
  } else {
45
- args = ['--max_old_space_size=8096', ng, 'build', pkgName];
45
+ if (versionNumber >= 19) {
46
+ args = [ng, 'build', pkgName];
47
+ } else {
48
+ args = ['--max_old_space_size=8096', ng, 'build', pkgName];
49
+ }
46
50
  }
47
51
 
48
52
  if (statsJson) {