Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
search-page
Commits
6cc198bf
Commit
6cc198bf
authored
Dec 26, 2020
by
Sangjune Bae
Browse files
first commit
parent
81c6da4b
Changes
760
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
760 of 760+
files are displayed.
Plain diff
Email patch
node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
0 → 100644
View file @
6cc198bf
export
default
function
getHTMLElementScroll
(
element
)
{
return
{
scrollLeft
:
element
.
scrollLeft
,
scrollTop
:
element
.
scrollTop
};
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js.flow
0 → 100644
View file @
6cc198bf
// @flow
export default function getHTMLElementScroll(element: HTMLElement) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop,
};
}
node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.d.ts
0 → 100644
View file @
6cc198bf
import
{
Rect
}
from
"
../types
"
;
export
default
function
getLayoutRect
(
element
:
HTMLElement
):
Rect
;
node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
0 → 100644
View file @
6cc198bf
// Returns the layout rect of an element relative to its offsetParent. Layout
// means it doesn't take into account transforms.
export
default
function
getLayoutRect
(
element
)
{
return
{
x
:
element
.
offsetLeft
,
y
:
element
.
offsetTop
,
width
:
element
.
offsetWidth
,
height
:
element
.
offsetHeight
};
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import type { Rect } from '../types';
// Returns the layout rect of an element relative to its offsetParent. Layout
// means it doesn't take into account transforms.
export default function getLayoutRect(element: HTMLElement): Rect {
return {
x: element.offsetLeft,
y: element.offsetTop,
width: element.offsetWidth,
height: element.offsetHeight,
};
}
node_modules/@popperjs/core/lib/dom-utils/getNodeName.d.ts
0 → 100644
View file @
6cc198bf
import
{
Window
}
from
"
../types
"
;
export
default
function
getNodeName
(
element
:
(
Node
|
null
|
undefined
)
|
Window
):
string
|
null
|
undefined
;
node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
0 → 100644
View file @
6cc198bf
export
default
function
getNodeName
(
element
)
{
return
element
?
(
element
.
nodeName
||
''
).
toLowerCase
()
:
null
;
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getNodeName.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import type { Window } from '../types';
export default function getNodeName(element: ?Node | Window): ?string {
return element ? (element.nodeName || '').toLowerCase() : null;
}
node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.d.ts
0 → 100644
View file @
6cc198bf
import
{
Window
}
from
"
../types
"
;
export
default
function
getNodeScroll
(
node
:
Node
|
Window
):
any
;
node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
0 → 100644
View file @
6cc198bf
import
getWindowScroll
from
"
./getWindowScroll.js
"
;
import
getWindow
from
"
./getWindow.js
"
;
import
{
isHTMLElement
}
from
"
./instanceOf.js
"
;
import
getHTMLElementScroll
from
"
./getHTMLElementScroll.js
"
;
export
default
function
getNodeScroll
(
node
)
{
if
(
node
===
getWindow
(
node
)
||
!
isHTMLElement
(
node
))
{
return
getWindowScroll
(
node
);
}
else
{
return
getHTMLElementScroll
(
node
);
}
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getWindowScroll from './getWindowScroll';
import getWindow from './getWindow';
import { isHTMLElement } from './instanceOf';
import getHTMLElementScroll from './getHTMLElementScroll';
import type { Window } from '../types';
export default function getNodeScroll(node: Node | Window) {
if (node === getWindow(node) || !isHTMLElement(node)) {
return getWindowScroll(node);
} else {
return getHTMLElementScroll(node);
}
}
node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.d.ts
0 → 100644
View file @
6cc198bf
export
default
function
getOffsetParent
(
element
:
Element
):
any
;
node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
0 → 100644
View file @
6cc198bf
import
getWindow
from
"
./getWindow.js
"
;
import
getNodeName
from
"
./getNodeName.js
"
;
import
getComputedStyle
from
"
./getComputedStyle.js
"
;
import
{
isHTMLElement
}
from
"
./instanceOf.js
"
;
import
isTableElement
from
"
./isTableElement.js
"
;
import
getParentNode
from
"
./getParentNode.js
"
;
import
getDocumentElement
from
"
./getDocumentElement.js
"
;
function
getTrueOffsetParent
(
element
)
{
if
(
!
isHTMLElement
(
element
)
||
// https://github.com/popperjs/popper-core/issues/837
getComputedStyle
(
element
).
position
===
'
fixed
'
)
{
return
null
;
}
var
offsetParent
=
element
.
offsetParent
;
if
(
offsetParent
)
{
var
html
=
getDocumentElement
(
offsetParent
);
if
(
getNodeName
(
offsetParent
)
===
'
body
'
&&
getComputedStyle
(
offsetParent
).
position
===
'
static
'
&&
getComputedStyle
(
html
).
position
!==
'
static
'
)
{
return
html
;
}
}
return
offsetParent
;
}
// `.offsetParent` reports `null` for fixed elements, while absolute elements
// return the containing block
function
getContainingBlock
(
element
)
{
var
currentNode
=
getParentNode
(
element
);
while
(
isHTMLElement
(
currentNode
)
&&
[
'
html
'
,
'
body
'
].
indexOf
(
getNodeName
(
currentNode
))
<
0
)
{
var
css
=
getComputedStyle
(
currentNode
);
// This is non-exhaustive but covers the most common CSS properties that
// create a containing block.
if
(
css
.
transform
!==
'
none
'
||
css
.
perspective
!==
'
none
'
||
css
.
willChange
&&
css
.
willChange
!==
'
auto
'
)
{
return
currentNode
;
}
else
{
currentNode
=
currentNode
.
parentNode
;
}
}
return
null
;
}
// Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.
export
default
function
getOffsetParent
(
element
)
{
var
window
=
getWindow
(
element
);
var
offsetParent
=
getTrueOffsetParent
(
element
);
while
(
offsetParent
&&
isTableElement
(
offsetParent
)
&&
getComputedStyle
(
offsetParent
).
position
===
'
static
'
)
{
offsetParent
=
getTrueOffsetParent
(
offsetParent
);
}
if
(
offsetParent
&&
getNodeName
(
offsetParent
)
===
'
body
'
&&
getComputedStyle
(
offsetParent
).
position
===
'
static
'
)
{
return
window
;
}
return
offsetParent
||
getContainingBlock
(
element
)
||
window
;
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getWindow from './getWindow';
import getNodeName from './getNodeName';
import getComputedStyle from './getComputedStyle';
import { isHTMLElement } from './instanceOf';
import isTableElement from './isTableElement';
import getParentNode from './getParentNode';
import getDocumentElement from './getDocumentElement';
function getTrueOffsetParent(element: Element): ?Element {
if (
!isHTMLElement(element) ||
// https://github.com/popperjs/popper-core/issues/837
getComputedStyle(element).position === 'fixed'
) {
return null;
}
const offsetParent = element.offsetParent;
if (offsetParent) {
const html = getDocumentElement(offsetParent);
if (
getNodeName(offsetParent) === 'body' &&
getComputedStyle(offsetParent).position === 'static' &&
getComputedStyle(html).position !== 'static'
) {
return html;
}
}
return offsetParent;
}
// `.offsetParent` reports `null` for fixed elements, while absolute elements
// return the containing block
function getContainingBlock(element: Element) {
let currentNode = getParentNode(element);
while (
isHTMLElement(currentNode) &&
['html', 'body'].indexOf(getNodeName(currentNode)) < 0
) {
const css = getComputedStyle(currentNode);
// This is non-exhaustive but covers the most common CSS properties that
// create a containing block.
if (
css.transform !== 'none' ||
css.perspective !== 'none' ||
(css.willChange && css.willChange !== 'auto')
) {
return currentNode;
} else {
currentNode = currentNode.parentNode;
}
}
return null;
}
// Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.
export default function getOffsetParent(element: Element) {
const window = getWindow(element);
let offsetParent = getTrueOffsetParent(element);
while (
offsetParent &&
isTableElement(offsetParent) &&
getComputedStyle(offsetParent).position === 'static'
) {
offsetParent = getTrueOffsetParent(offsetParent);
}
if (
offsetParent &&
getNodeName(offsetParent) === 'body' &&
getComputedStyle(offsetParent).position === 'static'
) {
return window;
}
return offsetParent || getContainingBlock(element) || window;
}
node_modules/@popperjs/core/lib/dom-utils/getParentNode.d.ts
0 → 100644
View file @
6cc198bf
export
default
function
getParentNode
(
element
:
Node
|
ShadowRoot
):
Node
;
node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
0 → 100644
View file @
6cc198bf
import
getNodeName
from
"
./getNodeName.js
"
;
import
getDocumentElement
from
"
./getDocumentElement.js
"
;
export
default
function
getParentNode
(
element
)
{
if
(
getNodeName
(
element
)
===
'
html
'
)
{
return
element
;
}
return
(
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
element
.
assignedSlot
||
// step into the shadow DOM of the parent of a slotted node
element
.
parentNode
||
// DOM Element detected
// $FlowFixMe[incompatible-return]: need a better way to handle this...
element
.
host
||
// ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
getDocumentElement
(
element
)
// fallback
);
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getParentNode.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getNodeName from './getNodeName';
import getDocumentElement from './getDocumentElement';
export default function getParentNode(element: Node | ShadowRoot): Node {
if (getNodeName(element) === 'html') {
return element;
}
return (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
element.parentNode || // DOM Element detected
// $FlowFixMe[incompatible-return]: need a better way to handle this...
element.host || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
getDocumentElement(element) // fallback
);
}
node_modules/@popperjs/core/lib/dom-utils/getScrollParent.d.ts
0 → 100644
View file @
6cc198bf
export
default
function
getScrollParent
(
node
:
Node
):
HTMLElement
;
node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
0 → 100644
View file @
6cc198bf
import
getParentNode
from
"
./getParentNode.js
"
;
import
isScrollParent
from
"
./isScrollParent.js
"
;
import
getNodeName
from
"
./getNodeName.js
"
;
import
{
isHTMLElement
}
from
"
./instanceOf.js
"
;
export
default
function
getScrollParent
(
node
)
{
if
([
'
html
'
,
'
body
'
,
'
#document
'
].
indexOf
(
getNodeName
(
node
))
>=
0
)
{
// $FlowFixMe[incompatible-return]: assume body is always available
return
node
.
ownerDocument
.
body
;
}
if
(
isHTMLElement
(
node
)
&&
isScrollParent
(
node
))
{
return
node
;
}
return
getScrollParent
(
getParentNode
(
node
));
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getParentNode from './getParentNode';
import isScrollParent from './isScrollParent';
import getNodeName from './getNodeName';
import { isHTMLElement } from './instanceOf';
export default function getScrollParent(node: Node): HTMLElement {
if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
// $FlowFixMe[incompatible-return]: assume body is always available
return node.ownerDocument.body;
}
if (isHTMLElement(node) && isScrollParent(node)) {
return node;
}
return getScrollParent(getParentNode(node));
}
Prev
1
…
12
13
14
15
16
17
18
19
20
…
38
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment