@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
|
@@ -3511,6 +3511,7 @@ var ContentToggleComponent = /** @class */ (function () {
|
|
|
3511
3511
|
this.cdr = cdr;
|
|
3512
3512
|
this.isOpen = true;
|
|
3513
3513
|
this.icon = null;
|
|
3514
|
+
this.manualArrow = true;
|
|
3514
3515
|
this.toggle = new EventEmitter();
|
|
3515
3516
|
}
|
|
3516
3517
|
ContentToggleComponent.prototype.toggleOpen = function () {
|
|
@@ -3533,6 +3534,10 @@ var ContentToggleComponent = /** @class */ (function () {
|
|
|
3533
3534
|
Input(),
|
|
3534
3535
|
__metadata("design:type", String)
|
|
3535
3536
|
], ContentToggleComponent.prototype, "icon", void 0);
|
|
3537
|
+
__decorate([
|
|
3538
|
+
Input(),
|
|
3539
|
+
__metadata("design:type", Boolean)
|
|
3540
|
+
], ContentToggleComponent.prototype, "manualArrow", void 0);
|
|
3536
3541
|
__decorate([
|
|
3537
3542
|
Output(),
|
|
3538
3543
|
__metadata("design:type", EventEmitter)
|
|
@@ -3540,7 +3545,7 @@ var ContentToggleComponent = /** @class */ (function () {
|
|
|
3540
3545
|
ContentToggleComponent = __decorate([
|
|
3541
3546
|
Component({
|
|
3542
3547
|
selector: 'in-content-toggle',
|
|
3543
|
-
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\"
|
|
3548
|
+
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",
|
|
3544
3549
|
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}"]
|
|
3545
3550
|
}),
|
|
3546
3551
|
__metadata("design:paramtypes", [ChangeDetectorRef])
|
|
@@ -4050,6 +4055,114 @@ var AutoCompleteComponentModule = /** @class */ (function () {
|
|
|
4050
4055
|
return AutoCompleteComponentModule;
|
|
4051
4056
|
}());
|
|
4052
4057
|
|
|
4058
|
+
var PieService = /** @class */ (function () {
|
|
4059
|
+
function PieService() {
|
|
4060
|
+
this.colorArray = ['-1', 0, 1, 2, 3, 4]; // Цвета и последовательность в которой они будут отображены
|
|
4061
|
+
this.colors = {
|
|
4062
|
+
1: '#31ac51',
|
|
4063
|
+
2: '#EE9946',
|
|
4064
|
+
3: '#F95C5D',
|
|
4065
|
+
4: '#a20000',
|
|
4066
|
+
0: '#7E8087',
|
|
4067
|
+
'-1': '#85B3CB'
|
|
4068
|
+
};
|
|
4069
|
+
}
|
|
4070
|
+
PieService.prototype.create = function (statuses, size) {
|
|
4071
|
+
var _this = this;
|
|
4072
|
+
var data = [];
|
|
4073
|
+
var allCount = 0;
|
|
4074
|
+
this.colorArray.forEach(function (color) {
|
|
4075
|
+
allCount += statuses[color] || 0;
|
|
4076
|
+
});
|
|
4077
|
+
var cumulativePercent = 0;
|
|
4078
|
+
this.colorArray.forEach(function (color) {
|
|
4079
|
+
var count = statuses[color];
|
|
4080
|
+
if (!count) {
|
|
4081
|
+
return;
|
|
4082
|
+
}
|
|
4083
|
+
var percent = count / allCount;
|
|
4084
|
+
var _a = __read(_this.getCoordinatesForPercent(size, cumulativePercent), 2), startX = _a[0], startY = _a[1];
|
|
4085
|
+
cumulativePercent += percent;
|
|
4086
|
+
var _b = __read(_this.getCoordinatesForPercent(size, cumulativePercent), 2), endX = _b[0], endY = _b[1];
|
|
4087
|
+
var largeArcFlag = percent > .5 ? 1 : 0;
|
|
4088
|
+
var pathData = [
|
|
4089
|
+
"M " + startX + " " + startY,
|
|
4090
|
+
"A 20 20 0 " + largeArcFlag + " 1 " + endX + " " + endY,
|
|
4091
|
+
"L 0 0",
|
|
4092
|
+
].join(' ');
|
|
4093
|
+
data.push({
|
|
4094
|
+
path: pathData,
|
|
4095
|
+
color: _this.colors[color + '']
|
|
4096
|
+
});
|
|
4097
|
+
});
|
|
4098
|
+
return data;
|
|
4099
|
+
};
|
|
4100
|
+
PieService.prototype.getCoordinatesForPercent = function (size, percent) {
|
|
4101
|
+
var x = size / 2 * Math.cos(2 * Math.PI * percent);
|
|
4102
|
+
var y = size / 2 * Math.sin(2 * Math.PI * percent);
|
|
4103
|
+
return [x, y];
|
|
4104
|
+
};
|
|
4105
|
+
PieService = __decorate([
|
|
4106
|
+
Injectable()
|
|
4107
|
+
], PieService);
|
|
4108
|
+
return PieService;
|
|
4109
|
+
}());
|
|
4110
|
+
|
|
4111
|
+
var ObjectPieComponent = /** @class */ (function () {
|
|
4112
|
+
function ObjectPieComponent(translate, pieService, cdr) {
|
|
4113
|
+
this.translate = translate;
|
|
4114
|
+
this.pieService = pieService;
|
|
4115
|
+
this.cdr = cdr;
|
|
4116
|
+
this.count = 30;
|
|
4117
|
+
this.size = 40;
|
|
4118
|
+
this.statuses = {
|
|
4119
|
+
'-1': 20,
|
|
4120
|
+
0: 4,
|
|
4121
|
+
1: 3,
|
|
4122
|
+
2: 4,
|
|
4123
|
+
3: 5
|
|
4124
|
+
};
|
|
4125
|
+
}
|
|
4126
|
+
ObjectPieComponent.prototype.ngOnInit = function () {
|
|
4127
|
+
this.data = this.pieService.create(this.statuses, this.size);
|
|
4128
|
+
};
|
|
4129
|
+
ObjectPieComponent.prototype.ngOnDestroy = function () {
|
|
4130
|
+
};
|
|
4131
|
+
ObjectPieComponent.prototype.ngOnChanges = function (changes) {
|
|
4132
|
+
};
|
|
4133
|
+
ObjectPieComponent.ctorParameters = function () { return [
|
|
4134
|
+
{ type: TranslateService },
|
|
4135
|
+
{ type: PieService },
|
|
4136
|
+
{ type: ChangeDetectorRef }
|
|
4137
|
+
]; };
|
|
4138
|
+
__decorate([
|
|
4139
|
+
Input(),
|
|
4140
|
+
__metadata("design:type", Object)
|
|
4141
|
+
], ObjectPieComponent.prototype, "count", void 0);
|
|
4142
|
+
__decorate([
|
|
4143
|
+
Input(),
|
|
4144
|
+
__metadata("design:type", Object)
|
|
4145
|
+
], ObjectPieComponent.prototype, "size", void 0);
|
|
4146
|
+
__decorate([
|
|
4147
|
+
Input(),
|
|
4148
|
+
__metadata("design:type", Object)
|
|
4149
|
+
], ObjectPieComponent.prototype, "statuses", void 0);
|
|
4150
|
+
ObjectPieComponent = __decorate([
|
|
4151
|
+
Component({
|
|
4152
|
+
selector: 'in-pie',
|
|
4153
|
+
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",
|
|
4154
|
+
encapsulation: ViewEncapsulation.Emulated,
|
|
4155
|
+
providers: [],
|
|
4156
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4157
|
+
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}"]
|
|
4158
|
+
}),
|
|
4159
|
+
__metadata("design:paramtypes", [TranslateService,
|
|
4160
|
+
PieService,
|
|
4161
|
+
ChangeDetectorRef])
|
|
4162
|
+
], ObjectPieComponent);
|
|
4163
|
+
return ObjectPieComponent;
|
|
4164
|
+
}());
|
|
4165
|
+
|
|
4053
4166
|
var InsparkComponentsModule = /** @class */ (function () {
|
|
4054
4167
|
function InsparkComponentsModule() {
|
|
4055
4168
|
}
|
|
@@ -4100,7 +4213,8 @@ var InsparkComponentsModule = /** @class */ (function () {
|
|
|
4100
4213
|
RadiobuttonComponent,
|
|
4101
4214
|
ObjectTreeComponent,
|
|
4102
4215
|
ContentToggleComponent,
|
|
4103
|
-
InputGroupComponent
|
|
4216
|
+
InputGroupComponent,
|
|
4217
|
+
ObjectPieComponent,
|
|
4104
4218
|
],
|
|
4105
4219
|
exports: [
|
|
4106
4220
|
ButtonComponent,
|
|
@@ -4135,6 +4249,7 @@ var InsparkComponentsModule = /** @class */ (function () {
|
|
|
4135
4249
|
RadiobuttonComponent,
|
|
4136
4250
|
ObjectTreeComponent,
|
|
4137
4251
|
ContentToggleComponent,
|
|
4252
|
+
ObjectPieComponent,
|
|
4138
4253
|
InputGroupComponent,
|
|
4139
4254
|
AutoCompleteComponentModule
|
|
4140
4255
|
],
|
|
@@ -4153,5 +4268,5 @@ var InsparkComponentsModule = /** @class */ (function () {
|
|
|
4153
4268
|
* Generated bundle index. Do not edit.
|
|
4154
4269
|
*/
|
|
4155
4270
|
|
|
4156
|
-
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 };
|
|
4271
|
+
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 };
|
|
4157
4272
|
//# sourceMappingURL=inspark-inspark-components.js.map
|