@web-atoms/core 2.2.98 → 2.2.103
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/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/controls/AtomControl.js +15 -2
- package/dist/web/controls/AtomControl.js.map +1 -1
- package/dist/web/controls/AtomWindow.js.map +1 -1
- package/dist/web/core/AtomUI.d.ts +8 -1
- package/dist/web/core/AtomUI.d.ts.map +1 -1
- package/dist/web/core/AtomUI.js +2 -2
- package/dist/web/core/AtomUI.js.map +1 -1
- package/package.json +1 -1
- package/src/web/controls/AtomControl.ts +18 -1
- package/src/web/controls/AtomWindow.tsx +342 -342
- package/src/web/core/AtomUI.ts +10 -3
package/src/web/core/AtomUI.ts
CHANGED
|
@@ -6,18 +6,25 @@ export class AncestorEnumerator {
|
|
|
6
6
|
let start = e?.parentElement;
|
|
7
7
|
while (start) {
|
|
8
8
|
if(filter(start)) {
|
|
9
|
-
return start;
|
|
9
|
+
return start as HTMLElement;
|
|
10
10
|
}
|
|
11
11
|
start = start.parentElement;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Finds the parent element that matches given selector. It does not
|
|
17
|
+
* return element that contains the selector.
|
|
18
|
+
* @param e target Element
|
|
19
|
+
* @param selector selector to match
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
15
22
|
public static findSelector(e: HTMLElement, selector: string) {
|
|
16
23
|
let start = e?.parentElement;
|
|
17
24
|
while (start) {
|
|
18
|
-
const found = start.
|
|
25
|
+
const found = start.matches(selector);
|
|
19
26
|
if(found) {
|
|
20
|
-
return
|
|
27
|
+
return start as HTMLElement;
|
|
21
28
|
}
|
|
22
29
|
start = start.parentElement;
|
|
23
30
|
}
|