@inspark/inspark-components 1.0.40 → 1.0.42

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.
@@ -2080,6 +2080,12 @@
2080
2080
  return _this.groupInfo[key] = { isExpanded: true };
2081
2081
  });
2082
2082
  this.sortByGroup();
2083
+ if (this.dt && this.dt.filteredValue) {
2084
+ this.sortByGroup(this.dt.filteredValue, this.dt._sortOrder);
2085
+ }
2086
+ else if (this.dt && this.dt._value && this.dt._sortOrder) {
2087
+ this.sortByGroup(this.dt._value, this.dt._sortOrder);
2088
+ }
2083
2089
  }
2084
2090
  };
2085
2091
  TableComponent.prototype.isShowGroup = function (key, rowIndex) {
@@ -2103,8 +2109,18 @@
2103
2109
  TableComponent.prototype.localSearch = function (dt, searchText) {
2104
2110
  dt.filterGlobal(searchText, 'contains');
2105
2111
  };
2106
- TableComponent.prototype.sortByGroup = function () {
2112
+ TableComponent.prototype.sortByGroup = function (values, sortOrder) {
2107
2113
  var g = this.groupMode;
2114
+ if (values) {
2115
+ return values.sort(function (row1, row2) {
2116
+ if (typeof (row1.groupOrder[g]) === 'number') {
2117
+ return sortOrder * (row1.groupOrder[g] - row2.groupOrder[g]);
2118
+ }
2119
+ else {
2120
+ return sortOrder * row1.groupOrder[g].localeCompare(row2.groupOrder[g], undefined, { numeric: true, sensitivity: 'base' });
2121
+ }
2122
+ });
2123
+ }
2108
2124
  this.values.sort(function (row1, row2) {
2109
2125
  if (typeof (row1.groupOrder[g]) === 'number') {
2110
2126
  return row1.groupOrder[g] - row2.groupOrder[g];
@@ -2516,7 +2532,7 @@
2516
2532
  template: "<div class=\"toolbar-wrapper\">\n <in-sticky top=\"60\">\n\n <div class=\"c-panel toolbar-container\">\n <div class=\"c-toolbar\">\n <div class=\"c-toolbar__side-left\">\n <div class=\"c-toolbar__title\">{{title}}</div>\n </div>\n <div class=\"c-toolbar__side-center\">\n\n </div>\n <div class=\"c-toolbar__side-right\">\n <ng-content></ng-content>\n </div>\n\n </div>\n </div>\n </in-sticky>\n</div>\n",
2517
2533
  changeDetection: core.ChangeDetectionStrategy.OnPush,
2518
2534
  entryComponents: [],
2519
- styles: [".toolbar-wrapper{padding-bottom:4px}.toolbar-container{padding:8px;position:relative}:host{position:-webkit-sticky;position:sticky;z-index:2}.c-toolbar{display:inline-flex;width:100%}.c-toolbar__side-left{flex:1;text-align:left}.c-toolbar__title{display:inline-flex;vertical-align:middle;font-size:22px}.c-toolbar__side-right{display:flex;text-align:right}.add-widget{position:fixed;right:16px;bottom:16px}.widget-container{position:absolute;left:0;top:40px;right:0;bottom:0;overflow:auto}.widget-block{position:absolute;left:5px;top:5px;right:5px;bottom:5px}.sidebar{background:var(--main-background);position:absolute;left:0;top:35px;bottom:0;height:100vh;z-index:100;width:300px;box-shadow:0 0 3px 8px rgba(0,0,0,.1);overflow:auto}.right-side{display:flex;align-items:center;justify-content:flex-end;flex:1}.right-side>*{margin-left:5px}.left-side{white-space:nowrap;display:flex;align-items:center;justify-content:flex-start}.left-side>*{margin-right:5px}.controls-panel{height:41px;border-radius:2px;padding:4px 0;margin:0 5px 5px;display:flex}.dashboard-list{position:relative}.title{font-size:22px}"]
2535
+ styles: [".toolbar-wrapper{padding-bottom:4px}.toolbar-container{padding:8px;position:relative}:host{position:sticky;z-index:2}.c-toolbar{display:inline-flex;width:100%}.c-toolbar__side-left{flex:1;text-align:left}.c-toolbar__title{display:inline-flex;vertical-align:middle;font-size:22px}.c-toolbar__side-right{display:flex;text-align:right}.add-widget{position:fixed;right:16px;bottom:16px}.widget-container{position:absolute;left:0;top:40px;right:0;bottom:0;overflow:auto}.widget-block{position:absolute;left:5px;top:5px;right:5px;bottom:5px}.sidebar{background:var(--main-background);position:absolute;left:0;top:35px;bottom:0;height:100vh;z-index:100;width:300px;box-shadow:0 0 3px 8px rgba(0,0,0,.1);overflow:auto}.right-side{display:flex;align-items:center;justify-content:flex-end;flex:1}.right-side>*{margin-left:5px}.left-side{white-space:nowrap;display:flex;align-items:center;justify-content:flex-start}.left-side>*{margin-right:5px}.controls-panel{height:41px;border-radius:2px;padding:4px 0;margin:0 5px 5px;display:flex}.dashboard-list{position:relative}.title{font-size:22px}"]
2520
2536
  }),
2521
2537
  __metadata("design:paramtypes", [core.ElementRef, core.ChangeDetectorRef, router.Router])
2522
2538
  ], ToolbarComponent);
@@ -3727,14 +3743,12 @@
3727
3743
  }
3728
3744
  ContentToggleComponent.prototype.ngOnInit = function () {
3729
3745
  this.isOpen = this.defaultOpen;
3730
- console.log('defaultOpen', this.defaultOpen);
3731
- console.log('isOpen', this.isOpen);
3732
3746
  };
3733
3747
  ContentToggleComponent.prototype.toggleOpen = function (e) {
3734
3748
  // Получаем родительский элемент div
3735
3749
  var parentElement = this.elementButtons.nativeElement;
3736
3750
  // Проверяем, входит ли цель события в родительский элемент
3737
- if (!parentElement.contains(e.target)) {
3751
+ if (!parentElement.contains(e.target) || e.target === parentElement) {
3738
3752
  this.isOpen = !this.isOpen;
3739
3753
  this.toggle.emit(this.isOpen);
3740
3754
  this.cdr.detectChanges();
@@ -3775,7 +3789,7 @@
3775
3789
  core.Component({
3776
3790
  selector: 'in-content-toggle',
3777
3791
  template: "<div class=\"block\" (click)=\"toggleOpen($event)\" 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 class=\"buttons\" #buttons>\n <ng-content select=\"[buttons]\"></ng-content>\n </div>\n</div>\n<div class=\"container\" *ngIf=\"isOpen\">\n <ng-content select=\"[body]\"></ng-content>\n</div>\n",
3778
- styles: ["@charset \"UTF-8\";.block{font-size:12px;text-transform:uppercase;cursor:pointer;display:flex;white-space:nowrap}.block .buttons{flex:1;display:flex;justify-content:flex-end}.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}"]
3792
+ styles: ["@charset \"UTF-8\";.block{font-size:12px;text-transform:uppercase;cursor:pointer;display:flex;white-space:nowrap}.block .buttons{flex:1;display:flex;justify-content:flex-end;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.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}"]
3779
3793
  }),
3780
3794
  __metadata("design:paramtypes", [core.ChangeDetectorRef])
3781
3795
  ], ContentToggleComponent);