forked from vitest-dev/vitest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Anthony Fu <[email protected]>
- Loading branch information
Showing
76 changed files
with
853 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export * from '../core/onClickOutside/component' | ||
export * from '../core/useActiveElement/component' | ||
export * from '../core/useBattery/component' | ||
export * from '../core/useBrowserLocation/component' | ||
export * from '../core/useDark/component' | ||
export * from '../core/useDeviceLight/component' | ||
export * from '../core/useDeviceMotion/component' | ||
export * from '../core/useDeviceOrientation/component' | ||
export * from '../core/useDevicePixelRatio/component' | ||
export * from '../core/useDevicesList/component' | ||
export * from '../core/useDocumentVisibility/component' | ||
export * from '../core/useElementBounding/component' | ||
export * from '../core/useElementSize/component' | ||
export * from '../core/useElementVisibility/component' | ||
export * from '../core/useFullscreen/component' | ||
export * from '../core/useGeolocation/component' | ||
export * from '../core/useIdle/component' | ||
export * from '../core/useMouse/component' | ||
export * from '../core/useMouseInElement/component' | ||
export * from '../core/useMousePressed/component' | ||
export * from '../core/useNetwork/component' | ||
export * from '../core/useNow/component' | ||
export * from '../core/useOnline/component' | ||
export * from '../core/usePageLeave/component' | ||
export * from '../core/usePreferredColorScheme/component' | ||
export * from '../core/usePreferredDark/component' | ||
export * from '../core/usePreferredLanguages/component' | ||
export * from '../core/useTimeAgo/component' | ||
export * from '../core/useTimestamp/component' | ||
export * from '../core/useWindowSize/component' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "@vueuse/components", | ||
"version": "5.0.0-beta.1", | ||
"description": "Renderless components for VueUse", | ||
"keywords": [ | ||
"vue", | ||
"vue-use", | ||
"utils" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/vueuse/vueuse.git" | ||
}, | ||
"author": "Wheat<https://github.com/wheatjs>", | ||
"files": [ | ||
"dist" | ||
], | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.esm.js", | ||
"require": "./dist/index.cjs.js" | ||
}, | ||
"./*": "./*" | ||
}, | ||
"main": "./dist/index.cjs.js", | ||
"types": "./dist/index.d.ts", | ||
"module": "./dist/index.esm.js", | ||
"unpkg": "./dist/index.iife.min.js", | ||
"jsdelivr": "./dist/index.iife.min.js", | ||
"sideEffects": false, | ||
"bugs": { | ||
"url": "https://github.com/vueuse/vueuse/issues" | ||
}, | ||
"homepage": "https://github.com/vueuse/vueuse/tree/main/packages/components#readme", | ||
"dependencies": { | ||
"@vueuse/core": "5.0.0-beta.1", | ||
"@vueuse/shared": "5.0.0-beta.1", | ||
"vue-demi": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { h, ref, defineComponent } from 'vue-demi' | ||
import { onClickOutside } from '@vueuse/core' | ||
|
||
export const OnClickOutside = defineComponent({ | ||
name: 'OnClickOutside', | ||
emits: ['trigger'], | ||
setup(props, { slots, emit }) { | ||
const target = ref() | ||
onClickOutside(target, (e) => { | ||
emit('trigger', e) | ||
}) | ||
|
||
return () => { | ||
if (slots.default) | ||
return h('div', { ref: target }, slots.default()) | ||
} | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { FunctionDirective } from 'vue-demi' | ||
import { onClickOutside, OnClickOutsideEvents } from '.' | ||
|
||
/** | ||
* TODO: Test that this actually works | ||
*/ | ||
export const VOnClickOutside: FunctionDirective<any, (evt: OnClickOutsideEvents['pointerdown']) => void> = (el, binding) => { | ||
onClickOutside(el, binding.value) | ||
} |
Oops, something went wrong.