@syncfusion/ej2-popups
Advanced tools
Comparing version 20.2.49 to 20.3.47-14047
@@ -9,3 +9,4 @@ { | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:jsdoc/recommended" | ||
"plugin:jsdoc/recommended", | ||
"plugin:security/recommended" | ||
], | ||
@@ -22,2 +23,3 @@ "parser": "@typescript-eslint/parser", | ||
"@typescript-eslint/tslint", | ||
"eslint-plugin-security", | ||
"jsdoc" | ||
@@ -27,2 +29,15 @@ ], | ||
"use-isnan": "error", | ||
"security/detect-unsafe-regex":"error", | ||
"security/detect-buffer-noassert":"error", | ||
"security/detect-child-process":"error", | ||
"security/detect-disable-mustache-escape":"error", | ||
"security/detect-eval-with-expression":"error", | ||
"security/detect-no-csrf-before-method-override":"error", | ||
"security/detect-non-literal-fs-filename":"error", | ||
"security/detect-non-literal-regexp":"error", | ||
"security/detect-non-literal-require":"error", | ||
"security/detect-object-injection":"error", | ||
"security/detect-possible-timing-attacks":"error", | ||
"security/detect-pseudoRandomBytes":"error", | ||
"security/detect-new-buffer":"error", | ||
"@typescript-eslint/no-inferrable-types": "off", | ||
@@ -29,0 +44,0 @@ "@typescript-eslint/ban-types": ["warn", { |
@@ -5,2 +5,28 @@ # Changelog | ||
## 21.2.3 (2023-05-03) | ||
### Tooltip | ||
#### Bug Fixes | ||
- `#I446416` - The performance issue in ListView while integrating Tooltip has been resolved. | ||
## 21.1.41 (2023-04-18) | ||
### Tooltip | ||
#### Bug Fixes | ||
- `#I448669` - The issue in Tooltip component while hovering the previous selected item has been resolved. | ||
### Spinner | ||
#### Bug Fixes | ||
- `#I448112` - Now, able to change the Spinner template dynamically. | ||
- `I449008` - Now, Spinner actions on parent element not affecting the child element spinner. | ||
## 21.1.37 (2023-03-29) | ||
### Dialog | ||
@@ -10,2 +36,55 @@ | ||
- `#I446985` - Now, while using the NVDA screen reader, the entire dialog elements will not be read twice. | ||
## 21.1.35 (2023-03-23) | ||
### Tooltip | ||
#### New Features | ||
- `#I434633` - Provided the htmlAttributes support for the Tooltip component which allows to add attributes for the root element of Tooltip popup. | ||
#### Breaking Changes | ||
- The tooltip target's tabindex and aria-describedby attributes, which were handled by the built-in source, were removed. Now, you can add these attributes directly to a target element. | ||
### Dialog | ||
#### New Features | ||
- **State persistence**: Provide support to preserve the updated values of the dialog width and height when performing a page reload. | ||
## 20.4.53 (2023-03-07) | ||
### Dialog | ||
#### Bug Fixes | ||
- `#I441169` - Now, the Dialog Component `ESC` key works properly. | ||
## 20.4.52 (2023-02-28) | ||
### Dialog | ||
#### Bug Fixes | ||
- `#I430348` - Fixed an issue where pressing the enter key triggered the button click event multiple times. | ||
## 20.4.38 (2022-12-21) | ||
### Tooltip | ||
#### Bug Fixes | ||
- `#I415013` - Resolved detached elements memory leak issue in the Tooltip component. | ||
- `#I415386` - The issue "Tooltip did not appear for the second time when using the tab key to focus on the remove icon of the uploader component" has been resolved. | ||
## 20.2.49 (2022-09-13) | ||
### Dialog | ||
#### Bug Fixes | ||
- `#I401514` - Now, when we begin to drag the Utility Dialog, it does not move to the left side. | ||
- `#I400881` - Now, When you set a secondary font color in the bootstrap 5 theme using the theme studio, the changes will be reflected for the Dialog Cancel button. | ||
@@ -12,0 +91,0 @@ |
@@ -1,10 +0,1 @@ | ||
/*! | ||
* filename: index.d.ts | ||
* version : 20.2.49 | ||
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. | ||
* Use of this code is subject to the terms of our license. | ||
* A copy of the current license can be obtained at any time by e-mailing | ||
* licensing@syncfusion.com. Any infringement will be prosecuted under | ||
* applicable laws. | ||
*/ | ||
import * as _popups from '@syncfusion/ej2-popups'; | ||
@@ -11,0 +2,0 @@ |
187
package.json
{ | ||
"_from": "@syncfusion/ej2-popups@*", | ||
"_id": "@syncfusion/ej2-popups@20.2.45", | ||
"_inBundle": false, | ||
"_integrity": "sha512-GcQW12LftB+QMAYlW/yiNdhkmc2q/AtjgA5HMgGHEmQIZv2TKQBQJBo3MzdQwaneNMHmxz3IYRZSxNtCdNFLvw==", | ||
"_location": "/@syncfusion/ej2-popups", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"type": "range", | ||
"registry": true, | ||
"raw": "@syncfusion/ej2-popups@*", | ||
"name": "@syncfusion/ej2-popups", | ||
"escapedName": "@syncfusion%2fej2-popups", | ||
"scope": "@syncfusion", | ||
"rawSpec": "*", | ||
"saveSpec": null, | ||
"fetchSpec": "*" | ||
}, | ||
"_requiredBy": [ | ||
"/", | ||
"/@syncfusion/ej2", | ||
"/@syncfusion/ej2-angular-popups", | ||
"/@syncfusion/ej2-calendars", | ||
"/@syncfusion/ej2-diagrams", | ||
"/@syncfusion/ej2-documenteditor", | ||
"/@syncfusion/ej2-dropdowns", | ||
"/@syncfusion/ej2-filemanager", | ||
"/@syncfusion/ej2-gantt", | ||
"/@syncfusion/ej2-grids", | ||
"/@syncfusion/ej2-inplace-editor", | ||
"/@syncfusion/ej2-inputs", | ||
"/@syncfusion/ej2-kanban", | ||
"/@syncfusion/ej2-navigations", | ||
"/@syncfusion/ej2-notifications", | ||
"/@syncfusion/ej2-pdfviewer", | ||
"/@syncfusion/ej2-pivotview", | ||
"/@syncfusion/ej2-react-popups", | ||
"/@syncfusion/ej2-richtexteditor", | ||
"/@syncfusion/ej2-schedule", | ||
"/@syncfusion/ej2-splitbuttons", | ||
"/@syncfusion/ej2-treegrid", | ||
"/@syncfusion/ej2-vue-popups" | ||
], | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-popups/-/ej2-popups-20.2.45.tgz", | ||
"_shasum": "f287004e5cd29c282e72607b97a2500e3d697e9e", | ||
"_spec": "@syncfusion/ej2-popups@*", | ||
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included", | ||
"author": { | ||
"name": "Syncfusion Inc." | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/issues" | ||
}, | ||
"bundleDependencies": false, | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~20.2.48", | ||
"@syncfusion/ej2-buttons": "~20.2.46" | ||
}, | ||
"deprecated": false, | ||
"description": "A package of Essential JS 2 popup components such as Dialog and Tooltip that is used to display information or messages in separate pop-ups.", | ||
"devDependencies": {}, | ||
"es2015": "./dist/es6/ej2-popups.es2015.js", | ||
"homepage": "https://github.com/syncfusion/ej2-javascript-ui-controls#readme", | ||
"keywords": [ | ||
"ej2", | ||
"syncfusion", | ||
"web-components", | ||
"javascript", | ||
"typescript", | ||
"dialog", | ||
"modal", | ||
"popup", | ||
"alert", | ||
"tooltip", | ||
"hint", | ||
"spinner", | ||
"waiting-popup", | ||
"loading-indicator", | ||
"loader", | ||
"busy-indicator", | ||
"waitingfor-loader" | ||
], | ||
"license": "SEE LICENSE IN license", | ||
"main": "./dist/ej2-popups.umd.min.js", | ||
"module": "./index.js", | ||
"name": "@syncfusion/ej2-popups", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git" | ||
}, | ||
"typings": "index.d.ts", | ||
"version": "20.2.49", | ||
"sideEffects": false | ||
} | ||
"_from": "@syncfusion/ej2-popups@*", | ||
"_id": "@syncfusion/ej2-popups@19.21.6", | ||
"_inBundle": false, | ||
"_integrity": "sha512-tGbvEGrfsBmMdihMtQ8WG2JtNWDu4mLScXwBLS5SiT2K5Ht1Fn0pbIxuUnUVPZ94T6GgqYgV+pH8h34uwSwNKw==", | ||
"_location": "/@syncfusion/ej2-popups", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"type": "range", | ||
"registry": true, | ||
"raw": "@syncfusion/ej2-popups@*", | ||
"name": "@syncfusion/ej2-popups", | ||
"escapedName": "@syncfusion%2fej2-popups", | ||
"scope": "@syncfusion", | ||
"rawSpec": "*", | ||
"saveSpec": null, | ||
"fetchSpec": "*" | ||
}, | ||
"_requiredBy": [ | ||
"/", | ||
"/@syncfusion/ej2", | ||
"/@syncfusion/ej2-angular-popups", | ||
"/@syncfusion/ej2-calendars", | ||
"/@syncfusion/ej2-diagrams", | ||
"/@syncfusion/ej2-documenteditor", | ||
"/@syncfusion/ej2-dropdowns", | ||
"/@syncfusion/ej2-filemanager", | ||
"/@syncfusion/ej2-gantt", | ||
"/@syncfusion/ej2-grids", | ||
"/@syncfusion/ej2-image-editor", | ||
"/@syncfusion/ej2-inplace-editor", | ||
"/@syncfusion/ej2-inputs", | ||
"/@syncfusion/ej2-kanban", | ||
"/@syncfusion/ej2-navigations", | ||
"/@syncfusion/ej2-notifications", | ||
"/@syncfusion/ej2-pdfviewer", | ||
"/@syncfusion/ej2-pivotview", | ||
"/@syncfusion/ej2-react-popups", | ||
"/@syncfusion/ej2-richtexteditor", | ||
"/@syncfusion/ej2-schedule", | ||
"/@syncfusion/ej2-splitbuttons", | ||
"/@syncfusion/ej2-treegrid", | ||
"/@syncfusion/ej2-vue-popups" | ||
], | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-popups/-/ej2-popups-19.21.6.tgz", | ||
"_shasum": "f815fab97e48a9bf09d5337a5f41d733a46f96ea", | ||
"_spec": "@syncfusion/ej2-popups@*", | ||
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included", | ||
"author": { | ||
"name": "Syncfusion Inc." | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/syncfusion/ej2-javascript-ui-controls/issues" | ||
}, | ||
"bundleDependencies": false, | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~20.3.47", | ||
"@syncfusion/ej2-buttons": "~20.3.47" | ||
}, | ||
"deprecated": false, | ||
"description": "A package of Essential JS 2 popup components such as Dialog and Tooltip that is used to display information or messages in separate pop-ups.", | ||
"devDependencies": {}, | ||
"es2015": "./dist/es6/ej2-popups.es5.js", | ||
"homepage": "https://github.com/syncfusion/ej2-javascript-ui-controls#readme", | ||
"keywords": [ | ||
"ej2", | ||
"syncfusion", | ||
"web-components", | ||
"javascript", | ||
"typescript", | ||
"dialog", | ||
"modal", | ||
"popup", | ||
"alert", | ||
"tooltip", | ||
"hint", | ||
"spinner", | ||
"waiting-popup", | ||
"loading-indicator", | ||
"loader", | ||
"busy-indicator", | ||
"waitingfor-loader" | ||
], | ||
"license": "SEE LICENSE IN license", | ||
"main": "./dist/ej2-popups.umd.min.js", | ||
"module": "./index.js", | ||
"name": "@syncfusion/ej2-popups", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git" | ||
}, | ||
"typings": "index.d.ts", | ||
"version": "20.3.47-14047", | ||
"sideEffects": false | ||
} |
@@ -91,2 +91,2 @@ # ej2-popups | ||
© Copyright 2022 Syncfusion, Inc. All Rights Reserved. The Syncfusion Essential Studio license and copyright applies to this distribution. | ||
© Copyright 2019 Syncfusion, Inc. All Rights Reserved. The Syncfusion Essential Studio license and copyright applies to this distribution. |
@@ -142,3 +142,2 @@ /** | ||
} | ||
// eslint-disable-next-line | ||
var tEdge = { TL: null, | ||
@@ -145,0 +144,0 @@ TR: null, |
@@ -49,3 +49,2 @@ /** | ||
export function calculatePosition(currentElement, positionX, positionY, parentElement, targetValues) { | ||
//eslint-disable-next-line | ||
popupRect = undefined; | ||
@@ -134,2 +133,3 @@ popupRect = targetValues; | ||
} | ||
element = null; | ||
return pos; | ||
@@ -136,0 +136,0 @@ } |
@@ -26,3 +26,2 @@ /** | ||
var containerElement; | ||
/* eslint-disable */ | ||
var resizeStart = null; | ||
@@ -177,3 +176,3 @@ var resize = null; | ||
if (this.targetEle && targetElement && targetElement.querySelector('.' + DIALOG_RESIZABLE)) { | ||
containerElement = this.target === 'body' || 'document.body' || document.body ? null : this.targetEle; | ||
containerElement = this.target === ('body' || 'document.body' || document.body) ? null : this.targetEle; | ||
maxWidth = this.targetEle.clientWidth; | ||
@@ -237,2 +236,6 @@ maxHeight = this.targetEle.clientHeight; | ||
calculateValues(); | ||
var dialogResizeElement = targetElement.classList.contains('e-dialog'); | ||
if ((e.target.classList.contains(RESIZE_HANDLER) || e.target.classList.contains('e-dialog-border-resize')) && dialogResizeElement) { | ||
e.target.classList.add(FOCUSED_HANDLER); | ||
} | ||
var coordinates = e.touches ? e.changedTouches[0] : e; | ||
@@ -251,3 +254,3 @@ originalMouseX = coordinates.pageX; | ||
EventHandler.add(target, touchMoveEvent, onMouseMove, this); | ||
EventHandler.add(document, touchEndEvent, onMouseUp); | ||
EventHandler.add(document, touchEndEvent, onMouseUp, this); | ||
} | ||
@@ -254,0 +257,0 @@ /* istanbul ignore next */ |
@@ -38,3 +38,2 @@ import { Component, Property, Event, Collection, L10n, EmitType, Complex, compile, createElement } from '@syncfusion/ej2-base';import { addClass, removeClass, detach, attributes, prepend, setStyleAttribute } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty, isBlazor } from '@syncfusion/ej2-base';import { isNullOrUndefined, formatUnit, append, EventHandler, Draggable, extend } from '@syncfusion/ej2-base';import { BlazorDragEventArgs, SanitizeHtmlHelper, Browser } from '@syncfusion/ej2-base';import { Button, ButtonModel } from '@syncfusion/ej2-buttons';import { Popup, PositionData, getZindexPartial } from '../popup/popup';import { PositionDataModel } from '../popup/popup-model';import { createResize, removeResize, setMinHeight, setMaxWidth, setMaxHeight } from '../common/resize'; | ||
*/ | ||
/* eslint-disable */ | ||
click?: EmitType<Object>; | ||
@@ -117,2 +116,9 @@ | ||
/** | ||
* Enables or disables the persistence of the dialog's dimensions and position state between page reloads. | ||
* | ||
* @default false | ||
*/ | ||
enablePersistence?: boolean; | ||
/** | ||
* Specifies the value that represents whether the close icon is shown in the dialog component. | ||
@@ -299,3 +305,2 @@ * | ||
*/ | ||
/* eslint-disable */ | ||
created?: EmitType<Object>; | ||
@@ -310,3 +315,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
open?: EmitType<Object>; | ||
@@ -339,3 +343,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
close?: EmitType<Object>; | ||
@@ -360,3 +363,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
dragStart?: EmitType<Object>; | ||
@@ -371,3 +373,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
dragStop?: EmitType<Object>; | ||
@@ -382,3 +383,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
drag?: EmitType<Object>; | ||
@@ -392,3 +392,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
overlayClick?: EmitType<Object>; | ||
@@ -402,3 +401,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
resizeStart?: EmitType<Object>; | ||
@@ -412,3 +410,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
resizing?: EmitType<Object>; | ||
@@ -422,3 +419,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
resizeStop?: EmitType<Object>; | ||
@@ -425,0 +421,0 @@ |
@@ -148,3 +148,3 @@ import { Component, EmitType } from '@syncfusion/ej2-base'; | ||
* @blazorType string | ||
* @deprecated | ||
*/ | ||
@@ -178,3 +178,3 @@ target?: HTMLElement | string; | ||
* @blazorType string | ||
* @deprecated | ||
*/ | ||
@@ -384,2 +384,8 @@ target?: HTMLElement | string; | ||
/** | ||
* Enables or disables the persistence of the dialog's dimensions and position state between page reloads. | ||
* | ||
* @default false | ||
*/ | ||
enablePersistence: boolean; | ||
/** | ||
* Specifies the value that represents whether the close icon is shown in the dialog component. | ||
@@ -649,2 +655,3 @@ * | ||
destroyed: EmitType<Event>; | ||
protected needsID: boolean; | ||
constructor(options?: DialogModel, element?: string | HTMLElement); | ||
@@ -666,2 +673,3 @@ /** | ||
protected preRender(): void; | ||
private updatePersistData; | ||
private isNumberValue; | ||
@@ -746,3 +754,3 @@ private checkPositionData; | ||
*/ | ||
protected getPersistData(): string; | ||
getPersistData(): string; | ||
/** | ||
@@ -779,3 +787,3 @@ * To destroy the widget | ||
* | ||
* @returns {DialogDimension} | ||
* @returns {DialogDimension}- returns the dialog element Dimension. | ||
* @public | ||
@@ -872,2 +880,4 @@ */ | ||
close?: EmitType<Object>; | ||
width?: string | number; | ||
height?: string | number; | ||
} | ||
@@ -892,2 +902,4 @@ /** | ||
close?: EmitType<Object>; | ||
width?: string | number; | ||
height?: string | number; | ||
} | ||
@@ -894,0 +906,0 @@ interface DialogDimension { |
@@ -144,3 +144,2 @@ import { setStyleAttribute, addClass, removeClass, ChildProperty, Complex } from '@syncfusion/ej2-base';import { isNullOrUndefined, formatUnit } from '@syncfusion/ej2-base';import { Browser } from '@syncfusion/ej2-base';import { calculatePosition, OffsetPosition, calculateRelativeBasedPosition } from '../common/position';import { Animation, AnimationModel, Property, Event, EmitType, Component } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged } from '@syncfusion/ej2-base';import { EventHandler } from '@syncfusion/ej2-base';import { flip, fit, isCollide , CollisionCoordinates } from '../common/collision'; | ||
*/ | ||
/* eslint-disable */ | ||
open?: EmitType<Object>; | ||
@@ -153,3 +152,2 @@ | ||
*/ | ||
/* eslint-disable */ | ||
close?: EmitType<Object>; | ||
@@ -162,5 +160,4 @@ | ||
*/ | ||
/* eslint-disable */ | ||
targetExitViewport?: EmitType<Object>; | ||
} |
@@ -182,2 +182,3 @@ import { ChildProperty } from '@syncfusion/ej2-base'; | ||
constructor(element?: HTMLElement, options?: PopupModel); | ||
private fmDialogContainer; | ||
/** | ||
@@ -184,0 +185,0 @@ * Called internally if any of the property value changed. |
@@ -153,6 +153,8 @@ var __extends = (this && this.__extends) || (function () { | ||
Popup.prototype.destroy = function () { | ||
this.element.classList.remove(CLASSNAMES.ROOT, CLASSNAMES.RTL, CLASSNAMES.OPEN, CLASSNAMES.CLOSE); | ||
if (this.element.classList.contains('e-popup-open')) { | ||
this.unwireEvents(); | ||
} | ||
this.element.classList.remove(CLASSNAMES.ROOT, CLASSNAMES.RTL, CLASSNAMES.OPEN, CLASSNAMES.CLOSE); | ||
this.content = null; | ||
this.relateTo = null; | ||
_super.prototype.destroy.call(this); | ||
@@ -561,3 +563,10 @@ }; | ||
var _this = this; | ||
var relateToElement = this.getRelateToElement(); | ||
if (relateToElement.classList.contains('e-filemanager')) { | ||
this.fmDialogContainer = this.element.getElementsByClassName('e-file-select-wrap')[0]; | ||
} | ||
this.wireEvents(); | ||
if (!isNullOrUndefined(this.fmDialogContainer) && Browser.isIos) { | ||
this.fmDialogContainer.style.display = 'block'; | ||
} | ||
if (this.zIndex === 1000 || !isNullOrUndefined(relativeElement)) { | ||
@@ -638,5 +647,7 @@ var zIndexElement = (isNullOrUndefined(relativeElement)) ? this.element : relativeElement; | ||
var parentStyle = getComputedStyle(parent); | ||
if (parentStyle.position === 'fixed' && !isNullOrUndefined(this.element) && this.element.offsetParent && this.element.offsetParent.tagName === 'BODY') { | ||
this.element.style.top = window.scrollY > parseInt(this.element.style.top) ? formatUnit(window.scrollY - parseInt(this.element.style.top)) | ||
: formatUnit(parseInt(this.element.style.top) - window.scrollY); | ||
if (parentStyle.position === 'fixed' && !isNullOrUndefined(this.element) && this.element.offsetParent && | ||
this.element.offsetParent.tagName === 'BODY' && getComputedStyle(this.element.offsetParent).overflow !== 'hidden') { | ||
this.element.style.top = window.scrollY > parseInt(this.element.style.top, 10) ? | ||
formatUnit(window.scrollY - parseInt(this.element.style.top, 10)) | ||
: formatUnit(parseInt(this.element.style.top, 10) - window.scrollY); | ||
this.element.style.position = 'fixed'; | ||
@@ -643,0 +654,0 @@ this.fixedParent = true; |
@@ -13,3 +13,3 @@ export declare type createElementParams = (tag: string, prop?: { | ||
*/ | ||
export declare type SpinnerType = 'Material' | 'Fabric' | 'Bootstrap' | 'HighContrast' | 'Bootstrap4' | 'Tailwind' | 'Bootstrap5' | 'Fluent'; | ||
export declare type SpinnerType = 'Material' | 'Material3' | 'Fabric' | 'Bootstrap' | 'HighContrast' | 'Bootstrap4' | 'Tailwind' | 'Bootstrap5' | 'Fluent'; | ||
/** | ||
@@ -16,0 +16,0 @@ * Function to change the Spinners in a page globally from application end. |
import { isNullOrUndefined, classList, createElement } from '@syncfusion/ej2-base'; | ||
var globalTimeOut = {}; | ||
var DEFT_MAT_WIDTH = 30; | ||
var DEFT_MAT3_WIDTH = 30; | ||
var DEFT_FAB_WIDTH = 30; | ||
var DEFT_FLUENT_WIDTH = 30; | ||
var DEFT_TAIL_WIDTH = 24; | ||
var DEFT_BOOT_WIDTH = 30; | ||
@@ -13,2 +13,3 @@ var DEFT_BOOT4_WIDTH = 36; | ||
var CLS_MATERIALSPIN = 'e-spin-material'; | ||
var CLS_MATERIAL3SPIN = 'e-spin-material3'; | ||
var CLS_FABRICSPIN = 'e-spin-fabric'; | ||
@@ -128,3 +129,3 @@ var CLS_FLUENTSPIN = 'e-spin-fluent'; | ||
var uniqueID = random_generator(); | ||
globalTimeOut[uniqueID] = { timeOut: 0, type: 'Material', radius: radius }; | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'Material', radius: radius }; | ||
create_material_element(container, uniqueID, makeElement, CLS_MATERIALSPIN); | ||
@@ -140,5 +141,18 @@ mat_calculate_attributes(radius, container, 'Material', CLS_MATERIALSPIN); | ||
*/ | ||
function createMaterial3Spinner(container, radius, makeElement) { | ||
var uniqueID = random_generator(); | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'Material3', radius: radius }; | ||
create_material_element(container, uniqueID, makeElement, CLS_MATERIAL3SPIN); | ||
mat_calculate_attributes(radius, container, 'Material3', CLS_MATERIAL3SPIN); | ||
} | ||
/** | ||
* | ||
* @param {HTMLElement} container - specifies the element | ||
* @param {number} radius - specifies the radius | ||
* @param {createElementParams} makeElement - specifies the element | ||
* @returns {void} | ||
*/ | ||
function createBootstrap4Spinner(container, radius, makeElement) { | ||
var uniqueID = random_generator(); | ||
globalTimeOut[uniqueID] = { timeOut: 0, type: 'Bootstrap4', radius: radius }; | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'Bootstrap4', radius: radius }; | ||
create_material_element(container, uniqueID, makeElement, CLS_BOOT4SPIN); | ||
@@ -156,3 +170,3 @@ mat_calculate_attributes(radius, container, 'Bootstrap4', CLS_BOOT4SPIN); | ||
var uniqueID = random_generator(); | ||
globalTimeOut[uniqueID] = { timeOut: 0, type: 'Bootstrap5', radius: radius }; | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'Bootstrap5', radius: radius }; | ||
create_material_element(container, uniqueID, makeElement, CLS_BOOT5SPIN); | ||
@@ -171,4 +185,4 @@ mat_calculate_attributes(radius, container, 'Bootstrap5', CLS_BOOT5SPIN); | ||
var timeOutVar = 0; | ||
globalTimeOut[uniqueID].timeOut = 0; | ||
globalObject[uniqueID] = globalVariables(uniqueID, radius, 0, 0); | ||
globalTimeOut["" + uniqueID].timeOut = 0; | ||
globalObject["" + uniqueID] = globalVariables(uniqueID, radius, 0, 0); | ||
// eslint-disable-next-line | ||
@@ -187,3 +201,3 @@ var spinnerInfo = { uniqueID: uniqueID, container: container, globalInfo: globalObject, timeOutVar: timeOutVar }; | ||
var uniqueID = random_generator(); | ||
globalTimeOut[uniqueID] = { timeOut: 0, type: 'Fabric', radius: radius }; | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'Fabric', radius: radius }; | ||
create_fabric_element(container, uniqueID, CLS_FABRICSPIN, makeElement); | ||
@@ -201,9 +215,16 @@ fb_calculate_attributes(radius, container, CLS_FABRICSPIN); | ||
var uniqueID = random_generator(); | ||
globalTimeOut[uniqueID] = { timeOut: 0, type: 'Fluent', radius: radius }; | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'Fluent', radius: radius }; | ||
create_fabric_element(container, uniqueID, CLS_FLUENTSPIN, makeElement); | ||
fb_calculate_attributes(radius, container, CLS_FLUENTSPIN); | ||
} | ||
/** | ||
* | ||
* @param {HTMLElement} container - specifies the element | ||
* @param {number} radius - specifies the radius | ||
* @param {createElementParams} makeElement - specifies the element | ||
* @returns {void} | ||
*/ | ||
function createTailwindSpinner(container, radius, makeElement) { | ||
var uniqueID = random_generator(); | ||
globalTimeOut[uniqueID] = { timeOut: 0, type: 'Tailwind', radius: radius }; | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'Tailwind', radius: radius }; | ||
create_fabric_element(container, uniqueID, CLS_TAILWINDSPIN, makeElement); | ||
@@ -221,3 +242,3 @@ fb_calculate_attributes(radius, container, CLS_TAILWINDSPIN); | ||
var uniqueID = random_generator(); | ||
globalTimeOut[uniqueID] = { timeOut: 0, type: 'HighContrast', radius: radius }; | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'HighContrast', radius: radius }; | ||
create_fabric_element(container, uniqueID, CLS_HIGHCONTRASTSPIN, makeElement); | ||
@@ -253,2 +274,5 @@ fb_calculate_attributes(radius, container, CLS_HIGHCONTRASTSPIN); | ||
break; | ||
case 'Material3': | ||
createMaterial3Spinner(innerContainer, radius, makeElement); | ||
break; | ||
case 'Fabric': | ||
@@ -287,3 +311,3 @@ createFabricSpinner(innerContainer, radius, makeElement); | ||
var uniqueID = random_generator(); | ||
globalTimeOut[uniqueID] = { timeOut: 0, type: 'Bootstrap', radius: radius }; | ||
globalTimeOut["" + uniqueID] = { timeOut: 0, type: 'Bootstrap', radius: radius }; | ||
create_bootstrap_element(innerContainer, uniqueID, makeElement); | ||
@@ -411,3 +435,3 @@ boot_calculate_attributes(innerContainer, radius); | ||
function boot_animate(radius) { | ||
if (globalTimeOut[id].isAnimate) { | ||
if (globalTimeOut["" + id].isAnimate) { | ||
++count; | ||
@@ -450,2 +474,5 @@ circle.setAttribute('r', radius + ''); | ||
break; | ||
case 'Material3': | ||
defaultSize = DEFT_MAT3_WIDTH; | ||
break; | ||
case 'Fabric': | ||
@@ -580,3 +607,2 @@ defaultSize = DEFT_FAB_WIDTH; | ||
*/ | ||
// eslint-disable-next-line | ||
function createCircle(start, end, easing, duration, count, max, spinnerInfo) { | ||
@@ -609,8 +635,15 @@ var id = ++spinnerInfo.globalInfo[spinnerInfo.uniqueID].previousId; | ||
function updatePath(value, container) { | ||
if ((!isNullOrUndefined(container.querySelector('svg.e-spin-material'))) | ||
&& (!isNullOrUndefined(container.querySelector('svg.e-spin-material').querySelector('path.e-path-circle')))) { | ||
var svg = container.querySelector('svg.e-spin-material'); | ||
var path = svg.querySelector('path.e-path-circle'); | ||
path.setAttribute('stroke-dashoffset', getDashOffset(diameter, strokeSize, value, max) + ''); | ||
path.setAttribute('transform', 'rotate(' + (rotate) + ' ' + diameter / 2 + ' ' + diameter / 2 + ')'); | ||
if (!isNullOrUndefined(container.querySelector('svg.e-spin-material')) || !isNullOrUndefined(container.querySelector('svg.e-spin-material3'))) { | ||
var svg = void 0; | ||
if (!isNullOrUndefined(container.querySelector('svg.e-spin-material')) && !isNullOrUndefined(container.querySelector('svg.e-spin-material').querySelector('path.e-path-circle'))) { | ||
svg = container.querySelector('svg.e-spin-material'); | ||
} | ||
else if (!isNullOrUndefined(container.querySelector('svg.e-spin-material3')) && !isNullOrUndefined(container.querySelector('svg.e-spin-material3').querySelector('path.e-path-circle'))) { | ||
svg = container.querySelector('svg.e-spin-material3'); | ||
} | ||
if (!isNullOrUndefined(svg)) { | ||
var path = svg.querySelector('path.e-path-circle'); | ||
path.setAttribute('stroke-dashoffset', getDashOffset(diameter, strokeSize, value, max) + ''); | ||
path.setAttribute('transform', 'rotate(' + (rotate) + ' ' + diameter / 2 + ' ' + diameter / 2 + ')'); | ||
} | ||
} | ||
@@ -638,3 +671,3 @@ } | ||
path.setAttribute('d', drawArc(diameter, strokeSize)); | ||
if (type === 'Material') { | ||
if (type === 'Material' || type === 'Material3') { | ||
path.setAttribute('stroke-width', strokeSize + ''); | ||
@@ -771,3 +804,2 @@ path.setAttribute('stroke-dasharray', ((diameter - strokeSize) * Math.PI * 0.75) + ''); | ||
} | ||
// eslint-disable-next-line | ||
/** | ||
@@ -793,4 +825,10 @@ * Function to show the Spinner. | ||
if (container) { | ||
spinnerWrap = container.classList.contains(CLS_SPINWRAP) ? container : | ||
container.querySelector('.' + CLS_SPINWRAP); | ||
if (container.classList.contains(CLS_SPINWRAP)) { | ||
spinnerWrap = container; | ||
} | ||
else { | ||
var spinWrapCollection = void 0; | ||
spinWrapCollection = container.querySelectorAll('.' + CLS_SPINWRAP); | ||
spinnerWrap = Array.from(spinWrapCollection).find(function (wrap) { return wrap.parentElement === container; }) || null; | ||
} | ||
} | ||
@@ -809,5 +847,6 @@ if (container && spinnerWrap) { | ||
var id = svgEle.getAttribute('id'); | ||
globalTimeOut[id].isAnimate = !isHide; | ||
switch (globalTimeOut[id].type) { | ||
globalTimeOut["" + id].isAnimate = !isHide; | ||
switch (globalTimeOut["" + id].type) { | ||
case 'Material': | ||
case 'Material3': | ||
// eslint-disable-next-line | ||
@@ -889,2 +928,5 @@ isHide ? clearTimeout(globalTimeOut[id].timeOut) : startMatAnimate(inner, id, globalTimeOut[id].radius); | ||
} | ||
if (!isNullOrUndefined(spinTemplate)) { | ||
replaceContent(container, spinTemplate, spinCSSClass); | ||
} | ||
} | ||
@@ -905,10 +947,12 @@ } | ||
var svgElement = container.querySelector('svg'); | ||
var radius = theme === 'Bootstrap' ? parseFloat(svgElement.style.height) : parseFloat(svgElement.style.height) / 2; | ||
var classNames = svgElement.getAttribute('class'); | ||
var svgClassList = classNames.split(/\s/); | ||
if (svgClassList.indexOf('e-spin-material') >= 0) { | ||
var id = svgElement.getAttribute('id'); | ||
clearTimeout(globalTimeOut[id].timeOut); | ||
if (!isNullOrUndefined(svgElement)) { | ||
var radius = theme === 'Bootstrap' ? parseFloat(svgElement.style.height) : parseFloat(svgElement.style.height) / 2; | ||
var classNames = svgElement.getAttribute('class'); | ||
var svgClassList = classNames.split(/\s/); | ||
if (svgClassList.indexOf('e-spin-material') >= 0) { | ||
var id = svgElement.getAttribute('id'); | ||
clearTimeout(globalTimeOut["" + id].timeOut); | ||
} | ||
setTheme(theme, container, radius, makeEle); | ||
} | ||
setTheme(theme, container, radius, makeEle); | ||
} |
@@ -132,2 +132,3 @@ import { Component, Property, ChildProperty, Event, BaseEventArgs, append, compile } from '@syncfusion/ej2-base';import { EventHandler, EmitType, Touch, TapEventArgs, Browser, Animation as PopupAnimation } from '@syncfusion/ej2-base';import { isNullOrUndefined, getUniqueID, formatUnit, select, selectAll } from '@syncfusion/ej2-base';import { attributes, closest, removeClass, addClass, remove } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, Complex, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { Popup } from '../popup/popup';import { OffsetPosition, calculatePosition } from '../common/position';import { isCollide, fit } from '../common/collision'; | ||
* to know more about this property with demo. | ||
* | ||
* {% codeBlock src="tooltip/tippointerposition/index.md" %}{% endcodeBlock %} | ||
@@ -143,2 +144,3 @@ * | ||
* If it is in touch device, it will show the Tooltip content when tap and holding on the target element. | ||
* | ||
* {% codeBlock src="tooltip/openson/index.md" %}{% endcodeBlock %} | ||
@@ -155,2 +157,3 @@ * {% codeBlock src="tooltip/opensOn-api/index.ts" %}{% endcodeBlock %} | ||
* to know more about this property with demo. | ||
* | ||
* {% codeBlock src="tooltip/mousetrail/index.md" %}{% endcodeBlock %} | ||
@@ -167,2 +170,3 @@ * {% codeBlock src="tooltip/offsetX-api/index.ts" %}{% endcodeBlock %} | ||
* to know more about this property with demo. | ||
* | ||
* {% codeBlock src="tooltip/issticky/index.md" %}{% endcodeBlock %} | ||
@@ -178,2 +182,3 @@ * | ||
* to know more about this property with demo. | ||
* | ||
* {% codeBlock src="tooltip/animation/index.md" %}{% endcodeBlock %} | ||
@@ -216,2 +221,12 @@ * {% codeBlock src="tooltip/animation-api/index.ts" %}{% endcodeBlock %} | ||
/** | ||
* Allows additional HTML attributes such as tabindex, title, name, etc. to root element of the Tooltip popup, and | ||
* accepts n number of attributes in a key-value pair format. | ||
* | ||
* {% codeBlock src='tooltip/htmlAttributes/index.md' %}{% endcodeBlock %} | ||
* | ||
* @default {} | ||
*/ | ||
htmlAttributes?: { [key: string]: string }; | ||
/** | ||
* We can trigger `beforeRender` event before the Tooltip and its contents are added to the DOM. | ||
@@ -234,2 +249,3 @@ * When one of its arguments `cancel` is set to true, the Tooltip can be prevented from rendering on the page. | ||
* set customized styles in it and so on. | ||
* | ||
* {% codeBlock src="tooltip/beforeOpen/index.md" %}{% endcodeBlock %} | ||
@@ -243,2 +259,3 @@ * | ||
* We can trigger `afterOpen` event after the Tooltip Component gets opened. | ||
* | ||
* {% codeBlock src="tooltip/afterOpen/index.md" %}{% endcodeBlock %} | ||
@@ -252,2 +269,3 @@ * | ||
* We can trigger `beforeClose` event before the Tooltip hides from the screen. If returned false, then the Tooltip is no more hidden. | ||
* | ||
* {% codeBlock src="tooltip/beforeClose/index.md" %}{% endcodeBlock %} | ||
@@ -261,2 +279,3 @@ * | ||
* We can trigger `afterClose` event when the Tooltip Component gets closed. | ||
* | ||
* {% codeBlock src="tooltip/afterClose/index.md" %}{% endcodeBlock %} | ||
@@ -270,2 +289,3 @@ * | ||
* We can trigger `beforeCollision` event for every collision fit calculation. | ||
* | ||
* {% codeBlock src="tooltip/beforeCollision/index.md" %}{% endcodeBlock %} | ||
@@ -282,3 +302,2 @@ * | ||
*/ | ||
/* eslint-disable */ | ||
created?: EmitType<Object>; | ||
@@ -291,5 +310,4 @@ | ||
*/ | ||
/* eslint-disable */ | ||
destroyed?: EmitType<Object>; | ||
} |
@@ -8,16 +8,160 @@ import { Component, ChildProperty, BaseEventArgs } from '@syncfusion/ej2-base'; | ||
*/ | ||
export declare type OpenMode = 'Auto' | 'Hover' | 'Click' | 'Focus' | 'Custom'; | ||
export declare type OpenMode = | ||
/** | ||
* The tooltip opens automatically when the trigger element is hovered over. | ||
*/ | ||
'Auto' | | ||
/** | ||
* The tooltip opens when the trigger element is hovered over. | ||
*/ | ||
'Hover' | | ||
/** | ||
* The tooltip opens when the trigger element is clicked. | ||
*/ | ||
'Click' | | ||
/** | ||
* The tooltip opens when the trigger element is focused. | ||
*/ | ||
'Focus' | | ||
/** | ||
* The tooltip opens when the trigger element is triggered by a custom event. | ||
*/ | ||
'Custom'; | ||
/** | ||
* Applicable positions where the Tooltip can be displayed over specific target elements. | ||
*/ | ||
export declare type Position = 'TopLeft' | 'TopCenter' | 'TopRight' | 'BottomLeft' | 'BottomCenter' | 'BottomRight' | 'LeftTop' | 'LeftCenter' | 'LeftBottom' | 'RightTop' | 'RightCenter' | 'RightBottom'; | ||
export declare type Position = | ||
/** | ||
* The tooltip is positioned at the top-left corner of the trigger element. | ||
*/ | ||
'TopLeft' | | ||
/** | ||
* The tooltip is positioned at the top-center of the trigger element. | ||
*/ | ||
'TopCenter' | | ||
/** | ||
* The tooltip is positioned at the top-right corner of the trigger element. | ||
*/ | ||
'TopRight' | | ||
/** | ||
* The tooltip is positioned at the bottom-left corner of the trigger element. | ||
*/ | ||
'BottomLeft' | | ||
/** | ||
* The tooltip is positioned at the bottom-center of the trigger element. | ||
*/ | ||
'BottomCenter' | | ||
/** | ||
* The tooltip is positioned at the bottom-right corner of the trigger element. | ||
*/ | ||
'BottomRight' | | ||
/** | ||
* The tooltip is positioned at the left-top corner of the trigger element. | ||
*/ | ||
'LeftTop' | | ||
/** | ||
* The tooltip is positioned at the left-center of the trigger element. | ||
*/ | ||
'LeftCenter' | | ||
/** | ||
* The tooltip is positioned at the left-bottom corner of the trigger element. | ||
*/ | ||
'LeftBottom' | | ||
/** | ||
* The tooltip is positioned at the right-top corner of the trigger element. | ||
*/ | ||
'RightTop' | | ||
/** | ||
* The tooltip is positioned at the right-center of the trigger element. | ||
*/ | ||
'RightCenter' | | ||
/** | ||
* The tooltip is positioned at the right-bottom corner of the trigger element. | ||
*/ | ||
'RightBottom'; | ||
/** | ||
* Applicable tip positions attached to the Tooltip. | ||
*/ | ||
export declare type TipPointerPosition = 'Auto' | 'Start' | 'Middle' | 'End'; | ||
export declare type TipPointerPosition = | ||
/** | ||
* The tip pointer position is automatically calculated based on the available space. | ||
*/ | ||
'Auto' | | ||
/** | ||
* The tip pointer is positioned at the start of the tooltip. | ||
*/ | ||
'Start' | | ||
/** | ||
* The tip pointer is positioned at the middle of the tooltip. | ||
*/ | ||
'Middle' | | ||
/** | ||
* The tip pointer is positioned at the end of the tooltip. | ||
*/ | ||
'End'; | ||
/** | ||
* Animation effects that are applicable for Tooltip. | ||
*/ | ||
export declare type Effect = 'FadeIn' | 'FadeOut' | 'FadeZoomIn' | 'FadeZoomOut' | 'FlipXDownIn' | 'FlipXDownOut' | 'FlipXUpIn' | 'FlipXUpOut' | 'FlipYLeftIn' | 'FlipYLeftOut' | 'FlipYRightIn' | 'FlipYRightOut' | 'ZoomIn' | 'ZoomOut' | 'None'; | ||
export declare type Effect = | ||
/** | ||
* A fade-in animation effect where the tooltip gradually increases in opacity from 0 to full. | ||
*/ | ||
'FadeIn' | | ||
/** | ||
* A fade-out animation effect where the tooltip gradually decreases in opacity from full to 0. | ||
*/ | ||
'FadeOut' | | ||
/** | ||
* A fade-in animation effect combined with a zoom-in effect. | ||
*/ | ||
'FadeZoomIn' | | ||
/** | ||
* A fade-out animation effect combined with a zoom-out effect. | ||
*/ | ||
'FadeZoomOut' | | ||
/** | ||
* A flip-down animation effect where the tooltip starts upside down and flips down to become fully visible. | ||
*/ | ||
'FlipXDownIn' | | ||
/** | ||
* A flip-down animation effect where the tooltip starts fully visible and flips down to become invisible. | ||
*/ | ||
'FlipXDownOut' | | ||
/** | ||
* A flip-up animation effect where the tooltip starts upside down and flips up to become fully visible. | ||
*/ | ||
'FlipXUpIn' | | ||
/** | ||
* A flip-up animation effect where the tooltip starts fully visible and flips up to become invisible. | ||
*/ | ||
'FlipXUpOut' | | ||
/** | ||
* A flip-left animation effect where the tooltip starts from the right side and flips left to become fully visible. | ||
*/ | ||
'FlipYLeftIn' | | ||
/** | ||
* A flip-left animation effect where the tooltip starts from the left side and flips left to become invisible. | ||
*/ | ||
'FlipYLeftOut' | | ||
/** | ||
* A flip-right animation effect where the tooltip starts from the left side and flips right to become fully visible. | ||
*/ | ||
'FlipYRightIn' | | ||
/** | ||
* A flip-right animation effect where the tooltip starts from the right side and flips right to become invisible. | ||
*/ | ||
'FlipYRightOut' | | ||
/** | ||
* zoom-in animation effect where the tooltip starts small and gradually grows in size to become fully visible. | ||
*/ | ||
'ZoomIn' | | ||
/** | ||
* A zoom-out animation effect where the tooltip starts full size and gradually decreases in size to become invisible. | ||
*/ | ||
'ZoomOut' | | ||
/** | ||
* No animation effect, the tooltip simply appears or disappears without any animation. | ||
*/ | ||
'None'; | ||
/** | ||
* Interface for Tooltip event arguments. | ||
@@ -114,2 +258,3 @@ */ | ||
private isBodyContainer; | ||
private targetsList; | ||
/** | ||
@@ -209,2 +354,3 @@ * It is used to set the width of Tooltip component which accepts both string and number values. | ||
* to know more about this property with demo. | ||
* | ||
* {% codeBlock src="tooltip/tippointerposition/index.md" %}{% endcodeBlock %} | ||
@@ -219,2 +365,3 @@ * | ||
* If it is in touch device, it will show the Tooltip content when tap and holding on the target element. | ||
* | ||
* {% codeBlock src="tooltip/openson/index.md" %}{% endcodeBlock %} | ||
@@ -230,2 +377,3 @@ * {% codeBlock src="tooltip/opensOn-api/index.ts" %}{% endcodeBlock %} | ||
* to know more about this property with demo. | ||
* | ||
* {% codeBlock src="tooltip/mousetrail/index.md" %}{% endcodeBlock %} | ||
@@ -241,2 +389,3 @@ * {% codeBlock src="tooltip/offsetX-api/index.ts" %}{% endcodeBlock %} | ||
* to know more about this property with demo. | ||
* | ||
* {% codeBlock src="tooltip/issticky/index.md" %}{% endcodeBlock %} | ||
@@ -251,2 +400,3 @@ * | ||
* to know more about this property with demo. | ||
* | ||
* {% codeBlock src="tooltip/animation/index.md" %}{% endcodeBlock %} | ||
@@ -284,2 +434,13 @@ * {% codeBlock src="tooltip/animation-api/index.ts" %}{% endcodeBlock %} | ||
/** | ||
* Allows additional HTML attributes such as tabindex, title, name, etc. to root element of the Tooltip popup, and | ||
* accepts n number of attributes in a key-value pair format. | ||
* | ||
* {% codeBlock src='tooltip/htmlAttributes/index.md' %}{% endcodeBlock %} | ||
* | ||
* @default {} | ||
*/ | ||
htmlAttributes: { | ||
[key: string]: string; | ||
}; | ||
/** | ||
* We can trigger `beforeRender` event before the Tooltip and its contents are added to the DOM. | ||
@@ -301,2 +462,3 @@ * When one of its arguments `cancel` is set to true, the Tooltip can be prevented from rendering on the page. | ||
* set customized styles in it and so on. | ||
* | ||
* {% codeBlock src="tooltip/beforeOpen/index.md" %}{% endcodeBlock %} | ||
@@ -309,2 +471,3 @@ * | ||
* We can trigger `afterOpen` event after the Tooltip Component gets opened. | ||
* | ||
* {% codeBlock src="tooltip/afterOpen/index.md" %}{% endcodeBlock %} | ||
@@ -317,2 +480,3 @@ * | ||
* We can trigger `beforeClose` event before the Tooltip hides from the screen. If returned false, then the Tooltip is no more hidden. | ||
* | ||
* {% codeBlock src="tooltip/beforeClose/index.md" %}{% endcodeBlock %} | ||
@@ -325,2 +489,3 @@ * | ||
* We can trigger `afterClose` event when the Tooltip Component gets closed. | ||
* | ||
* {% codeBlock src="tooltip/afterClose/index.md" %}{% endcodeBlock %} | ||
@@ -333,2 +498,3 @@ * | ||
* We can trigger `beforeCollision` event for every collision fit calculation. | ||
* | ||
* {% codeBlock src="tooltip/beforeCollision/index.md" %}{% endcodeBlock %} | ||
@@ -374,4 +540,4 @@ * | ||
private renderCloseIcon; | ||
private addDescribedBy; | ||
private removeDescribedBy; | ||
private addDataTooltipId; | ||
private removeDataTooltipId; | ||
private tapHoldHandler; | ||
@@ -378,0 +544,0 @@ private touchEndHandler; |
@@ -170,7 +170,11 @@ var __extends = (this && this.__extends) || (function () { | ||
this.trigger('afterOpen', this.tooltipEventArgs); | ||
this.tooltipEventArgs = null; | ||
}; | ||
Tooltip.prototype.closePopupHandler = function () { | ||
this.clearTemplate(['content']); | ||
if (this.isReact && !(this.opensOn === 'Click' && typeof (this.content) === 'function')) { | ||
this.clearTemplate(['content']); | ||
} | ||
this.clear(); | ||
this.trigger('afterClose', this.tooltipEventArgs); | ||
this.tooltipEventArgs = null; | ||
}; | ||
@@ -286,3 +290,4 @@ Tooltip.prototype.calculateTooltipOffset = function (position) { | ||
else if ((tipPosExclude) && (this.tipPointerPosition === 'End' || this.tipPointerPosition === 'Start')) { | ||
leftValue = (this.tipPointerPosition === 'End') ? ((target.offsetWidth + ((this.tooltipEle.offsetWidth - target.offsetWidth) / 2)) - (tipWidth / 2)) - POINTER_ADJUST + 'px' : ((this.tooltipEle.offsetWidth - target.offsetWidth) / 2) - (tipWidth / 2) + POINTER_ADJUST + 'px'; | ||
leftValue = (this.tipPointerPosition === 'End') ? ((target.offsetWidth + ((this.tooltipEle.offsetWidth - target.offsetWidth) / 2)) - (tipWidth / 2)) - POINTER_ADJUST + 'px' | ||
: ((this.tooltipEle.offsetWidth - target.offsetWidth) / 2) - (tipWidth / 2) + POINTER_ADJUST + 'px'; | ||
} | ||
@@ -337,3 +342,2 @@ else { | ||
} | ||
// eslint-disable-next-line | ||
var tempFunction = compile(this.content); | ||
@@ -354,3 +358,2 @@ var tempArr = tempFunction({}, this, 'content', this.element.id + 'content', undefined, undefined, tooltipContent); | ||
else { | ||
// eslint-disable-next-line | ||
var templateFunction = compile(this.content); | ||
@@ -378,24 +381,7 @@ var tempArr = templateFunction({}, this, 'content', this.element.id + 'content', undefined, undefined, tooltipContent); | ||
}; | ||
Tooltip.prototype.addDescribedBy = function (target, id) { | ||
var describedby = (target.getAttribute('aria-describedby') || '').split(/\s+/); | ||
if (describedby.indexOf(id) < 0) { | ||
describedby.push(id); | ||
} | ||
attributes(target, { 'aria-describedby': describedby.join(' ').trim(), 'data-tooltip-id': id }); | ||
Tooltip.prototype.addDataTooltipId = function (target, id) { | ||
attributes(target, { 'data-tooltip-id': id }); | ||
}; | ||
Tooltip.prototype.removeDescribedBy = function (target) { | ||
var id = target.getAttribute('data-tooltip-id'); | ||
var describedby = (target.getAttribute('aria-describedby') || '').split(/\s+/); | ||
var index = describedby.indexOf(id); | ||
if (index !== -1) { | ||
describedby.splice(index, 1); | ||
} | ||
Tooltip.prototype.removeDataTooltipId = function (target) { | ||
target.removeAttribute('data-tooltip-id'); | ||
var orgdescribedby = describedby.join(' ').trim(); | ||
if (orgdescribedby) { | ||
target.setAttribute('aria-describedby', orgdescribedby); | ||
} | ||
else { | ||
target.removeAttribute('aria-describedby'); | ||
} | ||
}; | ||
@@ -411,3 +397,2 @@ Tooltip.prototype.tapHoldHandler = function (evt) { | ||
} | ||
// eslint-disable-next-line | ||
var close = function () { | ||
@@ -475,3 +460,2 @@ _this.close(); | ||
}; | ||
// eslint-disable-next-line | ||
var observeCallback = function (beforeRenderArgs) { | ||
@@ -499,2 +483,12 @@ _this.beforeRenderCallback(beforeRenderArgs, target, e, showAnimation); | ||
}); | ||
if (Object.keys(this.htmlAttributes).length !== 0) { | ||
for (var attr in this.htmlAttributes) { | ||
if (attr === "class") { | ||
this.tooltipEle.classList.add(this.htmlAttributes["" + attr]); | ||
} | ||
else { | ||
this.tooltipEle.setAttribute(attr, this.htmlAttributes["" + attr]); | ||
} | ||
} | ||
} | ||
this.tooltipBeforeRender(target, this); | ||
@@ -506,3 +500,3 @@ this.tooltipAfterRender(target, e, showAnimation, this); | ||
this.adjustArrow(target, this.position, this.tooltipPositionX, this.tooltipPositionY); | ||
this.addDescribedBy(target, this.ctrlId + '_content'); | ||
this.addDataTooltipId(target, this.ctrlId + '_content'); | ||
this.renderContent(target); | ||
@@ -546,3 +540,3 @@ PopupAnimation.stop(this.tooltipEle); | ||
removeClass([ctrlObj.tooltipEle], HIDE_POPUP); | ||
ctrlObj.addDescribedBy(target, ctrlObj.ctrlId + '_content'); | ||
ctrlObj.addDataTooltipId(target, ctrlObj.ctrlId + '_content'); | ||
ctrlObj.renderContent(target); | ||
@@ -571,3 +565,2 @@ addClass([ctrlObj.tooltipEle], POPUP_OPEN); | ||
} | ||
// eslint-disable-next-line | ||
var observeCallback = function (observedArgs) { | ||
@@ -588,3 +581,2 @@ ctrlObj.beforeOpenCallback(observedArgs, target, showAnimation, e); | ||
else { | ||
// eslint-disable-next-line | ||
var openAnimation_1 = { | ||
@@ -600,3 +592,2 @@ name: showAnimation.effect, | ||
if (this.openDelay > 0) { | ||
// eslint-disable-next-line | ||
var show = function () { | ||
@@ -721,3 +712,2 @@ if (_this.mouseTrail) { | ||
clearTimeout(this.showTimer); | ||
// eslint-disable-next-line | ||
var hide = function () { | ||
@@ -759,2 +749,3 @@ if (_this.closeDelay && _this.tooltipEle && _this.isTooltipOpen) { | ||
}); | ||
this.tooltipEventArgs = null; | ||
}; | ||
@@ -766,3 +757,2 @@ Tooltip.prototype.popupHide = function (hideAnimation, target) { | ||
this.isHidden = true; | ||
// eslint-disable-next-line | ||
var closeAnimation = { | ||
@@ -787,3 +777,3 @@ name: hideAnimation.effect, | ||
} | ||
this.removeDescribedBy(target); | ||
this.removeDataTooltipId(target); | ||
}; | ||
@@ -876,2 +866,9 @@ Tooltip.prototype.clear = function () { | ||
Tooltip.prototype.keyDown = function (event) { | ||
if (!isNullOrUndefined(this.targetsList) && !isNullOrUndefined(this.target)) { | ||
var target = [].slice.call(selectAll(this.target, this.element)); | ||
if (target.length !== this.targetsList.length) { | ||
this.unwireEvents(this.opensOn); | ||
this.wireEvents(this.opensOn); | ||
} | ||
} | ||
if (this.tooltipEle && event.keyCode === 27) { | ||
@@ -963,7 +960,13 @@ this.close(); | ||
if (!isNullOrUndefined(this.target)) { | ||
var targetList = [].slice.call(selectAll(this.target, this.element)); | ||
for (var _i = 0, targetList_2 = targetList; _i < targetList_2.length; _i++) { | ||
var target = targetList_2[_i]; | ||
EventHandler.add(target, 'focus', this.targetHover, this); | ||
if (this.element.nodeName !== "BODY") { | ||
EventHandler.add(this.element, 'focusin', this.targetHover, this); | ||
} | ||
else { | ||
var targetList = [].slice.call(selectAll(this.target, this.element)); | ||
this.targetsList = targetList; | ||
for (var _i = 0, targetList_2 = targetList; _i < targetList_2.length; _i++) { | ||
var target = targetList_2[_i]; | ||
EventHandler.add(target, 'focus', this.targetHover, this); | ||
} | ||
} | ||
} | ||
@@ -980,2 +983,5 @@ else { | ||
} | ||
if (e.type === 'focusin') { | ||
EventHandler.add(target, 'focusout', this.onMouseOut, this); | ||
} | ||
if (e.type === 'mouseover') { | ||
@@ -1035,7 +1041,12 @@ EventHandler.add(target, 'mouseleave', this.onMouseOut, this); | ||
if (!isNullOrUndefined(this.target)) { | ||
var targetList = [].slice.call(selectAll(this.target, this.element)); | ||
for (var _i = 0, targetList_3 = targetList; _i < targetList_3.length; _i++) { | ||
var target = targetList_3[_i]; | ||
EventHandler.remove(target, 'focus', this.targetHover); | ||
if (this.element.nodeName === 'BODY') { | ||
EventHandler.remove(this.element, 'focusin', this.targetHover); | ||
} | ||
else { | ||
var targetList = [].slice.call(selectAll(this.target, this.element)); | ||
for (var _i = 0, targetList_3 = targetList; _i < targetList_3.length; _i++) { | ||
var target = targetList_3[_i]; | ||
EventHandler.remove(target, 'focus', this.targetHover); | ||
} | ||
} | ||
} | ||
@@ -1053,2 +1064,3 @@ else { | ||
EventHandler.remove(target, 'blur', this.onMouseOut); | ||
EventHandler.remove(target, 'focusout', this.onMouseOut); | ||
} | ||
@@ -1249,2 +1261,7 @@ if (opensOn === 'Hover' && !Browser.isDevice) { | ||
this.popupObj = null; | ||
var currentTarget = selectAll('[data-tooltip-id= "' + this.ctrlId + '_content"]', this.element); | ||
for (var _i = 0, currentTarget_1 = currentTarget; _i < currentTarget_1.length; _i++) { | ||
var target = currentTarget_1[_i]; | ||
this.restoreElement(target); | ||
} | ||
}; | ||
@@ -1312,2 +1329,5 @@ __decorate([ | ||
__decorate([ | ||
Property('') | ||
], Tooltip.prototype, "htmlAttributes", void 0); | ||
__decorate([ | ||
Event() | ||
@@ -1314,0 +1334,0 @@ ], Tooltip.prototype, "beforeRender", void 0); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3579041
49468
326
3
+ Added@syncfusion/ej2-base@20.3.56(transitive)
+ Added@syncfusion/ej2-buttons@20.3.58(transitive)
+ Added@syncfusion/ej2-icons@20.3.56(transitive)
- Removed@syncfusion/ej2-base@20.2.48(transitive)
- Removed@syncfusion/ej2-buttons@20.2.46(transitive)
- Removed@syncfusion/ej2-icons@20.2.45(transitive)