Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentiny/vue-scrollbar

Package Overview
Dependencies
Maintainers
1
Versions
61
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 2.6.0 to 2.6.1-alpha.0

index.d.ts

299

lib/index.js

@@ -1,123 +0,45 @@

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';
import '@opentiny/vue-theme/scrollbar/index.css';
var script$1 = {
name: $prefix + 'Bar',
props: {
vertical: Boolean,
size: String,
move: Number
},
setup: function setup$1(props, context) {
return setup({
props: props,
context: context,
renderless: renderless,
api: api,
mono: true,
h: h
});
},
render: function render() {
var h = arguments[0];
var size = this.size,
move = this.move,
renderThumbStyle = this.renderThumbStyle,
clickTrackHandler = this.clickTrackHandler,
clickThumbHandler = this.clickThumbHandler,
bar = this.state.bar;
return h("div", {
"ref": "bar",
"class": ['tiny-scrollbar__bar', 'is-' + bar.key],
"on": {
"mousedown": clickTrackHandler
}
}, [h("div", {
"ref": "thumb",
"class": "tiny-scrollbar__thumb",
"on": {
"mousedown": clickThumbHandler
},
"style": renderThumbStyle({
bar: bar,
move: move,
size: size
})
})]);
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";
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
if (render) {
options.render = render;
options.staticRenderFns = staticRenderFns;
options._compiled = true;
}
};
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
/* server only */
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
if (typeof shadowMode !== 'boolean') {
createInjectorSSR = createInjector;
createInjector = shadowMode;
shadowMode = false;
} // Vue.extend constructor export interop.
var options = typeof script === 'function' ? script.options : script; // render functions
if (template && template.render) {
options.render = template.render;
options.staticRenderFns = template.staticRenderFns;
options._compiled = true; // functional template
if (isFunctionalTemplate) {
options.functional = true;
}
} // scopedId
if (functionalTemplate) {
options.functional = true;
}
if (scopeId) {
options._scopeId = scopeId;
options._scopeId = "data-v-" + scopeId;
}
var hook;
if (moduleIdentifier) {
// server build
hook = function hook(context) {
// 2.3 injection
hook = function hook2(context) {
context = context || // cached call
this.$vnode && this.$vnode.ssrContext || // stateful
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
context = __VUE_SSR_CONTEXT__;
} // inject component styles
if (style) {
style.call(this, createInjectorSSR(context));
} // register component module identifier for async chunk inference
}
if (injectStyles) {
injectStyles.call(this, context);
}
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier);
}
}; // used by ssr in case component is cached and beforeCreate
// never gets called
};
options._ssrRegister = hook;
} else if (style) {
hook = shadowMode ? function () {
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
} : function (context) {
style.call(this, createInjector(context));
};
} else if (injectStyles) {
hook = shadowMode ? function() {
injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
} : injectStyles;
}
if (hook) {
if (options.functional) {
// register for functional component in vue file
options._injectStyles = hook;
var originalRender = options.render;
options.render = function renderWithStyleInjection(h, context) {

@@ -128,3 +50,2 @@ hook.call(context);

} else {
// inject component registration as beforeCreate hook
var existing = options.beforeCreate;

@@ -134,20 +55,65 @@ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];

}
return {
exports: scriptExports,
options
};
}
return script;
import "@opentiny/vue-theme/scrollbar/index.css";
var __vue2_script$1 = {
name: $prefix + "Bar",
props: {
vertical: Boolean,
size: String,
move: Number
},
setup: function setup(props, context) {
return _setup({
props,
context,
renderless,
api,
mono: true,
h
});
},
render: function render() {
var h2 = arguments[0];
var size = this.size, move = this.move, renderThumbStyle = this.renderThumbStyle, clickTrackHandler = this.clickTrackHandler, clickThumbHandler = this.clickThumbHandler, bar = this.state.bar;
return h2("div", {
"ref": "bar",
"class": ["tiny-scrollbar__bar", "is-" + bar.key],
"on": {
"mousedown": clickTrackHandler
}
}, [h2("div", {
"ref": "thumb",
"class": "tiny-scrollbar__thumb",
"on": {
"mousedown": clickThumbHandler
},
"style": renderThumbStyle({
bar,
move,
size
})
})]);
}
};
var __vue2_render$1, __vue2_staticRenderFns$1;
var __cssModules$1 = {};
var __component__$1 = /* @__PURE__ */ normalizeComponent(__vue2_script$1, __vue2_render$1, __vue2_staticRenderFns$1, false, __vue2_injectStyles$1, null, null, null);
function __vue2_injectStyles$1(context) {
for (var o in __cssModules$1) {
this[o] = __cssModules$1[o];
}
}
var normalizeComponent_1 = normalizeComponent;
var __vue_script__$1 = script$1;
var __vue_inject_styles__$1 = undefined;
var __vue_scope_id__$1 = undefined;
var __vue_module_identifier__$1 = undefined;
var __vue_is_functional_template__$1 = undefined;
var __vue_component__$1 = normalizeComponent_1({}, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, false, undefined, undefined, undefined);
var script = {
name: $prefix + 'Scrollbar',
emits: ['mouseenter', 'mousemove', 'scroll'],
var Bar = /* @__PURE__ */ function() {
return __component__$1.exports;
}();
var __vue2_script = defineComponent({
name: $prefix + "Scrollbar",
emits: ["mouseenter", "mousemove", "scroll"],
components: {
Bar: __vue_component__$1
Bar
},

@@ -160,6 +126,7 @@ props: {

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

@@ -171,6 +138,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,

@@ -181,21 +148,12 @@ api: api$1,

},
render: function render() {
render: function render2() {
var _this = this;
var h = arguments[0];
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 h2 = arguments[0];
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)) {

@@ -205,3 +163,3 @@ style = toObject(wrapStyle);

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

@@ -212,8 +170,8 @@ } else {

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

@@ -224,13 +182,13 @@ "style": style,

},
"class": [wrapClass, 'tiny-scrollbar__wrap', gutter ? '' : 'tiny-scrollbar__wrap--hidden-default']
"class": [wrapClass, "tiny-scrollbar__wrap", gutter ? "" : "tiny-scrollbar__wrap--hidden-default"]
}, [[view]]);
var nodes;
if (native) {
nodes = [h("div", {
nodes = [h2("div", {
"ref": "wrap",
"class": [wrapClass, 'tiny-scrollbar__wrap'],
"class": [wrapClass, "tiny-scrollbar__wrap"],
"style": style
}, [[view]])];
} else {
nodes = [wrap, h(__vue_component__$1, {
nodes = [wrap, h2(Bar, {
"attrs": {

@@ -240,3 +198,3 @@ "move": state.moveX,

}
}), h(__vue_component__$1, {
}), h2(Bar, {
"attrs": {

@@ -249,10 +207,10 @@ "vertical": true,

}
return h("div", {
return h2("div", {
"class": "tiny-scrollbar",
"on": {
"mouseenter": function mouseenter(e) {
_this.$emit('mouseenter', e);
_this.$emit("mouseenter", e);
},
"mousemove": function mousemove(e) {
_this.$emit('mousemove', e);
_this.$emit("mousemove", e);
}

@@ -262,16 +220,21 @@ }

}
});
var __vue2_render, __vue2_staticRenderFns;
var __cssModules = {};
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles, null, null, null);
function __vue2_injectStyles(context) {
for (var o in __cssModules) {
this[o] = __cssModules[o];
}
}
var Scrollbar = /* @__PURE__ */ function() {
return __component__.exports;
}();
var version = "3.7.0";
Scrollbar.install = function(Vue) {
Vue.component(Scrollbar.name, Scrollbar);
};
var __vue_script__ = script;
var __vue_inject_styles__ = undefined;
var __vue_scope_id__ = undefined;
var __vue_module_identifier__ = undefined;
var __vue_is_functional_template__ = undefined;
var __vue_component__ = normalizeComponent_1({}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
__vue_component__.install = function (Vue) {
Vue.component(__vue_component__.name, __vue_component__);
Scrollbar.version = version;
export {
Scrollbar as default
};
__vue_component__.version = '2.6.0';
export { __vue_component__ as default };
{
"name": "@opentiny/vue-scrollbar",
"version": "2.6.0",
"version": "2.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": "~2.6.0",
"@opentiny/vue-icon": "~2.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": "~2.6.1-alpha.0"
},
"license": "MIT",
"sideEffects": false
"types": "index.d.ts",
"scripts": {
"build": "pnpm -w build:ui $npm_package_name",
"//postversion": "pnpm build"
}
}
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