Socket
Socket
Sign inDemoInstall

@opentiny/vue-scrollbar

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentiny/vue-scrollbar - npm Package Compare versions

Comparing version 3.6.0 to 3.6.1-alpha.0

LICENSE

1

index.d.ts

@@ -13,3 +13,2 @@ /**

import Scrollbar from './src/index.vue';
import '@opentiny/vue-theme/scrollbar/index.css';
export default Scrollbar;

@@ -1,10 +0,10 @@

import { createVNode } from 'vue';
import { renderless as renderless$1, api as api$1 } from '@opentiny/vue-renderless/scrollbar/vue';
import { $prefix, setup, h } from '@opentiny/vue-common';
import scrollbarWidth from '@opentiny/vue-renderless/common/deps/scrollbar-width';
import { toObject } from '@opentiny/vue-renderless/common/array';
import { renderless, api } from '@opentiny/vue-renderless/scrollbar/vue-bar';
var script$1 = {
name: $prefix + 'Bar',
import { createVNode } from "vue";
import { renderless as renderless$1, api as api$1 } from "@opentiny/vue-renderless/scrollbar/vue";
import { $prefix, setup as _setup, h, defineComponent } from "@opentiny/vue-common";
import scrollbarWidth from "@opentiny/vue-renderless/common/deps/scrollbar-width";
import { toObject } from "@opentiny/vue-renderless/common/array";
import { renderless, api } from "@opentiny/vue-renderless/scrollbar/vue-bar";
import "@opentiny/vue-theme/scrollbar/index.css";
var _sfc_main$1 = {
name: $prefix + "Bar",
props: {

@@ -15,22 +15,17 @@ vertical: Boolean,

},
setup: function setup$1(props, context) {
return setup({
props: props,
context: context,
renderless: renderless,
api: api,
setup: function setup(props, context) {
return _setup({
props,
context,
renderless,
api,
mono: true,
h: h
h
});
},
render: function render() {
var size = this.size,
move = this.move,
renderThumbStyle = this.renderThumbStyle,
clickTrackHandler = this.clickTrackHandler,
clickThumbHandler = this.clickThumbHandler,
bar = this.state.bar;
var size = this.size, move = this.move, renderThumbStyle = this.renderThumbStyle, clickTrackHandler = this.clickTrackHandler, clickThumbHandler = this.clickThumbHandler, bar = this.state.bar;
return createVNode("div", {
"ref": "bar",
"class": ['tiny-scrollbar__bar', 'is-' + bar.key],
"class": ["tiny-scrollbar__bar", "is-" + bar.key],
"onMousedown": clickTrackHandler

@@ -42,5 +37,5 @@ }, [createVNode("div", {

"style": renderThumbStyle({
bar: bar,
move: move,
size: size
bar,
move,
size
})

@@ -50,8 +45,7 @@ }, null)]);

};
var script = {
name: $prefix + 'Scrollbar',
emits: ['mouseenter', 'mousemove', 'scroll'],
var _sfc_main = /* @__PURE__ */ defineComponent({
name: $prefix + "Scrollbar",
emits: ["mouseenter", "mousemove", "scroll"],
components: {
Bar: script$1
Bar: _sfc_main$1
},

@@ -64,6 +58,7 @@ props: {

native: Boolean,
// 如果container尺寸不会发生变化,最好设置它可以优化性能
noresize: Boolean,
tag: {
type: String,
default: 'div'
default: "div"
},

@@ -75,6 +70,6 @@ viewClass: {},

},
setup: function setup$1(props, context) {
return setup({
props: props,
context: context,
setup: function setup2(props, context) {
return _setup({
props,
context,
renderless: renderless$1,

@@ -85,20 +80,11 @@ api: api$1,

},
render: function render() {
render: function render2() {
var _this = this;
var tag = this.tag,
$slots = this.vm.$slots,
native = this.native,
wrapStyle = this.wrapStyle,
wrapClass = this.wrapClass,
viewStyle = this.viewStyle,
viewClass = this.viewClass,
handleScroll = this.handleScroll,
state = this.state,
marginBottomAdjust = this.marginBottomAdjust;
var tag = this.tag, $slots = this.vm.$slots, native = this.native, wrapStyle = this.wrapStyle, wrapClass = this.wrapClass, viewStyle = this.viewStyle, viewClass = this.viewClass, handleScroll = this.handleScroll, state = this.state, marginBottomAdjust = this.marginBottomAdjust;
var gutter = scrollbarWidth();
var style = wrapStyle;
if (gutter) {
var gutterWith = "-".concat(gutter, "px");
var gutterHeight = "-".concat(gutter - marginBottomAdjust, "px");
var gutterStyle = "margin-bottom: ".concat(gutterHeight, "; margin-right: ").concat(gutterWith, ";");
var gutterWith = "-" + gutter + "px";
var gutterHeight = "-" + (gutter - marginBottomAdjust) + "px";
var gutterStyle = "margin-bottom: " + gutterHeight + "; margin-right: " + gutterWith + ";";
if (Array.isArray(wrapStyle)) {

@@ -108,3 +94,3 @@ style = toObject(wrapStyle);

style.marginBottom = gutterHeight;
} else if (typeof wrapStyle === 'string') {
} else if (typeof wrapStyle === "string") {
style += gutterStyle;

@@ -116,5 +102,5 @@ } else {

var view = h(tag, {
class: ['tiny-scrollbar__view', viewClass],
class: ["tiny-scrollbar__view", viewClass],
style: viewStyle,
ref: 'resize'
ref: "resize"
}, $slots.default ? $slots.default() : $slots.empty && $slots.empty());

@@ -125,3 +111,3 @@ var wrap = createVNode("div", {

"onScroll": handleScroll,
"class": [wrapClass, 'tiny-scrollbar__wrap', gutter ? '' : 'tiny-scrollbar__wrap--hidden-default']
"class": [wrapClass, "tiny-scrollbar__wrap", gutter ? "" : "tiny-scrollbar__wrap--hidden-default"]
}, [[view]]);

@@ -132,10 +118,10 @@ var nodes;

"ref": "wrap",
"class": [wrapClass, 'tiny-scrollbar__wrap'],
"class": [wrapClass, "tiny-scrollbar__wrap"],
"style": style
}, [[view]])];
} else {
nodes = [wrap, createVNode(script$1, {
nodes = [wrap, createVNode(_sfc_main$1, {
"move": state.moveX,
"size": state.sizeWidth
}, null), createVNode(script$1, {
}, null), createVNode(_sfc_main$1, {
"vertical": true,

@@ -149,46 +135,17 @@ "move": state.moveY,

"onMouseenter": function onMouseenter(e) {
_this.$emit('mouseenter', e);
_this.$emit("mouseenter", e);
},
"onMousemove": function onMousemove(e) {
_this.$emit('mousemove', e);
_this.$emit("mousemove", e);
}
}, [nodes]);
}
});
var version = "3.7.0";
_sfc_main.install = function(Vue) {
Vue.component(_sfc_main.name, _sfc_main);
};
function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;
if (!css || typeof document === 'undefined') { return; }
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}
var css_248z = ".tiny-scrollbar{overflow:hidden;position:relative}.tiny-scrollbar:active>.tiny-scrollbar__bar,.tiny-scrollbar:focus>.tiny-scrollbar__bar,.tiny-scrollbar:hover>.tiny-scrollbar__bar{opacity:1;-webkit-transition:opacity 340ms ease-out;transition:opacity 340ms ease-out}.tiny-scrollbar__wrap{overflow:scroll;height:100%;max-height:200px}.tiny-scrollbar__wrap--hidden-default::-webkit-scrollbar{width:0;height:0}.tiny-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:rgba(144,147,153,.3);-webkit-transition:.3s background-color;transition:.3s background-color}.tiny-scrollbar__thumb:hover{background-color:rgba(144,147,153,.5)}.tiny-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px;opacity:0;-webkit-transition:opacity 120ms ease-out;transition:opacity 120ms ease-out}.tiny-scrollbar__bar.is-vertical{width:6px;top:2px}.tiny-scrollbar__bar.is-vertical>div{width:100%}.tiny-scrollbar__bar.is-horizontal{height:6px;left:2px}.tiny-scrollbar__bar.is-horizontal>div{height:100%}";
styleInject(css_248z);
script.install = function (Vue) {
Vue.component(script.name, script);
_sfc_main.version = version;
export {
_sfc_main as default
};
script.version = '3.6.0';
export { script as default };
{
"name": "@opentiny/vue-scrollbar",
"version": "3.6.0",
"version": "3.6.1-alpha.0",
"description": "",
"main": "lib/index.js",
"scripts": {
"lint": "eslint src/**/*{.js,.html,.vue} --quiet",
"build:ui2": "cross-env BUILD_TARGET=single NODE_ENV=production node ../../build/build-ui.js",
"build:ui3": "cross-env BUILD_TARGET=single NODE_ENV=production node ../../example/build/build-ui.js"
},
"main": "./lib/index.js",
"dependencies": {
"@opentiny/vue-renderless": "~3.6.0",
"@opentiny/vue-common": "~3.6.0",
"@opentiny/vue-icon": "~3.6.0",
"@opentiny/vue-theme": "~3.6.0",
"@opentiny/vue-theme-mobile": "~3.6.0"
"@opentiny/vue-renderless": "~3.6.1-alpha.0",
"@opentiny/vue-common": "~3.6.1-alpha.0"
},
"license": "MIT",
"types": "index.d.ts",
"sideEffects": false
"scripts": {
"build": "pnpm -w build:ui $npm_package_name",
"//postversion": "pnpm build"
}
}

@@ -1,2 +0,2 @@

declare const _default: {
declare const _sfc_main: {
name: string;

@@ -9,3 +9,3 @@ props: {

setup(props: any, context: any): {
t: any;
t: (this: any, path: any, options?: any) => any;
vm: any;

@@ -19,2 +19,2 @@ f: (props: any, attrs?: {}) => {};

};
export default _default;
export default _sfc_main;

@@ -1,2 +0,2 @@

declare const _default: import("vue").DefineComponent<{
declare const _sfc_main: import("@vue/runtime-core").DefineComponent<{
marginBottomAdjust: {

@@ -17,3 +17,3 @@ type: NumberConstructor;

}, {
t: any;
t: (this: any, path: any, options?: any) => any;
vm: any;

@@ -24,3 +24,3 @@ f: (props: any, attrs?: {}) => {};

dp: (props: any) => void;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mouseenter" | "scroll" | "mousemove")[], "mouseenter" | "scroll" | "mousemove", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mouseenter" | "mousemove" | "scroll")[], "mouseenter" | "mousemove" | "scroll", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
marginBottomAdjust: {

@@ -45,7 +45,7 @@ type: NumberConstructor;

}, {
tag: string;
marginBottomAdjust: number;
native: boolean;
noresize: boolean;
tag: string;
}>;
export default _default;
export default _sfc_main;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc