@danske/sapphire-angular 1.19.2 → 1.19.3
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/theme/src/theme-root.directive.mjs +12 -6
- package/fesm2015/danske-sapphire-angular.mjs +10 -3
- package/fesm2015/danske-sapphire-angular.mjs.map +1 -1
- package/fesm2020/danske-sapphire-angular.mjs +8 -3
- package/fesm2020/danske-sapphire-angular.mjs.map +1 -1
- package/lib/theme/src/theme-root.directive.d.ts +3 -2
- package/package.json +3 -3
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { Directive } from '@angular/core';
|
|
1
|
+
import { Directive, Optional, SkipSelf } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "./theme-
|
|
3
|
+
import * as i1 from "./top-level-theme-ref.service";
|
|
4
|
+
import * as i2 from "./theme-base.directive";
|
|
4
5
|
/**
|
|
5
6
|
* Applies the current theme style on an element which is not under the rendered
|
|
6
7
|
* sp-theme, in DOM tree. Useful for non-Sapphire portal components that render things in body.
|
|
7
8
|
*
|
|
8
9
|
*/
|
|
9
10
|
export class ThemeRootDirective {
|
|
10
|
-
constructor(elementRef,
|
|
11
|
+
constructor(elementRef, themeRef, parentTheme) {
|
|
12
|
+
const theme = parentTheme || themeRef.theme;
|
|
11
13
|
theme.applyOnDomNode(elementRef.nativeElement);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
|
-
ThemeRootDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ThemeRootDirective, deps: [{ token: i0.ElementRef }, { token: i1.ThemeBaseDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
16
|
+
ThemeRootDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ThemeRootDirective, deps: [{ token: i0.ElementRef }, { token: i1.TopLevelThemeRef }, { token: i2.ThemeBaseDirective, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
15
17
|
ThemeRootDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.0", type: ThemeRootDirective, isStandalone: true, selector: "[sp-theme-root]", ngImport: i0 });
|
|
16
18
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ThemeRootDirective, decorators: [{
|
|
17
19
|
type: Directive,
|
|
@@ -19,5 +21,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
|
|
|
19
21
|
selector: '[sp-theme-root]',
|
|
20
22
|
standalone: true,
|
|
21
23
|
}]
|
|
22
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.
|
|
23
|
-
|
|
24
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.TopLevelThemeRef }, { type: i2.ThemeBaseDirective, decorators: [{
|
|
25
|
+
type: Optional
|
|
26
|
+
}, {
|
|
27
|
+
type: SkipSelf
|
|
28
|
+
}] }]; } });
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWUtcm9vdC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbGliL3RoZW1lL3NyYy90aGVtZS1yb290LmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFjLFFBQVEsRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7Ozs7QUFJMUU7Ozs7R0FJRztBQUtILE1BQU0sT0FBTyxrQkFBa0I7SUFDN0IsWUFDRSxVQUFzQixFQUN0QixRQUEwQixFQUNGLFdBQStCO1FBRXZELE1BQU0sS0FBSyxHQUFHLFdBQVcsSU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GhlbWVSZWY6IFRvcExldmVsVGhlbWVSZWYsXG4gICAgQE9wdGlvbmFsKCkgQFNraXBTZWxmKCkgcGFyZW50VGhlbWU6IFRoZW1lQmFzZURpcmVjdGl2ZVxuICApIHtcbiAgICBjb25zdCB0aGVtZSA9IHBhcmVudFRoZW1lIHx8IHRoZW1lUmVmLnRoZW1lO1xuICAgIHRoZW1lLmFwcGx5T25Eb21Ob2RlKGVsZW1lbnRSZWYubmF0aXZlRWxlbWVudCk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -6518,11 +6518,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
|
|
|
6518
6518
|
*
|
|
6519
6519
|
*/
|
|
6520
6520
|
class ThemeRootDirective {
|
|
6521
|
-
constructor(elementRef,
|
|
6521
|
+
constructor(elementRef, themeRef, parentTheme) {
|
|
6522
|
+
const theme = parentTheme || themeRef.theme;
|
|
6522
6523
|
theme.applyOnDomNode(elementRef.nativeElement);
|
|
6523
6524
|
}
|
|
6524
6525
|
}
|
|
6525
|
-
ThemeRootDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ThemeRootDirective, deps: [{ token: i0.ElementRef }, { token: ThemeBaseDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6526
|
+
ThemeRootDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ThemeRootDirective, deps: [{ token: i0.ElementRef }, { token: TopLevelThemeRef }, { token: ThemeBaseDirective, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6526
6527
|
ThemeRootDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.0", type: ThemeRootDirective, isStandalone: true, selector: "[sp-theme-root]", ngImport: i0 });
|
|
6527
6528
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: ThemeRootDirective, decorators: [{
|
|
6528
6529
|
type: Directive,
|
|
@@ -6530,7 +6531,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
|
|
|
6530
6531
|
selector: '[sp-theme-root]',
|
|
6531
6532
|
standalone: true,
|
|
6532
6533
|
}]
|
|
6533
|
-
}], ctorParameters: function () {
|
|
6534
|
+
}], ctorParameters: function () {
|
|
6535
|
+
return [{ type: i0.ElementRef }, { type: TopLevelThemeRef }, { type: ThemeBaseDirective, decorators: [{
|
|
6536
|
+
type: Optional
|
|
6537
|
+
}, {
|
|
6538
|
+
type: SkipSelf
|
|
6539
|
+
}] }];
|
|
6540
|
+
} });
|
|
6534
6541
|
|
|
6535
6542
|
/**
|
|
6536
6543
|
* - Makes sure currently applied theme is applied on overlays which are rendered as portal
|