@ts-core/angular 15.0.51 → 15.0.52
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/service/RouterBaseService.mjs +4 -1
- package/esm2020/util/ViewUtil.mjs +15 -4
- package/fesm2015/ts-core-angular.mjs +17 -3
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +17 -3
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/util/ViewUtil.d.ts +3 -1
|
@@ -296,18 +296,22 @@ class ViewUtil {
|
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
static setBackground(container, image, repeat = 'repeat') {
|
|
299
|
+
static setBackground(container, image, repeat = 'repeat', error) {
|
|
300
300
|
if (_.isNil(image)) {
|
|
301
301
|
ViewUtil.removeStyle(container, 'backgroundImage');
|
|
302
302
|
ViewUtil.removeStyle(container, 'backgroundRepeat');
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
image = ViewUtil.getBackgroundUrl(image);
|
|
306
|
+
if (!_.isEmpty(error)) {
|
|
307
|
+
image += `, ${ViewUtil.getBackgroundUrl(error)}`;
|
|
307
308
|
}
|
|
308
309
|
ViewUtil.setStyle(container, 'backgroundImage', image);
|
|
309
310
|
ViewUtil.setStyle(container, 'backgroundRepeat', repeat);
|
|
310
311
|
}
|
|
312
|
+
static getBackgroundUrl(item) {
|
|
313
|
+
return !item.includes('url(') ? `url(${item})` : item;
|
|
314
|
+
}
|
|
311
315
|
// --------------------------------------------------------------------------
|
|
312
316
|
//
|
|
313
317
|
// Child Methods
|
|
@@ -593,6 +597,13 @@ class ViewUtil {
|
|
|
593
597
|
static removeProperty(container, name) {
|
|
594
598
|
ViewUtil.removeAttribute(container, name);
|
|
595
599
|
}
|
|
600
|
+
static getAttribute(container, name) {
|
|
601
|
+
if (_.isNil(name)) {
|
|
602
|
+
return null;
|
|
603
|
+
}
|
|
604
|
+
container = ViewUtil.parseElement(container);
|
|
605
|
+
return !_.isNil(container) ? container.getAttribute(name) : null;
|
|
606
|
+
}
|
|
596
607
|
static removeAttribute(container, name) {
|
|
597
608
|
container = ViewUtil.parseElement(container);
|
|
598
609
|
if (_.isNil(name) || _.isNil(container)) {
|
|
@@ -4862,6 +4873,9 @@ class RouterBaseService extends Loadable {
|
|
|
4862
4873
|
if (_.isNil(snapshot)) {
|
|
4863
4874
|
snapshot = this.route.snapshot;
|
|
4864
4875
|
}
|
|
4876
|
+
if (_.isNil(defaultValue)) {
|
|
4877
|
+
defaultValue = null;
|
|
4878
|
+
}
|
|
4865
4879
|
return !_.isNil(snapshot.fragment) ? snapshot.fragment : defaultValue;
|
|
4866
4880
|
}
|
|
4867
4881
|
hasFragment(snapshot) {
|