@anglr/common 18.1.0-beta.20230918134407 → 18.1.0-beta.20231011085406
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 +12 -11
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js +7 -5
- package/es2022/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.js.map +1 -1
- package/es2022/src/modules/commonDynamic.module.js +2 -2
- package/es2022/src/modules/commonDynamic.module.js.map +1 -1
- package/es2022/src/modules/logger/services/rest/rest.sink.js +1 -1
- package/es2022/src/modules/logger/services/rest/rest.sink.js.map +1 -1
- package/es2022/src/pipes/localize/localize.pipe.js +1 -1
- package/es2022/src/pipes/localize/localize.pipe.js.map +1 -1
- package/package.json +1 -1
- package/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.d.ts +4 -4
- package/src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.d.ts.map +1 -1
- package/src/modules/commonDynamic.module.d.ts +1 -1
- package/version.bak +1 -1
package/changelog.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## Version 18.1.0 (2023-
|
|
3
|
+
## Version 18.1.0 (2023-10-11)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- fixed `RestSink`, now correctly sends log level as uppercase as was before
|
|
8
|
+
- fixed `LocalizeSAPipe`, now correctly handles empty strings as key value
|
|
9
|
+
- fixed `NgComponentOutletEx`, now has correct null safe types
|
|
4
10
|
|
|
5
11
|
### Features
|
|
6
12
|
|
|
@@ -12,13 +18,8 @@
|
|
|
12
18
|
- `title` title displayed in header of cheat sheet
|
|
13
19
|
- **method**
|
|
14
20
|
- `toggleCheatSheet` toggles cheatsheet visibility
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
|
|
20
|
-
- fixed `RestSink`
|
|
21
|
-
- now sends `LogLevel` in lowercase like before
|
|
21
|
+
- updated `NgComponentOutletEx` directive
|
|
22
|
+
- is now standalone
|
|
22
23
|
|
|
23
24
|
## Version 18.0.0 (2023-08-23)
|
|
24
25
|
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
- new `loggerEnabled` function, that tests whether is logger sink enabled
|
|
50
51
|
- new `useEnrichers` function, that creates logger properties by using enrichers
|
|
51
52
|
- new `DeveloperConsoleSink` service, that is sink that is used for storing logs using browser developer console
|
|
52
|
-
- **implements**
|
|
53
|
+
- **implements**
|
|
53
54
|
- `LoggerSink`
|
|
54
55
|
- new `DefaultLogger` service, that is default implementation of `Logger`
|
|
55
56
|
- **implements**
|
|
@@ -269,7 +270,7 @@
|
|
|
269
270
|
- removed `PositionModule` module, use `PositionToSADirective` directly
|
|
270
271
|
- *subpackage* `@anglr/common/numeral`
|
|
271
272
|
- pipe `NumeralPipe` renamed to `NumeralSAPipe`
|
|
272
|
-
- removed `NumeralModule` module, use `NumeralSAPipe` directly
|
|
273
|
+
- removed `NumeralModule` module, use `NumeralSAPipe` directly
|
|
273
274
|
- *subpackage* `@anglr/common/structured-log`
|
|
274
275
|
- updated `ConsoleLogModule` module
|
|
275
276
|
- removed `forRoot` method, instead use new `provideConsoleComponentSink` function and you also have to provide logger using `provideLogger(StructuredLogLogger)`
|
|
@@ -371,7 +372,7 @@
|
|
|
371
372
|
|
|
372
373
|
### Bug Fixes
|
|
373
374
|
|
|
374
|
-
- updated `NumberInputControlValueAccessor` directive, which now correctly implements `setDisabledState`
|
|
375
|
+
- updated `NumberInputControlValueAccessor` directive, which now correctly implements `setDisabledState`
|
|
375
376
|
|
|
376
377
|
## Version 14.1.1 (2022-06-30)
|
|
377
378
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter, Directive, Injector, Input, Type, ViewContainerRef, Output } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
//TODO: add module as origin componentOutlet has
|
|
4
|
+
//TODO: rename to SA component on next breaking change
|
|
4
5
|
/**
|
|
5
6
|
* Instantiates a single Component type and inserts its Host View into current View.
|
|
6
7
|
*/
|
|
@@ -48,23 +49,24 @@ class NgComponentOutletEx {
|
|
|
48
49
|
this._viewContainerRef.clear();
|
|
49
50
|
this._componentRef = null;
|
|
50
51
|
if (this.ngComponentOutletEx) {
|
|
51
|
-
const injector = this.ngComponentOutletExInjector
|
|
52
|
+
const injector = this.ngComponentOutletExInjector ?? this._viewContainerRef.injector;
|
|
52
53
|
this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutletEx, {
|
|
53
|
-
injector
|
|
54
|
-
projectableNodes: this.ngComponentOutletExContent
|
|
54
|
+
injector,
|
|
55
|
+
projectableNodes: this.ngComponentOutletExContent ?? undefined
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
this.ngComponentOutletExCreated.emit(this.component);
|
|
58
59
|
}
|
|
59
60
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: NgComponentOutletEx, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
60
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: NgComponentOutletEx, selector: "[ngComponentOutletEx]", inputs: { ngComponentOutletEx: "ngComponentOutletEx", ngComponentOutletExInjector: "ngComponentOutletExInjector", ngComponentOutletExContent: "ngComponentOutletExContent" }, outputs: { ngComponentOutletExCreated: "ngComponentOutletExCreated" }, exportAs: ["ngComponentOutletEx"], usesOnChanges: true, ngImport: i0 });
|
|
61
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.4", type: NgComponentOutletEx, isStandalone: true, selector: "[ngComponentOutletEx]", inputs: { ngComponentOutletEx: "ngComponentOutletEx", ngComponentOutletExInjector: "ngComponentOutletExInjector", ngComponentOutletExContent: "ngComponentOutletExContent" }, outputs: { ngComponentOutletExCreated: "ngComponentOutletExCreated" }, exportAs: ["ngComponentOutletEx"], usesOnChanges: true, ngImport: i0 });
|
|
61
62
|
}
|
|
62
63
|
export { NgComponentOutletEx };
|
|
63
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: NgComponentOutletEx, decorators: [{
|
|
64
65
|
type: Directive,
|
|
65
66
|
args: [{
|
|
66
67
|
selector: '[ngComponentOutletEx]',
|
|
67
|
-
exportAs: 'ngComponentOutletEx'
|
|
68
|
+
exportAs: 'ngComponentOutletEx',
|
|
69
|
+
standalone: true,
|
|
68
70
|
}]
|
|
69
71
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { ngComponentOutletEx: [{
|
|
70
72
|
type: Input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngComponentOutletEx.directive.js","sourceRoot":"","sources":["../../../../src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAgB,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAa,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;;AAEhI,gDAAgD;
|
|
1
|
+
{"version":3,"file":"ngComponentOutletEx.directive.js","sourceRoot":"","sources":["../../../../src/directives/ngComponentOutletEx/ngComponentOutletEx.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAgB,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAa,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;;AAEhI,gDAAgD;AAChD,sDAAsD;AAEtD;;GAEG;AACH,MAMa,mBAAmB;IAqDR;IAnDpB,oEAAoE;IAEpE;;OAEG;IACK,aAAa,GAAkC,IAAI,CAAC;IAE5D,gFAAgF;IAEhF;;OAEG;IAEI,mBAAmB,CAAkC;IAE5D;;OAEG;IAEI,2BA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entRef, Directive, Injector, Input, OnChanges, Type, ViewContainerRef, Output} from '@angular/core';\n\n//TODO: add module as origin componentOutlet has\n//TODO: rename to SA component on next breaking change\n\n/**\n * Instantiates a single Component type and inserts its Host View into current View.\n */\n@Directive(\n{\n selector: '[ngComponentOutletEx]',\n exportAs: 'ngComponentOutletEx',\n standalone: true,\n})\nexport class NgComponentOutletEx<TComponent> implements OnChanges\n{\n //######################### private fields #########################\n\n /**\n * Created component reference\n */\n private _componentRef: ComponentRef<TComponent>|null = null;\n \n //######################### public properties - inputs #########################\n \n /**\n * Type that should be dynamically created into current container\n */\n @Input() \n public ngComponentOutletEx: Type<TComponent>|undefined|null;\n\n /**\n * Custom injector that will be used for newly created component\n */\n @Input() \n public ngComponentOutletExInjector: Injector|undefined|null;\n\n /**\n * Projectable nodes that can be injected into component\n */\n @Input() \n public ngComponentOutletExContent: Node[][]|undefined|null;\n\n //######################### public properties - outputs #########################\n\n /**\n * Occurs when component is created or destroyed, it can send instance of component, or null\n */\n @Output()\n public ngComponentOutletExCreated: EventEmitter<TComponent|null> = new EventEmitter<TComponent|null>();\n\n //######################### public properties #########################\n\n /**\n * Instance of dynamically created component \n */\n public get component(): TComponent|null\n {\n if(!this._componentRef)\n {\n return null;\n }\n\n return this._componentRef.instance;\n }\n\n //######################### constructor #########################\n constructor(private _viewContainerRef: ViewContainerRef)\n {\n }\n\n //######################### public methods - implementation of OnChanges #########################\n public ngOnChanges(): void\n {\n this._viewContainerRef.clear();\n this._componentRef = null;\n\n if (this.ngComponentOutletEx)\n {\n const injector = this.ngComponentOutletExInjector ?? this._viewContainerRef.injector;\n\n this._componentRef = this._viewContainerRef.createComponent<TComponent>(this.ngComponentOutletEx,\n {\n injector,\n projectableNodes: this.ngComponentOutletExContent ?? undefined\n });\n }\n\n this.ngComponentOutletExCreated.emit(this.component);\n }\n}\n"]}
|
|
@@ -6,14 +6,14 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
*/
|
|
7
7
|
class CommonDynamicModule {
|
|
8
8
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CommonDynamicModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: CommonDynamicModule,
|
|
9
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.4", ngImport: i0, type: CommonDynamicModule, imports: [NgComponentOutletEx], exports: [NgComponentOutletEx] });
|
|
10
10
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CommonDynamicModule });
|
|
11
11
|
}
|
|
12
12
|
export { CommonDynamicModule };
|
|
13
13
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CommonDynamicModule, decorators: [{
|
|
14
14
|
type: NgModule,
|
|
15
15
|
args: [{
|
|
16
|
-
|
|
16
|
+
imports: [
|
|
17
17
|
NgComponentOutletEx,
|
|
18
18
|
],
|
|
19
19
|
exports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonDynamic.module.js","sourceRoot":"","sources":["../../../src/modules/commonDynamic.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,iEAAiE,CAAC;;AAEpG;;GAEG;AACH,MAWa,mBAAmB;uGAAnB,mBAAmB;wGAAnB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"commonDynamic.module.js","sourceRoot":"","sources":["../../../src/modules/commonDynamic.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,iEAAiE,CAAC;;AAEpG;;GAEG;AACH,MAWa,mBAAmB;uGAAnB,mBAAmB;wGAAnB,mBAAmB,YAPxB,mBAAmB,aAInB,mBAAmB;wGAGd,mBAAmB;;SAAnB,mBAAmB;2FAAnB,mBAAmB;kBAX/B,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,mBAAmB;qBACtB;oBACD,OAAO,EACP;wBACI,mBAAmB;qBACtB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {NgComponentOutletEx} from '../directives/ngComponentOutletEx/ngComponentOutletEx.directive';\n\n/**\n * Module for common dynamic stuff\n */\n@NgModule(\n{\n imports:\n [\n NgComponentOutletEx,\n ],\n exports: \n [\n NgComponentOutletEx,\n ]\n})\nexport class CommonDynamicModule\n{\n}"]}
|
|
@@ -61,7 +61,7 @@ let RestSink = class RestSink {
|
|
|
61
61
|
let forceFlush = false;
|
|
62
62
|
const fullMessage = `${messageLog.buildMessage(options.messageTemplate ?? '{{messageLog}}', loggerProperties)}`;
|
|
63
63
|
this.logs.push({
|
|
64
|
-
logLevel: LogLevel[messageLog.logLevel].
|
|
64
|
+
logLevel: LogLevel[messageLog.logLevel].toUpperCase(),
|
|
65
65
|
message: fullMessage,
|
|
66
66
|
timestamp: messageLog.timestamp,
|
|
67
67
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest.sink.js","sourceRoot":"","sources":["../../../../../../src/modules/logger/services/rest/rest.sink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,kBAAkB,EAAE,aAAa,EAAC,MAAM,YAAY,C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CAAC,EAAE,CAAC;QAEhH,IAAI,CAAC,IAAI,CAAC,IAAI,CACd;YACI,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE;YACrD,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,UAAU,CAAC,SAAS;SAClC,CAAC,CAAC;QAEH,IAAG,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,UAAU,CAAC,QAAQ,CAAC,EAChF;YACI,UAAU,GAAG,IAAI,CAAC;SACrB;QAED,oEAAoE;QACpE,IAAG,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,EACxE;YACI,IAAI,CAAC,KAAK,EAAE,CAAC;SAChB;IACL,CAAC;IAED;;OAEG;IACO,KAAK;QAEX,IAAI,OAAgC,CAAC;QAErC,mBAAmB;QACnB,IAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EACpB;YACI,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;SAC5B;QAED,IACA;YACI,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3D;QACD,OAAM,CAAC,EACP;YACI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAClB;QAED,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QAEf,OAAO,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IACxC,CAAC;CACJ,CAAA;AArHY,QAAQ;IADpB,QAAQ,EAAE;;GACE,QAAQ,CAqHpB;SArHY,QAAQ","sourcesContent":["import {inject} from '@angular/core';\nimport {isPresent} from '@jscrpt/common';\nimport {lastValueFrom} from 'rxjs';\n\nimport {RestSinkOptions} from './restSink.options';\nimport {SinkType} from '../../decorators';\nimport {LoggerRestClient, LoggerSink, RestLog} from '../../interfaces';\nimport {APP_STABLE} from '../../../../utils';\nimport {LOGGER_REST_CLIENT, loggerEnabled} from '../../misc';\nimport {LogLevel, LoggerOptions, MessageLog} from '../../types';\n\n/**\n * Sink that is used for storing logs using REST\n */\n@SinkType()\nexport class RestSink implements LoggerSink\n{\n //######################### protected fields #########################\n\n /**\n * Array of unflushed logs\n */\n protected logs: RestLog[] = [];\n\n /**\n * Interval timer id\n */\n protected timer: number|undefined|null;\n\n /**\n * Configuration options for rest sink\n */\n protected options: RestSinkOptions = inject(RestSinkOptions);\n\n /**\n * Indication whether is app stable\n */\n protected isStable: Promise<void> = inject(APP_STABLE);\n\n /**\n * Rest client used for sending logs through REST\n */\n protected restClient: LoggerRestClient = inject(LOGGER_REST_CLIENT);\n\n //######################### constructor #########################\n constructor()\n {\n if(!(this.options instanceof RestSinkOptions))\n {\n this.options = new RestSinkOptions();\n }\n\n this.isStable.then(() =>\n {\n this.timer = setInterval(() =>\n {\n this.flush();\n }, (this.options.secondsToFlushAfter ?? 0) * 1000) as any;\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(isPresent(this.timer))\n {\n clearInterval(this.timer);\n }\n\n this.flush();\n }\n\n //######################### public methods - implementation of Sink #########################\n\n /**\n * @inheritdoc\n */\n public log(options: LoggerOptions, loggerProperties: Record<string, unknown>, messageLog: MessageLog): void\n {\n let forceFlush = false;\n\n const fullMessage = `${messageLog.buildMessage(options.messageTemplate ?? '{{messageLog}}', loggerProperties)}`;\n\n this.logs.push(\n {\n logLevel: LogLevel[messageLog.logLevel].
|
|
1
|
+
{"version":3,"file":"rest.sink.js","sourceRoot":"","sources":["../../../../../../src/modules/logger/services/rest/rest.sink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAA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Y,QAAQ;IADpB,QAAQ,EAAE;;GACE,QAAQ,CAqHpB;SArHY,QAAQ","sourcesContent":["import {inject} from '@angular/core';\nimport {isPresent} from '@jscrpt/common';\nimport {lastValueFrom} from 'rxjs';\n\nimport {RestSinkOptions} from './restSink.options';\nimport {SinkType} from '../../decorators';\nimport {LoggerRestClient, LoggerSink, RestLog} from '../../interfaces';\nimport {APP_STABLE} from '../../../../utils';\nimport {LOGGER_REST_CLIENT, loggerEnabled} from '../../misc';\nimport {LogLevel, LoggerOptions, MessageLog} from '../../types';\n\n/**\n * Sink that is used for storing logs using REST\n */\n@SinkType()\nexport class RestSink implements LoggerSink\n{\n //######################### protected fields #########################\n\n /**\n * Array of unflushed logs\n */\n protected logs: RestLog[] = [];\n\n /**\n * Interval timer id\n */\n protected timer: number|undefined|null;\n\n /**\n * Configuration options for rest sink\n */\n protected options: RestSinkOptions = inject(RestSinkOptions);\n\n /**\n * Indication whether is app stable\n */\n protected isStable: Promise<void> = inject(APP_STABLE);\n\n /**\n * Rest client used for sending logs through REST\n */\n protected restClient: LoggerRestClient = inject(LOGGER_REST_CLIENT);\n\n //######################### constructor #########################\n constructor()\n {\n if(!(this.options instanceof RestSinkOptions))\n {\n this.options = new RestSinkOptions();\n }\n\n this.isStable.then(() =>\n {\n this.timer = setInterval(() =>\n {\n this.flush();\n }, (this.options.secondsToFlushAfter ?? 0) * 1000) as any;\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(isPresent(this.timer))\n {\n clearInterval(this.timer);\n }\n\n this.flush();\n }\n\n //######################### public methods - implementation of Sink #########################\n\n /**\n * @inheritdoc\n */\n public log(options: LoggerOptions, loggerProperties: Record<string, unknown>, messageLog: MessageLog): void\n {\n let forceFlush = false;\n\n const fullMessage = `${messageLog.buildMessage(options.messageTemplate ?? '{{messageLog}}', loggerProperties)}`;\n\n this.logs.push(\n {\n logLevel: LogLevel[messageLog.logLevel].toUpperCase(),\n message: fullMessage,\n timestamp: messageLog.timestamp,\n });\n\n if(loggerEnabled(() => this.options.immediateFlushMinLevel, messageLog.logLevel))\n {\n forceFlush = true;\n }\n\n //flush if number of records is bigger than max or flush is required\n if(forceFlush || this.logs.length >= this.options.flushAfterNumberOfLogs)\n {\n this.flush();\n }\n }\n\n /**\n * Flushes logs\n */\n protected flush(): Promise<void>\n {\n let promise: Promise<void>|undefined;\n\n //no logs available\n if(!this.logs.length)\n {\n return Promise.resolve();\n }\n\n try\n {\n promise = lastValueFrom(this.restClient.log(this.logs));\n }\n catch(e)\n {\n console.log(e);\n }\n\n this.logs = [];\n\n return promise ?? Promise.resolve();\n }\n}"]}
|
|
@@ -25,7 +25,7 @@ class LocalizeSAPipe {
|
|
|
25
25
|
* @param interpolateParams - Optional object storing interpolation parameters
|
|
26
26
|
*/
|
|
27
27
|
transform(key, interpolateParams) {
|
|
28
|
-
if (isBlank(key)) {
|
|
28
|
+
if (isBlank(key) || key === '') {
|
|
29
29
|
return '';
|
|
30
30
|
}
|
|
31
31
|
return this._localizationSvc.get(key, interpolateParams);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localize.pipe.js","sourceRoot":"","sources":["../../../../src/pipes/localize/localize.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAiB,MAAM,EAAE,iBAAiB,EAAoB,MAAM,eAAe,CAAC;AAChG,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;;AAGvD;;GAEG;AACH,MAMa,cAAc;IAU0B;IAC7B;IATpB,oEAAoE;IAEpE;;OAEG;IACK,aAAa,CAA8B;IAEnD,iEAAiE;IACjE,YAAiD,gBAAoC,EACjE,eAAkC;QADL,qBAAgB,GAAhB,gBAAgB,CAAoB;QACjE,oBAAe,GAAf,eAAe,CAAmB;IAEtD,CAAC;IAED,oEAAoE;IAEpE;;;;OAI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9B,cAAc;;SAAd,cAAc;2FAAd,cAAc;kBAN1B,IAAI;mBACL;oBACI,IAAI,EAAE,UAAU;oBAChB,UAAU,EAAE,IAAI;oBAChB,IAAI,EAAE,KAAK;iBACd;;0BAWgB,MAAM;2BAAC,mBAAmB","sourcesContent":["import {Pipe, PipeTransform, Inject, ChangeDetectorRef, OnInit, OnDestroy} from '@angular/core';\nimport {isBlank} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {STRING_LOCALIZATION} from '../../types/tokens';\nimport {StringLocalization} from '../../services/stringLocalization';\n\n/**\n * Localize strings using 'StringLocalization'\n */\n@Pipe(\n{\n name: 'localize',\n standalone: true,\n pure: false,\n})\nexport class LocalizeSAPipe implements PipeTransform, OnInit, OnDestroy\n{\n //######################### private fields #########################\n\n /**\n * Subscription for changes of texts\n */\n private _subscription: Subscription|undefined|null;\n\n //######################### constructor #########################\n constructor(@Inject(STRING_LOCALIZATION) private _localizationSvc: StringLocalization,\n private _changeDetector: ChangeDetectorRef,)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets localized string for specified key, interpolation might be used\n * @param key - Key to be localized\n * @param interpolateParams - Optional object storing interpolation parameters\n */\n public transform(key: string|undefined|null, interpolateParams?: Object): string\n {\n if(isBlank(key) || key === '')\n {\n return '';\n }\n\n return this._localizationSvc.get(key, interpolateParams);\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._subscription = this._localizationSvc.textsChange.subscribe(() =>\n {\n this._changeDetector.markForCheck();\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this._subscription?.unsubscribe();\n this._subscription = null;\n }\n}"]}
|
package/package.json
CHANGED
|
@@ -12,15 +12,15 @@ export declare class NgComponentOutletEx<TComponent> implements OnChanges {
|
|
|
12
12
|
/**
|
|
13
13
|
* Type that should be dynamically created into current container
|
|
14
14
|
*/
|
|
15
|
-
ngComponentOutletEx: Type<TComponent
|
|
15
|
+
ngComponentOutletEx: Type<TComponent> | undefined | null;
|
|
16
16
|
/**
|
|
17
17
|
* Custom injector that will be used for newly created component
|
|
18
18
|
*/
|
|
19
|
-
ngComponentOutletExInjector: Injector;
|
|
19
|
+
ngComponentOutletExInjector: Injector | undefined | null;
|
|
20
20
|
/**
|
|
21
21
|
* Projectable nodes that can be injected into component
|
|
22
22
|
*/
|
|
23
|
-
ngComponentOutletExContent:
|
|
23
|
+
ngComponentOutletExContent: Node[][] | undefined | null;
|
|
24
24
|
/**
|
|
25
25
|
* Occurs when component is created or destroyed, it can send instance of component, or null
|
|
26
26
|
*/
|
|
@@ -32,6 +32,6 @@ export declare class NgComponentOutletEx<TComponent> implements OnChanges {
|
|
|
32
32
|
constructor(_viewContainerRef: ViewContainerRef);
|
|
33
33
|
ngOnChanges(): void;
|
|
34
34
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgComponentOutletEx<any>, never>;
|
|
35
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgComponentOutletEx<any>, "[ngComponentOutletEx]", ["ngComponentOutletEx"], { "ngComponentOutletEx": { "alias": "ngComponentOutletEx"; "required": false; }; "ngComponentOutletExInjector": { "alias": "ngComponentOutletExInjector"; "required": false; }; "ngComponentOutletExContent": { "alias": "ngComponentOutletExContent"; "required": false; }; }, { "ngComponentOutletExCreated": "ngComponentOutletExCreated"; }, never, never,
|
|
35
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgComponentOutletEx<any>, "[ngComponentOutletEx]", ["ngComponentOutletEx"], { "ngComponentOutletEx": { "alias": "ngComponentOutletEx"; "required": false; }; "ngComponentOutletExInjector": { "alias": "ngComponentOutletExInjector"; "required": false; }; "ngComponentOutletExContent": { "alias": "ngComponentOutletExContent"; "required": false; }; }, { "ngComponentOutletExCreated": "ngComponentOutletExCreated"; }, never, never, true, never>;
|
|
36
36
|
}
|
|
37
37
|
//# sourceMappingURL=ngComponentOutletEx.directive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngComponentOutletEx.directive.d.ts","sourceRoot":"","sources":["ngComponentOutletEx.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAA2B,QAAQ,EAAS,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAS,MAAM,eAAe,CAAC;;
|
|
1
|
+
{"version":3,"file":"ngComponentOutletEx.directive.d.ts","sourceRoot":"","sources":["ngComponentOutletEx.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAA2B,QAAQ,EAAS,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAS,MAAM,eAAe,CAAC;;AAKhI;;GAEG;AACH,qBAMa,mBAAmB,CAAC,UAAU,CAAE,YAAW,SAAS;IAqDjD,OAAO,CAAC,iBAAiB;IAjDrC;;OAEG;IACH,OAAO,CAAC,aAAa,CAAuC;IAI5D;;OAEG;IAEI,mBAAmB,EAAE,IAAI,CAAC,UAAU,CAAC,GAAC,SAAS,GAAC,IAAI,CAAC;IAE5D;;OAEG;IAEI,2BAA2B,EAAE,QAAQ,GAAC,SAAS,GAAC,IAAI,CAAC;IAE5D;;OAEG;IAEI,0BAA0B,EAAE,IAAI,EAAE,EAAE,GAAC,SAAS,GAAC,IAAI,CAAC;IAI3D;;OAEG;IAEI,0BAA0B,EAAE,YAAY,CAAC,UAAU,GAAC,IAAI,CAAC,CAAuC;IAIvG;;OAEG;IACH,IAAW,SAAS,IAAI,UAAU,GAAC,IAAI,CAQtC;gBAGmB,iBAAiB,EAAE,gBAAgB;IAKhD,WAAW,IAAI,IAAI;yCA1DjB,mBAAmB;2CAAnB,mBAAmB;CA4E/B"}
|
|
@@ -5,7 +5,7 @@ import * as i1 from "../directives/ngComponentOutletEx/ngComponentOutletEx.direc
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class CommonDynamicModule {
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<CommonDynamicModule, never>;
|
|
8
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CommonDynamicModule, [typeof i1.NgComponentOutletEx],
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CommonDynamicModule, never, [typeof i1.NgComponentOutletEx], [typeof i1.NgComponentOutletEx]>;
|
|
9
9
|
static ɵinj: i0.ɵɵInjectorDeclaration<CommonDynamicModule>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=commonDynamic.module.d.ts.map
|
package/version.bak
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
18.1.0-beta.
|
|
1
|
+
18.1.0-beta.20231011085406
|