@danske/sapphire-angular 3.7.1 → 3.8.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.
- package/esm2020/lib/button/src/button-group.component.mjs +2 -2
- package/esm2020/lib/button/src/button.component.mjs +29 -11
- package/esm2020/lib/button/src/button.module.mjs +14 -4
- package/esm2020/lib/button/src/toggle-button.component.mjs +4 -3
- package/esm2020/lib/checkbox/src/checkbox-group.component.mjs +2 -2
- package/esm2020/lib/common/focused.directive.mjs +8 -8
- package/esm2020/lib/list/src/list.component.mjs +2 -2
- package/esm2020/lib/listbox/src/listbox.component.mjs +2 -2
- package/esm2020/lib/menu/src/menu.component.mjs +2 -2
- package/esm2020/lib/modal/src/panel/panel.component.mjs +2 -2
- package/esm2020/lib/radio/src/radio-group.component.mjs +2 -2
- package/esm2020/lib/table/src/table.component.mjs +2 -2
- package/esm2020/lib/text-field/src/text-field.component.mjs +2 -2
- package/esm2020/lib/theme/src/themes.mjs +4 -4
- package/esm2020/lib/tooltip/src/tooltip.module.mjs +12 -4
- package/esm2020/lib/tooltip/src/truncated-with-tooltip.directive.mjs +90 -9
- package/fesm2015/danske-sapphire-angular.mjs +5585 -5467
- package/fesm2015/danske-sapphire-angular.mjs.map +1 -1
- package/fesm2020/danske-sapphire-angular.mjs +5399 -5285
- package/fesm2020/danske-sapphire-angular.mjs.map +1 -1
- package/lib/button/src/button.component.d.ts +10 -5
- package/lib/button/src/button.module.d.ts +3 -1
- package/lib/common/focused.directive.d.ts +2 -2
- package/lib/tooltip/src/tooltip.module.d.ts +1 -1
- package/lib/tooltip/src/truncated-with-tooltip.directive.d.ts +58 -4
- package/package.json +3 -3
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { AfterContentInit, ElementRef } from '@angular/core';
|
|
1
|
+
import { AfterContentInit, AfterViewChecked, ElementRef } from '@angular/core';
|
|
2
2
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
3
3
|
import { IconComponent } from '../../icon/public_api';
|
|
4
4
|
import { ButtonIconDirective } from './button-icon.directive';
|
|
5
|
+
import { TooltipDirective, TruncatedWithTooltipDirective } from '../../tooltip/public_api';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
import * as i1 from "../../theme/src/theme-check.directive";
|
|
7
8
|
import * as i2 from "../../common/sapphire-view-encapsulation";
|
|
8
|
-
|
|
9
|
+
import * as i3 from "../../tooltip/src/truncated-with-tooltip.directive";
|
|
10
|
+
export declare class ButtonComponent implements AfterContentInit, AfterViewChecked {
|
|
9
11
|
elementRef: ElementRef<HTMLButtonElement>;
|
|
12
|
+
private userTooltipDirective;
|
|
13
|
+
private truncatedWithTooltipDirective;
|
|
10
14
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'danger' | 'danger-secondary' | 'danger-tertiary' | 'danger-text';
|
|
11
15
|
size?: 'sm' | 'md' | 'lg';
|
|
12
16
|
disabled: BooleanInput;
|
|
@@ -20,8 +24,9 @@ export declare class ButtonComponent implements AfterContentInit {
|
|
|
20
24
|
get hostTabIndex(): number | string | null;
|
|
21
25
|
buttonIcon?: ButtonIconDirective;
|
|
22
26
|
icon?: IconComponent;
|
|
23
|
-
constructor(elementRef: ElementRef<HTMLButtonElement
|
|
27
|
+
constructor(elementRef: ElementRef<HTMLButtonElement>, userTooltipDirective: TooltipDirective, truncatedWithTooltipDirective: TruncatedWithTooltipDirective);
|
|
24
28
|
ngAfterContentInit(): void;
|
|
25
|
-
|
|
26
|
-
static
|
|
29
|
+
ngAfterViewChecked(): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, [null, { optional: true; self: true; }, null]>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "button[sp-button], a[sp-button]", never, { "variant": "variant"; "size": "size"; "disabled": "disabled"; "iconAlign": "iconAlign"; "type": "type"; "tabindex": "tabindex"; }, {}, ["buttonIcon", "icon"], ["*", "[spButtonIcon]"], false, [{ directive: typeof i1.ThemeCheckDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.UseComponentStylesOnHost; inputs: {}; outputs: {}; }, { directive: typeof i3.TruncatedWithTooltipDirective; inputs: {}; outputs: {}; }]>;
|
|
27
32
|
}
|
|
@@ -7,8 +7,10 @@ import * as i5 from "./button-group.component";
|
|
|
7
7
|
import * as i6 from "./toggle-button-required-validator";
|
|
8
8
|
import * as i7 from "@angular/common";
|
|
9
9
|
import * as i8 from "@angular/forms";
|
|
10
|
+
import * as i9 from "../../tooltip/src/tooltip.directive";
|
|
11
|
+
import * as i10 from "../../tooltip/src/truncated-with-tooltip.directive";
|
|
10
12
|
export declare class SapphireButtonModule {
|
|
11
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<SapphireButtonModule, never>;
|
|
12
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireButtonModule, [typeof i1.ButtonComponent, typeof i2.ButtonIconDirective, typeof i3.IconButtonComponent, typeof i4.ToggleButtonComponent, typeof i5.ButtonGroupComponent, typeof i6.SapphireToggleButtonRequiredValidator], [typeof i7.CommonModule, typeof i8.FormsModule], [typeof i1.ButtonComponent, typeof i2.ButtonIconDirective, typeof i3.IconButtonComponent, typeof i4.ToggleButtonComponent, typeof i5.ButtonGroupComponent, typeof i6.SapphireToggleButtonRequiredValidator]>;
|
|
14
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireButtonModule, [typeof i1.ButtonComponent, typeof i2.ButtonIconDirective, typeof i3.IconButtonComponent, typeof i4.ToggleButtonComponent, typeof i5.ButtonGroupComponent, typeof i6.SapphireToggleButtonRequiredValidator], [typeof i7.CommonModule, typeof i8.FormsModule, typeof i9.TooltipDirective, typeof i10.TruncatedWithTooltipContentElementDirective], [typeof i1.ButtonComponent, typeof i2.ButtonIconDirective, typeof i3.IconButtonComponent, typeof i4.ToggleButtonComponent, typeof i5.ButtonGroupComponent, typeof i6.SapphireToggleButtonRequiredValidator]>;
|
|
13
15
|
static ɵinj: i0.ɵɵInjectorDeclaration<SapphireButtonModule>;
|
|
14
16
|
}
|
|
@@ -20,8 +20,8 @@ export declare class FocusedDirective {
|
|
|
20
20
|
focusedInput?: boolean;
|
|
21
21
|
private hostFocused;
|
|
22
22
|
private get className();
|
|
23
|
-
private
|
|
24
|
-
private
|
|
23
|
+
private onFocus;
|
|
24
|
+
private onBlur;
|
|
25
25
|
isFocused(): boolean;
|
|
26
26
|
isFocusVisible(): boolean;
|
|
27
27
|
constructor(inputModalityDetector: InputModalityDetector);
|
|
@@ -6,6 +6,6 @@ import * as i4 from "./tooltip.directive";
|
|
|
6
6
|
import * as i5 from "./truncated-with-tooltip.directive";
|
|
7
7
|
export declare class SapphireTooltipModule {
|
|
8
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<SapphireTooltipModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireTooltipModule, [typeof i1.TooltipComponent], [typeof i2.CommonModule, typeof i3.OverlayModule, typeof i4.TooltipDirective, typeof i5.TruncatedWithTooltipDirective], [typeof i4.TooltipDirective, typeof i5.TruncatedWithTooltipDirective]>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireTooltipModule, [typeof i1.TooltipComponent], [typeof i2.CommonModule, typeof i3.OverlayModule, typeof i4.TooltipDirective, typeof i5.TruncatedWithTooltipDirective, typeof i5.TruncatedWithTooltipContentElementDirective], [typeof i4.TooltipDirective, typeof i5.TruncatedWithTooltipDirective, typeof i5.TruncatedWithTooltipContentElementDirective]>;
|
|
10
10
|
static ɵinj: i0.ɵɵInjectorDeclaration<SapphireTooltipModule>;
|
|
11
11
|
}
|
|
@@ -1,8 +1,38 @@
|
|
|
1
|
-
import { AfterContentChecked, ElementRef } from '@angular/core';
|
|
1
|
+
import { AfterContentChecked, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { TooltipDirective } from './tooltip.directive';
|
|
3
3
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Marks an element as the content element to be checked for overflow
|
|
7
|
+
* when using spTruncatedWithTooltip directive.
|
|
8
|
+
* Automatically registers itself with the parent TruncatedWithTooltipDirective.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TruncatedWithTooltipContentElementDirective implements OnInit, OnDestroy {
|
|
11
|
+
elementRef: ElementRef<HTMLElement>;
|
|
12
|
+
private parentDirective?;
|
|
13
|
+
constructor(elementRef: ElementRef<HTMLElement>, parentDirective?: TruncatedWithTooltipDirective | undefined);
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
ngOnDestroy(): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TruncatedWithTooltipContentElementDirective, [null, { optional: true; skipSelf: true; }]>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TruncatedWithTooltipContentElementDirective, "[spTruncatedWithTooltipContent]", never, {}, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Internal wrapper directive that extends TooltipDirective for use with truncated text functionality.
|
|
21
|
+
*
|
|
22
|
+
* This directive is designed to be used exclusively as a hostDirective within the
|
|
23
|
+
* TruncatedWithTooltipDirective, enabling components to support automatic truncation tooltips
|
|
24
|
+
* without conflicting with user-provided tooltip directives.
|
|
25
|
+
*
|
|
26
|
+
* Angular's hostDirectives feature allows a directive to be composed with other directives,
|
|
27
|
+
* but if we used TooltipDirective directly in components that expose spTruncatedWithTooltip,
|
|
28
|
+
* it would prevent users from also applying their own spTooltip directive to the same component.
|
|
29
|
+
* By creating this internal wrapper, we maintain directive composition flexibility while
|
|
30
|
+
* avoiding selector conflicts.
|
|
31
|
+
*/
|
|
32
|
+
export declare class TruncatedWithTooltipDirectiveInternal extends TooltipDirective {
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TruncatedWithTooltipDirectiveInternal, never>;
|
|
34
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TruncatedWithTooltipDirectiveInternal, never, never, {}, {}, never, never, true, never>;
|
|
35
|
+
}
|
|
6
36
|
/**
|
|
7
37
|
* Shows a tooltip with the text content of the host element, if the content is
|
|
8
38
|
* overflowing. It also applies inline styles to hide the overflow and show the
|
|
@@ -10,6 +40,12 @@ import * as i1 from "./tooltip.directive";
|
|
|
10
40
|
*
|
|
11
41
|
* @example <something spTruncatedWithTooltip>Overflow will always be truncated</something>
|
|
12
42
|
* @example <something spTruncatedWithTooltip="someCondition">Overflow will be truncated only if someCondition is truthy</something>
|
|
43
|
+
* @example
|
|
44
|
+
* By using spTruncatedWithTooltipContent, you can detect overflow on a child element
|
|
45
|
+
* while keeping the tooltip attached to the host element:
|
|
46
|
+
* <div spTruncatedWithTooltip>
|
|
47
|
+
* <span spTruncatedWithTooltipContent>This text will be checked for overflow</span>
|
|
48
|
+
* </div>
|
|
13
49
|
*/
|
|
14
50
|
export declare class TruncatedWithTooltipDirective implements AfterContentChecked {
|
|
15
51
|
private tooltipDirective;
|
|
@@ -18,9 +54,27 @@ export declare class TruncatedWithTooltipDirective implements AfterContentChecke
|
|
|
18
54
|
* Whether the directive is enabled.
|
|
19
55
|
*/
|
|
20
56
|
enabled: BooleanInput;
|
|
21
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Optional content element marked with spTruncatedWithTooltipContent directive.
|
|
59
|
+
* If not provided, the host element will be used.
|
|
60
|
+
* This is automatically set when a child element has the directive.
|
|
61
|
+
*/
|
|
62
|
+
contentElementDirective?: TruncatedWithTooltipContentElementDirective;
|
|
63
|
+
/**
|
|
64
|
+
* Registers a content element directive.
|
|
65
|
+
* Called automatically by TruncatedWithTooltipContentElementDirective.
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
registerContentElement(directive: TruncatedWithTooltipContentElementDirective): void;
|
|
69
|
+
/**
|
|
70
|
+
* Unregisters the content element directive.
|
|
71
|
+
* Called automatically by TruncatedWithTooltipContentElementDirective.
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
unregisterContentElement(): void;
|
|
75
|
+
constructor(tooltipDirective: TruncatedWithTooltipDirectiveInternal, elementRef: ElementRef);
|
|
22
76
|
ngAfterContentChecked(): void;
|
|
23
77
|
private hasOverflow;
|
|
24
78
|
static ɵfac: i0.ɵɵFactoryDeclaration<TruncatedWithTooltipDirective, never>;
|
|
25
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TruncatedWithTooltipDirective, "[spTruncatedWithTooltip]", never, { "enabled": "spTruncatedWithTooltip"; }, {}, never, never, true, [{ directive: typeof
|
|
79
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TruncatedWithTooltipDirective, "[spTruncatedWithTooltip]", never, { "enabled": "spTruncatedWithTooltip"; }, {}, never, never, true, [{ directive: typeof TruncatedWithTooltipDirectiveInternal; inputs: {}; outputs: {}; }]>;
|
|
26
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danske/sapphire-angular",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "The Angular implementation of the Sapphire Design System from Danske Bank A/S",
|
|
6
6
|
"module": "fesm2015/danske-sapphire-angular.mjs",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"@danske/sapphire-icons": "^3.1.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@danske/sapphire-css": "^
|
|
19
|
+
"@danske/sapphire-css": "^49.1.0",
|
|
20
20
|
"@internationalized/message": "^3.1.5",
|
|
21
21
|
"dompurify": "^3.2.6",
|
|
22
22
|
"tslib": "^2.3.0"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "88e11202ab17bb9830ba1f261d631ab24edf57d2",
|
|
25
25
|
"es2020": "fesm2020/danske-sapphire-angular.mjs",
|
|
26
26
|
"esm2020": "esm2020/danske-sapphire-angular.mjs",
|
|
27
27
|
"fesm2020": "fesm2020/danske-sapphire-angular.mjs",
|