@hypericon/mico 0.5.8 → 0.5.10
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.
|
@@ -70,6 +70,21 @@ class MenuManager {
|
|
|
70
70
|
yield new Promise((resolve, reject) => {
|
|
71
71
|
setTimeout(() => resolve(), 0);
|
|
72
72
|
});
|
|
73
|
+
// If the target is a menu button, and if the menu button was a child and not in the body container,
|
|
74
|
+
// then ignore the open and just re-hide.
|
|
75
|
+
// This is not ideal, but as the "open menu" action is being triggered by the button,
|
|
76
|
+
// for now, just ignore the "new" menu.
|
|
77
|
+
// This is a workaround for the issue where the menu is opened from a button that is a child of the menu,
|
|
78
|
+
// re-opening itself.
|
|
79
|
+
if ((ev === null || ev === void 0 ? void 0 : ev.target) instanceof HTMLElement && ev.target.closest(".mico-menu-button")) {
|
|
80
|
+
const parentEl = ev.target.parentElement;
|
|
81
|
+
// If there is *not* an ancestor with the "menu-container" class, then ignore the open
|
|
82
|
+
if (parentEl && !parentEl.closest(".menu-container")) {
|
|
83
|
+
menu_settings_1.MENU_SETTINGS.DEBUG_MENU && console.log("Ignoring menu open from button, as it is not in the menu container");
|
|
84
|
+
console.log("Ignoring new menu (current menu attached as child)");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
73
88
|
let y = menu_settings_1.MENU_SETTINGS.ANCHOR === "page" ? ev === null || ev === void 0 ? void 0 : ev.pageY : ev === null || ev === void 0 ? void 0 : ev.clientY;
|
|
74
89
|
// When the event is raised from within a dialog element,
|
|
75
90
|
// automatically set the menu to be a dialog as well.
|
|
@@ -7,7 +7,7 @@ export interface TableColumnDefinitionOptions {
|
|
|
7
7
|
style?: string;
|
|
8
8
|
}
|
|
9
9
|
export type TableColumnDefinition<T> = {
|
|
10
|
-
header:
|
|
10
|
+
header: m.Children;
|
|
11
11
|
cell: TableCellDisplayFn<T>;
|
|
12
12
|
/** Optional settings to tweak the column's behaviour */
|
|
13
13
|
options?: TableColumnDefinitionOptions;
|
|
@@ -70,6 +70,21 @@ class MenuManager {
|
|
|
70
70
|
yield new Promise((resolve, reject) => {
|
|
71
71
|
setTimeout(() => resolve(), 0);
|
|
72
72
|
});
|
|
73
|
+
// If the target is a menu button, and if the menu button was a child and not in the body container,
|
|
74
|
+
// then ignore the open and just re-hide.
|
|
75
|
+
// This is not ideal, but as the "open menu" action is being triggered by the button,
|
|
76
|
+
// for now, just ignore the "new" menu.
|
|
77
|
+
// This is a workaround for the issue where the menu is opened from a button that is a child of the menu,
|
|
78
|
+
// re-opening itself.
|
|
79
|
+
if ((ev === null || ev === void 0 ? void 0 : ev.target) instanceof HTMLElement && ev.target.closest(".mico-menu-button")) {
|
|
80
|
+
const parentEl = ev.target.parentElement;
|
|
81
|
+
// If there is *not* an ancestor with the "menu-container" class, then ignore the open
|
|
82
|
+
if (parentEl && !parentEl.closest(".menu-container")) {
|
|
83
|
+
menu_settings_1.MENU_SETTINGS.DEBUG_MENU && console.log("Ignoring menu open from button, as it is not in the menu container");
|
|
84
|
+
console.log("Ignoring new menu (current menu attached as child)");
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
73
88
|
let y = menu_settings_1.MENU_SETTINGS.ANCHOR === "page" ? ev === null || ev === void 0 ? void 0 : ev.pageY : ev === null || ev === void 0 ? void 0 : ev.clientY;
|
|
74
89
|
// When the event is raised from within a dialog element,
|
|
75
90
|
// automatically set the menu to be a dialog as well.
|
|
@@ -7,7 +7,7 @@ export interface TableColumnDefinitionOptions {
|
|
|
7
7
|
style?: string;
|
|
8
8
|
}
|
|
9
9
|
export type TableColumnDefinition<T> = {
|
|
10
|
-
header:
|
|
10
|
+
header: m.Children;
|
|
11
11
|
cell: TableCellDisplayFn<T>;
|
|
12
12
|
/** Optional settings to tweak the column's behaviour */
|
|
13
13
|
options?: TableColumnDefinitionOptions;
|