@colijnit/corecomponents_v12 261.20.18 → 261.20.20

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.
package/index.d.ts CHANGED
@@ -3421,19 +3421,28 @@ declare class TooltipDirective implements OnDestroy, OnInit {
3421
3421
  private _injector;
3422
3422
  private _sanitizer;
3423
3423
  set tooltip(str: string);
3424
+ orientation: CoDirection;
3424
3425
  private _elementRef;
3425
3426
  private _tooltipMessage;
3426
3427
  private _componentRef;
3428
+ private _showTimeoutId;
3429
+ private _autoHideTimeoutId;
3430
+ private readonly _mouseEnterHandler;
3431
+ private readonly _mouseLeaveHandler;
3432
+ private readonly _scrollHandler;
3427
3433
  constructor(elementRef: ElementRef, _compFactoryResolver: ComponentFactoryResolver, _appRef: ApplicationRef, _injector: Injector, _sanitizer: DomSanitizer);
3428
3434
  ngOnDestroy(): void;
3429
3435
  ngOnInit(): void;
3430
3436
  private _handleScroll;
3431
- private _handleMouseMove;
3432
- private _showTooltip;
3437
+ private _startShowTimeout;
3438
+ private _resolveDelay;
3439
+ private _clearShowTimeout;
3433
3440
  private _removeTooltip;
3441
+ private _startAutoHideTimeout;
3442
+ private _clearAutoHideTimeout;
3434
3443
  private _createTooltipComponent;
3435
3444
  static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
3436
- static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[tooltip]", never, { "tooltip": { "alias": "tooltip"; "required": false; }; }, {}, never, never, false, never>;
3445
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[tooltip]", never, { "tooltip": { "alias": "tooltip"; "required": false; }; "orientation": { "alias": "tooltipOrientation"; "required": false; }; }, {}, never, never, false, never>;
3437
3446
  }
3438
3447
 
3439
3448
  declare class TooltipComponent implements AfterViewInit, OnDestroy {
@@ -3443,21 +3452,32 @@ declare class TooltipComponent implements AfterViewInit, OnDestroy {
3443
3452
  set hostElement(value: HTMLElement);
3444
3453
  get hostElement(): HTMLElement;
3445
3454
  toolTip: SafeHtml | string;
3455
+ orientation: CoDirection;
3446
3456
  tooltipClosed: EventEmitter<void>;
3447
3457
  showClass(): boolean;
3448
3458
  top: number;
3449
3459
  left: number;
3450
- bottom: boolean;
3460
+ get isTop(): boolean;
3461
+ get isBottom(): boolean;
3462
+ get isLeft(): boolean;
3463
+ get isRight(): boolean;
3451
3464
  animate: boolean;
3465
+ private _resolvedOrientation;
3452
3466
  private _hostElement;
3453
3467
  private _documentClickListener;
3454
3468
  constructor(_elementRef: ElementRef, _changeDetector: ChangeDetectorRef, _renderer: Renderer2);
3455
3469
  ngAfterViewInit(): void;
3456
3470
  ngOnDestroy(): void;
3457
3471
  private _positionTooltip;
3472
+ private _resolveOrientation;
3473
+ private _fits;
3474
+ private _availableSpace;
3475
+ private _calculateLeft;
3476
+ private _calculateTop;
3477
+ private _positionArrow;
3458
3478
  private closeTooltip;
3459
3479
  static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, never>;
3460
- static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "co-tooltip", never, { "hostElement": { "alias": "hostElement"; "required": false; }; "toolTip": { "alias": "toolTip"; "required": false; }; }, { "tooltipClosed": "tooltipClosed"; }, never, never, false, never>;
3480
+ static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "co-tooltip", never, { "hostElement": { "alias": "hostElement"; "required": false; }; "toolTip": { "alias": "toolTip"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; }, { "tooltipClosed": "tooltipClosed"; }, never, never, false, never>;
3461
3481
  }
3462
3482
 
3463
3483
  declare class TooltipModule {
@@ -10,7 +10,7 @@
10
10
  align-items: center;
11
11
  column-gap: 10px;
12
12
  padding: $co-tooltip-padding;
13
- z-index: 999999;
13
+ z-index: $co-tooltip-z-index;
14
14
  border-radius: $co-tooltip-border-radius;
15
15
  border: $co-tooltip-border;
16
16
 
@@ -23,30 +23,73 @@
23
23
  pointer-events: none;
24
24
  position: absolute;
25
25
  width: 0;
26
- bottom: -20px;
27
26
  }
28
27
 
29
28
  &::after {
30
- left: 20px;
31
- border-width: 10px;
29
+ border-width: $co-tooltip-arrow-size;
32
30
  }
33
31
 
34
32
  &::before {
35
- margin-left: 12px;
36
- border-width: 8px;
33
+ border-width: $co-tooltip-arrow-inner-size;
37
34
  z-index: 1;
38
- bottom: -16px;
39
35
  }
36
+
37
+ @if not $co-tooltip-has-border {
38
+ &::after {
39
+ display: none;
40
+ }
41
+ }
42
+
43
+ // The arrow sits on the edge facing the host: --co-tooltip-arrow-center is the offset along that edge.
44
+ &.top {
45
+ &::after {
46
+ left: calc(#{$co-tooltip-arrow-center} - #{$co-tooltip-arrow-size});
47
+ bottom: calc(-2 * #{$co-tooltip-arrow-size});
48
+ }
49
+
50
+ &::before {
51
+ left: calc(#{$co-tooltip-arrow-center} - #{$co-tooltip-arrow-inner-size});
52
+ bottom: calc(-2 * #{$co-tooltip-arrow-inner-size});
53
+ }
54
+ }
55
+
40
56
  &.bottom {
41
- &::after,
57
+ &::after {
58
+ left: calc(#{$co-tooltip-arrow-center} - #{$co-tooltip-arrow-size});
59
+ top: calc(-2 * #{$co-tooltip-arrow-size});
60
+ }
61
+
42
62
  &::before {
43
- bottom: 100%;
63
+ left: calc(#{$co-tooltip-arrow-center} - #{$co-tooltip-arrow-inner-size});
64
+ top: calc(-2 * #{$co-tooltip-arrow-inner-size});
44
65
  }
45
66
  }
67
+
68
+ &.left {
69
+ &::after {
70
+ top: calc(#{$co-tooltip-arrow-center} - #{$co-tooltip-arrow-size});
71
+ right: calc(-2 * #{$co-tooltip-arrow-size});
72
+ }
73
+
74
+ &::before {
75
+ top: calc(#{$co-tooltip-arrow-center} - #{$co-tooltip-arrow-inner-size});
76
+ right: calc(-2 * #{$co-tooltip-arrow-inner-size});
77
+ }
78
+ }
79
+
80
+ &.right {
81
+ &::after {
82
+ top: calc(#{$co-tooltip-arrow-center} - #{$co-tooltip-arrow-size});
83
+ left: calc(-2 * #{$co-tooltip-arrow-size});
84
+ }
85
+
86
+ &::before {
87
+ top: calc(#{$co-tooltip-arrow-center} - #{$co-tooltip-arrow-inner-size});
88
+ left: calc(-2 * #{$co-tooltip-arrow-inner-size});
89
+ }
90
+ }
91
+ .title {
92
+ font-weight: $co-tooltip-title-font-weight;
93
+ }
46
94
  }
47
- //.validation-error-content {
48
- // display: flex;
49
- // flex-direction: row;
50
- // align-items: center;
51
- //}
52
95
  }
@@ -1,8 +1,34 @@
1
+ @use "sass:list";
2
+ @use "sass:meta";
3
+
4
+ :root {
5
+ --co-tooltip-arrow-size: 10px;
6
+ --co-tooltip-arrow-inner-size: 8px;
7
+ --co-tooltip-arrow-center: 30px;
8
+ --co-tooltip-z-index: 9999999999;
9
+ // Read by TooltipDirective (getComputedStyle), not applied by CSS.
10
+ --co-tooltip-show-delay: 400ms;
11
+ --co-tooltip-auto-hide-delay: 10000ms; // 0 disables the auto-hide guard
12
+ }
13
+
1
14
  $co-tooltip-font-family: $cc-font-family !default;
2
15
  $co-tooltip-font-size: $cc-font-size-default !default;
3
16
  $co-tooltip-padding: 10px !default;
4
- $co-tooltip-background-color: $cc-color-form-input-background-focus !default;
5
- $co-tooltip-color: $cc-color-font !default;
6
- $co-tooltip-border: 2px solid !default;
7
- $co-tooltip-border-color: black !default;
17
+ $co-tooltip-background-color: $cc-color-tooltip-default !default;
18
+ $co-tooltip-color: white !default;
19
+ $co-tooltip-border: 1px solid !default;
20
+ $co-tooltip-border-color: gray !default;
8
21
  $co-tooltip-border-radius: 5px !default;
22
+ $co-tooltip-arrow-size: var(--co-tooltip-arrow-size) !default;
23
+ $co-tooltip-arrow-inner-size: var(--co-tooltip-arrow-inner-size) !default;
24
+ $co-tooltip-arrow-center: var(--co-tooltip-arrow-center) !default;
25
+ $co-tooltip-z-index: var(--co-tooltip-z-index) !default;
26
+
27
+ // Derived from the border shorthand so the arrow rim follows whatever the consumer sets.
28
+ $co-tooltip-border-width: if(meta.type-of($co-tooltip-border) == list, list.nth($co-tooltip-border, 1), $co-tooltip-border) !default;
29
+ $co-tooltip-has-border: meta.type-of($co-tooltip-border-width) == number and $co-tooltip-border-width > 0 !default;
30
+
31
+ $co-tooltip-title-font-family: $cc-font-family !default;
32
+ $co-tooltip-title-font-size: $cc-font-size-default !default;
33
+ $co-tooltip-title-font-color: $co-tooltip-color !default;
34
+ $co-tooltip-title-font-weight: bold !default;
@@ -4,30 +4,49 @@
4
4
  color: $co-tooltip-color;
5
5
  border-color: $co-tooltip-border-color;
6
6
 
7
- &::after {
8
- border-bottom-color: transparent;
9
- border-top-color: $co-tooltip-border-color;
7
+ // Each orientation colours the border edge that forms the visible triangle.
8
+ &.top {
9
+ &::after {
10
+ border-top-color: $co-tooltip-border-color;
11
+ }
12
+
13
+ &::before {
14
+ border-top-color: $co-tooltip-background-color;
15
+ }
10
16
  }
11
17
 
12
- &::before {
13
- border-bottom-color: transparent;
14
- border-top-color: $co-tooltip-background-color;
18
+ &.bottom {
19
+ &::after {
20
+ border-bottom-color: $co-tooltip-border-color;
21
+ }
22
+
23
+ &::before {
24
+ border-bottom-color: $co-tooltip-background-color;
25
+ }
15
26
  }
16
27
 
17
- @if $co-tooltip-border == "none" {
28
+ &.left {
18
29
  &::after {
19
- display: none;
30
+ border-left-color: $co-tooltip-border-color;
31
+ }
32
+
33
+ &::before {
34
+ border-left-color: $co-tooltip-background-color;
20
35
  }
21
36
  }
22
- &.bottom {
37
+
38
+ &.right {
23
39
  &::after {
24
- border-top-color: transparent;
25
- border-bottom-color: $co-tooltip-border-color;
40
+ border-right-color: $co-tooltip-border-color;
26
41
  }
42
+
27
43
  &::before {
28
- border-top-color: transparent;
29
- border-bottom-color: $co-tooltip-background-color;
44
+ border-right-color: $co-tooltip-background-color;
30
45
  }
31
46
  }
47
+
48
+ .title {
49
+ color: $co-tooltip-title-font-color;
50
+ }
32
51
  }
33
52
  }
@@ -48,6 +48,7 @@ $cc-color-text-main: #22313C !default;
48
48
  $cc-color-input-positive: #d7ead7 !default;
49
49
  $cc-color-input-important: $cc-color-light !default;
50
50
  $cc-color-input-info: #e4e6eb !default;
51
+ $cc-color-tooltip-default: #2e3350 !default;
51
52
  $cc-color-active-accent: #8faba6 !default;
52
53
  $cc-color-less-light: #F7FAFA !default;
53
54
  $cc-color-border: #CCCCCC !default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/corecomponents_v12",
3
- "version": "261.20.18",
3
+ "version": "261.20.20",
4
4
  "description": "Colijn IT core components for Angular 12",
5
5
  "private": false,
6
6
  "peerDependencies": {