@eui/base 19.0.0-next.13 → 19.0.0-next.15
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.
- package/docs/classes/EuiLazyService.html +4 -4
- package/docs/classes/EuiService.html +2 -2
- package/docs/dependencies.html +2 -2
- package/docs/interfaces/EuiStoreServiceModel.html +2 -3
- package/docs/js/search/search_index.js +2 -2
- package/docs/miscellaneous/typealiases.html +21 -0
- package/docs/miscellaneous/variables.html +58 -4
- package/fesm2022/eui-base.mjs +73 -46
- package/fesm2022/eui-base.mjs.map +1 -1
- package/lib/eui-models/eui-service.model.d.ts +16 -2
- package/lib/eui-models/eui-service.model.d.ts.map +1 -1
- package/lib/eui-models/eui-store/eui-store-service.model.d.ts +2 -2
- package/lib/eui-models/eui-store/eui-store-service.model.d.ts.map +1 -1
- package/lib/eui-models/eui-store/selectors/app.selectors.d.ts +8 -0
- package/lib/eui-models/eui-store/selectors/app.selectors.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -113,6 +113,9 @@
|
|
|
113
113
|
<li>
|
|
114
114
|
<a href="#ConsoleAppenderPrefixConverters" title="packages/eui/packages/base/src/lib/eui-models/eui-config/log.config.ts" ><b>ConsoleAppenderPrefixConverters</b> (packages/.../log.config.ts)</a>
|
|
115
115
|
</li>
|
|
116
|
+
<li>
|
|
117
|
+
<a href="#DeepPartial" title="packages/eui/packages/base/src/lib/eui-models/eui-service.model.ts" ><b>DeepPartial</b> (packages/.../eui-service.model.ts)</a>
|
|
118
|
+
</li>
|
|
116
119
|
<li>
|
|
117
120
|
<a href="#ErrorMappingHandler" title="packages/eui/packages/base/src/lib/ux-models/ux-error-feedback.model.ts" ><b>ErrorMappingHandler</b> (packages/.../ux-error-feedback.model.ts)</a>
|
|
118
121
|
</li>
|
|
@@ -205,6 +208,24 @@
|
|
|
205
208
|
</tr>
|
|
206
209
|
</tbody>
|
|
207
210
|
</table>
|
|
211
|
+
</section> <h3>packages/eui/packages/base/src/lib/eui-models/eui-service.model.ts</h3>
|
|
212
|
+
<section data-compodoc="block-typealias">
|
|
213
|
+
<table class="table table-sm table-bordered">
|
|
214
|
+
<tbody>
|
|
215
|
+
<tr>
|
|
216
|
+
<td class="col-md-4">
|
|
217
|
+
<a name="DeepPartial"></a>
|
|
218
|
+
<span class="name "><b>DeepPartial</b><a href="#DeepPartial"><span class="icon ion-ios-link"></span></a></span>
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr>
|
|
222
|
+
<td class="col-md-4">
|
|
223
|
+
<code> <code></code>
|
|
224
|
+
</code>
|
|
225
|
+
</td>
|
|
226
|
+
</tr>
|
|
227
|
+
</tbody>
|
|
228
|
+
</table>
|
|
208
229
|
</section> <h3>packages/eui/packages/base/src/lib/ux-models/ux-error-feedback.model.ts</h3>
|
|
209
230
|
<section data-compodoc="block-typealias">
|
|
210
231
|
<table class="table table-sm table-bordered">
|
|
@@ -138,7 +138,10 @@
|
|
|
138
138
|
<a href="#getAppConnection" title="packages/eui/packages/base/src/lib/eui-models/eui-store/selectors/app.selectors.ts" ><b>getAppConnection</b> (packages/.../app.selectors.ts)</a>
|
|
139
139
|
</li>
|
|
140
140
|
<li>
|
|
141
|
-
<a href="#getAppLoadedConfigModules" title="packages/eui/packages/base/src/lib/eui-models/eui-
|
|
141
|
+
<a href="#getAppLoadedConfigModules" title="packages/eui/packages/base/src/lib/eui-models/eui-service.model.ts" ><b>getAppLoadedConfigModules</b> (packages/.../eui-service.model.ts)</a>
|
|
142
|
+
</li>
|
|
143
|
+
<li>
|
|
144
|
+
<a href="#getAppLoadedConfigModules" title="packages/eui/packages/base/src/lib/eui-models/eui-store/selectors/app.selectors.ts" class="deprecated-name"><b>getAppLoadedConfigModules</b> (packages/.../app.selectors.ts)</a>
|
|
142
145
|
</li>
|
|
143
146
|
<li>
|
|
144
147
|
<a href="#getAppState" title="packages/eui/packages/base/src/lib/eui-models/eui-store/selectors/core.selectors.ts" ><b>getAppState</b> (packages/.../core.selectors.ts)</a>
|
|
@@ -171,7 +174,7 @@
|
|
|
171
174
|
<a href="#getI18nState" title="packages/eui/packages/base/src/lib/eui-models/eui-store/selectors/core.selectors.ts" ><b>getI18nState</b> (packages/.../core.selectors.ts)</a>
|
|
172
175
|
</li>
|
|
173
176
|
<li>
|
|
174
|
-
<a href="#getLastAddedModule" title="packages/eui/packages/base/src/lib/eui-models/eui-store/selectors/app.selectors.ts" ><b>getLastAddedModule</b> (packages/.../app.selectors.ts)</a>
|
|
177
|
+
<a href="#getLastAddedModule" title="packages/eui/packages/base/src/lib/eui-models/eui-store/selectors/app.selectors.ts" class="deprecated-name"><b>getLastAddedModule</b> (packages/.../app.selectors.ts)</a>
|
|
175
178
|
</li>
|
|
176
179
|
<li>
|
|
177
180
|
<a href="#getLocaleServiceConfigFromBase" title="packages/eui/packages/base/src/lib/eui-models/eui-config/locale.config.ts" ><b>getLocaleServiceConfigFromBase</b> (packages/.../locale.config.ts)</a>
|
|
@@ -672,10 +675,15 @@
|
|
|
672
675
|
<td class="col-md-4">
|
|
673
676
|
<a name="getAppLoadedConfigModules"></a>
|
|
674
677
|
<span class="name">
|
|
675
|
-
<span ><b>getAppLoadedConfigModules</b></span>
|
|
678
|
+
<span class="deprecated-name"><b>getAppLoadedConfigModules</b></span>
|
|
676
679
|
<a href="#getAppLoadedConfigModules"><span class="icon ion-ios-link"></span></a>
|
|
677
680
|
</span>
|
|
678
681
|
</td>
|
|
682
|
+
</tr>
|
|
683
|
+
<tr>
|
|
684
|
+
<td class="col-md-4 deprecated">
|
|
685
|
+
It will be removed in the future.
|
|
686
|
+
</td>
|
|
679
687
|
</tr>
|
|
680
688
|
<tr>
|
|
681
689
|
<td class="col-md-4">
|
|
@@ -692,6 +700,12 @@
|
|
|
692
700
|
</td>
|
|
693
701
|
</tr>
|
|
694
702
|
|
|
703
|
+
<tr>
|
|
704
|
+
<td class="col-md-4">
|
|
705
|
+
<div class="io-description"><p>Returns the loaded config modules from the app state</p>
|
|
706
|
+
</div>
|
|
707
|
+
</td>
|
|
708
|
+
</tr>
|
|
695
709
|
|
|
696
710
|
</tbody>
|
|
697
711
|
</table>
|
|
@@ -779,10 +793,15 @@
|
|
|
779
793
|
<td class="col-md-4">
|
|
780
794
|
<a name="getLastAddedModule"></a>
|
|
781
795
|
<span class="name">
|
|
782
|
-
<span ><b>getLastAddedModule</b></span>
|
|
796
|
+
<span class="deprecated-name"><b>getLastAddedModule</b></span>
|
|
783
797
|
<a href="#getLastAddedModule"><span class="icon ion-ios-link"></span></a>
|
|
784
798
|
</span>
|
|
785
799
|
</td>
|
|
800
|
+
</tr>
|
|
801
|
+
<tr>
|
|
802
|
+
<td class="col-md-4 deprecated">
|
|
803
|
+
It will be removed in the future.
|
|
804
|
+
</td>
|
|
786
805
|
</tr>
|
|
787
806
|
<tr>
|
|
788
807
|
<td class="col-md-4">
|
|
@@ -799,6 +818,41 @@
|
|
|
799
818
|
</td>
|
|
800
819
|
</tr>
|
|
801
820
|
|
|
821
|
+
<tr>
|
|
822
|
+
<td class="col-md-4">
|
|
823
|
+
<div class="io-description"><p>Returns the last added module from the app state</p>
|
|
824
|
+
</div>
|
|
825
|
+
</td>
|
|
826
|
+
</tr>
|
|
827
|
+
|
|
828
|
+
</tbody>
|
|
829
|
+
</table>
|
|
830
|
+
</section>
|
|
831
|
+
<h3>packages/eui/packages/base/src/lib/eui-models/eui-service.model.ts</h3>
|
|
832
|
+
<section data-compodoc="block-properties">
|
|
833
|
+
<h3></h3> <table class="table table-sm table-bordered">
|
|
834
|
+
<tbody>
|
|
835
|
+
<tr>
|
|
836
|
+
<td class="col-md-4">
|
|
837
|
+
<a name="getAppLoadedConfigModules"></a>
|
|
838
|
+
<span class="name">
|
|
839
|
+
<span ><b>getAppLoadedConfigModules</b></span>
|
|
840
|
+
<a href="#getAppLoadedConfigModules"><span class="icon ion-ios-link"></span></a>
|
|
841
|
+
</span>
|
|
842
|
+
</td>
|
|
843
|
+
</tr>
|
|
844
|
+
<tr>
|
|
845
|
+
<td class="col-md-4">
|
|
846
|
+
<i>Type : </i> <code>Selector<CoreState, LoadedConfigModules></code>
|
|
847
|
+
|
|
848
|
+
</td>
|
|
849
|
+
</tr>
|
|
850
|
+
<tr>
|
|
851
|
+
<td class="col-md-4">
|
|
852
|
+
<i>Default value : </i><code>(state: CoreState) => state?.app?.loadedConfigModules</code>
|
|
853
|
+
</td>
|
|
854
|
+
</tr>
|
|
855
|
+
|
|
802
856
|
|
|
803
857
|
</tbody>
|
|
804
858
|
</table>
|
package/fesm2022/eui-base.mjs
CHANGED
|
@@ -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
|
}
|
|
@@ -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,
|