chrv-components 1.12.71 → 1.12.73

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,168 @@ 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.chrHoverContext = input({}, ...(ngDevMode ? [{ debugName: "chrHoverContext" }] : []));
6697
+ this.chrHoverSnap = input(false, ...(ngDevMode ? [{ debugName: "chrHoverSnap" }] : []));
6698
+ this.chrHoverPosition = input('right', ...(ngDevMode ? [{ debugName: "chrHoverPosition" }] : []));
6699
+ this.mousePositionStrategy = (mousemove) => {
6700
+ const positionOffset = { left: mousemove.clientX, top: mousemove.clientY };
6701
+ const componentSize = this.overlayRef?.overlayElement.getBoundingClientRect();
6702
+ switch (this.chrHoverPosition()) {
6703
+ case 'above':
6704
+ positionOffset.top -= (componentSize?.height || 0) + 20;
6705
+ positionOffset.left -= (componentSize?.width || 0) / 2;
6706
+ break;
6707
+ case 'below':
6708
+ positionOffset.top += 20;
6709
+ positionOffset.left -= (componentSize?.width || 0) / 2;
6710
+ break;
6711
+ case 'left':
6712
+ positionOffset.left -= (componentSize?.width || 0) + 20;
6713
+ positionOffset.top -= (componentSize?.height || 0) / 2;
6714
+ break;
6715
+ case 'right':
6716
+ positionOffset.left += 20;
6717
+ positionOffset.top -= (componentSize?.height || 0) / 2;
6718
+ break;
6719
+ }
6720
+ const positionStrategy = this.overlay
6721
+ .position()
6722
+ .global()
6723
+ .left(`${positionOffset.left}px`)
6724
+ .top(`${positionOffset.top}px`);
6725
+ return positionStrategy;
6726
+ };
6727
+ this.snappedStrategy = () => {
6728
+ const positionStrategy = this.overlay
6729
+ .position()
6730
+ .flexibleConnectedTo(this.el);
6731
+ switch (this.chrHoverPosition()) {
6732
+ case 'above':
6733
+ positionStrategy.withPositions([
6734
+ {
6735
+ originX: 'center',
6736
+ originY: 'top',
6737
+ overlayX: 'center',
6738
+ overlayY: 'bottom',
6739
+ },
6740
+ {
6741
+ originX: 'center',
6742
+ originY: 'bottom',
6743
+ overlayX: 'center',
6744
+ overlayY: 'top',
6745
+ },
6746
+ ]);
6747
+ break;
6748
+ case 'below':
6749
+ positionStrategy.withPositions([
6750
+ {
6751
+ originX: 'center',
6752
+ originY: 'bottom',
6753
+ overlayX: 'center',
6754
+ overlayY: 'top',
6755
+ },
6756
+ {
6757
+ originX: 'center',
6758
+ originY: 'top',
6759
+ overlayX: 'center',
6760
+ overlayY: 'bottom',
6761
+ },
6762
+ ]);
6763
+ break;
6764
+ case 'left':
6765
+ positionStrategy.withPositions([
6766
+ {
6767
+ originX: 'start',
6768
+ originY: 'center',
6769
+ overlayX: 'end',
6770
+ overlayY: 'center',
6771
+ },
6772
+ {
6773
+ originX: 'end',
6774
+ originY: 'center',
6775
+ overlayX: 'start',
6776
+ overlayY: 'center',
6777
+ },
6778
+ ]);
6779
+ break;
6780
+ case 'right':
6781
+ positionStrategy.withPositions([
6782
+ {
6783
+ originX: 'end',
6784
+ originY: 'center',
6785
+ overlayX: 'start',
6786
+ overlayY: 'center',
6787
+ },
6788
+ {
6789
+ originX: 'start',
6790
+ originY: 'center',
6791
+ overlayX: 'end',
6792
+ overlayY: 'center',
6793
+ },
6794
+ ]);
6795
+ break;
6796
+ }
6797
+ return positionStrategy;
6798
+ };
6799
+ const positionStrategy = this.snappedStrategy();
6800
+ this.overlayRef = this.overlay.create({
6801
+ positionStrategy,
6802
+ hasBackdrop: false,
6803
+ });
6804
+ }
6805
+ ngOnInit() {
6806
+ this.eventListeners.push(this.renderer.listen(this.el.nativeElement, 'mouseenter', (event) => {
6807
+ this.open();
6808
+ }));
6809
+ this.eventListeners.push(this.renderer.listen(this.el.nativeElement, 'mouseleave', (event) => {
6810
+ this.close();
6811
+ }));
6812
+ this.eventListeners.push(this.renderer.listen(this.el.nativeElement, 'mousemove', (event) => {
6813
+ if (!this.chrHoverSnap()) {
6814
+ const positionStrategy = this.mousePositionStrategy(event);
6815
+ this.overlayRef.updatePositionStrategy(positionStrategy);
6816
+ }
6817
+ }));
6818
+ }
6819
+ ngOnDestroy() {
6820
+ this.overlayRef.dispose();
6821
+ this.removeEventListeners();
6822
+ }
6823
+ removeEventListeners() {
6824
+ this.eventListeners.forEach((unlisten) => unlisten());
6825
+ this.eventListeners = [];
6826
+ }
6827
+ open() {
6828
+ if (!this.overlayRef.hasAttached()) {
6829
+ if (!this.portal) {
6830
+ this.portal = new TemplatePortal(this.template, this.vcr, this.chrHoverContext());
6831
+ }
6832
+ const ref = this.overlayRef.attach(this.portal);
6833
+ }
6834
+ }
6835
+ close() {
6836
+ this.overlayRef.detach();
6837
+ }
6838
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ChrHoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
6839
+ 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 }, chrHoverContext: { classPropertyName: "chrHoverContext", publicName: "chrHoverContext", isSignal: true, 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 }); }
6840
+ }
6841
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: ChrHoverDirective, decorators: [{
6842
+ type: Directive,
6843
+ args: [{
6844
+ selector: '[chrHover]',
6845
+ }]
6846
+ }], ctorParameters: () => [], propDecorators: { template: [{
6847
+ type: Input,
6848
+ args: ['chrHover']
6849
+ }], chrHoverContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrHoverContext", required: false }] }], chrHoverSnap: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrHoverSnap", required: false }] }], chrHoverPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "chrHoverPosition", required: false }] }] } });
6850
+
6677
6851
  class CsvExporter {
6678
6852
  export(data, columns) {
6679
6853
  const csvRows = [];
@@ -7520,5 +7694,5 @@ const provideDebounceEventPlugin = () => [
7520
7694
  * Generated bundle index. Do not edit.
7521
7695
  */
7522
7696
 
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 };
7697
+ 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
7698
  //# sourceMappingURL=chrv-components.mjs.map