@acorex/components 18.15.3 → 18.16.0-next.1

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 (85) hide show
  1. package/audio-wave/lib/audio-wave.component.d.ts +1 -0
  2. package/comment/lib/comment-container/comment-container.component.d.ts +1 -0
  3. package/common/lib/components/value-component.class.d.ts +1 -0
  4. package/common/lib/directives/auto-focus.directive.d.ts +1 -0
  5. package/common/lib/directives/inverted-color.directive.d.ts +1 -0
  6. package/common/lib/directives/ripple.directive.d.ts +1 -0
  7. package/conversation/lib/conversation-messages/conversation-message-voice/conversation-message-voice.component.d.ts +1 -0
  8. package/data-table/lib/columns/data-table-column-resizable.directive.d.ts +1 -0
  9. package/data-table/lib/data-table/data-table.component.d.ts +1 -0
  10. package/data-table/lib/infinite-scroll-data-table/infinite-scroll-data-table.component.d.ts +1 -0
  11. package/drawer/lib/drawer/drawer-item/drawer.component.d.ts +1 -0
  12. package/esm2022/audio-wave/lib/audio-wave.component.mjs +18 -14
  13. package/esm2022/button/lib/button-item-list.component.mjs +2 -2
  14. package/esm2022/calendar/lib/calendar.component.mjs +17 -14
  15. package/esm2022/comment/lib/comment-container/comment-container.component.mjs +18 -15
  16. package/esm2022/common/lib/components/value-component.class.mjs +5 -4
  17. package/esm2022/common/lib/directives/auto-focus.directive.mjs +8 -5
  18. package/esm2022/common/lib/directives/inverted-color.directive.mjs +23 -19
  19. package/esm2022/common/lib/directives/ripple.directive.mjs +18 -15
  20. package/esm2022/conversation/lib/conversation-messages/conversation-message-voice/conversation-message-voice.component.mjs +13 -9
  21. package/esm2022/data-pager/lib/data-pager-pagesize-dropdown.component.mjs +19 -5
  22. package/esm2022/data-pager/lib/data-pager.component.mjs +3 -3
  23. package/esm2022/data-table/lib/columns/data-table-column-resizable.directive.mjs +13 -13
  24. package/esm2022/data-table/lib/data-table/data-table.component.mjs +14 -9
  25. package/esm2022/data-table/lib/infinite-scroll-data-table/infinite-scroll-data-table.component.mjs +13 -10
  26. package/esm2022/drawer/lib/drawer/drawer-item/drawer.component.mjs +5 -4
  27. package/esm2022/list/lib/list.component.mjs +14 -9
  28. package/esm2022/menu/lib/context-menu.component.mjs +40 -32
  29. package/esm2022/picker/lib/picker.component.mjs +11 -4
  30. package/esm2022/popover/lib/popover.component.mjs +7 -6
  31. package/esm2022/range-slider/lib/range-slider.component.mjs +15 -9
  32. package/esm2022/rate-picker/lib/rate-picker.component.mjs +8 -2
  33. package/esm2022/tree-view/acorex-components-tree-view.mjs +5 -0
  34. package/esm2022/tree-view/index.mjs +4 -0
  35. package/esm2022/tree-view/lib/tree-view-item.component.mjs +86 -0
  36. package/esm2022/tree-view/lib/tree-view.class.mjs +4 -0
  37. package/esm2022/tree-view/lib/tree-view.component.mjs +299 -0
  38. package/esm2022/tree-view/lib/tree-view.component.module.mjs +50 -0
  39. package/esm2022/uploader/lib/uploader-zone.directive.mjs +21 -16
  40. package/fesm2022/acorex-components-audio-wave.mjs +18 -15
  41. package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
  42. package/fesm2022/acorex-components-button.mjs +2 -2
  43. package/fesm2022/acorex-components-button.mjs.map +1 -1
  44. package/fesm2022/acorex-components-calendar.mjs +16 -14
  45. package/fesm2022/acorex-components-calendar.mjs.map +1 -1
  46. package/fesm2022/acorex-components-comment.mjs +17 -14
  47. package/fesm2022/acorex-components-comment.mjs.map +1 -1
  48. package/fesm2022/acorex-components-common.mjs +44 -34
  49. package/fesm2022/acorex-components-common.mjs.map +1 -1
  50. package/fesm2022/acorex-components-conversation.mjs +12 -9
  51. package/fesm2022/acorex-components-conversation.mjs.map +1 -1
  52. package/fesm2022/acorex-components-data-pager.mjs +20 -6
  53. package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
  54. package/fesm2022/acorex-components-data-table.mjs +33 -25
  55. package/fesm2022/acorex-components-data-table.mjs.map +1 -1
  56. package/fesm2022/acorex-components-drawer.mjs +4 -3
  57. package/fesm2022/acorex-components-drawer.mjs.map +1 -1
  58. package/fesm2022/acorex-components-list.mjs +14 -10
  59. package/fesm2022/acorex-components-list.mjs.map +1 -1
  60. package/fesm2022/acorex-components-menu.mjs +39 -31
  61. package/fesm2022/acorex-components-menu.mjs.map +1 -1
  62. package/fesm2022/acorex-components-picker.mjs +10 -4
  63. package/fesm2022/acorex-components-picker.mjs.map +1 -1
  64. package/fesm2022/acorex-components-popover.mjs +6 -5
  65. package/fesm2022/acorex-components-popover.mjs.map +1 -1
  66. package/fesm2022/acorex-components-range-slider.mjs +14 -8
  67. package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
  68. package/fesm2022/acorex-components-rate-picker.mjs +7 -1
  69. package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
  70. package/fesm2022/acorex-components-tree-view.mjs +433 -0
  71. package/fesm2022/acorex-components-tree-view.mjs.map +1 -0
  72. package/fesm2022/acorex-components-uploader.mjs +20 -15
  73. package/fesm2022/acorex-components-uploader.mjs.map +1 -1
  74. package/menu/lib/context-menu.component.d.ts +1 -0
  75. package/package.json +7 -1
  76. package/picker/lib/picker.component.d.ts +1 -0
  77. package/popover/lib/popover.component.d.ts +1 -0
  78. package/rate-picker/lib/rate-picker.component.d.ts +1 -0
  79. package/tree-view/README.md +3 -0
  80. package/tree-view/index.d.ts +3 -0
  81. package/tree-view/lib/tree-view-item.component.d.ts +23 -0
  82. package/tree-view/lib/tree-view.class.d.ts +20 -0
  83. package/tree-view/lib/tree-view.component.d.ts +80 -0
  84. package/tree-view/lib/tree-view.component.module.d.ts +16 -0
  85. package/uploader/lib/uploader-zone.directive.d.ts +1 -0
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { model, output, Component, inject, ElementRef, signal, afterNextRender, Injectable, Directive, Host, Self, Optional, Input, Inject, NgModule, ChangeDetectorRef, ViewContainerRef, EventEmitter, InjectionToken, Output, input, effect } from '@angular/core';
2
+ import { model, output, Component, inject, ElementRef, signal, afterNextRender, Injectable, PLATFORM_ID, Directive, Host, Self, Optional, Input, Inject, NgModule, ChangeDetectorRef, ViewContainerRef, EventEmitter, InjectionToken, Output, input, effect } from '@angular/core';
3
3
  import { AXHtmlUtil } from '@acorex/core/utils';
4
4
  import { flatten, clone, filter, isEqual } from 'lodash-es';
5
5
  import { DataSource } from '@angular/cdk/collections';
6
6
  import { Subscription, BehaviorSubject, debounceTime, distinctUntilChanged, Subject, fromEvent, noop, skip } from 'rxjs';
7
- import { DOCUMENT } from '@angular/common';
7
+ import { DOCUMENT, isPlatformBrowser } from '@angular/common';
8
8
  import * as i1 from '@angular/platform-browser';
9
9
  import { Observable } from 'rxjs/internal/Observable';
10
10
  import { map, pairwise, filter as filter$1, startWith, exhaustMap } from 'rxjs/operators';
@@ -669,6 +669,7 @@ class AXAutoFocusDirective {
669
669
  this.autoFocus = true;
670
670
  this.time = 50;
671
671
  this.document = inject(DOCUMENT);
672
+ this.platformID = inject(PLATFORM_ID);
672
673
  }
673
674
  ngAfterViewInit() {
674
675
  this.doFocus();
@@ -683,8 +684,10 @@ class AXAutoFocusDirective {
683
684
  }
684
685
  const list = ['button', 'input', '[href]', 'select', 'textarea', '[tabindex]'].map((c) => c + ':not([tabindex="-1"])');
685
686
  const focusable = this.el.nativeElement.querySelector(list.join(', ')) ?? this.el.nativeElement;
686
- const attr = this.document.createAttribute('autofocus');
687
- focusable.setAttributeNode(attr);
687
+ if (isPlatformBrowser(this.platformID)) {
688
+ const attr = this.document.createAttribute('autofocus');
689
+ focusable.setAttributeNode(attr);
690
+ }
688
691
  const hasTabindex = focusable.hasAttribute('tabindex');
689
692
  if (!hasTabindex) {
690
693
  focusable.setAttribute('tabindex', '0');
@@ -1310,6 +1313,7 @@ class MXValueComponent extends MXInteractiveComponent {
1310
1313
  this.stateChange = new EventEmitter();
1311
1314
  this._state = 'clear';
1312
1315
  this.document = inject(DOCUMENT);
1316
+ this.platformID = inject(PLATFORM_ID);
1313
1317
  this.validationService = inject(AXValidationService);
1314
1318
  this.validationRulesChange = new EventEmitter();
1315
1319
  this.validationRules = [];
@@ -1472,7 +1476,7 @@ class MXValueComponent extends MXInteractiveComponent {
1472
1476
  break;
1473
1477
  case 'error':
1474
1478
  this.setState('clear');
1475
- if (args[0]) {
1479
+ if (args[0] && isPlatformBrowser(this.platformID)) {
1476
1480
  const span = this.document.createElement('span');
1477
1481
  span.innerHTML = args[0];
1478
1482
  span.classList.add('ax-error-message');
@@ -1842,6 +1846,7 @@ class AXInvertedColorDirective {
1842
1846
  constructor() {
1843
1847
  this.color = input.required();
1844
1848
  this.ref = inject(ViewContainerRef);
1849
+ this.platformID = inject(PLATFORM_ID);
1845
1850
  afterNextRender(() => {
1846
1851
  this.invertColor();
1847
1852
  });
@@ -1853,25 +1858,27 @@ class AXInvertedColorDirective {
1853
1858
  let color;
1854
1859
  let foreColor;
1855
1860
  const invertedVariables = [];
1856
- if (this.color() === 'ghost') {
1857
- color = getComputedStyle(document.documentElement).getPropertyValue(`--ax-color-${this.color()}`);
1858
- foreColor = getComputedStyle(document.documentElement).getPropertyValue(`--ax-color-${this.color()}-fore`);
1859
- invertedVariables.push({ name: `--ax-color-ghost`, value: `${foreColor}` });
1860
- invertedVariables.push({ name: `--ax-color-ghost-fore`, value: `${color}` });
1861
- }
1862
- else {
1863
- const range = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
1864
- color = getComputedStyle(document.documentElement).getPropertyValue(`--ax-color-${this.color()}-500`);
1865
- foreColor = getComputedStyle(document.documentElement).getPropertyValue(`--ax-color-${this.color()}-fore`);
1866
- range.forEach((c) => {
1867
- invertedVariables.push({ name: `--ax-color-${this.color()}-${c}`, value: `${foreColor}` });
1861
+ if (isPlatformBrowser(this.platformID)) {
1862
+ if (this.color() === 'ghost') {
1863
+ color = getComputedStyle(document.documentElement).getPropertyValue(`--ax-color-${this.color()}`);
1864
+ foreColor = getComputedStyle(document.documentElement).getPropertyValue(`--ax-color-${this.color()}-fore`);
1865
+ invertedVariables.push({ name: `--ax-color-ghost`, value: `${foreColor}` });
1866
+ invertedVariables.push({ name: `--ax-color-ghost-fore`, value: `${color}` });
1867
+ }
1868
+ else {
1869
+ const range = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
1870
+ color = getComputedStyle(document.documentElement).getPropertyValue(`--ax-color-${this.color()}-500`);
1871
+ foreColor = getComputedStyle(document.documentElement).getPropertyValue(`--ax-color-${this.color()}-fore`);
1872
+ range.forEach((c) => {
1873
+ invertedVariables.push({ name: `--ax-color-${this.color()}-${c}`, value: `${foreColor}` });
1874
+ });
1875
+ invertedVariables.push({ name: `--ax-color-${this.color()}-fore`, value: `${color}` });
1876
+ invertedVariables.push({ name: `--ax-color-${this.color()}-fore-tint`, value: `${color}` });
1877
+ }
1878
+ invertedVariables.forEach((c) => {
1879
+ this.ref.element.nativeElement.style.setProperty(c.name, c.value);
1868
1880
  });
1869
- invertedVariables.push({ name: `--ax-color-${this.color()}-fore`, value: `${color}` });
1870
- invertedVariables.push({ name: `--ax-color-${this.color()}-fore-tint`, value: `${color}` });
1871
1881
  }
1872
- invertedVariables.forEach((c) => {
1873
- this.ref.element.nativeElement.style.setProperty(c.name, c.value);
1874
- });
1875
1882
  }
1876
1883
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXInvertedColorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1877
1884
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.0", type: AXInvertedColorDirective, isStandalone: true, selector: "[axInvertedColor]", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
@@ -1891,6 +1898,7 @@ class AXRippleDirective {
1891
1898
  this.enabled = true;
1892
1899
  this.axRippleColor = 'rgb(255, 255, 255 , 0.3)';
1893
1900
  this.document = inject(DOCUMENT);
1901
+ this.platformID = inject(PLATFORM_ID);
1894
1902
  }
1895
1903
  ngOnInit() {
1896
1904
  if (this.enabled) {
@@ -1914,18 +1922,20 @@ class AXRippleDirective {
1914
1922
  const rect = element.getBoundingClientRect();
1915
1923
  const x = Math.floor(((event.clientX - rect.left) / (rect.right - rect.left)) * element.clientWidth);
1916
1924
  const y = Math.floor(((event.clientY - rect.top) / (rect.bottom - rect.top)) * element.clientHeight);
1917
- const circle = this.document.createElement('span');
1918
- const diameter = Math.max(element.clientWidth, element.clientHeight);
1919
- const radius = diameter / 2;
1920
- circle.style.width = circle.style.height = `${diameter}px`;
1921
- circle.style.left = `${x - radius}px`;
1922
- circle.style.top = `${y - radius}px`;
1923
- circle.style.backgroundColor = `${this.axRippleColor}`;
1924
- circle.classList.add('ax-ripple');
1925
- element.appendChild(circle);
1926
- circle.addEventListener('animationend', () => {
1927
- circle?.remove();
1928
- });
1925
+ if (isPlatformBrowser(this.platformID)) {
1926
+ const circle = this.document.createElement('span');
1927
+ const diameter = Math.max(element.clientWidth, element.clientHeight);
1928
+ const radius = diameter / 2;
1929
+ circle.style.width = circle.style.height = `${diameter}px`;
1930
+ circle.style.left = `${x - radius}px`;
1931
+ circle.style.top = `${y - radius}px`;
1932
+ circle.style.backgroundColor = `${this.axRippleColor}`;
1933
+ circle.classList.add('ax-ripple');
1934
+ element.appendChild(circle);
1935
+ circle.addEventListener('animationend', () => {
1936
+ circle?.remove();
1937
+ });
1938
+ }
1929
1939
  }
1930
1940
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRippleDirective, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1931
1941
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: AXRippleDirective, isStandalone: true, selector: "[axRipple]", inputs: { enabled: ["axRipple", "enabled"], axRippleColor: "axRippleColor" }, ngImport: i0 }); }