@datarailsshared/datarailsshared 1.6.206 → 1.6.208

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.
@@ -1,34 +1,43 @@
1
- import { ElementRef, EventEmitter, SimpleChanges } from '@angular/core';
2
- import { IDropdown, IDropdownAction, IDropdownActionIcon, IDropdownItem } from '../models/dropdown';
1
+ import { ElementRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ICustomTooltipComponent, IDropdown, IDropdownAction, IDropdownActionIcon, IDropdownItem } from '../models/dropdown';
3
3
  import { DropdownInstanceRef } from './dr-dropdown.service';
4
+ import { Position } from '../models/position';
5
+ import { TooltipOptions } from '../dr-tooltip/dr-tooltip.component';
6
+ import { TooltipTheme } from '../dr-tooltip/enums/tooltip-theme.enum';
4
7
  import * as i0 from "@angular/core";
5
- export declare class DrDropdownComponent implements DropdownInstanceRef {
8
+ export declare class DrDropdownComponent implements DropdownInstanceRef, OnChanges {
9
+ constructor();
6
10
  private readonly cdr;
7
11
  private readonly popoverRef;
8
12
  private readonly dropdownInstanceService;
13
+ private readonly drDropdownInHoverChange$;
9
14
  private readonly destroy$;
10
15
  private _active;
11
- menuContainer: ElementRef<HTMLDivElement>;
12
16
  drDropdownInHover: boolean;
13
- private readonly drDropdownInHoverChange$;
14
17
  list: IDropdownItem<unknown>[];
15
18
  containerClass: string;
16
19
  wasHovered: boolean;
17
20
  asChild: boolean;
18
21
  dataAnalytics: string;
22
+ menuContainer: ElementRef<HTMLDivElement>;
19
23
  set options(data: IDropdown<IDropdownItem<unknown>>);
20
24
  onAction: EventEmitter<IDropdownAction<unknown>>;
21
- constructor();
22
25
  ngOnChanges(changes: SimpleChanges): void;
26
+ onMouseleave(): void;
27
+ active(): boolean;
23
28
  disabled(act: IDropdownItem<unknown>): boolean;
24
29
  selected(act: IDropdownItem<unknown>): boolean;
25
- tooltipToShow(act: IDropdownItem<unknown>): string;
30
+ tooltipToShow(act: IDropdownItem<unknown>): string | ICustomTooltipComponent;
31
+ getTooltipOptions(act: IDropdownItem<unknown>): TooltipOptions;
32
+ getTooltipPosition(act: IDropdownItem<unknown>): Position;
33
+ getTooltipTheme(act: IDropdownItem<unknown>): TooltipTheme;
34
+ getTooltipMousleaveTimeout(act: IDropdownItem<unknown>): number;
35
+ getTooltipMouseEnterTimeout(act: IDropdownItem<unknown>): number;
36
+ private getCustomTooltipComponent;
26
37
  action(act: IDropdownItem<unknown>): void;
27
38
  onActionIconClick($event: MouseEvent, actionIcon: IDropdownActionIcon<unknown>, data: unknown): void;
28
39
  hasChildren(item: IDropdownItem<unknown>): boolean;
29
40
  onMouseenter(): void;
30
- onMouseleave(): void;
31
- active(): boolean;
32
41
  getDataAnalyticsTag(act: IDropdownItem<unknown>, index: number): string;
33
42
  static ɵfac: i0.ɵɵFactoryDeclaration<DrDropdownComponent, never>;
34
43
  static ɵcmp: i0.ɵɵComponentDeclaration<DrDropdownComponent, "dr-dropdown", never, { "options": { "alias": "options"; "required": false; }; }, { "onAction": "action"; }, never, ["dr-dropdown-item"], false, never>;
@@ -0,0 +1,14 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ICustomTooltipComponent } from '../../../models/dropdown';
3
+ import * as i0 from "@angular/core";
4
+ export declare class TooltipCustomComponent implements OnChanges {
5
+ private readonly injector;
6
+ private readonly environmentInjector;
7
+ private cmpRef;
8
+ private container;
9
+ content: ICustomTooltipComponent;
10
+ ngOnChanges(changes: SimpleChanges): void;
11
+ private renderComponent;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipCustomComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<TooltipCustomComponent, "dr-tooltip-custom", never, { "content": { "alias": "content"; "required": false; }; }, {}, never, never, true, never>;
14
+ }
@@ -2,7 +2,7 @@ import { OnInit } from '@angular/core';
2
2
  import { BehaviorSubject } from 'rxjs';
3
3
  import { TooltipTheme } from './enums/tooltip-theme.enum';
4
4
  import * as i0 from "@angular/core";
5
- type TooltipOptions = {
5
+ export type TooltipOptions = {
6
6
  withoutContainerStyles?: boolean;
7
7
  withoutArrow?: boolean;
8
8
  };
@@ -14,6 +14,7 @@ export declare class TooltipComponent implements OnInit {
14
14
  class: string;
15
15
  theme: TooltipTheme;
16
16
  isContentTemplate: boolean;
17
+ isCustomTooltip: boolean;
17
18
  readonly role = "tooltip";
18
19
  isMouseOn$: BehaviorSubject<boolean>;
19
20
  ngOnInit(): void;
@@ -22,4 +23,3 @@ export declare class TooltipComponent implements OnInit {
22
23
  static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, never>;
23
24
  static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "dr-tooltip", never, { "content": { "alias": "content"; "required": false; }; "contentContext": { "alias": "contentContext"; "required": false; }; "position": { "alias": "position"; "required": false; }; "options": { "alias": "options"; "required": false; }; "class": { "alias": "class"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; }, {}, never, never, true, never>;
24
25
  }
25
- export {};
@@ -1,10 +1,11 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./components/tooltip-default/tooltip-default.component";
3
3
  import * as i2 from "./components/tooltip-info/tooltip-info.component";
4
- import * as i3 from "./dr-tooltip.component";
5
- import * as i4 from "./dr-tooltip.directive";
4
+ import * as i3 from "./components/tooltip-custom/tooltip-custom.component";
5
+ import * as i4 from "./dr-tooltip.component";
6
+ import * as i5 from "./dr-tooltip.directive";
6
7
  export declare class DrTooltipModule {
7
8
  static ɵfac: i0.ɵɵFactoryDeclaration<DrTooltipModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<DrTooltipModule, never, [typeof i1.TooltipDefaultComponent, typeof i2.TooltipInfoComponent, typeof i3.TooltipComponent, typeof i4.DrTooltipDirective], [typeof i1.TooltipDefaultComponent, typeof i2.TooltipInfoComponent, typeof i3.TooltipComponent, typeof i4.DrTooltipDirective]>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DrTooltipModule, never, [typeof i1.TooltipDefaultComponent, typeof i2.TooltipInfoComponent, typeof i3.TooltipCustomComponent, typeof i4.TooltipComponent, typeof i5.DrTooltipDirective], [typeof i1.TooltipDefaultComponent, typeof i2.TooltipInfoComponent, typeof i3.TooltipCustomComponent, typeof i4.TooltipComponent, typeof i5.DrTooltipDirective]>;
9
10
  static ɵinj: i0.ɵɵInjectorDeclaration<DrTooltipModule>;
10
11
  }
@@ -1,5 +1,8 @@
1
1
  import { TemplateRef } from '@angular/core';
2
2
  import { Position } from './position';
3
+ import { ComponentType } from '@angular/cdk/portal';
4
+ import { TooltipOptions } from '../dr-tooltip/dr-tooltip.component';
5
+ import { TooltipTheme } from '../dr-tooltip/enums/tooltip-theme.enum';
3
6
  export interface IDropdown<T> {
4
7
  drDropdownInHover?: boolean;
5
8
  position?: Position;
@@ -19,7 +22,7 @@ export interface IDropdownItem<T> {
19
22
  show?: (p: any) => boolean;
20
23
  disabled?: ((p: T) => boolean) | boolean;
21
24
  toolTip?: string;
22
- customTooltip?: (p: any) => string;
25
+ customTooltip?: (p: any) => string | ICustomTooltipComponent;
23
26
  toolTipIfDisabled?: boolean;
24
27
  children?: IDropdownItem<T>[];
25
28
  childOptions?: IDropdownChild<T>;
@@ -32,6 +35,18 @@ export interface IDropdownItem<T> {
32
35
  }>;
33
36
  dataAnalytics?: string;
34
37
  }
38
+ export interface ICustomTooltipComponentOptions extends TooltipOptions {
39
+ position?: Position;
40
+ theme?: TooltipTheme;
41
+ drTooltipMousleaveTimeout?: number;
42
+ drTooltipMouseEnterTimeout?: number;
43
+ }
44
+ export interface ICustomTooltipComponent<T = any> {
45
+ component: ComponentType<T>;
46
+ inputs?: Partial<T>;
47
+ providers?: any[];
48
+ options?: ICustomTooltipComponentOptions;
49
+ }
35
50
  export interface IDropdownActionIcon<T> {
36
51
  icon: string;
37
52
  action: (p: T) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/datarailsshared",
3
- "version": "1.6.206",
3
+ "version": "1.6.208",
4
4
  "description": "DataRails shared components",
5
5
  "keywords": [
6
6
  "angular",
package/public-api.d.ts CHANGED
@@ -112,7 +112,7 @@ export * from './lib/pipes/filter/filter.pipe';
112
112
  export * from './lib/models/datePicker';
113
113
  export { TAG_TYPES, ITag, IDateTag, IListTag, ITagForServer, IDynamicTag, TDynamicTagValue, TDynamicTag, TagTypes, TagsConfigSubType, TConnectedTags, } from './lib/models/serverTags';
114
114
  export { ISpinnerOptions, SpinnerType, SpinnerSize } from './lib/models/spinnerOptions';
115
- export { IDropdown, IDropdownItem, IDropdownActionIcon, IDropdownAction } from './lib/models/dropdown';
115
+ export { IDropdown, IDropdownItem, IDropdownActionIcon, IDropdownAction, ICustomTooltipComponent, ICustomTooltipComponentOptions, } from './lib/models/dropdown';
116
116
  export { Position } from './lib/models/position';
117
117
  export { DrPopoverRef, IDrPopoverComponentModel, Point, DrPopoverConfig, IPopoverManualClosing, DrPopoverAlignment, DrPopoverAlignmentDimension, } from './lib/models/popover';
118
118
  export { IValidationError } from './lib/models/validationError';