@tetacom/ng-components 1.0.53 → 1.0.56

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.
@@ -7982,14 +7982,14 @@ class TableUtil {
7982
7982
  return null;
7983
7983
  }
7984
7984
  static getData(data, state) {
7985
- let result = data;
7985
+ let result = [...data];
7986
7986
  result = TableUtil.filterData(result, state);
7987
7987
  result = TableUtil.sortData(result, state);
7988
7988
  return result;
7989
7989
  }
7990
7990
  static sortData(data, state) {
7991
7991
  var _a;
7992
- let result = data;
7992
+ let result = [...data];
7993
7993
  const func = (sortParam) => {
7994
7994
  result = TableUtil.sort(result, sortParam);
7995
7995
  };
@@ -8000,7 +8000,7 @@ class TableUtil {
8000
8000
  }
8001
8001
  static filterData(data, state) {
8002
8002
  var _a, _b, _c, _d;
8003
- let result = data;
8003
+ let result = [...data];
8004
8004
  if ((_a = state === null || state === void 0 ? void 0 : state.stringFilters) === null || _a === void 0 ? void 0 : _a.length) {
8005
8005
  const stringFilter = (filter) => {
8006
8006
  result = TableUtil.filterString(result, filter);
@@ -10240,10 +10240,10 @@ class TableComponent {
10240
10240
  }
10241
10241
  }
10242
10242
  TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: TableComponent, deps: [{ token: TableService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
10243
- TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: TableComponent, selector: "teta-table", inputs: { data: "data", columns: "columns", dict: "dict", filterOptions: "filterOptions", state: "state", cookieName: "cookieName", virtual: "virtual", detailComponent: "detailComponent", activeRow: "activeRow", selectedRows: "selectedRows", selectType: "selectType", aggregate: "aggregate", trackRow: "trackRow", editType: "editType", editEvent: "editEvent", rowEditable: "rowEditable", rowClass: "rowClass", scrollToIndex: "scrollToIndex", showHeadCellMenu: "showHeadCellMenu", contextMenu: "contextMenu", contextMenuOpen: "contextMenuOpen" }, outputs: { contextMenuOpenChange: "contextMenuOpenChange", stateChange: "stateChange", bodyLeft: "bodyLeft", activeRowChange: "activeRowChange", selectedRowsChange: "selectedRowsChange", cellClick: "cellClick", cellDoubleClick: "cellDoubleClick", cellFocus: "cellFocus", cellKeyDown: "cellKeyDown", rowLeft: "rowLeft", rowEditStart: "rowEditStart", rowEditEnd: "rowEditEnd", cellEditStart: "cellEditStart", cellEditEnd: "cellEditEnd", valueChange: "valueChange", tableService: "tableService" }, host: { listeners: { "document:click": "handleClickOutsideAnyRow($event)", "focusin": "focusIn($event)", "dblclick": "dblclick($event)", "keydown": "keydown($event)", "mousedown": "mousedown($event)" }, properties: { "class.table": "this.tableClass" } }, providers: [TableService], viewQueries: [{ propertyName: "menu", first: true, predicate: ["contextMenu"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"column column_auto\">\n <teta-table-head\n [selectType]=\"selectType\"\n [showHeadCellMenu]=\"showHeadCellMenu\"></teta-table-head>\n <div class=\"column column_auto position-relative\">\n <teta-table-body\n (contextmenu)=\"setContextMenuRow($event)\"\n [tetaContextMenu]=\"contextMenu\"\n [data]=\"contextMenuRow\"\n [open]=\"contextMenuOpen\"\n (openChange)=\"setContextMenuOpen($event)\"\n [aggregate]=\"aggregate\"\n [virtual]=\"virtual\"\n [activeRow]=\"activeRow\"\n [selectedRows]=\"selectedRowsList\"\n [additionalComponent]=\"detailComponent\"\n [selectType]=\"selectType\"\n [rowClass]=\"rowClass\"></teta-table-body>\n <div class=\"column column_auto\"\n style=\"position: absolute; top:0; bottom:0;left:0;right:0;\"\n *ngIf=\"!data?.length\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: ContextMenuDirective, selector: "[tetaContextMenu]", inputs: ["tetaContextMenu", "autoCloseIgnore"] }, { kind: "component", type: TableHeadComponent, selector: "teta-table-head", inputs: ["selectType", "showHeadCellMenu"] }, { kind: "component", type: TableBodyComponent, selector: "teta-table-body", inputs: ["virtual", "activeRow", "selectedRows", "additionalComponent", "aggregate", "selectType", "rowClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
10243
+ TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: TableComponent, selector: "teta-table", inputs: { data: "data", columns: "columns", dict: "dict", filterOptions: "filterOptions", state: "state", cookieName: "cookieName", virtual: "virtual", detailComponent: "detailComponent", activeRow: "activeRow", selectedRows: "selectedRows", selectType: "selectType", aggregate: "aggregate", trackRow: "trackRow", editType: "editType", editEvent: "editEvent", rowEditable: "rowEditable", rowClass: "rowClass", scrollToIndex: "scrollToIndex", showHeadCellMenu: "showHeadCellMenu", contextMenu: "contextMenu", contextMenuOpen: "contextMenuOpen" }, outputs: { contextMenuOpenChange: "contextMenuOpenChange", stateChange: "stateChange", bodyLeft: "bodyLeft", activeRowChange: "activeRowChange", selectedRowsChange: "selectedRowsChange", cellClick: "cellClick", cellDoubleClick: "cellDoubleClick", cellFocus: "cellFocus", cellKeyDown: "cellKeyDown", rowLeft: "rowLeft", rowEditStart: "rowEditStart", rowEditEnd: "rowEditEnd", cellEditStart: "cellEditStart", cellEditEnd: "cellEditEnd", valueChange: "valueChange", tableService: "tableService" }, host: { listeners: { "document:click": "handleClickOutsideAnyRow($event)", "focusin": "focusIn($event)", "dblclick": "dblclick($event)", "keydown": "keydown($event)", "mousedown": "mousedown($event)" }, properties: { "class.table": "this.tableClass" } }, providers: [TableService], viewQueries: [{ propertyName: "menu", first: true, predicate: ["contextMenu"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"column column_auto\">\n <teta-table-head\n [selectType]=\"selectType\"\n [showHeadCellMenu]=\"showHeadCellMenu\"></teta-table-head>\n <div class=\"column column_auto position-relative\">\n <teta-table-body\n (contextmenu)=\"setContextMenuRow($event)\"\n [tetaContextMenu]=\"contextMenu\"\n [appendToBody]=\"true\"\n [data]=\"contextMenuRow\"\n [open]=\"contextMenuOpen\"\n (openChange)=\"setContextMenuOpen($event)\"\n [aggregate]=\"aggregate\"\n [virtual]=\"virtual\"\n [activeRow]=\"activeRow\"\n [selectedRows]=\"selectedRowsList\"\n [additionalComponent]=\"detailComponent\"\n [selectType]=\"selectType\"\n [rowClass]=\"rowClass\"></teta-table-body>\n <div class=\"column column_auto\"\n style=\"position: absolute; top:0; bottom:0;left:0;right:0;\"\n *ngIf=\"!data?.length\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: ContextMenuDirective, selector: "[tetaContextMenu]", inputs: ["tetaContextMenu", "autoCloseIgnore"] }, { kind: "component", type: TableHeadComponent, selector: "teta-table-head", inputs: ["selectType", "showHeadCellMenu"] }, { kind: "component", type: TableBodyComponent, selector: "teta-table-body", inputs: ["virtual", "activeRow", "selectedRows", "additionalComponent", "aggregate", "selectType", "rowClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
10244
10244
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: TableComponent, decorators: [{
10245
10245
  type: Component,
10246
- args: [{ selector: 'teta-table', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableService], template: "<div class=\"column column_auto\">\n <teta-table-head\n [selectType]=\"selectType\"\n [showHeadCellMenu]=\"showHeadCellMenu\"></teta-table-head>\n <div class=\"column column_auto position-relative\">\n <teta-table-body\n (contextmenu)=\"setContextMenuRow($event)\"\n [tetaContextMenu]=\"contextMenu\"\n [data]=\"contextMenuRow\"\n [open]=\"contextMenuOpen\"\n (openChange)=\"setContextMenuOpen($event)\"\n [aggregate]=\"aggregate\"\n [virtual]=\"virtual\"\n [activeRow]=\"activeRow\"\n [selectedRows]=\"selectedRowsList\"\n [additionalComponent]=\"detailComponent\"\n [selectType]=\"selectType\"\n [rowClass]=\"rowClass\"></teta-table-body>\n <div class=\"column column_auto\"\n style=\"position: absolute; top:0; bottom:0;left:0;right:0;\"\n *ngIf=\"!data?.length\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n" }]
10246
+ args: [{ selector: 'teta-table', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableService], template: "<div class=\"column column_auto\">\n <teta-table-head\n [selectType]=\"selectType\"\n [showHeadCellMenu]=\"showHeadCellMenu\"></teta-table-head>\n <div class=\"column column_auto position-relative\">\n <teta-table-body\n (contextmenu)=\"setContextMenuRow($event)\"\n [tetaContextMenu]=\"contextMenu\"\n [appendToBody]=\"true\"\n [data]=\"contextMenuRow\"\n [open]=\"contextMenuOpen\"\n (openChange)=\"setContextMenuOpen($event)\"\n [aggregate]=\"aggregate\"\n [virtual]=\"virtual\"\n [activeRow]=\"activeRow\"\n [selectedRows]=\"selectedRowsList\"\n [additionalComponent]=\"detailComponent\"\n [selectType]=\"selectType\"\n [rowClass]=\"rowClass\"></teta-table-body>\n <div class=\"column column_auto\"\n style=\"position: absolute; top:0; bottom:0;left:0;right:0;\"\n *ngIf=\"!data?.length\">\n <ng-content></ng-content>\n </div>\n </div>\n</div>\n" }]
10247
10247
  }], ctorParameters: function () { return [{ type: TableService }, { type: i0.ElementRef }]; }, propDecorators: { data: [{
10248
10248
  type: Input
10249
10249
  }], columns: [{
@@ -11364,10 +11364,12 @@ class DragDropService {
11364
11364
  this.dragProcess = {
11365
11365
  selection: this.selection
11366
11366
  };
11367
+ this._document.body.style.cursor = 'copy';
11367
11368
  this._preview = this.createPreview();
11368
11369
  }
11369
11370
  stopProcess() {
11370
11371
  this.destroyPreview();
11372
+ this._document.body.style.cursor = 'default';
11371
11373
  this.dragProcess = null;
11372
11374
  this.startPosition = null;
11373
11375
  }
@@ -11414,7 +11416,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
11414
11416
  providedIn: 'root'
11415
11417
  }]
11416
11418
  }], ctorParameters: function () {
11417
- return [{ type: undefined, decorators: [{
11419
+ return [{ type: Document, decorators: [{
11418
11420
  type: Inject,
11419
11421
  args: [DOCUMENT]
11420
11422
  }] }, { type: i0.RendererFactory2 }];
@@ -11524,7 +11526,7 @@ class DragDirective {
11524
11526
  return ((_c = (_b = (_a = this._dragService) === null || _a === void 0 ? void 0 : _a.selection) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c.indexOf(this.instance)) >= 0;
11525
11527
  }
11526
11528
  get isDropTarget() {
11527
- return this.dropTarget === this.instance;
11529
+ return this.dropTarget === this.instance && this.allowDrop;
11528
11530
  }
11529
11531
  mousedown(event) {
11530
11532
  var _a, _b, _c;
@@ -11545,7 +11547,9 @@ class DragDirective {
11545
11547
  mouseenter(event) {
11546
11548
  if (this.allowDrop) {
11547
11549
  event.stopPropagation();
11548
- this._dragService.setDropTarget(this.instance);
11550
+ if (this.allowDropPredicate === undefined || this.allowDropPredicate(this._dragService.selection, this.data)) {
11551
+ this._dragService.setDropTarget(this.instance);
11552
+ }
11549
11553
  }
11550
11554
  }
11551
11555
  mouseleave(event) {
@@ -11579,7 +11583,7 @@ class DragDirective {
11579
11583
  }
11580
11584
  }
11581
11585
  DragDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DragDirective, deps: [{ token: DragContainerDirective, optional: true, skipSelf: true }, { token: DragDropService }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
11582
- DragDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: DragDirective, selector: "[tetaDrag]", inputs: { data: ["tetaDrag", "data"], allowDrag: "allowDrag", allowDrop: "allowDrop" }, outputs: { tetaDragEnter: "tetaDragEnter", tetaDrop: "tetaDrop" }, host: { listeners: { "mousedown": "mousedown($event)", "touchstart": "mousedown($event)", "mouseenter": "mouseenter($event)", "mouseleave": "mouseleave($event)" }, properties: { "style.userSelect": "\"none\"", "class.teta-drag-item": "\"true\"", "class.teta_draggable_item": "this.allowDrag", "class.teta_droppable_item": "this.allowDrop", "class.teta-drag-selection": "this.selection", "class.teta-drop-target": "this.isDropTarget" } }, exportAs: ["drag"], ngImport: i0 });
11586
+ DragDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: DragDirective, selector: "[tetaDrag]", inputs: { data: ["tetaDrag", "data"], allowDrag: "allowDrag", allowDrop: "allowDrop", allowDropPredicate: "allowDropPredicate" }, outputs: { tetaDragEnter: "tetaDragEnter", tetaDrop: "tetaDrop" }, host: { listeners: { "mousedown": "mousedown($event)", "touchstart": "mousedown($event)", "mouseenter": "mouseenter($event)", "mouseleave": "mouseleave($event)" }, properties: { "style.userSelect": "\"none\"", "class.teta-drag-item": "\"true\"", "class.teta_draggable_item": "this.allowDrag", "class.teta_droppable_item": "this.allowDrop", "class.teta-drag-selection": "this.selection", "class.teta-drop-target": "this.isDropTarget" } }, exportAs: ["drag"], ngImport: i0 });
11583
11587
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DragDirective, decorators: [{
11584
11588
  type: Directive,
11585
11589
  args: [{
@@ -11612,6 +11616,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
11612
11616
  args: ['class.teta_droppable_item']
11613
11617
  }, {
11614
11618
  type: Input
11619
+ }], allowDropPredicate: [{
11620
+ type: Input
11615
11621
  }], tetaDragEnter: [{
11616
11622
  type: Output
11617
11623
  }], tetaDrop: [{