@syncfusion/ej2-popups
Advanced tools
Comparing version 1.0.22 to 15.4.17
@@ -82,22 +82,12 @@ var __extends = (this && this.__extends) || (function () { | ||
if (event.keyCode === 9) { | ||
event.preventDefault(); | ||
for (var u = 0; u < this.focusElements.length; u++) { | ||
if (this.focusElements[u].disabled) { | ||
this.focusElements.splice(u, 1); | ||
if (this.isModal) { | ||
if (document.activeElement === this.btnObj.element && !event.shiftKey) { | ||
event.preventDefault(); | ||
this.focusableElements(this.element).focus(); | ||
} | ||
if (document.activeElement === this.focusableElements(this.element) && event.shiftKey) { | ||
event.preventDefault(); | ||
this.btnObj.element.focus(); | ||
} | ||
} | ||
var focusIndex = void 0; | ||
if (event.shiftKey) { | ||
focusIndex = (this.focusIndex === 0 || isNullOrUndefined(this.focusIndex)) ? | ||
this.focusElements.length - 1 : this.focusIndex - 1; | ||
} | ||
else { | ||
focusIndex = (this.focusElements.length - 1 === this.focusIndex || isNullOrUndefined(this.focusIndex)) ? | ||
0 : this.focusIndex + 1; | ||
} | ||
var element_1 = this.focusElements[focusIndex]; | ||
element_1.focus(); | ||
if (element_1 instanceof HTMLInputElement) { | ||
element_1.select(); | ||
} | ||
} | ||
@@ -190,11 +180,6 @@ var element = document.activeElement; | ||
close: function (event) { | ||
_this.unBindEvent(_this.element); | ||
if (_this.isModal) { | ||
_this.dlgContainer.style.display = 'none'; | ||
} | ||
if (!isNullOrUndefined(_this.focusElements) && _this.focusElements.length > 0) { | ||
_this.unBindEvent((isNullOrUndefined(_this.focusIndex) ? _this.element : _this.focusElements[_this.focusIndex])); | ||
} | ||
else { | ||
_this.unBindEvent(_this.element); | ||
} | ||
_this.trigger('close', _this.closedFrom); | ||
@@ -286,3 +271,3 @@ _this.closedFrom = {}; | ||
for (var i = 0; i < this.buttons.length; i++) { | ||
var btn = createElement('button'); | ||
var btn = createElement('button', { attrs: { type: 'button' } }); | ||
this.buttonContent.push(btn.outerHTML); | ||
@@ -340,3 +325,3 @@ } | ||
Dialog.prototype.renderCloseIcon = function () { | ||
this.closeIcon = createElement('button', { className: DLG_CLOSE_ICON_BTN }); | ||
this.closeIcon = createElement('button', { className: DLG_CLOSE_ICON_BTN, attrs: { type: 'button' } }); | ||
this.closeIconBtnObj = new Button({ cssClass: 'e-flat', iconCss: DLG_CLOSE_ICON + ' ' + ICON }); | ||
@@ -382,47 +367,39 @@ this.closeIconTitle(); | ||
}; | ||
Dialog.prototype.focusContentEle = function (container) { | ||
var _this = this; | ||
var value = 'input,select,textarea,button,a,[contenteditable="true"]'; | ||
var items = container.querySelectorAll(value); | ||
var item; | ||
this.focusElements = []; | ||
this.focusIndex = 0; | ||
Dialog.prototype.getValidFocusNode = function (items) { | ||
var node; | ||
for (var u = 0; u < items.length; u++) { | ||
item = items[u]; | ||
if ((item.clientHeight > 0 || (item.tagName.toLowerCase() === 'a' && item.hasAttribute('href'))) && item.tabIndex > -1 && | ||
!item.disabled && !this.disableElement(item, '[disabled],[aria-disabled="true"],[type="hidden"]')) { | ||
this.focusElements.push(item); | ||
node = items[u]; | ||
if ((node.clientHeight > 0 || (node.tagName.toLowerCase() === 'a' && node.hasAttribute('href'))) && node.tabIndex > -1 && | ||
!node.disabled && !this.disableElement(node, '[disabled],[aria-disabled="true"],[type="hidden"]')) { | ||
return node; | ||
} | ||
} | ||
if (0 < this.focusElements.length) { | ||
var autofocusEle = [].slice.call(this.focusElements); | ||
var isAutoFocus_1 = autofocusEle.some(function (value, index) { | ||
if (value.hasAttribute('autofocus')) { | ||
_this.focusIndex = index; | ||
isAutoFocus_1 = true; | ||
} | ||
else { | ||
isAutoFocus_1 = false; | ||
} | ||
return isAutoFocus_1; | ||
}); | ||
if (!isAutoFocus_1) { | ||
var index = this.showCloseIcon && this.focusElements.length > 1 ? 1 : 0; | ||
var contentEle = !isNullOrUndefined(this.contentEle) && | ||
this.focusElements[index]; | ||
if (contentEle && this.contentEle.contains(contentEle)) { | ||
this.focusIndex = this.focusElements.indexOf(contentEle); | ||
} | ||
else if (!isNullOrUndefined(this.primaryButtonEle)) { | ||
var ele = this.element.querySelector('.' + DLG_PRIMARY_BUTTON); | ||
this.focusIndex = this.focusElements.indexOf(ele); | ||
} | ||
return node; | ||
}; | ||
Dialog.prototype.focusableElements = function (content) { | ||
if (!isNullOrUndefined(content)) { | ||
var value = 'input,select,textarea,button,a,[contenteditable="true"],[tabindex]'; | ||
var items = content.querySelectorAll(value); | ||
return this.getValidFocusNode(items); | ||
} | ||
return null; | ||
}; | ||
Dialog.prototype.getAutoFocusNode = function (container) { | ||
var node = container.querySelector('.' + DLG_CLOSE_ICON_BTN); | ||
var value = '[autofocus]'; | ||
var items = container.querySelectorAll(value); | ||
var validNode = this.getValidFocusNode(items); | ||
if (!isNullOrUndefined(validNode)) { | ||
node = validNode; | ||
} | ||
else { | ||
validNode = this.focusableElements(this.contentEle); | ||
if (!isNullOrUndefined(validNode)) { | ||
return node = validNode; | ||
} | ||
var element = this.focusElements[this.focusIndex]; | ||
element.focus(); | ||
this.bindEvent(element); | ||
if (element instanceof HTMLInputElement) { | ||
element.select(); | ||
else if (!isNullOrUndefined(this.primaryButtonEle)) { | ||
return this.element.querySelector('.' + DLG_PRIMARY_BUTTON); | ||
} | ||
} | ||
return node; | ||
}; | ||
@@ -441,33 +418,13 @@ Dialog.prototype.disableElement = function (element, t) { | ||
Dialog.prototype.focusContent = function () { | ||
this.focusContentEle(this.element); | ||
if (this.focusElements.length === 0) { | ||
this.element.focus(); | ||
this.bindEvent(this.element); | ||
} | ||
var element = this.getAutoFocusNode(this.element); | ||
var node = !isNullOrUndefined(element) ? element : this.element; | ||
node.focus(); | ||
this.bindEvent(this.element); | ||
}; | ||
Dialog.prototype.bindEvent = function (element) { | ||
EventHandler.add(element, 'keydown', this.keyDown, this); | ||
EventHandler.add(element, 'blur', this.focusOut, this); | ||
}; | ||
Dialog.prototype.unBindEvent = function (element) { | ||
if (!isNullOrUndefined(element)) { | ||
EventHandler.remove(element, 'keydown', this.keyDown); | ||
EventHandler.remove(element, 'blur', this.focusOut); | ||
} | ||
EventHandler.remove(element, 'keydown', this.keyDown); | ||
}; | ||
Dialog.prototype.focusOut = function (e) { | ||
var _this = this; | ||
var element = isNullOrUndefined(this.focusIndex) ? this.element : this.focusElements[this.focusIndex]; | ||
setTimeout(function () { | ||
var tags = ['input', 'select', 'textarea', 'button', 'a']; | ||
var activeEle = document.activeElement; | ||
var isValid = (tags.indexOf(activeEle.tagName.toLowerCase()) > -1) || | ||
(activeEle.hasAttribute('contenteditable') && activeEle.getAttribute('contenteditable') === 'true'); | ||
if (_this.dialogOpen && _this.element.contains(activeEle)) { | ||
_this.focusIndex = isValid ? _this.focusElements.indexOf(activeEle) : null; | ||
_this.unBindEvent(element); | ||
_this.bindEvent((isNullOrUndefined(_this.focusIndex) ? _this.element : activeEle)); | ||
} | ||
}); | ||
}; | ||
Dialog.prototype.getModuleName = function () { | ||
@@ -474,0 +431,0 @@ return 'dialog'; |
@@ -1,2 +0,2 @@ | ||
import { isNullOrUndefined } from '@syncfusion/ej2-base'; | ||
import { isNullOrUndefined, classList } from '@syncfusion/ej2-base'; | ||
var globalTimeOut = {}; | ||
@@ -354,40 +354,31 @@ var spinTemplate = null; | ||
export function showSpinner(container) { | ||
showHideSpinner(container, false); | ||
} | ||
function showHideSpinner(container, isHide) { | ||
var spinnerWrap = container.classList.contains(CLS_SPINWRAP) ? container : | ||
container.querySelector('.' + CLS_SPINWRAP); | ||
var inner = spinnerWrap.querySelector('.' + CLS_SPININWRAP); | ||
if (!spinnerWrap.classList.contains(CLS_SPINTEMPLATE) && !spinnerWrap.classList.contains(CLS_SHOWSPIN)) { | ||
var id = spinnerWrap.querySelector('svg').getAttribute('id'); | ||
globalTimeOut[id].isAnimate = true; | ||
var spinCheck; | ||
spinCheck = isHide ? !spinnerWrap.classList.contains(CLS_SPINTEMPLATE) && !spinnerWrap.classList.contains(CLS_HIDESPIN) : | ||
!spinnerWrap.classList.contains(CLS_SPINTEMPLATE) && !spinnerWrap.classList.contains(CLS_SHOWSPIN); | ||
if (spinCheck) { | ||
var svgEle = spinnerWrap.querySelector('svg'); | ||
if (isNullOrUndefined(svgEle)) { | ||
return; | ||
} | ||
var id = svgEle.getAttribute('id'); | ||
globalTimeOut[id].isAnimate = !isHide; | ||
switch (globalTimeOut[id].type) { | ||
case 'Material': | ||
startMatAnimate(inner, id, globalTimeOut[id].radius); | ||
isHide ? clearTimeout(globalTimeOut[id].timeOut) : startMatAnimate(inner, id, globalTimeOut[id].radius); | ||
break; | ||
case 'Bootstrap': | ||
animateBootstrap(inner); | ||
isHide ? clearTimeout(globalTimeOut[id].timeOut) : animateBootstrap(inner); | ||
break; | ||
} | ||
} | ||
if (spinnerWrap.classList.contains(CLS_HIDESPIN)) { | ||
spinnerWrap.classList.remove(CLS_HIDESPIN); | ||
} | ||
spinnerWrap.classList.add(CLS_SHOWSPIN); | ||
isHide ? classList(spinnerWrap, [CLS_HIDESPIN], [CLS_SHOWSPIN]) : classList(spinnerWrap, [CLS_SHOWSPIN], [CLS_HIDESPIN]); | ||
} | ||
export function hideSpinner(container) { | ||
var spinnerContainer = container.classList.contains(CLS_SPINWRAP) ? container : | ||
container.querySelector('.' + CLS_SPINWRAP); | ||
var innerContainer = spinnerContainer.querySelector('.' + CLS_SPININWRAP); | ||
if (!spinnerContainer.classList.contains(CLS_SPINTEMPLATE) && !spinnerContainer.classList.contains(CLS_HIDESPIN)) { | ||
var id = spinnerContainer.querySelector('svg').getAttribute('id'); | ||
globalTimeOut[id].isAnimate = false; | ||
switch (globalTimeOut[id].type) { | ||
case 'Material': | ||
case 'Bootstrap': | ||
clearTimeout(globalTimeOut[id].timeOut); | ||
break; | ||
} | ||
} | ||
spinnerContainer.classList.add(CLS_HIDESPIN); | ||
if (spinnerContainer.classList.contains(CLS_SHOWSPIN)) { | ||
spinnerContainer.classList.remove(CLS_SHOWSPIN); | ||
} | ||
showHideSpinner(container, true); | ||
} | ||
@@ -394,0 +385,0 @@ export function setSpinner(args) { |
{ | ||
"name": "@syncfusion/ej2-popups", | ||
"version": "1.0.22", | ||
"version": "15.4.17", | ||
"description": "Essential JS 2 popup Component", | ||
@@ -9,4 +9,4 @@ "author": "Syncfusion Inc.", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "^1.0.22", | ||
"@syncfusion/ej2-buttons": "^1.0.22" | ||
"@syncfusion/ej2-base": "^15.4.17", | ||
"@syncfusion/ej2-buttons": "^15.4.17" | ||
}, | ||
@@ -13,0 +13,0 @@ "devDependencies": { |
@@ -99,5 +99,8 @@ import{Dialog} from "./dialog"; | ||
/** | ||
* Specifies to `position` the Dialog on build-in 9 places or any custom location with | ||
* Specifies to `position` the Dialog on built-in 9 places or any custom location with | ||
respect to the associated target elements. | ||
For ex: {X:'left', Y:'top'} or { X: 100, Y: 100 } | ||
Following list of positions are available. | ||
* for X is: left, center, right (or) any offset value | ||
* for Y is: top, center, bottom (or) any offset value | ||
*/ | ||
@@ -139,2 +142,19 @@ position(value: (val:PositionData) => void | Object): BuilderProperties; | ||
If the user sets `Fade` effect then the Dialog will open with 'FadeIn' effect and close with 'FadeOut' effect. | ||
Following list of effects will be available, you can use any of this. | ||
1. 'Fade' | ||
2. 'FadeZoom' | ||
3. 'FlipLeftDown' | ||
4. 'FlipLeftUp' | ||
5. 'FlipRightDown' | ||
6. 'FlipRightUp' | ||
7. 'FlipXDown' | ||
8. 'FlipXUp' | ||
9. 'FlipYLeft' | ||
10. 'FlipYRight' | ||
11. 'SlideBottom' | ||
12. 'SlideLeft' | ||
13. 'SlideRight' | ||
14. 'SlideTop' | ||
15. 'Zoom' | ||
16. 'None' | ||
*/ | ||
@@ -141,0 +161,0 @@ effect(value:DialogEffect): AnimationSettings; |
@@ -120,5 +120,8 @@ import { Component, Property, Event, CreateBuilder, Collection, L10n, Browser, EmitType } from '@syncfusion/ej2-base';import { createElement, addClass, removeClass, detach, attributes, prepend, setStyleAttribute } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty } from '@syncfusion/ej2-base';import { isNullOrUndefined, formatUnit } from '@syncfusion/ej2-base';import { DialogHelper } from './dialog-builder';import { EventHandler } from '@syncfusion/ej2-base';import { Draggable } from '@syncfusion/ej2-base';import { Popup, PositionData } from '../popup/popup';import { Button, ButtonModel } from '@syncfusion/ej2-buttons'; | ||
/** | ||
* Specifies to `position` the Dialog on build-in 9 places or any custom location with | ||
* Specifies to `position` the Dialog on built-in 9 places or any custom location with | ||
* respect to the associated target elements. | ||
* For ex: {X:'left', Y:'top'} or { X: 100, Y: 100 } | ||
* Following list of positions are available. | ||
* * for X is: left, center, right (or) any offset value | ||
* * for Y is: top, center, bottom (or) any offset value | ||
* @default {X:'center', Y:'center'} | ||
@@ -125,0 +128,0 @@ */ |
@@ -25,2 +25,19 @@ import { Component, EmitType } from '@syncfusion/ej2-base'; | ||
* If the user sets `Fade` effect then the Dialog will open with 'FadeIn' effect and close with 'FadeOut' effect. | ||
* Following list of effects will be available, you can use any of this. | ||
* 1. 'Fade' | ||
* 2. 'FadeZoom' | ||
* 3. 'FlipLeftDown' | ||
* 4. 'FlipLeftUp' | ||
* 5. 'FlipRightDown' | ||
* 6. 'FlipRightUp' | ||
* 7. 'FlipXDown' | ||
* 8. 'FlipXUp' | ||
* 9. 'FlipYLeft' | ||
* 10. 'FlipYRight' | ||
* 11. 'SlideBottom' | ||
* 12. 'SlideLeft' | ||
* 13. 'SlideRight' | ||
* 14. 'SlideTop' | ||
* 15. 'Zoom' | ||
* 16. 'None' | ||
*/ | ||
@@ -153,5 +170,8 @@ effect?: DialogEffect; | ||
/** | ||
* Specifies to `position` the Dialog on build-in 9 places or any custom location with | ||
* Specifies to `position` the Dialog on built-in 9 places or any custom location with | ||
* respect to the associated target elements. | ||
* For ex: {X:'left', Y:'top'} or { X: 100, Y: 100 } | ||
* Following list of positions are available. | ||
* * for X is: left, center, right (or) any offset value | ||
* * for Y is: top, center, bottom (or) any offset value | ||
* @default {X:'center', Y:'center'} | ||
@@ -250,3 +270,5 @@ */ | ||
private setIsModal(); | ||
private focusContentEle(container); | ||
private getValidFocusNode(items); | ||
private focusableElements(content); | ||
private getAutoFocusNode(container); | ||
private disableElement(element, t); | ||
@@ -256,3 +278,2 @@ private focusContent(); | ||
private unBindEvent(element); | ||
private focusOut(e); | ||
/** | ||
@@ -259,0 +280,0 @@ * Module required function |
@@ -77,22 +77,12 @@ var __extends = (this && this.__extends) || (function () { | ||
if (event.keyCode === 9) { | ||
event.preventDefault(); | ||
for (var u = 0; u < this.focusElements.length; u++) { | ||
if (this.focusElements[u].disabled) { | ||
this.focusElements.splice(u, 1); | ||
if (this.isModal) { | ||
if (document.activeElement === this.btnObj.element && !event.shiftKey) { | ||
event.preventDefault(); | ||
this.focusableElements(this.element).focus(); | ||
} | ||
if (document.activeElement === this.focusableElements(this.element) && event.shiftKey) { | ||
event.preventDefault(); | ||
this.btnObj.element.focus(); | ||
} | ||
} | ||
var focusIndex = void 0; | ||
if (event.shiftKey) { | ||
focusIndex = (this.focusIndex === 0 || ej2_base_4.isNullOrUndefined(this.focusIndex)) ? | ||
this.focusElements.length - 1 : this.focusIndex - 1; | ||
} | ||
else { | ||
focusIndex = (this.focusElements.length - 1 === this.focusIndex || ej2_base_4.isNullOrUndefined(this.focusIndex)) ? | ||
0 : this.focusIndex + 1; | ||
} | ||
var element_1 = this.focusElements[focusIndex]; | ||
element_1.focus(); | ||
if (element_1 instanceof HTMLInputElement) { | ||
element_1.select(); | ||
} | ||
} | ||
@@ -185,11 +175,6 @@ var element = document.activeElement; | ||
close: function (event) { | ||
_this.unBindEvent(_this.element); | ||
if (_this.isModal) { | ||
_this.dlgContainer.style.display = 'none'; | ||
} | ||
if (!ej2_base_4.isNullOrUndefined(_this.focusElements) && _this.focusElements.length > 0) { | ||
_this.unBindEvent((ej2_base_4.isNullOrUndefined(_this.focusIndex) ? _this.element : _this.focusElements[_this.focusIndex])); | ||
} | ||
else { | ||
_this.unBindEvent(_this.element); | ||
} | ||
_this.trigger('close', _this.closedFrom); | ||
@@ -281,3 +266,3 @@ _this.closedFrom = {}; | ||
for (var i = 0; i < this.buttons.length; i++) { | ||
var btn = ej2_base_2.createElement('button'); | ||
var btn = ej2_base_2.createElement('button', { attrs: { type: 'button' } }); | ||
this.buttonContent.push(btn.outerHTML); | ||
@@ -335,3 +320,3 @@ } | ||
Dialog.prototype.renderCloseIcon = function () { | ||
this.closeIcon = ej2_base_2.createElement('button', { className: DLG_CLOSE_ICON_BTN }); | ||
this.closeIcon = ej2_base_2.createElement('button', { className: DLG_CLOSE_ICON_BTN, attrs: { type: 'button' } }); | ||
this.closeIconBtnObj = new ej2_buttons_1.Button({ cssClass: 'e-flat', iconCss: DLG_CLOSE_ICON + ' ' + ICON }); | ||
@@ -377,47 +362,39 @@ this.closeIconTitle(); | ||
}; | ||
Dialog.prototype.focusContentEle = function (container) { | ||
var _this = this; | ||
var value = 'input,select,textarea,button,a,[contenteditable="true"]'; | ||
var items = container.querySelectorAll(value); | ||
var item; | ||
this.focusElements = []; | ||
this.focusIndex = 0; | ||
Dialog.prototype.getValidFocusNode = function (items) { | ||
var node; | ||
for (var u = 0; u < items.length; u++) { | ||
item = items[u]; | ||
if ((item.clientHeight > 0 || (item.tagName.toLowerCase() === 'a' && item.hasAttribute('href'))) && item.tabIndex > -1 && | ||
!item.disabled && !this.disableElement(item, '[disabled],[aria-disabled="true"],[type="hidden"]')) { | ||
this.focusElements.push(item); | ||
node = items[u]; | ||
if ((node.clientHeight > 0 || (node.tagName.toLowerCase() === 'a' && node.hasAttribute('href'))) && node.tabIndex > -1 && | ||
!node.disabled && !this.disableElement(node, '[disabled],[aria-disabled="true"],[type="hidden"]')) { | ||
return node; | ||
} | ||
} | ||
if (0 < this.focusElements.length) { | ||
var autofocusEle = [].slice.call(this.focusElements); | ||
var isAutoFocus_1 = autofocusEle.some(function (value, index) { | ||
if (value.hasAttribute('autofocus')) { | ||
_this.focusIndex = index; | ||
isAutoFocus_1 = true; | ||
} | ||
else { | ||
isAutoFocus_1 = false; | ||
} | ||
return isAutoFocus_1; | ||
}); | ||
if (!isAutoFocus_1) { | ||
var index = this.showCloseIcon && this.focusElements.length > 1 ? 1 : 0; | ||
var contentEle = !ej2_base_4.isNullOrUndefined(this.contentEle) && | ||
this.focusElements[index]; | ||
if (contentEle && this.contentEle.contains(contentEle)) { | ||
this.focusIndex = this.focusElements.indexOf(contentEle); | ||
} | ||
else if (!ej2_base_4.isNullOrUndefined(this.primaryButtonEle)) { | ||
var ele = this.element.querySelector('.' + DLG_PRIMARY_BUTTON); | ||
this.focusIndex = this.focusElements.indexOf(ele); | ||
} | ||
return node; | ||
}; | ||
Dialog.prototype.focusableElements = function (content) { | ||
if (!ej2_base_4.isNullOrUndefined(content)) { | ||
var value = 'input,select,textarea,button,a,[contenteditable="true"],[tabindex]'; | ||
var items = content.querySelectorAll(value); | ||
return this.getValidFocusNode(items); | ||
} | ||
return null; | ||
}; | ||
Dialog.prototype.getAutoFocusNode = function (container) { | ||
var node = container.querySelector('.' + DLG_CLOSE_ICON_BTN); | ||
var value = '[autofocus]'; | ||
var items = container.querySelectorAll(value); | ||
var validNode = this.getValidFocusNode(items); | ||
if (!ej2_base_4.isNullOrUndefined(validNode)) { | ||
node = validNode; | ||
} | ||
else { | ||
validNode = this.focusableElements(this.contentEle); | ||
if (!ej2_base_4.isNullOrUndefined(validNode)) { | ||
return node = validNode; | ||
} | ||
var element = this.focusElements[this.focusIndex]; | ||
element.focus(); | ||
this.bindEvent(element); | ||
if (element instanceof HTMLInputElement) { | ||
element.select(); | ||
else if (!ej2_base_4.isNullOrUndefined(this.primaryButtonEle)) { | ||
return this.element.querySelector('.' + DLG_PRIMARY_BUTTON); | ||
} | ||
} | ||
return node; | ||
}; | ||
@@ -436,33 +413,13 @@ Dialog.prototype.disableElement = function (element, t) { | ||
Dialog.prototype.focusContent = function () { | ||
this.focusContentEle(this.element); | ||
if (this.focusElements.length === 0) { | ||
this.element.focus(); | ||
this.bindEvent(this.element); | ||
} | ||
var element = this.getAutoFocusNode(this.element); | ||
var node = !ej2_base_4.isNullOrUndefined(element) ? element : this.element; | ||
node.focus(); | ||
this.bindEvent(this.element); | ||
}; | ||
Dialog.prototype.bindEvent = function (element) { | ||
ej2_base_5.EventHandler.add(element, 'keydown', this.keyDown, this); | ||
ej2_base_5.EventHandler.add(element, 'blur', this.focusOut, this); | ||
}; | ||
Dialog.prototype.unBindEvent = function (element) { | ||
if (!ej2_base_4.isNullOrUndefined(element)) { | ||
ej2_base_5.EventHandler.remove(element, 'keydown', this.keyDown); | ||
ej2_base_5.EventHandler.remove(element, 'blur', this.focusOut); | ||
} | ||
ej2_base_5.EventHandler.remove(element, 'keydown', this.keyDown); | ||
}; | ||
Dialog.prototype.focusOut = function (e) { | ||
var _this = this; | ||
var element = ej2_base_4.isNullOrUndefined(this.focusIndex) ? this.element : this.focusElements[this.focusIndex]; | ||
setTimeout(function () { | ||
var tags = ['input', 'select', 'textarea', 'button', 'a']; | ||
var activeEle = document.activeElement; | ||
var isValid = (tags.indexOf(activeEle.tagName.toLowerCase()) > -1) || | ||
(activeEle.hasAttribute('contenteditable') && activeEle.getAttribute('contenteditable') === 'true'); | ||
if (_this.dialogOpen && _this.element.contains(activeEle)) { | ||
_this.focusIndex = isValid ? _this.focusElements.indexOf(activeEle) : null; | ||
_this.unBindEvent(element); | ||
_this.bindEvent((ej2_base_4.isNullOrUndefined(_this.focusIndex) ? _this.element : activeEle)); | ||
} | ||
}); | ||
}; | ||
Dialog.prototype.getModuleName = function () { | ||
@@ -469,0 +426,0 @@ return 'dialog'; |
@@ -357,41 +357,32 @@ define(["require", "exports", "@syncfusion/ej2-base"], function (require, exports, ej2_base_1) { | ||
function showSpinner(container) { | ||
showHideSpinner(container, false); | ||
} | ||
exports.showSpinner = showSpinner; | ||
function showHideSpinner(container, isHide) { | ||
var spinnerWrap = container.classList.contains(CLS_SPINWRAP) ? container : | ||
container.querySelector('.' + CLS_SPINWRAP); | ||
var inner = spinnerWrap.querySelector('.' + CLS_SPININWRAP); | ||
if (!spinnerWrap.classList.contains(CLS_SPINTEMPLATE) && !spinnerWrap.classList.contains(CLS_SHOWSPIN)) { | ||
var id = spinnerWrap.querySelector('svg').getAttribute('id'); | ||
globalTimeOut[id].isAnimate = true; | ||
var spinCheck; | ||
spinCheck = isHide ? !spinnerWrap.classList.contains(CLS_SPINTEMPLATE) && !spinnerWrap.classList.contains(CLS_HIDESPIN) : | ||
!spinnerWrap.classList.contains(CLS_SPINTEMPLATE) && !spinnerWrap.classList.contains(CLS_SHOWSPIN); | ||
if (spinCheck) { | ||
var svgEle = spinnerWrap.querySelector('svg'); | ||
if (ej2_base_1.isNullOrUndefined(svgEle)) { | ||
return; | ||
} | ||
var id = svgEle.getAttribute('id'); | ||
globalTimeOut[id].isAnimate = !isHide; | ||
switch (globalTimeOut[id].type) { | ||
case 'Material': | ||
startMatAnimate(inner, id, globalTimeOut[id].radius); | ||
isHide ? clearTimeout(globalTimeOut[id].timeOut) : startMatAnimate(inner, id, globalTimeOut[id].radius); | ||
break; | ||
case 'Bootstrap': | ||
animateBootstrap(inner); | ||
isHide ? clearTimeout(globalTimeOut[id].timeOut) : animateBootstrap(inner); | ||
break; | ||
} | ||
} | ||
if (spinnerWrap.classList.contains(CLS_HIDESPIN)) { | ||
spinnerWrap.classList.remove(CLS_HIDESPIN); | ||
} | ||
spinnerWrap.classList.add(CLS_SHOWSPIN); | ||
isHide ? ej2_base_1.classList(spinnerWrap, [CLS_HIDESPIN], [CLS_SHOWSPIN]) : ej2_base_1.classList(spinnerWrap, [CLS_SHOWSPIN], [CLS_HIDESPIN]); | ||
} | ||
exports.showSpinner = showSpinner; | ||
function hideSpinner(container) { | ||
var spinnerContainer = container.classList.contains(CLS_SPINWRAP) ? container : | ||
container.querySelector('.' + CLS_SPINWRAP); | ||
var innerContainer = spinnerContainer.querySelector('.' + CLS_SPININWRAP); | ||
if (!spinnerContainer.classList.contains(CLS_SPINTEMPLATE) && !spinnerContainer.classList.contains(CLS_HIDESPIN)) { | ||
var id = spinnerContainer.querySelector('svg').getAttribute('id'); | ||
globalTimeOut[id].isAnimate = false; | ||
switch (globalTimeOut[id].type) { | ||
case 'Material': | ||
case 'Bootstrap': | ||
clearTimeout(globalTimeOut[id].timeOut); | ||
break; | ||
} | ||
} | ||
spinnerContainer.classList.add(CLS_HIDESPIN); | ||
if (spinnerContainer.classList.contains(CLS_SHOWSPIN)) { | ||
spinnerContainer.classList.remove(CLS_SHOWSPIN); | ||
} | ||
showHideSpinner(container, true); | ||
} | ||
@@ -398,0 +389,0 @@ exports.hideSpinner = hideSpinner; |
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 too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7205109
57433
+ Added@syncfusion/ej2-base@15.4.23(transitive)
+ Added@syncfusion/ej2-buttons@15.4.30(transitive)
- Removed@syncfusion/ej2-base@1.0.25(transitive)
- Removed@syncfusion/ej2-buttons@1.0.25(transitive)