@inspark/inspark-components 1.0.36 → 1.0.38
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/full/bundles/inspark-inspark-components.umd.js +119 -2
- package/full/bundles/inspark-inspark-components.umd.js.map +1 -1
- package/full/bundles/inspark-inspark-components.umd.min.js +2 -2
- package/full/bundles/inspark-inspark-components.umd.min.js.map +1 -1
- package/full/components/content-toggle/content-toggle.component.d.ts +1 -0
- package/full/components/pie/pie.component.d.ts +16 -0
- package/full/components/pie/pie.service.d.ts +16 -0
- package/full/esm2015/components/content-toggle/content-toggle.component.js +7 -2
- package/full/esm2015/components/inspark.module.js +5 -2
- package/full/esm2015/components/pie/pie.component.js +59 -0
- package/full/esm2015/components/pie/pie.service.js +54 -0
- package/full/esm2015/inspark-inspark-components.js +3 -1
- package/full/esm5/components/content-toggle/content-toggle.component.js +7 -2
- package/full/esm5/components/inspark.module.js +5 -2
- package/full/esm5/components/pie/pie.component.js +60 -0
- package/full/esm5/components/pie/pie.service.js +56 -0
- package/full/esm5/inspark-inspark-components.js +3 -1
- package/full/fesm2015/inspark-inspark-components.js +115 -3
- package/full/fesm2015/inspark-inspark-components.js.map +1 -1
- package/full/fesm5/inspark-inspark-components.js +118 -3
- package/full/fesm5/inspark-inspark-components.js.map +1 -1
- package/full/inspark-inspark-components.d.ts +2 -0
- package/full/inspark-inspark-components.metadata.json +1 -1
- package/full/package.json +1 -1
- package/interface/package.json +1 -1
- package/package.json +1 -1
|
@@ -3380,6 +3380,7 @@ let ContentToggleComponent = class ContentToggleComponent {
|
|
|
3380
3380
|
this.cdr = cdr;
|
|
3381
3381
|
this.isOpen = true;
|
|
3382
3382
|
this.icon = null;
|
|
3383
|
+
this.manualArrow = true;
|
|
3383
3384
|
this.toggle = new EventEmitter();
|
|
3384
3385
|
}
|
|
3385
3386
|
toggleOpen() {
|
|
@@ -3403,6 +3404,10 @@ __decorate([
|
|
|
3403
3404
|
Input(),
|
|
3404
3405
|
__metadata("design:type", String)
|
|
3405
3406
|
], ContentToggleComponent.prototype, "icon", void 0);
|
|
3407
|
+
__decorate([
|
|
3408
|
+
Input(),
|
|
3409
|
+
__metadata("design:type", Boolean)
|
|
3410
|
+
], ContentToggleComponent.prototype, "manualArrow", void 0);
|
|
3406
3411
|
__decorate([
|
|
3407
3412
|
Output(),
|
|
3408
3413
|
__metadata("design:type", EventEmitter)
|
|
@@ -3410,7 +3415,7 @@ __decorate([
|
|
|
3410
3415
|
ContentToggleComponent = __decorate([
|
|
3411
3416
|
Component({
|
|
3412
3417
|
selector: 'in-content-toggle',
|
|
3413
|
-
template: "<div class=\"block\" (click)=\"toggleOpen()\" tabIndex=\"1\">\n <span [ngClass]=\"{arrow: true, close: !isOpen}\">\n <in-svg [src]=\"'arrow-down.svg'\" width=\"48px\" height=\"48px\"></in-svg>\n </span>\n <span class=\"label\"
|
|
3418
|
+
template: "<div class=\"block\" (click)=\"toggleOpen()\" tabIndex=\"1\">\n <span [ngClass]=\"{arrow: true, close: !isOpen}\">\n <in-svg *ngIf=\"manualArrow\" [src]=\"'arrow-down.svg'\" width=\"48px\" height=\"48px\"></in-svg>\n <ng-content select=\"[arrow]\"></ng-content>\n </span>\n <span class=\"label\">\n <in-svg *ngIf=\"icon\" class=\"label-icon\" [src]=\"icon\"></in-svg>\n {{label}}\n </span>\n <span class=\"counter\">\n <ng-content select=\"[header]\"></ng-content>\n </span>\n</div>\n<div class=\"container\" *ngIf=\"isOpen\">\n <ng-content select=\"[body]\"></ng-content>\n</div>\n",
|
|
3414
3419
|
styles: ["@charset \"UTF-8\";.block{font-size:12px;text-transform:uppercase;cursor:pointer;display:flex;white-space:nowrap}.block:hover{background:var(--colorBgLevel2)}.block>span{display:inline-block;margin-right:4px}.block .label{margin-right:8px;display:flex;align-items:center;overflow:hidden;text-overflow:ellipsis}.block .counter{display:flex;align-items:center;padding-right:8px}.block .arrow{margin-right:0}.block .arrow.close{transform:rotate(-90deg)}.label-icon{margin-right:4px;width:16px;height:16px}"]
|
|
3415
3420
|
}),
|
|
3416
3421
|
__metadata("design:paramtypes", [ChangeDetectorRef])
|
|
@@ -3908,6 +3913,111 @@ AutoCompleteComponentModule = __decorate([
|
|
|
3908
3913
|
})
|
|
3909
3914
|
], AutoCompleteComponentModule);
|
|
3910
3915
|
|
|
3916
|
+
let PieService = class PieService {
|
|
3917
|
+
constructor() {
|
|
3918
|
+
this.colorArray = ['-1', 0, 1, 2, 3, 4]; // Цвета и последовательность в которой они будут отображены
|
|
3919
|
+
this.colors = {
|
|
3920
|
+
1: '#31ac51',
|
|
3921
|
+
2: '#EE9946',
|
|
3922
|
+
3: '#F95C5D',
|
|
3923
|
+
4: '#a20000',
|
|
3924
|
+
0: '#7E8087',
|
|
3925
|
+
'-1': '#85B3CB'
|
|
3926
|
+
};
|
|
3927
|
+
}
|
|
3928
|
+
create(statuses, size) {
|
|
3929
|
+
const data = [];
|
|
3930
|
+
let allCount = 0;
|
|
3931
|
+
this.colorArray.forEach((color) => {
|
|
3932
|
+
allCount += statuses[color] || 0;
|
|
3933
|
+
});
|
|
3934
|
+
let cumulativePercent = 0;
|
|
3935
|
+
this.colorArray.forEach((color) => {
|
|
3936
|
+
const count = statuses[color];
|
|
3937
|
+
if (!count) {
|
|
3938
|
+
return;
|
|
3939
|
+
}
|
|
3940
|
+
const percent = count / allCount;
|
|
3941
|
+
const [startX, startY] = this.getCoordinatesForPercent(size, cumulativePercent);
|
|
3942
|
+
cumulativePercent += percent;
|
|
3943
|
+
const [endX, endY] = this.getCoordinatesForPercent(size, cumulativePercent);
|
|
3944
|
+
const largeArcFlag = percent > .5 ? 1 : 0;
|
|
3945
|
+
const pathData = [
|
|
3946
|
+
`M ${startX} ${startY}`,
|
|
3947
|
+
`A 20 20 0 ${largeArcFlag} 1 ${endX} ${endY}`,
|
|
3948
|
+
`L 0 0`,
|
|
3949
|
+
].join(' ');
|
|
3950
|
+
data.push({
|
|
3951
|
+
path: pathData,
|
|
3952
|
+
color: this.colors[color + '']
|
|
3953
|
+
});
|
|
3954
|
+
});
|
|
3955
|
+
return data;
|
|
3956
|
+
}
|
|
3957
|
+
getCoordinatesForPercent(size, percent) {
|
|
3958
|
+
const x = size / 2 * Math.cos(2 * Math.PI * percent);
|
|
3959
|
+
const y = size / 2 * Math.sin(2 * Math.PI * percent);
|
|
3960
|
+
return [x, y];
|
|
3961
|
+
}
|
|
3962
|
+
};
|
|
3963
|
+
PieService = __decorate([
|
|
3964
|
+
Injectable()
|
|
3965
|
+
], PieService);
|
|
3966
|
+
|
|
3967
|
+
let ObjectPieComponent = class ObjectPieComponent {
|
|
3968
|
+
constructor(translate, pieService, cdr) {
|
|
3969
|
+
this.translate = translate;
|
|
3970
|
+
this.pieService = pieService;
|
|
3971
|
+
this.cdr = cdr;
|
|
3972
|
+
this.count = 30;
|
|
3973
|
+
this.size = 40;
|
|
3974
|
+
this.statuses = {
|
|
3975
|
+
'-1': 20,
|
|
3976
|
+
0: 4,
|
|
3977
|
+
1: 3,
|
|
3978
|
+
2: 4,
|
|
3979
|
+
3: 5
|
|
3980
|
+
};
|
|
3981
|
+
}
|
|
3982
|
+
ngOnInit() {
|
|
3983
|
+
this.data = this.pieService.create(this.statuses, this.size);
|
|
3984
|
+
}
|
|
3985
|
+
ngOnDestroy() {
|
|
3986
|
+
}
|
|
3987
|
+
ngOnChanges(changes) {
|
|
3988
|
+
}
|
|
3989
|
+
};
|
|
3990
|
+
ObjectPieComponent.ctorParameters = () => [
|
|
3991
|
+
{ type: TranslateService },
|
|
3992
|
+
{ type: PieService },
|
|
3993
|
+
{ type: ChangeDetectorRef }
|
|
3994
|
+
];
|
|
3995
|
+
__decorate([
|
|
3996
|
+
Input(),
|
|
3997
|
+
__metadata("design:type", Object)
|
|
3998
|
+
], ObjectPieComponent.prototype, "count", void 0);
|
|
3999
|
+
__decorate([
|
|
4000
|
+
Input(),
|
|
4001
|
+
__metadata("design:type", Object)
|
|
4002
|
+
], ObjectPieComponent.prototype, "size", void 0);
|
|
4003
|
+
__decorate([
|
|
4004
|
+
Input(),
|
|
4005
|
+
__metadata("design:type", Object)
|
|
4006
|
+
], ObjectPieComponent.prototype, "statuses", void 0);
|
|
4007
|
+
ObjectPieComponent = __decorate([
|
|
4008
|
+
Component({
|
|
4009
|
+
selector: 'in-pie',
|
|
4010
|
+
template: "<div class=\"pie-block\">\n <svg viewBox=\"-20 -20 40 40\">\n <defs>\n <clipPath id=\"cut-off-bottom\">\n <circle cx=\"0\" cy=\"0\" r=\"12\"></circle>\n </clipPath>\n </defs>\n <mask id=\"re8-clip\">\n <circle cx=\"0\" cy=\"0\" r=\"20\" fill=\"white\"></circle>\n <circle cx=\"0\" cy=\"0\" r=\"14\" fill=\"black\"></circle>\n </mask>\n <path *ngFor=\"let path of data\" [attr.d]=\"path.path\" [attr.fill]=\"path.color\" mask=\"url(#re8-clip)\"></path>\n <text x=\"0\" y=\"4\" text-anchor=\"middle\" fill=\"currentColor\">{{count}}</text>\n </svg>\n</div>\n\n\n",
|
|
4011
|
+
encapsulation: ViewEncapsulation.Emulated,
|
|
4012
|
+
providers: [],
|
|
4013
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4014
|
+
styles: [".pie-block{width:40px;height:40px;color:var(--text-color)}.pie-block text{width:20px;height:20px;background:var(--colorBgLevel2);font-size:11px}.pie-block svg{width:40px;height:40px}"]
|
|
4015
|
+
}),
|
|
4016
|
+
__metadata("design:paramtypes", [TranslateService,
|
|
4017
|
+
PieService,
|
|
4018
|
+
ChangeDetectorRef])
|
|
4019
|
+
], ObjectPieComponent);
|
|
4020
|
+
|
|
3911
4021
|
let InsparkComponentsModule = class InsparkComponentsModule {
|
|
3912
4022
|
};
|
|
3913
4023
|
InsparkComponentsModule = __decorate([
|
|
@@ -3957,7 +4067,8 @@ InsparkComponentsModule = __decorate([
|
|
|
3957
4067
|
RadiobuttonComponent,
|
|
3958
4068
|
ObjectTreeComponent,
|
|
3959
4069
|
ContentToggleComponent,
|
|
3960
|
-
InputGroupComponent
|
|
4070
|
+
InputGroupComponent,
|
|
4071
|
+
ObjectPieComponent,
|
|
3961
4072
|
],
|
|
3962
4073
|
exports: [
|
|
3963
4074
|
ButtonComponent,
|
|
@@ -3992,6 +4103,7 @@ InsparkComponentsModule = __decorate([
|
|
|
3992
4103
|
RadiobuttonComponent,
|
|
3993
4104
|
ObjectTreeComponent,
|
|
3994
4105
|
ContentToggleComponent,
|
|
4106
|
+
ObjectPieComponent,
|
|
3995
4107
|
InputGroupComponent,
|
|
3996
4108
|
AutoCompleteComponentModule
|
|
3997
4109
|
],
|
|
@@ -4008,5 +4120,5 @@ InsparkComponentsModule = __decorate([
|
|
|
4008
4120
|
* Generated bundle index. Do not edit.
|
|
4009
4121
|
*/
|
|
4010
4122
|
|
|
4011
|
-
export { AutoCompleteComponentModule, BreadcrumbComponent, ButtonComponent, CheckboxComponent, CommunicationService, ComponentContainerComponent, ContentToggleComponent, DropdownComponentModule, EmptyComponent, FileComponent, InlineMessageComponent, InputTextComponent, InsparkComponentsModule, InsparkDialogService, InsparkHeaderComponent, InsparkMessageService, InsparkStickyComponent, InsparkTemplate, LinkComponent, ModalInputTextComponent, ObjectTreeComponent, PanelComponent, PipesModule, PreloaderComponent, RadiobuttonComponent, SelectButtonComponent, SelectListComponent, StatusCircleComponent, SvgComponent, SwitcherComponent, TableComponentModule, TextareaComponent, ToolbarComponent, TooltipComponent, TreeTableComponentModule, DropdownItem as ɵa, DropdownComponent as ɵb, tableFactory as ɵc, TableComponent as ɵd, TreeTableComponent as ɵe, AutoCompleteComponent as ɵf, PropertyValuePipe as ɵg, ShortToFullWeekdayPipe as ɵh, NumToShortWeekdayPipe as ɵi, FormatNumToTime as ɵj, InDate as ɵk, SafeUrlPipe as ɵl, SortByPipe as ɵm, PrimengComponentsModule as ɵn, TableColumnsMultiselectComponent as ɵo, TableMenuOverlayComponent as ɵp, TableClickOutsideDirective as ɵq, InputGroupComponent as ɵr };
|
|
4123
|
+
export { AutoCompleteComponentModule, BreadcrumbComponent, ButtonComponent, CheckboxComponent, CommunicationService, ComponentContainerComponent, ContentToggleComponent, DropdownComponentModule, EmptyComponent, FileComponent, InlineMessageComponent, InputTextComponent, InsparkComponentsModule, InsparkDialogService, InsparkHeaderComponent, InsparkMessageService, InsparkStickyComponent, InsparkTemplate, LinkComponent, ModalInputTextComponent, ObjectTreeComponent, PanelComponent, PipesModule, PreloaderComponent, RadiobuttonComponent, SelectButtonComponent, SelectListComponent, StatusCircleComponent, SvgComponent, SwitcherComponent, TableComponentModule, TextareaComponent, ToolbarComponent, TooltipComponent, TreeTableComponentModule, DropdownItem as ɵa, DropdownComponent as ɵb, tableFactory as ɵc, TableComponent as ɵd, TreeTableComponent as ɵe, AutoCompleteComponent as ɵf, PropertyValuePipe as ɵg, ShortToFullWeekdayPipe as ɵh, NumToShortWeekdayPipe as ɵi, FormatNumToTime as ɵj, InDate as ɵk, SafeUrlPipe as ɵl, SortByPipe as ɵm, PrimengComponentsModule as ɵn, TableColumnsMultiselectComponent as ɵo, TableMenuOverlayComponent as ɵp, TableClickOutsideDirective as ɵq, InputGroupComponent as ɵr, ObjectPieComponent as ɵs, PieService as ɵt };
|
|
4012
4124
|
//# sourceMappingURL=inspark-inspark-components.js.map
|