@brandup/ui-kit 1.0.24 → 1.0.26

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/package.json CHANGED
@@ -11,22 +11,22 @@
11
11
  "name": "Dmitry Kovyazin",
12
12
  "email": "it@brandup.online"
13
13
  },
14
- "homepage": "https://github.com/brandup-online/brandup-ui/npm/brandup-ui-input",
14
+ "homepage": "https://github.com/brandup-online/brandup-ui-kit/npm/brandup-ui-kit",
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/brandup-online/brandup-ui.git"
17
+ "url": "https://github.com/brandup-online/brandup-ui-kit.git"
18
18
  },
19
19
  "bugs": {
20
- "url": "https://github.com/brandup-online/brandup-ui/issues",
20
+ "url": "https://github.com/brandup-online/brandup-ui-kit/issues",
21
21
  "email": "it@brandup.online"
22
22
  },
23
23
  "type": "module",
24
24
  "license": "Apache-2.0",
25
- "version": "1.0.24",
25
+ "version": "1.0.26",
26
26
  "main": "source/index.ts",
27
27
  "types": "source/index.ts",
28
28
  "dependencies": {
29
- "@brandup/ui-app": "^1.0.40"
29
+ "@brandup/ui-app": "^1.0.44"
30
30
  },
31
31
  "files": [
32
32
  "source",
package/source/popup.ts CHANGED
@@ -15,10 +15,12 @@ const closePopupEventHandler = (e: MouseEvent) => {
15
15
  if (target.closest(`.${POPUP_CLASS}`))
16
16
  return; // если клик внутри popup, то делать ничего не нужно
17
17
 
18
+ const clickedMenuItem = target.closest(`.${POPUP_EXPANDED_CLASS}`);
19
+ const isInitiator = target == current?.initiator;
20
+
18
21
  close();
19
22
 
20
- const clickedMenuItem = target.closest(`.${POPUP_EXPANDED_CLASS}`);
21
- if (clickedMenuItem || target == current?.initiator) {
23
+ if (clickedMenuItem || isInitiator) {
22
24
  // если клик по тому же элементу, который открыл контекстное меню, то останавливаем обработку клика, чтобы оно не отрылось заново
23
25
 
24
26
  e.preventDefault();
@@ -33,6 +35,8 @@ const close = () => {
33
35
 
34
36
  current.initiator?.classList.remove(POPUP_EXPANDED_CLASS); // закрываем последнее открытое контекстное меню
35
37
  current.popup.classList.remove("opened");
38
+
39
+ current = null;
36
40
  }
37
41
 
38
42
  document.body.removeEventListener("click", closePopupEventHandler);
@@ -0,0 +1 @@
1
+ declare module "*.less";