@tetacom/ng-components 1.0.5 → 1.0.9

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.
@@ -1151,12 +1151,12 @@ class DropdownBase {
1151
1151
  }
1152
1152
  }
1153
1153
  closeDropdown() {
1154
- if (this._body && this.container.contains(this._body)) {
1154
+ if (this.open && this._body && this.container.contains(this._body)) {
1155
1155
  this._renderer.removeChild(this.container, this._body);
1156
+ this._open = false;
1157
+ this._body = null;
1158
+ this.openChange.emit(this.open);
1156
1159
  }
1157
- this._open = false;
1158
- this._body = null;
1159
- this.openChange.emit(this.open);
1160
1160
  }
1161
1161
  openDropdown() {
1162
1162
  if (this._open || !this._content || this.disabled) {
@@ -2620,7 +2620,7 @@ class OnlyNumberDirective {
2620
2620
  if (this.tetaOnlyNumber === false) {
2621
2621
  return;
2622
2622
  }
2623
- value = value.replace(',', '.');
2623
+ value = value.replace(',', '.').trim();
2624
2624
  let regex = this._integerUnsigned;
2625
2625
  if (!this.allowDecimals && !this.allowSign) {
2626
2626
  regex = this._integerUnsigned;
@@ -2672,7 +2672,8 @@ class OnlyNumberDirective {
2672
2672
  if (value === '-0.0') {
2673
2673
  value = '0.0';
2674
2674
  }
2675
- const valid = new RegExp(regex).test(value);
2675
+ const valid = new RegExp(regex).test(value.toString());
2676
+ console.log(value, valid);
2676
2677
  this._control.control.setValue(valid ? value : this._previousValue ?? 0);
2677
2678
  }
2678
2679
  }
@@ -4122,9 +4123,8 @@ const getFilterComponent = (item) => filterComponentsMap.has(item.filterType)
4122
4123
  : StringFilterComponent;
4123
4124
 
4124
4125
  class FilterHostComponent {
4125
- constructor(viewContainerRef, componentFactoryResolver) {
4126
+ constructor(viewContainerRef) {
4126
4127
  this.viewContainerRef = viewContainerRef;
4127
- this.componentFactoryResolver = componentFactoryResolver;
4128
4128
  this.filterChanged = new EventEmitter();
4129
4129
  this._alive = true;
4130
4130
  }
@@ -4153,9 +4153,8 @@ class FilterHostComponent {
4153
4153
  if (!FilterComponentBase.isPrototypeOf(this._column.filterComponent)) {
4154
4154
  this._column.filterComponent = getFilterComponent(this._column);
4155
4155
  }
4156
- const compFactory = this.componentFactoryResolver.resolveComponentFactory(this._column.filterComponent);
4157
4156
  this._componentRef =
4158
- this.viewContainerRef.createComponent(compFactory);
4157
+ this.viewContainerRef.createComponent(this._column.filterComponent);
4159
4158
  this._componentRef.instance.column = this._column;
4160
4159
  this._componentRef.instance.state = this._state;
4161
4160
  this._componentRef.instance.filterOptions = this._filterOptions;
@@ -4171,7 +4170,7 @@ class FilterHostComponent {
4171
4170
  this._alive = false;
4172
4171
  }
4173
4172
  }
4174
- FilterHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FilterHostComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
4173
+ FilterHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FilterHostComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
4175
4174
  FilterHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: FilterHostComponent, selector: "teta-filter-host", inputs: { column: "column", state: "state", filterOptions: "filterOptions" }, outputs: { filterChanged: "filterChanged" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
4176
4175
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: FilterHostComponent, decorators: [{
4177
4176
  type: Component,
@@ -4181,7 +4180,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
4181
4180
  styles: [],
4182
4181
  changeDetection: ChangeDetectionStrategy.OnPush,
4183
4182
  }]
4184
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { column: [{
4183
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { column: [{
4185
4184
  type: Input
4186
4185
  }], state: [{
4187
4186
  type: Input
@@ -7608,9 +7607,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
7608
7607
  }] } });
7609
7608
 
7610
7609
  class HeadCellHostComponent {
7611
- constructor(viewContainerRef, componentFactoryResolver) {
7610
+ constructor(viewContainerRef) {
7612
7611
  this.viewContainerRef = viewContainerRef;
7613
- this.componentFactoryResolver = componentFactoryResolver;
7614
7612
  }
7615
7613
  set column(column) {
7616
7614
  this._column = column;
@@ -7625,19 +7623,18 @@ class HeadCellHostComponent {
7625
7623
  if (!HeadCellComponentBase.isPrototypeOf(this.column.headCellComponent)) {
7626
7624
  this.column.headCellComponent = DefaultHeadCellComponent;
7627
7625
  }
7628
- const compFactory = this.componentFactoryResolver.resolveComponentFactory(this.column.headCellComponent);
7629
7626
  this.componentRef =
7630
- this.viewContainerRef.createComponent(compFactory);
7627
+ this.viewContainerRef.createComponent(this.column.headCellComponent);
7631
7628
  this.componentRef.instance.column = this.column;
7632
7629
  this.init = true;
7633
7630
  }
7634
7631
  }
7635
- HeadCellHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HeadCellHostComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
7632
+ HeadCellHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HeadCellHostComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
7636
7633
  HeadCellHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: HeadCellHostComponent, selector: "teta-head-cell-host", inputs: { column: "column" }, ngImport: i0, template: '', isInline: true, styles: [":host{display:contents}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
7637
7634
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: HeadCellHostComponent, decorators: [{
7638
7635
  type: Component,
7639
7636
  args: [{ selector: 'teta-head-cell-host', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}\n"] }]
7640
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { column: [{
7637
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { column: [{
7641
7638
  type: Input
7642
7639
  }] } });
7643
7640
 
@@ -8678,7 +8675,7 @@ class DateCellComponent extends CellComponentBase {
8678
8675
  super.ngOnInit();
8679
8676
  }
8680
8677
  setValue(value) {
8681
- this.row.data[this.column.name] = value;
8678
+ this.row.data[this.column.name] = value ? new Date(value) : value;
8682
8679
  this.valueChanged();
8683
8680
  }
8684
8681
  startEdit(initiator, type) {
@@ -8694,10 +8691,10 @@ class DateCellComponent extends CellComponentBase {
8694
8691
  }
8695
8692
  }
8696
8693
  DateCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DateCellComponent, deps: [{ token: TableService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
8697
- DateCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: DateCellComponent, selector: "teta-date-cell", inputs: { column: "column", row: "row" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<span [style.display]=\"edit ? 'none' : 'block'\" class=\"cell-text\">\n {{row.data[column.name] | date : 'dd.MM.yyyy'}}\n</span>\n<teta-date-picker class=\"datepicker-table\" #input\n *ngIf=\"edit\"\n [appendToBody]=\"false\"\n [showTime]=\"false\"\n [ngModel]=\"row.data[column.name]\"\n (ngModelChange)=\"setValue($event)\"\n></teta-date-picker>\n", styles: [""], components: [{ type: DatePickerComponent, selector: "teta-date-picker", inputs: ["disabled", "invalid", "firstDayOfWeek", "disabledDates", "disabledPeriods", "disabledDays", "minDate", "maxDate", "minYearDate", "maxYearDate", "appendToBody", "showTime", "format"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "date": i2.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
8694
+ DateCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: DateCellComponent, selector: "teta-date-cell", inputs: { column: "column", row: "row" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<span [style.display]=\"edit ? 'none' : 'block'\" class=\"cell-text\">\n {{row.data[column.name] | date : 'dd.MM.yyyy'}}\n</span>\n<teta-date-picker class=\"datepicker-table\"\n #input\n *ngIf=\"edit\"\n [appendToBody]=\"false\"\n [showTime]=\"false\"\n [ngModel]=\"row.data[column.name]\"\n (ngModelChange)=\"setValue($event)\"\n></teta-date-picker>\n", styles: [""], components: [{ type: DatePickerComponent, selector: "teta-date-picker", inputs: ["disabled", "invalid", "firstDayOfWeek", "disabledDates", "disabledPeriods", "disabledDays", "minDate", "maxDate", "minYearDate", "maxYearDate", "appendToBody", "showTime", "format"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "date": i2.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
8698
8695
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DateCellComponent, decorators: [{
8699
8696
  type: Component,
8700
- args: [{ selector: 'teta-date-cell', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span [style.display]=\"edit ? 'none' : 'block'\" class=\"cell-text\">\n {{row.data[column.name] | date : 'dd.MM.yyyy'}}\n</span>\n<teta-date-picker class=\"datepicker-table\" #input\n *ngIf=\"edit\"\n [appendToBody]=\"false\"\n [showTime]=\"false\"\n [ngModel]=\"row.data[column.name]\"\n (ngModelChange)=\"setValue($event)\"\n></teta-date-picker>\n", styles: [""] }]
8697
+ args: [{ selector: 'teta-date-cell', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span [style.display]=\"edit ? 'none' : 'block'\" class=\"cell-text\">\n {{row.data[column.name] | date : 'dd.MM.yyyy'}}\n</span>\n<teta-date-picker class=\"datepicker-table\"\n #input\n *ngIf=\"edit\"\n [appendToBody]=\"false\"\n [showTime]=\"false\"\n [ngModel]=\"row.data[column.name]\"\n (ngModelChange)=\"setValue($event)\"\n></teta-date-picker>\n", styles: [""] }]
8701
8698
  }], ctorParameters: function () { return [{ type: TableService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { column: [{
8702
8699
  type: Input
8703
8700
  }], row: [{
@@ -8853,17 +8850,15 @@ const getCellComponent = (column) => cellComponentsMap.has(column.filterType)
8853
8850
  : StringCellComponent;
8854
8851
 
8855
8852
  class CellHostComponent {
8856
- constructor(viewContainerRef, componentFactoryResolver) {
8853
+ constructor(viewContainerRef) {
8857
8854
  this.viewContainerRef = viewContainerRef;
8858
- this.componentFactoryResolver = componentFactoryResolver;
8859
8855
  this._init = false;
8860
8856
  }
8861
8857
  ngOnInit() {
8862
8858
  if (!CellComponentBase.isPrototypeOf(this.column.cellComponent)) {
8863
8859
  this.column.cellComponent = getCellComponent(this.column);
8864
8860
  }
8865
- const compFactory = this.componentFactoryResolver.resolveComponentFactory(this.column.cellComponent);
8866
- this._componentRef = this.viewContainerRef.createComponent(compFactory);
8861
+ this._componentRef = this.viewContainerRef.createComponent(this.column.cellComponent);
8867
8862
  this._componentRef.instance.column = this.column;
8868
8863
  this._componentRef.instance.row = this.row;
8869
8864
  this._componentRef.instance.filterOptions = this.filterOptions;
@@ -8885,12 +8880,12 @@ class CellHostComponent {
8885
8880
  }
8886
8881
  }
8887
8882
  }
8888
- CellHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: CellHostComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
8883
+ CellHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: CellHostComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
8889
8884
  CellHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.1", type: CellHostComponent, selector: "teta-cell-host", inputs: { column: "column", row: "row", filterOptions: "filterOptions", dict: "dict" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
8890
8885
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: CellHostComponent, decorators: [{
8891
8886
  type: Component,
8892
8887
  args: [{ selector: 'teta-cell-host', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [""] }]
8893
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { column: [{
8888
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { column: [{
8894
8889
  type: Input
8895
8890
  }], row: [{
8896
8891
  type: Input
@@ -9226,7 +9221,7 @@ class TableComponent {
9226
9221
  this.startEditRowOrCell(coordinates);
9227
9222
  }
9228
9223
  }
9229
- if (!this.isRow(event.target)) {
9224
+ if (!this.eventIsOnRow(event)) {
9230
9225
  this._svc.startEditRow(null);
9231
9226
  }
9232
9227
  }
@@ -9364,27 +9359,19 @@ class TableComponent {
9364
9359
  this._svc.startEditCell(coordinates);
9365
9360
  }
9366
9361
  }
9367
- getCell(element) {
9368
- if (!element.parentElement) {
9369
- return null;
9370
- }
9371
- if (element.tagName.toLowerCase() === 'teta-cell') {
9372
- return element;
9373
- }
9374
- return this.getCell(element.parentElement);
9362
+ getEventCell(event) {
9363
+ return event.composedPath().find((target) => {
9364
+ return target.tagName?.toLowerCase() === 'teta-cell';
9365
+ });
9375
9366
  }
9376
- isRow(element) {
9377
- if (!element.parentElement) {
9378
- return false;
9379
- }
9380
- if (this._elementRef.nativeElement.contains(element) &&
9381
- element.getAttribute('data-row')) {
9382
- return true;
9383
- }
9384
- return this.isRow(element.parentElement);
9367
+ eventIsOnRow(event) {
9368
+ const row = event.composedPath().find((target) => {
9369
+ return target?.getAttribute && target?.getAttribute('data-row');
9370
+ });
9371
+ return row && this._elementRef.nativeElement.contains(row);
9385
9372
  }
9386
9373
  getCoordinates(event) {
9387
- const cell = this.getCell(event.target);
9374
+ const cell = this.getEventCell(event);
9388
9375
  if (cell) {
9389
9376
  const rowIndex = cell.getAttribute('data-row');
9390
9377
  const columnName = cell.getAttribute('data-column');
@@ -10717,7 +10704,7 @@ class TetaChart {
10717
10704
  }
10718
10705
  drawAnnotations() {
10719
10706
  this._chart.selectAll('.annotations').remove();
10720
- const annotations = this._options.annotations.map((annotation) => {
10707
+ const annotations = this._options.annotations?.map((annotation) => {
10721
10708
  const x = this._xScales.get(annotation.xAxisIndex);
10722
10709
  const y = this._yScales.get(annotation.yAxisIndex);
10723
10710
  return {
@@ -10731,12 +10718,15 @@ class TetaChart {
10731
10718
  className: annotation.className,
10732
10719
  };
10733
10720
  });
10734
- const makeAnnotations = d3annotation.annotation().annotations(annotations);
10721
+ const makeAnnotations = d3annotation
10722
+ .annotation()
10723
+ .annotations(annotations ?? []);
10735
10724
  this._chart
10736
10725
  .append('g')
10737
10726
  .attr('class', 'annotations')
10738
10727
  .attr('clip-path', `url(#draw-window-${this.uniqId})`)
10739
- .call(makeAnnotations);
10728
+ .call(makeAnnotations)
10729
+ .lower();
10740
10730
  }
10741
10731
  drawPlotLines() {
10742
10732
  this._chart.selectAll('.plotlines').remove();
@@ -12502,6 +12492,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
12502
12492
  }]
12503
12493
  }] });
12504
12494
 
12495
+ // import {DragSortItemDirective} from './drag-sort-item.directive';
12496
+ class DragSortContainerDirective {
12497
+ constructor() {
12498
+ this.dragSorted = new EventEmitter();
12499
+ }
12500
+ drop(event) {
12501
+ event.stopPropagation();
12502
+ event.preventDefault();
12503
+ }
12504
+ setDragItem(item) {
12505
+ this._dragItem = item;
12506
+ }
12507
+ getDragItem() {
12508
+ return this._dragItem;
12509
+ }
12510
+ getList() {
12511
+ return this.dragSortList;
12512
+ }
12513
+ setList(list) {
12514
+ this.dragSortList = list;
12515
+ }
12516
+ updateSortOrder(source, target, insertBefore) {
12517
+ if (source === target) {
12518
+ return;
12519
+ }
12520
+ const list = this.getList();
12521
+ const sourceIndex = list.indexOf(source);
12522
+ const targetIndex = list.indexOf(target);
12523
+ if ((insertBefore && sourceIndex + 1 === targetIndex) ||
12524
+ (!insertBefore && sourceIndex === targetIndex + 1)) {
12525
+ return;
12526
+ }
12527
+ const newIndex = list.indexOf(target) + (insertBefore ? 0 : 1);
12528
+ this.dragSorted.emit({
12529
+ list,
12530
+ source,
12531
+ target,
12532
+ newIndex,
12533
+ previousIndex: sourceIndex,
12534
+ });
12535
+ }
12536
+ }
12537
+ DragSortContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DragSortContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
12538
+ DragSortContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.1", type: DragSortContainerDirective, selector: "[tetaDragSortContainer]", inputs: { dragSortList: "dragSortList" }, outputs: { dragSorted: "dragSorted" }, host: { listeners: { "drop": "drop($event)" } }, ngImport: i0 });
12539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DragSortContainerDirective, decorators: [{
12540
+ type: Directive,
12541
+ args: [{
12542
+ selector: '[tetaDragSortContainer]',
12543
+ }]
12544
+ }], ctorParameters: function () { return []; }, propDecorators: { dragSortList: [{
12545
+ type: Input
12546
+ }], dragSorted: [{
12547
+ type: Output
12548
+ }], drop: [{
12549
+ type: HostListener,
12550
+ args: ['drop', ['$event']]
12551
+ }] } });
12552
+
12505
12553
  class DragSortItemDirective {
12506
12554
  constructor(_container, _elementRef, _renderer) {
12507
12555
  this._container = _container;
@@ -12614,66 +12662,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImpor
12614
12662
  args: ['drop', ['$event']]
12615
12663
  }] } });
12616
12664
 
12617
- class DragSortContainerDirective {
12618
- constructor() {
12619
- this.dragSorted = new EventEmitter();
12620
- }
12621
- drop(event) {
12622
- event.stopPropagation();
12623
- event.preventDefault();
12624
- }
12625
- setDragItem(item) {
12626
- this._dragItem = item;
12627
- }
12628
- getDragItem() {
12629
- return this._dragItem;
12630
- }
12631
- getList() {
12632
- return this.dragSortList;
12633
- }
12634
- setList(list) {
12635
- this.dragSortList = list;
12636
- }
12637
- updateSortOrder(source, target, insertBefore) {
12638
- if (source === target) {
12639
- return;
12640
- }
12641
- const list = this.getList();
12642
- const sourceIndex = list.indexOf(source);
12643
- const targetIndex = list.indexOf(target);
12644
- if ((insertBefore && sourceIndex + 1 === targetIndex) ||
12645
- (!insertBefore && sourceIndex === targetIndex + 1)) {
12646
- return;
12647
- }
12648
- const newIndex = list.indexOf(target) + (insertBefore ? 0 : 1);
12649
- this.dragSorted.emit({
12650
- list,
12651
- source,
12652
- target,
12653
- newIndex,
12654
- previousIndex: sourceIndex,
12655
- });
12656
- }
12657
- }
12658
- DragSortContainerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DragSortContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
12659
- DragSortContainerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.1", type: DragSortContainerDirective, selector: "[tetaDragSortContainer]", inputs: { dragSortList: "dragSortList" }, outputs: { dragSorted: "dragSorted" }, host: { listeners: { "drop": "drop($event)" } }, queries: [{ propertyName: "items", predicate: DragSortItemDirective, descendants: true }], ngImport: i0 });
12660
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DragSortContainerDirective, decorators: [{
12661
- type: Directive,
12662
- args: [{
12663
- selector: '[tetaDragSortContainer]',
12664
- }]
12665
- }], ctorParameters: function () { return []; }, propDecorators: { dragSortList: [{
12666
- type: Input
12667
- }], dragSorted: [{
12668
- type: Output
12669
- }], items: [{
12670
- type: ContentChildren,
12671
- args: [DragSortItemDirective, { descendants: true }]
12672
- }], drop: [{
12673
- type: HostListener,
12674
- args: ['drop', ['$event']]
12675
- }] } });
12676
-
12677
12665
  class DragSortModule {
12678
12666
  }
12679
12667
  DragSortModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.1", ngImport: i0, type: DragSortModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });