@onecx/integration-interface 9.0.0-rc.4 → 9.0.0-rc.6
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/dist/index.cjs
CHANGED
|
@@ -782,11 +782,15 @@ var IconService = class {
|
|
|
782
782
|
}
|
|
783
783
|
return className;
|
|
784
784
|
}
|
|
785
|
-
async requestIconAsync(name, classType
|
|
785
|
+
async requestIconAsync(name, classType, fallbackClass) {
|
|
786
786
|
const className = this.requestIcon(name, classType);
|
|
787
787
|
const cached = globalThis.onecxIcons?.[name];
|
|
788
|
-
if (cached === null)
|
|
789
|
-
|
|
788
|
+
if (cached === null) {
|
|
789
|
+
return fallbackClass ?? null;
|
|
790
|
+
}
|
|
791
|
+
if (cached) {
|
|
792
|
+
return className;
|
|
793
|
+
}
|
|
790
794
|
await (0, import_rxjs5.firstValueFrom)(
|
|
791
795
|
this.iconTopic.pipe(
|
|
792
796
|
(0, import_rxjs5.filter)((e) => e.type === "IconsReceived"),
|
|
@@ -794,7 +798,7 @@ var IconService = class {
|
|
|
794
798
|
(0, import_rxjs5.filter)((v) => v !== void 0)
|
|
795
799
|
)
|
|
796
800
|
);
|
|
797
|
-
return globalThis.onecxIcons?.[name] ? className : null;
|
|
801
|
+
return globalThis.onecxIcons?.[name] ? className : fallbackClass ?? null;
|
|
798
802
|
}
|
|
799
803
|
destroy() {
|
|
800
804
|
this.iconTopic.destroy();
|
package/dist/index.mjs
CHANGED
|
@@ -691,11 +691,15 @@ var IconService = class {
|
|
|
691
691
|
}
|
|
692
692
|
return className;
|
|
693
693
|
}
|
|
694
|
-
async requestIconAsync(name, classType
|
|
694
|
+
async requestIconAsync(name, classType, fallbackClass) {
|
|
695
695
|
const className = this.requestIcon(name, classType);
|
|
696
696
|
const cached = globalThis.onecxIcons?.[name];
|
|
697
|
-
if (cached === null)
|
|
698
|
-
|
|
697
|
+
if (cached === null) {
|
|
698
|
+
return fallbackClass ?? null;
|
|
699
|
+
}
|
|
700
|
+
if (cached) {
|
|
701
|
+
return className;
|
|
702
|
+
}
|
|
699
703
|
await firstValueFrom2(
|
|
700
704
|
this.iconTopic.pipe(
|
|
701
705
|
filter2((e) => e.type === "IconsReceived"),
|
|
@@ -703,7 +707,7 @@ var IconService = class {
|
|
|
703
707
|
filter2((v) => v !== void 0)
|
|
704
708
|
)
|
|
705
709
|
);
|
|
706
|
-
return globalThis.onecxIcons?.[name] ? className : null;
|
|
710
|
+
return globalThis.onecxIcons?.[name] ? className : fallbackClass ?? null;
|
|
707
711
|
}
|
|
708
712
|
destroy() {
|
|
709
713
|
this.iconTopic.destroy();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onecx/integration-interface",
|
|
3
|
-
"version": "9.0.0-rc.
|
|
3
|
+
"version": "9.0.0-rc.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"rxjs": "^7.8.1",
|
|
11
|
-
"@onecx/accelerator": "^9.0.0-rc.
|
|
11
|
+
"@onecx/accelerator": "^9.0.0-rc.6"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"dependencies": {
|
|
@@ -10,6 +10,6 @@ export declare class IconService {
|
|
|
10
10
|
set iconTopic(source: IconTopic);
|
|
11
11
|
constructor();
|
|
12
12
|
requestIcon(name: string, classType?: IconClassType): string;
|
|
13
|
-
requestIconAsync(name: string, classType?: IconClassType): Promise<string | null>;
|
|
13
|
+
requestIconAsync(name: string, classType?: IconClassType, fallbackClass?: string): Promise<string | null>;
|
|
14
14
|
destroy(): void;
|
|
15
15
|
}
|
|
@@ -33,15 +33,17 @@ export class IconService {
|
|
|
33
33
|
}
|
|
34
34
|
return className;
|
|
35
35
|
}
|
|
36
|
-
async requestIconAsync(name, classType
|
|
36
|
+
async requestIconAsync(name, classType, fallbackClass) {
|
|
37
37
|
const className = this.requestIcon(name, classType);
|
|
38
38
|
const cached = globalThis.onecxIcons?.[name];
|
|
39
|
-
if (cached === null)
|
|
40
|
-
return null;
|
|
41
|
-
|
|
39
|
+
if (cached === null) {
|
|
40
|
+
return fallbackClass ?? null;
|
|
41
|
+
}
|
|
42
|
+
if (cached) {
|
|
42
43
|
return className;
|
|
44
|
+
}
|
|
43
45
|
await firstValueFrom(this.iconTopic.pipe(filter(e => e.type === 'IconsReceived'), map(() => globalThis.onecxIcons?.[name]), filter(v => v !== undefined)));
|
|
44
|
-
return globalThis.onecxIcons?.[name] ? className : null;
|
|
46
|
+
return globalThis.onecxIcons?.[name] ? className : (fallbackClass ?? null);
|
|
45
47
|
}
|
|
46
48
|
destroy() {
|
|
47
49
|
this.iconTopic.destroy();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.service.js","sourceRoot":"","sources":["../../../../../../libs/integration-interface/src/lib/services/icon.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,iBAAiB,CAAC;AAEzB,MAAM,kBAAkB,GAAkB,mBAAmB,CAAA;AAG7D,MAAM,UAAU,eAAe;IAC7B,cAAc,CAAC,UAAU,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAA;AAChD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,SAAwB;IACtE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAA;IACxC,OAAO,oBAAoB,SAAS,IAAI,QAAQ,EAAE,CAAA;AACpD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAA;AACjD,CAAC;AAGD,MAAM,OAAO,WAAW;IAEd,WAAW,CAAwB;IAC3C,IAAI,SAAS;QACX,IAAI,CAAC,WAAW,KAAK,IAAI,SAAS,EAAE,CAAA;QACpC,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IACD,IAAI,SAAS,CAAC,MAAiB;QAC7B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;IAC3B,CAAC;IAED;QACE,eAAe,EAAE,CAAA;IACnB,CAAC;IAED,WAAW,CAAC,IAAY,EAAE,YAA2B,kBAAkB;QACrE,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAEpD,IAAI,UAAU,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9D,cAAc,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,SAAS,CAAC,CAAA;YAC3D,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAA;QACzD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,IAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"icon.service.js","sourceRoot":"","sources":["../../../../../../libs/integration-interface/src/lib/services/icon.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,iBAAiB,CAAC;AAEzB,MAAM,kBAAkB,GAAkB,mBAAmB,CAAA;AAG7D,MAAM,UAAU,eAAe;IAC7B,cAAc,CAAC,UAAU,E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AAM,MAAM,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAA;QAC5C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,OAAO,aAAa,IAAI,IAAI,CAAA;QAC9B,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,MAAM,cAAc,CAClB,IAAI,CAAC,SAAS,CAAC,IAAI,CACjB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC,EACvC,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,EACxC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAC7B,CACF,CAAA;QAED,OAAO,UAAU,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,IAAI,IAAI,CAAC,CAAA;IAC5E,CAAC;IAED,OAAO;QACL,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF"}
|
package/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const LIB_NAME = "@onecx/integration-interface";
|
|
2
|
-
export declare const LIB_VERSION = "9.0.0-rc.
|
|
2
|
+
export declare const LIB_VERSION = "9.0.0-rc.6";
|
package/src/version.js
CHANGED