@danske/sapphire-angular 2.3.0 → 2.5.0
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/checkbox/src/checkbox.component.mjs +20 -4
- package/esm2020/lib/checkbox/src/checkbox.module.mjs +4 -3
- package/esm2020/lib/field/src/field-control.mjs +1 -1
- package/esm2020/lib/field/src/field.component.mjs +24 -9
- package/esm2020/lib/listbox/src/listbox.component.mjs +2 -2
- package/esm2020/lib/menu/src/menu-trigger.directive.mjs +10 -4
- package/esm2020/lib/menu/src/menu.component.mjs +2 -2
- package/esm2020/lib/modal/src/dialog/dialog-trigger.directive.mjs +3 -8
- package/esm2020/lib/modal/src/modal-trigger.directive.mjs +13 -11
- package/esm2020/lib/modal/src/modal.service.mjs +5 -4
- package/esm2020/lib/modal/src/panel/panel-trigger.directive.mjs +3 -8
- package/esm2020/lib/popover/src/popover-trigger.directive.mjs +11 -11
- package/esm2020/lib/popover/src/popover.component.mjs +3 -3
- package/esm2020/lib/segmented-tabs/src/segmented-tab.component.mjs +2 -2
- package/esm2020/lib/select/src/basic-select/basic-select.component.mjs +2 -2
- package/esm2020/lib/select/src/select/select.component.mjs +4 -3
- package/esm2020/lib/text-field/src/text-field.component.mjs +4 -3
- package/esm2020/lib/theme/public_api.mjs +2 -2
- package/esm2020/lib/theme/src/sapphire-overlay.service.mjs +62 -0
- package/esm2020/lib/theme/src/theme-base.directive.mjs +6 -46
- package/esm2020/lib/theme/src/theme.module.mjs +3 -29
- package/esm2020/lib/theme/src/themes.mjs +4 -4
- package/esm2020/lib/tooltip/src/tooltip.directive.mjs +4 -4
- package/fesm2015/danske-sapphire-angular.mjs +299 -312
- package/fesm2015/danske-sapphire-angular.mjs.map +1 -1
- package/fesm2020/danske-sapphire-angular.mjs +296 -308
- package/fesm2020/danske-sapphire-angular.mjs.map +1 -1
- package/lib/checkbox/src/checkbox.component.d.ts +6 -1
- package/lib/checkbox/src/checkbox.module.d.ts +4 -3
- package/lib/field/src/field-control.d.ts +1 -0
- package/lib/field/src/field.component.d.ts +11 -3
- package/lib/modal/src/dialog/dialog-trigger.directive.d.ts +0 -3
- package/lib/modal/src/modal-trigger.directive.d.ts +3 -2
- package/lib/modal/src/modal.service.d.ts +10 -2
- package/lib/modal/src/panel/panel-trigger.directive.d.ts +0 -3
- package/lib/popover/src/popover-trigger.directive.d.ts +4 -3
- package/lib/select/src/select/select.component.d.ts +1 -0
- package/lib/table/src/table-cell.directive.d.ts +1 -1
- package/lib/text-field/src/text-field.component.d.ts +1 -0
- package/lib/theme/public_api.d.ts +1 -1
- package/lib/theme/src/sapphire-overlay.service.d.ts +34 -0
- package/lib/tooltip/src/tooltip.directive.d.ts +2 -2
- package/package.json +3 -3
- package/esm2020/lib/theme/src/sapphire-overlay-container.service.mjs +0 -37
- package/lib/theme/src/sapphire-overlay-container.service.d.ts +0 -14
|
@@ -45,6 +45,10 @@ export declare class CheckboxComponent extends _CheckboxMixinBase implements Aft
|
|
|
45
45
|
get _inputId(): string;
|
|
46
46
|
/** Whether the checkbox is required. */
|
|
47
47
|
required: BooleanInput;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the necessity indicator should be visible.
|
|
50
|
+
*/
|
|
51
|
+
necessityIndicator?: BooleanInput;
|
|
48
52
|
/**
|
|
49
53
|
* Whether the checkbox is readonly.
|
|
50
54
|
*/
|
|
@@ -89,6 +93,7 @@ export declare class CheckboxComponent extends _CheckboxMixinBase implements Aft
|
|
|
89
93
|
get indeterminate(): boolean;
|
|
90
94
|
set indeterminate(value: BooleanInput);
|
|
91
95
|
private _indeterminate;
|
|
96
|
+
get labelNecessityIndicator(): 'optional' | 'required' | undefined;
|
|
92
97
|
writeValue(value: any): void;
|
|
93
98
|
registerOnChange(fn: (value: any) => void): void;
|
|
94
99
|
registerOnTouched(fn: any): void;
|
|
@@ -111,6 +116,6 @@ export declare class CheckboxComponent extends _CheckboxMixinBase implements Aft
|
|
|
111
116
|
*/
|
|
112
117
|
private syncIndeterminate;
|
|
113
118
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxComponent, [{ optional: true; }, null, null, { attribute: "tabindex"; }]>;
|
|
114
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "sp-checkbox", ["spCheckbox"], { "ariaLabel": "aria-label"; "ariaLabelledby": "aria-labelledby"; "ariaDescribedby": "aria-describedby"; "id": "id"; "required": "required"; "readonly": "readonly"; "name": "name"; "size": "size"; "value": "value"; "selected": "selected"; "disabled": "disabled"; "indeterminate": "indeterminate"; }, { "change": "change"; }, never, ["*"], false, [{ directive: typeof i1.ThemeCheckDirective; inputs: {}; outputs: {}; }]>;
|
|
119
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "sp-checkbox", ["spCheckbox"], { "ariaLabel": "aria-label"; "ariaLabelledby": "aria-labelledby"; "ariaDescribedby": "aria-describedby"; "id": "id"; "required": "required"; "necessityIndicator": "necessityIndicator"; "readonly": "readonly"; "name": "name"; "size": "size"; "value": "value"; "selected": "selected"; "disabled": "disabled"; "indeterminate": "indeterminate"; }, { "change": "change"; }, never, ["*"], false, [{ directive: typeof i1.ThemeCheckDirective; inputs: {}; outputs: {}; }]>;
|
|
115
120
|
}
|
|
116
121
|
export {};
|
|
@@ -3,10 +3,11 @@ import * as i1 from "./checkbox.component";
|
|
|
3
3
|
import * as i2 from "./checkbox-required-validator";
|
|
4
4
|
import * as i3 from "./checkbox-group.component";
|
|
5
5
|
import * as i4 from "@angular/common";
|
|
6
|
-
import * as i5 from "
|
|
7
|
-
import * as i6 from "@angular/
|
|
6
|
+
import * as i5 from "../../common/translate.pipe";
|
|
7
|
+
import * as i6 from "@angular/forms";
|
|
8
|
+
import * as i7 from "@angular/cdk/a11y";
|
|
8
9
|
export declare class SapphireCheckboxModule {
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<SapphireCheckboxModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireCheckboxModule, [typeof i1.CheckboxComponent, typeof i2.SapphireCheckboxRequiredValidator, typeof i3.CheckboxGroupComponent], [typeof i4.CommonModule, typeof i5.
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireCheckboxModule, [typeof i1.CheckboxComponent, typeof i2.SapphireCheckboxRequiredValidator, typeof i3.CheckboxGroupComponent], [typeof i4.CommonModule, typeof i5.TranslatePipe, typeof i6.FormsModule, typeof i7.A11yModule], [typeof i1.CheckboxComponent, typeof i2.SapphireCheckboxRequiredValidator, typeof i3.CheckboxGroupComponent]>;
|
|
11
12
|
static ɵinj: i0.ɵɵInjectorDeclaration<SapphireCheckboxModule>;
|
|
12
13
|
}
|
|
@@ -43,13 +43,16 @@ export declare class FieldComponent implements AfterContentInit, AfterViewChecke
|
|
|
43
43
|
* @default "above"
|
|
44
44
|
*/
|
|
45
45
|
labelPlacement?: 'side' | 'above';
|
|
46
|
+
/**
|
|
47
|
+
* Avoid the default width
|
|
48
|
+
*/
|
|
49
|
+
noDefaultWidth?: BooleanInput;
|
|
46
50
|
/**
|
|
47
51
|
* @default "lg"
|
|
48
52
|
*/
|
|
49
53
|
size?: 'lg' | 'md';
|
|
50
54
|
note?: FieldNoteDirective;
|
|
51
55
|
error?: FieldErrorDirective;
|
|
52
|
-
radioGroup?: RadioGroupComponent;
|
|
53
56
|
label?: LabelComponent;
|
|
54
57
|
_fieldLabel?: FieldLabelDirective;
|
|
55
58
|
/**
|
|
@@ -57,6 +60,7 @@ export declare class FieldComponent implements AfterContentInit, AfterViewChecke
|
|
|
57
60
|
* that are meant to rendered inside sp-field, provide FieldControl.
|
|
58
61
|
*/
|
|
59
62
|
controls?: QueryList<FieldControl>;
|
|
63
|
+
radioGroup?: RadioGroupComponent;
|
|
60
64
|
private requiredValidator?;
|
|
61
65
|
/**
|
|
62
66
|
* Is set via field-note-affix directive. ContentChild query can't be used since we need
|
|
@@ -76,6 +80,10 @@ export declare class FieldComponent implements AfterContentInit, AfterViewChecke
|
|
|
76
80
|
* If there are multiple controls, the field is only disabled when all of them are disabled
|
|
77
81
|
*/
|
|
78
82
|
isDisabled(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* If any of the controls should be constrained by the field's default widht
|
|
85
|
+
*/
|
|
86
|
+
controlHasDefaultWidth(): boolean;
|
|
79
87
|
/**
|
|
80
88
|
* Only support features like `for` or `labelClick` if the field has one control.
|
|
81
89
|
*/
|
|
@@ -84,9 +92,9 @@ export declare class FieldComponent implements AfterContentInit, AfterViewChecke
|
|
|
84
92
|
/**
|
|
85
93
|
* Whether the field control is radio group (sp-radio-group).
|
|
86
94
|
*/
|
|
87
|
-
|
|
95
|
+
hasRadioGroupChild(): boolean;
|
|
88
96
|
get labelNecessityIndicator(): LabelComponent['necessityIndicator'];
|
|
89
97
|
_setSuffixPortal(portal: DomPortal<HTMLElement> | null): void;
|
|
90
98
|
static ɵfac: i0.ɵɵFactoryDeclaration<FieldComponent, never>;
|
|
91
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FieldComponent, "sp-field", never, { "necessityIndicator": "necessityIndicator"; "labelPlacement": "labelPlacement"; "size": "size"; }, {}, ["note", "error", "
|
|
99
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldComponent, "sp-field", never, { "necessityIndicator": "necessityIndicator"; "labelPlacement": "labelPlacement"; "noDefaultWidth": "noDefaultWidth"; "size": "size"; }, {}, ["note", "error", "_fieldLabel", "radioGroup", "requiredValidator", "controls"], ["sp-field-label", "sp-help-button", "*", "sp-field-error", "sp-field-note"], false, [{ directive: typeof i1.UseComponentStylesOnHost; inputs: {}; outputs: {}; }]>;
|
|
92
100
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { ModalTriggerDirective } from '../modal-trigger.directive';
|
|
2
|
-
import { ModalService } from '../modal.service';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
/**
|
|
5
4
|
* Makes a clickable element a trigger for a dialog.
|
|
6
5
|
*/
|
|
7
6
|
export declare class DialogTriggerDirective extends ModalTriggerDirective {
|
|
8
|
-
protected modalService: ModalService;
|
|
9
|
-
constructor(modalService: ModalService);
|
|
10
7
|
open(): void;
|
|
11
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<DialogTriggerDirective, never>;
|
|
12
9
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogTriggerDirective, "[spDialogTriggerFor]", ["spDialogTrigger"], { "dismissable": "spDialogDismissable"; "keyboardDismissDisabled": "spDialogDisableKeyboardDismissable"; "templateRef": "spDialogTriggerFor"; }, {}, never, never, false, never>;
|
|
@@ -2,12 +2,12 @@ import { TemplateRef } from '@angular/core';
|
|
|
2
2
|
import { DialogRef } from '@angular/cdk/dialog';
|
|
3
3
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
4
4
|
import { ModalOptions, ModalService } from './modal.service';
|
|
5
|
+
import { ThemeBaseDirective } from '../../theme/public_api';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
/**
|
|
7
8
|
* Makes a clickable element a trigger for a modal
|
|
8
9
|
*/
|
|
9
10
|
export declare abstract class ModalTriggerDirective implements ModalOptions {
|
|
10
|
-
protected modalService: ModalService;
|
|
11
11
|
protected templateRef: TemplateRef<unknown> | null;
|
|
12
12
|
protected dialogRef?: DialogRef;
|
|
13
13
|
get dismissable(): boolean;
|
|
@@ -16,7 +16,8 @@ export declare abstract class ModalTriggerDirective implements ModalOptions {
|
|
|
16
16
|
get keyboardDismissDisabled(): boolean;
|
|
17
17
|
set keyboardDismissDisabled(value: BooleanInput);
|
|
18
18
|
private _keyboardDismissDisabled;
|
|
19
|
-
|
|
19
|
+
protected modalService: ModalService;
|
|
20
|
+
readonly theme: ThemeBaseDirective;
|
|
20
21
|
abstract open(): void;
|
|
21
22
|
close(): void;
|
|
22
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<ModalTriggerDirective, never>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Dialog, DialogRef } from '@angular/cdk/dialog';
|
|
2
|
-
import { ComponentType
|
|
2
|
+
import { ComponentType } from '@angular/cdk/overlay';
|
|
3
3
|
import { TemplateRef } from '@angular/core';
|
|
4
|
+
import { SapphireOverlay } from '../../theme/src/sapphire-overlay.service';
|
|
5
|
+
import { ThemeBaseDirective } from '../../theme/src/theme-base.directive';
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
7
|
export interface ModalOptions {
|
|
6
8
|
/**
|
|
@@ -13,11 +15,17 @@ export interface ModalOptions {
|
|
|
13
15
|
* @default false
|
|
14
16
|
*/
|
|
15
17
|
keyboardDismissDisabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The theme to apply on the opened modal. It allows for injecting and
|
|
20
|
+
* passing along the "current" theme, when `ModalService` is used in a
|
|
21
|
+
* trigger component.
|
|
22
|
+
*/
|
|
23
|
+
theme?: ThemeBaseDirective;
|
|
16
24
|
}
|
|
17
25
|
export declare class ModalService {
|
|
18
26
|
private cdkDialog;
|
|
19
27
|
private overlay;
|
|
20
|
-
constructor(cdkDialog: Dialog, overlay:
|
|
28
|
+
constructor(cdkDialog: Dialog, overlay: SapphireOverlay);
|
|
21
29
|
private open;
|
|
22
30
|
openDialog<C = unknown>(componentOrTemplateRef: ComponentType<C> | TemplateRef<C>, options?: ModalOptions): DialogRef<unknown, C>;
|
|
23
31
|
openPanel<C = unknown>(componentOrTemplateRef: ComponentType<C> | TemplateRef<C>, options?: ModalOptions): DialogRef<unknown, C>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { ModalTriggerDirective } from '../modal-trigger.directive';
|
|
2
|
-
import { ModalService } from '../modal.service';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
/**
|
|
5
4
|
* Makes a clickable element a trigger for a panel.
|
|
6
5
|
*/
|
|
7
6
|
export declare class PanelTriggerDirective extends ModalTriggerDirective {
|
|
8
|
-
protected modalService: ModalService;
|
|
9
|
-
constructor(modalService: ModalService);
|
|
10
7
|
open(): void;
|
|
11
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<PanelTriggerDirective, never>;
|
|
12
9
|
static ɵdir: i0.ɵɵDirectiveDeclaration<PanelTriggerDirective, "[spPanelTriggerFor]", ["spPanelTrigger"], { "dismissable": "spPanelDismissable"; "keyboardDismissDisabled": "spPanelDisableKeyboardDismissable"; "templateRef": "spPanelTriggerFor"; }, {}, never, never, false, never>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OverlayRef } from '@angular/cdk/overlay';
|
|
2
2
|
import { ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, Injector, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { Placement } from '../../common/placement';
|
|
5
5
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
6
|
+
import { SapphireOverlay } from '../../theme/src/sapphire-overlay.service';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
export interface PopoverTrigger {
|
|
8
9
|
toggle(): void;
|
|
@@ -13,7 +14,7 @@ export interface PopoverTrigger {
|
|
|
13
14
|
export declare const POPOVER_TRIGGER: InjectionToken<PopoverTrigger>;
|
|
14
15
|
export declare class PopoverTriggerDirective implements PopoverTrigger {
|
|
15
16
|
private changeDetectorRef;
|
|
16
|
-
private
|
|
17
|
+
private overlay;
|
|
17
18
|
private viewContainerRef;
|
|
18
19
|
elementRef: ElementRef<HTMLElement>;
|
|
19
20
|
private injector;
|
|
@@ -52,7 +53,7 @@ export declare class PopoverTriggerDirective implements PopoverTrigger {
|
|
|
52
53
|
protected overlayRef: OverlayRef | null;
|
|
53
54
|
private isBeingPressed;
|
|
54
55
|
get getPopoverId(): string | undefined;
|
|
55
|
-
constructor(changeDetectorRef: ChangeDetectorRef,
|
|
56
|
+
constructor(changeDetectorRef: ChangeDetectorRef, overlay: SapphireOverlay, viewContainerRef: ViewContainerRef, elementRef: ElementRef<HTMLElement>, injector: Injector);
|
|
56
57
|
ngOnDestroy(): void;
|
|
57
58
|
/** Toggle the attached popover. */
|
|
58
59
|
toggle(): void;
|
|
@@ -75,6 +75,7 @@ export declare class SelectComponent extends SelectComponentBase implements Fiel
|
|
|
75
75
|
_onSearchInput(event: Event): void;
|
|
76
76
|
_handleSelected(): void;
|
|
77
77
|
isDisabled(): boolean;
|
|
78
|
+
hasDefaultWidth: boolean;
|
|
78
79
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, [null, null, null, { optional: true; }, { optional: true; }]>;
|
|
79
80
|
static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "sp-select", ["spSelect"], {}, {}, never, ["sp-selection-text"], false, [{ directive: typeof i1.UseComponentStylesOnHost; inputs: {}; outputs: {}; }]>;
|
|
80
81
|
}
|
|
@@ -11,7 +11,7 @@ export declare class TableCellDirective implements AfterContentChecked {
|
|
|
11
11
|
private table;
|
|
12
12
|
private truncatedWithTooltipDirective;
|
|
13
13
|
private tableRow;
|
|
14
|
-
get role(): "
|
|
14
|
+
get role(): "cell" | "rowheader";
|
|
15
15
|
/**
|
|
16
16
|
* Horizontal alignment of content in the cell.
|
|
17
17
|
*
|
|
@@ -14,6 +14,7 @@ export declare class TextFieldComponent implements FieldControl {
|
|
|
14
14
|
isCharacterCounterExceeded(): boolean;
|
|
15
15
|
isDisabled(): boolean;
|
|
16
16
|
getId(): string | undefined;
|
|
17
|
+
readonly hasDefaultWidth = true;
|
|
17
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextFieldComponent, [{ optional: true; }]>;
|
|
18
19
|
static ɵcmp: i0.ɵɵComponentDeclaration<TextFieldComponent, "sp-text-field", never, { "characterCounterMax": "characterCounterMax"; }, {}, ["inputElement", "_inputDirective"], ["sp-text-field-prefix", "input", "sp-text-field-postfix", "textarea"], false, [{ directive: typeof i1.ThemeCheckDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.UseComponentStylesOnHost; inputs: {}; outputs: {}; }]>;
|
|
19
20
|
}
|
|
@@ -17,7 +17,7 @@ export type Breakpoints = Record<Breakpoint, number>;
|
|
|
17
17
|
*/
|
|
18
18
|
export declare const DEFAULT_BREAKPOINTS: Breakpoints;
|
|
19
19
|
export { SapphireThemeModule } from './src/theme.module';
|
|
20
|
-
export {
|
|
20
|
+
export { SapphireOverlay } from './src/sapphire-overlay.service';
|
|
21
21
|
export { ThemeDefaultDark, ThemeDefault } from './src/themes';
|
|
22
22
|
export { ThemeRootDirective } from './src/theme-root.directive';
|
|
23
23
|
export { ThemeBaseDirective } from './src/theme-base.directive';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
|
|
2
|
+
import { ThemeBaseDirective } from './theme-base.directive';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* NOTE: Providing a theme-aware OverlayContainer was a solution for overlay styles we used to have.
|
|
6
|
+
* It proved error-prone since it can lead to multiple overlay containers, which can cause
|
|
7
|
+
* z-index issues in various scenarios (UC-4160, UC-2897, UC-3843).
|
|
8
|
+
* The current solution applies.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Sapphire theme aware overlay service.
|
|
12
|
+
* It's a slim wrapper around CDK Overlay service that adds theme styles to the overlay container.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SapphireOverlay extends Overlay {
|
|
15
|
+
private topLevelThemeRef;
|
|
16
|
+
private theme;
|
|
17
|
+
/**
|
|
18
|
+
* Same as Angular CDK's `overlay.create`,
|
|
19
|
+
* but applies the current theme style on the overlay container.
|
|
20
|
+
* @param overlayConfig The overlay configuration to pass to overlay.create()
|
|
21
|
+
* @param theme The theme to apply. If not provided, the current theme will be used.
|
|
22
|
+
*/
|
|
23
|
+
create(overlayConfig?: OverlayConfig, theme?: ThemeBaseDirective): OverlayRef;
|
|
24
|
+
/**
|
|
25
|
+
* Applies the current theme style on the overlay container.
|
|
26
|
+
* Useful only when the overlay is not created using `SapphireOverlay.create` method.
|
|
27
|
+
* E.g. when using some higher-level service like Dialog from angular CDK.
|
|
28
|
+
* @param overlayRef The overlay reference to apply the theme on.
|
|
29
|
+
* @param theme The theme to apply. If not provided, the current theme will be used.
|
|
30
|
+
*/
|
|
31
|
+
applyTheme(overlayRef: OverlayRef, theme?: ThemeBaseDirective): void;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SapphireOverlay, never>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SapphireOverlay>;
|
|
34
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Overlay } from '@angular/cdk/overlay';
|
|
2
1
|
import { ElementRef } from '@angular/core';
|
|
3
2
|
import { NumberInput } from '@angular/cdk/coercion';
|
|
3
|
+
import { SapphireOverlay } from '../../theme/public_api';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class TooltipDirective {
|
|
6
6
|
private _overlay;
|
|
@@ -33,7 +33,7 @@ export declare class TooltipDirective {
|
|
|
33
33
|
hide: (immediate?: boolean) => void;
|
|
34
34
|
warmup: () => void;
|
|
35
35
|
private attachTooltipPortal;
|
|
36
|
-
constructor(_overlay:
|
|
36
|
+
constructor(_overlay: SapphireOverlay, _elementRef: ElementRef<HTMLElement>);
|
|
37
37
|
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
|
|
38
38
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[spTooltip]", ["spTooltip"], { "tooltipText": "spTooltip"; "delay": "spTooltipDelay"; "placement": "spTooltipPlacement"; }, {}, never, never, true, never>;
|
|
39
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danske/sapphire-angular",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
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,11 +16,11 @@
|
|
|
16
16
|
"@danske/sapphire-icons": "^2.0.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@danske/sapphire-css": "^
|
|
19
|
+
"@danske/sapphire-css": "^38.0.0",
|
|
20
20
|
"@internationalized/message": "^3.1.5",
|
|
21
21
|
"tslib": "^2.3.0"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "7673827573af06dab98309795b977522151a5c2c",
|
|
24
24
|
"es2020": "fesm2020/danske-sapphire-angular.mjs",
|
|
25
25
|
"esm2020": "esm2020/danske-sapphire-angular.mjs",
|
|
26
26
|
"fesm2020": "fesm2020/danske-sapphire-angular.mjs",
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { OverlayContainer } from '@angular/cdk/overlay';
|
|
2
|
-
import { DOCUMENT } from '@angular/common';
|
|
3
|
-
import { Inject, Injectable, inject } from '@angular/core';
|
|
4
|
-
import { ThemeBaseDirective } from './theme-base.directive';
|
|
5
|
-
import { TopLevelThemeRef } from './top-level-theme-ref.service';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "@angular/cdk/platform";
|
|
8
|
-
/**
|
|
9
|
-
* Sapphire theme aware overlay container.
|
|
10
|
-
*/
|
|
11
|
-
export class SapphireOverlayContainer extends OverlayContainer {
|
|
12
|
-
constructor(document, platform) {
|
|
13
|
-
super(document, platform);
|
|
14
|
-
this.topLevelThemeRef = inject(TopLevelThemeRef);
|
|
15
|
-
this.theme = inject(ThemeBaseDirective, {
|
|
16
|
-
optional: true,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
_createContainer() {
|
|
20
|
-
const theme = this.theme || this.topLevelThemeRef.getTheme();
|
|
21
|
-
if (!theme) {
|
|
22
|
-
throw new Error('Could not find the current theme needed for overlay container');
|
|
23
|
-
}
|
|
24
|
-
super._createContainer();
|
|
25
|
-
// wrapping the .cdk-overlay-container element with another div which provides theme styles.
|
|
26
|
-
theme?.applyOnDomNode(this._containerElement);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
SapphireOverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: SapphireOverlayContainer, deps: [{ token: DOCUMENT }, { token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
30
|
-
SapphireOverlayContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: SapphireOverlayContainer });
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: SapphireOverlayContainer, decorators: [{
|
|
32
|
-
type: Injectable
|
|
33
|
-
}], ctorParameters: function () { return [{ type: Document, decorators: [{
|
|
34
|
-
type: Inject,
|
|
35
|
-
args: [DOCUMENT]
|
|
36
|
-
}] }, { type: i1.Platform }]; } });
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FwcGhpcmUtb3ZlcmxheS1jb250YWluZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvdGhlbWUvc3JjL3NhcHBoaXJlLW92ZXJsYXktY29udGFpbmVyLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFeEQsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzNDLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzRCxPQUFPLEV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BpZiAoIXRoZW1lKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICdDb3VsZCBub3QgZmluZCB0aGUgY3VycmVudCB0aGVtZSBuZWVkZWQgZm9yIG92ZXJsYXkgY29udGFpbmVyJ1xuICAgICAgKTtcbiAgICB9XG4gICAgc3VwZXIuX2NyZWF0ZUNvbnRhaW5lcigpO1xuICAgIC8vIHdyYXBwaW5nIHRoZSAuY2RrLW92ZXJsYXktY29udGFpbmVyIGVsZW1lbnQgd2l0aCBhbm90aGVyIGRpdiB3aGljaCBwcm92aWRlcyB0aGVtZSBzdHlsZXMuXG4gICAgdGhlbWU/LmFwcGx5T25Eb21Ob2RlKHRoaXMuX2NvbnRhaW5lckVsZW1lbnQpO1xuICB9XG59XG4iXX0=
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OverlayContainer } from '@angular/cdk/overlay';
|
|
2
|
-
import { Platform } from '@angular/cdk/platform';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* Sapphire theme aware overlay container.
|
|
6
|
-
*/
|
|
7
|
-
export declare class SapphireOverlayContainer extends OverlayContainer {
|
|
8
|
-
private topLevelThemeRef;
|
|
9
|
-
private theme;
|
|
10
|
-
constructor(document: Document, platform: Platform);
|
|
11
|
-
_createContainer(): void;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SapphireOverlayContainer, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SapphireOverlayContainer>;
|
|
14
|
-
}
|