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/getViewportRect.d.ts
0 → 100644
View file @
6cc198bf
export
default
function
getViewportRect
(
element
:
Element
):
{
width
:
number
;
height
:
number
;
x
:
number
;
y
:
number
;
};
node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
0 → 100644
View file @
6cc198bf
import
getWindow
from
"
./getWindow.js
"
;
import
getDocumentElement
from
"
./getDocumentElement.js
"
;
import
getWindowScrollBarX
from
"
./getWindowScrollBarX.js
"
;
export
default
function
getViewportRect
(
element
)
{
var
win
=
getWindow
(
element
);
var
html
=
getDocumentElement
(
element
);
var
visualViewport
=
win
.
visualViewport
;
var
width
=
html
.
clientWidth
;
var
height
=
html
.
clientHeight
;
var
x
=
0
;
var
y
=
0
;
// NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
// can be obscured underneath it.
// Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
// if it isn't open, so if this isn't available, the popper will be detected
// to overflow the bottom of the screen too early.
if
(
visualViewport
)
{
width
=
visualViewport
.
width
;
height
=
visualViewport
.
height
;
// Uses Layout Viewport (like Chrome; Safari does not currently)
// In Chrome, it returns a value very close to 0 (+/-) but contains rounding
// errors due to floating point numbers, so we need to check precision.
// Safari returns a number <= 0, usually < -1 when pinch-zoomed
// Feature detection fails in mobile emulation mode in Chrome.
// Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
// 0.001
// Fallback here: "Not Safari" userAgent
if
(
!
/^
((?!
chrome|android
)
.
)
*safari/i
.
test
(
navigator
.
userAgent
))
{
x
=
visualViewport
.
offsetLeft
;
y
=
visualViewport
.
offsetTop
;
}
}
return
{
width
:
width
,
height
:
height
,
x
:
x
+
getWindowScrollBarX
(
element
),
y
:
y
};
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getWindow from './getWindow';
import getDocumentElement from './getDocumentElement';
import getWindowScrollBarX from './getWindowScrollBarX';
export default function getViewportRect(element: Element) {
const win = getWindow(element);
const html = getDocumentElement(element);
const visualViewport = win.visualViewport;
let width = html.clientWidth;
let height = html.clientHeight;
let x = 0;
let y = 0;
// NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
// can be obscured underneath it.
// Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
// if it isn't open, so if this isn't available, the popper will be detected
// to overflow the bottom of the screen too early.
if (visualViewport) {
width = visualViewport.width;
height = visualViewport.height;
// Uses Layout Viewport (like Chrome; Safari does not currently)
// In Chrome, it returns a value very close to 0 (+/-) but contains rounding
// errors due to floating point numbers, so we need to check precision.
// Safari returns a number <= 0, usually < -1 when pinch-zoomed
// Feature detection fails in mobile emulation mode in Chrome.
// Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
// 0.001
// Fallback here: "Not Safari" userAgent
if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
x = visualViewport.offsetLeft;
y = visualViewport.offsetTop;
}
}
return {
width,
height,
x: x + getWindowScrollBarX(element),
y,
};
}
node_modules/@popperjs/core/lib/dom-utils/getWindow.d.ts
0 → 100644
View file @
6cc198bf
export
default
function
getWindow
(
node
:
any
):
any
;
node_modules/@popperjs/core/lib/dom-utils/getWindow.js
0 → 100644
View file @
6cc198bf
/*:: import type { Window } from '../types'; */
/*:: declare function getWindow(node: Node | Window): Window; */
export
default
function
getWindow
(
node
)
{
if
(
node
.
toString
()
!==
'
[object Window]
'
)
{
var
ownerDocument
=
node
.
ownerDocument
;
return
ownerDocument
?
ownerDocument
.
defaultView
||
window
:
window
;
}
return
node
;
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getWindow.js.flow
0 → 100644
View file @
6cc198bf
// @flow
/*:: import type { Window } from '../types'; */
/*:: declare function getWindow(node: Node | Window): Window; */
export default function getWindow(node) {
if (node.toString() !== '[object Window]') {
const ownerDocument = node.ownerDocument;
return ownerDocument ? ownerDocument.defaultView || window : window;
}
return node;
}
node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.d.ts
0 → 100644
View file @
6cc198bf
import
{
Window
}
from
"
../types
"
;
export
default
function
getWindowScroll
(
node
:
Node
|
Window
):
{
scrollLeft
:
any
;
scrollTop
:
any
;
};
node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
0 → 100644
View file @
6cc198bf
import
getWindow
from
"
./getWindow.js
"
;
export
default
function
getWindowScroll
(
node
)
{
var
win
=
getWindow
(
node
);
var
scrollLeft
=
win
.
pageXOffset
;
var
scrollTop
=
win
.
pageYOffset
;
return
{
scrollLeft
:
scrollLeft
,
scrollTop
:
scrollTop
};
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getWindow from './getWindow';
import type { Window } from '../types';
export default function getWindowScroll(node: Node | Window) {
const win = getWindow(node);
const scrollLeft = win.pageXOffset;
const scrollTop = win.pageYOffset;
return {
scrollLeft,
scrollTop,
};
}
node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.d.ts
0 → 100644
View file @
6cc198bf
export
default
function
getWindowScrollBarX
(
element
:
Element
):
number
;
node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
0 → 100644
View file @
6cc198bf
import
getBoundingClientRect
from
"
./getBoundingClientRect.js
"
;
import
getDocumentElement
from
"
./getDocumentElement.js
"
;
import
getWindowScroll
from
"
./getWindowScroll.js
"
;
export
default
function
getWindowScrollBarX
(
element
)
{
// If <html> has a CSS width greater than the viewport, then this will be
// incorrect for RTL.
// Popper 1 is broken in this case and never had a bug report so let's assume
// it's not an issue. I don't think anyone ever specifies width on <html>
// anyway.
// Browsers where the left scrollbar doesn't cause an issue report `0` for
// this (e.g. Edge 2019, IE11, Safari)
return
getBoundingClientRect
(
getDocumentElement
(
element
)).
left
+
getWindowScroll
(
element
).
scrollLeft
;
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getBoundingClientRect from './getBoundingClientRect';
import getDocumentElement from './getDocumentElement';
import getWindowScroll from './getWindowScroll';
export default function getWindowScrollBarX(element: Element): number {
// If
<html>
has a CSS width greater than the viewport, then this will be
// incorrect for RTL.
// Popper 1 is broken in this case and never had a bug report so let's assume
// it's not an issue. I don't think anyone ever specifies width on
<html>
// anyway.
// Browsers where the left scrollbar doesn't cause an issue report `0` for
// this (e.g. Edge 2019, IE11, Safari)
return (
getBoundingClientRect(getDocumentElement(element)).left +
getWindowScroll(element).scrollLeft
);
}
node_modules/@popperjs/core/lib/dom-utils/instanceOf.d.ts
0 → 100644
View file @
6cc198bf
declare
function
isElement
(
node
:
any
):
boolean
;
declare
function
isHTMLElement
(
node
:
any
):
boolean
;
declare
function
isShadowRoot
(
node
:
any
):
boolean
;
export
{
isElement
,
isHTMLElement
,
isShadowRoot
};
node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
0 → 100644
View file @
6cc198bf
import
getWindow
from
"
./getWindow.js
"
;
/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
Element); */
function
isElement
(
node
)
{
var
OwnElement
=
getWindow
(
node
).
Element
;
return
node
instanceof
OwnElement
||
node
instanceof
Element
;
}
/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
HTMLElement); */
function
isHTMLElement
(
node
)
{
var
OwnElement
=
getWindow
(
node
).
HTMLElement
;
return
node
instanceof
OwnElement
||
node
instanceof
HTMLElement
;
}
/*:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof
ShadowRoot); */
function
isShadowRoot
(
node
)
{
var
OwnElement
=
getWindow
(
node
).
ShadowRoot
;
return
node
instanceof
OwnElement
||
node
instanceof
ShadowRoot
;
}
export
{
isElement
,
isHTMLElement
,
isShadowRoot
};
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/instanceOf.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getWindow from './getWindow';
/*:: declare function isElement(node: mixed): boolean %checks(node instanceof
Element); */
function isElement(node) {
const OwnElement = getWindow(node).Element;
return node instanceof OwnElement || node instanceof Element;
}
/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof
HTMLElement); */
function isHTMLElement(node) {
const OwnElement = getWindow(node).HTMLElement;
return node instanceof OwnElement || node instanceof HTMLElement;
}
/*:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof
ShadowRoot); */
function isShadowRoot(node) {
const OwnElement = getWindow(node).ShadowRoot;
return node instanceof OwnElement || node instanceof ShadowRoot;
}
export { isElement, isHTMLElement, isShadowRoot };
node_modules/@popperjs/core/lib/dom-utils/isScrollParent.d.ts
0 → 100644
View file @
6cc198bf
export
default
function
isScrollParent
(
element
:
HTMLElement
):
boolean
;
node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
0 → 100644
View file @
6cc198bf
import
getComputedStyle
from
"
./getComputedStyle.js
"
;
export
default
function
isScrollParent
(
element
)
{
// Firefox wants us to check `-x` and `-y` variations as well
var
_getComputedStyle
=
getComputedStyle
(
element
),
overflow
=
_getComputedStyle
.
overflow
,
overflowX
=
_getComputedStyle
.
overflowX
,
overflowY
=
_getComputedStyle
.
overflowY
;
return
/auto|scroll|overlay|hidden/
.
test
(
overflow
+
overflowY
+
overflowX
);
}
\ No newline at end of file
node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js.flow
0 → 100644
View file @
6cc198bf
// @flow
import getComputedStyle from './getComputedStyle';
export default function isScrollParent(element: HTMLElement): boolean {
// Firefox wants us to check `-x` and `-y` variations as well
const { overflow, overflowX, overflowY } = getComputedStyle(element);
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
node_modules/@popperjs/core/lib/dom-utils/isTableElement.d.ts
0 → 100644
View file @
6cc198bf
export
default
function
isTableElement
(
element
:
Element
):
boolean
;
node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
0 → 100644
View file @
6cc198bf
import
getNodeName
from
"
./getNodeName.js
"
;
export
default
function
isTableElement
(
element
)
{
return
[
'
table
'
,
'
td
'
,
'
th
'
].
indexOf
(
getNodeName
(
element
))
>=
0
;
}
\ No newline at end of file
Prev
1
…
13
14
15
16
17
18
19
20
21
…
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