Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
macaronideath
fc-pregmod
Commits
812e467b
Commit
812e467b
authored
3 years ago
by
Arkerthan
Browse files
Options
Downloads
Patches
Plain Diff
Add typings for tippy.js
parent
7a889711
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
devTools/types/tippy/index.d.ts
+5
-0
5 additions, 0 deletions
devTools/types/tippy/index.d.ts
devTools/types/tippy/tippy.d.ts
+260
-0
260 additions, 0 deletions
devTools/types/tippy/tippy.d.ts
src/js/utilsDOM.js
+1
-2
1 addition, 2 deletions
src/js/utilsDOM.js
with
266 additions
and
2 deletions
devTools/types/tippy/index.d.ts
0 → 100644
+
5
−
0
View file @
812e467b
import
{
Tippy
}
from
"
./tippy
"
;
declare
global
{
const
tippy
:
Tippy
;
}
This diff is collapsed.
Click to expand it.
devTools/types/tippy/tippy.d.ts
0 → 100644
+
260
−
0
View file @
812e467b
import
*
as
Popper
from
'
@popperjs/core
'
;
export
type
BasePlacement
=
Popper
.
BasePlacement
;
export
type
Placement
=
Popper
.
Placement
;
export
type
Content
=
|
string
|
Element
|
DocumentFragment
|
((
ref
:
Element
)
=>
string
|
Element
|
DocumentFragment
);
export
type
SingleTarget
=
Element
;
export
type
MultipleTargets
=
string
|
Element
[]
|
NodeList
;
export
type
Targets
=
SingleTarget
|
MultipleTargets
;
export
interface
ReferenceElement
<
TProps
=
Props
>
extends
Element
{
_tippy
?:
Instance
<
TProps
>
;
}
export
interface
PopperElement
<
TProps
=
Props
>
extends
HTMLDivElement
{
_tippy
?:
Instance
<
TProps
>
;
}
export
interface
LifecycleHooks
<
TProps
=
Props
>
{
onAfterUpdate
(
instance
:
Instance
<
TProps
>
,
partialProps
:
Partial
<
TProps
>
):
void
;
onBeforeUpdate
(
instance
:
Instance
<
TProps
>
,
partialProps
:
Partial
<
TProps
>
):
void
;
onCreate
(
instance
:
Instance
<
TProps
>
):
void
;
onDestroy
(
instance
:
Instance
<
TProps
>
):
void
;
onHidden
(
instance
:
Instance
<
TProps
>
):
void
;
onHide
(
instance
:
Instance
<
TProps
>
):
void
|
false
;
onMount
(
instance
:
Instance
<
TProps
>
):
void
;
onShow
(
instance
:
Instance
<
TProps
>
):
void
|
false
;
onShown
(
instance
:
Instance
<
TProps
>
):
void
;
onTrigger
(
instance
:
Instance
<
TProps
>
,
event
:
Event
):
void
;
onUntrigger
(
instance
:
Instance
<
TProps
>
,
event
:
Event
):
void
;
onClickOutside
(
instance
:
Instance
<
TProps
>
,
event
:
Event
):
void
;
}
export
interface
RenderProps
{
allowHTML
:
boolean
;
animation
:
string
|
boolean
;
arrow
:
boolean
|
string
|
SVGElement
|
DocumentFragment
;
content
:
Content
;
inertia
:
boolean
;
maxWidth
:
number
|
string
;
role
:
string
;
theme
:
string
;
zIndex
:
number
;
}
export
interface
GetReferenceClientRect
{
():
ClientRect
|
DOMRect
;
contextElement
?:
Element
;
}
export
interface
Props
extends
LifecycleHooks
,
RenderProps
{
animateFill
:
boolean
;
appendTo
:
'
parent
'
|
Element
|
((
ref
:
Element
)
=>
Element
);
aria
:
{
content
?:
'
auto
'
|
'
describedby
'
|
'
labelledby
'
|
null
;
expanded
?:
'
auto
'
|
boolean
;
};
delay
:
number
|
[
number
|
null
,
number
|
null
];
duration
:
number
|
[
number
|
null
,
number
|
null
];
followCursor
:
boolean
|
'
horizontal
'
|
'
vertical
'
|
'
initial
'
;
getReferenceClientRect
:
null
|
GetReferenceClientRect
;
hideOnClick
:
boolean
|
'
toggle
'
;
ignoreAttributes
:
boolean
;
inlinePositioning
:
boolean
;
interactive
:
boolean
;
interactiveBorder
:
number
;
interactiveDebounce
:
number
;
moveTransition
:
string
;
offset
:
|
[
number
,
number
]
|
(({
placement
,
popper
,
reference
,
}:
{
placement
:
Placement
;
popper
:
Popper
.
Rect
;
reference
:
Popper
.
Rect
;
})
=>
[
number
,
number
]);
placement
:
Placement
;
plugins
:
Plugin
<
unknown
>
[];
popperOptions
:
Partial
<
Popper
.
Options
>
;
render
:
|
((
instance
:
Instance
)
=>
{
popper
:
PopperElement
;
onUpdate
?:
(
prevProps
:
Props
,
nextProps
:
Props
)
=>
void
;
})
|
null
;
showOnCreate
:
boolean
;
sticky
:
boolean
|
'
reference
'
|
'
popper
'
;
touch
:
boolean
|
'
hold
'
|
[
'
hold
'
,
number
];
trigger
:
string
;
triggerTarget
:
Element
|
Element
[]
|
null
;
}
export
interface
DefaultProps
extends
Omit
<
Props
,
'
delay
'
|
'
duration
'
>
{
delay
:
number
|
[
number
,
number
];
duration
:
number
|
[
number
,
number
];
}
export
interface
Instance
<
TProps
=
Props
>
{
clearDelayTimeouts
():
void
;
destroy
():
void
;
disable
():
void
;
enable
():
void
;
hide
():
void
;
hideWithInteractivity
(
event
:
MouseEvent
):
void
;
id
:
number
;
plugins
:
Plugin
<
TProps
>
[];
popper
:
PopperElement
<
TProps
>
;
popperInstance
:
Popper
.
Instance
|
null
;
props
:
TProps
;
reference
:
ReferenceElement
<
TProps
>
;
setContent
(
content
:
Content
):
void
;
setProps
(
partialProps
:
Partial
<
TProps
>
):
void
;
show
():
void
;
state
:
{
isEnabled
:
boolean
;
isVisible
:
boolean
;
isDestroyed
:
boolean
;
isMounted
:
boolean
;
isShown
:
boolean
;
};
unmount
():
void
;
}
export
interface
TippyStatics
{
readonly
currentInput
:
{
isTouch
:
boolean
};
readonly
defaultProps
:
DefaultProps
;
setDefaultProps
(
partialProps
:
Partial
<
DefaultProps
>
):
void
;
}
export
interface
Tippy
<
TProps
=
Props
>
extends
TippyStatics
{
(
targets
:
SingleTarget
,
optionalProps
?:
Partial
<
TProps
>
):
Instance
<
TProps
>
;
}
export
interface
Tippy
<
TProps
=
Props
>
extends
TippyStatics
{
(
targets
:
MultipleTargets
,
optionalProps
?:
Partial
<
TProps
>
):
Instance
<
TProps
>
[];
}
declare
const
tippy
:
Tippy
;
// =============================================================================
// Addon types
// =============================================================================
export
interface
DelegateInstance
<
TProps
=
Props
>
extends
Instance
<
TProps
>
{
destroy
(
shouldDestroyTargetInstances
?:
boolean
):
void
;
}
export
interface
Delegate
<
TProps
=
Props
>
{
(
targets
:
SingleTarget
,
props
:
Partial
<
TProps
>
&
{
target
:
string
}
):
DelegateInstance
<
TProps
>
;
}
export
interface
Delegate
<
TProps
=
Props
>
{
(
targets
:
MultipleTargets
,
props
:
Partial
<
TProps
>
&
{
target
:
string
}
):
DelegateInstance
<
TProps
>
[];
}
export
type
CreateSingletonProps
<
TProps
=
Props
>
=
TProps
&
{
overrides
:
Array
<
keyof
TProps
>
;
};
export
type
CreateSingletonInstance
<
TProps
=
CreateSingletonProps
>
=
Instance
<
TProps
>
&
{
setInstances
(
instances
:
Instance
<
any
>
[]):
void
;
show
(
target
?:
ReferenceElement
|
Instance
|
number
):
void
;
showNext
():
void
;
showPrevious
():
void
;
};
export
type
CreateSingleton
<
TProps
=
Props
>
=
(
tippyInstances
:
Instance
<
any
>
[],
optionalProps
?:
Partial
<
CreateSingletonProps
<
TProps
>>
)
=>
CreateSingletonInstance
<
CreateSingletonProps
<
TProps
>>
;
declare
const
delegate
:
Delegate
;
declare
const
createSingleton
:
CreateSingleton
;
// =============================================================================
// Plugin types
// =============================================================================
export
interface
Plugin
<
TProps
=
Props
>
{
name
?:
string
;
defaultValue
?:
any
;
fn
(
instance
:
Instance
<
TProps
>
):
Partial
<
LifecycleHooks
<
TProps
>>
;
}
export
interface
AnimateFill
extends
Plugin
{
name
:
'
animateFill
'
;
defaultValue
:
false
;
}
export
interface
FollowCursor
extends
Plugin
{
name
:
'
followCursor
'
;
defaultValue
:
false
;
}
export
interface
InlinePositioning
extends
Plugin
{
name
:
'
inlinePositioning
'
;
defaultValue
:
false
;
}
export
interface
Sticky
extends
Plugin
{
name
:
'
sticky
'
;
defaultValue
:
false
;
}
declare
const
animateFill
:
AnimateFill
;
declare
const
followCursor
:
FollowCursor
;
declare
const
inlinePositioning
:
InlinePositioning
;
declare
const
sticky
:
Sticky
;
// =============================================================================
// Misc types
// =============================================================================
export
interface
HideAllOptions
{
duration
?:
number
;
exclude
?:
Instance
|
ReferenceElement
;
}
export
type
HideAll
=
(
options
?:
HideAllOptions
)
=>
void
;
declare
const
hideAll
:
HideAll
;
declare
const
roundArrow
:
string
;
export
default
tippy
;
export
{
hideAll
,
delegate
,
createSingleton
,
animateFill
,
followCursor
,
inlinePositioning
,
sticky
,
roundArrow
,
};
This diff is collapsed.
Click to expand it.
src/js/utilsDOM.js
+
1
−
2
View file @
812e467b
...
@@ -111,13 +111,12 @@ App.UI.DOM.disabledLink = function(link, reasons) {
...
@@ -111,13 +111,12 @@ App.UI.DOM.disabledLink = function(link, reasons) {
tooltip
.
appendChild
(
li
);
tooltip
.
appendChild
(
li
);
}
}
}
}
return
App
.
UI
.
DOM
.
spanWithTooltip
(
link
,
tooltip
);
return
App
.
UI
.
DOM
.
spanWithTooltip
(
link
,
tooltip
);
};
};
/**
/**
* @param {string} text
* @param {string} text
* @param {string|
Node
} tooltip
* @param {string|
HTMLElement
} tooltip
* @param {string|Array<string>} [classNames]
* @param {string|Array<string>} [classNames]
* @returns {HTMLSpanElement}
* @returns {HTMLSpanElement}
*/
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment