mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-19 08:10:35 +03:00
build
This commit is contained in:
@@ -477,7 +477,10 @@ const debounce = (functionToDebounce, timeout, maxWait) => {
|
||||
};
|
||||
};
|
||||
|
||||
const cssNumber = {};
|
||||
const cssNumber = {
|
||||
opacity: 1,
|
||||
zindex: 1,
|
||||
};
|
||||
|
||||
const parseToZeroOrNumber = (value, toFloat) => {
|
||||
const num = toFloat ? parseFloat(value) : parseInt(value, 10);
|
||||
@@ -822,7 +825,6 @@ const createEnvironment = () => {
|
||||
let initializationStrategy = defaultInitializationStrategy;
|
||||
let defaultDefaultOptions = defaultOptions;
|
||||
const env = {
|
||||
_autoUpdateLoop: false,
|
||||
_nativeScrollbarSize: nativeScrollbarSize,
|
||||
_nativeScrollbarIsOverlaid: nativeScrollbarIsOverlaid,
|
||||
_nativeScrollbarStyling: nativeScrollbarStyling,
|
||||
@@ -2070,8 +2072,7 @@ const createLifecycleHub = (options, structureSetup) => {
|
||||
});
|
||||
};
|
||||
|
||||
const trinsicObserver = _content && createTrinsicObserver(_host, onTrinsicChanged);
|
||||
|
||||
const trinsicObserver = (_content || !_flexboxGlue) && createTrinsicObserver(_host, onTrinsicChanged);
|
||||
const sizeObserver = createSizeObserver(_host, onSizeChanged, {
|
||||
_appear: true,
|
||||
_direction: !_nativeScrollbarStyling,
|
||||
@@ -2093,7 +2094,6 @@ const createLifecycleHub = (options, structureSetup) => {
|
||||
|
||||
const envUpdateListener = update.bind(null, null, true);
|
||||
addEnvironmentListener(envUpdateListener);
|
||||
console.log(getEnvironment());
|
||||
return {
|
||||
_update: update,
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5
-5
@@ -551,7 +551,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
var cssNumber = {};
|
||||
var cssNumber = {
|
||||
opacity: 1,
|
||||
zindex: 1,
|
||||
};
|
||||
|
||||
var parseToZeroOrNumber = function parseToZeroOrNumber(value, toFloat) {
|
||||
var num = toFloat ? parseFloat(value) : parseInt(value, 10);
|
||||
@@ -919,7 +922,6 @@
|
||||
var initializationStrategy = defaultInitializationStrategy;
|
||||
var defaultDefaultOptions = defaultOptions;
|
||||
var env = {
|
||||
_autoUpdateLoop: false,
|
||||
_nativeScrollbarSize: nativeScrollbarSize,
|
||||
_nativeScrollbarIsOverlaid: nativeScrollbarIsOverlaid,
|
||||
_nativeScrollbarStyling: nativeScrollbarStyling,
|
||||
@@ -2344,8 +2346,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
var trinsicObserver = _content && createTrinsicObserver(_host, onTrinsicChanged);
|
||||
|
||||
var trinsicObserver = (_content || !_flexboxGlue) && createTrinsicObserver(_host, onTrinsicChanged);
|
||||
var sizeObserver = createSizeObserver(_host, onSizeChanged, {
|
||||
_appear: true,
|
||||
_direction: !_nativeScrollbarStyling,
|
||||
@@ -2367,7 +2368,6 @@
|
||||
|
||||
var envUpdateListener = update.bind(null, null, true);
|
||||
addEnvironmentListener(envUpdateListener);
|
||||
console.log(getEnvironment());
|
||||
return {
|
||||
_update: update,
|
||||
_destroy: function _destroy() {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
export * from 'overlayscrollbars';
|
||||
export { OverlayScrollbars as default } from 'overlayscrollbars';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { OverlayScrollbars } from './';
|
||||
import { OverlayScrollbars } from 'overlayscrollbars';
|
||||
|
||||
const targets: Set<Element> = new Set();
|
||||
const targetInstanceMap: WeakMap<Element, OverlayScrollbars> = new WeakMap();
|
||||
|
||||
@@ -16,7 +16,7 @@ export interface OverlayScrollbars {
|
||||
update(force?: boolean): void;
|
||||
}
|
||||
|
||||
const OverlayScrollbars: OverlayScrollbarsStatic = (
|
||||
export const OverlayScrollbars: OverlayScrollbarsStatic = (
|
||||
target: OSTarget | OSTargetObject,
|
||||
options?: PartialOptions<OSOptions>,
|
||||
extensions?: any
|
||||
@@ -50,5 +50,3 @@ const OverlayScrollbars: OverlayScrollbarsStatic = (
|
||||
|
||||
return instance;
|
||||
};
|
||||
|
||||
export default OverlayScrollbars;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import 'styles/overlayscrollbars.scss';
|
||||
import './index.scss';
|
||||
import { createDiv, appendChildren, parent, style, on, off, addClass, WH, XY, clientSize } from 'support';
|
||||
import OverlayScrollbars from 'overlayscrollbars';
|
||||
import { OverlayScrollbars } from 'overlayscrollbars';
|
||||
|
||||
const targetElm = document.querySelector('#target') as HTMLElement;
|
||||
window.os = OverlayScrollbars({ target: targetElm, content: false });
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { addInstance, removeInstance, getInstance, allInstances } from 'instances';
|
||||
import OverlayScrollbars from 'overlayscrollbars';
|
||||
import { OverlayScrollbars } from 'overlayscrollbars';
|
||||
|
||||
const testElm = document.body;
|
||||
const testInstance = OverlayScrollbars(document.body);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export {};
|
||||
@@ -1,6 +0,0 @@
|
||||
export interface AutoUpdateLoop {
|
||||
_add(fn: (delta: number) => any): () => void;
|
||||
_interval(newInterval: number): () => void;
|
||||
_interval(): number;
|
||||
}
|
||||
export declare const getAutoUpdateLoop: () => AutoUpdateLoop;
|
||||
@@ -1 +0,0 @@
|
||||
export * from 'autoUpdateLoop/autoUpdateLoop';
|
||||
-1
@@ -6,7 +6,6 @@ export interface InitializationStrategy {
|
||||
}
|
||||
export declare type OnEnvironmentChanged = (env: Environment) => void;
|
||||
export interface Environment {
|
||||
_autoUpdateLoop: boolean;
|
||||
_nativeScrollbarSize: XY;
|
||||
_nativeScrollbarIsOverlaid: XY<boolean>;
|
||||
_nativeScrollbarStyling: boolean;
|
||||
@@ -1,3 +0,0 @@
|
||||
import { Environment } from 'environment/environment';
|
||||
export * from 'environment/environment';
|
||||
export declare type OSEnvironment = Omit<Environment, 'addListener' | 'removeListener'>;
|
||||
+1
-2
@@ -1,2 +1 @@
|
||||
import { OverlayScrollbars } from 'overlayscrollbars/overlayscrollbars';
|
||||
export default OverlayScrollbars;
|
||||
export { OverlayScrollbars as default } from 'overlayscrollbars';
|
||||
|
||||
+4
-3
@@ -1,9 +1,10 @@
|
||||
import { OverlayScrollbars } from 'overlayscrollbars';
|
||||
/**
|
||||
* Adds the given OverlayScrollbars instance to the given element.
|
||||
* @param target The element which is the target of the OverlayScrollbars instance.
|
||||
* @param osInstance The OverlayScrollbars instance.
|
||||
*/
|
||||
export declare const addInstance: (target: Element, osInstance: any) => void;
|
||||
export declare const addInstance: (target: Element, osInstance: OverlayScrollbars) => void;
|
||||
/**
|
||||
* Removes a OverlayScrollbars instance from the given element.
|
||||
* @param target The element from which its OverlayScrollbars instance shall be removed.
|
||||
@@ -13,9 +14,9 @@ export declare const removeInstance: (target: Element) => void;
|
||||
* Gets the OverlayScrollbars from the given element or undefined if it doesn't have one.
|
||||
* @param target The element of which its OverlayScrollbars instance shall be get.
|
||||
*/
|
||||
export declare const getInstance: (target: Element) => any;
|
||||
export declare const getInstance: (target: Element) => OverlayScrollbars | undefined;
|
||||
/**
|
||||
* Gets a Map which represents all active OverayScrollbars instances.
|
||||
* The Key is the ekement and the value is the instance.
|
||||
*/
|
||||
export declare const allInstances: () => ReadonlyMap<Element, any>;
|
||||
export declare const allInstances: () => ReadonlyMap<Element, OverlayScrollbars>;
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,3 @@
|
||||
export * from 'options/options';
|
||||
export declare type ResizeBehavior = 'none' | 'both' | 'horizontal' | 'vertical';
|
||||
export declare type OverflowBehavior = 'hidden' | 'scroll' | 'visible-hidden' | 'visible-scroll';
|
||||
export declare type VisibilityBehavior = 'visible' | 'hidden' | 'auto';
|
||||
@@ -11,7 +10,7 @@ export declare type OverflowAmountChangedCallback = (this: any, args?: OverflowA
|
||||
export declare type DirectionChangedCallback = (this: any, args?: DirectionChangedArgs) => void;
|
||||
export declare type SizeChangedCallback = (this: any, args?: SizeChangedArgs) => void;
|
||||
export declare type UpdatedCallback = (this: any, args?: UpdatedArgs) => void;
|
||||
export interface OverlayScrollbarsOptions {
|
||||
export interface OSOptions {
|
||||
resize: ResizeBehavior;
|
||||
paddingAbsolute: boolean;
|
||||
updating: {
|
||||
@@ -64,3 +63,4 @@ export interface SizeChangedArgs {
|
||||
export interface UpdatedArgs {
|
||||
forced: boolean;
|
||||
}
|
||||
export declare const optionsTemplate: import("./support/options").OptionsTemplate<OSOptions>, defaultOptions: OSOptions;
|
||||
@@ -1,2 +0,0 @@
|
||||
import { OSOptions } from 'options';
|
||||
export declare const optionsTemplate: import("../support/options").OptionsTemplate<OSOptions>, defaultOptions: OSOptions;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { OSTarget, OSTargetObject } from 'typings';
|
||||
import { PartialOptions } from 'support';
|
||||
import { OSOptions } from 'options';
|
||||
export interface OverlayScrollbarsStatic {
|
||||
(target: OSTarget | OSTargetObject, options?: PartialOptions<OSOptions>, extensions?: any): OverlayScrollbars;
|
||||
}
|
||||
export interface OverlayScrollbars {
|
||||
options(): OSOptions;
|
||||
options(newOptions?: PartialOptions<OSOptions>): OSOptions;
|
||||
update(force?: boolean): void;
|
||||
}
|
||||
export declare const OverlayScrollbars: OverlayScrollbarsStatic;
|
||||
@@ -1,5 +0,0 @@
|
||||
import { OSTarget, OSTargetObject } from 'typings';
|
||||
import { PartialOptions } from 'support';
|
||||
import { OSOptions } from 'options';
|
||||
declare const OverlayScrollbars: (target: OSTarget | OSTargetObject, options?: PartialOptions<OSOptions> | undefined, extensions?: any) => any;
|
||||
export { OverlayScrollbars };
|
||||
@@ -1,2 +0,0 @@
|
||||
export * from 'overlayscrollbars';
|
||||
export declare type TargetElement = HTMLElement | HTMLTextAreaElement;
|
||||
Reference in New Issue
Block a user