@anglr/common 17.0.0-beta.20230711095959 → 17.0.0-beta.20230815112307
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/changelog.md +89 -3
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js +15 -2
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2022/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js +1 -1
- package/es2022/forms/src/modules/errorMessage/components/groupErrors/groupErrors.component.js.map +1 -1
- package/es2022/numeral/src/modules/numeral.module.js +4 -4
- package/es2022/numeral/src/modules/numeral.module.js.map +1 -1
- package/es2022/numeral/src/pipes/numeral.pipe.js +6 -6
- package/es2022/numeral/src/pipes/numeral.pipe.js.map +1 -1
- package/es2022/src/{modules/clickOutside/directives → directives}/clickOutside/clickOutside.directive.js +29 -22
- package/es2022/src/directives/clickOutside/clickOutside.directive.js.map +1 -0
- package/es2022/src/{modules/goBack/directives → directives}/goBack/goBack.directive.js +7 -6
- package/es2022/src/directives/goBack/goBack.directive.js.map +1 -0
- package/es2022/src/{modules/position/directives → directives}/positionTo/positionTo.directive.js +9 -8
- package/es2022/src/directives/positionTo/positionTo.directive.js.map +1 -0
- package/es2022/src/index.js +6 -5
- package/es2022/src/index.js.map +1 -1
- package/es2022/src/modules/commonUtils.module.js +21 -21
- package/es2022/src/modules/commonUtils.module.js.map +1 -1
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js +15 -15
- package/es2022/src/modules/tooltip/components/tooltip/tooltip.component.js.map +1 -1
- package/es2022/src/pipes/isNaN/isNaN.pipe.js +7 -6
- package/es2022/src/pipes/isNaN/isNaN.pipe.js.map +1 -1
- package/es2022/src/pipes/isPresent/isPresent.pipe.js +7 -6
- package/es2022/src/pipes/isPresent/isPresent.pipe.js.map +1 -1
- package/es2022/src/pipes/keys/keys.pipe.js +6 -6
- package/es2022/src/pipes/keys/keys.pipe.js.map +1 -1
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js +6 -6
- package/es2022/src/pipes/mergeCssClasses/mergeCssClasses.pipe.js.map +1 -1
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js +6 -6
- package/es2022/src/pipes/urlEncode/urlEncode.pipe.js.map +1 -1
- package/es2022/src/services/logger/logger.interface.js.map +1 -1
- package/es2022/src/services/notifications/defaultNotifications.service.js +12 -12
- package/es2022/src/services/notifications/defaultNotifications.service.js.map +1 -1
- package/es2022/src/services/notifications/notifications.interface.js +10 -1
- package/es2022/src/services/notifications/notifications.interface.js.map +1 -1
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js +22 -0
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js.map +1 -1
- package/es2022/src/services/permanentStorage/permanentStorage.interface.js.map +1 -1
- package/es2022/src/services/position/position.interface.js.map +1 -1
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js +2 -4
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js.map +1 -1
- package/es2022/src/services/stringLocalization/stringLocalization.interface.js.map +1 -1
- package/es2022/src/services/temporaryStorage/temporaryStorage.interface.js.map +1 -1
- package/es2022/src/types/providerDecoratedType.js +32 -0
- package/es2022/src/types/providerDecoratedType.js.map +1 -0
- package/es2022/src/types/providers.js +48 -0
- package/es2022/src/types/providers.js.map +1 -0
- package/es2022/store/src/index.js +1 -1
- package/es2022/store/src/index.js.map +1 -1
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js +21 -1
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js.map +1 -1
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js +21 -0
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js.map +1 -1
- package/es2022/structured-log/src/components/console/console.component.js +2 -2
- package/es2022/structured-log/src/components/console/console.component.js.map +1 -1
- package/es2022/structured-log/src/index.js +1 -0
- package/es2022/structured-log/src/index.js.map +1 -1
- package/es2022/structured-log/src/misc/providers.js +12 -0
- package/es2022/structured-log/src/misc/providers.js.map +1 -0
- package/es2022/structured-log/src/modules/consoleLog.module.js +0 -15
- package/es2022/structured-log/src/modules/consoleLog.module.js.map +1 -1
- package/es2022/structured-log/src/services/logger.service.js +21 -0
- package/es2022/structured-log/src/services/logger.service.js.map +1 -1
- package/es2022/structured-log/src/types/tokens.js +0 -9
- package/es2022/structured-log/src/types/tokens.js.map +1 -1
- package/floating-ui/src/services/floatingUiDomPosition.service.d.ts +3 -4
- package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
- package/numeral/src/modules/numeral.module.d.ts +1 -1
- package/numeral/src/pipes/numeral.pipe.d.ts +3 -3
- package/numeral/src/pipes/numeral.pipe.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/directives/clickOutside/clickOutside.directive.d.ts +48 -0
- package/src/directives/clickOutside/clickOutside.directive.d.ts.map +1 -0
- package/src/{modules/goBack/directives → directives}/goBack/goBack.directive.d.ts +3 -3
- package/src/directives/goBack/goBack.directive.d.ts.map +1 -0
- package/src/{modules/position/directives → directives}/positionTo/positionTo.directive.d.ts +4 -4
- package/src/{modules/position/directives → directives}/positionTo/positionTo.directive.d.ts.map +1 -1
- package/src/index.d.ts +9 -8
- package/src/index.d.ts.map +1 -1
- package/src/modules/commonUtils.module.d.ts +1 -1
- package/src/modules/tooltip/components/tooltip/tooltip.component.d.ts +10 -9
- package/src/modules/tooltip/components/tooltip/tooltip.component.d.ts.map +1 -1
- package/src/pipes/isNaN/isNaN.pipe.d.ts +3 -3
- package/src/pipes/isNaN/isNaN.pipe.d.ts.map +1 -1
- package/src/pipes/isPresent/isPresent.pipe.d.ts +4 -4
- package/src/pipes/isPresent/isPresent.pipe.d.ts.map +1 -1
- package/src/pipes/keys/keys.pipe.d.ts +3 -3
- package/src/pipes/keys/keys.pipe.d.ts.map +1 -1
- package/src/pipes/mergeCssClasses/mergeCssClasses.pipe.d.ts +3 -3
- package/src/pipes/mergeCssClasses/mergeCssClasses.pipe.d.ts.map +1 -1
- package/src/pipes/urlEncode/urlEncode.pipe.d.ts +3 -3
- package/src/pipes/urlEncode/urlEncode.pipe.d.ts.map +1 -1
- package/src/services/logger/logger.interface.d.ts +6 -0
- package/src/services/logger/logger.interface.d.ts.map +1 -1
- package/src/services/notifications/defaultNotifications.service.d.ts +6 -6
- package/src/services/notifications/defaultNotifications.service.d.ts.map +1 -1
- package/src/services/notifications/notifications.interface.d.ts +19 -7
- package/src/services/notifications/notifications.interface.d.ts.map +1 -1
- package/src/services/permanentStorage/cookiePermanentStorage.service.d.ts +5 -1
- package/src/services/permanentStorage/cookiePermanentStorage.service.d.ts.map +1 -1
- package/src/services/permanentStorage/permanentStorage.interface.d.ts +6 -0
- package/src/services/permanentStorage/permanentStorage.interface.d.ts.map +1 -1
- package/src/services/position/position.interface.d.ts +6 -0
- package/src/services/position/position.interface.d.ts.map +1 -1
- package/src/services/stringLocalization/noStringLocalization.service.d.ts +1 -2
- package/src/services/stringLocalization/noStringLocalization.service.d.ts.map +1 -1
- package/src/services/stringLocalization/stringLocalization.interface.d.ts +6 -0
- package/src/services/stringLocalization/stringLocalization.interface.d.ts.map +1 -1
- package/src/services/temporaryStorage/temporaryStorage.interface.d.ts +6 -0
- package/src/services/temporaryStorage/temporaryStorage.interface.d.ts.map +1 -1
- package/src/types/providerDecoratedType.d.ts +12 -0
- package/src/types/providerDecoratedType.d.ts.map +1 -0
- package/src/types/providers.d.ts +32 -0
- package/src/types/providers.d.ts.map +1 -0
- package/store/src/index.d.ts +1 -1
- package/store/src/index.d.ts.map +1 -1
- package/store/src/services/permanentStorage/localPermanentStorage.service.d.ts +5 -1
- package/store/src/services/permanentStorage/localPermanentStorage.service.d.ts.map +1 -1
- package/store/src/services/temporaryStorage/sessionTemporaryStorage.service.d.ts +5 -1
- package/store/src/services/temporaryStorage/sessionTemporaryStorage.service.d.ts.map +1 -1
- package/structured-log/src/components/console/console.component.d.ts.map +1 -1
- package/structured-log/src/components/console/console.component.html +1 -1
- package/structured-log/src/index.d.ts +1 -0
- package/structured-log/src/index.d.ts.map +1 -1
- package/structured-log/src/misc/providers.d.ts +6 -0
- package/structured-log/src/misc/providers.d.ts.map +1 -0
- package/structured-log/src/modules/consoleLog.module.d.ts +0 -5
- package/structured-log/src/modules/consoleLog.module.d.ts.map +1 -1
- package/structured-log/src/services/logger.service.d.ts +5 -1
- package/structured-log/src/services/logger.service.d.ts.map +1 -1
- package/structured-log/src/types/tokens.d.ts +0 -4
- package/structured-log/src/types/tokens.d.ts.map +1 -1
- package/version.bak +1 -1
- package/es2022/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.js.map +0 -1
- package/es2022/src/modules/clickOutside/modules/clickOutside.module.js +0 -25
- package/es2022/src/modules/clickOutside/modules/clickOutside.module.js.map +0 -1
- package/es2022/src/modules/goBack/directives/goBack/goBack.directive.js.map +0 -1
- package/es2022/src/modules/goBack/directives/index.js +0 -2
- package/es2022/src/modules/goBack/directives/index.js.map +0 -1
- package/es2022/src/modules/goBack/index.js +0 -3
- package/es2022/src/modules/goBack/index.js.map +0 -1
- package/es2022/src/modules/goBack/modules/goBack.module.js +0 -24
- package/es2022/src/modules/goBack/modules/goBack.module.js.map +0 -1
- package/es2022/src/modules/goBack/modules/index.js +0 -2
- package/es2022/src/modules/goBack/modules/index.js.map +0 -1
- package/es2022/src/modules/position/directives/index.js +0 -2
- package/es2022/src/modules/position/directives/index.js.map +0 -1
- package/es2022/src/modules/position/directives/positionTo/positionTo.directive.js.map +0 -1
- package/es2022/src/modules/position/index.js +0 -3
- package/es2022/src/modules/position/index.js.map +0 -1
- package/es2022/src/modules/position/modules/index.js +0 -2
- package/es2022/src/modules/position/modules/index.js.map +0 -1
- package/es2022/src/modules/position/modules/position.module.js +0 -25
- package/es2022/src/modules/position/modules/position.module.js.map +0 -1
- package/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.d.ts +0 -47
- package/src/modules/clickOutside/directives/clickOutside/clickOutside.directive.d.ts.map +0 -1
- package/src/modules/clickOutside/modules/clickOutside.module.d.ts +0 -11
- package/src/modules/clickOutside/modules/clickOutside.module.d.ts.map +0 -1
- package/src/modules/goBack/directives/goBack/goBack.directive.d.ts.map +0 -1
- package/src/modules/goBack/directives/index.d.ts +0 -2
- package/src/modules/goBack/directives/index.d.ts.map +0 -1
- package/src/modules/goBack/index.d.ts +0 -3
- package/src/modules/goBack/index.d.ts.map +0 -1
- package/src/modules/goBack/modules/goBack.module.d.ts +0 -11
- package/src/modules/goBack/modules/goBack.module.d.ts.map +0 -1
- package/src/modules/goBack/modules/index.d.ts +0 -2
- package/src/modules/goBack/modules/index.d.ts.map +0 -1
- package/src/modules/position/directives/index.d.ts +0 -2
- package/src/modules/position/directives/index.d.ts.map +0 -1
- package/src/modules/position/index.d.ts +0 -3
- package/src/modules/position/index.d.ts.map +0 -1
- package/src/modules/position/modules/index.d.ts +0 -2
- package/src/modules/position/modules/index.d.ts.map +0 -1
- package/src/modules/position/modules/position.module.d.ts +0 -11
- package/src/modules/position/modules/position.module.d.ts.map +0 -1
package/es2022/src/index.js
CHANGED
|
@@ -5,28 +5,29 @@ export { CommonUtilsModule } from './modules/commonUtils.module';
|
|
|
5
5
|
export { DebugDataModule } from './modules/debugData/modules/debugData.module';
|
|
6
6
|
export { DebugDataComponent } from './modules/debugData/components/debugData/debugData.component';
|
|
7
7
|
export { DebugDataEnabledService } from './modules/debugData/services/debugDataEnabled/debugDataEnabled.service';
|
|
8
|
-
export { ClickOutsideDirective } from './modules/clickOutside/directives/clickOutside/clickOutside.directive';
|
|
9
|
-
export { ClickOutsideModule } from './modules/clickOutside/modules/clickOutside.module';
|
|
10
8
|
export { MultiButtonComponent } from './modules/multiButton/components/multiButton/multiButton.component';
|
|
11
9
|
export { MULTI_BUTTON_CSS_CLASSES } from './modules/multiButton/misc/tokens';
|
|
12
10
|
export { MultiButtonModule } from './modules/multiButton/modules/multiButton.module';
|
|
13
11
|
export * from './decorators';
|
|
14
12
|
export * from './modules/castPipes';
|
|
15
|
-
export * from './modules/goBack';
|
|
16
|
-
export * from './modules/position';
|
|
17
13
|
export * from './modules/progressIndicator';
|
|
18
14
|
export * from './modules/tooltip';
|
|
19
15
|
export * from './pipes';
|
|
20
16
|
export * from './types/host';
|
|
21
17
|
export * from './types/styles';
|
|
22
18
|
export * from './types/tokens';
|
|
19
|
+
export * from './types/providers';
|
|
20
|
+
export * from './types/providerDecoratedType';
|
|
23
21
|
export * from './utils';
|
|
24
22
|
export { CookieService } from './services/cookies/cookies.service';
|
|
25
23
|
export { StatusCodeService } from './services/statusCode/statusCode.service';
|
|
26
|
-
export { CookiePermanentStorageService } from './services/permanentStorage';
|
|
24
|
+
export { CookiePermanentStorageService, CookiePermanentStorage } from './services/permanentStorage';
|
|
27
25
|
export { MemoryTemporaryStorageService } from './services/temporaryStorage';
|
|
28
26
|
export { NoStringLocalizationService } from './services/stringLocalization';
|
|
29
27
|
export * from './directives/bodyRender/bodyRender.directive';
|
|
28
|
+
export * from './directives/clickOutside/clickOutside.directive';
|
|
29
|
+
export * from './directives/goBack/goBack.directive';
|
|
30
|
+
export * from './directives/positionTo/positionTo.directive';
|
|
30
31
|
export { NgComponentOutletEx } from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';
|
|
31
32
|
export { APP_STABLE, extractAppStableResolve, runWhenModuleStable, runWhenAppStable } from './utils';
|
|
32
33
|
export { DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, NotificationsOptions } from './services/notifications';
|
package/es2022/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,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AsB,EAAC,MAAM,6BAA6B,CAAC;AAC1I,OAAO,EAAC,6BAA6B,EAAyC,MAAM,6BAA6B,CAAC;AAClH,OAAO,EAAC,2BAA2B,EAA6C,MAAM,+BAA+B,CAAC;AAEtH,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,OAAO,EAAC,mBAAmB,EAAC,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAC,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAC;AACnG,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAiB,oBAAoB,EAAuF,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC;AAEpC,sBAAsB;AACtB,0BAA0B","sourcesContent":["export {GlobalizationService} from './services/globalization/globalization.service';\nexport {CommonDynamicModule} from './modules/commonDynamic.module';\nexport {CommonLocalizeModule} from './modules/commonLocalize.module';\nexport {CommonUtilsModule} from './modules/commonUtils.module';\nexport {DebugDataModule} from './modules/debugData/modules/debugData.module';\nexport {DebugDataComponent} from './modules/debugData/components/debugData/debugData.component';\nexport {DebugDataEnabledService} from './modules/debugData/services/debugDataEnabled/debugDataEnabled.service';\nexport {MultiButtonComponent} from './modules/multiButton/components/multiButton/multiButton.component';\nexport {MultiButtonCssClasses} from './modules/multiButton/components/multiButton/multiButton.interface';\nexport {MULTI_BUTTON_CSS_CLASSES} from './modules/multiButton/misc/tokens';\nexport {MultiButtonModule} from './modules/multiButton/modules/multiButton.module';\nexport * from './decorators';\nexport * from './modules/castPipes';\nexport * from './modules/progressIndicator';\nexport * from './modules/tooltip';\nexport * from './pipes';\nexport * from './types/host';\nexport * from './types/styles';\nexport * from './types/tokens';\nexport * from './types/providers';\nexport * from './types/providerDecoratedType';\nexport * from './utils';\nexport {CookieService} from './services/cookies/cookies.service';\nexport {StatusCodeService} from './services/statusCode/statusCode.service';\nexport {CookiePermanentStorageService, PermanentStorage, PermanentStorageType, CookiePermanentStorage} from './services/permanentStorage';\nexport {MemoryTemporaryStorageService, TemporaryStorage, TemporaryStorageType} from './services/temporaryStorage';\nexport {NoStringLocalizationService, StringLocalization, StringLocalizationType} from './services/stringLocalization';\nexport {Logger, LoggerType} from './services/logger';\nexport * from './directives/bodyRender/bodyRender.directive';\nexport * from './directives/clickOutside/clickOutside.directive';\nexport * from './directives/goBack/goBack.directive';\nexport * from './directives/positionTo/positionTo.directive';\nexport {NgComponentOutletEx} from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';\nexport {APP_STABLE, extractAppStableResolve, runWhenModuleStable, runWhenAppStable} from './utils';\nexport {DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, Notifications, NotificationsOptions, NotificationsProvider, NotificationsScopeProvider, NotificationsScopeProviderFactory} from './services/notifications';\nexport * from './services/position';\n\n//TODO: any to unknown\n//TODO: strict null checks"]}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { IsNaNSAPipe, IsPresentSAPipe, UrlEncodeSAPipe, MergeCssClassesSAPipe, KeysSAPipe } from '../pipes';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
5
|
* Module for common utility stuff
|
|
6
6
|
*/
|
|
7
7
|
class CommonUtilsModule {
|
|
8
8
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CommonUtilsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: CommonUtilsModule,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: CommonUtilsModule, imports: [IsNaNSAPipe,
|
|
10
|
+
IsPresentSAPipe,
|
|
11
|
+
UrlEncodeSAPipe,
|
|
12
|
+
MergeCssClassesSAPipe,
|
|
13
|
+
KeysSAPipe], exports: [IsNaNSAPipe,
|
|
14
|
+
IsPresentSAPipe,
|
|
15
|
+
UrlEncodeSAPipe,
|
|
16
|
+
MergeCssClassesSAPipe,
|
|
17
|
+
KeysSAPipe] });
|
|
18
18
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CommonUtilsModule });
|
|
19
19
|
}
|
|
20
20
|
export { CommonUtilsModule };
|
|
21
21
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CommonUtilsModule, decorators: [{
|
|
22
22
|
type: NgModule,
|
|
23
23
|
args: [{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
imports: [
|
|
25
|
+
IsNaNSAPipe,
|
|
26
|
+
IsPresentSAPipe,
|
|
27
|
+
UrlEncodeSAPipe,
|
|
28
|
+
MergeCssClassesSAPipe,
|
|
29
|
+
KeysSAPipe,
|
|
30
30
|
],
|
|
31
31
|
exports: [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
IsNaNSAPipe,
|
|
33
|
+
IsPresentSAPipe,
|
|
34
|
+
UrlEncodeSAPipe,
|
|
35
|
+
MergeCssClassesSAPipe,
|
|
36
|
+
KeysSAPipe,
|
|
37
37
|
]
|
|
38
38
|
}]
|
|
39
39
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonUtils.module.js","sourceRoot":"","sources":["../../../src/modules/commonUtils.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"commonUtils.module.js","sourceRoot":"","sources":["../../../src/modules/commonUtils.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,qBAAqB,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;;AAE1G;;GAEG;AACH,MAmBa,iBAAiB;uGAAjB,iBAAiB;wGAAjB,iBAAiB,YAftB,WAAW;YACX,eAAe;YACf,eAAe;YACf,qBAAqB;YACrB,UAAU,aAIV,WAAW;YACX,eAAe;YACf,eAAe;YACf,qBAAqB;YACrB,UAAU;wGAGL,iBAAiB;;SAAjB,iBAAiB;2FAAjB,iBAAiB;kBAnB7B,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,WAAW;wBACX,eAAe;wBACf,eAAe;wBACf,qBAAqB;wBACrB,UAAU;qBACb;oBACD,OAAO,EACP;wBACI,WAAW;wBACX,eAAe;wBACf,eAAe;wBACf,qBAAqB;wBACrB,UAAU;qBACb;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {IsNaNSAPipe, IsPresentSAPipe, UrlEncodeSAPipe, MergeCssClassesSAPipe, KeysSAPipe} from '../pipes';\n\n/**\n * Module for common utility stuff\n */\n@NgModule(\n{\n imports:\n [\n IsNaNSAPipe,\n IsPresentSAPipe,\n UrlEncodeSAPipe,\n MergeCssClassesSAPipe,\n KeysSAPipe,\n ],\n exports: \n [\n IsNaNSAPipe,\n IsPresentSAPipe,\n UrlEncodeSAPipe,\n MergeCssClassesSAPipe,\n KeysSAPipe,\n ]\n})\nexport class CommonUtilsModule\n{\n}"]}
|
|
@@ -5,17 +5,17 @@ import * as i1 from "@angular/common";
|
|
|
5
5
|
* Component used for displaying tooltip content
|
|
6
6
|
*/
|
|
7
7
|
class TooltipComponent {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
changeDetector;
|
|
9
|
+
element;
|
|
10
10
|
//######################### protected fields #########################
|
|
11
11
|
/**
|
|
12
12
|
* Called when mouse enter tooltip component, hover
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
enterFn = () => null;
|
|
15
15
|
/**
|
|
16
16
|
* Called when mouse leaves tooltip component
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
leaveFn = () => null;
|
|
19
19
|
//######################### public properties - implementation of TooltipRenderer #########################
|
|
20
20
|
/**
|
|
21
21
|
* Data that are rendered in tooltip
|
|
@@ -34,9 +34,9 @@ class TooltipComponent {
|
|
|
34
34
|
*/
|
|
35
35
|
cssClass;
|
|
36
36
|
//######################### constructor #########################
|
|
37
|
-
constructor(
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
37
|
+
constructor(changeDetector, element) {
|
|
38
|
+
this.changeDetector = changeDetector;
|
|
39
|
+
this.element = element;
|
|
40
40
|
}
|
|
41
41
|
//######################### public methods - implementation of TooltipRenderer #########################
|
|
42
42
|
/**
|
|
@@ -45,32 +45,32 @@ class TooltipComponent {
|
|
|
45
45
|
* @param leave - Called when mouse leaves tooltip component
|
|
46
46
|
*/
|
|
47
47
|
registerHoverEvents(enter, leave) {
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
48
|
+
this.enterFn = enter;
|
|
49
|
+
this.leaveFn = leave;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* @inheritdoc
|
|
53
53
|
*/
|
|
54
54
|
invalidateVisuals() {
|
|
55
55
|
if (this.cssClass) {
|
|
56
|
-
this.
|
|
56
|
+
this.element.nativeElement.classList.add(this.cssClass);
|
|
57
57
|
}
|
|
58
|
-
this.
|
|
58
|
+
this.changeDetector.detectChanges();
|
|
59
59
|
}
|
|
60
|
-
//#########################
|
|
60
|
+
//######################### protected methods - host #########################
|
|
61
61
|
/**
|
|
62
62
|
* Handles mouse enter event over tooltip
|
|
63
63
|
* @internal
|
|
64
64
|
*/
|
|
65
65
|
mouseEnter() {
|
|
66
|
-
this.
|
|
66
|
+
this.enterFn();
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Handles mouse leave event over tooltip
|
|
70
70
|
* @internal
|
|
71
71
|
*/
|
|
72
72
|
mouseLeave() {
|
|
73
|
-
this.
|
|
73
|
+
this.leaveFn();
|
|
74
74
|
}
|
|
75
75
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: TooltipComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
76
76
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.4", type: TooltipComponent, selector: "tooltip-popup", host: { listeners: { "mouseenter": "mouseEnter()", "mouseleave": "mouseLeave()" } }, ngImport: i0, template: "<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>", styles: [":host\r\n{\r\n display: block;\r\n position: absolute;\r\n padding: 2px 4px;\r\n border-radius: 3px;\r\n font-size: 0.9em;\r\n max-width: 300px;\r\n user-select: text;\r\n}"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.component.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/components/tooltip/tooltip.component.ts","../../../../../../src/modules/tooltip/components/tooltip/tooltip.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAe,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;;;
|
|
1
|
+
{"version":3,"file":"tooltip.component.js","sourceRoot":"","sources":["../../../../../../src/modules/tooltip/components/tooltip/tooltip.component.ts","../../../../../../src/modules/tooltip/components/tooltip/tooltip.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAe,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;;;AAM3H;;GAEG;AACH,MAOa,gBAAgB;IAqCH;IACA;IApCtB,sEAAsE;IAEtE;;OAEG;IACO,OAAO,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;IAE3C;;OAEG;IACO,OAAO,GAAe,GAAG,EAAE,CAAC,IAAI,CAAC;IAE3C,2GAA2G;IAE3G;;OAEG;IACI,IAAI,CAAuB;IAElC;;OAEG;IACI,QAAQ,CAA4D;IAE3E;;OAEG;IACI,SAAS,GAAY,KAAK,CAAC;IAElC;;OAEG;IACI,QAAQ,CAAwB;IAEvC,iEAAiE;IACjE,YAAsB,cAAiC,EACjC,OAAgC;QADhC,mBAAc,GAAd,cAAc,CAAmB;QACjC,YAAO,GAAP,OAAO,CAAyB;IAEtD,CAAC;IAED,wGAAwG;IAExG;;;;OAIG;IACI,mBAAmB,CAAC,KAAiB,EAAE,KAAiB;QAE3D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,iBAAiB;QAEpB,IAAG,IAAI,CAAC,QAAQ,EAChB;YACI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC3D;QAED,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;IACxC,CAAC;IAED,8EAA8E;IAE9E;;;OAGG;IAEO,UAAU;QAEhB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED;;;OAGG;IAEO,UAAU;QAEhB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;uGAxFQ,gBAAgB;2FAAhB,gBAAgB,0IChB7B,uRAKc;;SDWD,gBAAgB;2FAAhB,gBAAgB;kBAP5B,SAAS;+BAEI,eAAe,mBAGR,uBAAuB,CAAC,MAAM;iIA6ErC,UAAU;sBADnB,YAAY;uBAAC,YAAY;gBAWhB,UAAU;sBADnB,YAAY;uBAAC,YAAY","sourcesContent":["import {Component, ChangeDetectionStrategy, TemplateRef, ChangeDetectorRef, ElementRef, HostListener} from '@angular/core';\nimport {Invalidatable} from '@jscrpt/common';\n\nimport {TooltipTemplateContext} from '../../directives';\nimport {TooltipRenderer} from '../../misc/tooltip.interface';\n\n/**\n * Component used for displaying tooltip content\n */\n@Component(\n{\n selector: 'tooltip-popup',\n templateUrl: 'tooltip.component.html',\n styleUrls: ['tooltip.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TooltipComponent<TData = any> implements TooltipRenderer<TData>, Invalidatable\n{\n //######################### protected fields #########################\n\n /**\n * Called when mouse enter tooltip component, hover\n */\n protected enterFn: () => void = () => null;\n\n /**\n * Called when mouse leaves tooltip component\n */\n protected leaveFn: () => void = () => null;\n\n //######################### public properties - implementation of TooltipRenderer #########################\n\n /**\n * Data that are rendered in tooltip\n */\n public data: TData|null|undefined;\n\n /**\n * Template used for rendering tooltip\n */\n public template: TemplateRef<TooltipTemplateContext<TData>>|null|undefined;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n public allowHtml: boolean = false;\n\n /**\n * Css class that is applied to tooltip renderer component\n */\n public cssClass: string|null|undefined;\n\n //######################### constructor #########################\n constructor(protected changeDetector: ChangeDetectorRef,\n protected element: ElementRef<HTMLElement>)\n {\n }\n\n //######################### public methods - implementation of TooltipRenderer #########################\n\n /**\n * Registers handlers that allows reaction to entering or leaving tooltip\n * @param enter - Called when mouse enter tooltip component, hover\n * @param leave - Called when mouse leaves tooltip component\n */\n public registerHoverEvents(enter: () => void, leave: () => void): void\n {\n this.enterFn = enter;\n this.leaveFn = leave;\n }\n\n /**\n * @inheritdoc\n */\n public invalidateVisuals(): void\n {\n if(this.cssClass)\n {\n this.element.nativeElement.classList.add(this.cssClass);\n }\n\n this.changeDetector.detectChanges();\n }\n\n //######################### protected methods - host #########################\n\n /**\n * Handles mouse enter event over tooltip\n * @internal\n */\n @HostListener('mouseenter')\n protected mouseEnter(): void\n {\n this.enterFn();\n }\n\n /**\n * Handles mouse leave event over tooltip\n * @internal\n */\n @HostListener('mouseleave')\n protected mouseLeave(): void\n {\n this.leaveFn();\n }\n}","<div *ngIf=\"!template && !allowHtml\">{{data}}</div>\r\n<div *ngIf=\"!template && allowHtml\" [innerHTML]=\"data\"></div>\r\n\r\n<ng-template [ngIf]=\"template\">\r\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: data}\"></ng-container>\r\n</ng-template>"]}
|
|
@@ -3,7 +3,7 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns true if object is NaN
|
|
5
5
|
*/
|
|
6
|
-
class
|
|
6
|
+
class IsNaNSAPipe {
|
|
7
7
|
//######################### public methods #########################
|
|
8
8
|
/**
|
|
9
9
|
* Checks whether is value NaN
|
|
@@ -12,14 +12,15 @@ class IsNaNPipe {
|
|
|
12
12
|
transform(value) {
|
|
13
13
|
return isNaN(value);
|
|
14
14
|
}
|
|
15
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
16
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type:
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsNaNSAPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
16
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: IsNaNSAPipe, isStandalone: true, name: "isNaN" });
|
|
17
17
|
}
|
|
18
|
-
export {
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
18
|
+
export { IsNaNSAPipe };
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsNaNSAPipe, decorators: [{
|
|
20
20
|
type: Pipe,
|
|
21
21
|
args: [{
|
|
22
|
-
name: 'isNaN'
|
|
22
|
+
name: 'isNaN',
|
|
23
|
+
standalone: true
|
|
23
24
|
}]
|
|
24
25
|
}] });
|
|
25
26
|
//# sourceMappingURL=isNaN.pipe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isNaN.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/isNaN/isNaN.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;;AAElD;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"isNaN.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/isNaN/isNaN.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;;AAElD;;GAEG;AACH,MAKa,WAAW;IAEpB,oEAAoE;IAEpE;;;OAGG;IACI,SAAS,CAAC,KAAU;QAEvB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;uGAXQ,WAAW;qGAAX,WAAW;;SAAX,WAAW;2FAAX,WAAW;kBALvB,IAAI;mBACL;oBACI,IAAI,EAAE,OAAO;oBACb,UAAU,EAAE,IAAI;iBACnB","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\n\n/**\n * Returns true if object is NaN\n */\n@Pipe(\n{\n name: 'isNaN',\n standalone: true\n})\nexport class IsNaNSAPipe implements PipeTransform\n{\n //######################### public methods #########################\n\n /**\n * Checks whether is value NaN\n * @param value - Value to be checked\n */\n public transform(value: any): boolean\n {\n return isNaN(value);\n }\n}"]}
|
|
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
/**
|
|
5
5
|
* Returns true if object is different from null or undefined
|
|
6
6
|
*/
|
|
7
|
-
class
|
|
7
|
+
class IsPresentSAPipe {
|
|
8
8
|
//######################### public methods #########################
|
|
9
9
|
/**
|
|
10
10
|
* Checks whether is value different from null or undefined
|
|
@@ -13,14 +13,15 @@ class IsPresentPipe {
|
|
|
13
13
|
transform(value) {
|
|
14
14
|
return isPresent(value);
|
|
15
15
|
}
|
|
16
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
17
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type:
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsPresentSAPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
17
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: IsPresentSAPipe, isStandalone: true, name: "isPresent" });
|
|
18
18
|
}
|
|
19
|
-
export {
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
19
|
+
export { IsPresentSAPipe };
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: IsPresentSAPipe, decorators: [{
|
|
21
21
|
type: Pipe,
|
|
22
22
|
args: [{
|
|
23
|
-
name: 'isPresent'
|
|
23
|
+
name: 'isPresent',
|
|
24
|
+
standalone: true,
|
|
24
25
|
}]
|
|
25
26
|
}] });
|
|
26
27
|
//# sourceMappingURL=isPresent.pipe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPresent.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/isPresent/isPresent.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;;AAEzC;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"isPresent.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/isPresent/isPresent.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;;AAEzC;;GAEG;AACH,MAKa,eAAe;IAExB,oEAAoE;IAEpE;;;OAGG;IACI,SAAS,CAAC,KAAc;QAE3B,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;uGAXQ,eAAe;qGAAf,eAAe;;SAAf,eAAe;2FAAf,eAAe;kBAL3B,IAAI;mBACL;oBACI,IAAI,EAAE,WAAW;oBACjB,UAAU,EAAE,IAAI;iBACnB","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\nimport {isPresent} from '@jscrpt/common';\n\n/**\n * Returns true if object is different from null or undefined\n */\n@Pipe(\n{\n name: 'isPresent',\n standalone: true,\n})\nexport class IsPresentSAPipe implements PipeTransform\n{\n //######################### public methods #########################\n\n /**\n * Checks whether is value different from null or undefined\n * @param value - Value to be checked\n */\n public transform(value: unknown): boolean\n {\n return isPresent(value);\n }\n}"]}
|
|
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
/**
|
|
5
5
|
* Gets object keys/property names
|
|
6
6
|
*/
|
|
7
|
-
class
|
|
7
|
+
class KeysSAPipe {
|
|
8
8
|
/**
|
|
9
9
|
* Gets object keys/property names
|
|
10
10
|
* @param value - Object containing keys which will be obtained
|
|
@@ -15,12 +15,12 @@ class KeysPipe {
|
|
|
15
15
|
}
|
|
16
16
|
return Object.keys(value);
|
|
17
17
|
}
|
|
18
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
19
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type:
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: KeysSAPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
19
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: KeysSAPipe, isStandalone: true, name: "keys" });
|
|
20
20
|
}
|
|
21
|
-
export {
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
21
|
+
export { KeysSAPipe };
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: KeysSAPipe, decorators: [{
|
|
23
23
|
type: Pipe,
|
|
24
|
-
args: [{ name: 'keys' }]
|
|
24
|
+
args: [{ name: 'keys', standalone: true }]
|
|
25
25
|
}] });
|
|
26
26
|
//# sourceMappingURL=keys.pipe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/keys/keys.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAa,OAAO,EAAC,MAAM,gBAAgB,CAAC;;AAEnD;;GAEG;AACH,MACa,
|
|
1
|
+
{"version":3,"file":"keys.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/keys/keys.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAa,OAAO,EAAC,MAAM,gBAAgB,CAAC;;AAEnD;;GAEG;AACH,MACa,UAAU;IAEnB;;;OAGG;IACI,SAAS,CAAC,KAAsB;QAEnC,IAAG,OAAO,CAAC,KAAK,CAAC,EACjB;YACI,OAAO,EAAE,CAAC;SACb;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;uGAdQ,UAAU;qGAAV,UAAU;;SAAV,UAAU;2FAAV,UAAU;kBADtB,IAAI;mBAAC,EAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\nimport {Dictionary, isBlank} from '@jscrpt/common';\n\n/**\n * Gets object keys/property names\n */\n@Pipe({name: 'keys', standalone: true})\nexport class KeysSAPipe implements PipeTransform\n{\n /**\n * Gets object keys/property names\n * @param value - Object containing keys which will be obtained\n */\n public transform(value: Dictionary<any>): string[]\n {\n if(isBlank(value))\n {\n return [];\n }\n\n return Object.keys(value);\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
/**
|
|
5
5
|
* Merges css classes that will be passed to ngClass
|
|
6
6
|
*/
|
|
7
|
-
class
|
|
7
|
+
class MergeCssClassesSAPipe {
|
|
8
8
|
/**
|
|
9
9
|
* Merges css classes that will be passed to ngClass
|
|
10
10
|
* @param value - Css class to be merged
|
|
@@ -33,12 +33,12 @@ class MergeCssClassesPipe {
|
|
|
33
33
|
});
|
|
34
34
|
return result;
|
|
35
35
|
}
|
|
36
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
37
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type:
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: MergeCssClassesSAPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
37
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: MergeCssClassesSAPipe, isStandalone: true, name: "mergeCssClasses" });
|
|
38
38
|
}
|
|
39
|
-
export {
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
39
|
+
export { MergeCssClassesSAPipe };
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: MergeCssClassesSAPipe, decorators: [{
|
|
41
41
|
type: Pipe,
|
|
42
|
-
args: [{ name: 'mergeCssClasses' }]
|
|
42
|
+
args: [{ name: 'mergeCssClasses', standalone: true }]
|
|
43
43
|
}] });
|
|
44
44
|
//# sourceMappingURL=mergeCssClasses.pipe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeCssClasses.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/mergeCssClasses/mergeCssClasses.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAa,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAOpD;;GAEG;AACH,MACa,
|
|
1
|
+
{"version":3,"file":"mergeCssClasses.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/mergeCssClasses/mergeCssClasses.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAa,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAOpD;;GAEG;AACH,MACa,qBAAqB;IAE9B;;;;OAIG;IACI,SAAS,CAAC,KAAkB,EAAE,YAA2B;QAE5D,MAAM,MAAM,GAAwB,EAAE,CAAC;QAEvC,SAAS,YAAY,CAAC,GAAgB;YAElC,IAAG,QAAQ,CAAC,GAAG,CAAC,EAChB;gBACI,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;aACtB;iBACI,IAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAC1B;gBACI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;oBAEnB,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;gBAC5B,CAAC,CAAC,CAAC;aACN;iBAED;gBACI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;oBAEhC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACrC,CAAC,CAAC,CAAC;aACN;QACL,CAAC;QAED,YAAY,CAAC,KAAK,CAAC,CAAC;QAEpB,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAEvB,YAAY,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAClB,CAAC;uGAzCQ,qBAAqB;qGAArB,qBAAqB;;SAArB,qBAAqB;2FAArB,qBAAqB;kBADjC,IAAI;mBAAC,EAAC,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAC","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\nimport {Dictionary, isString} from '@jscrpt/common';\n\n/**\n * Type of css class definition for NgClass and merge\n */\nexport type NgClassType = string | string[] | Dictionary<boolean>;\n\n/**\n * Merges css classes that will be passed to ngClass\n */\n@Pipe({name: 'mergeCssClasses', standalone: true})\nexport class MergeCssClassesSAPipe implements PipeTransform\n{\n /**\n * Merges css classes that will be passed to ngClass\n * @param value - Css class to be merged\n * @param mergeClasses - Definition of css classes that will be merged\n */\n public transform(value: NgClassType, mergeClasses: NgClassType[]): Dictionary<boolean>\n {\n const result: Dictionary<boolean> = {};\n\n function updateResult(val: NgClassType): void\n {\n if(isString(val))\n {\n result[val] = true;\n }\n else if(Array.isArray(val))\n {\n val.forEach(cssClass =>\n {\n result[cssClass] = true;\n });\n }\n else\n {\n Object.keys(val).forEach(cssClass =>\n {\n result[cssClass] = val[cssClass];\n });\n }\n }\n\n updateResult(value);\n\n mergeClasses.forEach(itm =>\n {\n updateResult(itm);\n });\n\n return result;\n }\n}"]}
|
|
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
/**
|
|
5
5
|
* Pipe that encodes data for url
|
|
6
6
|
*/
|
|
7
|
-
class
|
|
7
|
+
class UrlEncodeSAPipe {
|
|
8
8
|
//######################### public methods #########################
|
|
9
9
|
/**
|
|
10
10
|
* Encodes data for URL
|
|
@@ -16,12 +16,12 @@ class UrlEncodePipe {
|
|
|
16
16
|
}
|
|
17
17
|
return serializeToUrlQuery(value);
|
|
18
18
|
}
|
|
19
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
20
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type:
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UrlEncodeSAPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
20
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: UrlEncodeSAPipe, isStandalone: true, name: "urlEncode" });
|
|
21
21
|
}
|
|
22
|
-
export {
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
22
|
+
export { UrlEncodeSAPipe };
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: UrlEncodeSAPipe, decorators: [{
|
|
24
24
|
type: Pipe,
|
|
25
|
-
args: [{ name: 'urlEncode' }]
|
|
25
|
+
args: [{ name: 'urlEncode', standalone: true }]
|
|
26
26
|
}] });
|
|
27
27
|
//# sourceMappingURL=urlEncode.pipe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlEncode.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/urlEncode/urlEncode.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;;AAEnD;;GAEG;AACH,MACa,
|
|
1
|
+
{"version":3,"file":"urlEncode.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/urlEncode/urlEncode.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAgB,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;;AAEnD;;GAEG;AACH,MACa,eAAe;IAExB,oEAAoE;IAEpE;;;OAGG;IACI,SAAS,CAAC,KAAa;QAE1B,IAAG,CAAC,KAAK,EACT;YACI,OAAO,EAAE,CAAC;SACb;QAED,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;uGAhBQ,eAAe;qGAAf,eAAe;;SAAf,eAAe;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAC","sourcesContent":["import {Pipe, PipeTransform} from '@angular/core';\nimport {serializeToUrlQuery} from '@jscrpt/common';\n\n/**\n * Pipe that encodes data for url\n */\n@Pipe({name: 'urlEncode', standalone: true})\nexport class UrlEncodeSAPipe implements PipeTransform\n{\n //######################### public methods #########################\n \n /**\n * Encodes data for URL\n * @param value - Value to be encoded\n */ \n public transform(value: object): string\n {\n if(!value)\n {\n return '';\n }\n\n return serializeToUrlQuery(value);\n }\n}\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.interface.js","sourceRoot":"","sources":["../../../../src/services/logger/logger.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for general logger\n */\nexport interface Logger\n{\n //######################### public methods #########################\n\n /**\n * Logs an event with the LogEventLevel.fatal severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n fatal(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.fatal severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n fatal(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.error severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n error(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.error severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n error(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.warning severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n warn(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.warning severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n warn(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.information severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n info(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.information severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n info(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.debug severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n debug(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.debug severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n debug(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.verbose severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n verbose(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.verbose severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n verbose(error: Error, messageTemplate: string, ...properties: any[]): void;\n}"]}
|
|
1
|
+
{"version":3,"file":"logger.interface.js","sourceRoot":"","sources":["../../../../src/services/logger/logger.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from '@angular/core';\n\n/**\n * Interface for general logger\n */\nexport interface Logger\n{\n //######################### public methods #########################\n\n /**\n * Logs an event with the LogEventLevel.fatal severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n fatal(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.fatal severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n fatal(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.error severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n error(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.error severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n error(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.warning severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n warn(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.warning severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n warn(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.information severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n info(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.information severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n info(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.debug severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n debug(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.debug severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n debug(error: Error, messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.verbose severity.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n verbose(messageTemplate: string, ...properties: any[]): void;\n\n /**\n * Logs an event with the LogEventLevel.verbose severity.\n * @param error - Error for the log event.\n * @param messageTemplate - Message template for the log event.\n * @param properties - Properties that can be used to render the message template.\n */\n verbose(error: Error, messageTemplate: string, ...properties: any[]): void;\n}\n\n/**\n * Used for restriction of logger provider type only for type decorated with logger provider\n */\nexport interface LoggerType extends Type<unknown>\n{\n}"]}
|
|
@@ -62,8 +62,8 @@ class DefaultNotificationsService {
|
|
|
62
62
|
/**
|
|
63
63
|
* @inheritdoc
|
|
64
64
|
*/
|
|
65
|
-
message(message, severity) {
|
|
66
|
-
const notification = new Notification(message, severity);
|
|
65
|
+
message(message, severity, parameter) {
|
|
66
|
+
const notification = new Notification(message, severity, parameter);
|
|
67
67
|
this._notifications.push(notification);
|
|
68
68
|
this._notificationsChange.next();
|
|
69
69
|
// set timeout
|
|
@@ -77,32 +77,32 @@ class DefaultNotificationsService {
|
|
|
77
77
|
/**
|
|
78
78
|
* @inheritdoc
|
|
79
79
|
*/
|
|
80
|
-
default(message) {
|
|
81
|
-
return this.message(message, NotificationSeverity.Default);
|
|
80
|
+
default(message, parameter) {
|
|
81
|
+
return this.message(message, NotificationSeverity.Default, parameter);
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* @inheritdoc
|
|
85
85
|
*/
|
|
86
|
-
success(message) {
|
|
87
|
-
return this.message(message, NotificationSeverity.Success);
|
|
86
|
+
success(message, parameter) {
|
|
87
|
+
return this.message(message, NotificationSeverity.Success, parameter);
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* @inheritdoc
|
|
91
91
|
*/
|
|
92
|
-
error(message) {
|
|
93
|
-
return this.message(message, NotificationSeverity.Error);
|
|
92
|
+
error(message, parameter) {
|
|
93
|
+
return this.message(message, NotificationSeverity.Error, parameter);
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* @inheritdoc
|
|
97
97
|
*/
|
|
98
|
-
info(message) {
|
|
99
|
-
return this.message(message, NotificationSeverity.Info);
|
|
98
|
+
info(message, parameter) {
|
|
99
|
+
return this.message(message, NotificationSeverity.Info, parameter);
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* @inheritdoc
|
|
103
103
|
*/
|
|
104
|
-
warning(message) {
|
|
105
|
-
return this.message(message, NotificationSeverity.Warning);
|
|
104
|
+
warning(message, parameter) {
|
|
105
|
+
return this.message(message, NotificationSeverity.Warning, parameter);
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* @inheritdoc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultNotifications.service.js","sourceRoot":"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AAE,mBAAmB;YAC5B,QAAQ,EAAE,SAAS;SACtB;QACD;YACI,OAAO,EAAE,KAAK,IAAI,aAAa;YAC/B,UAAU,EAAE,CAAC,aAA4B,EAAE,EAAE;gBAEzC,OAAO,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC7C,CAAC;YACD,IAAI,EAAE,CAAC,CAAC,IAAI,QAAQ,EAAE,EAAE,aAAa,CAAC,CAAC;SAC1C;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,cAAc,CAAC,qBAAqB,EAAE,OAAO,EACpD;IACI,GAAG;QAEC,MAAM,IAAI,GAAsC,CAAC,SAAiB,EAAE,KAAsD,EAAE,EAAE;YAE1H,OAAO,oBAAoB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,EACpC;YACI,GAAG;gBAEC,OAAO,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;SACJ,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAC,CAAC;AAEH,OAAO,EAAC,qBAAqB,EAAC,CAAC","sourcesContent":["import {Injectable, InjectionToken, Optional, SkipSelf, Type} from '@angular/core';\nimport {Dictionary, generateId} from '@jscrpt/common';\nimport {Observable, Subject, Subscription} from 'rxjs';\n\nimport {NOTIFICATIONS, NOTIFICATIONS_SCOPE} from '../../types/tokens';\nimport {Notifications, Notification, NotificationSeverity, NotificationsProvider, NotificationsScopeProviderFactory, NotificationsScopeProvider} from './notifications.interface';\nimport {NotificationsOptions} from './notificationsOptions';\n\n/**\n * Default notifications service implementation\n */\n@Injectable()\nexport class DefaultNotificationsService implements Notifications\n{\n //######################### protected fields #########################\n\n /**\n * Array of notifications\n */\n protected _notifications: Notification[] = [];\n\n /**\n * Array of notifications timeouts\n */\n protected _notificationsTimeouts: number[] = [];\n\n /**\n * Subject used for emitting changes of current notifications\n */\n protected _notificationsChange: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting event when instance is being destroyed\n */\n protected _destroy: Subject<void> = new Subject<void>();\n\n /**\n * Array of scoped notifications\n */\n protected _scopes: Dictionary<[Notifications, Subscription]> = {};\n\n //######################### public properties #########################\n\n /**\n * @inheritdoc\n */\n public get notifications(): readonly Notification[]\n {\n return [...this._notifications];\n }\n\n /**\n * @inheritdoc\n */\n public get notificationsChange(): Observable<void>\n {\n return this._notificationsChange.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get destroy(): Observable<void>\n {\n return this._destroy.asObservable();\n }\n\n //######################### constructor #########################\n constructor(@Optional() protected _options: NotificationsOptions)\n {\n if(!this._options || !(this._options instanceof NotificationsOptions))\n {\n this._options = new NotificationsOptions();\n }\n }\n\n //######################### public methods - implementation of Notifications #########################\n \n /**\n * @inheritdoc\n */\n public message(message: string, severity: NotificationSeverity): Notifications\n {\n const notification = new Notification(message, severity);\n \n this._notifications.push(notification);\n this._notificationsChange.next();\n\n // set timeout\n if(this._options.timeout > 0)\n {\n this._notificationsTimeouts.push(setTimeout(() =>\n {\n this.remove(notification);\n }, this._options.timeout) as any);\n }\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public default(message: string): Notifications\n {\n return this.message(message, NotificationSeverity.Default);\n }\n\n /**\n * @inheritdoc\n */\n public success(message: string): Notifications\n {\n return this.message(message, NotificationSeverity.Success);\n }\n \n /**\n * @inheritdoc\n */\n public error(message: string): Notifications\n {\n return this.message(message, NotificationSeverity.Error);\n }\n \n /**\n * @inheritdoc\n */\n public info(message: string): Notifications\n {\n return this.message(message, NotificationSeverity.Info);\n }\n \n /**\n * @inheritdoc\n */\n public warning(message: string): Notifications\n {\n return this.message(message, NotificationSeverity.Warning);\n }\n\n /**\n * @inheritdoc\n */\n public clearNotifications(): Notifications\n {\n while(this._notifications[0])\n {\n this._remove(this._notifications[0], false);\n }\n\n this._notificationsChange.next();\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public remove(notification: Notification): Notifications\n {\n return this._remove(notification);\n }\n\n /**\n * @inheritdoc\n */\n public getScope(scopeName: string): Notifications\n {\n const scopeObj = this._scopes[scopeName];\n let scope: Notifications;\n\n // no scope yet\n if(!scopeObj)\n {\n scope = new DefaultNotificationsService(this._options);\n const subscription = new Subscription();\n\n this._scopes[scopeName] = [scope, subscription];\n\n //destroys and removes scope\n subscription.add(scope.destroy.subscribe(() =>\n {\n delete this._scopes[scopeName];\n subscription.unsubscribe();\n }));\n }\n else\n {\n scope = scopeObj[0];\n }\n\n return scope;\n }\n\n /**\n * @inheritdoc\n * \n * Call this manualy for scoped instances until this is fixed https://github.com/angular/angular/issues/28738\n */\n public ngOnDestroy(): void\n {\n this._destroy.next();\n this._destroy.complete();\n this._notificationsChange.complete();\n\n Object.keys(this._scopes).forEach(scopeName =>\n {\n const [scope] = this._scopes[scopeName];\n\n scope.ngOnDestroy();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Removes notification from array of notifications\n * @param notification - Notification to be removed\n * @param emitEvent - Indication whether emit event on removal\n */\n protected _remove(notification: Notification, emitEvent: boolean = true): Notifications\n {\n const index = this._notifications.indexOf(notification);\n\n if(index < 0)\n {\n return this;\n }\n\n this._notifications.splice(index, 1);\n\n if(emitEvent)\n {\n this._notificationsChange.next();\n }\n\n // clear timeout\n if(this._options.timeout > 0)\n {\n clearTimeout(this._notificationsTimeouts[index]);\n this._notificationsTimeouts.splice(index, 1);\n }\n\n return this;\n }\n}\n\n/**\n * Default notifications provider\n */\nconst DEFAULT_NOTIFICATIONS: NotificationsProvider =\n{\n provide: NOTIFICATIONS,\n useClass: DefaultNotificationsService\n};\n\n//TODO: add options to notifications factory\n\n/**\n * Factory that creates notifications provider for scope\n */\nconst notificationsFactory = (scopeName: string, token?: Function | Type<any> | InjectionToken<unknown>) =>\n{\n return <NotificationsScopeProvider> [\n {\n provide: NOTIFICATIONS_SCOPE,\n useValue: scopeName\n },\n {\n provide: token ?? NOTIFICATIONS,\n useFactory: (notifications: Notifications) =>\n {\n return notifications.getScope(scopeName);\n },\n deps: [[new SkipSelf(), NOTIFICATIONS]]\n }\n ];\n};\n\nObject.defineProperty(DEFAULT_NOTIFICATIONS, 'scope', \n{\n get()\n {\n const func: NotificationsScopeProviderFactory = (scopeName: string, token?: Function | Type<any> | InjectionToken<unknown>) =>\n {\n return notificationsFactory(scopeName, token);\n };\n\n Object.defineProperty(func, 'random', \n {\n get()\n {\n return notificationsFactory(generateId(6));\n }\n });\n\n return func;\n }\n});\n\nexport {DEFAULT_NOTIFICATIONS};"]}
|
|
1
|
+
{"version":3,"file":"defaultNotifications.service.js","sourceRoot":"","sources":["../../../../src/services/notifications/defaultNotifications.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,QAAQ,EAAE,QAAQ,EAAO,MAAM,eAAe,CAAC;AACnF,OAAO,EAAa,UAAU,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAa,OAAO,EAAE,YAAY,EAAC,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAgB,YAAY,EAAE,oBAAoB,EAAuF,MAAM,2BAA2B,CAAC;AAClL,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;;;AAE5D;;GAEG;AACH,MACa,2BAA2B;IAwDF;IAtDlC,sEAAsE;IAEtE;;OAEG;IACO,cAAc,GAAmB,EAAE,CAAC;IAE9C;;OAEG;IACO,sBAAsB,GAAa,EAAE,CAAC;IAEhD;;OAEG;IACO,oBAAoB,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAEpE;;OAEG;IACO,QAAQ,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAExD;;OAEG;IACO,OAAO,GAA8C,EAAE,CAAC;IAElE,uEAAuE;IAEvE;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,CAAC,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/C,CAAC;SACJ,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAC,CAAC;AAEH,OAAO,EAAC,qBAAqB,EAAC,CAAC","sourcesContent":["import {Injectable, InjectionToken, Optional, SkipSelf, Type} from '@angular/core';\nimport {Dictionary, generateId} from '@jscrpt/common';\nimport {Observable, Subject, Subscription} from 'rxjs';\n\nimport {NOTIFICATIONS, NOTIFICATIONS_SCOPE} from '../../types/tokens';\nimport {Notifications, Notification, NotificationSeverity, NotificationsProvider, NotificationsScopeProviderFactory, NotificationsScopeProvider} from './notifications.interface';\nimport {NotificationsOptions} from './notificationsOptions';\n\n/**\n * Default notifications service implementation\n */\n@Injectable()\nexport class DefaultNotificationsService implements Notifications\n{\n //######################### protected fields #########################\n\n /**\n * Array of notifications\n */\n protected _notifications: Notification[] = [];\n\n /**\n * Array of notifications timeouts\n */\n protected _notificationsTimeouts: number[] = [];\n\n /**\n * Subject used for emitting changes of current notifications\n */\n protected _notificationsChange: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting event when instance is being destroyed\n */\n protected _destroy: Subject<void> = new Subject<void>();\n\n /**\n * Array of scoped notifications\n */\n protected _scopes: Dictionary<[Notifications, Subscription]> = {};\n\n //######################### public properties #########################\n\n /**\n * @inheritdoc\n */\n public get notifications(): readonly Notification[]\n {\n return [...this._notifications];\n }\n\n /**\n * @inheritdoc\n */\n public get notificationsChange(): Observable<void>\n {\n return this._notificationsChange.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get destroy(): Observable<void>\n {\n return this._destroy.asObservable();\n }\n\n //######################### constructor #########################\n constructor(@Optional() protected _options: NotificationsOptions)\n {\n if(!this._options || !(this._options instanceof NotificationsOptions))\n {\n this._options = new NotificationsOptions();\n }\n }\n\n //######################### public methods - implementation of Notifications #########################\n \n /**\n * @inheritdoc\n */\n public message(message: string, severity: NotificationSeverity, parameter?: Record<string, unknown>): Notifications\n {\n const notification = new Notification(message, severity, parameter);\n \n this._notifications.push(notification);\n this._notificationsChange.next();\n\n // set timeout\n if(this._options.timeout > 0)\n {\n this._notificationsTimeouts.push(setTimeout(() =>\n {\n this.remove(notification);\n }, this._options.timeout) as any);\n }\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public default(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Default, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public success(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Success, parameter);\n }\n \n /**\n * @inheritdoc\n */\n public error(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Error, parameter);\n }\n \n /**\n * @inheritdoc\n */\n public info(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Info, parameter);\n }\n \n /**\n * @inheritdoc\n */\n public warning(message: string, parameter?: Record<string, unknown>): Notifications\n {\n return this.message(message, NotificationSeverity.Warning, parameter);\n }\n\n /**\n * @inheritdoc\n */\n public clearNotifications(): Notifications\n {\n while(this._notifications[0])\n {\n this._remove(this._notifications[0], false);\n }\n\n this._notificationsChange.next();\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public remove(notification: Notification): Notifications\n {\n return this._remove(notification);\n }\n\n /**\n * @inheritdoc\n */\n public getScope(scopeName: string): Notifications\n {\n const scopeObj = this._scopes[scopeName];\n let scope: Notifications;\n\n // no scope yet\n if(!scopeObj)\n {\n scope = new DefaultNotificationsService(this._options);\n const subscription = new Subscription();\n\n this._scopes[scopeName] = [scope, subscription];\n\n //destroys and removes scope\n subscription.add(scope.destroy.subscribe(() =>\n {\n delete this._scopes[scopeName];\n subscription.unsubscribe();\n }));\n }\n else\n {\n scope = scopeObj[0];\n }\n\n return scope;\n }\n\n /**\n * @inheritdoc\n * \n * Call this manualy for scoped instances until this is fixed https://github.com/angular/angular/issues/28738\n */\n public ngOnDestroy(): void\n {\n this._destroy.next();\n this._destroy.complete();\n this._notificationsChange.complete();\n\n Object.keys(this._scopes).forEach(scopeName =>\n {\n const [scope] = this._scopes[scopeName];\n\n scope.ngOnDestroy();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Removes notification from array of notifications\n * @param notification - Notification to be removed\n * @param emitEvent - Indication whether emit event on removal\n */\n protected _remove(notification: Notification, emitEvent: boolean = true): Notifications\n {\n const index = this._notifications.indexOf(notification);\n\n if(index < 0)\n {\n return this;\n }\n\n this._notifications.splice(index, 1);\n\n if(emitEvent)\n {\n this._notificationsChange.next();\n }\n\n // clear timeout\n if(this._options.timeout > 0)\n {\n clearTimeout(this._notificationsTimeouts[index]);\n this._notificationsTimeouts.splice(index, 1);\n }\n\n return this;\n }\n}\n\n/**\n * Default notifications provider\n */\nconst DEFAULT_NOTIFICATIONS: NotificationsProvider =\n{\n provide: NOTIFICATIONS,\n useClass: DefaultNotificationsService\n};\n\n//TODO: add options to notifications factory\n\n/**\n * Factory that creates notifications provider for scope\n */\nconst notificationsFactory = (scopeName: string, token?: Function | Type<any> | InjectionToken<unknown>) =>\n{\n return <NotificationsScopeProvider> [\n {\n provide: NOTIFICATIONS_SCOPE,\n useValue: scopeName\n },\n {\n provide: token ?? NOTIFICATIONS,\n useFactory: (notifications: Notifications) =>\n {\n return notifications.getScope(scopeName);\n },\n deps: [[new SkipSelf(), NOTIFICATIONS]]\n }\n ];\n};\n\nObject.defineProperty(DEFAULT_NOTIFICATIONS, 'scope', \n{\n get()\n {\n const func: NotificationsScopeProviderFactory = (scopeName: string, token?: Function | Type<any> | InjectionToken<unknown>) =>\n {\n return notificationsFactory(scopeName, token);\n };\n\n Object.defineProperty(func, 'random', \n {\n get()\n {\n return notificationsFactory(generateId(6));\n }\n });\n\n return func;\n }\n});\n\nexport {DEFAULT_NOTIFICATIONS};"]}
|