cps-ui-kit 19.2.0 → 19.4.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/fesm2022/cps-ui-kit.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i2 from '@angular/common';
|
|
2
2
|
import { DOCUMENT, CommonModule, isPlatformBrowser } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, Inject, Input, Directive, HostListener, EventEmitter, Self, Optional, Output, ViewChild, Pipe, PLATFORM_ID, ChangeDetectionStrategy, ViewEncapsulation, HostBinding, InjectionToken, Host, ViewChildren, ContentChild, RendererStyleFlags2, TemplateRef, ContentChildren, numberAttribute, input, computed, createComponent, createEnvironmentInjector, Injectable, SkipSelf } from '@angular/core';
|
|
4
|
+
import { Component, Inject, Input, inject, ElementRef, SecurityContext, Directive, HostListener, EventEmitter, Self, Optional, Output, ViewChild, Pipe, PLATFORM_ID, ChangeDetectionStrategy, ViewEncapsulation, HostBinding, InjectionToken, Host, ViewChildren, ContentChild, RendererStyleFlags2, TemplateRef, ContentChildren, numberAttribute, input, computed, createComponent, createEnvironmentInjector, Injectable, SkipSelf } from '@angular/core';
|
|
5
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
6
|
import * as i1 from '@angular/forms';
|
|
6
7
|
import { FormsModule, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
7
8
|
import { isEqual, cloneDeep } from 'lodash-es';
|
|
@@ -386,9 +387,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
386
387
|
* @group Components
|
|
387
388
|
*/
|
|
388
389
|
class CpsTooltipDirective {
|
|
389
|
-
constructor(
|
|
390
|
-
this._elementRef = _elementRef;
|
|
391
|
-
this.document = document;
|
|
390
|
+
constructor() {
|
|
392
391
|
/**
|
|
393
392
|
* Delay to show the tooltip in milliseconds, it can be of type string or number.
|
|
394
393
|
* @group Props
|
|
@@ -434,12 +433,15 @@ class CpsTooltipDirective {
|
|
|
434
433
|
* @group Props
|
|
435
434
|
*/
|
|
436
435
|
this.tooltipOffset = 8;
|
|
436
|
+
this._elementRef = inject((ElementRef));
|
|
437
|
+
this._document = inject(DOCUMENT);
|
|
438
|
+
this._domSanitizer = inject(DomSanitizer);
|
|
437
439
|
this._createTooltip = () => {
|
|
438
440
|
if (this._popup)
|
|
439
441
|
return;
|
|
440
442
|
if (this.tooltipDisabled)
|
|
441
443
|
return;
|
|
442
|
-
this._popup = this.
|
|
444
|
+
this._popup = this._document.createElement('div');
|
|
443
445
|
this._constructElement(this._popup);
|
|
444
446
|
if (this.tooltipPersistent)
|
|
445
447
|
this._popup.addEventListener('click', this._destroyTooltip);
|
|
@@ -468,19 +470,21 @@ class CpsTooltipDirective {
|
|
|
468
470
|
}, 200);
|
|
469
471
|
}
|
|
470
472
|
};
|
|
471
|
-
this.window = this.
|
|
473
|
+
this.window = this._document.defaultView;
|
|
472
474
|
}
|
|
473
475
|
ngOnDestroy() {
|
|
474
476
|
this._destroyTooltip();
|
|
475
477
|
}
|
|
476
478
|
_constructElement(popup) {
|
|
477
|
-
const popupContent = this.
|
|
478
|
-
popupContent.innerHTML =
|
|
479
|
+
const popupContent = this._document.createElement('div');
|
|
480
|
+
popupContent.innerHTML =
|
|
481
|
+
this._domSanitizer.sanitize(SecurityContext.HTML, this.tooltip) ||
|
|
482
|
+
'Add your text to this tooltip';
|
|
479
483
|
popupContent.classList.add(this.tooltipContentClass);
|
|
480
484
|
popup.appendChild(popupContent);
|
|
481
485
|
popup.classList.add('cps-tooltip');
|
|
482
486
|
popup.style.maxWidth = convertSize(this.tooltipMaxWidth);
|
|
483
|
-
this.
|
|
487
|
+
this._document.body.appendChild(popup);
|
|
484
488
|
requestAnimationFrame(function () {
|
|
485
489
|
popup.style.opacity = '1';
|
|
486
490
|
});
|
|
@@ -596,7 +600,7 @@ class CpsTooltipDirective {
|
|
|
596
600
|
if (this._popup)
|
|
597
601
|
this._destroyTooltip(event);
|
|
598
602
|
}
|
|
599
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CpsTooltipDirective, deps: [
|
|
603
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CpsTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
600
604
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: CpsTooltipDirective, isStandalone: true, selector: "[cpsTooltip]", inputs: { tooltip: ["cpsTooltip", "tooltip"], tooltipOpenDelay: "tooltipOpenDelay", tooltipCloseDelay: "tooltipCloseDelay", tooltipOpenOn: "tooltipOpenOn", tooltipPosition: "tooltipPosition", tooltipPersistent: "tooltipPersistent", tooltipDisabled: "tooltipDisabled", tooltipMaxWidth: "tooltipMaxWidth", tooltipContentClass: "tooltipContentClass", tooltipOffset: "tooltipOffset" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focus": "onFocus()", "blur": "onBlur()", "click": "onClick()", "document:click": "onDocumentClick($event.target)", "window:resize": "onPageResize($event)" } }, ngImport: i0 }); }
|
|
601
605
|
}
|
|
602
606
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: CpsTooltipDirective, decorators: [{
|
|
@@ -605,10 +609,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
605
609
|
selector: '[cpsTooltip]',
|
|
606
610
|
standalone: true
|
|
607
611
|
}]
|
|
608
|
-
}], ctorParameters: () => [
|
|
609
|
-
type: Inject,
|
|
610
|
-
args: [DOCUMENT]
|
|
611
|
-
}] }], propDecorators: { tooltip: [{
|
|
612
|
+
}], ctorParameters: () => [], propDecorators: { tooltip: [{
|
|
612
613
|
type: Input,
|
|
613
614
|
args: ['cpsTooltip']
|
|
614
615
|
}], tooltipOpenDelay: [{
|
|
@@ -7602,7 +7603,7 @@ class CpsTableComponent {
|
|
|
7602
7603
|
}
|
|
7603
7604
|
}
|
|
7604
7605
|
exportXLSX() {
|
|
7605
|
-
import('xlsx').then((xlsx) => {
|
|
7606
|
+
import('@e965/xlsx').then((xlsx) => {
|
|
7606
7607
|
const sheetData = [
|
|
7607
7608
|
this.selectedColumns.map((c) => c[this.colHeaderName]),
|
|
7608
7609
|
...this.primengTable.value.map((item) => this.selectedColumns.map((c) => item[c[this.colFieldName]]))
|