@ts-core/angular 15.0.44 → 15.0.46
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/esm2020/list/select/RouterSelectListItems.mjs +52 -0
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/service/RouterBaseService.mjs +9 -5
- package/fesm2015/ts-core-angular.mjs +58 -5
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +58 -5
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/list/select/RouterSelectListItems.d.ts +14 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/service/RouterBaseService.d.ts +4 -2
|
@@ -12,7 +12,7 @@ import * as Cookie from 'ngx-cookie';
|
|
|
12
12
|
import * as interact from 'interactjs';
|
|
13
13
|
import { Validators } from '@angular/forms';
|
|
14
14
|
import * as i1$1 from '@angular/router';
|
|
15
|
-
import { NavigationStart, NavigationEnd, NavigationCancel, NavigationError
|
|
15
|
+
import { NavigationStart, NavigationEnd, NavigationCancel, NavigationError } from '@angular/router';
|
|
16
16
|
import * as i1$2 from '@angular/platform-browser';
|
|
17
17
|
|
|
18
18
|
class ApplicationBaseComponent extends DestroyableContainer {
|
|
@@ -3996,6 +3996,55 @@ class SelectListItems extends ListItems {
|
|
|
3996
3996
|
}
|
|
3997
3997
|
}
|
|
3998
3998
|
|
|
3999
|
+
class RouterSelectListItems extends SelectListItems {
|
|
4000
|
+
//--------------------------------------------------------------------------
|
|
4001
|
+
//
|
|
4002
|
+
// Constructor
|
|
4003
|
+
//
|
|
4004
|
+
//--------------------------------------------------------------------------
|
|
4005
|
+
constructor(router, language) {
|
|
4006
|
+
super(language, true);
|
|
4007
|
+
this.router = router;
|
|
4008
|
+
//--------------------------------------------------------------------------
|
|
4009
|
+
//
|
|
4010
|
+
// Protected Methods
|
|
4011
|
+
//
|
|
4012
|
+
//--------------------------------------------------------------------------
|
|
4013
|
+
this.setData = () => {
|
|
4014
|
+
this.selectedItem = this.getRouterSelectedItem();
|
|
4015
|
+
};
|
|
4016
|
+
this.setFragment = (item) => {
|
|
4017
|
+
let index = _.indexOf(this.collection, item);
|
|
4018
|
+
this.router.setFragment(index > 0 ? item.data.toString() : null);
|
|
4019
|
+
};
|
|
4020
|
+
this.changed
|
|
4021
|
+
.pipe(filter(() => !this.isDisabled), takeUntil(this.destroyed))
|
|
4022
|
+
.subscribe(this.setFragment);
|
|
4023
|
+
this.router.completed
|
|
4024
|
+
.pipe(filter(() => !this.isDisabled), takeUntil(this.destroyed))
|
|
4025
|
+
.subscribe(this.setData);
|
|
4026
|
+
}
|
|
4027
|
+
getRouterSelectedItem() {
|
|
4028
|
+
return _.find(this.collection, { data: this.router.getFragment() });
|
|
4029
|
+
}
|
|
4030
|
+
//--------------------------------------------------------------------------
|
|
4031
|
+
//
|
|
4032
|
+
// Public Methods
|
|
4033
|
+
//
|
|
4034
|
+
//--------------------------------------------------------------------------
|
|
4035
|
+
complete() {
|
|
4036
|
+
let item = this.getRouterSelectedItem();
|
|
4037
|
+
super.complete(!_.isNil(item) ? item.data : 0);
|
|
4038
|
+
}
|
|
4039
|
+
destroy() {
|
|
4040
|
+
if (this.isDestroyed) {
|
|
4041
|
+
return;
|
|
4042
|
+
}
|
|
4043
|
+
super.destroy();
|
|
4044
|
+
this.router = null;
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
|
|
3999
4048
|
class PrettifyPipe {
|
|
4000
4049
|
// --------------------------------------------------------------------------
|
|
4001
4050
|
//
|
|
@@ -4640,9 +4689,10 @@ class RouterBaseService extends Loadable {
|
|
|
4640
4689
|
// Constructor
|
|
4641
4690
|
//
|
|
4642
4691
|
// --------------------------------------------------------------------------
|
|
4643
|
-
constructor(_router, window) {
|
|
4692
|
+
constructor(_router, _route, window) {
|
|
4644
4693
|
super();
|
|
4645
4694
|
this._router = _router;
|
|
4695
|
+
this._route = _route;
|
|
4646
4696
|
this.window = window;
|
|
4647
4697
|
this.isNeedUpdateExtras = false;
|
|
4648
4698
|
this.params = new Map();
|
|
@@ -4806,8 +4856,8 @@ class RouterBaseService extends Loadable {
|
|
|
4806
4856
|
//
|
|
4807
4857
|
// --------------------------------------------------------------------------
|
|
4808
4858
|
getFragment(snapshot, defaultValue) {
|
|
4809
|
-
if (snapshot
|
|
4810
|
-
snapshot =
|
|
4859
|
+
if (_.isNil(snapshot)) {
|
|
4860
|
+
snapshot = this.route.snapshot;
|
|
4811
4861
|
}
|
|
4812
4862
|
return !_.isNil(snapshot.fragment) ? snapshot.fragment : defaultValue;
|
|
4813
4863
|
}
|
|
@@ -4837,6 +4887,9 @@ class RouterBaseService extends Loadable {
|
|
|
4837
4887
|
get previousUrlTree() {
|
|
4838
4888
|
return this.router.parseUrl(this.previousUrl);
|
|
4839
4889
|
}
|
|
4890
|
+
get route() {
|
|
4891
|
+
return this._route;
|
|
4892
|
+
}
|
|
4840
4893
|
get router() {
|
|
4841
4894
|
return this._router;
|
|
4842
4895
|
}
|
|
@@ -6880,5 +6933,5 @@ const VI_ANGULAR_OPTIONS = new InjectionToken(`VI_ANGULAR_OPTIONS`);
|
|
|
6880
6933
|
* Generated bundle index. Do not edit.
|
|
6881
6934
|
*/
|
|
6882
6935
|
|
|
6883
|
-
export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BooleanValueStorage, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, DateValueStorage, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVIOptions, IWindow, IWindowContent, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageModule, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LazyModuleLoader, ListItem, ListItems, LocalStorageService, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, LoginTokenStorage, MenuItem, MenuItemBase, MenuItems, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationConfig, NotificationEvent, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListItem, SelectListItems, SelectOnFocusDirective, StartCasePipe, StructureDirective, THEME_OPTIONS, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VIModule, VI_ANGULAR_OPTIONS, ValueStorage, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowClosedError, WindowConfig, WindowEvent, WindowService, WindowServiceEvent, cookieServiceFactory, initializerFactory, languageServiceFactory, localStorageServiceFactory, loggerServiceFactory, loginTokenStorageServiceFactory, nativeWindowServiceFactory, themeAssetServiceFactory, themeServiceFactory };
|
|
6936
|
+
export { APPLICATION_INJECTOR, ApplicationBaseComponent, ApplicationComponent, AspectRatioResizeDirective, AssetBackgroundDirective, AssetBackgroundPipe, AssetFilePipe, AssetIconPipe, AssetImagePipe, AssetModule, AssetSoundPipe, AssetVideoPipe, AutoScrollBottomDirective, BooleanValueStorage, BottomSheetService, COOKIE_OPTIONS, CamelCasePipe, CanDeactivateGuard, ClickToCopyDirective, ClickToSelectDirective, CookieModule, CookieOptions, CookieService, DateValueStorage, Direction, FinancePipe, FocusDirective, FocusManager, FormElementAsync, FormElementSync, HTMLContentTitleDirective, HTMLTitleDirective, INotification, INotificationContent, IUser, IVIOptions, IWindow, IWindowContent, InfiniteScrollDirective, IsBrowserDirective, IsServerDirective, LANGUAGE_OPTIONS, LanguageDirective, LanguageHasDirective, LanguageModule, LanguagePipe, LanguagePipeHas, LanguagePipeHasPure, LanguagePipePure, LanguageRequireResolver, LanguageResolver, LazyModuleLoader, ListItem, ListItems, LocalStorageService, LoginBaseService, LoginBaseServiceEvent, LoginGuard, LoginIfCanGuard, LoginNotGuard, LoginRequireResolver, LoginResolver, LoginTokenStorage, MenuItem, MenuItemBase, MenuItems, MessageBaseComponent, MomentDateAdaptivePipe, MomentDateFromNowPipe, MomentDatePipe, MomentTimePipe, NavigationMenuItem, NgModelErrorPipe, NotificationConfig, NotificationEvent, NotificationService, NotificationServiceEvent, PipeBaseService, PlatformService, PrettifyPipe, QuestionEvent, QuestionManager, QuestionMode, ResizeDirective, ResizeManager, RouterBaseService, RouterSelectListItems, SanitizePipe, ScrollCheckDirective, ScrollDirective, SelectListItem, SelectListItems, SelectOnFocusDirective, StartCasePipe, StructureDirective, THEME_OPTIONS, ThemeAssetBackgroundDirective, ThemeAssetDirective, ThemeAssetIconDirective, ThemeAssetImageDirective, ThemeModule, ThemeStyleDirective, ThemeStyleHoverDirective, ThemeToggleDirective, TimePipe, TransportLazy, TransportLazyModule, TransportLazyModuleLoadedEvent, TruncatePipe, UserBaseService, UserBaseServiceEvent, VIModule, VI_ANGULAR_OPTIONS, ValueStorage, ViewUtil, WINDOW_CONTENT_CONTAINER, WindowAlign, WindowBase, WindowClosedError, WindowConfig, WindowEvent, WindowService, WindowServiceEvent, cookieServiceFactory, initializerFactory, languageServiceFactory, localStorageServiceFactory, loggerServiceFactory, loginTokenStorageServiceFactory, nativeWindowServiceFactory, themeAssetServiceFactory, themeServiceFactory };
|
|
6884
6937
|
//# sourceMappingURL=ts-core-angular.mjs.map
|