@acorex/components 18.14.1-next.5 → 18.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/comment/lib/comment-container/comment-container.component.d.ts +1 -0
  2. package/common/lib/components/value-component.class.d.ts +1 -0
  3. package/common/lib/directives/auto-focus.directive.d.ts +1 -0
  4. package/common/lib/directives/ripple.directive.d.ts +1 -0
  5. package/data-table/lib/columns/data-table-column-resizable.directive.d.ts +1 -0
  6. package/data-table/lib/data-table/data-table.component.d.ts +61 -60
  7. package/data-table/lib/infinite-scroll-data-table/infinite-scroll-data-table.component.d.ts +7 -6
  8. package/drawer/lib/drawer/drawer-item/drawer.component.d.ts +2 -0
  9. package/esm2022/audio-wave/lib/audio-wave.component.mjs +79 -14
  10. package/esm2022/avatar/lib/avatar.component.mjs +2 -2
  11. package/esm2022/button/lib/button.component.mjs +2 -2
  12. package/esm2022/calendar/lib/calendar-range.component.mjs +2 -2
  13. package/esm2022/calendar/lib/calendar.component.mjs +3 -3
  14. package/esm2022/comment/lib/comment-container/comment-container.component.mjs +7 -3
  15. package/esm2022/common/lib/components/value-component.class.mjs +4 -2
  16. package/esm2022/common/lib/directives/auto-focus.directive.mjs +5 -3
  17. package/esm2022/common/lib/directives/inverted-color.directive.mjs +1 -1
  18. package/esm2022/common/lib/directives/ripple.directive.mjs +5 -3
  19. package/esm2022/conversation/lib/conversation-message/conversation-message.component.mjs +2 -2
  20. package/esm2022/conversation/lib/conversation-messages/conversation-message-voice/conversation-message-voice.component.mjs +2 -2
  21. package/esm2022/cron-job/index.mjs +1 -1
  22. package/esm2022/cron-job/lib/cron-job-container/cron-job-container.component.mjs +3 -3
  23. package/esm2022/cron-job/lib/day/day.component.mjs +3 -3
  24. package/esm2022/cron-job/lib/hours/hours.component.mjs +3 -3
  25. package/esm2022/cron-job/lib/minutes/minutes.component.mjs +3 -3
  26. package/esm2022/cron-job/lib/month/month.component.mjs +3 -3
  27. package/esm2022/cron-job/lib/seconds/seconds.component.mjs +3 -3
  28. package/esm2022/cron-job/lib/year/year.component.mjs +3 -3
  29. package/esm2022/data-table/lib/columns/data-table-column-resizable.directive.mjs +9 -7
  30. package/esm2022/data-table/lib/data-table/data-table.component.mjs +71 -67
  31. package/esm2022/data-table/lib/infinite-scroll-data-table/infinite-scroll-data-table.component.mjs +16 -11
  32. package/esm2022/drawer/lib/drawer/drawer-item/drawer.component.mjs +5 -2
  33. package/esm2022/list/lib/list.component.mjs +17 -5
  34. package/esm2022/loading/lib/loading-spinner.component.mjs +2 -2
  35. package/esm2022/loading-dialog/lib/loading-dialog.component.mjs +2 -2
  36. package/esm2022/menu/lib/context-menu.component.mjs +28 -21
  37. package/esm2022/password-box/lib/password-box.component.mjs +13 -5
  38. package/esm2022/password-box/lib/password-box.module.mjs +19 -3
  39. package/esm2022/password-box/lib/password-strength-validation/password-strength-validation.component.mjs +36 -14
  40. package/esm2022/popover/lib/popover.component.mjs +5 -3
  41. package/esm2022/popup/lib/popup.component.mjs +2 -2
  42. package/esm2022/uploader/lib/uploader-zone.directive.mjs +7 -5
  43. package/fesm2022/acorex-components-audio-wave.mjs +78 -13
  44. package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
  45. package/fesm2022/acorex-components-avatar.mjs +2 -2
  46. package/fesm2022/acorex-components-avatar.mjs.map +1 -1
  47. package/fesm2022/acorex-components-button.mjs +2 -2
  48. package/fesm2022/acorex-components-calendar.mjs +4 -4
  49. package/fesm2022/acorex-components-calendar.mjs.map +1 -1
  50. package/fesm2022/acorex-components-comment.mjs +7 -4
  51. package/fesm2022/acorex-components-comment.mjs.map +1 -1
  52. package/fesm2022/acorex-components-common.mjs +6 -3
  53. package/fesm2022/acorex-components-common.mjs.map +1 -1
  54. package/fesm2022/acorex-components-conversation.mjs +2 -2
  55. package/fesm2022/acorex-components-conversation.mjs.map +1 -1
  56. package/fesm2022/acorex-components-cron-job.mjs +14 -14
  57. package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
  58. package/fesm2022/acorex-components-data-table.mjs +89 -81
  59. package/fesm2022/acorex-components-data-table.mjs.map +1 -1
  60. package/fesm2022/acorex-components-drawer.mjs +4 -2
  61. package/fesm2022/acorex-components-drawer.mjs.map +1 -1
  62. package/fesm2022/acorex-components-list.mjs +16 -4
  63. package/fesm2022/acorex-components-list.mjs.map +1 -1
  64. package/fesm2022/acorex-components-loading-dialog.mjs +2 -2
  65. package/fesm2022/acorex-components-loading.mjs +2 -2
  66. package/fesm2022/acorex-components-loading.mjs.map +1 -1
  67. package/fesm2022/acorex-components-menu.mjs +24 -18
  68. package/fesm2022/acorex-components-menu.mjs.map +1 -1
  69. package/fesm2022/acorex-components-password-box.mjs +65 -19
  70. package/fesm2022/acorex-components-password-box.mjs.map +1 -1
  71. package/fesm2022/acorex-components-popover.mjs +4 -3
  72. package/fesm2022/acorex-components-popover.mjs.map +1 -1
  73. package/fesm2022/acorex-components-popup.mjs +2 -2
  74. package/fesm2022/acorex-components-uploader.mjs +7 -6
  75. package/fesm2022/acorex-components-uploader.mjs.map +1 -1
  76. package/menu/lib/context-menu.component.d.ts +2 -1
  77. package/package.json +1 -1
  78. package/password-box/lib/password-box.component.d.ts +9 -1
  79. package/password-box/lib/password-box.module.d.ts +3 -1
  80. package/password-box/lib/password-strength-validation/password-strength-validation.component.d.ts +23 -1
  81. package/popover/lib/popover.component.d.ts +1 -0
  82. package/uploader/lib/uploader-zone.directive.d.ts +1 -0
@@ -1,8 +1,10 @@
1
1
  import * as i5$1 from '@acorex/components/common';
2
2
  import { MXBaseComponent, convertArrayToDataSource, AXListDataSource, AXPagedComponent, AXCommonModule, AXRippleDirective } from '@acorex/components/common';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, signal, Injectable, Input, Output, Directive, HostListener, inject, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, ChangeDetectorRef, NgZone, computed, ContentChildren, NgModule } from '@angular/core';
4
+ import { EventEmitter, signal, Injectable, Input, Output, inject, Directive, HostListener, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, ChangeDetectorRef, NgZone, computed, ContentChildren, NgModule } from '@angular/core';
5
5
  import { isBrowser } from '@acorex/core/platform';
6
+ import * as i1$1 from '@angular/common';
7
+ import { DOCUMENT, CommonModule } from '@angular/common';
6
8
  import { Subject, debounceTime, buffer, filter } from 'rxjs';
7
9
  import { __decorate, __metadata } from 'tslib';
8
10
  import * as i2 from '@acorex/core/format';
@@ -17,8 +19,6 @@ import { AXButtonModule } from '@acorex/components/button';
17
19
  import * as i4 from '@acorex/components/dropdown';
18
20
  import { AXDropdownModule } from '@acorex/components/dropdown';
19
21
  import { AXUnsubscriber, AXHtmlUtil } from '@acorex/core/utils';
20
- import * as i1$1 from '@angular/common';
21
- import { CommonModule } from '@angular/common';
22
22
  import * as i6 from '@acorex/components/data-pager';
23
23
  import { AXDataPagerModule } from '@acorex/components/data-pager';
24
24
  import { AXResultModule } from '@acorex/components/result';
@@ -112,6 +112,7 @@ class AXDataTableColumnResizableDirective {
112
112
  this.renderer = renderer;
113
113
  this.ngZone = ngZone;
114
114
  this.cdr = cdr;
115
+ this.document = inject(DOCUMENT);
115
116
  this.resize$ = new Subject();
116
117
  this.onMouseMoveRawBound = this.onMouseMoveRaw.bind(this);
117
118
  this.onMouseUpBound = this.onMouseUp.bind(this);
@@ -123,8 +124,8 @@ class AXDataTableColumnResizableDirective {
123
124
  this.ngZone.runOutsideAngular(() => {
124
125
  this.startX = event.pageX;
125
126
  this.startWidth = this.el?.nativeElement?.parentElement.offsetWidth;
126
- document.addEventListener('mousemove', this.onMouseMoveRawBound);
127
- document.addEventListener('mouseup', this.onMouseUpBound);
127
+ this.document.addEventListener('mousemove', this.onMouseMoveRawBound);
128
+ this.document.addEventListener('mouseup', this.onMouseUpBound);
128
129
  });
129
130
  this.cdr.detach(); // Detach the change detector
130
131
  }
@@ -140,8 +141,8 @@ class AXDataTableColumnResizableDirective {
140
141
  }
141
142
  }
142
143
  onMouseUp() {
143
- document.removeEventListener('mousemove', this.onMouseMoveRawBound);
144
- document.removeEventListener('mouseup', this.onMouseUpBound);
144
+ this.document.removeEventListener('mousemove', this.onMouseMoveRawBound);
145
+ this.document.removeEventListener('mouseup', this.onMouseUpBound);
145
146
  this.cdr.reattach(); // Reattach the change detector
146
147
  }
147
148
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXDataTableColumnResizableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -911,6 +912,7 @@ class AXDataTableComponent extends AXBaseDataTable {
911
912
  super(...arguments);
912
913
  this._unsubscriber = inject(AXUnsubscriber);
913
914
  this._zone = inject(NgZone);
915
+ this.document = inject(DOCUMENT);
914
916
  /**
915
917
  * @ignore
916
918
  */
@@ -992,73 +994,73 @@ class AXDataTableComponent extends AXBaseDataTable {
992
994
  */
993
995
  this.fixedHeader = true;
994
996
  /**
995
- * Indicates if the table footer should be displayed.
996
- *
997
- * @defaultValue `false`
998
- */
997
+ * Indicates if the table footer should be displayed.
998
+ *
999
+ * @defaultValue `false`
1000
+ */
999
1001
  this.showFooter = false;
1000
1002
  /**
1001
- * Indicates if the table footer should be fixed.
1002
- *
1003
- * @defaultValue `true`
1004
- */
1003
+ * Indicates if the table footer should be fixed.
1004
+ *
1005
+ * @defaultValue `true`
1006
+ */
1005
1007
  this.fixedFooter = true;
1006
1008
  /**
1007
- * Specifies the height of each item in the table.
1008
- *
1009
- * @defaultValue `40`
1010
- */
1009
+ * Specifies the height of each item in the table.
1010
+ *
1011
+ * @defaultValue `40`
1012
+ */
1011
1013
  this.itemHeight = 40;
1012
1014
  /**
1013
- * Enables or disables row reordering.
1014
- *
1015
- * @defaultValue `false`
1016
- */
1015
+ * Enables or disables row reordering.
1016
+ *
1017
+ * @defaultValue `false`
1018
+ */
1017
1019
  this.allowReordering = false;
1018
1020
  /**
1019
- * Enables or disables paging.
1020
- *
1021
- * @defaultValue `true`
1022
- */
1021
+ * Enables or disables paging.
1022
+ *
1023
+ * @defaultValue `true`
1024
+ */
1023
1025
  this.paging = true;
1024
1026
  /**
1025
- * Specifies how data should be fetched.
1026
- *
1027
- * @defaultValue `'auto'`
1028
- */
1027
+ * Specifies how data should be fetched.
1028
+ *
1029
+ * @defaultValue `'auto'`
1030
+ */
1029
1031
  this.fetchDataMode = 'auto';
1030
1032
  /**
1031
- * Configuration for loading state.
1032
- *
1033
- * @defaultValue `{ enabled: true, animation: true }`
1034
- */
1033
+ * Configuration for loading state.
1034
+ *
1035
+ * @defaultValue `{ enabled: true, animation: true }`
1036
+ */
1035
1037
  this.loading = {
1036
1038
  enabled: true,
1037
1039
  animation: true,
1038
1040
  };
1039
1041
  /**
1040
- * Emits when the focused row changes.
1041
- *
1042
- * @event
1043
- */
1042
+ * Emits when the focused row changes.
1043
+ *
1044
+ * @event
1045
+ */
1044
1046
  this.focusedRowChange = new EventEmitter();
1045
1047
  /**
1046
- * Emits when a row is clicked.
1047
- *
1048
- * @event onRowClick
1049
- */
1048
+ * Emits when a row is clicked.
1049
+ *
1050
+ * @event onRowClick
1051
+ */
1050
1052
  this.onRowClick = new EventEmitter();
1051
1053
  /**
1052
- * Emits when a row is double-clicked.
1053
- *
1054
- * @event onRowDbClick
1055
- */
1054
+ * Emits when a row is double-clicked.
1055
+ *
1056
+ * @event onRowDbClick
1057
+ */
1056
1058
  this.onRowDbClick = new EventEmitter();
1057
1059
  /**
1058
- * Emits when the order of columns changes.
1059
- *
1060
- * @event onColumnsOrderChanged
1061
- */
1060
+ * Emits when the order of columns changes.
1061
+ *
1062
+ * @event onColumnsOrderChanged
1063
+ */
1062
1064
  this.onColumnsOrderChanged = new EventEmitter();
1063
1065
  /**
1064
1066
  * @ignore
@@ -1069,7 +1071,9 @@ class AXDataTableComponent extends AXBaseDataTable {
1069
1071
  */
1070
1072
  this.onResizeColumnMove = (event) => {
1071
1073
  const diffX = event.pageX - this.resizeColumnProp.startX;
1072
- const newWidth = this.rtl ? this.resizeColumnProp.startWidth - diffX : this.resizeColumnProp.startWidth + diffX;
1074
+ const newWidth = this.rtl
1075
+ ? this.resizeColumnProp.startWidth - diffX
1076
+ : this.resizeColumnProp.startWidth + diffX;
1073
1077
  this.resizeColumnProp.thElement.style.width = `${Math.max(100, newWidth)}px`;
1074
1078
  this.resizeColumnProp.thElement.setAttribute('new-width', `${newWidth}`);
1075
1079
  };
@@ -1077,24 +1081,24 @@ class AXDataTableComponent extends AXBaseDataTable {
1077
1081
  * @ignore
1078
1082
  */
1079
1083
  this.onResizeColumnEnd = () => {
1080
- document.removeEventListener('mousemove', this.onResizeColumnMove);
1081
- document.removeEventListener('mouseup', this.onResizeColumnEnd);
1084
+ this.document.removeEventListener('mousemove', this.onResizeColumnMove);
1085
+ this.document.removeEventListener('mouseup', this.onResizeColumnEnd);
1082
1086
  const newWidth = parseInt(this.resizeColumnProp.thElement.attributes.getNamedItem('new-width').value);
1083
1087
  this.columns.get(this.resizeColumnProp.columnIndex).width = `${Math.max(100, newWidth)}px`;
1084
1088
  this.resetResizingProcess();
1085
1089
  };
1086
1090
  }
1087
1091
  /**
1088
- * Gets the currently focused row.
1089
- */
1092
+ * Gets the currently focused row.
1093
+ */
1090
1094
  get focusedRow() {
1091
1095
  return this._focusedRow;
1092
1096
  }
1093
1097
  /**
1094
- * Sets the currently focused row and emits the change event.
1095
- *
1096
- * @param v - The row to be focused.
1097
- */
1098
+ * Sets the currently focused row and emits the change event.
1099
+ *
1100
+ * @param v - The row to be focused.
1101
+ */
1098
1102
  set focusedRow(v) {
1099
1103
  this._focusedRow = v;
1100
1104
  this.focusedRowChange.emit(v);
@@ -1208,13 +1212,13 @@ class AXDataTableComponent extends AXBaseDataTable {
1208
1212
  });
1209
1213
  }
1210
1214
  /**
1211
- * Handles the click event on a column header.
1212
- * Toggles the sorting direction or removes the sort if already sorted.
1213
- *
1214
- * @param e - The mouse event triggered by the click.
1215
- * @param column - The column that was clicked.
1216
- * @ignore
1217
- */
1215
+ * Handles the click event on a column header.
1216
+ * Toggles the sorting direction or removes the sort if already sorted.
1217
+ *
1218
+ * @param e - The mouse event triggered by the click.
1219
+ * @param column - The column that was clicked.
1220
+ * @ignore
1221
+ */
1218
1222
  handleColumnClick(e, column) {
1219
1223
  if (column instanceof AXDataTableTextColumnComponent) {
1220
1224
  const sort = this.dataSource.query.sort.find((c) => c.field == column.dataField);
@@ -1246,9 +1250,9 @@ class AXDataTableComponent extends AXBaseDataTable {
1246
1250
  return undefined;
1247
1251
  }
1248
1252
  /**
1249
- * Refreshes the data in the data source and resets the data pager to the first page.
1250
- * @ignore
1251
- */
1253
+ * Refreshes the data in the data source and resets the data pager to the first page.
1254
+ * @ignore
1255
+ */
1252
1256
  refresh() {
1253
1257
  this.dataSource.refresh();
1254
1258
  if (this.dataPager) {
@@ -1272,8 +1276,8 @@ class AXDataTableComponent extends AXBaseDataTable {
1272
1276
  this.resizeColumnProp.startWidth = parseInt(this.resizeColumnProp.thElement.style.width);
1273
1277
  this.resizeColumnProp.columnIndex = columnIndex;
1274
1278
  this._zone.runOutsideAngular(() => {
1275
- document.addEventListener('mousemove', this.onResizeColumnMove);
1276
- document.addEventListener('mouseup', this.onResizeColumnEnd);
1279
+ this.document.addEventListener('mousemove', this.onResizeColumnMove);
1280
+ this.document.addEventListener('mouseup', this.onResizeColumnEnd);
1277
1281
  });
1278
1282
  }
1279
1283
  /**
@@ -1398,6 +1402,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
1398
1402
  class AXInfiniteScrollDataTableComponent extends AXBaseDataTable {
1399
1403
  constructor() {
1400
1404
  super(...arguments);
1405
+ this.document = inject(DOCUMENT);
1401
1406
  this.ngZone = inject(NgZone);
1402
1407
  /**
1403
1408
  * Emits an event when the page changes.
@@ -1607,14 +1612,17 @@ class AXInfiniteScrollDataTableComponent extends AXBaseDataTable {
1607
1612
  * @ignore
1608
1613
  */
1609
1614
  updateHeight() {
1610
- this.height = `calc(100% - ${(this.headerContainer?.nativeElement.clientHeight ?? 0) + (this.footerContainer?.nativeElement.clientHeight ?? 0)}px)`;
1615
+ this.height = `calc(100% - ${(this.headerContainer?.nativeElement.clientHeight ?? 0) +
1616
+ (this.footerContainer?.nativeElement.clientHeight ?? 0)}px)`;
1611
1617
  }
1612
1618
  /**
1613
1619
  * @ignore
1614
1620
  */
1615
1621
  updateWidth() {
1616
1622
  if (this.columns && this.columns.length) {
1617
- const sumPx = sum(this.columns.toArray().map((c) => (typeof c.width == 'number' ? c.width : Number(c.width.replace('px', '')))));
1623
+ const sumPx = sum(this.columns
1624
+ .toArray()
1625
+ .map((c) => (typeof c.width == 'number' ? c.width : Number(c.width.replace('px', '')))));
1618
1626
  this.width = `${Math.max(sumPx, this.getHostElement().clientWidth - 5)}px`;
1619
1627
  }
1620
1628
  }
@@ -1640,7 +1648,7 @@ class AXInfiniteScrollDataTableComponent extends AXBaseDataTable {
1640
1648
  fixedColumnTable.querySelectorAll('tr').forEach((n) => n.remove());
1641
1649
  for (const row of originalRows) {
1642
1650
  const fixedCells = Array.from(row.querySelectorAll('[data-fixed="start"]'));
1643
- const fixedRow = document.createElement('tr');
1651
+ const fixedRow = this.document.createElement('tr');
1644
1652
  for (const cell of fixedCells) {
1645
1653
  const clonedCell = cell.cloneNode(true);
1646
1654
  fixedRow.appendChild(clonedCell);
@@ -1705,12 +1713,12 @@ class AXInfiniteScrollDataTableComponent extends AXBaseDataTable {
1705
1713
  });
1706
1714
  }
1707
1715
  /**
1708
- * Handles column header clicks to toggle sorting on the column.
1709
- *
1710
- * @param e - The mouse event triggered by the click.
1711
- * @param column - The column that was clicked.
1712
- * @ignore
1713
- */
1716
+ * Handles column header clicks to toggle sorting on the column.
1717
+ *
1718
+ * @param e - The mouse event triggered by the click.
1719
+ * @param column - The column that was clicked.
1720
+ * @ignore
1721
+ */
1714
1722
  handleColumnClick(e, column) {
1715
1723
  if (column instanceof AXDataTableTextColumnComponent) {
1716
1724
  const sort = this.dataSource.query.sort.find((c) => c.field == column.dataField);