@fundamental-ngx/platform 0.43.59 → 0.43.61

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.
Files changed (36) hide show
  1. package/esm2020/smart-filter-bar/components/smart-filter-bar-settings-dialog/smart-filter-bar-settings-dialog.component.mjs +1 -1
  2. package/esm2020/smart-filter-bar/smart-filter-bar.component.mjs +1 -1
  3. package/esm2020/table/components/table-p13-dialog/columns/columns.component.mjs +1 -1
  4. package/esm2020/table/components/table-toolbar/table-toolbar.component.mjs +5 -3
  5. package/esm2020/table/table.component.mjs +3 -3
  6. package/esm2020/table-helpers/directives/table-draggable.directive.mjs +45 -4
  7. package/esm2020/table-helpers/directives/table-virtual-scroll.directive.mjs +7 -3
  8. package/esm2020/upload-collection/upload-collection/upload-collection.component.mjs +1 -1
  9. package/esm2020/value-help-dialog/value-help-dialog/value-help-dialog.component.mjs +1 -1
  10. package/fesm2015/fundamental-ngx-platform-smart-filter-bar.mjs +2 -2
  11. package/fesm2015/fundamental-ngx-platform-smart-filter-bar.mjs.map +1 -1
  12. package/fesm2015/fundamental-ngx-platform-table-helpers.mjs +49 -5
  13. package/fesm2015/fundamental-ngx-platform-table-helpers.mjs.map +1 -1
  14. package/fesm2015/fundamental-ngx-platform-table.mjs +7 -5
  15. package/fesm2015/fundamental-ngx-platform-table.mjs.map +1 -1
  16. package/fesm2015/fundamental-ngx-platform-upload-collection.mjs +1 -1
  17. package/fesm2015/fundamental-ngx-platform-upload-collection.mjs.map +1 -1
  18. package/fesm2015/fundamental-ngx-platform-value-help-dialog.mjs +1 -1
  19. package/fesm2015/fundamental-ngx-platform-value-help-dialog.mjs.map +1 -1
  20. package/fesm2020/fundamental-ngx-platform-smart-filter-bar.mjs +2 -2
  21. package/fesm2020/fundamental-ngx-platform-smart-filter-bar.mjs.map +1 -1
  22. package/fesm2020/fundamental-ngx-platform-table-helpers.mjs +48 -5
  23. package/fesm2020/fundamental-ngx-platform-table-helpers.mjs.map +1 -1
  24. package/fesm2020/fundamental-ngx-platform-table.mjs +7 -5
  25. package/fesm2020/fundamental-ngx-platform-table.mjs.map +1 -1
  26. package/fesm2020/fundamental-ngx-platform-upload-collection.mjs +1 -1
  27. package/fesm2020/fundamental-ngx-platform-upload-collection.mjs.map +1 -1
  28. package/fesm2020/fundamental-ngx-platform-value-help-dialog.mjs +1 -1
  29. package/fesm2020/fundamental-ngx-platform-value-help-dialog.mjs.map +1 -1
  30. package/fundamental-ngx-platform-v0.43.61.tgz +0 -0
  31. package/package.json +4 -4
  32. package/schematics/ng-add/index.js +1 -1
  33. package/table/components/table-toolbar/table-toolbar.component.d.ts +6 -1
  34. package/table-helpers/directives/table-draggable.directive.d.ts +10 -2
  35. package/table-helpers/directives/table-virtual-scroll.directive.d.ts +2 -0
  36. package/fundamental-ngx-platform-v0.43.59.tgz +0 -0
@@ -12,7 +12,7 @@ import { get } from 'lodash-es';
12
12
  import equal from 'fast-deep-equal';
13
13
  import cloneDeep from 'lodash-es/cloneDeep';
14
14
  import set from 'lodash-es/set';
15
- import { UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes';
15
+ import { LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, SPACE, PAGE_DOWN, PAGE_UP, END, HOME } from '@angular/cdk/keycodes';
16
16
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
17
17
  import { DOCUMENT } from '@angular/common';
18
18
  import { TableCellDirective } from '@fundamental-ngx/core/table';
@@ -2061,6 +2061,10 @@ class TableDraggableDirective extends TableDraggable {
2061
2061
  get _rowsDraggable() {
2062
2062
  return this.isTreeTable && this.enableRowReordering;
2063
2063
  }
2064
+ /** @hidden */
2065
+ ngOnDestroy() {
2066
+ this._setDragInProgress(false);
2067
+ }
2064
2068
  /** Sets table reference. */
2065
2069
  setTable(table) {
2066
2070
  this._table = table;
@@ -2069,7 +2073,7 @@ class TableDraggableDirective extends TableDraggable {
2069
2073
  * Initiates drag&drop sequence.
2070
2074
  */
2071
2075
  dragDropStart() {
2072
- this.dragDropInProgress = true;
2076
+ this._setDragInProgress(true);
2073
2077
  }
2074
2078
  /** Method called when dnd performed with the keyboard. */
2075
2079
  dragRowFromKeyboard(dir, event, currentRowIndex, mode) {
@@ -2097,14 +2101,16 @@ class TableDraggableDirective extends TableDraggable {
2097
2101
  dropCancelled() {
2098
2102
  /** After timeout to make click event handled first */
2099
2103
  this._ngZone.runOutsideAngular(() => {
2100
- setTimeout(() => (this.dragDropInProgress = false));
2104
+ setTimeout(() => {
2105
+ this._setDragInProgress(false);
2106
+ });
2101
2107
  });
2102
2108
  }
2103
2109
  /** Method called when dragged item being dropped. */
2104
2110
  dragDropItemDrop(event) {
2105
2111
  /** After timeout to make click event handled first */
2106
2112
  this._ngZone.runOutsideAngular(() => {
2107
- setTimeout(() => (this.dragDropInProgress = false));
2113
+ setTimeout(() => this._setDragInProgress(false));
2108
2114
  });
2109
2115
  this._onZoneFree(() => {
2110
2116
  if (this.isTreeTable && event.draggedItemIndex !== event.replacedItemIndex) {
@@ -2143,6 +2149,11 @@ class TableDraggableDirective extends TableDraggable {
2143
2149
  this.rowsRearrange.emit(new TableRowsRearrangeEvent(row.value, dropRow.value, event.draggedItemIndex, event.replacedItemIndex, event.insertAt, event.mode, rows));
2144
2150
  }
2145
2151
  /** @hidden */
2152
+ _setDragInProgress(dragging) {
2153
+ this.dragDropInProgress = dragging;
2154
+ dragging ? this._blockScrolling() : this._enableScrolling();
2155
+ }
2156
+ /** @hidden */
2146
2157
  _isDroppedInsideItself(dropRow, dragRow) {
2147
2158
  const dropRowParents = getRowParents(dropRow);
2148
2159
  return !!dropRowParents.find((row) => row === dragRow);
@@ -2236,6 +2247,24 @@ class TableDraggableDirective extends TableDraggable {
2236
2247
  callback();
2237
2248
  });
2238
2249
  }
2250
+ /** @hidden */
2251
+ _blockScrolling() {
2252
+ this._table._focusableGrid._preventKeydown = true;
2253
+ this._table.tableContainer.nativeElement.addEventListener('DOMMouseScroll', preventDefault, false);
2254
+ this._table.tableContainer.nativeElement.addEventListener('wheel', preventDefault, { passive: false });
2255
+ this._table.tableContainer.nativeElement.addEventListener('mousewheel', preventDefault, { passive: false });
2256
+ this._table.tableContainer.nativeElement.addEventListener('touchmove', preventDefault, { passive: false });
2257
+ this._table.tableContainer.nativeElement.addEventListener('keydown', preventDefaultForScrollKeys, false);
2258
+ }
2259
+ /** @hidden */
2260
+ _enableScrolling() {
2261
+ this._table._focusableGrid._preventKeydown = false;
2262
+ this._table.tableContainer.nativeElement.removeEventListener('DOMMouseScroll', preventDefault, false);
2263
+ this._table.tableContainer.nativeElement.removeEventListener('wheel', preventDefault);
2264
+ this._table.tableContainer.nativeElement.removeEventListener('mousewheel', preventDefault);
2265
+ this._table.tableContainer.nativeElement.removeEventListener('touchmove', preventDefault);
2266
+ this._table.tableContainer.nativeElement.removeEventListener('keydown', preventDefaultForScrollKeys, false);
2267
+ }
2239
2268
  }
2240
2269
  TableDraggableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TableDraggableDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2241
2270
  TableDraggableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: TableDraggableDirective, isStandalone: true, selector: "fdp-table[isTreeTable], fdp-table[enableRowReordering]", inputs: { enableRowReordering: "enableRowReordering", isTreeTable: "isTreeTable", dropMode: "dropMode", dropPredicate: "dropPredicate", dragoverPredicate: "dragoverPredicate" }, outputs: { rowsRearrange: "rowsRearrange" }, host: { properties: { "class.fd-table--tree": "this.isTreeTable" } }, providers: [
@@ -2273,6 +2302,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2273
2302
  }], rowsRearrange: [{
2274
2303
  type: Output
2275
2304
  }] } });
2305
+ function preventDefault(event) {
2306
+ event.preventDefault();
2307
+ }
2308
+ function preventDefaultForScrollKeys(event) {
2309
+ if (!event.altKey &&
2310
+ KeyUtil.isKeyCode(event, [LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, SPACE, PAGE_DOWN, PAGE_UP, END, HOME])) {
2311
+ preventDefault(event);
2312
+ return false;
2313
+ }
2314
+ }
2276
2315
 
2277
2316
  const TABLE_SCROLLABLE = new InjectionToken('Table Scrollable');
2278
2317
  class TableScrollDispatcherService {
@@ -2459,6 +2498,10 @@ class TableVirtualScrollDirective extends TableVirtualScroll {
2459
2498
  /** @hidden */
2460
2499
  this._tableScrollDispatcher = inject(TableScrollDispatcherService);
2461
2500
  /** @hidden */
2501
+ this._dndTableDirective = inject(FDP_TABLE_DRAGGABLE_DIRECTIVE, {
2502
+ optional: true
2503
+ });
2504
+ /** @hidden */
2462
2505
  this._tableRowService = inject(TableRowService);
2463
2506
  /** @hidden */
2464
2507
  this._destroy$ = inject(DestroyedService);
@@ -2587,13 +2630,14 @@ class TableVirtualScrollDirective extends TableVirtualScroll {
2587
2630
  * start node index, which may come from the table state
2588
2631
  */
2589
2632
  calculateVirtualScrollRows() {
2633
+ var _a;
2590
2634
  if (this.scrollWholeRows) {
2591
2635
  if (!this._focusableGridSubscription) {
2592
2636
  this._focusableGridSubscription = this._table._focusableGrid.itemFocused.subscribe((event) => {
2593
2637
  this._focusedCell = event;
2594
2638
  });
2595
2639
  }
2596
- if (!this.virtualScroll || !this.bodyHeight) {
2640
+ if (!this.virtualScroll || !this.bodyHeight || ((_a = this._dndTableDirective) === null || _a === void 0 ? void 0 : _a.dragDropInProgress)) {
2597
2641
  return;
2598
2642
  }
2599
2643
  let startNodeIndex = 0;