widget-common-container 0.0.0
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/.angular/cache/19.2.26/ng-packagr/0997d7866dbb7999756bcd6dce071e827244865f4ff149c26d049d1515686b01 +1 -0
- package/.angular/cache/19.2.26/ng-packagr/882519e10fb587011272af89a34932495c0e2cc97d0c030536d1033ee55ce561 +1 -0
- package/.angular/cache/19.2.26/ng-packagr/8b15b546ec32b4e82b20945f62d23ba911050bdc6a4a60d34875eea6fe236635 +1 -0
- package/.angular/cache/19.2.26/ng-packagr/9711df1afdc00e2ac901d2b22d9559a220e74d16c0bf6d3917e410c565aed496 +1 -0
- package/.angular/cache/19.2.26/ng-packagr/tsbuildinfo/inspark-widget-common.tsbuildinfo +1 -0
- package/.editorconfig +13 -0
- package/.eslintrc.json +28 -0
- package/README.md +27 -0
- package/angular.json +46 -0
- package/e2e/protractor.conf.js +28 -0
- package/e2e/src/app.e2e-spec.ts +14 -0
- package/e2e/src/app.po.ts +11 -0
- package/e2e/tsconfig.e2e.json +13 -0
- package/package.json +75 -0
- package/projects/widget-common/copy.json +8 -0
- package/projects/widget-common/karma.conf.js +31 -0
- package/projects/widget-common/ng-package.json +7 -0
- package/projects/widget-common/package-lock.json +78 -0
- package/projects/widget-common/package.json +23 -0
- package/projects/widget-common/src/assets/error.svg +6 -0
- package/projects/widget-common/src/assets/falsevalue.svg +6 -0
- package/projects/widget-common/src/assets/icon.svg +6 -0
- package/projects/widget-common/src/assets/none.svg +6 -0
- package/projects/widget-common/src/assets/success.svg +6 -0
- package/projects/widget-common/src/assets/warning.svg +6 -0
- package/projects/widget-common/src/lib/common.ts +23 -0
- package/projects/widget-common/src/lib/communication.service.ts +59 -0
- package/projects/widget-common/src/lib/echart/echart.component.html +2 -0
- package/projects/widget-common/src/lib/echart/echart.component.scss +40 -0
- package/projects/widget-common/src/lib/echart/echart.component.ts +703 -0
- package/projects/widget-common/src/lib/echart/en.ts +156 -0
- package/projects/widget-common/src/lib/echart/ru.ts +156 -0
- package/projects/widget-common/src/lib/forge/ParamAssign.ts +187 -0
- package/projects/widget-common/src/lib/forge/Script.service.ts +86 -0
- package/projects/widget-common/src/lib/forge/extenstion.ts +263 -0
- package/projects/widget-common/src/lib/forge/forge.component.html +2 -0
- package/projects/widget-common/src/lib/forge/forge.component.scss +6 -0
- package/projects/widget-common/src/lib/forge/forge.component.ts +184 -0
- package/projects/widget-common/src/lib/forge/forge.interface.ts +4 -0
- package/projects/widget-common/src/lib/loader.ts +19 -0
- package/projects/widget-common/src/lib/pie-chart/pie-chart.component.html +1 -0
- package/projects/widget-common/src/lib/pie-chart/pie-chart.component.scss +3 -0
- package/projects/widget-common/src/lib/pie-chart/pie-chart.component.ts +252 -0
- package/projects/widget-common/src/lib/shared.module.ts +40 -0
- package/projects/widget-common/src/lib/sprintf.ts +212 -0
- package/projects/widget-common/src/lib/widget-container/widget-container.component.ts +53 -0
- package/projects/widget-common/src/lib/widget.api.ts +24 -0
- package/projects/widget-common/src/lib/widget.component.ts +87 -0
- package/projects/widget-common/src/lib/widget.dialog.ts +14 -0
- package/projects/widget-common/src/lib/widget.generator.ts +1532 -0
- package/projects/widget-common/src/lib/widget.interface.ts +871 -0
- package/projects/widget-common/src/lib/widget.utils.ts +634 -0
- package/projects/widget-common/src/public_api.ts +9 -0
- package/projects/widget-common/src/scss/main.scss +24 -0
- package/projects/widget-common/src/test.ts +22 -0
- package/projects/widget-common/tsconfig.lib.json +38 -0
- package/projects/widget-common/tsconfig.lib.prod.json +6 -0
- package/projects/widget-common/tsconfig.spec.json +17 -0
- package/projects/widget-common/tslint.json +17 -0
- package/projects/widget-common/versions/full/copy.json +15 -0
- package/projects/widget-common/versions/full/package.json +7 -0
- package/projects/widget-common/versions/full/public_api.ts +19 -0
- package/projects/widget-common/versions/interfaces/copy.json +15 -0
- package/projects/widget-common/versions/interfaces/package.json +7 -0
- package/projects/widget-common/versions/interfaces/public_api.ts +9 -0
- package/src/app/app.component.html +20 -0
- package/src/app/app.component.scss +0 -0
- package/src/app/app.component.spec.ts +31 -0
- package/src/app/app.component.ts +10 -0
- package/src/app/app.module.ts +16 -0
- package/src/assets/.gitkeep +0 -0
- package/src/browserslist +11 -0
- package/src/environments/environment.prod.ts +3 -0
- package/src/environments/environment.ts +16 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +14 -0
- package/src/karma.conf.js +31 -0
- package/src/main.ts +12 -0
- package/src/polyfills.ts +80 -0
- package/src/styles.scss +1 -0
- package/src/test.ts +20 -0
- package/src/tsconfig.app.json +11 -0
- package/src/tsconfig.spec.json +18 -0
- package/src/tslint.json +17 -0
- package/tsconfig.json +34 -0
- package/tslint.json +131 -0
- package/update_full.js +27 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
2
|
+
<g fill="#44f" fill-rule="nonzero">
|
|
3
|
+
<circle cx="12" cy="12" r="10" stroke="#666" stroke-width="1" fill="#fa6" />
|
|
4
|
+
</g>
|
|
5
|
+
<text style="font: 4px sans-serif; color: #000" x="4.5" y="13.5" class="small">Warning</text>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {IWidgetClass} from "./widget.interface";
|
|
2
|
+
|
|
3
|
+
class Common {
|
|
4
|
+
|
|
5
|
+
serviceUrl = '';
|
|
6
|
+
|
|
7
|
+
getWidgetPath(widget: IWidgetClass): string {
|
|
8
|
+
return `/assets/widgets/${widget.storeId}/`;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
transformChartUrlConfig(param: any, isCalc = null, isSignal = null): string {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
override(serviceUrl: string, transformChartUrlConfig: any, getWidgetPath: any) {
|
|
16
|
+
this.serviceUrl = serviceUrl;
|
|
17
|
+
this.transformChartUrlConfig = transformChartUrlConfig;
|
|
18
|
+
this.getWidgetPath = getWidgetPath;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const common = new Common();
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {Injectable} from '@angular/core';
|
|
2
|
+
import {Subject} from 'rxjs';
|
|
3
|
+
|
|
4
|
+
export enum CommunicationCommand {
|
|
5
|
+
'values' = 'values',
|
|
6
|
+
'params' = 'params',
|
|
7
|
+
'locale' = 'locale',
|
|
8
|
+
'theme' = 'theme',
|
|
9
|
+
'widget' = 'widget',
|
|
10
|
+
'resize' = 'resize',
|
|
11
|
+
'paramData' = 'paramData',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CommunicationValue {
|
|
15
|
+
command?: CommunicationCommand;
|
|
16
|
+
|
|
17
|
+
[k: string]: any;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Injectable()
|
|
21
|
+
export class CommunicationService {
|
|
22
|
+
|
|
23
|
+
private messageSource: Record<string, Subject<CommunicationValue>> = {};
|
|
24
|
+
message$/*: Record<number, Observable<CommunicationValue>>*/ = {};
|
|
25
|
+
|
|
26
|
+
cache: Record<string, Partial<Record<CommunicationCommand, CommunicationValue>>> = {};
|
|
27
|
+
|
|
28
|
+
create(id: number | string) {
|
|
29
|
+
const _id = `${id}`.trim();
|
|
30
|
+
if (!this.messageSource[_id]) {
|
|
31
|
+
this.messageSource[_id] = new Subject<CommunicationValue>();
|
|
32
|
+
this.message$[_id] = this.messageSource[_id].asObservable() as any;
|
|
33
|
+
this.cache[_id] = {};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
next(widgetId: number | string, value: CommunicationValue) {
|
|
38
|
+
const _id = `${widgetId}`.trim();
|
|
39
|
+
this.create(_id);
|
|
40
|
+
this.messageSource[_id].next(value);
|
|
41
|
+
if (value.command) {
|
|
42
|
+
this.cache[_id][value.command] = value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
subscribe(widgetId: number | string, callback: (data: CommunicationValue) => {}) {
|
|
47
|
+
const _id = `${widgetId}`.trim();
|
|
48
|
+
this.create(_id);
|
|
49
|
+
if (this.cache[_id][CommunicationCommand.params]) {
|
|
50
|
+
callback((this.cache[_id][CommunicationCommand.params]));
|
|
51
|
+
}
|
|
52
|
+
for (const k in this.cache[_id]) {
|
|
53
|
+
if (this.cache[_id].hasOwnProperty(k)) {
|
|
54
|
+
callback((this.cache[_id][k]));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return this.message$[_id].subscribe(callback);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.no-data-message {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 50%;
|
|
4
|
+
left: 50%;
|
|
5
|
+
transform: translate(-50%, -50%);
|
|
6
|
+
opacity: .7;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
::ng-deep .label-formatter {
|
|
10
|
+
|
|
11
|
+
.title {
|
|
12
|
+
padding-bottom: 8px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
table {
|
|
16
|
+
color: #333;
|
|
17
|
+
|
|
18
|
+
.label {
|
|
19
|
+
padding-right: 8px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.value {
|
|
23
|
+
text-align: right;
|
|
24
|
+
//font-weight: bold;
|
|
25
|
+
color: #555;
|
|
26
|
+
min-width: 100px;
|
|
27
|
+
display: flex;
|
|
28
|
+
|
|
29
|
+
& > div {
|
|
30
|
+
margin-right: 4px;
|
|
31
|
+
|
|
32
|
+
span {
|
|
33
|
+
opacity: .5;
|
|
34
|
+
font-size: 11px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|