diff --git a/packages/devextreme/js/__internal/events/m_visibility_change.ts b/packages/devextreme/js/__internal/events/m_visibility_change.ts index 623329c76d45..34734551acd4 100644 --- a/packages/devextreme/js/__internal/events/m_visibility_change.ts +++ b/packages/devextreme/js/__internal/events/m_visibility_change.ts @@ -1,22 +1,28 @@ -import $ from '../core/renderer'; -import eventsEngine from './core/events_engine'; +import $ from '@js/core/renderer'; +import eventsEngine from '@js/events/core/events_engine'; -const triggerVisibilityChangeEvent = function(eventName) { - const VISIBILITY_CHANGE_SELECTOR = '.dx-visibility-change-handler'; +const triggerVisibilityChangeEvent = function (eventName) { + const VISIBILITY_CHANGE_SELECTOR = '.dx-visibility-change-handler'; - return function(element) { - const $element = $(element || 'body'); + return function (element) { + const $element = $(element || 'body'); - const changeHandlers = $element.filter(VISIBILITY_CHANGE_SELECTOR). - add($element.find(VISIBILITY_CHANGE_SELECTOR)); + const changeHandlers = $element.filter(VISIBILITY_CHANGE_SELECTOR) + // @ts-expect-error + .add($element.find(VISIBILITY_CHANGE_SELECTOR)); - for(let i = 0; i < changeHandlers.length; i++) { - eventsEngine.triggerHandler(changeHandlers[i], eventName); - } - }; + for (let i = 0; i < changeHandlers.length; i++) { + eventsEngine.triggerHandler(changeHandlers[i], eventName); + } + }; }; +const triggerShownEvent = triggerVisibilityChangeEvent('dxshown'); +const triggerHidingEvent = triggerVisibilityChangeEvent('dxhiding'); +const triggerResizeEvent = triggerVisibilityChangeEvent('dxresize'); -export const triggerShownEvent = triggerVisibilityChangeEvent('dxshown'); -export const triggerHidingEvent = triggerVisibilityChangeEvent('dxhiding'); -export const triggerResizeEvent = triggerVisibilityChangeEvent('dxresize'); +export { + triggerHidingEvent, + triggerResizeEvent, + triggerShownEvent, +}; diff --git a/packages/devextreme/js/events/visibility_change.js b/packages/devextreme/js/events/visibility_change.js new file mode 100644 index 000000000000..11c982814886 --- /dev/null +++ b/packages/devextreme/js/events/visibility_change.js @@ -0,0 +1,5 @@ +export { + triggerHidingEvent, + triggerShownEvent, + triggerResizeEvent +} from '../__internal/events/m_visibility_change';