// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)
10113 // @ts-expect-error ST-2949_2 10114 function matches(selector) { 10115 var matches = document.querySelectorAll(selector); 10117 return Array.prototype.some.call(matches, function (e) { 10121 : // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 10122 // @ts-expect-error ST-2949_1 10123 (e.matches = e.matchesSelector = matches); // eslint-disable-line no-multi-assign 10124})(Element.prototype); 10126// Element.closest() 10127if (!Element.prototype.closest) { 10128 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 10129 // @ts-expect-error ST-2949_2 10130 Element.prototype.closest = function (s) { 10132 while (el && el.nodeType === 1) { 10133 if (Element.prototype.matches.call(el, s)) { 10136 // TODO ST-2949_5: assignability, arguments, calls, return types (TS2345, TS2322, TS2554, TS2769, TS2740, TS2739, TS2353, TS2349, TS2355, TS2366, TS2774, TS18046) 10137 // @ts-expect-error ST-2949_5 10138 el = el.parentElement || el.parentNode; 10144// String.prototype.trim() 10145if (!String.prototype.trim) { 10147 // eslint-disable-next-line no-extend-native 10148 String.prototype.trim = function () { 10149 return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); 10155 * Триггерит пользовательское событие на указанном элементе с переданными данными 10157 * @param {HTMLElement} el - Элемент, на котором будет вызвано событие 10158 * @param {string} eventName - Имя события 10159 * @param {Object} [data] - Данные, передаваемые с событием 10162function t_catalog_triggerEvent(el, eventName, data) { 10165 // События с данными 10166 if (data && window.CustomEvent) { 10167 event = new CustomEvent(eventName, { 10172 el.dispatchEvent(event); 10174 // Когда нет данных, с поддержкой до IE 9 10175 else if (document.createEvent) { 10176 event = document.createEvent('HTMLEvents'); 10177 event.initEvent(eventName, true, false); 10178 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 10179 // @ts-expect-error ST-2949_1 10180 event.eventName = eventName; 10181 el.dispatchEvent(event); 10183 // Остальные браузеры 10184 // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) 10185 // @ts-expect-error ST-2949_1 10186 else if (document.createEventObject) { 10187 // @ts-expect-error ST-2949_1 10188 event = document.createEventObject(); 10189 event.eventType = eventName; 10190 event.eventName = eventName; 10191 // @ts-expect-error ST-2949_1 10192 el.fireEvent('on' + event.eventType, event); 10193 // TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015) 10194 // @ts-expect-error ST-2949_2 10195 } else if (el[eventName]) { 10196 // @ts-expect-error ST-2949_2 10198 // @ts-expect-error ST-2949_2 10199 } else if (el['on' + eventName]) { 10200 // @ts-expect-error ST-2949_2