Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc167874

Browse files
committed
first commit
0 parents  commitc167874

File tree

11 files changed

+492
-0
lines changed

11 files changed

+492
-0
lines changed

‎.gitignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
*.sublime-project
3+
*.sublime-workspace
4+
npm-debug.log
5+
build/bundle.js
6+
dev/index.js
7+
static
8+
*.js

‎.npmignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
*.sublime-project
3+
*.sublime-workspace
4+
npm-debug.log
5+
dev/index.js
6+
static

‎README.md‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#vue-comps-tooltip
2+
3+
a advanced tooltip.
4+
5+
###[Demo](https://vue-comps.github.io/vue-comps-tooltip)
6+
7+
#Install
8+
9+
```sh
10+
npm install --save-dev vue-comps-tooltip
11+
```
12+
or include`build/bundle.js`.
13+
14+
##Usage
15+
```coffee
16+
# in your component
17+
components:
18+
"tooltip":require("vue-comps-tooltip")
19+
# or, when using bundle.js
20+
components:
21+
"tooltip":window.vueComps.tooltip
22+
```
23+
```html
24+
<button> Hover
25+
<tooltip>Content</tooltip>
26+
</button>
27+
```
28+
see[`dev/`](dev/) for examples.
29+
30+
####Props
31+
| Name| type| default| description|
32+
| ---:| ---| ---| ---|
33+
| offset| Number| 0| offset to the parent|
34+
| anchor| String| "snwe"| direction of opening, viewport dependet. "s" forces to open down. "sn" would try to open down, the up.|
35+
| class| String| tooltip| class of the`div`|
36+
| ignore-parent| Boolean| false| will not set-up`mouseenter`/`mouseleave` listener on parent|
37+
| is-opened| Boolean| false| (two-way) set to open / close|
38+
| transition-in| function| no animation| set animation. Argument: {el,pos,style,cb}|
39+
| transition-out| function| no animation| set animation. Argument: {el,style,cb}|
40+
41+
| parent| element| parentElement| where the tooltip should attach|
42+
43+
####Events
44+
| Name| description|
45+
| ---:| ---|
46+
| close| when received, will close|
47+
| before-open| will be called before open animation|
48+
| opened| will be called when opened|
49+
| before-close| will be called before close animation|
50+
| closed| will be called when closed|
51+
52+
53+
54+
#Development
55+
Clone repository.
56+
```sh
57+
npm install
58+
npm run dev
59+
```
60+
Browse to`http://localhost:8080/`.
61+
62+
##License
63+
Copyright (c) 2016 Paul Pflugradt
64+
Licensed under the MIT license.

‎build/common.coffee‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
window.vueComps?= {}
2+
window.vueComps.tooltip=require('../tooltip.js')

‎build/webpack.config.coffee‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
webpack=require"webpack"
2+
3+
module.exports=
4+
entry:"./build/common.coffee"
5+
output:
6+
filename:"bundle.js"
7+
path:__dirname
8+
module:
9+
loaders: [
10+
{test:/\.coffee$/,loader:"coffee"}
11+
]
12+
plugins: [
13+
newwebpack.optimize.UglifyJsPlugincompress:warnings:false
14+
newwebpack.optimize.OccurenceOrderPlugin()
15+
]

‎dev/basic.vue‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<template lang="jade">
2+
.container
3+
button hover
4+
tooltip Content
5+
button hover
6+
tooltip Content
7+
button hover
8+
tooltip Content
9+
button hover
10+
tooltip Content
11+
button hover
12+
tooltip(anchor="s") so much Content. wow
13+
button hover
14+
tooltip(anchor="e") so much Content. wow
15+
button hover
16+
tooltip(anchor="w") so much Content. wow
17+
a(href="https://github.com/vue-comps/vue-comps-tooltip/blob/master/dev/basic.vue") source
18+
</template>
19+
20+
<script lang="coffee">
21+
module.exports=
22+
components:
23+
"tooltip":require"../src/tooltip.vue"
24+
25+
</script>
26+
27+
<style lang="stylus">
28+
.container>a
29+
positionabsolute
30+
left250px
31+
top40px
32+
button
33+
positionabsolute
34+
&:nth-child(1)
35+
top10px
36+
left10px
37+
&:nth-child(2)
38+
top10px
39+
right10px
40+
&:nth-child(3)
41+
bottom10px
42+
left10px
43+
&:nth-child(4)
44+
bottom10px
45+
right10px
46+
&:nth-child(5)
47+
top100px
48+
left100px
49+
&:nth-child(6)
50+
top100px
51+
left200px
52+
&:nth-child(7)
53+
top100px
54+
left300px
55+
button>.tooltip
56+
margin0
57+
padding2px
58+
border1pxsolidblack
59+
60+
</style>

‎dev/divs.vue‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<template lang="jade">
2+
.container
3+
div.div.nr1
4+
tooltip(anchor="s") Content
5+
div.div.nr2
6+
tooltip(anchor="s") Content
7+
div.div.nr3
8+
tooltip(anchor="e") Content
9+
div.div.nr4
10+
tooltip(anchor="e") Content
11+
div.div.nr5
12+
tooltip(anchor="s") so much Content. wow
13+
div.div.nr6
14+
tooltip(anchor="e") so much Content. wow
15+
div.div.nr7
16+
tooltip(anchor="w") so much Content. wow
17+
div.div.nr8
18+
tooltip(anchor="n") so much Content. wow
19+
div.div
20+
a(href="https://github.com/vue-comps/vue-comps-tooltip/blob/master/dev/divs.vue") source
21+
</template>
22+
23+
<script lang="coffee">
24+
module.exports=
25+
components:
26+
"tooltip":require"../src/tooltip.vue"
27+
28+
</script>
29+
30+
<style lang="stylus">
31+
.div
32+
margin50px100px
33+
height20px
34+
width44px
35+
padding5px
36+
border1pxsolidblack
37+
&.nr1
38+
border-top5pxsolidblack
39+
&.nr2
40+
border-bottom5pxsolidblack
41+
&.nr3
42+
border-left5pxsolidblack
43+
&.nr4
44+
border-right5pxsolidblack
45+
div>.tooltip
46+
margin0
47+
padding2px
48+
border1pxdashedred
49+
50+
</style>

‎karma.conf.coffee‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports= (config)->
2+
config.set
3+
preprocessors:
4+
"**/*.coffee": ["webpack",'sourcemap']
5+
webpack:
6+
devtool:'inline-source-map'
7+
resolve:
8+
extensions: ["",".js",".coffee",".vue"]
9+
module:
10+
loaders: [
11+
{test:/\.coffee$/,loader:"coffee-loader" }
12+
{test:/\.vue$/,loader:"vue-loader" }
13+
{test:/\.html$/,loader:"html"}
14+
{test:/\.css$/,loader:"style-loader!css-loader" }
15+
]
16+
webpackMiddleware:
17+
noInfo:true
18+
files: ["test/*.coffee"]
19+
frameworks: ["mocha","chai-dom","chai-spies","chai","vue-component"]
20+
plugins: [
21+
require("karma-chai")
22+
require("karma-chai-dom")
23+
require("karma-chrome-launcher")
24+
require("karma-firefox-launcher")
25+
require("karma-mocha")
26+
require("karma-webpack")
27+
require("karma-sourcemap-loader")
28+
require("karma-spec-reporter")
29+
require("karma-chai-spies")
30+
require("karma-vue-component")
31+
]
32+
browsers: ["Chrome","Firefox"]

‎package.json‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"name":"vue-comps-tooltip",
3+
"description":"a advanced tooltip",
4+
"version":"0.0.0",
5+
"homepage":"https://github.com/vue-comps",
6+
"author": {
7+
"name":"Paul Pflugradt",
8+
"email":"paul.pflugradt@gmail.com"
9+
},
10+
"license":"MIT",
11+
"main":"tooltip.js",
12+
"repository": {
13+
"type":"git",
14+
"url":"git://github.com/vue-comps/vue-comps-tooltip"
15+
},
16+
"engines": {
17+
"node":"*"
18+
},
19+
"dependencies": {
20+
"vue-mixins":"^0.2.6"
21+
},
22+
"peerDependencies": {},
23+
"devDependencies": {
24+
"babel-core":"^6.7.6",
25+
"babel-loader":"^6.2.4",
26+
"babel-plugin-transform-runtime":"^6.7.5",
27+
"babel-preset-es2015":"^6.6.0",
28+
"babel-runtime":"^5.8.34",
29+
"chai":"^3.5.0",
30+
"chai-spies":"^0.7.1",
31+
"coffee-loader":"^0.7.2",
32+
"coffee-script":"^1.10.0",
33+
"css-loader":"^0.23.1",
34+
"gh-pages":"^0.11.0",
35+
"jade":"^1.11.0",
36+
"karma":"^0.13.22",
37+
"karma-chai":"^0.1.0",
38+
"karma-chai-dom":"^1.1.0",
39+
"karma-chai-spies":"^0.1.4",
40+
"karma-chrome-launcher":"^0.2.3",
41+
"karma-firefox-launcher":"^0.1.7",
42+
"karma-mocha":"^0.2.2",
43+
"karma-sourcemap-loader":"^0.3.7",
44+
"karma-spec-reporter":"^0.0.26",
45+
"karma-vue-component":"^0.1.0",
46+
"karma-webpack":"^1.7.0",
47+
"mocha":"^2.4.5",
48+
"parse5":"^2.1.5",
49+
"script-runner":"^0.1.4",
50+
"style-loader":"^0.13.1",
51+
"stylus-loader":"^2.0.0",
52+
"template-html-loader":"0.0.3",
53+
"vue":"^1.0.21",
54+
"vue-compiler":"^0.1.0",
55+
"vue-dev-server":"^0.2.10",
56+
"vue-hot-reload-api":"^1.3.2",
57+
"vue-html-loader":"^1.2.2",
58+
"vue-loader":"^8.2.2",
59+
"vue-style-loader":"^1.0.0",
60+
"vueify-insert-css":"^1.0.0",
61+
"webpack":"^1.12.14"
62+
},
63+
"keywords": [
64+
"tooltip",
65+
"component",
66+
"vue"
67+
],
68+
"readmeFilename":"README.md",
69+
"scripts": {
70+
"build:vue":"NODE_ENV=production vue-compiler --out . src/*.vue",
71+
"build:webpack":"webpack --config build/webpack.config.coffee",
72+
"build":"run-npm build:*",
73+
"dev":"vue-dev-server",
74+
"watch":"karma start --browsers Chrome --auto-watch --reporters spec",
75+
"test":"karma start --single-run",
76+
"preversion":"npm test",
77+
"version":"npm run build && git add .",
78+
"postversion":"git push && git push --tags && npm publish",
79+
"ghpages":"vue-dev-server --static static/ && gh-pages -d static"
80+
}
81+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp