@eui/base 19.0.0-next.9 → 19.0.0-rc.10

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 (109) hide show
  1. package/docs/classes/ConsoleAppender.html +7 -6
  2. package/docs/classes/EuiEuLanguages.html +225 -6
  3. package/docs/classes/EuiLazyService.html +11 -10
  4. package/docs/classes/EuiPagination.html +7 -6
  5. package/docs/classes/EuiService.html +9 -8
  6. package/docs/classes/LogAppender.html +7 -6
  7. package/docs/classes/Logger.html +7 -6
  8. package/docs/classes/LoggerMock.html +7 -6
  9. package/docs/classes/UrlAppender.html +7 -6
  10. package/docs/classes/UxBadgeLegacy.html +7 -6
  11. package/docs/classes/UxClearErrorFeedbackEvent.html +7 -6
  12. package/docs/classes/UxErrorGroupOnClickEvent.html +7 -6
  13. package/docs/classes/UxErrorOutput.html +7 -6
  14. package/docs/classes/UxLinkLegacy.html +7 -6
  15. package/docs/classes/UxPublishErrorFeedbackEvent.html +7 -6
  16. package/docs/classes/UxValidationErrorClass.html +7 -6
  17. package/docs/dependencies.html +47 -66
  18. package/docs/index.html +7 -6
  19. package/docs/interfaces/ApiQueue.html +7 -6
  20. package/docs/interfaces/ApiQueueItem.html +7 -6
  21. package/docs/interfaces/AppState.html +7 -6
  22. package/docs/interfaces/ConnectionStatus.html +7 -6
  23. package/docs/interfaces/ConsoleAppenderConfig.html +7 -6
  24. package/docs/interfaces/ConsoleAppenderTypeConfig.html +7 -6
  25. package/docs/interfaces/CoreState.html +7 -6
  26. package/docs/interfaces/EnvDynamicConfig.html +7 -6
  27. package/docs/interfaces/EuiAppHandlersConfig.html +7 -6
  28. package/docs/interfaces/EuiAppJsonConfig.html +7 -6
  29. package/docs/interfaces/EuiAuthConfig.html +7 -6
  30. package/docs/interfaces/EuiConfig.html +7 -6
  31. package/docs/interfaces/EuiEnvConfig.html +7 -6
  32. package/docs/interfaces/EuiGlobalConfig.html +7 -6
  33. package/docs/interfaces/EuiGrowlMessage.html +7 -6
  34. package/docs/interfaces/EuiLanguage.html +58 -6
  35. package/docs/interfaces/EuiMenuItem.html +7 -6
  36. package/docs/interfaces/EuiPaginationConfig.html +7 -6
  37. package/docs/interfaces/EuiServiceModel.html +7 -6
  38. package/docs/interfaces/EuiServiceStatus.html +7 -6
  39. package/docs/interfaces/EuiStoreServiceModel.html +9 -9
  40. package/docs/interfaces/EuiUserRight.html +7 -6
  41. package/docs/interfaces/GlobalConfig.html +7 -6
  42. package/docs/interfaces/HttpErrorHandlerConfig.html +7 -6
  43. package/docs/interfaces/HttpErrorRouteConfig.html +7 -6
  44. package/docs/interfaces/I18nConfig.html +7 -6
  45. package/docs/interfaces/I18nLoaderConfig.html +7 -6
  46. package/docs/interfaces/I18nResource.html +7 -6
  47. package/docs/interfaces/I18nServiceConfig.html +7 -6
  48. package/docs/interfaces/I18nState.html +7 -6
  49. package/docs/interfaces/LoadedConfigModules.html +7 -6
  50. package/docs/interfaces/LocaleServiceConfig.html +7 -240
  51. package/docs/interfaces/LocaleState.html +7 -64
  52. package/docs/interfaces/LogAppenderConfig.html +7 -6
  53. package/docs/interfaces/LogAppenderTypeConfig.html +7 -6
  54. package/docs/interfaces/LogConfig.html +7 -6
  55. package/docs/interfaces/LogEvent.html +7 -6
  56. package/docs/interfaces/LogPosition.html +7 -6
  57. package/docs/interfaces/ModuleConfig.html +7 -6
  58. package/docs/interfaces/ModulesConfig.html +7 -6
  59. package/docs/interfaces/NotificationsState.html +7 -6
  60. package/docs/interfaces/UrlAppenderConfig.html +7 -6
  61. package/docs/interfaces/UrlAppenderTypeConfig.html +7 -6
  62. package/docs/interfaces/UrlLogEvent.html +7 -6
  63. package/docs/interfaces/UserConfig.html +7 -6
  64. package/docs/interfaces/UserDetails.html +7 -6
  65. package/docs/interfaces/UserPreferences.html +7 -6
  66. package/docs/interfaces/UserState.html +7 -6
  67. package/docs/interfaces/UxErrorFeedback.html +7 -6
  68. package/docs/interfaces/UxErrorFollowMap.html +7 -6
  69. package/docs/interfaces/UxErrorInfo.html +7 -6
  70. package/docs/interfaces/UxErrorMessage.html +7 -6
  71. package/docs/interfaces/UxFormValidationError.html +7 -6
  72. package/docs/interfaces/UxHttpErrorInfo.html +7 -6
  73. package/docs/interfaces/UxHttpErrorResponse.html +7 -6
  74. package/docs/interfaces/UxModalLegacy.html +7 -6
  75. package/docs/interfaces/UxValidationErrorAttribute.html +7 -6
  76. package/docs/interfaces/UxValidationErrorFeedback.html +7 -6
  77. package/docs/interfaces/UxValidationErrorI18nMessage.html +7 -6
  78. package/docs/interfaces/VersionsConfig.html +7 -6
  79. package/docs/interfaces/XHRConfig.html +7 -6
  80. package/docs/js/libs/bootstrap-native.js +1 -1
  81. package/docs/js/menu.js +10 -11
  82. package/docs/js/search/search-lunr.js +6 -8
  83. package/docs/js/search/search.js +107 -102
  84. package/docs/js/search/search_index.js +2 -2
  85. package/docs/license.html +7 -6
  86. package/docs/miscellaneous/enumerations.html +7 -6
  87. package/docs/miscellaneous/functions.html +7 -6
  88. package/docs/miscellaneous/typealiases.html +28 -6
  89. package/docs/miscellaneous/variables.html +67 -12
  90. package/docs/modules.html +7 -6
  91. package/docs/properties.html +7 -6
  92. package/docs/styles/compodoc.css +11 -8
  93. package/fesm2022/eui-base.mjs +278 -48
  94. package/fesm2022/eui-base.mjs.map +1 -1
  95. package/lib/eui-models/eui-config/locale.config.d.ts +0 -24
  96. package/lib/eui-models/eui-config/locale.config.d.ts.map +1 -1
  97. package/lib/eui-models/eui-language/eui-eu-languages.model.d.ts +14 -0
  98. package/lib/eui-models/eui-language/eui-eu-languages.model.d.ts.map +1 -1
  99. package/lib/eui-models/eui-language/eui-language.model.d.ts +2 -0
  100. package/lib/eui-models/eui-language/eui-language.model.d.ts.map +1 -1
  101. package/lib/eui-models/eui-service.model.d.ts +16 -2
  102. package/lib/eui-models/eui-service.model.d.ts.map +1 -1
  103. package/lib/eui-models/eui-store/eui-store-service.model.d.ts +2 -2
  104. package/lib/eui-models/eui-store/eui-store-service.model.d.ts.map +1 -1
  105. package/lib/eui-models/eui-store/selectors/app.selectors.d.ts +8 -0
  106. package/lib/eui-models/eui-store/selectors/app.selectors.d.ts.map +1 -1
  107. package/lib/eui-models/eui-store/state/locale.state.d.ts +0 -6
  108. package/lib/eui-models/eui-store/state/locale.state.d.ts.map +1 -1
  109. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { Subject } from 'rxjs';
2
- import { createSelector } from 'reselect';
3
2
  import { filter, switchMap } from 'rxjs/operators';
4
3
  import { HttpClient } from '@angular/common/http';
4
+ import { createSelector } from 'reselect';
5
5
 
6
6
  const isObject = (item) => item && typeof item === 'object' && !Array.isArray(item);
7
7
  function merge(target, ...sources) {
@@ -222,37 +222,6 @@ class UxLinkLegacy {
222
222
  }
223
223
  }
224
224
 
225
- const getAppState = (state) => state.app;
226
- const getUserState = (state) => state.user;
227
- const getNotificationsState = (state) => state.notifications;
228
- const getI18nState = (state) => state.i18n;
229
- const getLocaleState = (state) => state.locale;
230
-
231
- const getAppVersion = createSelector(getAppState, (state) => state.version);
232
- const getAppConnection = createSelector(getAppState, (state) => state.connected);
233
- const getAppLoadedConfigModules = createSelector(getAppState, (state) => state.loadedConfigModules);
234
- const getLastAddedModule = createSelector(getAppState, (state) => state.loadedConfigModules.lastAddedModule);
235
- const getAppStatus = createSelector(getAppState, (state) => state.status);
236
- const getCurrentModule = createSelector(getAppState, (state) => state.currentModule);
237
- const getApiQueue = createSelector(getAppState, (state) => state.apiQueue);
238
- const getApiQueueItem = (itemId) => createSelector(getAppState, (state) => state.apiQueue[itemId]);
239
-
240
- const getActiveLang = createSelector(getI18nState, (state) => state.activeLang);
241
-
242
- const getUserDetails = createSelector(getUserState, (state) => state);
243
- const getUserPreferences = createSelector(getUserState, (state) => state.preferences);
244
- const getUserId = createSelector(getUserDetails, (state) => state.userId);
245
- const getUserFirstName = createSelector(getUserDetails, (state) => state.firstName);
246
- const getUserLastName = createSelector(getUserDetails, (state) => state.lastName);
247
- const getUserFullName = createSelector(getUserDetails, (state) => state.fullName);
248
- const getUserLang = createSelector(getUserPreferences, (state) => state.lang);
249
- const getUserRights = createSelector(getUserState, (state) => state.rights);
250
- const getUserRight = (rightId) => createSelector(getUserRights, (state) => state.find((right) => right && right.id === rightId));
251
- const getUserRightPermissions = (rightId) => createSelector(getUserRight(rightId), (state) => state && state.permissions);
252
- const getUserDashboard = createSelector(getUserPreferences, (state) => state.dashboard);
253
-
254
- const getNotificationsList = createSelector(getNotificationsState, (state) => state.list);
255
-
256
225
  class EuiService {
257
226
  constructor(defaultState) {
258
227
  this.onStateChange = new Subject();
@@ -269,19 +238,6 @@ class EuiService {
269
238
  this.onStateChange.next(newState);
270
239
  });
271
240
  }
272
- // updateStateProperty(property: keyof T, newVal) {
273
- // if (typeof this.stateInstance === 'object') {
274
- // this.updateState({
275
- // ...this.stateInstance,
276
- // [property]: {
277
- // ...this.stateInstance[property],
278
- // ...newVal,
279
- // },
280
- // });
281
- // } else {
282
- // console.log('This helper method can not be used except for objects');
283
- // }
284
- // }
285
241
  unSubscribe() {
286
242
  if (this.$stateSubs && this.$stateSubs.unsubscribe) {
287
243
  this.$stateSubs.unsubscribe();
@@ -290,6 +246,37 @@ class EuiService {
290
246
  this.$stateLazyLoadSubs.unsubscribe();
291
247
  }
292
248
  }
249
+ /**
250
+ * deep merge two objects
251
+ * @param target the object that will be merged into
252
+ * @param source the object that will be merged from
253
+ */
254
+ deepMerge(target, source) {
255
+ const output = Object.assign({}, target);
256
+ if (this.isObject(target) && this.isObject(source)) {
257
+ Object.keys(source).forEach(key => {
258
+ if (this.isObject(source[key])) {
259
+ if (!(key in target)) {
260
+ Object.assign(output, { [key]: source[key] });
261
+ }
262
+ else {
263
+ output[key] = this.deepMerge(target[key], source[key]);
264
+ }
265
+ }
266
+ else {
267
+ Object.assign(output, { [key]: source[key] });
268
+ }
269
+ });
270
+ }
271
+ return output;
272
+ }
273
+ /**
274
+ * checks if the given item is an object
275
+ * @param item the item that will be checked
276
+ */
277
+ isObject(item) {
278
+ return item && typeof item === 'object' && !Array.isArray(item);
279
+ }
293
280
  /**
294
281
  * returns a copy of the given value whether this value is object or primitive. For the arrays it will cover
295
282
  * multidimensional arrays, but it will not cover an object that contain functions. JSON.parse and JSON.stringify
@@ -305,6 +292,7 @@ class EuiService {
305
292
  return JSON.parse(JSON.stringify(state));
306
293
  }
307
294
  }
295
+ const getAppLoadedConfigModules$1 = (state) => state?.app?.loadedConfigModules;
308
296
  class EuiLazyService extends EuiService {
309
297
  constructor(defaultState) {
310
298
  super(defaultState);
@@ -314,7 +302,7 @@ class EuiLazyService extends EuiService {
314
302
  super.initEuiService();
315
303
  if (storeForLazyLoad) {
316
304
  this.$stateLazyLoadSubs = storeForLazyLoad
317
- .select(getAppLoadedConfigModules)
305
+ .select(getAppLoadedConfigModules$1)
318
306
  .pipe(filter((loadedConfigModules) => loadedConfigModules?.modulesConfig?.[loadedConfigModules.lastAddedModule] ? true : false), switchMap((loadedConfigModules) => this.lazyLoadInit(loadedConfigModules.modulesConfig[loadedConfigModules.lastAddedModule], loadedConfigModules.lastAddedModule)))
319
307
  .subscribe(null);
320
308
  }
@@ -741,8 +729,8 @@ const getBrowserPreferredLanguages = () => navigator.languages.map((lang) => lan
741
729
  * responsible to extract the attributes "available" and "id" from the locale configuration
742
730
  */
743
731
  const getLocaleServiceConfigFromBase = (baseGlobalConfig) => {
744
- const { registered, available, bindWithTranslate, affectGlobalLocale } = baseGlobalConfig.locale;
745
- return { registered, available, bindWithTranslate, affectGlobalLocale };
732
+ const { bindWithTranslate } = baseGlobalConfig.locale;
733
+ return { bindWithTranslate };
746
734
  };
747
735
 
748
736
  const initialUserPreferences = Object.assign({}, {
@@ -750,6 +738,45 @@ const initialUserPreferences = Object.assign({}, {
750
738
  dashboard: null,
751
739
  });
752
740
 
741
+ const getAppState = (state) => state.app;
742
+ const getUserState = (state) => state.user;
743
+ const getNotificationsState = (state) => state.notifications;
744
+ const getI18nState = (state) => state.i18n;
745
+ const getLocaleState = (state) => state.locale;
746
+
747
+ const getAppVersion = createSelector(getAppState, (state) => state.version);
748
+ const getAppConnection = createSelector(getAppState, (state) => state.connected);
749
+ /**
750
+ * Returns the loaded config modules from the app state
751
+ * @deprecated It will be removed in the future.
752
+ */
753
+ const getAppLoadedConfigModules = createSelector(getAppState, (state) => state.loadedConfigModules);
754
+ /**
755
+ * Returns the last added module from the app state
756
+ * @deprecated It will be removed in the future.
757
+ */
758
+ const getLastAddedModule = createSelector(getAppState, (state) => state.loadedConfigModules.lastAddedModule);
759
+ const getAppStatus = createSelector(getAppState, (state) => state.status);
760
+ const getCurrentModule = createSelector(getAppState, (state) => state.currentModule);
761
+ const getApiQueue = createSelector(getAppState, (state) => state.apiQueue);
762
+ const getApiQueueItem = (itemId) => createSelector(getAppState, (state) => state.apiQueue[itemId]);
763
+
764
+ const getActiveLang = createSelector(getI18nState, (state) => state.activeLang);
765
+
766
+ const getUserDetails = createSelector(getUserState, (state) => state);
767
+ const getUserPreferences = createSelector(getUserState, (state) => state.preferences);
768
+ const getUserId = createSelector(getUserDetails, (state) => state.userId);
769
+ const getUserFirstName = createSelector(getUserDetails, (state) => state.firstName);
770
+ const getUserLastName = createSelector(getUserDetails, (state) => state.lastName);
771
+ const getUserFullName = createSelector(getUserDetails, (state) => state.fullName);
772
+ const getUserLang = createSelector(getUserPreferences, (state) => state.lang);
773
+ const getUserRights = createSelector(getUserState, (state) => state.rights);
774
+ const getUserRight = (rightId) => createSelector(getUserRights, (state) => state.find((right) => right && right.id === rightId));
775
+ const getUserRightPermissions = (rightId) => createSelector(getUserRight(rightId), (state) => state && state.permissions);
776
+ const getUserDashboard = createSelector(getUserPreferences, (state) => state.dashboard);
777
+
778
+ const getNotificationsList = createSelector(getNotificationsState, (state) => state.list);
779
+
753
780
  const initialAppState = Object.assign({}, {
754
781
  version: '0.0.0',
755
782
  connected: true,
@@ -1143,6 +1170,190 @@ class EuiEuLanguages {
1143
1170
  label: 'svenska',
1144
1171
  },
1145
1172
  }; }
1173
+ static { this.allLanguages = [
1174
+ { code: 'aa', label: 'Afaraf' },
1175
+ { code: 'ab', label: 'аҧсуа' },
1176
+ { code: 'ae', label: 'avesta' },
1177
+ { code: 'af', label: 'Afrikaans' },
1178
+ { code: 'ak', label: 'Akan' },
1179
+ { code: 'am', label: 'አማርኛ' },
1180
+ { code: 'an', label: 'Aragonés' },
1181
+ { code: 'ar', label: 'العربية', isRtl: true },
1182
+ { code: 'as', label: 'অসমীয়া' },
1183
+ { code: 'av', label: 'авар мацӀ, магӀарул мацӀ' },
1184
+ { code: 'ay', label: 'aymar aru' },
1185
+ { code: 'az', label: 'azərbaycan dili' },
1186
+ { code: 'ba', label: 'башҡорт теле' },
1187
+ { code: 'be', label: 'Беларуская' },
1188
+ { code: 'bg', label: 'български' },
1189
+ { code: 'bh', label: 'भोजपुरी' },
1190
+ { code: 'bi', label: 'Bislama' },
1191
+ { code: 'bm', label: 'bamanankan' },
1192
+ { code: 'bn', label: 'বাংলা' },
1193
+ { code: 'bo', label: 'བོད་ཡིག' },
1194
+ { code: 'br', label: 'brezhoneg' },
1195
+ { code: 'bs', label: 'bosanski jezik' },
1196
+ { code: 'ca', label: 'Català' },
1197
+ { code: 'ce', label: 'нохчийн мотт' },
1198
+ { code: 'ch', label: 'Chamoru' },
1199
+ { code: 'co', label: 'corsu, lingua corsa' },
1200
+ { code: 'cr', label: 'ᓀᐦᐃᔭᐍᐏᐣ' },
1201
+ { code: 'cs', label: 'čeština' },
1202
+ { code: 'cu', label: 'ѩзыкъ словѣньскъ' },
1203
+ { code: 'cv', label: 'чӑваш чӗлхи' },
1204
+ { code: 'cy', label: 'Cymraeg' },
1205
+ { code: 'da', label: 'dansk' },
1206
+ { code: 'de', label: 'Deutsch' },
1207
+ { code: 'dv', label: 'ދިވެހި' },
1208
+ { code: 'ee', label: 'Eʋegbe' },
1209
+ { code: 'el', label: 'Ελληνικά' },
1210
+ { code: 'en', label: 'English' },
1211
+ { code: 'eo', label: 'Esperanto' },
1212
+ { code: 'es', label: 'español' },
1213
+ { code: 'et', label: 'eesti' },
1214
+ { code: 'eu', label: 'euskara, euskera' },
1215
+ { code: 'fa', label: 'فارسی', isRtl: true },
1216
+ { code: 'ff', label: 'Fulfulde, Pulaar, Pular' },
1217
+ { code: 'fi', label: 'suomi' },
1218
+ { code: 'fj', label: 'vosa Vakaviti' },
1219
+ { code: 'fo', label: 'føroyskt' },
1220
+ { code: 'fr', label: 'français' },
1221
+ { code: 'fy', label: 'Frysk' },
1222
+ { code: 'ga', label: 'Gaeilge' },
1223
+ { code: 'gd', label: 'Gàidhlig' },
1224
+ { code: 'gl', label: 'Galego' },
1225
+ { code: 'gn', label: 'Avañeẽ' },
1226
+ { code: 'gu', label: 'ગુજરાતી' },
1227
+ { code: 'gv', label: 'Gaelg, Gailck' },
1228
+ { code: 'ha', label: 'Hausa, هَوُسَ' },
1229
+ { code: 'he', label: 'עברית', isRtl: true },
1230
+ { code: 'hi', label: 'हिन्दी, हिंदी' },
1231
+ { code: 'ho', label: 'Hiri Motu' },
1232
+ { code: 'hr', label: 'hrvatski' },
1233
+ { code: 'ht', label: 'Kreyòl ayisyen' },
1234
+ { code: 'hu', label: 'Magyar' },
1235
+ { code: 'hy', label: 'Հայերեն' },
1236
+ { code: 'hz', label: 'Otjiherero' },
1237
+ { code: 'ia', label: 'Interlingua' },
1238
+ { code: 'id', label: 'Bahasa Indonesia' },
1239
+ { code: 'ie', label: 'Originally called Occidental' },
1240
+ { code: 'ig', label: 'Asụsụ Igbo' },
1241
+ { code: 'ii', label: 'ꆈꌠ꒿ Nuosuhxop' },
1242
+ { code: 'ik', label: 'Iñupiaq, Iñupiatun' },
1243
+ { code: 'io', label: 'Ido' },
1244
+ { code: 'is', label: 'Íslenska' },
1245
+ { code: 'it', label: 'Italiano' },
1246
+ { code: 'iu', label: 'ᐃᓄᒃᑎᑐᑦ' },
1247
+ { code: 'ja', label: '日本語' },
1248
+ { code: 'jv', label: 'basa Jawa' },
1249
+ { code: 'ka', label: 'ქართული' },
1250
+ { code: 'kg', label: 'KiKongo' },
1251
+ { code: 'ki', label: 'Gĩkũyũ' },
1252
+ { code: 'kj', label: 'Kuanyama' },
1253
+ { code: 'kk', label: 'Қазақ тілі' },
1254
+ { code: 'kl', label: 'kalaallisut' },
1255
+ { code: 'km', label: 'ភាសាខ្មែរ' },
1256
+ { code: 'kn', label: 'ಕನ್ನಡ' },
1257
+ { code: 'ko', label: '한국어 (韓國語), 조선말 (朝鮮語)' },
1258
+ { code: 'kr', label: 'Kanuri' },
1259
+ { code: 'ks', label: 'कश्मीरी, كشميري‎' },
1260
+ { code: 'ku', label: 'Kurdî, كوردی‎', isRtl: true },
1261
+ { code: 'kv', label: 'коми кыв' },
1262
+ { code: 'kw', label: 'Kernewek' },
1263
+ { code: 'ky', label: 'кыргыз тили' },
1264
+ { code: 'la', label: 'latine' },
1265
+ { code: 'lb', label: 'Lëtzebuergesch' },
1266
+ { code: 'lg', label: 'Luganda' },
1267
+ { code: 'li', label: 'Limburgs' },
1268
+ { code: 'ln', label: 'Lingála' },
1269
+ { code: 'lo', label: 'ພາສາລາວ' },
1270
+ { code: 'lt', label: 'lietuvių kalba' },
1271
+ { code: 'lu', label: 'Lëtzebuergesch' },
1272
+ { code: 'lv', label: 'latviešu valoda' },
1273
+ { code: 'mg', label: 'Malagasy fiteny' },
1274
+ { code: 'mh', label: 'Kajin M̧ajeļ' },
1275
+ { code: 'mi', label: 'te reo Māori' },
1276
+ { code: 'mk', label: 'македонски јазик' },
1277
+ { code: 'ml', label: 'മലയാളം' },
1278
+ { code: 'mn', label: 'монгол' },
1279
+ { code: 'mr', label: 'मराठी' },
1280
+ { code: 'ms', label: 'bahasa Melayu, بهاس ملايو‎' },
1281
+ { code: 'mt', label: 'Malti' },
1282
+ { code: 'my', label: 'ဗမာစာ' },
1283
+ { code: 'na', label: 'Ekakairũ Naoero' },
1284
+ { code: 'nb', label: 'Norsk bokmål' },
1285
+ { code: 'nd', label: 'isiNdebele' },
1286
+ { code: 'ne', label: 'नेपाली' },
1287
+ { code: 'ng', label: 'Owambo' },
1288
+ { code: 'nl', label: 'Nederlands' },
1289
+ { code: 'nn', label: 'Norsk nynorsk' },
1290
+ { code: 'no', label: 'Norsk' },
1291
+ { code: 'nr', label: 'isiNdebele' },
1292
+ { code: 'nv', label: 'Diné bizaad, Dinékʼehǰí' },
1293
+ { code: 'ny', label: 'chiCheŵa, chinyanja' },
1294
+ { code: 'oc', label: 'Occitan' },
1295
+ { code: 'oj', label: 'ᐊᓂᔑᓈᐯᒧᐎᓐ' },
1296
+ { code: 'om', label: 'Afaan Oromoo' },
1297
+ { code: 'or', label: 'ଓଡ଼ିଆ' },
1298
+ { code: 'os', label: 'ирон æвзаг' },
1299
+ { code: 'pa', label: 'ਪੰਜਾਬੀ, پنجابی‎' },
1300
+ { code: 'pi', label: 'पाऴि' },
1301
+ { code: 'pl', label: 'polski' },
1302
+ { code: 'ps', label: 'پښتو' },
1303
+ { code: 'pt', label: 'Português' },
1304
+ { code: 'qu', label: 'Runa Simi, Kichwa' },
1305
+ { code: 'rm', label: 'rumantsch grischun' },
1306
+ { code: 'rn', label: 'kiRundi' },
1307
+ { code: 'ro', label: 'română' },
1308
+ { code: 'ru', label: 'русский язык' },
1309
+ { code: 'rw', label: 'Ikinyarwanda' },
1310
+ { code: 'sa', label: 'संस्कृतम्' },
1311
+ { code: 'sc', label: 'sardu' },
1312
+ { code: 'sd', label: 'सिन्धी, سنڌي، سندھی‎' },
1313
+ { code: 'se', label: 'Davvisámegiella' },
1314
+ { code: 'sg', label: 'yângâ tî sängö' },
1315
+ { code: 'si', label: 'සිංහල' },
1316
+ { code: 'sk', label: 'slovenčina' },
1317
+ { code: 'sl', label: 'slovenščina' },
1318
+ { code: 'sm', label: 'gagana faa Samoa' },
1319
+ { code: 'sn', label: 'chiShona' },
1320
+ { code: 'so', label: 'Soomaaliga, af Soomaali' },
1321
+ { code: 'sq', label: 'Shqip' },
1322
+ { code: 'sr', label: 'српски језик' },
1323
+ { code: 'ss', label: 'SiSwati' },
1324
+ { code: 'st', label: 'Sesotho' },
1325
+ { code: 'su', label: 'Basa Sunda' },
1326
+ { code: 'sv', label: 'svenska' },
1327
+ { code: 'sw', label: 'Kiswahili' },
1328
+ { code: 'ta', label: 'தமிழ்' },
1329
+ { code: 'te', label: 'తెలుగు' },
1330
+ { code: 'tg', label: 'тоҷикӣ, toğikī, تاجیکی‎' },
1331
+ { code: 'th', label: 'ไทย' },
1332
+ { code: 'ti', label: 'ትግርኛ' },
1333
+ { code: 'tk', label: 'Türkmen, Түркмен' },
1334
+ { code: 'tl', label: 'Wikang Tagalog' },
1335
+ { code: 'tn', label: 'Setswana' },
1336
+ { code: 'to', label: 'faka Tonga' },
1337
+ { code: 'tr', label: 'Türkçe' },
1338
+ { code: 'ts', label: 'Xitsonga' },
1339
+ { code: 'tt', label: 'татарча, tatarça, تاتارچا‎' },
1340
+ { code: 'tw', label: 'Twi' },
1341
+ { code: 'ty', label: 'Reo Tahiti' },
1342
+ { code: 'ug', label: 'Uyƣurqə, ئۇيغۇرچە‎' },
1343
+ { code: 'uk', label: 'українська' },
1344
+ { code: 'ur', label: 'اردو', isRtl: true },
1345
+ { code: 'uz', label: 'zbek, Ўзбек, أۇزبېك‎' },
1346
+ { code: 've', label: 'Tshivenḓa' },
1347
+ { code: 'vi', label: 'Tiếng Việt' },
1348
+ { code: 'vo', label: 'Volapük' },
1349
+ { code: 'wa', label: 'Walon' },
1350
+ { code: 'wo', label: 'Wollof' },
1351
+ { code: 'xh', label: 'isiXhosa' },
1352
+ { code: 'yi', label: 'ייִדיש' },
1353
+ { code: 'yo', label: 'Yorùbá' },
1354
+ { code: 'za', label: 'Saɯ cueŋƅ, Saw cuengh' },
1355
+ { code: 'zh', label: '中文 (Zhōngwén), 汉语, 漢語' },
1356
+ ]; }
1146
1357
  /**
1147
1358
  * Matches the given string array to the EU languages and returns a EuiLanguage array.
1148
1359
  * In case that no codes provided it returns the EU Languages array.
@@ -1194,6 +1405,25 @@ class EuiEuLanguages {
1194
1405
  static filterEULanguages(array) {
1195
1406
  return array ? array.filter((lang) => Object.keys(this.languages).includes(lang.code)) : [];
1196
1407
  }
1408
+ /**
1409
+ * @param code language code, ex. 'lu'
1410
+ */
1411
+ static getLanguageByCode(code) {
1412
+ return code ? this.allLanguages.find(lang => lang.code === code) : undefined;
1413
+ }
1414
+ /**
1415
+ * @param code language code, ex. 'lu'
1416
+ */
1417
+ static isEuLanguage(code) {
1418
+ return Object.keys(this.languages).includes(code);
1419
+ }
1420
+ /**
1421
+ * Returns array of EuiLanguage that match the given codes. If codes array is empty, returns all languages.
1422
+ * @param codes A string array of 2 char codes, ex. ['en', 'de']
1423
+ */
1424
+ static getAllLanguagesByCodes(codes) {
1425
+ return (codes && codes.length > 0) ? this.allLanguages.filter(el => codes.includes(el.code)) : this.allLanguages;
1426
+ }
1197
1427
  }
1198
1428
 
1199
1429
  if (typeof crypto === 'object' && typeof crypto.randomUUID !== 'function') {