iss-ctrl 0.0.12 → 0.0.13
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/fesm2022/iss-ctrl-iss-ctrl-BN9rcLt2.mjs +8855 -0
- package/fesm2022/iss-ctrl-iss-ctrl-BN9rcLt2.mjs.map +1 -0
- package/fesm2022/iss-ctrl-iss-ctrl-DOmgkxUv.mjs +8924 -0
- package/fesm2022/iss-ctrl-iss-ctrl-DOmgkxUv.mjs.map +1 -0
- package/fesm2022/iss-ctrl-load-event-AgBohfHa.mjs +60 -0
- package/fesm2022/iss-ctrl-load-event-AgBohfHa.mjs.map +1 -0
- package/fesm2022/iss-ctrl-load-event-D70VZuyD.mjs +60 -0
- package/fesm2022/iss-ctrl-load-event-D70VZuyD.mjs.map +1 -0
- package/fesm2022/iss-ctrl-load-options-event-ClQPHNBO.mjs +50 -0
- package/fesm2022/iss-ctrl-load-options-event-ClQPHNBO.mjs.map +1 -0
- package/fesm2022/iss-ctrl-load-options-event-DHmaMAOb.mjs +50 -0
- package/fesm2022/iss-ctrl-load-options-event-DHmaMAOb.mjs.map +1 -0
- package/fesm2022/iss-ctrl-load-value-event-CDAKsE_O.mjs +52 -0
- package/fesm2022/iss-ctrl-load-value-event-CDAKsE_O.mjs.map +1 -0
- package/fesm2022/iss-ctrl-load-value-event-Cpuy1og1.mjs +52 -0
- package/fesm2022/iss-ctrl-load-value-event-Cpuy1og1.mjs.map +1 -0
- package/fesm2022/iss-ctrl-note.field-C9cVaAz0.mjs +65 -0
- package/fesm2022/iss-ctrl-note.field-C9cVaAz0.mjs.map +1 -0
- package/fesm2022/iss-ctrl-note.field-IM4x1O3b.mjs +65 -0
- package/fesm2022/iss-ctrl-note.field-IM4x1O3b.mjs.map +1 -0
- package/fesm2022/iss-ctrl-replace-api-keys-CLP4wBYu.mjs +57 -0
- package/fesm2022/iss-ctrl-replace-api-keys-CLP4wBYu.mjs.map +1 -0
- package/fesm2022/iss-ctrl-replace-api-keys-CvhCKvNB.mjs +57 -0
- package/fesm2022/iss-ctrl-replace-api-keys-CvhCKvNB.mjs.map +1 -0
- package/fesm2022/iss-ctrl-set-value-event-C7YYwHZV.mjs +61 -0
- package/fesm2022/iss-ctrl-set-value-event-C7YYwHZV.mjs.map +1 -0
- package/fesm2022/iss-ctrl-set-value-event-CrpzRR6X.mjs +61 -0
- package/fesm2022/iss-ctrl-set-value-event-CrpzRR6X.mjs.map +1 -0
- package/fesm2022/iss-ctrl-table.field-BP-HMKO3.mjs +592 -0
- package/fesm2022/iss-ctrl-table.field-BP-HMKO3.mjs.map +1 -0
- package/fesm2022/iss-ctrl-table.field-CDSVakji.mjs +592 -0
- package/fesm2022/iss-ctrl-table.field-CDSVakji.mjs.map +1 -0
- package/fesm2022/iss-ctrl-trigger-based-on-json-value-DS4TR38v.mjs +24 -0
- package/fesm2022/iss-ctrl-trigger-based-on-json-value-DS4TR38v.mjs.map +1 -0
- package/fesm2022/iss-ctrl-trigger-based-on-json-value-Dp0EhVLA.mjs +24 -0
- package/fesm2022/iss-ctrl-trigger-based-on-json-value-Dp0EhVLA.mjs.map +1 -0
- package/fesm2022/iss-ctrl-user-picker.field-8Jb1325c.mjs +225 -0
- package/fesm2022/iss-ctrl-user-picker.field-8Jb1325c.mjs.map +1 -0
- package/fesm2022/iss-ctrl-user-picker.field-PxT_dZ_O.mjs +225 -0
- package/fesm2022/iss-ctrl-user-picker.field-PxT_dZ_O.mjs.map +1 -0
- package/fesm2022/iss-ctrl.mjs +1 -1
- package/package.json +1 -1
- package/types/iss-ctrl.d.ts +3 -5
- package/upgrade.scss +16 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, Injectable } from '@angular/core';
|
|
4
|
+
import { map, EMPTY } from 'rxjs';
|
|
5
|
+
import { P as PLACEHOLDER_REGEX, H as HOST } from './iss-ctrl-iss-ctrl-DOmgkxUv.mjs';
|
|
6
|
+
import { ReplaceApiKeys } from './iss-ctrl-replace-api-keys-CLP4wBYu.mjs';
|
|
7
|
+
|
|
8
|
+
const API_RESPONSE_MAPPER = new InjectionToken("Map backend response to required response interface.");
|
|
9
|
+
|
|
10
|
+
function isValidEndpoint(api) {
|
|
11
|
+
if (api.includes("undefined") || api.includes("null")) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return !api.match(PLACEHOLDER_REGEX)?.length && !["undefined", "null"].includes(api);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class IssHttp {
|
|
18
|
+
#http = inject(HttpClient);
|
|
19
|
+
#apiResponseMapper = inject(API_RESPONSE_MAPPER);
|
|
20
|
+
get(url) {
|
|
21
|
+
if (isValidEndpoint(url)) {
|
|
22
|
+
return this.#http.get(url).pipe(map((res) => this.#apiResponseMapper(res)));
|
|
23
|
+
}
|
|
24
|
+
return EMPTY;
|
|
25
|
+
}
|
|
26
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssHttp, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
27
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssHttp, providedIn: "root" });
|
|
28
|
+
}
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssHttp, decorators: [{
|
|
30
|
+
type: Injectable,
|
|
31
|
+
args: [{ providedIn: "root" }]
|
|
32
|
+
}] });
|
|
33
|
+
|
|
34
|
+
class LoadEvent {
|
|
35
|
+
#replaceApiKeysService = inject(ReplaceApiKeys);
|
|
36
|
+
#host = inject(HOST);
|
|
37
|
+
getApi(args) {
|
|
38
|
+
let api;
|
|
39
|
+
if (args.action.config.fn) {
|
|
40
|
+
api = args.action.config.fn.execute(args);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
api = this.#replaceApiKeysService.execute(args);
|
|
44
|
+
}
|
|
45
|
+
return `${this.#host}${api}`;
|
|
46
|
+
}
|
|
47
|
+
fetchErrorHandler(args, err) {
|
|
48
|
+
console.error(err);
|
|
49
|
+
args.field.loading.set(false);
|
|
50
|
+
}
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadEvent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
52
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadEvent, providedIn: "root" });
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadEvent, decorators: [{
|
|
55
|
+
type: Injectable,
|
|
56
|
+
args: [{ providedIn: "root" }]
|
|
57
|
+
}] });
|
|
58
|
+
|
|
59
|
+
export { IssHttp as I, LoadEvent as L };
|
|
60
|
+
//# sourceMappingURL=iss-ctrl-load-event-AgBohfHa.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-load-event-AgBohfHa.mjs","sources":["../../../projects/iss/src/shared/tokens/api-response-mapper.token.ts","../../../projects/iss/src/shared/utilities/is-valid-api.util.ts","../../../projects/iss/src/shared/utilities/http.util.service.ts","../../../projects/iss/src/events/load/load-event.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { Dto } from \"../interfaces/dto\";\r\n\r\nexport const API_RESPONSE_MAPPER: InjectionToken<(res: any) => Dto> = new InjectionToken(\"Map backend response to required response interface.\");\r\n","import { PLACEHOLDER_REGEX } from \"../constants/placeholder-regex.const\";\r\n\r\nexport function isValidEndpoint(api: string): boolean {\r\n if (api.includes(\"undefined\") || api.includes(\"null\")) {\r\n return false;\r\n }\r\n return !api.match(PLACEHOLDER_REGEX)?.length && ![\"undefined\", \"null\"].includes(api);\r\n}\r\n","import { HttpClient } from \"@angular/common/http\";\r\nimport { inject, Injectable } from \"@angular/core\";\r\nimport { EMPTY, map, Observable } from \"rxjs\";\r\nimport { Dto } from \"../interfaces/dto\";\r\nimport { API_RESPONSE_MAPPER } from \"../tokens/api-response-mapper.token\";\r\nimport { isValidEndpoint } from \"./is-valid-api.util\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class IssHttp {\r\n #http: HttpClient = inject(HttpClient);\r\n #apiResponseMapper = inject(API_RESPONSE_MAPPER);\r\n\r\n get<T>(url: string): Observable<Dto> {\r\n if (isValidEndpoint(url)) {\r\n return this.#http.get<T>(url).pipe(map((res: any): Dto => this.#apiResponseMapper(res)));\r\n }\r\n return EMPTY;\r\n }\r\n}\r\n","import { inject, Injectable } from \"@angular/core\";\r\nimport { EventArgument } from \"../../shared/interfaces/event-strategy\";\r\nimport { HOST } from \"../../shared/tokens/host.token\";\r\nimport { ReplaceApiKeys } from \"./replace-api-keys\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class LoadEvent {\r\n #replaceApiKeysService = inject(ReplaceApiKeys);\r\n #host: string = inject(HOST);\r\n\r\n getApi(args: EventArgument) {\r\n let api;\r\n if (args.action.config.fn) {\r\n api = args.action.config.fn.execute(args);\r\n } else {\r\n api = this.#replaceApiKeysService.execute(args);\r\n }\r\n\r\n return `${this.#host}${api}`;\r\n }\r\n\r\n fetchErrorHandler(args: EventArgument, err: any) {\r\n console.error(err);\r\n args.field.loading.set(false);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,mBAAmB,GAAsC,IAAI,cAAc,CAAC,sDAAsD,CAAC;;ACD1I,SAAU,eAAe,CAAC,GAAW,EAAA;AACzC,IAAA,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACrD,QAAA,OAAO,KAAK;IACd;IACA,OAAO,CAAC,G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3C;aAAO;YACL,GAAG,GAAG,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC;QACjD;AAEA,QAAA,OAAO,GAAG,IAAI,CAAC,KAAK,CAAA,EAAG,GAAG,EAAE;IAC9B;IAEA,iBAAiB,CAAC,IAAmB,EAAE,GAAQ,EAAA;AAC7C,QAAA,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;QAClB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;IAC/B;uGAlBW,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAT,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,cADG,MAAM,EAAA,CAAA;;2FAClB,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;;;"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, Injectable } from '@angular/core';
|
|
4
|
+
import { map, EMPTY } from 'rxjs';
|
|
5
|
+
import { P as PLACEHOLDER_REGEX, H as HOST } from './iss-ctrl-iss-ctrl-BN9rcLt2.mjs';
|
|
6
|
+
import { ReplaceApiKeys } from './iss-ctrl-replace-api-keys-CvhCKvNB.mjs';
|
|
7
|
+
|
|
8
|
+
const API_RESPONSE_MAPPER = new InjectionToken("Map backend response to required response interface.");
|
|
9
|
+
|
|
10
|
+
function isValidEndpoint(api) {
|
|
11
|
+
if (api.includes("undefined") || api.includes("null")) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return !api.match(PLACEHOLDER_REGEX)?.length && !["undefined", "null"].includes(api);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class IssHttp {
|
|
18
|
+
#http = inject(HttpClient);
|
|
19
|
+
#apiResponseMapper = inject(API_RESPONSE_MAPPER);
|
|
20
|
+
get(url) {
|
|
21
|
+
if (isValidEndpoint(url)) {
|
|
22
|
+
return this.#http.get(url).pipe(map((res) => this.#apiResponseMapper(res)));
|
|
23
|
+
}
|
|
24
|
+
return EMPTY;
|
|
25
|
+
}
|
|
26
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssHttp, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
27
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssHttp, providedIn: "root" });
|
|
28
|
+
}
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IssHttp, decorators: [{
|
|
30
|
+
type: Injectable,
|
|
31
|
+
args: [{ providedIn: "root" }]
|
|
32
|
+
}] });
|
|
33
|
+
|
|
34
|
+
class LoadEvent {
|
|
35
|
+
#replaceApiKeysService = inject(ReplaceApiKeys);
|
|
36
|
+
#host = inject(HOST);
|
|
37
|
+
getApi(args) {
|
|
38
|
+
let api;
|
|
39
|
+
if (args.action.config.fn) {
|
|
40
|
+
api = args.action.config.fn.execute(args);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
api = this.#replaceApiKeysService.execute(args);
|
|
44
|
+
}
|
|
45
|
+
return `${this.#host}${api}`;
|
|
46
|
+
}
|
|
47
|
+
fetchErrorHandler(args, err) {
|
|
48
|
+
console.error(err);
|
|
49
|
+
args.field.loading.set(false);
|
|
50
|
+
}
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadEvent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
52
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadEvent, providedIn: "root" });
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadEvent, decorators: [{
|
|
55
|
+
type: Injectable,
|
|
56
|
+
args: [{ providedIn: "root" }]
|
|
57
|
+
}] });
|
|
58
|
+
|
|
59
|
+
export { IssHttp as I, LoadEvent as L };
|
|
60
|
+
//# sourceMappingURL=iss-ctrl-load-event-D70VZuyD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-load-event-D70VZuyD.mjs","sources":["../../../projects/iss/src/shared/tokens/api-response-mapper.token.ts","../../../projects/iss/src/shared/utilities/is-valid-api.util.ts","../../../projects/iss/src/shared/utilities/http.util.service.ts","../../../projects/iss/src/events/load/load-event.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { Dto } from \"../interfaces/dto\";\r\n\r\nexport const API_RESPONSE_MAPPER: InjectionToken<(res: any) => Dto> = new InjectionToken(\"Map backend response to required response interface.\");\r\n","import { PLACEHOLDER_REGEX } from \"../constants/placeholder-regex.const\";\r\n\r\nexport function isValidEndpoint(api: string): boolean {\r\n if (api.includes(\"undefined\") || api.includes(\"null\")) {\r\n return false;\r\n }\r\n return !api.match(PLACEHOLDER_REGEX)?.length && ![\"undefined\", \"null\"].includes(api);\r\n}\r\n","import { HttpClient } from \"@angular/common/http\";\r\nimport { inject, Injectable } from \"@angular/core\";\r\nimport { EMPTY, map, Observable } from \"rxjs\";\r\nimport { Dto } from \"../interfaces/dto\";\r\nimport { API_RESPONSE_MAPPER } from \"../tokens/api-response-mapper.token\";\r\nimport { isValidEndpoint } from \"./is-valid-api.util\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class IssHttp {\r\n #http: HttpClient = inject(HttpClient);\r\n #apiResponseMapper = inject(API_RESPONSE_MAPPER);\r\n\r\n get<T>(url: string): Observable<Dto> {\r\n if (isValidEndpoint(url)) {\r\n return this.#http.get<T>(url).pipe(map((res: any): Dto => this.#apiResponseMapper(res)));\r\n }\r\n return EMPTY;\r\n }\r\n}\r\n","import { inject, Injectable } from \"@angular/core\";\r\nimport { EventArgument } from \"../../shared/interfaces/event-strategy\";\r\nimport { HOST } from \"../../shared/tokens/host.token\";\r\nimport { ReplaceApiKeys } from \"./replace-api-keys\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class LoadEvent {\r\n #replaceApiKeysService = inject(ReplaceApiKeys);\r\n #host: string = inject(HOST);\r\n\r\n getApi(args: EventArgument) {\r\n let api;\r\n if (args.action.config.fn) {\r\n api = args.action.config.fn.execute(args);\r\n } else {\r\n api = this.#replaceApiKeysService.execute(args);\r\n }\r\n\r\n return `${this.#host}${api}`;\r\n }\r\n\r\n fetchErrorHandler(args: EventArgument, err: any) {\r\n console.error(err);\r\n args.field.loading.set(false);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,mBAAmB,GAAsC,IAAI,cAAc,CAAC,sDAAsD,CAAC;;ACD1I,SAAU,eAAe,CAAC,GAAW,EAAA;AACzC,IAAA,IAAI,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACrD,QAAA,OAAO,KAAK;IACd;IACA,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;AACtF;;MCCa,OAAO,CAAA;AAClB,IAAA,KAAK,GAAe,MAAM,CAAC,UAAU,CAAC;AACtC,IAAA,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAEhD,IAAA,GAAG,CAAI,GAAW,EAAA;AAChB,QAAA,IAAI,eAAe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AK,CAAC;IAC/B;uGAlBW,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAT,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,cADG,MAAM,EAAA,CAAA;;2FAClB,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { g as getPropertyByPath } from './iss-ctrl-iss-ctrl-BN9rcLt2.mjs';
|
|
4
|
+
import { L as LoadEvent, I as IssHttp } from './iss-ctrl-load-event-D70VZuyD.mjs';
|
|
5
|
+
|
|
6
|
+
class LoadOptionsEvent {
|
|
7
|
+
loadEvent = inject(LoadEvent);
|
|
8
|
+
#http = inject(IssHttp);
|
|
9
|
+
fire(args) {
|
|
10
|
+
console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + "%c Load Event Fired", "color: green");
|
|
11
|
+
const api = this.loadEvent.getApi(args);
|
|
12
|
+
args.field.loading.set(true);
|
|
13
|
+
this.#http.get(api).subscribe({
|
|
14
|
+
next: (response) => {
|
|
15
|
+
args.field.response.set(response.data);
|
|
16
|
+
args.field.apiResponse.next(response.data);
|
|
17
|
+
if (args.action.config.afterFetchFn) {
|
|
18
|
+
args.action.config.afterFetchFn?.execute(args);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
args.field.options.set(args.field.response());
|
|
22
|
+
if (args.action.config.setValueFromApiResponse) {
|
|
23
|
+
args.control.setValue(getPropertyByPath(args.field.response(), args.action.config.setValueFromApiResponse));
|
|
24
|
+
}
|
|
25
|
+
if (args.action.config.disableAfterFetching) {
|
|
26
|
+
args.control.disable();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
args.field.loading.set(false);
|
|
30
|
+
},
|
|
31
|
+
error: (err) => {
|
|
32
|
+
// todo handle errors
|
|
33
|
+
this.loadEvent.fetchErrorHandler(args, err);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
args.action.triggered = true;
|
|
37
|
+
}
|
|
38
|
+
revert(args) {
|
|
39
|
+
console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + "%c Load Event Reverted", "color: red");
|
|
40
|
+
}
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadOptionsEvent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadOptionsEvent, providedIn: "root" });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadOptionsEvent, decorators: [{
|
|
45
|
+
type: Injectable,
|
|
46
|
+
args: [{ providedIn: "root" }]
|
|
47
|
+
}] });
|
|
48
|
+
|
|
49
|
+
export { LoadOptionsEvent };
|
|
50
|
+
//# sourceMappingURL=iss-ctrl-load-options-event-ClQPHNBO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-load-options-event-ClQPHNBO.mjs","sources":["../../../projects/iss/src/events/load/load-options-event.ts"],"sourcesContent":["import { inject, Injectable } from \"@angular/core\";\r\nimport { Dto } from \"../../shared/interfaces/dto\";\r\nimport { EventArgument, EventStrategy } from \"../../shared/interfaces/event-strategy\";\r\nimport { getPropertyByPath } from \"../../shared/utilities/get-property-by-path.util\";\r\nimport { IssHttp } from \"../../shared/utilities/http.util.service\";\r\nimport { LoadEvent } from \"./load-event\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class LoadOptionsEvent implements EventStrategy {\r\n loadEvent = inject(LoadEvent);\r\n #http: IssHttp = inject(IssHttp);\r\n\r\n fire(args: EventArgument) {\r\n console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + \"%c Load Event Fired\", \"color: green\");\r\n const api = this.loadEvent.getApi(args);\r\n\r\n args.field.loading.set(true);\r\n this.#http.get(api).subscribe({\r\n next: (response: Dto) => {\r\n args.field.response.set(response.data);\r\n args.field.apiResponse.next(response.data);\r\n\r\n if (args.action.config.afterFetchFn) {\r\n args.action.config.afterFetchFn?.execute(args);\r\n } else {\r\n args.field.options.set(args.field.response());\r\n\r\n if (args.action.config.setValueFromApiResponse) {\r\n args.control.setValue(getPropertyByPath(args.field.response(), args.action.config.setValueFromApiResponse));\r\n }\r\n\r\n if (args.action.config.disableAfterFetching) {\r\n args.control.disable();\r\n }\r\n }\r\n args.field.loading.set(false);\r\n },\r\n error: (err) => {\r\n // todo handle errors\r\n this.loadEvent.fetchErrorHandler(args, err);\r\n },\r\n });\r\n args.action.triggered = true;\r\n }\r\n\r\n revert(args: EventArgument) {\r\n console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + \"%c Load Event Reverted\", \"color: red\");\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;MAQa,gBAAgB,CAAA;AAC3B,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,KAAK,GAAY,MAAM,CAAC,OAAO,CAAC;AAEhC,IAAA,IAAI,CAAC,IAAmB,EAAA;QACtB,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAA,GAAA,CAAK,GAAG,qBAAqB,EAAE,cAAc,CAAC;QACvH,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;Q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G,IAAI;IAC9B;AAEA,IAAA,MAAM,CAAC,IAAmB,EAAA;QACxB,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAA,GAAA,CAAK,GAAG,wBAAwB,EAAE,YAAY,CAAC;IAC1H;uGAvCW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cADJ,MAAM,EAAA,CAAA;;2FAClB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { g as getPropertyByPath } from './iss-ctrl-iss-ctrl-DOmgkxUv.mjs';
|
|
4
|
+
import { L as LoadEvent, I as IssHttp } from './iss-ctrl-load-event-AgBohfHa.mjs';
|
|
5
|
+
|
|
6
|
+
class LoadOptionsEvent {
|
|
7
|
+
loadEvent = inject(LoadEvent);
|
|
8
|
+
#http = inject(IssHttp);
|
|
9
|
+
fire(args) {
|
|
10
|
+
console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + "%c Load Event Fired", "color: green");
|
|
11
|
+
const api = this.loadEvent.getApi(args);
|
|
12
|
+
args.field.loading.set(true);
|
|
13
|
+
this.#http.get(api).subscribe({
|
|
14
|
+
next: (response) => {
|
|
15
|
+
args.field.response.set(response.data);
|
|
16
|
+
args.field.apiResponse.next(response.data);
|
|
17
|
+
if (args.action.config.afterFetchFn) {
|
|
18
|
+
args.action.config.afterFetchFn?.execute(args);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
args.field.options.set(args.field.response());
|
|
22
|
+
if (args.action.config.setValueFromApiResponse) {
|
|
23
|
+
args.control.setValue(getPropertyByPath(args.field.response(), args.action.config.setValueFromApiResponse));
|
|
24
|
+
}
|
|
25
|
+
if (args.action.config.disableAfterFetching) {
|
|
26
|
+
args.control.disable();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
args.field.loading.set(false);
|
|
30
|
+
},
|
|
31
|
+
error: (err) => {
|
|
32
|
+
// todo handle errors
|
|
33
|
+
this.loadEvent.fetchErrorHandler(args, err);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
args.action.triggered = true;
|
|
37
|
+
}
|
|
38
|
+
revert(args) {
|
|
39
|
+
console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + "%c Load Event Reverted", "color: red");
|
|
40
|
+
}
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadOptionsEvent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadOptionsEvent, providedIn: "root" });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadOptionsEvent, decorators: [{
|
|
45
|
+
type: Injectable,
|
|
46
|
+
args: [{ providedIn: "root" }]
|
|
47
|
+
}] });
|
|
48
|
+
|
|
49
|
+
export { LoadOptionsEvent };
|
|
50
|
+
//# sourceMappingURL=iss-ctrl-load-options-event-DHmaMAOb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-load-options-event-DHmaMAOb.mjs","sources":["../../../projects/iss/src/events/load/load-options-event.ts"],"sourcesContent":["import { inject, Injectable } from \"@angular/core\";\r\nimport { Dto } from \"../../shared/interfaces/dto\";\r\nimport { EventArgument, EventStrategy } from \"../../shared/interfaces/event-strategy\";\r\nimport { getPropertyByPath } from \"../../shared/utilities/get-property-by-path.util\";\r\nimport { IssHttp } from \"../../shared/utilities/http.util.service\";\r\nimport { LoadEvent } from \"./load-event\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class LoadOptionsEvent implements EventStrategy {\r\n loadEvent = inject(LoadEvent);\r\n #http: IssHttp = inject(IssHttp);\r\n\r\n fire(args: EventArgument) {\r\n console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + \"%c Load Event Fired\", \"color: green\");\r\n const api = this.loadEvent.getApi(args);\r\n\r\n args.field.loading.set(true);\r\n this.#http.get(api).subscribe({\r\n next: (response: Dto) => {\r\n args.field.response.set(response.data);\r\n args.field.apiResponse.next(response.data);\r\n\r\n if (args.action.config.afterFetchFn) {\r\n args.action.config.afterFetchFn?.execute(args);\r\n } else {\r\n args.field.options.set(args.field.response());\r\n\r\n if (args.action.config.setValueFromApiResponse) {\r\n args.control.setValue(getPropertyByPath(args.field.response(), args.action.config.setValueFromApiResponse));\r\n }\r\n\r\n if (args.action.config.disableAfterFetching) {\r\n args.control.disable();\r\n }\r\n }\r\n args.field.loading.set(false);\r\n },\r\n error: (err) => {\r\n // todo handle errors\r\n this.loadEvent.fetchErrorHandler(args, err);\r\n },\r\n });\r\n args.action.triggered = true;\r\n }\r\n\r\n revert(args: EventArgument) {\r\n console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + \"%c Load Event Reverted\", \"color: red\");\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;MAQa,gBAAgB,CAAA;AAC3B,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,KAAK,GAAY,MAAM,CAAC,OAAO,CAAC;AAEhC,IAAA,IAAI,CAAC,IAAmB,EAAA;QACtB,OAAO,CAAC,G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AC,GAAG,CAAC,KAAK,CAAC;YAC/B,CAAC;AACD,YAAA,KAAK,EAAE,CAAC,GAAG,KAAI;;gBAEb,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC;YAC7C,CAAC;AACF,SAAA,CAAC;AACF,QAAA,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI;IAC9B;AAEA,IAAA,MAAM,CAAC,IAAmB,EAAA;QACxB,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAA,GAAA,CAAK,GAAG,wBAAwB,EAAE,YAAY,CAAC;IAC1H;uGAvCW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cADJ,MAAM,EAAA,CAAA;;2FAClB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { g as getPropertyByPath } from './iss-ctrl-iss-ctrl-BN9rcLt2.mjs';
|
|
4
|
+
import { L as LoadEvent, I as IssHttp } from './iss-ctrl-load-event-D70VZuyD.mjs';
|
|
5
|
+
|
|
6
|
+
class LoadValueEvent {
|
|
7
|
+
loadEvent = inject(LoadEvent);
|
|
8
|
+
#http = inject(IssHttp);
|
|
9
|
+
fire(args) {
|
|
10
|
+
console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + "%c Load Event Fired", "color: green");
|
|
11
|
+
const api = this.loadEvent.getApi(args);
|
|
12
|
+
args.field.loading.set(true);
|
|
13
|
+
this.#http.get(api).subscribe({
|
|
14
|
+
next: (response) => {
|
|
15
|
+
args.field.response.set(response.data);
|
|
16
|
+
args.field.apiResponse.next(response.data);
|
|
17
|
+
if (args.action.config.afterFetchFn) {
|
|
18
|
+
args.action.config.afterFetchFn?.execute(args);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
if (args.action?.config?.setValueFromApiResponse) {
|
|
22
|
+
args.control.setValue(getPropertyByPath(args.field.response(), args.action.config.setValueFromApiResponse));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
args.control.setValue(args.field.response());
|
|
26
|
+
}
|
|
27
|
+
if (args.action.config.disableAfterFetching) {
|
|
28
|
+
args.control.disable();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
args.field.loading.set(false);
|
|
32
|
+
},
|
|
33
|
+
error: (err) => {
|
|
34
|
+
// todo handle errors
|
|
35
|
+
this.loadEvent.fetchErrorHandler(args, err);
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
args.action.triggered = true;
|
|
39
|
+
}
|
|
40
|
+
revert(args) {
|
|
41
|
+
console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + "%c Load Event Reverted", "color: red");
|
|
42
|
+
}
|
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadValueEvent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
44
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadValueEvent, providedIn: "root" });
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadValueEvent, decorators: [{
|
|
47
|
+
type: Injectable,
|
|
48
|
+
args: [{ providedIn: "root" }]
|
|
49
|
+
}] });
|
|
50
|
+
|
|
51
|
+
export { LoadValueEvent };
|
|
52
|
+
//# sourceMappingURL=iss-ctrl-load-value-event-CDAKsE_O.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-load-value-event-CDAKsE_O.mjs","sources":["../../../projects/iss/src/events/load/load-value-event.ts"],"sourcesContent":["import { inject, Injectable } from \"@angular/core\";\r\nimport { Dto } from \"../../shared/interfaces/dto\";\r\nimport { EventArgument, EventStrategy } from \"../../shared/interfaces/event-strategy\";\r\nimport { getPropertyByPath } from \"../../shared/utilities/get-property-by-path.util\";\r\nimport { IssHttp } from \"../../shared/utilities/http.util.service\";\r\nimport { LoadEvent } from \"./load-event\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class LoadValueEvent implements EventStrategy {\r\n loadEvent = inject(LoadEvent);\r\n #http: IssHttp = inject(IssHttp);\r\n\r\n fire(args: EventArgument) {\r\n console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + \"%c Load Event Fired\", \"color: green\");\r\n const api = this.loadEvent.getApi(args);\r\n\r\n args.field.loading.set(true);\r\n this.#http.get(api).subscribe({\r\n next: (response: Dto) => {\r\n args.field.response.set(response.data);\r\n args.field.apiResponse.next(response.data);\r\n\r\n if (args.action.config.afterFetchFn) {\r\n args.action.config.afterFetchFn?.execute(args);\r\n } else {\r\n if (args.action?.config?.setValueFromApiResponse) {\r\n args.control.setValue(getPropertyByPath(args.field.response(), args.action.config.setValueFromApiResponse));\r\n } else {\r\n args.control.setValue(args.field.response());\r\n }\r\n\r\n if (args.action.config.disableAfterFetching) {\r\n args.control.disable();\r\n }\r\n }\r\n\r\n args.field.loading.set(false);\r\n },\r\n error: (err) => {\r\n // todo handle errors\r\n this.loadEvent.fetchErrorHandler(args, err);\r\n },\r\n });\r\n args.action.triggered = true;\r\n }\r\n\r\n revert(args: EventArgument) {\r\n console.log(`${args.field.name} listens to ${args.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gkxUv.mjs';
|
|
4
|
+
import { L as LoadEvent, I as IssHttp } from './iss-ctrl-load-event-AgBohfHa.mjs';
|
|
5
|
+
|
|
6
|
+
class LoadValueEvent {
|
|
7
|
+
loadEvent = inject(LoadEvent);
|
|
8
|
+
#http = inject(IssHttp);
|
|
9
|
+
fire(args) {
|
|
10
|
+
console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + "%c Load Event Fired", "color: green");
|
|
11
|
+
const api = this.loadEvent.getApi(args);
|
|
12
|
+
args.field.loading.set(true);
|
|
13
|
+
this.#http.get(api).subscribe({
|
|
14
|
+
next: (response) => {
|
|
15
|
+
args.field.response.set(response.data);
|
|
16
|
+
args.field.apiResponse.next(response.data);
|
|
17
|
+
if (args.action.config.afterFetchFn) {
|
|
18
|
+
args.action.config.afterFetchFn?.execute(args);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
if (args.action?.config?.setValueFromApiResponse) {
|
|
22
|
+
args.control.setValue(getPropertyByPath(args.field.response(), args.action.config.setValueFromApiResponse));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
args.control.setValue(args.field.response());
|
|
26
|
+
}
|
|
27
|
+
if (args.action.config.disableAfterFetching) {
|
|
28
|
+
args.control.disable();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
args.field.loading.set(false);
|
|
32
|
+
},
|
|
33
|
+
error: (err) => {
|
|
34
|
+
// todo handle errors
|
|
35
|
+
this.loadEvent.fetchErrorHandler(args, err);
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
args.action.triggered = true;
|
|
39
|
+
}
|
|
40
|
+
revert(args) {
|
|
41
|
+
console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + "%c Load Event Reverted", "color: red");
|
|
42
|
+
}
|
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadValueEvent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
44
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadValueEvent, providedIn: "root" });
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LoadValueEvent, decorators: [{
|
|
47
|
+
type: Injectable,
|
|
48
|
+
args: [{ providedIn: "root" }]
|
|
49
|
+
}] });
|
|
50
|
+
|
|
51
|
+
export { LoadValueEvent };
|
|
52
|
+
//# sourceMappingURL=iss-ctrl-load-value-event-Cpuy1og1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-load-value-event-Cpuy1og1.mjs","sources":["../../../projects/iss/src/events/load/load-value-event.ts"],"sourcesContent":["import { inject, Injectable } from \"@angular/core\";\r\nimport { Dto } from \"../../shared/interfaces/dto\";\r\nimport { EventArgument, EventStrategy } from \"../../shared/interfaces/event-strategy\";\r\nimport { getPropertyByPath } from \"../../shared/utilities/get-property-by-path.util\";\r\nimport { IssHttp } from \"../../shared/utilities/http.util.service\";\r\nimport { LoadEvent } from \"./load-event\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class LoadValueEvent implements EventStrategy {\r\n loadEvent = inject(LoadEvent);\r\n #http: IssHttp = inject(IssHttp);\r\n\r\n fire(args: EventArgument) {\r\n console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + \"%c Load Event Fired\", \"color: green\");\r\n const api = this.loadEvent.getApi(args);\r\n\r\n args.field.loading.set(true);\r\n this.#http.get(api).subscribe({\r\n next: (response: Dto) => {\r\n args.field.response.set(response.data);\r\n args.field.apiResponse.next(response.data);\r\n\r\n if (args.action.config.afterFetchFn) {\r\n args.action.config.afterFetchFn?.execute(args);\r\n } else {\r\n if (args.action?.config?.setValueFromApiResponse) {\r\n args.control.setValue(getPropertyByPath(args.field.response(), args.action.config.setValueFromApiResponse));\r\n } else {\r\n args.control.setValue(args.field.response());\r\n }\r\n\r\n if (args.action.config.disableAfterFetching) {\r\n args.control.disable();\r\n }\r\n }\r\n\r\n args.field.loading.set(false);\r\n },\r\n error: (err) => {\r\n // todo handle errors\r\n this.loadEvent.fetchErrorHandler(args, err);\r\n },\r\n });\r\n args.action.triggered = true;\r\n }\r\n\r\n revert(args: EventArgument) {\r\n console.log(`${args.field.name} listens to ${args.action.trackedFieldName} =>` + \"%c Load Event Reverted\", \"color: red\");\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;MAQa,cAAc,CAAA;AACzB,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,KAAK,GAAY,MAAM,CAAC,OAAO,CAAC;AAEhC,IAAA,IAAI,CAAC,IAAmB,EAAA;QACtB,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAA,GAAA,CAAK,GAAG,qBAAqB,EAAE,cAAc,CAAC;QACvH,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;QAEvC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC;AAC5B,YAAA,IAAI,EAAE,CAAC,QAAa,KAAI;gBACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACtC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAE1C,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE;oBACnC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC;gBAChD;qBAAO;oBACL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A;;2FAClB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { MatLabel } from '@angular/material/form-field';
|
|
5
|
+
import { F as FieldBase, V as VIEW_PROVIDER } from './iss-ctrl-iss-ctrl-BN9rcLt2.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `<iss-field-note>` — read-only explanatory text shown inside the form.
|
|
9
|
+
*
|
|
10
|
+
* Rendered by the outlet for fields of type `enrichment`. It has no control and no viewer:
|
|
11
|
+
* it prints its own control value as a paragraph under the label, in both modes.
|
|
12
|
+
*
|
|
13
|
+
* ### Supported `config` keys
|
|
14
|
+
* | Key | Type | Description |
|
|
15
|
+
* | --- | --- | --- |
|
|
16
|
+
* | `hideLabel` | `boolean` | Hides the field label. |
|
|
17
|
+
*
|
|
18
|
+
* ### Other field members used
|
|
19
|
+
* `label()` · `ctrlValue()`
|
|
20
|
+
*
|
|
21
|
+
* Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and
|
|
22
|
+
* `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```json
|
|
26
|
+
* { "name": "intro", "type": "enrichment", "label": "Before you start", "value": "Fill in every required field before submitting." }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
class NoteField extends FieldBase {
|
|
30
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoteField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: NoteField, isStandalone: true, selector: "iss-field-note", usesInheritance: true, ngImport: i0, template: `
|
|
32
|
+
@if (field.visible()) {
|
|
33
|
+
@if (!field.config.hideLabel()) {
|
|
34
|
+
<mat-label>{{ field.label() }}</mat-label>
|
|
35
|
+
}
|
|
36
|
+
<p>
|
|
37
|
+
{{ ctrlValueChange() }}
|
|
38
|
+
</p>
|
|
39
|
+
}
|
|
40
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: MatLabel, selector: "mat-label" }], viewProviders: [VIEW_PROVIDER] });
|
|
41
|
+
}
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoteField, decorators: [{
|
|
43
|
+
type: Component,
|
|
44
|
+
args: [{
|
|
45
|
+
selector: "iss-field-note",
|
|
46
|
+
viewProviders: [VIEW_PROVIDER],
|
|
47
|
+
imports: [
|
|
48
|
+
ReactiveFormsModule,
|
|
49
|
+
MatLabel
|
|
50
|
+
],
|
|
51
|
+
template: `
|
|
52
|
+
@if (field.visible()) {
|
|
53
|
+
@if (!field.config.hideLabel()) {
|
|
54
|
+
<mat-label>{{ field.label() }}</mat-label>
|
|
55
|
+
}
|
|
56
|
+
<p>
|
|
57
|
+
{{ ctrlValueChange() }}
|
|
58
|
+
</p>
|
|
59
|
+
}
|
|
60
|
+
`
|
|
61
|
+
}]
|
|
62
|
+
}] });
|
|
63
|
+
|
|
64
|
+
export { NoteField };
|
|
65
|
+
//# sourceMappingURL=iss-ctrl-note.field-C9cVaAz0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-note.field-C9cVaAz0.mjs","sources":["../../../projects/iss/src/components/controls/note/note.field.ts"],"sourcesContent":["import { Component } from \"@angular/core\";\r\nimport { ReactiveFormsModule } from \"@angular/forms\";\r\nimport { MatLabel } from \"@angular/material/form-field\";\r\nimport { VIEW_PROVIDER } from \"../../../shared/constants/view-provider.const\";\r\nimport { FieldBase } from \"../base/field-base\";\r\n\r\n/**\r\n * `<iss-field-note>` — read-only explanatory text shown inside the form.\r\n *\r\n * Rendered by the outlet for fields of type `enrichment`. It has no control and no viewer:\r\n * it prints its own control value as a paragraph under the label, in both modes.\r\n *\r\n * ### Supported `config` keys\r\n * | Key | Type | Description |\r\n * | --- | --- | --- |\r\n * | `hideLabel` | `boolean` | Hides the field label. |\r\n *\r\n * ### Other field members used\r\n * `label()` · `ctrlValue()`\r\n *\r\n * Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and\r\n * `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.\r\n *\r\n * @example\r\n * ```json\r\n * { \"name\": \"intro\", \"type\": \"enrichment\", \"label\": \"Before you start\", \"value\": \"Fill in every required field before submitting.\" }\r\n * ```\r\n */\r\n@Component({\r\n selector: \"iss-field-note\",\r\n viewProviders: [VIEW_PROVIDER],\r\n imports: [\r\n ReactiveFormsModule,\r\n MatLabel\r\n ],\r\n template: `\r\n @if (field.visible()) {\r\n @if (!field.config.hideLabel()) {\r\n <mat-label>{{ field.label() }}</mat-label>\r\n }\r\n <p>\r\n {{ ctrlValueChange() }}\r\n </p>\r\n }\r\n `\r\n})\r\nexport class NoteField extends FieldBase {}\r\n"],"names":[],"mappings":";;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAmBG,MAAO,SAAU,SAAQ,SAAS,CAAA;uGAA3B,SAAS,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAXV,CAAA;;;;;;;;;AAST,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAZC,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,QAAQ,EAAA,QAAA,EAAA,WAAA,EAAA,CAAA,EAAA,aAAA,EAHK,CAAC,aAAa,CAAC,EAAA,CAAA;;2FAgBnB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAlBrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,aAAa,EAAE,CAAC,aAAa,CAAC;AAC9B,oBAAA,OAAO,EAAE;wBACP,mBAAmB;wBACnB;AACD,qBAAA;AACD,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;AAST,EAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component } from '@angular/core';
|
|
3
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { MatLabel } from '@angular/material/form-field';
|
|
5
|
+
import { F as FieldBase, V as VIEW_PROVIDER } from './iss-ctrl-iss-ctrl-DOmgkxUv.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* `<iss-field-note>` — read-only explanatory text shown inside the form.
|
|
9
|
+
*
|
|
10
|
+
* Rendered by the outlet for fields of type `enrichment`. It has no control and no viewer:
|
|
11
|
+
* it prints its own control value as a paragraph under the label, in both modes.
|
|
12
|
+
*
|
|
13
|
+
* ### Supported `config` keys
|
|
14
|
+
* | Key | Type | Description |
|
|
15
|
+
* | --- | --- | --- |
|
|
16
|
+
* | `hideLabel` | `boolean` | Hides the field label. |
|
|
17
|
+
*
|
|
18
|
+
* ### Other field members used
|
|
19
|
+
* `label()` · `ctrlValue()`
|
|
20
|
+
*
|
|
21
|
+
* Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and
|
|
22
|
+
* `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```json
|
|
26
|
+
* { "name": "intro", "type": "enrichment", "label": "Before you start", "value": "Fill in every required field before submitting." }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
class NoteField extends FieldBase {
|
|
30
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoteField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: NoteField, isStandalone: true, selector: "iss-field-note", usesInheritance: true, ngImport: i0, template: `
|
|
32
|
+
@if (field.visible()) {
|
|
33
|
+
@if (!field.config.hideLabel()) {
|
|
34
|
+
<mat-label>{{ field.label() }}</mat-label>
|
|
35
|
+
}
|
|
36
|
+
<p>
|
|
37
|
+
{{ ctrlValueChange() }}
|
|
38
|
+
</p>
|
|
39
|
+
}
|
|
40
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: MatLabel, selector: "mat-label" }], viewProviders: [VIEW_PROVIDER] });
|
|
41
|
+
}
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: NoteField, decorators: [{
|
|
43
|
+
type: Component,
|
|
44
|
+
args: [{
|
|
45
|
+
selector: "iss-field-note",
|
|
46
|
+
viewProviders: [VIEW_PROVIDER],
|
|
47
|
+
imports: [
|
|
48
|
+
ReactiveFormsModule,
|
|
49
|
+
MatLabel
|
|
50
|
+
],
|
|
51
|
+
template: `
|
|
52
|
+
@if (field.visible()) {
|
|
53
|
+
@if (!field.config.hideLabel()) {
|
|
54
|
+
<mat-label>{{ field.label() }}</mat-label>
|
|
55
|
+
}
|
|
56
|
+
<p>
|
|
57
|
+
{{ ctrlValueChange() }}
|
|
58
|
+
</p>
|
|
59
|
+
}
|
|
60
|
+
`
|
|
61
|
+
}]
|
|
62
|
+
}] });
|
|
63
|
+
|
|
64
|
+
export { NoteField };
|
|
65
|
+
//# sourceMappingURL=iss-ctrl-note.field-IM4x1O3b.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-note.field-IM4x1O3b.mjs","sources":["../../../projects/iss/src/components/controls/note/note.field.ts"],"sourcesContent":["import { Component } from \"@angular/core\";\r\nimport { ReactiveFormsModule } from \"@angular/forms\";\r\nimport { MatLabel } from \"@angular/material/form-field\";\r\nimport { VIEW_PROVIDER } from \"../../../shared/constants/view-provider.const\";\r\nimport { FieldBase } from \"../base/field-base\";\r\n\r\n/**\r\n * `<iss-field-note>` — read-only explanatory text shown inside the form.\r\n *\r\n * Rendered by the outlet for fields of type `enrichment`. It has no control and no viewer:\r\n * it prints its own control value as a paragraph under the label, in both modes.\r\n *\r\n * ### Supported `config` keys\r\n * | Key | Type | Description |\r\n * | --- | --- | --- |\r\n * | `hideLabel` | `boolean` | Hides the field label. |\r\n *\r\n * ### Other field members used\r\n * `label()` · `ctrlValue()`\r\n *\r\n * Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and\r\n * `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.\r\n *\r\n * @example\r\n * ```json\r\n * { \"name\": \"intro\", \"type\": \"enrichment\", \"label\": \"Before you start\", \"value\": \"Fill in every required field before submitting.\" }\r\n * ```\r\n */\r\n@Component({\r\n selector: \"iss-field-note\",\r\n viewProviders: [VIEW_PROVIDER],\r\n imports: [\r\n ReactiveFormsModule,\r\n MatLabel\r\n ],\r\n template: `\r\n @if (field.visible()) {\r\n @if (!field.config.hideLabel()) {\r\n <mat-label>{{ field.label() }}</mat-label>\r\n }\r\n <p>\r\n {{ ctrlValueChange() }}\r\n </p>\r\n }\r\n `\r\n})\r\nexport class NoteField extends FieldBase {}\r\n"],"names":[],"mappings":";;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAmBG,MAAO,SAAU,SAAQ,SAAS,CAAA;uGAA3B,SAAS,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAXV,CAAA;;;;;;;;;AAST,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAZC,mBAAmB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACnB,QAAQ,EAAA,QAAA,EAAA,WAAA,EAAA,CAAA,EAAA,aAAA,EAHK,CAAC,aAAa,CAAC,EAAA,CAAA;;2FAgBnB,SAAS,EAAA,UAAA,EAAA,CAAA;kBAlBrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;oBAC1B,aAAa,EAAE,CAAC,aAAa,CAAC;AAC9B,oBAAA,OAAO,EAAE;wBACP,mBAAmB;wBACnB;AACD,qBAAA;AACD,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;AAST,EAAA;AACF,iBAAA;;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import { P as PLACEHOLDER_REGEX, g as getPropertyByPath, r as replacePlaceholders } from './iss-ctrl-iss-ctrl-DOmgkxUv.mjs';
|
|
4
|
+
|
|
5
|
+
class ReplaceApiKeys {
|
|
6
|
+
// todo replace {key} with tracked field value [will be deprecated]
|
|
7
|
+
execute(args) {
|
|
8
|
+
// console.log("Replace API keys - Default Implementation");
|
|
9
|
+
const api = args.field.api();
|
|
10
|
+
const matches = api.match(PLACEHOLDER_REGEX);
|
|
11
|
+
if (matches) {
|
|
12
|
+
const replacements = {};
|
|
13
|
+
matches.forEach((match) => {
|
|
14
|
+
const replacement = match.replace("{", "").replace("}", "");
|
|
15
|
+
if (replacement.includes(".")) {
|
|
16
|
+
const path = this.getPath(replacement);
|
|
17
|
+
if (replacement.includes(args.change.trackedField.name)) {
|
|
18
|
+
replacements[replacement] = getPropertyByPath(args.change.trackedField, path);
|
|
19
|
+
}
|
|
20
|
+
if (replacement.includes("loggedInUser")) {
|
|
21
|
+
const loggedInUserProfileStr = localStorage.getItem("profile");
|
|
22
|
+
if (loggedInUserProfileStr) {
|
|
23
|
+
const loggedInUserProfile = JSON.parse(loggedInUserProfileStr);
|
|
24
|
+
replacements[replacement] = getPropertyByPath(loggedInUserProfile, path);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
throw new Error("User profile not found in localStorage. Make sure that localStorage has profile key with user profile.");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (replacement.includes("requestDto")) {
|
|
31
|
+
// todo replace {fromRequestDto}
|
|
32
|
+
// todo from where to get requestDto?
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
replacements[replacement] = args.form.get(replacement)?.getRawValue();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return replacePlaceholders(api, replacements);
|
|
40
|
+
}
|
|
41
|
+
return api;
|
|
42
|
+
}
|
|
43
|
+
getPath(replacement) {
|
|
44
|
+
const arr = replacement.split(".");
|
|
45
|
+
arr.shift();
|
|
46
|
+
return arr.join(".");
|
|
47
|
+
}
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ReplaceApiKeys, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
49
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ReplaceApiKeys, providedIn: "root" });
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ReplaceApiKeys, decorators: [{
|
|
52
|
+
type: Injectable,
|
|
53
|
+
args: [{ providedIn: "root" }]
|
|
54
|
+
}] });
|
|
55
|
+
|
|
56
|
+
export { ReplaceApiKeys };
|
|
57
|
+
//# sourceMappingURL=iss-ctrl-replace-api-keys-CLP4wBYu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iss-ctrl-replace-api-keys-CLP4wBYu.mjs","sources":["../../../projects/iss/src/events/load/replace-api-keys.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\r\nimport { PLACEHOLDER_REGEX } from \"../../shared/constants/placeholder-regex.const\";\r\nimport { EventArgument, EventConfigFn } from \"../../shared/interfaces/event-strategy\";\r\nimport { getPropertyByPath } from \"../../shared/utilities/get-property-by-path.util\";\r\nimport { replacePlaceholders } from \"../../shared/utilities/replace-placeholder.util\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class ReplaceApiKeys implements EventConfigFn {\r\n // todo replace {key} with tracked field value [will be deprecated]\r\n execute(args: EventArgument): string {\r\n // console.log(\"Replace API keys - Default Implementation\");\r\n const api = args.field.api();\r\n const matches = api.match(PLACEHOLDER_REGEX);\r\n if (matches) {\r\n const replacements: any = {};\r\n matches.forEach((match) => {\r\n const replacement = match.replace(\"{\", \"\").replace(\"}\", \"\");\r\n\r\n if (replacement.includes(\".\")) {\r\n const path = this.getPath(replacement);\r\n\r\n if (replacement.includes(args.change.trackedField.name)) {\r\n replacements[replacement] = getPropertyByPath(args.change.trackedField, path);\r\n }\r\n\r\n if (replacement.includes(\"loggedInUser\")) {\r\n const loggedInUserProfileStr = localStorage.getItem(\"profile\");\r\n if (loggedInUserProfileStr) {\r\n const loggedInUserProfile = JSON.parse(loggedInUserProfileStr);\r\n replacements[replacement] = getPropertyByPath(loggedInUserProfile, path);\r\n } else {\r\n throw new Error(\"User profile not found in localStorage. Make sure that localStorage has profile key with user profile.\");\r\n }\r\n }\r\n\r\n if (replacement.includes(\"requestDto\")) {\r\n // todo replace {fromRequestDto}\r\n // todo from where to get requestDto?\r\n }\r\n } else {\r\n replacements[replacement] = args.form.get(replacement)?.getRawValue();\r\n }\r\n });\r\n return replacePlaceholders(api, replacements);\r\n }\r\n\r\n return api;\r\n }\r\n\r\n getPath(replacement: string): string {\r\n const arr = replacement.split(\".\");\r\n arr.shift();\r\n return arr.join(\".\");\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;MAOa,cAAc,CAAA;;AAEzB,IAAA,OAAO,CAAC,IAAmB,EAAA;;QAEzB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;QAC5B,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC;QAC5C,IAAI,OAAO,EAAE;YACX,MAAM,YAAY,GAAQ,EAAE;AAC5B,YAAA,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACxB,gBAAA,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;AAE3D,gBAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;AAEtC,oBAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;AACvD,wBAAA,YAAY,CAAC,WAAW,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAA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