Skip to content

Commit c500503

Browse files
committed
Plugin repository init
1 parent 5089f32 commit c500503

19 files changed

+8815
-0
lines changed

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
extends: [
3+
'standard',
4+
'plugin:vue/recommended'
5+
],
6+
rules: {
7+
}
8+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules/
2+
/.vscode

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# vue2-perfect-scrollbar
2+
Vue.js wrapper for perfect scrollbar

dist/vue2-perfect-scrollbar.cjs.js

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
'use strict';
2+
3+
Object.defineProperty(exports, '__esModule', { value: true });
4+
5+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6+
7+
var PerfectScrollbar = _interopDefault(require('perfect-scrollbar'));
8+
9+
var script = {
10+
name: 'PeftectScrollbar',
11+
props: {
12+
options: {
13+
type: Object,
14+
required: false,
15+
default: () => {}
16+
},
17+
tag: {
18+
type: String,
19+
required: false,
20+
default: 'div'
21+
}
22+
},
23+
data () {
24+
return {
25+
ps: null
26+
}
27+
},
28+
mounted () {
29+
if (!(this.ps && this.$isServer)) {
30+
this.ps = new PerfectScrollbar(this.$refs.container, this.options);
31+
}
32+
},
33+
updated () {
34+
this.update();
35+
},
36+
methods: {
37+
update () {
38+
if (this.ps) {
39+
this.ps.update();
40+
}
41+
}
42+
},
43+
render (h) {
44+
return h(this.tag,
45+
{
46+
ref: 'container',
47+
on: this.$listeners
48+
},
49+
this.$slots.default)
50+
}
51+
};
52+
53+
/* script */
54+
const __vue_script__ = script;
55+
/* template */
56+
57+
/* style */
58+
const __vue_inject_styles__ = undefined;
59+
/* scoped */
60+
const __vue_scope_id__ = undefined;
61+
/* module identifier */
62+
const __vue_module_identifier__ = undefined;
63+
/* functional template */
64+
const __vue_is_functional_template__ = undefined;
65+
/* component normalizer */
66+
function __vue_normalize__(
67+
template, style, script$$1,
68+
scope, functional, moduleIdentifier,
69+
createInjector, createInjectorSSR
70+
) {
71+
const component = (typeof script$$1 === 'function' ? script$$1.options : script$$1) || {};
72+
73+
// For security concerns, we use only base name in production mode.
74+
component.__file = "/Users/merc/Work/OpenSource/vue2-perfect-scrollbar/src/Scrollbar.vue";
75+
76+
if (!component.render) {
77+
component.render = template.render;
78+
component.staticRenderFns = template.staticRenderFns;
79+
component._compiled = true;
80+
81+
if (functional) component.functional = true;
82+
}
83+
84+
component._scopeId = scope;
85+
86+
return component
87+
}
88+
/* style inject */
89+
90+
/* style inject SSR */
91+
92+
93+
94+
var PerfectScrollbar$1 = __vue_normalize__(
95+
{},
96+
__vue_inject_styles__,
97+
__vue_script__,
98+
__vue_scope_id__,
99+
__vue_is_functional_template__,
100+
__vue_module_identifier__,
101+
undefined,
102+
undefined
103+
);
104+
105+
function install (Vue, settings) {
106+
if (settings.options) {
107+
PerfectScrollbar$1.props.options.default = () => {
108+
return settings.options
109+
};
110+
}
111+
112+
if (settings.tag) {
113+
PerfectScrollbar$1.props.tag.default = settings.tag;
114+
}
115+
116+
Vue.component(
117+
settings.name ? settings.name : PerfectScrollbar$1.name,
118+
PerfectScrollbar$1
119+
);
120+
}
121+
122+
exports.PerfectScrollbar = PerfectScrollbar$1;
123+
exports.default = install;

dist/vue2-perfect-scrollbar.css

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*
2+
* Container style
3+
*/
4+
.ps {
5+
overflow: hidden !important;
6+
overflow-anchor: none;
7+
-ms-overflow-style: none;
8+
touch-action: auto;
9+
-ms-touch-action: auto;
10+
}
11+
12+
/*
13+
* Scrollbar rail styles
14+
*/
15+
.ps__rail-x {
16+
display: none;
17+
opacity: 0;
18+
transition: background-color .2s linear, opacity .2s linear;
19+
-webkit-transition: background-color .2s linear, opacity .2s linear;
20+
height: 15px;
21+
/* there must be 'bottom' or 'top' for ps__rail-x */
22+
bottom: 0px;
23+
/* please don't change 'position' */
24+
position: absolute;
25+
}
26+
.ps__rail-y {
27+
display: none;
28+
opacity: 0;
29+
transition: background-color .2s linear, opacity .2s linear;
30+
-webkit-transition: background-color .2s linear, opacity .2s linear;
31+
width: 15px;
32+
/* there must be 'right' or 'left' for ps__rail-y */
33+
right: 0;
34+
/* please don't change 'position' */
35+
position: absolute;
36+
}
37+
.ps--active-x > .ps__rail-x,
38+
.ps--active-y > .ps__rail-y {
39+
display: block;
40+
background-color: transparent;
41+
}
42+
.ps:hover > .ps__rail-x,
43+
.ps:hover > .ps__rail-y,
44+
.ps--focus > .ps__rail-x,
45+
.ps--focus > .ps__rail-y,
46+
.ps--scrolling-x > .ps__rail-x,
47+
.ps--scrolling-y > .ps__rail-y {
48+
opacity: 0.6;
49+
}
50+
.ps .ps__rail-x:hover,
51+
.ps .ps__rail-y:hover,
52+
.ps .ps__rail-x:focus,
53+
.ps .ps__rail-y:focus,
54+
.ps .ps__rail-x.ps--clicking,
55+
.ps .ps__rail-y.ps--clicking {
56+
background-color: #eee;
57+
opacity: 0.9;
58+
}
59+
60+
/*
61+
* Scrollbar thumb styles
62+
*/
63+
.ps__thumb-x {
64+
background-color: #aaa;
65+
border-radius: 6px;
66+
transition: background-color .2s linear, height .2s ease-in-out;
67+
-webkit-transition: background-color .2s linear, height .2s ease-in-out;
68+
height: 6px;
69+
/* there must be 'bottom' for ps__thumb-x */
70+
bottom: 2px;
71+
/* please don't change 'position' */
72+
position: absolute;
73+
}
74+
.ps__thumb-y {
75+
background-color: #aaa;
76+
border-radius: 6px;
77+
transition: background-color .2s linear, width .2s ease-in-out;
78+
-webkit-transition: background-color .2s linear, width .2s ease-in-out;
79+
width: 6px;
80+
/* there must be 'right' for ps__thumb-y */
81+
right: 2px;
82+
/* please don't change 'position' */
83+
position: absolute;
84+
}
85+
.ps__rail-x:hover > .ps__thumb-x,
86+
.ps__rail-x:focus > .ps__thumb-x,
87+
.ps__rail-x.ps--clicking .ps__thumb-x {
88+
background-color: #999;
89+
height: 11px;
90+
}
91+
.ps__rail-y:hover > .ps__thumb-y,
92+
.ps__rail-y:focus > .ps__thumb-y,
93+
.ps__rail-y.ps--clicking .ps__thumb-y {
94+
background-color: #999;
95+
width: 11px;
96+
}
97+
98+
/* MS supports */
99+
@supports (-ms-overflow-style: none) {
100+
.ps {
101+
overflow: auto !important;
102+
}
103+
}
104+
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
105+
.ps {
106+
overflow: auto !important;
107+
}
108+
}
109+
110+
.ps {
111+
position: relative;
112+
}

dist/vue2-perfect-scrollbar.esm.js

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import PerfectScrollbar from 'perfect-scrollbar';
2+
3+
var script = {
4+
name: 'PeftectScrollbar',
5+
props: {
6+
options: {
7+
type: Object,
8+
required: false,
9+
default: () => {}
10+
},
11+
tag: {
12+
type: String,
13+
required: false,
14+
default: 'div'
15+
}
16+
},
17+
data () {
18+
return {
19+
ps: null
20+
}
21+
},
22+
mounted () {
23+
if (!(this.ps && this.$isServer)) {
24+
this.ps = new PerfectScrollbar(this.$refs.container, this.options);
25+
}
26+
},
27+
updated () {
28+
this.update();
29+
},
30+
methods: {
31+
update () {
32+
if (this.ps) {
33+
this.ps.update();
34+
}
35+
}
36+
},
37+
render (h) {
38+
return h(this.tag,
39+
{
40+
ref: 'container',
41+
on: this.$listeners
42+
},
43+
this.$slots.default)
44+
}
45+
};
46+
47+
/* script */
48+
const __vue_script__ = script;
49+
/* template */
50+
51+
/* style */
52+
const __vue_inject_styles__ = undefined;
53+
/* scoped */
54+
const __vue_scope_id__ = undefined;
55+
/* module identifier */
56+
const __vue_module_identifier__ = undefined;
57+
/* functional template */
58+
const __vue_is_functional_template__ = undefined;
59+
/* component normalizer */
60+
function __vue_normalize__(
61+
template, style, script$$1,
62+
scope, functional, moduleIdentifier,
63+
createInjector, createInjectorSSR
64+
) {
65+
const component = (typeof script$$1 === 'function' ? script$$1.options : script$$1) || {};
66+
67+
// For security concerns, we use only base name in production mode.
68+
component.__file = "/Users/merc/Work/OpenSource/vue2-perfect-scrollbar/src/Scrollbar.vue";
69+
70+
if (!component.render) {
71+
component.render = template.render;
72+
component.staticRenderFns = template.staticRenderFns;
73+
component._compiled = true;
74+
75+
if (functional) component.functional = true;
76+
}
77+
78+
component._scopeId = scope;
79+
80+
return component
81+
}
82+
/* style inject */
83+
84+
/* style inject SSR */
85+
86+
87+
88+
var PerfectScrollbar$1 = __vue_normalize__(
89+
{},
90+
__vue_inject_styles__,
91+
__vue_script__,
92+
__vue_scope_id__,
93+
__vue_is_functional_template__,
94+
__vue_module_identifier__,
95+
undefined,
96+
undefined
97+
);
98+
99+
function install (Vue, settings) {
100+
if (settings.options) {
101+
PerfectScrollbar$1.props.options.default = () => {
102+
return settings.options
103+
};
104+
}
105+
106+
if (settings.tag) {
107+
PerfectScrollbar$1.props.tag.default = settings.tag;
108+
}
109+
110+
Vue.component(
111+
settings.name ? settings.name : PerfectScrollbar$1.name,
112+
PerfectScrollbar$1
113+
);
114+
}
115+
116+
export default install;
117+
export { PerfectScrollbar$1 as PerfectScrollbar };

0 commit comments

Comments
 (0)