@ts-core/angular 13.0.11 → 13.0.12
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.
|
@@ -188,6 +188,7 @@ class ViewUtil {
|
|
|
188
188
|
return value;
|
|
189
189
|
}
|
|
190
190
|
static selectContent(container, isNeedCopyToClipboard = false) {
|
|
191
|
+
container = ViewUtil.parseElement(container);
|
|
191
192
|
if (container instanceof HTMLInputElement || container instanceof HTMLTextAreaElement) {
|
|
192
193
|
let isWasDisabled = container.disabled;
|
|
193
194
|
if (isWasDisabled) {
|
|
@@ -272,6 +273,7 @@ class ViewUtil {
|
|
|
272
273
|
return window.innerHeight || document.body.clientHeight;
|
|
273
274
|
}
|
|
274
275
|
static getWidth(container) {
|
|
276
|
+
container = ViewUtil.parseElement(container);
|
|
275
277
|
if (_.isNil(container)) {
|
|
276
278
|
return NaN;
|
|
277
279
|
}
|
|
@@ -290,7 +292,6 @@ class ViewUtil {
|
|
|
290
292
|
}
|
|
291
293
|
if (isNeedCheckLimits && (value < ViewUtil.getMinWidth(container) || value > ViewUtil.getMaxWidth(container) || value === ViewUtil.getWidth(container)))
|
|
292
294
|
return false;
|
|
293
|
-
container.style.width = '540px';
|
|
294
295
|
ViewUtil.setStyle(container, 'width', value + 'px');
|
|
295
296
|
return true;
|
|
296
297
|
}
|
|
@@ -315,6 +316,7 @@ class ViewUtil {
|
|
|
315
316
|
return value;
|
|
316
317
|
}
|
|
317
318
|
static getHeight(container) {
|
|
319
|
+
container = ViewUtil.parseElement(container);
|
|
318
320
|
if (_.isNil(container)) {
|
|
319
321
|
return NaN;
|
|
320
322
|
}
|
|
@@ -460,48 +462,39 @@ class ViewUtil {
|
|
|
460
462
|
return !_.isNil(container) ? container[name] : null;
|
|
461
463
|
}
|
|
462
464
|
static setProperty(container, name, value) {
|
|
463
|
-
if (_.isNil(name)) {
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
465
|
container = ViewUtil.parseElement(container);
|
|
467
|
-
if (
|
|
468
|
-
|
|
466
|
+
if (_.isNil(name) || _.isNil(container)) {
|
|
467
|
+
return;
|
|
469
468
|
}
|
|
469
|
+
ViewUtil.RENDERER.setProperty(container, name, value);
|
|
470
470
|
}
|
|
471
471
|
static removeProperty(container, name) {
|
|
472
472
|
ViewUtil.removeAttribute(container, name);
|
|
473
473
|
}
|
|
474
474
|
static removeAttribute(container, name) {
|
|
475
|
-
if (_.isNil(name)) {
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
475
|
container = ViewUtil.parseElement(container);
|
|
479
|
-
if (
|
|
480
|
-
|
|
476
|
+
if (_.isNil(name) || _.isNil(container)) {
|
|
477
|
+
return;
|
|
481
478
|
}
|
|
479
|
+
ViewUtil.RENDERER.removeAttribute(container, name);
|
|
482
480
|
}
|
|
483
481
|
static setAttribute(container, name, value) {
|
|
484
|
-
if (_.isNil(name)) {
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
482
|
container = ViewUtil.parseElement(container);
|
|
488
|
-
if (
|
|
489
|
-
|
|
483
|
+
if (_.isNil(name) || _.isNil(container)) {
|
|
484
|
+
return;
|
|
490
485
|
}
|
|
486
|
+
ViewUtil.RENDERER.setAttribute(container, name, value);
|
|
491
487
|
}
|
|
492
488
|
static getStyle(container, name) {
|
|
493
|
-
|
|
489
|
+
container = ViewUtil.parseElement(container);
|
|
490
|
+
if (_.isNil(name) || _.isNil(container)) {
|
|
494
491
|
return null;
|
|
495
492
|
}
|
|
496
|
-
container
|
|
497
|
-
return !_.isNil(container) ? container.style[name] : null;
|
|
493
|
+
return container.style[name];
|
|
498
494
|
}
|
|
499
495
|
static setStyle(container, name, value, flags) {
|
|
500
|
-
if (_.isNil(name)) {
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
496
|
container = ViewUtil.parseElement(container);
|
|
504
|
-
if (_.isNil(
|
|
497
|
+
if (_.isNil(name) || _.isNil(container)) {
|
|
505
498
|
return;
|
|
506
499
|
}
|
|
507
500
|
if (value !== ViewUtil.getStyle(container, name)) {
|
|
@@ -509,13 +502,11 @@ class ViewUtil {
|
|
|
509
502
|
}
|
|
510
503
|
}
|
|
511
504
|
static removeStyle(container, name, flags) {
|
|
512
|
-
if (_.isNil(name)) {
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
505
|
container = ViewUtil.parseElement(container);
|
|
516
|
-
if (
|
|
517
|
-
|
|
506
|
+
if (_.isNil(name) || _.isNil(container)) {
|
|
507
|
+
return;
|
|
518
508
|
}
|
|
509
|
+
ViewUtil.RENDERER.removeStyle(container, name, flags);
|
|
519
510
|
}
|
|
520
511
|
// --------------------------------------------------------------------------
|
|
521
512
|
//
|
|
@@ -623,6 +614,7 @@ class ViewUtil {
|
|
|
623
614
|
video.remove();
|
|
624
615
|
}
|
|
625
616
|
static disposeVideos(container) {
|
|
617
|
+
container = ViewUtil.parseElement(container);
|
|
626
618
|
for (let i = container.children.length - 1; i >= 0; i--) {
|
|
627
619
|
let item = container.children.item(i);
|
|
628
620
|
if (item instanceof HTMLVideoElement) {
|
|
@@ -636,6 +628,7 @@ class ViewUtil {
|
|
|
636
628
|
//
|
|
637
629
|
// --------------------------------------------------------------------------
|
|
638
630
|
static disposeObjects(container, isIEBrowser) {
|
|
631
|
+
container = ViewUtil.parseElement(container);
|
|
639
632
|
for (let i = container.children.length - 1; i >= 0; i--) {
|
|
640
633
|
let item = container.children.item(i);
|
|
641
634
|
if (item instanceof HTMLObjectElement) {
|