@aglyn/shared-util-dom 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +7 -0
- package/package.json +37 -0
- package/src/constants/enums.d.ts +18 -0
- package/src/constants/enums.js +19 -0
- package/src/constants/enums.js.map +1 -0
- package/src/dom.d.ts +100 -0
- package/src/dom.js +51 -0
- package/src/dom.js.map +1 -0
- package/src/index.d.ts +17 -0
- package/src/index.js +18 -0
- package/src/index.js.map +1 -0
- package/src/lib/controllers/page-title.d.ts +47 -0
- package/src/lib/controllers/page-title.js +114 -0
- package/src/lib/controllers/page-title.js.map +1 -0
- package/src/lib/get-element-client-rect-bounding-inner.d.ts +19 -0
- package/src/lib/get-element-client-rect-bounding-inner.js +31 -0
- package/src/lib/get-element-client-rect-bounding-inner.js.map +1 -0
- package/src/lib/get-element-client-rect-bounding.d.ts +39 -0
- package/src/lib/get-element-client-rect-bounding.js +45 -0
- package/src/lib/get-element-client-rect-bounding.js.map +1 -0
- package/src/lib/get-element-clipping-rect.d.ts +26 -0
- package/src/lib/get-element-clipping-rect.js +77 -0
- package/src/lib/get-element-clipping-rect.js.map +1 -0
- package/src/lib/get-element-computed-style.d.ts +18 -0
- package/src/lib/get-element-computed-style.js +22 -0
- package/src/lib/get-element-computed-style.js.map +1 -0
- package/src/lib/get-element-document-element-rect.d.ts +19 -0
- package/src/lib/get-element-document-element-rect.js +43 -0
- package/src/lib/get-element-document-element-rect.js.map +1 -0
- package/src/lib/get-element-document-element.d.ts +18 -0
- package/src/lib/get-element-document-element.js +23 -0
- package/src/lib/get-element-document-element.js.map +1 -0
- package/src/lib/get-element-fragment-rects.d.ts +93 -0
- package/src/lib/get-element-fragment-rects.js +113 -0
- package/src/lib/get-element-fragment-rects.js.map +1 -0
- package/src/lib/get-element-list-scroll-parents.d.ts +19 -0
- package/src/lib/get-element-list-scroll-parents.js +38 -0
- package/src/lib/get-element-list-scroll-parents.js.map +1 -0
- package/src/lib/get-element-node-name.d.ts +18 -0
- package/src/lib/get-element-node-name.js +21 -0
- package/src/lib/get-element-node-name.js.map +1 -0
- package/src/lib/get-element-offset-parent.d.ts +18 -0
- package/src/lib/get-element-offset-parent.js +81 -0
- package/src/lib/get-element-offset-parent.js.map +1 -0
- package/src/lib/get-element-parent-node.d.ts +18 -0
- package/src/lib/get-element-parent-node.js +31 -0
- package/src/lib/get-element-parent-node.js.map +1 -0
- package/src/lib/get-element-rect-as-client-rect.d.ts +19 -0
- package/src/lib/get-element-rect-as-client-rect.js +27 -0
- package/src/lib/get-element-rect-as-client-rect.js.map +1 -0
- package/src/lib/get-element-scroll-parent.d.ts +18 -0
- package/src/lib/get-element-scroll-parent.js +36 -0
- package/src/lib/get-element-scroll-parent.js.map +1 -0
- package/src/lib/get-element-viewport-rect.d.ts +23 -0
- package/src/lib/get-element-viewport-rect.js +57 -0
- package/src/lib/get-element-viewport-rect.js.map +1 -0
- package/src/lib/get-element-window-scroll-bar-x.d.ts +18 -0
- package/src/lib/get-element-window-scroll-bar-x.js +31 -0
- package/src/lib/get-element-window-scroll-bar-x.js.map +1 -0
- package/src/lib/get-event-coordinates.d.ts +22 -0
- package/src/lib/get-event-coordinates.js +49 -0
- package/src/lib/get-event-coordinates.js.map +1 -0
- package/src/lib/get-iframe-document.d.ts +18 -0
- package/src/lib/get-iframe-document.js +29 -0
- package/src/lib/get-iframe-document.js.map +1 -0
- package/src/lib/get-node-window-scroll.d.ts +21 -0
- package/src/lib/get-node-window-scroll.js +28 -0
- package/src/lib/get-node-window-scroll.js.map +1 -0
- package/src/lib/get-node-window.d.ts +18 -0
- package/src/lib/get-node-window.js +34 -0
- package/src/lib/get-node-window.js.map +1 -0
- package/src/lib/get-owner-document.d.ts +2 -0
- package/src/lib/get-owner-document.js +40 -0
- package/src/lib/get-owner-document.js.map +1 -0
- package/src/lib/guards/element-contains-child-element.d.ts +18 -0
- package/src/lib/guards/element-contains-child-element.js +37 -0
- package/src/lib/guards/element-contains-child-element.js.map +1 -0
- package/src/lib/guards/event-has-viewport-coordinates.d.ts +18 -0
- package/src/lib/guards/event-has-viewport-coordinates.js +21 -0
- package/src/lib/guards/event-has-viewport-coordinates.js.map +1 -0
- package/src/lib/guards/is-element-html-element.d.ts +18 -0
- package/src/lib/guards/is-element-html-element.js +26 -0
- package/src/lib/guards/is-element-html-element.js.map +1 -0
- package/src/lib/guards/is-element-scroll-parent-element.d.ts +2 -0
- package/src/lib/guards/is-element-scroll-parent-element.js +24 -0
- package/src/lib/guards/is-element-scroll-parent-element.js.map +1 -0
- package/src/lib/guards/is-element-window.d.ts +18 -0
- package/src/lib/guards/is-element-window.js +22 -0
- package/src/lib/guards/is-element-window.js.map +1 -0
- package/src/lib/guards/is-keyboard-event.d.ts +18 -0
- package/src/lib/guards/is-keyboard-event.js +26 -0
- package/src/lib/guards/is-keyboard-event.js.map +1 -0
- package/src/lib/guards/is-node-element.d.ts +2 -0
- package/src/lib/guards/is-node-element.js +23 -0
- package/src/lib/guards/is-node-element.js.map +1 -0
- package/src/lib/guards/is-node-object.d.ts +18 -0
- package/src/lib/guards/is-node-object.js +21 -0
- package/src/lib/guards/is-node-object.js.map +1 -0
- package/src/lib/guards/is-node-shadow-root.d.ts +2 -0
- package/src/lib/guards/is-node-shadow-root.js +27 -0
- package/src/lib/guards/is-node-shadow-root.js.map +1 -0
- package/src/lib/guards/is-node-table-element.d.ts +2 -0
- package/src/lib/guards/is-node-table-element.js +26 -0
- package/src/lib/guards/is-node-table-element.js.map +1 -0
- package/src/lib/guards/is-node-window-document.d.ts +18 -0
- package/src/lib/guards/is-node-window-document.js +23 -0
- package/src/lib/guards/is-node-window-document.js.map +1 -0
- package/src/lib/guards/is-svg-element.d.ts +2 -0
- package/src/lib/guards/is-svg-element.js +22 -0
- package/src/lib/guards/is-svg-element.js.map +1 -0
- package/src/lib/guards/is-touch-event.d.ts +18 -0
- package/src/lib/guards/is-touch-event.js +26 -0
- package/src/lib/guards/is-touch-event.js.map +1 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getElementWindowScrollBarX(element: Element): number;
|
|
18
|
+
export default getElementWindowScrollBarX;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { getElementClientRectBounding } from "./get-element-client-rect-bounding.js";
|
|
17
|
+
import { getElementDocumentElement } from "./get-element-document-element.js";
|
|
18
|
+
import { getNodeWindowScroll } from "./get-node-window-scroll.js";
|
|
19
|
+
export function getElementWindowScrollBarX(element) {
|
|
20
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
21
|
+
// incorrect for RTL.
|
|
22
|
+
// Popper 1 is broken in this case and never had a bug report so let's assume
|
|
23
|
+
// it's not an issue. I don't think anyone ever specifies width on <html>
|
|
24
|
+
// anyway.
|
|
25
|
+
// Browsers where the left scrollbar doesn't cause an issue report `0` for
|
|
26
|
+
// this (e.g. Edge 2019, IE11, Safari)
|
|
27
|
+
return getElementClientRectBounding(getElementDocumentElement(element)).left + getNodeWindowScroll(element).scrollLeft;
|
|
28
|
+
}
|
|
29
|
+
export default getElementWindowScrollBarX;
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=get-element-window-scroll-bar-x.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/util/dom/src/lib/get-element-window-scroll-bar-x.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {getElementClientRectBounding} from './get-element-client-rect-bounding'\nimport {getElementDocumentElement} from './get-element-document-element'\nimport {getNodeWindowScroll} from './get-node-window-scroll'\n\n\nexport function getElementWindowScrollBarX(element: Element): number {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on <html>\n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return (\n getElementClientRectBounding(getElementDocumentElement(element)).left +\n getNodeWindowScroll(element).scrollLeft\n )\n}\nexport default getElementWindowScrollBarX\n"],"names":["getElementClientRectBounding","getElementDocumentElement","getNodeWindowScroll","getElementWindowScrollBarX","element","left","scrollLeft"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SAAQA,4BAA4B,QAAO,wCAAoC;AAC/E,SAAQC,yBAAyB,QAAO,oCAAgC;AACxE,SAAQC,mBAAmB,QAAO,8BAA0B;AAG5D,OAAO,SAASC,2BAA2BC,OAAgB;IACzD,yEAAyE;IACzE,qBAAqB;IACrB,6EAA6E;IAC7E,yEAAyE;IACzE,UAAU;IACV,0EAA0E;IAC1E,sCAAsC;IACtC,OACEJ,6BAA6BC,0BAA0BG,UAAUC,IAAI,GACrEH,oBAAoBE,SAASE,UAAU;AAE3C;AACA,eAAeH,2BAA0B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { Coordinates } from '../dom';
|
|
18
|
+
/**
|
|
19
|
+
* Returns the denormalized x and y coordinates for mouse and touch events.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getEventCoordinates(event: Event): Coordinates;
|
|
22
|
+
export default getEventCoordinates;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { eventHasViewportCoordinates } from "./guards/event-has-viewport-coordinates.js";
|
|
17
|
+
import { isTouchEvent } from "./guards/is-touch-event.js";
|
|
18
|
+
/**
|
|
19
|
+
* Returns the denormalized x and y coordinates for mouse and touch events.
|
|
20
|
+
*/ export function getEventCoordinates(event) {
|
|
21
|
+
if (isTouchEvent(event)) {
|
|
22
|
+
if (event.touches && event.touches.length) {
|
|
23
|
+
const { clientX: x, clientY: y } = event.touches[0];
|
|
24
|
+
return {
|
|
25
|
+
x,
|
|
26
|
+
y
|
|
27
|
+
};
|
|
28
|
+
} else if (event.changedTouches && event.changedTouches.length) {
|
|
29
|
+
const { clientX: x, clientY: y } = event.changedTouches[0];
|
|
30
|
+
return {
|
|
31
|
+
x,
|
|
32
|
+
y
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (eventHasViewportCoordinates(event)) {
|
|
37
|
+
return {
|
|
38
|
+
x: event.clientX,
|
|
39
|
+
y: event.clientY
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
x: 0,
|
|
44
|
+
y: 0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export default getEventCoordinates;
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=get-event-coordinates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/util/dom/src/lib/get-event-coordinates.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Coordinates } from '../dom'\nimport { eventHasViewportCoordinates } from './guards/event-has-viewport-coordinates'\nimport { isTouchEvent } from './guards/is-touch-event'\n\n/**\n * Returns the denormalized x and y coordinates for mouse and touch events.\n */\nexport function getEventCoordinates(event: Event): Coordinates {\n if (isTouchEvent(event)) {\n if (event.touches && event.touches.length) {\n const { clientX: x, clientY: y } = event.touches[0]\n\n return {\n x,\n y,\n }\n } else if (event.changedTouches && event.changedTouches.length) {\n const { clientX: x, clientY: y } = event.changedTouches[0]\n\n return {\n x,\n y,\n }\n }\n }\n\n if (eventHasViewportCoordinates(event)) {\n return {\n x: event.clientX,\n y: event.clientY,\n }\n }\n\n return {\n x: 0,\n y: 0,\n }\n}\nexport default getEventCoordinates\n"],"names":["eventHasViewportCoordinates","isTouchEvent","getEventCoordinates","event","touches","length","clientX","x","clientY","y","changedTouches"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SAASA,2BAA2B,QAAQ,6CAAyC;AACrF,SAASC,YAAY,QAAQ,6BAAyB;AAEtD;;CAEC,GACD,OAAO,SAASC,oBAAoBC,KAAY;IAC9C,IAAIF,aAAaE,QAAQ;QACvB,IAAIA,MAAMC,OAAO,IAAID,MAAMC,OAAO,CAACC,MAAM,EAAE;YACzC,MAAM,EAAEC,SAASC,CAAC,EAAEC,SAASC,CAAC,EAAE,GAAGN,MAAMC,OAAO,CAAC,EAAE;YAEnD,OAAO;gBACLG;gBACAE;YACF;QACF,OAAO,IAAIN,MAAMO,cAAc,IAAIP,MAAMO,cAAc,CAACL,MAAM,EAAE;YAC9D,MAAM,EAAEC,SAASC,CAAC,EAAEC,SAASC,CAAC,EAAE,GAAGN,MAAMO,cAAc,CAAC,EAAE;YAE1D,OAAO;gBACLH;gBACAE;YACF;QACF;IACF;IAEA,IAAIT,4BAA4BG,QAAQ;QACtC,OAAO;YACLI,GAAGJ,MAAMG,OAAO;YAChBG,GAAGN,MAAMK,OAAO;QAClB;IACF;IAEA,OAAO;QACLD,GAAG;QACHE,GAAG;IACL;AACF;AACA,eAAeP,oBAAmB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getIframeDocument(element: HTMLIFrameElement): Document;
|
|
18
|
+
export default getIframeDocument;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
17
|
+
export function getIframeDocument(element) {
|
|
18
|
+
var _element_id;
|
|
19
|
+
if (hasOwnProperty.call(element, 'contentDocument')) {
|
|
20
|
+
return element.contentDocument;
|
|
21
|
+
}
|
|
22
|
+
if (hasOwnProperty.call(element, 'contentWindow')) {
|
|
23
|
+
return element.contentWindow.document;
|
|
24
|
+
}
|
|
25
|
+
return window.frames[(_element_id = element.id) != null ? _element_id : element.id = 'iframe'].document;
|
|
26
|
+
}
|
|
27
|
+
export default getIframeDocument;
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=get-iframe-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/util/dom/src/lib/get-iframe-document.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\n\nexport function getIframeDocument(element: HTMLIFrameElement): Document {\n if (hasOwnProperty.call(element, 'contentDocument')) {\n return element.contentDocument\n }\n if (hasOwnProperty.call(element, 'contentWindow')) {\n return element.contentWindow.document\n }\n\n return window.frames[element.id ?? (element.id = 'iframe')].document\n}\n\nexport default getIframeDocument\n"],"names":["hasOwnProperty","Object","prototype","getIframeDocument","element","call","contentDocument","contentWindow","document","window","frames","id"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,MAAMA,iBAAiBC,OAAOC,SAAS,CAACF,cAAc;AAEtD,OAAO,SAASG,kBAAkBC,OAA0B;QAQrCA;IAPrB,IAAIJ,eAAeK,IAAI,CAACD,SAAS,oBAAoB;QACnD,OAAOA,QAAQE,eAAe;IAChC;IACA,IAAIN,eAAeK,IAAI,CAACD,SAAS,kBAAkB;QACjD,OAAOA,QAAQG,aAAa,CAACC,QAAQ;IACvC;IAEA,OAAOC,OAAOC,MAAM,EAACN,cAAAA,QAAQO,EAAE,YAAVP,cAAeA,QAAQO,EAAE,GAAG,SAAU,CAACH,QAAQ;AACtE;AAEA,eAAeL,kBAAiB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getNodeWindowScroll(node: Node | Window): {
|
|
18
|
+
scrollLeft: number;
|
|
19
|
+
scrollTop: number;
|
|
20
|
+
};
|
|
21
|
+
export default getNodeWindowScroll;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { getNodeWindow } from "./get-node-window.js";
|
|
17
|
+
export function getNodeWindowScroll(node) {
|
|
18
|
+
const win = getNodeWindow(node);
|
|
19
|
+
const scrollLeft = win['pageXOffset'];
|
|
20
|
+
const scrollTop = win['pageYOffset'];
|
|
21
|
+
return {
|
|
22
|
+
scrollLeft,
|
|
23
|
+
scrollTop
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export default getNodeWindowScroll;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=get-node-window-scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/util/dom/src/lib/get-node-window-scroll.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nimport {getNodeWindow} from './get-node-window'\n\n\nexport function getNodeWindowScroll(node: Node | Window) {\n const win = getNodeWindow(node)\n const scrollLeft = win['pageXOffset']\n const scrollTop = win['pageYOffset']\n\n return {\n scrollLeft,\n scrollTop,\n }\n}\nexport default getNodeWindowScroll\n"],"names":["getNodeWindow","getNodeWindowScroll","node","win","scrollLeft","scrollTop"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SAAQA,aAAa,QAAO,uBAAmB;AAG/C,OAAO,SAASC,oBAAoBC,IAAmB;IACrD,MAAMC,MAAMH,cAAcE;IAC1B,MAAME,aAAaD,GAAG,CAAC,cAAc;IACrC,MAAME,YAAYF,GAAG,CAAC,cAAc;IAEpC,OAAO;QACLC;QACAC;IACF;AACF;AACA,eAAeJ,oBAAmB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getNodeWindow(target?: Event['target']): typeof window;
|
|
18
|
+
export default getNodeWindow;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { isElementWindow } from "./guards/is-element-window.js";
|
|
17
|
+
import { isNodeObject } from "./guards/is-node-object.js";
|
|
18
|
+
export function getNodeWindow(target) {
|
|
19
|
+
var _ref;
|
|
20
|
+
var _target_ownerDocument;
|
|
21
|
+
if (!target) {
|
|
22
|
+
return window;
|
|
23
|
+
}
|
|
24
|
+
if (isElementWindow(target)) {
|
|
25
|
+
return target;
|
|
26
|
+
}
|
|
27
|
+
if (!isNodeObject(target)) {
|
|
28
|
+
return window;
|
|
29
|
+
}
|
|
30
|
+
return (_ref = (_target_ownerDocument = target.ownerDocument) == null ? void 0 : _target_ownerDocument.defaultView) != null ? _ref : window;
|
|
31
|
+
}
|
|
32
|
+
export default getNodeWindow;
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=get-node-window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/util/dom/src/lib/get-node-window.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {isElementWindow} from './guards/is-element-window'\nimport {isNodeObject} from './guards/is-node-object'\n\n\nexport function getNodeWindow(target?: Event['target']): typeof window {\n if (!target) {\n return window\n }\n\n if (isElementWindow(target)) {\n return target\n }\n\n if (!isNodeObject(target)) {\n return window\n }\n\n return target.ownerDocument?.defaultView ?? window\n}\nexport default getNodeWindow\n"],"names":["isElementWindow","isNodeObject","getNodeWindow","target","window","ownerDocument","defaultView"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAAQA,eAAe,QAAO,gCAA4B;AAC1D,SAAQC,YAAY,QAAO,6BAAyB;AAGpD,OAAO,SAASC,cAAcC,MAAwB;;QAa7CA;IAZP,IAAI,CAACA,QAAQ;QACX,OAAOC;IACT;IAEA,IAAIJ,gBAAgBG,SAAS;QAC3B,OAAOA;IACT;IAEA,IAAI,CAACF,aAAaE,SAAS;QACzB,OAAOC;IACT;IAEA,gBAAOD,wBAAAA,OAAOE,aAAa,qBAApBF,sBAAsBG,WAAW,mBAAIF;AAC9C;AACA,eAAeF,cAAa"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { isElementHTMLElement } from "./guards/is-element-html-element.js";
|
|
17
|
+
import { isElementWindow } from "./guards/is-element-window.js";
|
|
18
|
+
import { isNodeObject } from "./guards/is-node-object.js";
|
|
19
|
+
import isNodeDocument from "./guards/is-node-window-document.js";
|
|
20
|
+
export function getOwnerDocument(target) {
|
|
21
|
+
if (!target) {
|
|
22
|
+
return document;
|
|
23
|
+
}
|
|
24
|
+
if (isElementWindow(target)) {
|
|
25
|
+
return target.document;
|
|
26
|
+
}
|
|
27
|
+
if (!isNodeObject(target)) {
|
|
28
|
+
return document;
|
|
29
|
+
}
|
|
30
|
+
if (isNodeDocument(target)) {
|
|
31
|
+
return target;
|
|
32
|
+
}
|
|
33
|
+
if (isElementHTMLElement(target)) {
|
|
34
|
+
return target.ownerDocument;
|
|
35
|
+
}
|
|
36
|
+
return document;
|
|
37
|
+
}
|
|
38
|
+
export default getOwnerDocument;
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=get-owner-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/shared/util/dom/src/lib/get-owner-document.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {isElementHTMLElement} from './guards/is-element-html-element'\nimport {isElementWindow} from './guards/is-element-window'\nimport {isNodeObject} from './guards/is-node-object'\nimport isNodeDocument from './guards/is-node-window-document'\n\n\nexport function getOwnerDocument(target: Event['target']): Document {\n if (!target) {\n return document\n }\n\n if (isElementWindow(target)) {\n return target.document\n }\n\n if (!isNodeObject(target)) {\n return document\n }\n\n if (isNodeDocument(target)) {\n return target\n }\n\n if (isElementHTMLElement(target)) {\n return target.ownerDocument\n }\n\n return document\n}\nexport default getOwnerDocument\n"],"names":["isElementHTMLElement","isElementWindow","isNodeObject","isNodeDocument","getOwnerDocument","target","document","ownerDocument"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD,SAAQA,oBAAoB,QAAO,sCAAkC;AACrE,SAAQC,eAAe,QAAO,gCAA4B;AAC1D,SAAQC,YAAY,QAAO,6BAAyB;AACpD,OAAOC,oBAAoB,sCAAkC;AAG7D,OAAO,SAASC,iBAAiBC,MAAuB;IACtD,IAAI,CAACA,QAAQ;QACX,OAAOC;IACT;IAEA,IAAIL,gBAAgBI,SAAS;QAC3B,OAAOA,OAAOC,QAAQ;IACxB;IAEA,IAAI,CAACJ,aAAaG,SAAS;QACzB,OAAOC;IACT;IAEA,IAAIH,eAAeE,SAAS;QAC1B,OAAOA;IACT;IAEA,IAAIL,qBAAqBK,SAAS;QAChC,OAAOA,OAAOE,aAAa;IAC7B;IAEA,OAAOD;AACT;AACA,eAAeF,iBAAgB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function elementContainsChildElement(parent: Element, child: Element): boolean;
|
|
18
|
+
export default elementContainsChildElement;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import isNodeShadowRoot from "./is-node-shadow-root.js";
|
|
17
|
+
export function elementContainsChildElement(parent, child) {
|
|
18
|
+
const rootNode = child.getRootNode && child.getRootNode();
|
|
19
|
+
// First, attempt with faster native method
|
|
20
|
+
if (parent.contains(child)) {
|
|
21
|
+
return true;
|
|
22
|
+
} else if (rootNode && isNodeShadowRoot(rootNode)) {
|
|
23
|
+
let next = child;
|
|
24
|
+
do {
|
|
25
|
+
if (next && parent.isSameNode(next)) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
// $FlowFixMe[prop-missing]: need a better way to handle this...
|
|
29
|
+
next = next.parentNode || next['host'];
|
|
30
|
+
}while (next)
|
|
31
|
+
}
|
|
32
|
+
// Give up, the result is false
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
export default elementContainsChildElement;
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=element-contains-child-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/util/dom/src/lib/guards/element-contains-child-element.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport isNodeShadowRoot from './is-node-shadow-root'\n\n\nexport function elementContainsChildElement(parent: Element, child: Element) {\n const rootNode = child.getRootNode && child.getRootNode()\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true\n }\n // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isNodeShadowRoot(rootNode)) {\n let next = child\n do {\n if (next && parent.isSameNode(next)) {\n return true\n }\n // $FlowFixMe[prop-missing]: need a better way to handle this...\n next = next.parentNode || next['host']\n } while (next)\n }\n\n // Give up, the result is false\n return false\n}\nexport default elementContainsChildElement\n"],"names":["isNodeShadowRoot","elementContainsChildElement","parent","child","rootNode","getRootNode","contains","next","isSameNode","parentNode"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAOA,sBAAsB,2BAAuB;AAGpD,OAAO,SAASC,4BAA4BC,MAAe,EAAEC,KAAc;IACzE,MAAMC,WAAWD,MAAME,WAAW,IAAIF,MAAME,WAAW;IAEvD,2CAA2C;IAC3C,IAAIH,OAAOI,QAAQ,CAACH,QAAQ;QAC1B,OAAO;IACT,OAEK,IAAIC,YAAYJ,iBAAiBI,WAAW;QAC/C,IAAIG,OAAOJ;QACX,GAAG;YACD,IAAII,QAAQL,OAAOM,UAAU,CAACD,OAAO;gBACnC,OAAO;YACT;YACA,gEAAgE;YAChEA,OAAOA,KAAKE,UAAU,IAAIF,IAAI,CAAC,OAAO;QACxC,QAASA,KAAK;IAChB;IAEA,+BAA+B;IAC/B,OAAO;AACT;AACA,eAAeN,4BAA2B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function eventHasViewportCoordinates(event: Event): event is Event & Pick<PointerEvent, 'clientX' | 'clientY'>;
|
|
18
|
+
export default eventHasViewportCoordinates;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ export function eventHasViewportCoordinates(event) {
|
|
17
|
+
return 'clientX' in event && 'clientY' in event;
|
|
18
|
+
}
|
|
19
|
+
export default eventHasViewportCoordinates;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=event-has-viewport-coordinates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/util/dom/src/lib/guards/event-has-viewport-coordinates.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nexport function eventHasViewportCoordinates(\n event: Event,\n): event is Event & Pick<PointerEvent, 'clientX' | 'clientY'> {\n return 'clientX' in event && 'clientY' in event\n}\nexport default eventHasViewportCoordinates\n"],"names":["eventHasViewportCoordinates","event"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,OAAO,SAASA,4BACdC,KAAY;IAEZ,OAAO,aAAaA,SAAS,aAAaA;AAC5C;AACA,eAAeD,4BAA2B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isElementHTMLElement(node: Node | Window): node is HTMLElement;
|
|
18
|
+
export default isElementHTMLElement;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import getNodeWindow from "../get-node-window.js";
|
|
17
|
+
import isElementWindow from "./is-element-window.js";
|
|
18
|
+
export function isElementHTMLElement(node) {
|
|
19
|
+
if (isElementWindow(node)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return node instanceof getNodeWindow(node).HTMLElement;
|
|
23
|
+
}
|
|
24
|
+
export default isElementHTMLElement;
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=is-element-html-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/util/dom/src/lib/guards/is-element-html-element.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport getNodeWindow from '../get-node-window'\nimport isElementWindow from './is-element-window'\n\n\nexport function isElementHTMLElement(node: Node | Window): node is HTMLElement {\n if (isElementWindow(node)) {\n return false\n }\n\n return node instanceof getNodeWindow(node).HTMLElement\n}\n\nexport default isElementHTMLElement\n"],"names":["getNodeWindow","isElementWindow","isElementHTMLElement","node","HTMLElement"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAOA,mBAAmB,wBAAoB;AAC9C,OAAOC,qBAAqB,yBAAqB;AAGjD,OAAO,SAASC,qBAAqBC,IAAmB;IACtD,IAAIF,gBAAgBE,OAAO;QACzB,OAAO;IACT;IAEA,OAAOA,gBAAgBH,cAAcG,MAAMC,WAAW;AACxD;AAEA,eAAeF,qBAAoB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import getElementComputedStyle from "../get-element-computed-style.js";
|
|
17
|
+
export function isElementScrollParentElement(element) {
|
|
18
|
+
// Firefox wants us to check `-x` and `-y` variations as well
|
|
19
|
+
const { overflow, overflowX, overflowY } = getElementComputedStyle(element);
|
|
20
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
21
|
+
}
|
|
22
|
+
export default isElementScrollParentElement;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=is-element-scroll-parent-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/util/dom/src/lib/guards/is-element-scroll-parent-element.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport getElementComputedStyle from '../get-element-computed-style'\n\n\nexport function isElementScrollParentElement(element: Element): boolean {\n // Firefox wants us to check `-x` and `-y` variations as well\n const {overflow, overflowX, overflowY} = getElementComputedStyle(element)\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n\nexport default isElementScrollParentElement\n"],"names":["getElementComputedStyle","isElementScrollParentElement","element","overflow","overflowX","overflowY","test"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD,OAAOA,6BAA6B,mCAA+B;AAGnE,OAAO,SAASC,6BAA6BC,OAAgB;IAC3D,6DAA6D;IAC7D,MAAM,EAACC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,EAAC,GAAGL,wBAAwBE;IACjE,OAAO,6BAA6BI,IAAI,CAACH,WAAWE,YAAYD;AAClE;AAEA,eAAeH,6BAA4B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isElementWindow(element: any): element is typeof window;
|
|
18
|
+
export default isElementWindow;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ const toString = Object.prototype.toString;
|
|
17
|
+
export function isElementWindow(element) {
|
|
18
|
+
return toString.call(element) === '[object Window]';
|
|
19
|
+
}
|
|
20
|
+
export default isElementWindow;
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=is-element-window.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/util/dom/src/lib/guards/is-element-window.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst toString = Object.prototype.toString\n\nexport function isElementWindow(element: any): element is typeof window {\n return toString.call(element) === '[object Window]'\n}\n\nexport default isElementWindow\n"],"names":["toString","Object","prototype","isElementWindow","element","call"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,MAAMA,WAAWC,OAAOC,SAAS,CAACF,QAAQ;AAE1C,OAAO,SAASG,gBAAgBC,OAAY;IAC1C,OAAOJ,SAASK,IAAI,CAACD,aAAa;AACpC;AAEA,eAAeD,gBAAe"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isKeyboardEvent(event: Event | undefined | null): event is KeyboardEvent;
|
|
18
|
+
export default isKeyboardEvent;
|