@ts-core/angular 13.1.17 → 13.1.18
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/cookie/CookieService.d.ts +4 -2
- package/esm2020/cookie/CookieModule.mjs +2 -2
- package/esm2020/cookie/CookieService.mjs +13 -7
- package/esm2020/theme/ThemeModule.mjs +2 -2
- package/fesm2015/ts-core-angular.mjs +14 -8
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +14 -8
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1771,19 +1771,17 @@ class CookieService extends Cookie.CookieService {
|
|
|
1771
1771
|
// Constructor
|
|
1772
1772
|
//
|
|
1773
1773
|
// --------------------------------------------------------------------------
|
|
1774
|
-
constructor(options,
|
|
1774
|
+
constructor(options, platform, item) {
|
|
1775
1775
|
super({ options });
|
|
1776
|
-
|
|
1776
|
+
this._document = !_.isNil(item) ? item : document;
|
|
1777
1777
|
let cookieString = '';
|
|
1778
1778
|
Object.defineProperty(this, 'cookieString', {
|
|
1779
1779
|
get: () => {
|
|
1780
|
-
|
|
1781
|
-
return platform.isPlatformBrowser ? nativeWindow.document.cookie : cookieString;
|
|
1780
|
+
return platform.isPlatformBrowser ? this.document.cookie : cookieString;
|
|
1782
1781
|
},
|
|
1783
1782
|
set: (value) => {
|
|
1784
|
-
console.log('cookieSet', platform.isPlatformBrowser);
|
|
1785
1783
|
if (platform.isPlatformBrowser) {
|
|
1786
|
-
|
|
1784
|
+
this.document.cookie = value;
|
|
1787
1785
|
}
|
|
1788
1786
|
else {
|
|
1789
1787
|
cookieString = value;
|
|
@@ -1826,6 +1824,14 @@ class CookieService extends Cookie.CookieService {
|
|
|
1826
1824
|
this.remove(key);
|
|
1827
1825
|
}
|
|
1828
1826
|
}
|
|
1827
|
+
// --------------------------------------------------------------------------
|
|
1828
|
+
//
|
|
1829
|
+
// Private Properties
|
|
1830
|
+
//
|
|
1831
|
+
// --------------------------------------------------------------------------
|
|
1832
|
+
get document() {
|
|
1833
|
+
return this._document;
|
|
1834
|
+
}
|
|
1829
1835
|
}
|
|
1830
1836
|
|
|
1831
1837
|
class PlatformService extends DestroyableContainer {
|
|
@@ -1898,7 +1904,7 @@ function cookieServiceFactory(nativeWindow, platform, options) {
|
|
|
1898
1904
|
secure: false,
|
|
1899
1905
|
httpOnly: false
|
|
1900
1906
|
}, options);
|
|
1901
|
-
return new CookieService(options,
|
|
1907
|
+
return new CookieService(options, platform, nativeWindow.document);
|
|
1902
1908
|
}
|
|
1903
1909
|
const COOKIE_OPTIONS = new InjectionToken(`COOKIE_OPTIONS`);
|
|
1904
1910
|
|
|
@@ -6916,7 +6922,7 @@ function themeServiceFactory(nativeWindow, cookie, options) {
|
|
|
6916
6922
|
if (!_.isNil(options) && _.isNil(options.service)) {
|
|
6917
6923
|
options.service = cookie;
|
|
6918
6924
|
}
|
|
6919
|
-
return new ThemeService(
|
|
6925
|
+
return new ThemeService(options, nativeWindow.document);
|
|
6920
6926
|
}
|
|
6921
6927
|
function themeAssetServiceFactory(theme) {
|
|
6922
6928
|
return new ThemeAssetService(theme);
|