cps-ui-kit 0.28.0 → 0.29.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/README.md +2 -1
- package/assets/icons.svg +139 -323
- package/esm2020/lib/components/cps-icon/cps-icon.component.mjs +2 -1
- package/esm2020/lib/components/cps-info-circle/cps-info-circle.component.mjs +24 -0
- package/esm2020/lib/directives/cps-tooltip.directive.mjs +34 -14
- package/esm2020/public-api.mjs +3 -2
- package/fesm2015/cps-ui-kit.mjs +242 -201
- package/fesm2015/cps-ui-kit.mjs.map +1 -1
- package/fesm2020/cps-ui-kit.mjs +240 -199
- package/fesm2020/cps-ui-kit.mjs.map +1 -1
- package/lib/components/cps-info-circle/cps-info-circle.component.d.ts +10 -0
- package/lib/directives/cps-tooltip.directive.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -1
- package/styles/cps-tooltip-style.scss +2 -0
package/fesm2020/cps-ui-kit.mjs
CHANGED
|
@@ -145,6 +145,7 @@ const iconNames = [
|
|
|
145
145
|
'heart',
|
|
146
146
|
'help-circle',
|
|
147
147
|
'home',
|
|
148
|
+
'info-circle',
|
|
148
149
|
'insight',
|
|
149
150
|
'issues',
|
|
150
151
|
'jpeg',
|
|
@@ -2208,6 +2209,244 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
2208
2209
|
args: ['treeAutocompleteList']
|
|
2209
2210
|
}] } });
|
|
2210
2211
|
|
|
2212
|
+
class CpsTooltipDirective {
|
|
2213
|
+
// eslint-disable-next-line no-useless-constructor
|
|
2214
|
+
constructor(_elementRef) {
|
|
2215
|
+
this._elementRef = _elementRef;
|
|
2216
|
+
this.tooltipOpenDelay = 300;
|
|
2217
|
+
this.tooltipCloseDelay = 300;
|
|
2218
|
+
this.tooltipOpenOn = 'hover';
|
|
2219
|
+
this.tooltipPosition = 'top';
|
|
2220
|
+
this.tooltipPersistent = false;
|
|
2221
|
+
this.tooltipDisabled = false;
|
|
2222
|
+
this.tooltipMaxWidth = '100%';
|
|
2223
|
+
this.tooltipContentClass = 'cps-tooltip-content';
|
|
2224
|
+
this._createTooltip = () => {
|
|
2225
|
+
if (this._popup)
|
|
2226
|
+
return;
|
|
2227
|
+
if (this.tooltipDisabled)
|
|
2228
|
+
return;
|
|
2229
|
+
this._popup = document.createElement('div');
|
|
2230
|
+
this._constructElement(this._popup);
|
|
2231
|
+
if (this.tooltipPersistent)
|
|
2232
|
+
this._popup.addEventListener('click', this._destroyTooltip);
|
|
2233
|
+
window.addEventListener('scroll', this._destroyTooltip, true);
|
|
2234
|
+
};
|
|
2235
|
+
this._destroyTooltip = (event = undefined) => {
|
|
2236
|
+
const removeFromDOM = () => {
|
|
2237
|
+
this._popup?.remove();
|
|
2238
|
+
this._popup = undefined;
|
|
2239
|
+
};
|
|
2240
|
+
window.removeEventListener('scroll', this._destroyTooltip, true);
|
|
2241
|
+
if (!this._popup)
|
|
2242
|
+
return;
|
|
2243
|
+
this._popup.removeEventListener('click', this._destroyTooltip);
|
|
2244
|
+
const noAnimation = ['scroll', 'resize'].includes(event?.type);
|
|
2245
|
+
if (noAnimation) {
|
|
2246
|
+
removeFromDOM();
|
|
2247
|
+
}
|
|
2248
|
+
else {
|
|
2249
|
+
const popup = this._popup;
|
|
2250
|
+
requestAnimationFrame(function () {
|
|
2251
|
+
popup.style.opacity = '0';
|
|
2252
|
+
});
|
|
2253
|
+
setTimeout(() => {
|
|
2254
|
+
removeFromDOM();
|
|
2255
|
+
}, 200);
|
|
2256
|
+
}
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
ngOnDestroy() {
|
|
2260
|
+
this._destroyTooltip();
|
|
2261
|
+
}
|
|
2262
|
+
_constructElement(popup) {
|
|
2263
|
+
const popupContent = document.createElement('div');
|
|
2264
|
+
popupContent.innerHTML = this.tooltip || 'Add your text to this tooltip';
|
|
2265
|
+
popupContent.classList.add(this.tooltipContentClass);
|
|
2266
|
+
popup.appendChild(popupContent);
|
|
2267
|
+
popup.classList.add('cps-tooltip');
|
|
2268
|
+
popup.style.maxWidth = convertSize(this.tooltipMaxWidth);
|
|
2269
|
+
document.body.appendChild(popup);
|
|
2270
|
+
requestAnimationFrame(function () {
|
|
2271
|
+
popup.style.opacity = '1';
|
|
2272
|
+
});
|
|
2273
|
+
const coords = this._getCoords();
|
|
2274
|
+
if (!coords) {
|
|
2275
|
+
this._destroyTooltip();
|
|
2276
|
+
throw new Error('Not enough space on the screen for the tooltip!');
|
|
2277
|
+
}
|
|
2278
|
+
popup.style.left = coords.left.toString() + 'px';
|
|
2279
|
+
popup.style.top = coords.top.toString() + 'px';
|
|
2280
|
+
}
|
|
2281
|
+
_getCoords() {
|
|
2282
|
+
function isInsideScreen(coords) {
|
|
2283
|
+
return (coords.top >= 0 &&
|
|
2284
|
+
coords.left >= 0 &&
|
|
2285
|
+
coords.left + popupRect.width <= window.innerWidth &&
|
|
2286
|
+
coords.top + popupRect.height <= window.innerHeight);
|
|
2287
|
+
}
|
|
2288
|
+
let positions = ['top', 'bottom', 'left', 'right'];
|
|
2289
|
+
positions = positions.filter((item) => item !== this.tooltipPosition);
|
|
2290
|
+
positions.unshift(this.tooltipPosition);
|
|
2291
|
+
const targetEl = this._elementRef.nativeElement;
|
|
2292
|
+
const targetElRect = targetEl.getBoundingClientRect();
|
|
2293
|
+
const popupRect = this._popup.getBoundingClientRect();
|
|
2294
|
+
for (const pos of positions) {
|
|
2295
|
+
const coords = this._getCoordsForPosition(pos, targetEl, targetElRect, popupRect);
|
|
2296
|
+
if (isInsideScreen(coords)) {
|
|
2297
|
+
return coords;
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
return undefined;
|
|
2301
|
+
}
|
|
2302
|
+
_getCoordsForPosition(position, targetEl, targetElRect, popupRect) {
|
|
2303
|
+
switch (position) {
|
|
2304
|
+
case 'bottom':
|
|
2305
|
+
return {
|
|
2306
|
+
left: targetElRect.left +
|
|
2307
|
+
window.scrollX +
|
|
2308
|
+
(targetEl.offsetWidth - popupRect.width) / 2,
|
|
2309
|
+
top: targetElRect.bottom + window.scrollY + 8
|
|
2310
|
+
};
|
|
2311
|
+
case 'left':
|
|
2312
|
+
return {
|
|
2313
|
+
left: targetElRect.left - window.scrollX - popupRect.width - 8,
|
|
2314
|
+
top: targetElRect.top +
|
|
2315
|
+
window.scrollY +
|
|
2316
|
+
(targetEl.offsetHeight - popupRect.height) / 2
|
|
2317
|
+
};
|
|
2318
|
+
case 'right':
|
|
2319
|
+
return {
|
|
2320
|
+
left: targetElRect.right + window.scrollX + 8,
|
|
2321
|
+
top: targetElRect.top +
|
|
2322
|
+
window.scrollY +
|
|
2323
|
+
(targetEl.offsetHeight - popupRect.height) / 2
|
|
2324
|
+
};
|
|
2325
|
+
default:
|
|
2326
|
+
return {
|
|
2327
|
+
left: targetElRect.left +
|
|
2328
|
+
window.scrollX +
|
|
2329
|
+
(targetEl.offsetWidth - popupRect.width) / 2,
|
|
2330
|
+
top: targetElRect.top + window.scrollY - popupRect.height - 8
|
|
2331
|
+
};
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
onMouseEnter() {
|
|
2335
|
+
if (this.tooltipOpenOn === 'hover') {
|
|
2336
|
+
clearTimeout(this._hideTimeout);
|
|
2337
|
+
this._showTimeout = setTimeout(this._createTooltip, this.tooltipOpenDelay);
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
onMouseLeave() {
|
|
2341
|
+
clearTimeout(this._showTimeout);
|
|
2342
|
+
if (!this.tooltipPersistent) {
|
|
2343
|
+
this._hideTimeout = setTimeout(this._destroyTooltip, this.tooltipCloseDelay);
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
onFocus() {
|
|
2347
|
+
if (this.tooltipOpenOn === 'focus') {
|
|
2348
|
+
clearTimeout(this._hideTimeout);
|
|
2349
|
+
this._showTimeout = setTimeout(this._createTooltip, this.tooltipOpenDelay);
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
onBlur() {
|
|
2353
|
+
clearTimeout(this._showTimeout);
|
|
2354
|
+
if (!this.tooltipPersistent && this.tooltipOpenOn === 'focus') {
|
|
2355
|
+
this._hideTimeout = setTimeout(this._destroyTooltip, this.tooltipCloseDelay);
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
onClick() {
|
|
2359
|
+
if (this.tooltipOpenOn === 'click') {
|
|
2360
|
+
clearTimeout(this._hideTimeout);
|
|
2361
|
+
this._showTimeout = setTimeout(this._createTooltip, 0);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
onDocumentClick(target) {
|
|
2365
|
+
if (this.tooltipPersistent && this._popup) {
|
|
2366
|
+
if (!target?.isConnected) {
|
|
2367
|
+
return;
|
|
2368
|
+
}
|
|
2369
|
+
const clickedInside = this._elementRef?.nativeElement?.contains(target);
|
|
2370
|
+
if (!clickedInside) {
|
|
2371
|
+
this._destroyTooltip();
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
onPageResize(event) {
|
|
2376
|
+
if (this._popup)
|
|
2377
|
+
this._destroyTooltip(event);
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
CpsTooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsTooltipDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2381
|
+
CpsTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", 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" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focus": "onFocus()", "blur": "onBlur()", "click": "onClick()", "document:click": "onDocumentClick($event.target)", "window:resize": "onPageResize($event)" } }, ngImport: i0 });
|
|
2382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsTooltipDirective, decorators: [{
|
|
2383
|
+
type: Directive,
|
|
2384
|
+
args: [{
|
|
2385
|
+
selector: '[cpsTooltip]',
|
|
2386
|
+
standalone: true
|
|
2387
|
+
}]
|
|
2388
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { tooltip: [{
|
|
2389
|
+
type: Input,
|
|
2390
|
+
args: ['cpsTooltip']
|
|
2391
|
+
}], tooltipOpenDelay: [{
|
|
2392
|
+
type: Input
|
|
2393
|
+
}], tooltipCloseDelay: [{
|
|
2394
|
+
type: Input
|
|
2395
|
+
}], tooltipOpenOn: [{
|
|
2396
|
+
type: Input
|
|
2397
|
+
}], tooltipPosition: [{
|
|
2398
|
+
type: Input
|
|
2399
|
+
}], tooltipPersistent: [{
|
|
2400
|
+
type: Input
|
|
2401
|
+
}], tooltipDisabled: [{
|
|
2402
|
+
type: Input
|
|
2403
|
+
}], tooltipMaxWidth: [{
|
|
2404
|
+
type: Input
|
|
2405
|
+
}], tooltipContentClass: [{
|
|
2406
|
+
type: Input
|
|
2407
|
+
}], onMouseEnter: [{
|
|
2408
|
+
type: HostListener,
|
|
2409
|
+
args: ['mouseenter']
|
|
2410
|
+
}], onMouseLeave: [{
|
|
2411
|
+
type: HostListener,
|
|
2412
|
+
args: ['mouseleave']
|
|
2413
|
+
}], onFocus: [{
|
|
2414
|
+
type: HostListener,
|
|
2415
|
+
args: ['focus']
|
|
2416
|
+
}], onBlur: [{
|
|
2417
|
+
type: HostListener,
|
|
2418
|
+
args: ['blur']
|
|
2419
|
+
}], onClick: [{
|
|
2420
|
+
type: HostListener,
|
|
2421
|
+
args: ['click']
|
|
2422
|
+
}], onDocumentClick: [{
|
|
2423
|
+
type: HostListener,
|
|
2424
|
+
args: ['document:click', ['$event.target']]
|
|
2425
|
+
}], onPageResize: [{
|
|
2426
|
+
type: HostListener,
|
|
2427
|
+
args: ['window:resize', ['$event']]
|
|
2428
|
+
}] } });
|
|
2429
|
+
|
|
2430
|
+
class CpsInfoCircleComponent {
|
|
2431
|
+
constructor() {
|
|
2432
|
+
this.size = 'small';
|
|
2433
|
+
this.tooltipText = '';
|
|
2434
|
+
this.tooltipPosition = 'top';
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
CpsInfoCircleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsInfoCircleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2438
|
+
CpsInfoCircleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsInfoCircleComponent, isStandalone: true, selector: "cps-info-circle", inputs: { size: "size", tooltipText: "tooltipText", tooltipPosition: "tooltipPosition" }, ngImport: i0, template: "<cps-icon\n icon=\"info-circle\"\n [size]=\"size\"\n color=\"info\"\n [cpsTooltip]=\"tooltipText\"\n tooltipOpenDelay=\"0\"\n tooltipCloseDelay=\"100\"\n [tooltipPosition]=\"tooltipPosition\">\n</cps-icon>\n", styles: [":host{display:inline-flex}\n"], dependencies: [{ kind: "component", type: CpsIconComponent, selector: "cps-icon", inputs: ["icon", "size", "color"] }, { kind: "directive", type: CpsTooltipDirective, selector: "[cpsTooltip]", inputs: ["cpsTooltip", "tooltipOpenDelay", "tooltipCloseDelay", "tooltipOpenOn", "tooltipPosition", "tooltipPersistent", "tooltipDisabled", "tooltipMaxWidth", "tooltipContentClass"] }] });
|
|
2439
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsInfoCircleComponent, decorators: [{
|
|
2440
|
+
type: Component,
|
|
2441
|
+
args: [{ selector: 'cps-info-circle', standalone: true, imports: [CpsIconComponent, CpsTooltipDirective], template: "<cps-icon\n icon=\"info-circle\"\n [size]=\"size\"\n color=\"info\"\n [cpsTooltip]=\"tooltipText\"\n tooltipOpenDelay=\"0\"\n tooltipCloseDelay=\"100\"\n [tooltipPosition]=\"tooltipPosition\">\n</cps-icon>\n", styles: [":host{display:inline-flex}\n"] }]
|
|
2442
|
+
}], propDecorators: { size: [{
|
|
2443
|
+
type: Input
|
|
2444
|
+
}], tooltipText: [{
|
|
2445
|
+
type: Input
|
|
2446
|
+
}], tooltipPosition: [{
|
|
2447
|
+
type: Input
|
|
2448
|
+
}] } });
|
|
2449
|
+
|
|
2211
2450
|
class CpsProgressCircularComponent {
|
|
2212
2451
|
constructor() {
|
|
2213
2452
|
this.diameter = 40;
|
|
@@ -3348,204 +3587,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3348
3587
|
type: Output
|
|
3349
3588
|
}] } });
|
|
3350
3589
|
|
|
3351
|
-
class CpsTooltipDirective {
|
|
3352
|
-
// eslint-disable-next-line no-useless-constructor
|
|
3353
|
-
constructor(_elementRef) {
|
|
3354
|
-
this._elementRef = _elementRef;
|
|
3355
|
-
this.tooltipOpenDelay = 300;
|
|
3356
|
-
this.tooltipCloseDelay = 300;
|
|
3357
|
-
this.tooltipOpenOn = 'hover';
|
|
3358
|
-
this.tooltipPosition = 'top';
|
|
3359
|
-
this.tooltipPersistent = false;
|
|
3360
|
-
this.tooltipDisabled = false;
|
|
3361
|
-
this.tooltipMaxWidth = '100%';
|
|
3362
|
-
this.tooltipContentClass = 'cps-tooltip-content';
|
|
3363
|
-
this._createTooltip = () => {
|
|
3364
|
-
if (this._popup)
|
|
3365
|
-
this._destroyTooltip();
|
|
3366
|
-
if (this.tooltipDisabled)
|
|
3367
|
-
return;
|
|
3368
|
-
this._popup = document.createElement('div');
|
|
3369
|
-
this._constructElement(this._popup);
|
|
3370
|
-
if (this.tooltipPersistent)
|
|
3371
|
-
this._popup.addEventListener('click', this._destroyTooltip);
|
|
3372
|
-
window.addEventListener('scroll', this._destroyTooltip, true);
|
|
3373
|
-
};
|
|
3374
|
-
this._destroyTooltip = () => {
|
|
3375
|
-
window.removeEventListener('scroll', this._destroyTooltip, true);
|
|
3376
|
-
this._popup?.removeEventListener('click', this._destroyTooltip);
|
|
3377
|
-
this._popup?.remove();
|
|
3378
|
-
this._popup = undefined;
|
|
3379
|
-
};
|
|
3380
|
-
}
|
|
3381
|
-
ngOnDestroy() {
|
|
3382
|
-
this._destroyTooltip();
|
|
3383
|
-
}
|
|
3384
|
-
_constructElement(popup) {
|
|
3385
|
-
const popupContent = document.createElement('div');
|
|
3386
|
-
popupContent.innerHTML = this.tooltip || 'Add your text to this tooltip';
|
|
3387
|
-
popupContent.classList.add(this.tooltipContentClass);
|
|
3388
|
-
popup.appendChild(popupContent);
|
|
3389
|
-
popup.classList.add('cps-tooltip');
|
|
3390
|
-
popup.style.maxWidth = convertSize(this.tooltipMaxWidth);
|
|
3391
|
-
document.body.appendChild(popup);
|
|
3392
|
-
const coords = this._getCoords();
|
|
3393
|
-
if (!coords) {
|
|
3394
|
-
this._destroyTooltip();
|
|
3395
|
-
throw new Error('Not enough space on the screen for the tooltip!');
|
|
3396
|
-
}
|
|
3397
|
-
popup.style.left = coords.left.toString() + 'px';
|
|
3398
|
-
popup.style.top = coords.top.toString() + 'px';
|
|
3399
|
-
}
|
|
3400
|
-
_getCoords() {
|
|
3401
|
-
function isInsideScreen(coords) {
|
|
3402
|
-
return (coords.top >= 0 &&
|
|
3403
|
-
coords.left >= 0 &&
|
|
3404
|
-
coords.left + popupRect.width <= window.innerWidth &&
|
|
3405
|
-
coords.top + popupRect.height <= window.innerHeight);
|
|
3406
|
-
}
|
|
3407
|
-
let positions = ['top', 'bottom', 'left', 'right'];
|
|
3408
|
-
positions = positions.filter((item) => item !== this.tooltipPosition);
|
|
3409
|
-
positions.unshift(this.tooltipPosition);
|
|
3410
|
-
const targetEl = this._elementRef.nativeElement;
|
|
3411
|
-
const targetElRect = targetEl.getBoundingClientRect();
|
|
3412
|
-
const popupRect = this._popup.getBoundingClientRect();
|
|
3413
|
-
for (const pos of positions) {
|
|
3414
|
-
const coords = this._getCoordsForPosition(pos, targetEl, targetElRect, popupRect);
|
|
3415
|
-
if (isInsideScreen(coords)) {
|
|
3416
|
-
return coords;
|
|
3417
|
-
}
|
|
3418
|
-
}
|
|
3419
|
-
return undefined;
|
|
3420
|
-
}
|
|
3421
|
-
_getCoordsForPosition(position, targetEl, targetElRect, popupRect) {
|
|
3422
|
-
switch (position) {
|
|
3423
|
-
case 'bottom':
|
|
3424
|
-
return {
|
|
3425
|
-
left: targetElRect.left +
|
|
3426
|
-
window.scrollX +
|
|
3427
|
-
(targetEl.offsetWidth - popupRect.width) / 2,
|
|
3428
|
-
top: targetElRect.bottom + window.scrollY + 8
|
|
3429
|
-
};
|
|
3430
|
-
case 'left':
|
|
3431
|
-
return {
|
|
3432
|
-
left: targetElRect.left - window.scrollX - popupRect.width - 8,
|
|
3433
|
-
top: targetElRect.top +
|
|
3434
|
-
window.scrollY +
|
|
3435
|
-
(targetEl.offsetHeight - popupRect.height) / 2
|
|
3436
|
-
};
|
|
3437
|
-
case 'right':
|
|
3438
|
-
return {
|
|
3439
|
-
left: targetElRect.right + window.scrollX + 8,
|
|
3440
|
-
top: targetElRect.top +
|
|
3441
|
-
window.scrollY +
|
|
3442
|
-
(targetEl.offsetHeight - popupRect.height) / 2
|
|
3443
|
-
};
|
|
3444
|
-
default:
|
|
3445
|
-
return {
|
|
3446
|
-
left: targetElRect.left +
|
|
3447
|
-
window.scrollX +
|
|
3448
|
-
(targetEl.offsetWidth - popupRect.width) / 2,
|
|
3449
|
-
top: targetElRect.top + window.scrollY - popupRect.height - 8
|
|
3450
|
-
};
|
|
3451
|
-
}
|
|
3452
|
-
}
|
|
3453
|
-
onMouseEnter() {
|
|
3454
|
-
if (this.tooltipOpenOn === 'hover') {
|
|
3455
|
-
clearTimeout(this._hideTimeout);
|
|
3456
|
-
this._showTimeout = setTimeout(this._createTooltip, this.tooltipOpenDelay);
|
|
3457
|
-
}
|
|
3458
|
-
}
|
|
3459
|
-
onMouseLeave() {
|
|
3460
|
-
clearTimeout(this._showTimeout);
|
|
3461
|
-
if (!this.tooltipPersistent) {
|
|
3462
|
-
this._hideTimeout = setTimeout(this._destroyTooltip, this.tooltipCloseDelay);
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3465
|
-
onFocus() {
|
|
3466
|
-
if (this.tooltipOpenOn === 'focus') {
|
|
3467
|
-
clearTimeout(this._hideTimeout);
|
|
3468
|
-
this._showTimeout = setTimeout(this._createTooltip, this.tooltipOpenDelay);
|
|
3469
|
-
}
|
|
3470
|
-
}
|
|
3471
|
-
onBlur() {
|
|
3472
|
-
clearTimeout(this._showTimeout);
|
|
3473
|
-
if (!this.tooltipPersistent && this.tooltipOpenOn === 'focus') {
|
|
3474
|
-
this._hideTimeout = setTimeout(this._destroyTooltip, this.tooltipCloseDelay);
|
|
3475
|
-
}
|
|
3476
|
-
}
|
|
3477
|
-
onClick() {
|
|
3478
|
-
if (this.tooltipOpenOn === 'click') {
|
|
3479
|
-
clearTimeout(this._hideTimeout);
|
|
3480
|
-
this._showTimeout = setTimeout(this._createTooltip, 0);
|
|
3481
|
-
}
|
|
3482
|
-
}
|
|
3483
|
-
onPageResize() {
|
|
3484
|
-
if (this._popup)
|
|
3485
|
-
this._destroyTooltip();
|
|
3486
|
-
}
|
|
3487
|
-
onDocumentClick(target) {
|
|
3488
|
-
if (this.tooltipPersistent && this._popup) {
|
|
3489
|
-
if (!target?.isConnected) {
|
|
3490
|
-
return;
|
|
3491
|
-
}
|
|
3492
|
-
const clickedInside = this._elementRef?.nativeElement?.contains(target);
|
|
3493
|
-
if (!clickedInside) {
|
|
3494
|
-
this._destroyTooltip();
|
|
3495
|
-
}
|
|
3496
|
-
}
|
|
3497
|
-
}
|
|
3498
|
-
}
|
|
3499
|
-
CpsTooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsTooltipDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
3500
|
-
CpsTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", 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" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focus": "onFocus()", "blur": "onBlur()", "click": "onClick()", "window:resize": "onPageResize()", "document:click": "onDocumentClick($event.target)" } }, ngImport: i0 });
|
|
3501
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsTooltipDirective, decorators: [{
|
|
3502
|
-
type: Directive,
|
|
3503
|
-
args: [{
|
|
3504
|
-
selector: '[cpsTooltip]',
|
|
3505
|
-
standalone: true
|
|
3506
|
-
}]
|
|
3507
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { tooltip: [{
|
|
3508
|
-
type: Input,
|
|
3509
|
-
args: ['cpsTooltip']
|
|
3510
|
-
}], tooltipOpenDelay: [{
|
|
3511
|
-
type: Input
|
|
3512
|
-
}], tooltipCloseDelay: [{
|
|
3513
|
-
type: Input
|
|
3514
|
-
}], tooltipOpenOn: [{
|
|
3515
|
-
type: Input
|
|
3516
|
-
}], tooltipPosition: [{
|
|
3517
|
-
type: Input
|
|
3518
|
-
}], tooltipPersistent: [{
|
|
3519
|
-
type: Input
|
|
3520
|
-
}], tooltipDisabled: [{
|
|
3521
|
-
type: Input
|
|
3522
|
-
}], tooltipMaxWidth: [{
|
|
3523
|
-
type: Input
|
|
3524
|
-
}], tooltipContentClass: [{
|
|
3525
|
-
type: Input
|
|
3526
|
-
}], onMouseEnter: [{
|
|
3527
|
-
type: HostListener,
|
|
3528
|
-
args: ['mouseenter']
|
|
3529
|
-
}], onMouseLeave: [{
|
|
3530
|
-
type: HostListener,
|
|
3531
|
-
args: ['mouseleave']
|
|
3532
|
-
}], onFocus: [{
|
|
3533
|
-
type: HostListener,
|
|
3534
|
-
args: ['focus']
|
|
3535
|
-
}], onBlur: [{
|
|
3536
|
-
type: HostListener,
|
|
3537
|
-
args: ['blur']
|
|
3538
|
-
}], onClick: [{
|
|
3539
|
-
type: HostListener,
|
|
3540
|
-
args: ['click']
|
|
3541
|
-
}], onPageResize: [{
|
|
3542
|
-
type: HostListener,
|
|
3543
|
-
args: ['window:resize']
|
|
3544
|
-
}], onDocumentClick: [{
|
|
3545
|
-
type: HostListener,
|
|
3546
|
-
args: ['document:click', ['$event.target']]
|
|
3547
|
-
}] } });
|
|
3548
|
-
|
|
3549
3590
|
class CpsButtonToggleComponent {
|
|
3550
3591
|
set value(value) {
|
|
3551
3592
|
this._value = value;
|
|
@@ -3660,5 +3701,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3660
3701
|
* Generated bundle index. Do not edit.
|
|
3661
3702
|
*/
|
|
3662
3703
|
|
|
3663
|
-
export { CpsAutocompleteComponent, CpsButtonComponent, CpsButtonToggleComponent, CpsCheckboxComponent, CpsChipComponent, CpsDatepickerComponent, CpsExpansionPanelComponent, CpsIconComponent, CpsInputComponent, CpsLoaderComponent, CpsProgressCircularComponent, CpsProgressLinearComponent, CpsRadioComponent, CpsSelectComponent, CpsTableColumnSortableDirective, CpsTableComponent, CpsTagComponent, CpsTextareaComponent, CpsTooltipDirective, CpsTreeAutocompleteComponent, CpsTreeSelectComponent, getCSSColor, getCpsColors, getTextColor, iconNames, tableFactory };
|
|
3704
|
+
export { CpsAutocompleteComponent, CpsButtonComponent, CpsButtonToggleComponent, CpsCheckboxComponent, CpsChipComponent, CpsDatepickerComponent, CpsExpansionPanelComponent, CpsIconComponent, CpsInfoCircleComponent, CpsInputComponent, CpsLoaderComponent, CpsProgressCircularComponent, CpsProgressLinearComponent, CpsRadioComponent, CpsSelectComponent, CpsTableColumnSortableDirective, CpsTableComponent, CpsTagComponent, CpsTextareaComponent, CpsTooltipDirective, CpsTreeAutocompleteComponent, CpsTreeSelectComponent, getCSSColor, getCpsColors, getTextColor, iconNames, tableFactory };
|
|
3664
3705
|
//# sourceMappingURL=cps-ui-kit.mjs.map
|