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

simplebar-core

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simplebar-core - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

4

dist/helpers.d.ts

@@ -1,4 +0,4 @@

import { Options } from './';
import type { SimpleBarOptions } from './index';
export declare function getElementWindow(element: Element): Window & typeof globalThis;
export declare function getElementDocument(element: Element): Document;
export declare const getOptions: (obj: any) => Partial<Options>;
export declare const getOptions: (obj: any) => SimpleBarOptions;
import type { DebouncedFunc } from 'lodash';
export interface Options {
interface Options {
forceVisible: boolean | Axis;

@@ -7,33 +7,32 @@ clickOnTrack: boolean;

scrollbarMaxSize: number;
classNames: typeof ClassNames;
classNames: Partial<ClassNames>;
ariaLabel: string;
scrollableNode: HTMLElement | null;
contentNode: HTMLElement | null;
/**
* @deprecated autoHide option is deprecated. Please use CSS instead: '.simplebar-scrollbar::before { opacity: 0.5 };' for autoHide: false
*/
autoHide?: boolean;
autoHide: boolean;
}
declare const ClassNames: {
readonly contentEl: "simplebar-content";
readonly contentWrapper: "simplebar-content-wrapper";
readonly offset: "simplebar-offset";
readonly mask: "simplebar-mask";
readonly wrapper: "simplebar-wrapper";
readonly placeholder: "simplebar-placeholder";
readonly scrollbar: "simplebar-scrollbar";
readonly track: "simplebar-track";
readonly heightAutoObserverWrapperEl: "simplebar-height-auto-observer-wrapper";
readonly heightAutoObserverEl: "simplebar-height-auto-observer";
readonly visible: "simplebar-visible";
readonly horizontal: "simplebar-horizontal";
readonly vertical: "simplebar-vertical";
readonly hover: "simplebar-hover";
readonly dragging: "simplebar-dragging";
readonly scrolling: "simplebar-scrolling";
readonly scrollable: "simplebar-scrollable";
readonly mouseEntered: "simplebar-mouse-entered";
export interface SimpleBarOptions extends Partial<Options> {
}
type ClassNames = {
contentEl: string;
contentWrapper: string;
offset: string;
mask: string;
wrapper: string;
placeholder: string;
scrollbar: string;
track: string;
heightAutoObserverWrapperEl: string;
heightAutoObserverEl: string;
visible: string;
horizontal: string;
vertical: string;
hover: string;
dragging: string;
scrolling: string;
scrollable: string;
mouseEntered: string;
};
declare type Axis = 'x' | 'y';
declare type AxisProps = {
type Axis = 'x' | 'y';
type AxisProps = {
scrollOffsetAttr: 'scrollLeft' | 'scrollTop';

@@ -47,3 +46,2 @@ sizeAttr: 'width' | 'height';

isOverflowing: boolean;
isVisible: boolean;
forceVisible: boolean;

@@ -54,2 +52,3 @@ track: {

rect: DOMRect | null;
isVisible: boolean;
};

@@ -60,13 +59,14 @@ scrollbar: {

rect: DOMRect | null;
isVisible: boolean;
};
};
declare type RtlHelpers = {
type RtlHelpers = {
isScrollOriginAtZero: boolean;
isScrollingToNegative: boolean;
} | null;
declare type DefaultOptions = Partial<Options> & typeof SimpleBarCore.defaultOptions;
type DefaultOptions = Options & typeof SimpleBarCore.defaultOptions;
export default class SimpleBarCore {
el: HTMLElement;
options: DefaultOptions;
classNames: typeof ClassNames;
classNames: ClassNames;
axis: {

@@ -110,3 +110,3 @@ x: AxisProps;

*/
static getOptions: (obj: any) => Partial<Options>;
static getOptions: (obj: any) => SimpleBarOptions;
/**

@@ -113,0 +113,0 @@ * Helper to fix browsers inconsistency on RTL:

{
"version": "1.0.8",
"version": "1.0.9",
"name": "simplebar-core",

@@ -42,5 +42,3 @@ "title": "SimpleBar.js",

"@types/lodash": "^4.14.191",
"can-use-dom": "^0.1.0",
"intern": "^4.4.2",
"promise": "^8.0.2"
"intern": "^4.4.2"
},

@@ -53,3 +51,3 @@ "lint-staged": {

},
"gitHead": "edd8de57b1d186fdd2603bc9d945c7f61145925c"
"gitHead": "ab247843c54d13f353677468e369cb0a90fb647d"
}

@@ -119,3 +119,3 @@ # SimpleBar [![npm package][npm-badge]][npm] ![size-badge]

document.querySelectorAll('.myElements'),
el => new SimpleBar()
(el) => new SimpleBar()
);

@@ -141,2 +141,3 @@ ```

Ex, to change the color of the scrollbar:
```css

@@ -155,3 +156,3 @@ .simplebar-scrollbar::before {

option1: value1,
option2: value2
option2: value2,
});

@@ -350,2 +351,8 @@ ```

### IE11 Support
SimpleBar can support IE11 if you use the right polyfills. See [our configuration](https://github.com/Grsmto/simplebar/tree/master/packages/examples/.babelrc) using `@babel/preset-env` to support IE11!
Since IE11 does not support Resize Observer, some features won't work unless you polyfill it. For example, if the SimpleBar element is hidden (like a dropdown menu), you will need to manually call `recalculate()` for it to work.
### Community plugins

@@ -352,0 +359,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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