chrv-components 1.12.71 → 1.12.72

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.
Binary file
@@ -9,7 +9,7 @@ import * as i1 from '@angular/common';
9
9
  import { CommonModule, AsyncPipe, DatePipe, formatDate, DATE_PIPE_DEFAULT_OPTIONS, isPlatformBrowser, NgClass, formatNumber } from '@angular/common';
10
10
  import * as i1$3 from '@angular/cdk/overlay';
11
11
  import { Overlay, CdkOverlayOrigin, CdkConnectedOverlay, CdkScrollable } from '@angular/cdk/overlay';
12
- import { ComponentPortal } from '@angular/cdk/portal';
12
+ import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
13
13
  import { Subject, Observable, map, BehaviorSubject, skip, debounceTime as debounceTime$1, distinctUntilChanged, skipWhile, from, mergeMap, toArray, timer, takeUntil as takeUntil$1, of, catchError, forkJoin, take, tap, finalize as finalize$1, interval } from 'rxjs';
14
14
  import { debounceTime, takeUntil, finalize, concatMap, switchMap, tap as tap$1, catchError as catchError$1 } from 'rxjs/operators';
15
15
  import * as i1$1 from '@angular/forms';
@@ -1563,17 +1563,29 @@ class DataListComponent {
1563
1563
  const filtered = indexed.filter((suggestion) => suggestion.display.toLowerCase().includes(filter));
1564
1564
  return filtered;
1565
1565
  }, ...(ngDevMode ? [{ debugName: "filteredSuggestions" }] : []));
1566
- effect(() => {
1567
- const target = this.targetInput();
1568
- this.removeEventListeners();
1569
- if (target) {
1570
- this.setupEventListeners(target);
1571
- }
1572
- });
1573
- effect(() => {
1574
- if (this.targetInput())
1575
- this.positionDropdown();
1576
- });
1566
+ // effect(() => {
1567
+ // const target = this.targetInput();
1568
+ // this.removeEventListeners();
1569
+ // if (target) {
1570
+ // this.setupEventListeners(target);
1571
+ // }
1572
+ // });
1573
+ // effect(() => {
1574
+ // if (this.targetInput()) this.positionDropdown();
1575
+ // });
1576
+ }
1577
+ ngOnInit() {
1578
+ const target = this.targetInput();
1579
+ this.removeEventListeners();
1580
+ if (target) {
1581
+ this.setupEventListeners(target);
1582
+ }
1583
+ this.positionDropdown();
1584
+ }
1585
+ ngAfterViewInit() {
1586
+ if (this.targetInput()) {
1587
+ this.positionDropdown();
1588
+ }
1577
1589
  }
1578
1590
  ngOnDestroy() {
1579
1591
  this.removeEventListeners();
@@ -6674,6 +6686,167 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
6674
6686
  }]
6675
6687
  }], propDecorators: { chrDebounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrDebounceTime", required: false }] }] } });
6676
6688
 
6689
+ class ChrHoverDirective {
6690
+ constructor() {
6691
+ this.el = inject((ElementRef));
6692
+ this.overlay = inject(Overlay);
6693
+ this.vcr = inject(ViewContainerRef);
6694
+ this.renderer = inject(Renderer2);
6695
+ this.eventListeners = [];
6696
+ this.chrHoverSnap = input(false, ...(ngDevMode ? [{ debugName: "chrHoverSnap" }] : []));
6697
+ this.chrHoverPosition = input('right', ...(ngDevMode ? [{ debugName: "chrHoverPosition" }] : []));
6698
+ this.mousePositionStrategy = (mousemove) => {
6699
+ const positionOffset = { left: mousemove.clientX, top: mousemove.clientY };
6700
+ const componentSize = this.overlayRef?.overlayElement.getBoundingClientRect();
6701
+ switch (this.chrHoverPosition()) {
6702
+ case 'above':
6703
+ positionOffset.top -= (componentSize?.height || 0) + 20;
6704
+ positionOffset.left -= (componentSize?.width || 0) / 2;
6705
+ break;
6706
+ case 'below':
6707
+ positionOffset.top += 20;
6708
+ positionOffset.left -= (componentSize?.width || 0) / 2;
6709
+ break;
6710
+ case 'left':
6711
+ positionOffset.left -= (componentSize?.width || 0) + 20;
6712
+ positionOffset.top -= (componentSize?.height || 0) / 2;
6713
+ break;
6714
+ case 'right':
6715
+ positionOffset.left += 20;
6716
+ positionOffset.top -= (componentSize?.height || 0) / 2;
6717
+ break;
6718
+ }
6719
+ const positionStrategy = this.overlay
6720
+ .position()
6721
+ .global()
6722
+ .left(`${positionOffset.left}px`)
6723
+ .top(`${positionOffset.top}px`);
6724
+ return positionStrategy;
6725
+ };
6726
+ this.snappedStrategy = () => {
6727
+ const positionStrategy = this.overlay
6728
+ .position()
6729
+ .flexibleConnectedTo(this.el);
6730
+ switch (this.chrHoverPosition()) {
6731
+ case 'above':
6732
+ positionStrategy.withPositions([
6733
+ {
6734
+ originX: 'center',
6735
+ originY: 'top',
6736
+ overlayX: 'center',
6737
+ overlayY: 'bottom',
6738
+ },
6739
+ {
6740
+ originX: 'center',
6741
+ originY: 'bottom',
6742
+ overlayX: 'center',
6743
+ overlayY: 'top',
6744
+ },
6745
+ ]);
6746
+ break;
6747
+ case 'below':
6748
+ positionStrategy.withPositions([
6749
+ {
6750
+ originX: 'center',
6751
+ originY: 'bottom',
6752
+ overlayX: 'center',
6753
+ overlayY: 'top',
6754
+ },
6755
+ {
6756
+ originX: 'center',
6757
+ originY: 'top',
6758
+ overlayX: 'center',
6759
+ overlayY: 'bottom',
6760
+ },
6761
+ ]);
6762
+ break;
6763
+ case 'left':
6764
+ positionStrategy.withPositions([
6765
+ {
6766
+ originX: 'start',
6767
+ originY: 'center',
6768
+ overlayX: 'end',
6769
+ overlayY: 'center',
6770
+ },
6771
+ {
6772
+ originX: 'end',
6773
+ originY: 'center',
6774
+ overlayX: 'start',
6775
+ overlayY: 'center',
6776
+ },
6777
+ ]);
6778
+ break;
6779
+ case 'right':
6780
+ positionStrategy.withPositions([
6781
+ {
6782
+ originX: 'end',
6783
+ originY: 'center',
6784
+ overlayX: 'start',
6785
+ overlayY: 'center',
6786
+ },
6787
+ {
6788
+ originX: 'start',
6789
+ originY: 'center',
6790
+ overlayX: 'end',
6791
+ overlayY: 'center',
6792
+ },
6793
+ ]);
6794
+ break;
6795
+ }
6796
+ return positionStrategy;
6797
+ };
6798
+ const positionStrategy = this.snappedStrategy();
6799
+ this.overlayRef = this.overlay.create({
6800
+ positionStrategy,
6801
+ hasBackdrop: false,
6802
+ });
6803
+ }
6804
+ ngOnInit() {
6805
+ this.eventListeners.push(this.renderer.listen(this.el.nativeElement, 'mouseenter', (event) => {
6806
+ this.open();
6807
+ }));
6808
+ this.eventListeners.push(this.renderer.listen(this.el.nativeElement, 'mouseleave', (event) => {
6809
+ this.close();
6810
+ }));
6811
+ this.eventListeners.push(this.renderer.listen(this.el.nativeElement, 'mousemove', (event) => {
6812
+ if (!this.chrHoverSnap()) {
6813
+ const positionStrategy = this.mousePositionStrategy(event);
6814
+ this.overlayRef.updatePositionStrategy(positionStrategy);
6815
+ }
6816
+ }));
6817
+ }
6818
+ ngOnDestroy() {
6819
+ this.overlayRef.dispose();
6820
+ this.removeEventListeners();
6821
+ }
6822
+ removeEventListeners() {
6823
+ this.eventListeners.forEach((unlisten) => unlisten());
6824
+ this.eventListeners = [];
6825
+ }
6826
+ open() {
6827
+ if (!this.overlayRef.hasAttached()) {
6828
+ if (!this.portal) {
6829
+ this.portal = new TemplatePortal(this.template, this.vcr);
6830
+ }
6831
+ const ref = this.overlayRef.attach(this.portal);
6832
+ }
6833
+ }
6834
+ close() {
6835
+ this.overlayRef.detach();
6836
+ }
6837
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ChrHoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
6838
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.8", type: ChrHoverDirective, isStandalone: true, selector: "[chrHover]", inputs: { template: { classPropertyName: "template", publicName: "chrHover", isSignal: false, isRequired: false, transformFunction: null }, chrHoverSnap: { classPropertyName: "chrHoverSnap", publicName: "chrHoverSnap", isSignal: true, isRequired: false, transformFunction: null }, chrHoverPosition: { classPropertyName: "chrHoverPosition", publicName: "chrHoverPosition", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
6839
+ }
6840
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ChrHoverDirective, decorators: [{
6841
+ type: Directive,
6842
+ args: [{
6843
+ selector: '[chrHover]',
6844
+ }]
6845
+ }], ctorParameters: () => [], propDecorators: { template: [{
6846
+ type: Input,
6847
+ args: ['chrHover']
6848
+ }], chrHoverSnap: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrHoverSnap", required: false }] }], chrHoverPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrHoverPosition", required: false }] }] } });
6849
+
6677
6850
  class CsvExporter {
6678
6851
  export(data, columns) {
6679
6852
  const csvRows = [];
@@ -7520,5 +7693,5 @@ const provideDebounceEventPlugin = () => [
7520
7693
  * Generated bundle index. Do not edit.
7521
7694
  */
7522
7695
 
7523
- export { Aligments, AnonymousTable, AutoDataSource, AutoDataTable, AutofocusDirective, BaseErrorDisplays, BaseTable, BreadcrumbComponent, ButtonComponent, CHR_DEACTIVATION_MODAL, CHR_DEBOUNCE_DEFAULTS, CHR_MODAL_DATA, CHR_MODAL_REF, CacheService, CachingInterceptor, CarouselComponent, ChrBaseInputComponent, ChrButtonComponent, ChrCheckboxComponent, ChrColorInputComponent, ChrContextMenuComponent, ChrDataTable, ChrDateInputComponent, ChrDatetimeInputComponent, ChrDeactivationGuard, ChrDebounceDirective, ChrDefaultModalComponent, ChrDeleteModalComponent, ChrDropdownComponent, ChrFile, ChrFileInputComponent, ChrFormComponent, ChrHoverTitleComponent, ChrHoverTitleDirective, ChrModalComponent, ChrNiceFileInputComponent, ChrPaginatorComponent, ChrPreventReloadDirective, ChrSearchSelectComponent, ChrSearchbarComponent, ChrSeparatorComponent, ChrSpinnerComponent, ChrTableComponent, ChrTableHeaderCellComponent, ChrTagSelectComponent, ChrTextareaInputComponent, ChrToastComponent, ChrToggleInputComponent, Colors, ColorsVariables, ColumnFilter, ColumnGroup, ColumnMetadata, ContextMenuDirective, ControlClickDirective, CookiesService, CrossCellNavigationDirective, DEFAULTLIVEUPDATEMESSAGE, DEFAULT_TOAST_CONFIG, DGFilterMode, DGGroupAggregationEnum, DataExporterService, DataFormatterService, DataGrid, DataListComponent, DataService, DebounceDefaults, DebounceEventPlugin, DecimalValidatorDirective, DefaultLiveUpdateMessage, DropdownContent, DropdownTitle, ENABLE_CACHE, ENABLE_PROGRESS, EditableCell, FileService, HUBURL, INVALIDATE_CACHE, InlineSvgComponent, LegacyToastService, LiveUpdateService, LiveUpdateStatus, LoaderService, MaxDateValidatorDirective, MaxFileSizeValidator, MaxLengthValidatorDirective, MessageBanner, MinFileSizeValidator, MinLengthValidatorDirective, ModalRef, ModalService, OutsideClickAwareDirective, ProgressInterceptor, ProgressService, RequiredValidatorDirective, SHOW_SPINNER, ScrollIntoViewDirective, SpinnerInterceptor, SyncValidatorToAsync, TabComponent, TabGroupComponent, TabToEnterHandlerDirective, TabToInputHandlerDirective, TableConstraint, TableConstraintColumn, TableConstraintReference, ToastComponent, ToastDefaults, ToastRef, ToastService, TypeValidatorDirective, WaitAndStoreXsrfToken, XSRFCOOKIENAME, XSRFHEADERNAME, XsrfInterceptor, decimal, getAsyncValidators, getBackgroundColor, getBorderColor, getContrastBackgroundColor, getContrastBorderColor, getContrastTextColor, getSyncValidators, getTextColor, getValidators, getVariableColor, getVariableContrastColor, maxDate, maxFileSize, maxLength, minFileSize, minLength, provideDebounceEventPlugin, provideXsrfHttpClient, required, type };
7696
+ export { Aligments, AnonymousTable, AutoDataSource, AutoDataTable, AutofocusDirective, BaseErrorDisplays, BaseTable, BreadcrumbComponent, ButtonComponent, CHR_DEACTIVATION_MODAL, CHR_DEBOUNCE_DEFAULTS, CHR_MODAL_DATA, CHR_MODAL_REF, CacheService, CachingInterceptor, CarouselComponent, ChrBaseInputComponent, ChrButtonComponent, ChrCheckboxComponent, ChrColorInputComponent, ChrContextMenuComponent, ChrDataTable, ChrDateInputComponent, ChrDatetimeInputComponent, ChrDeactivationGuard, ChrDebounceDirective, ChrDefaultModalComponent, ChrDeleteModalComponent, ChrDropdownComponent, ChrFile, ChrFileInputComponent, ChrFormComponent, ChrHoverDirective, ChrHoverTitleComponent, ChrHoverTitleDirective, ChrModalComponent, ChrNiceFileInputComponent, ChrPaginatorComponent, ChrPreventReloadDirective, ChrSearchSelectComponent, ChrSearchbarComponent, ChrSeparatorComponent, ChrSpinnerComponent, ChrTableComponent, ChrTableHeaderCellComponent, ChrTagSelectComponent, ChrTextareaInputComponent, ChrToastComponent, ChrToggleInputComponent, Colors, ColorsVariables, ColumnFilter, ColumnGroup, ColumnMetadata, ContextMenuDirective, ControlClickDirective, CookiesService, CrossCellNavigationDirective, DEFAULTLIVEUPDATEMESSAGE, DEFAULT_TOAST_CONFIG, DGFilterMode, DGGroupAggregationEnum, DataExporterService, DataFormatterService, DataGrid, DataListComponent, DataService, DebounceDefaults, DebounceEventPlugin, DecimalValidatorDirective, DefaultLiveUpdateMessage, DropdownContent, DropdownTitle, ENABLE_CACHE, ENABLE_PROGRESS, EditableCell, FileService, HUBURL, INVALIDATE_CACHE, InlineSvgComponent, LegacyToastService, LiveUpdateService, LiveUpdateStatus, LoaderService, MaxDateValidatorDirective, MaxFileSizeValidator, MaxLengthValidatorDirective, MessageBanner, MinFileSizeValidator, MinLengthValidatorDirective, ModalRef, ModalService, OutsideClickAwareDirective, ProgressInterceptor, ProgressService, RequiredValidatorDirective, SHOW_SPINNER, ScrollIntoViewDirective, SpinnerInterceptor, SyncValidatorToAsync, TabComponent, TabGroupComponent, TabToEnterHandlerDirective, TabToInputHandlerDirective, TableConstraint, TableConstraintColumn, TableConstraintReference, ToastComponent, ToastDefaults, ToastRef, ToastService, TypeValidatorDirective, WaitAndStoreXsrfToken, XSRFCOOKIENAME, XSRFHEADERNAME, XsrfInterceptor, decimal, getAsyncValidators, getBackgroundColor, getBorderColor, getContrastBackgroundColor, getContrastBorderColor, getContrastTextColor, getSyncValidators, getTextColor, getValidators, getVariableColor, getVariableContrastColor, maxDate, maxFileSize, maxLength, minFileSize, minLength, provideDebounceEventPlugin, provideXsrfHttpClient, required, type };
7524
7697
  //# sourceMappingURL=chrv-components.mjs.map