mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-18 21:10:38 +03:00
improve code
This commit is contained in:
+23
-21
@@ -19,7 +19,7 @@
|
|||||||
z-index: -1;
|
z-index: -1;
|
||||||
contain: strict;
|
contain: strict;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: row;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
padding: inherit;
|
padding: inherit;
|
||||||
border: inherit;
|
border: inherit;
|
||||||
@@ -118,11 +118,15 @@
|
|||||||
min-height: 1px;
|
min-height: 1px;
|
||||||
min-width: 1px; }
|
min-width: 1px; }
|
||||||
|
|
||||||
|
[data-overlayscrollbars~='updating'] > .os-scrollbar {
|
||||||
|
display: none !important; }
|
||||||
|
|
||||||
.os-scrollbar {
|
.os-scrollbar {
|
||||||
|
contain: strict;
|
||||||
transition: opacity 0.3s, visibility 0.3s, top 0.3s, right 0.3s, bottom 0.3s, left 0.3s;
|
transition: opacity 0.3s, visibility 0.3s, top 0.3s, right 0.3s, bottom 0.3s, left 0.3s;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 0;
|
z-index: 99999;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
visibility: hidden; }
|
visibility: hidden; }
|
||||||
|
|
||||||
@@ -133,30 +137,24 @@ body > .os-scrollbar {
|
|||||||
transition: none; }
|
transition: none; }
|
||||||
|
|
||||||
.os-scrollbar-track {
|
.os-scrollbar-track {
|
||||||
pointer-events: none;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 100%;
|
direction: ltr !important;
|
||||||
width: 100%;
|
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
border: none !important; }
|
border: none !important; }
|
||||||
|
|
||||||
|
.os-scrollbar-handle {
|
||||||
|
position: absolute; }
|
||||||
|
|
||||||
|
.os-scrollbar-track,
|
||||||
.os-scrollbar-handle {
|
.os-scrollbar-handle {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%; }
|
height: 100%; }
|
||||||
|
|
||||||
.os-scrollbar-handle-interactive,
|
.os-scrollbar.os-scrollbar-track-interactive .os-scrollbar-track,
|
||||||
.os-scrollbar-track-interactive {
|
.os-scrollbar.os-scrollbar-handle-interactive .os-scrollbar-handle {
|
||||||
pointer-events: auto; }
|
pointer-events: auto;
|
||||||
|
touch-action: none; }
|
||||||
.os-scrollbar-unusable,
|
|
||||||
.os-scrollbar-unusable * {
|
|
||||||
pointer-events: none !important; }
|
|
||||||
|
|
||||||
.os-scrollbar-unusable .os-scrollbar-handle {
|
|
||||||
opacity: 0 !important;
|
|
||||||
visibility: hidden Im !important; }
|
|
||||||
|
|
||||||
.os-scrollbar-horizontal {
|
.os-scrollbar-horizontal {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
@@ -173,7 +171,8 @@ body > .os-scrollbar {
|
|||||||
right: auto;
|
right: auto;
|
||||||
left: 0; }
|
left: 0; }
|
||||||
|
|
||||||
.os-scrollbar-visible {
|
.os-scrollbar-visible,
|
||||||
|
.os-scrollbar-interaction.os-scrollbar-visible {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
visibility: visible; }
|
visibility: visible; }
|
||||||
|
|
||||||
@@ -181,9 +180,12 @@ body > .os-scrollbar {
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
visibility: hidden; }
|
visibility: hidden; }
|
||||||
|
|
||||||
.os-scrollbar-interaction.os-scrollbar-visible {
|
.os-scrollbar-unusable,
|
||||||
opacity: 1;
|
.os-scrollbar-unusable * {
|
||||||
visibility: visible; }
|
pointer-events: none !important; }
|
||||||
|
|
||||||
|
.os-scrollbar-unusable .os-scrollbar-handle {
|
||||||
|
opacity: 0 !important; }
|
||||||
|
|
||||||
.os-scrollbar.os-scrollbar-horizontal.os-scrollbar-cornerless {
|
.os-scrollbar.os-scrollbar-horizontal.os-scrollbar-cornerless {
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
+806
-666
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1067
-930
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
Cache,
|
|
||||||
CacheValues,
|
CacheValues,
|
||||||
createCache,
|
createCache,
|
||||||
createDOM,
|
createDOM,
|
||||||
style,
|
|
||||||
scrollLeft,
|
scrollLeft,
|
||||||
scrollTop,
|
scrollTop,
|
||||||
runEachAndClear,
|
runEachAndClear,
|
||||||
@@ -18,6 +16,7 @@ import {
|
|||||||
isObject,
|
isObject,
|
||||||
stopPropagation,
|
stopPropagation,
|
||||||
appendChildren,
|
appendChildren,
|
||||||
|
directionIsRTL,
|
||||||
} from 'support';
|
} from 'support';
|
||||||
import { getEnvironment } from 'environment';
|
import { getEnvironment } from 'environment';
|
||||||
import {
|
import {
|
||||||
@@ -41,7 +40,6 @@ export interface SizeObserverCallbackParams {
|
|||||||
export type SizeObserver = [destroy: () => void, append: () => void];
|
export type SizeObserver = [destroy: () => void, append: () => void];
|
||||||
|
|
||||||
const scrollAmount = 3333333;
|
const scrollAmount = 3333333;
|
||||||
const getElmDirectionIsRTL = (elm: HTMLElement): boolean => style(elm, 'direction') === 'rtl';
|
|
||||||
const domRectHasDimensions = (rect?: DOMRectReadOnly) => rect && (rect.height || rect.width);
|
const domRectHasDimensions = (rect?: DOMRectReadOnly) => rect && (rect.height || rect.width);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,7 +65,7 @@ export const createSizeObserver = (
|
|||||||
);
|
);
|
||||||
const sizeObserver = baseElements[0] as HTMLElement;
|
const sizeObserver = baseElements[0] as HTMLElement;
|
||||||
const listenerElement = sizeObserver.firstChild as HTMLElement;
|
const listenerElement = sizeObserver.firstChild as HTMLElement;
|
||||||
const getIsDirectionRTL = getElmDirectionIsRTL.bind(0, sizeObserver);
|
const getIsDirectionRTL = directionIsRTL.bind(0, target);
|
||||||
const [updateResizeObserverContentRectCache] = createCache<DOMRectReadOnly | undefined>({
|
const [updateResizeObserverContentRectCache] = createCache<DOMRectReadOnly | undefined>({
|
||||||
_initialValue: undefined,
|
_initialValue: undefined,
|
||||||
_alwaysUpdateValues: true,
|
_alwaysUpdateValues: true,
|
||||||
@@ -117,7 +115,7 @@ export const createSizeObserver = (
|
|||||||
if (observeDirectionChange && doDirectionScroll) {
|
if (observeDirectionChange && doDirectionScroll) {
|
||||||
const rtl = hasDirectionCache
|
const rtl = hasDirectionCache
|
||||||
? (sizeChangedContext as CacheValues<boolean>)[0]
|
? (sizeChangedContext as CacheValues<boolean>)[0]
|
||||||
: getElmDirectionIsRTL(sizeObserver);
|
: directionIsRTL(sizeObserver);
|
||||||
scrollLeft(
|
scrollLeft(
|
||||||
sizeObserver,
|
sizeObserver,
|
||||||
rtl
|
rtl
|
||||||
@@ -145,7 +143,6 @@ export const createSizeObserver = (
|
|||||||
let appearCallback: ((...args: any) => any) | false = observeAppearChange
|
let appearCallback: ((...args: any) => any) | false = observeAppearChange
|
||||||
? onSizeChangedCallbackProxy
|
? onSizeChangedCallbackProxy
|
||||||
: false;
|
: false;
|
||||||
let directionIsRTLCache: Cache<boolean> | undefined;
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
() => {
|
() => {
|
||||||
@@ -170,23 +167,22 @@ export const createSizeObserver = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (observeDirectionChange) {
|
if (observeDirectionChange) {
|
||||||
directionIsRTLCache = createCache(
|
const [updateDirectionIsRTLCache] = createCache(
|
||||||
{
|
{
|
||||||
_initialValue: !getIsDirectionRTL(), // invert current value to trigger initial change
|
_initialValue: !getIsDirectionRTL(), // invert current value to trigger initial change
|
||||||
},
|
},
|
||||||
getIsDirectionRTL
|
getIsDirectionRTL
|
||||||
);
|
);
|
||||||
const [updateDirectionIsRTLCache] = directionIsRTLCache;
|
|
||||||
|
|
||||||
push(
|
push(
|
||||||
offListeners,
|
offListeners,
|
||||||
on(sizeObserver, 'scroll', (event: Event) => {
|
on(sizeObserver, 'scroll', (event: Event) => {
|
||||||
const directionIsRTLCacheValues = updateDirectionIsRTLCache();
|
const directionIsRTLCacheValues = updateDirectionIsRTLCache();
|
||||||
const [directionIsRTL, directionIsRTLChanged] = directionIsRTLCacheValues;
|
const [directionIsRTLCache, directionIsRTLCacheChanged] = directionIsRTLCacheValues;
|
||||||
|
|
||||||
if (directionIsRTLChanged) {
|
if (directionIsRTLCacheChanged) {
|
||||||
removeClass(listenerElement, 'ltr rtl');
|
removeClass(listenerElement, 'ltr rtl');
|
||||||
if (directionIsRTL) {
|
if (directionIsRTLCache) {
|
||||||
addClass(listenerElement, 'rtl');
|
addClass(listenerElement, 'rtl');
|
||||||
} else {
|
} else {
|
||||||
addClass(listenerElement, 'ltr');
|
addClass(listenerElement, 'ltr');
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ export interface State {
|
|||||||
overflowAmount: XY<number>;
|
overflowAmount: XY<number>;
|
||||||
overflowStyle: XY<OverflowStyle>;
|
overflowStyle: XY<OverflowStyle>;
|
||||||
hasOverflow: XY<boolean>;
|
hasOverflow: XY<boolean>;
|
||||||
|
directionRTL: boolean;
|
||||||
destroyed: boolean;
|
destroyed: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,6 +214,7 @@ export const OverlayScrollbars: OverlayScrollbarsStatic = (
|
|||||||
_hasOverflow,
|
_hasOverflow,
|
||||||
_padding,
|
_padding,
|
||||||
_paddingAbsolute,
|
_paddingAbsolute,
|
||||||
|
_directionIsRTL,
|
||||||
} = structureState();
|
} = structureState();
|
||||||
return assignDeep(
|
return assignDeep(
|
||||||
{},
|
{},
|
||||||
@@ -223,6 +225,7 @@ export const OverlayScrollbars: OverlayScrollbarsStatic = (
|
|||||||
hasOverflow: _hasOverflow,
|
hasOverflow: _hasOverflow,
|
||||||
padding: _padding,
|
padding: _padding,
|
||||||
paddingAbsolute: _paddingAbsolute,
|
paddingAbsolute: _paddingAbsolute,
|
||||||
|
directionRTL: _directionIsRTL,
|
||||||
destroyed,
|
destroyed,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import {
|
|||||||
addClass,
|
addClass,
|
||||||
appendChildren,
|
appendChildren,
|
||||||
createDiv,
|
createDiv,
|
||||||
|
directionIsRTL,
|
||||||
each,
|
each,
|
||||||
isBoolean,
|
isBoolean,
|
||||||
isEmptyArray,
|
isEmptyArray,
|
||||||
@@ -138,7 +139,7 @@ export const createScrollbarsSetupElements = (
|
|||||||
_track,
|
_track,
|
||||||
_scrollOffsetElement,
|
_scrollOffsetElement,
|
||||||
structureSetupState,
|
structureSetupState,
|
||||||
style(_scrollbar, 'direction') === 'rtl',
|
directionIsRTL(_scrollbar),
|
||||||
isHorizontal
|
isHorizontal
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line no-self-compare
|
// eslint-disable-next-line no-self-compare
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
|
directionIsRTL,
|
||||||
getBoundingClientRect,
|
getBoundingClientRect,
|
||||||
offsetSize,
|
offsetSize,
|
||||||
on,
|
on,
|
||||||
preventDefault,
|
preventDefault,
|
||||||
runEachAndClear,
|
runEachAndClear,
|
||||||
stopPropagation,
|
stopPropagation,
|
||||||
style,
|
|
||||||
XY,
|
XY,
|
||||||
} from 'support';
|
} from 'support';
|
||||||
import { classNamesScrollbarInteraction } from 'classnames';
|
import { classNamesScrollbarInteraction } from 'classnames';
|
||||||
@@ -25,7 +25,7 @@ export type ScrollbarsSetupEvents = (
|
|||||||
isHorizontal?: boolean
|
isHorizontal?: boolean
|
||||||
) => () => void;
|
) => () => void;
|
||||||
|
|
||||||
const { round, abs } = Math;
|
const { round } = Math;
|
||||||
const getPageOffset = (event: PointerEvent): XY<number> => ({
|
const getPageOffset = (event: PointerEvent): XY<number> => ({
|
||||||
x: event.pageX,
|
x: event.pageX,
|
||||||
y: event.pageY,
|
y: event.pageY,
|
||||||
@@ -81,12 +81,11 @@ const createDragScrollingEvents = (
|
|||||||
const handleTrackDiff = offsetSize(_track)[whKey] - offsetSize(_handle)[whKey];
|
const handleTrackDiff = offsetSize(_track)[whKey] - offsetSize(_handle)[whKey];
|
||||||
const scrollDeltaPercent = movement / handleTrackDiff;
|
const scrollDeltaPercent = movement / handleTrackDiff;
|
||||||
const scrollDelta = scrollDeltaPercent * _overflowAmount[xyKey];
|
const scrollDelta = scrollDeltaPercent * _overflowAmount[xyKey];
|
||||||
const isRTL = style(_scrollbar, 'direction') === 'rtl';
|
const isRTL = directionIsRTL(_scrollbar);
|
||||||
const negateMultiplactor =
|
const negateMultiplactor =
|
||||||
isRTL && isHorizontal ? (_rtlScrollBehavior.n || _rtlScrollBehavior.i ? 1 : -1) : 1;
|
isRTL && isHorizontal ? (_rtlScrollBehavior.n || _rtlScrollBehavior.i ? 1 : -1) : 1;
|
||||||
|
|
||||||
scrollOffsetElement[scrollOffsetKey] =
|
scrollOffsetElement[scrollOffsetKey] = mouseDownScroll + scrollDelta * negateMultiplactor;
|
||||||
abs(mouseDownScroll) + scrollDelta * negateMultiplactor;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return on(_handle, 'pointerdown', (pointerDownEvent: PointerEvent) => {
|
return on(_handle, 'pointerdown', (pointerDownEvent: PointerEvent) => {
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ export const createStructureSetupObservers = (
|
|||||||
_heightIntrinsicChanged: heightIntrinsicChanged,
|
_heightIntrinsicChanged: heightIntrinsicChanged,
|
||||||
};
|
};
|
||||||
setState({ _heightIntrinsic: heightIntrinsic });
|
setState({ _heightIntrinsic: heightIntrinsic });
|
||||||
|
|
||||||
!fromRecords && structureSetupUpdate(updateHints);
|
!fromRecords && structureSetupUpdate(updateHints);
|
||||||
return updateHints;
|
return updateHints;
|
||||||
};
|
};
|
||||||
@@ -175,6 +176,7 @@ export const createStructureSetupObservers = (
|
|||||||
if (_directionIsRTLCache) {
|
if (_directionIsRTLCache) {
|
||||||
const [directionIsRTL, directionIsRTLChanged] = _directionIsRTLCache;
|
const [directionIsRTL, directionIsRTLChanged] = _directionIsRTLCache;
|
||||||
directionChanged = directionIsRTLChanged;
|
directionChanged = directionIsRTLChanged;
|
||||||
|
|
||||||
setState({ _directionIsRTL: directionIsRTL });
|
setState({ _directionIsRTL: directionIsRTL });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,9 @@ export const show = (elm: HTMLElement | false | null | undefined): void => {
|
|||||||
style(elm, { display: 'block' });
|
style(elm, { display: 'block' });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const directionIsRTL = (elm: HTMLElement | false | null | undefined): boolean =>
|
||||||
|
style(elm, 'direction') === 'rtl';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the top right bottom left values of the passed css property.
|
* Returns the top right bottom left values of the passed css property.
|
||||||
* @param elm The element of which the values shall be returned.
|
* @param elm The element of which the values shall be returned.
|
||||||
|
|||||||
+24
-33
@@ -58,7 +58,7 @@ interface Options {
|
|||||||
autoHideDelay: number;
|
autoHideDelay: number;
|
||||||
dragScroll: boolean;
|
dragScroll: boolean;
|
||||||
clickScroll: boolean;
|
clickScroll: boolean;
|
||||||
touch: boolean;
|
pointers: string[] | null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
type PluginInstance = Record<string, unknown> | ((staticObj: OverlayScrollbarsStatic, instanceObj: OverlayScrollbars) => void);
|
type PluginInstance = Record<string, unknown> | ((staticObj: OverlayScrollbarsStatic, instanceObj: OverlayScrollbars) => void);
|
||||||
@@ -72,32 +72,29 @@ type SizeObserverPluginInstance = {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
declare const sizeObserverPlugin: Plugin<SizeObserverPluginInstance>;
|
declare const sizeObserverPlugin: Plugin<SizeObserverPluginInstance>;
|
||||||
type StaticInitialization = HTMLElement | null | undefined;
|
type StaticInitialization = HTMLElement | false | null;
|
||||||
type DynamicInitialization = HTMLElement | boolean | null | undefined;
|
type DynamicInitialization = HTMLElement | boolean | null;
|
||||||
type CancelInitialization = {
|
type InitializationTargetElement = HTMLElement | HTMLTextAreaElement;
|
||||||
|
type Initialization = Omit<StructureInitialization, "target"> & ScrollbarsInitialization & {
|
||||||
cancel: {
|
cancel: {
|
||||||
nativeScrollbarsOverlaid: boolean | undefined;
|
nativeScrollbarsOverlaid: boolean;
|
||||||
body: boolean | null | undefined;
|
body: boolean | null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
type InitializationTargetElement = HTMLElement | HTMLTextAreaElement;
|
type InitializationTargetObject = DeepPartial<Initialization> & Pick<StructureInitialization, "target">;
|
||||||
type InitializationTargetObject = StructureInitialization & ScrollbarsInitialization & DeepPartial<CancelInitialization>;
|
|
||||||
type InitializationTarget = InitializationTargetElement | InitializationTargetObject;
|
type InitializationTarget = InitializationTargetElement | InitializationTargetObject;
|
||||||
type DefaultInitialization = DefaultStructureInitialization & DefaultScrollbarsInitialization & CancelInitialization;
|
|
||||||
/**
|
/**
|
||||||
* Static elements MUST be present.
|
* Static elements MUST be present.
|
||||||
* Null or undefined behave like if this element wasn't specified during initialization.
|
* With false, null or undefined the element will be generated, otherwise the specified element is taken.
|
||||||
*/
|
*/
|
||||||
type StaticInitializationElement<Args extends any[]> = ((...args: Args) => StaticInitialization) | StaticInitialization;
|
type StaticInitializationElement<Args extends any[]> = ((...args: Args) => StaticInitialization) | StaticInitialization;
|
||||||
/**
|
/**
|
||||||
* Dynamic element CAN be present.
|
* Dynamic element CAN be present.
|
||||||
* If its a element the element will be handled as the repsective element.
|
* If its a element the element will be taken as the repsective element.
|
||||||
* True means that the respective dynamic element is forced to be generated.
|
* With true the element will be generated.
|
||||||
* False means that the respective dynamic element is forced NOT to be generated.
|
* With false, null or undefined the element won't be generated.
|
||||||
* Null or undefined behave like if this element wasn't specified during initialization.
|
|
||||||
*/
|
*/
|
||||||
type DynamicInitializationElement<Args extends any[]> = ((...args: Args) => DynamicInitialization) | DynamicInitialization;
|
type DynamicInitializationElement<Args extends any[]> = ((...args: Args) => DynamicInitialization) | DynamicInitialization;
|
||||||
type DefaultInitializtationElement<InitElm> = Exclude<InitElm, HTMLElement>;
|
|
||||||
type ScrollbarsDynamicInitializationElement = DynamicInitializationElement<[
|
type ScrollbarsDynamicInitializationElement = DynamicInitializationElement<[
|
||||||
target: InitializationTargetElement,
|
target: InitializationTargetElement,
|
||||||
host: HTMLElement,
|
host: HTMLElement,
|
||||||
@@ -112,11 +109,8 @@ type ScrollbarsDynamicInitializationElement = DynamicInitializationElement<[
|
|||||||
* Null or Undefined means that the environment initialization strategy is used.
|
* Null or Undefined means that the environment initialization strategy is used.
|
||||||
*/
|
*/
|
||||||
interface ScrollbarsInitialization {
|
interface ScrollbarsInitialization {
|
||||||
scrollbarsSlot?: ScrollbarsDynamicInitializationElement;
|
scrollbarsSlot: ScrollbarsDynamicInitializationElement;
|
||||||
}
|
}
|
||||||
type DefaultScrollbarsInitialization = {
|
|
||||||
[K in keyof ScrollbarsInitialization]: DefaultInitializtationElement<ScrollbarsInitialization[K]>;
|
|
||||||
};
|
|
||||||
interface StructureSetupState {
|
interface StructureSetupState {
|
||||||
_padding: TRBL;
|
_padding: TRBL;
|
||||||
_paddingAbsolute: boolean;
|
_paddingAbsolute: boolean;
|
||||||
@@ -146,14 +140,11 @@ type StructureDynamicInitializationElement = DynamicInitializationElement<[
|
|||||||
*/
|
*/
|
||||||
interface StructureInitialization {
|
interface StructureInitialization {
|
||||||
target: InitializationTargetElement;
|
target: InitializationTargetElement;
|
||||||
host?: StructureStaticInitializationElement; // only relevant for textarea
|
host: StructureStaticInitializationElement; // only relevant for textarea
|
||||||
viewport?: StructureStaticInitializationElement;
|
viewport: StructureStaticInitializationElement;
|
||||||
padding?: StructureDynamicInitializationElement;
|
padding: StructureDynamicInitializationElement;
|
||||||
content?: StructureDynamicInitializationElement;
|
content: StructureDynamicInitializationElement;
|
||||||
}
|
}
|
||||||
type DefaultStructureInitialization = {
|
|
||||||
[K in keyof Omit<StructureInitialization, "target">]: DefaultInitializtationElement<StructureInitialization[K]>;
|
|
||||||
};
|
|
||||||
interface ViewportOverflowState {
|
interface ViewportOverflowState {
|
||||||
_scrollbarsHideOffset: XY<number>;
|
_scrollbarsHideOffset: XY<number>;
|
||||||
_scrollbarsHideOffsetArrange: XY<boolean>;
|
_scrollbarsHideOffsetArrange: XY<boolean>;
|
||||||
@@ -176,11 +167,11 @@ interface InternalEnvironment {
|
|||||||
};
|
};
|
||||||
readonly _flexboxGlue: boolean;
|
readonly _flexboxGlue: boolean;
|
||||||
readonly _cssCustomProperties: boolean;
|
readonly _cssCustomProperties: boolean;
|
||||||
readonly _staticDefaultInitialization: DefaultInitialization;
|
readonly _staticDefaultInitialization: Initialization;
|
||||||
readonly _staticDefaultOptions: Options;
|
readonly _staticDefaultOptions: Options;
|
||||||
_addListener(listener: EventListener<EnvironmentEventMap, "_">): () => void;
|
_addListener(listener: EventListener<EnvironmentEventMap, "_">): () => void;
|
||||||
_getDefaultInitialization(): DefaultInitialization;
|
_getDefaultInitialization(): Initialization;
|
||||||
_setDefaultInitialization(newInitialization: DeepPartial<DefaultInitialization>): void;
|
_setDefaultInitialization(newInitialization: DeepPartial<Initialization>): void;
|
||||||
_getDefaultOptions(): Options;
|
_getDefaultOptions(): Options;
|
||||||
_setDefaultOptions(newDefaultOptions: DeepPartial<Options>): void;
|
_setDefaultOptions(newDefaultOptions: DeepPartial<Options>): void;
|
||||||
}
|
}
|
||||||
@@ -202,7 +193,7 @@ declare const scrollbarsHidingPlugin: Plugin<ScrollbarsHidingPluginInstance>;
|
|||||||
type GeneralInitialEventListeners = InitialEventListeners;
|
type GeneralInitialEventListeners = InitialEventListeners;
|
||||||
type GeneralEventListener = EventListener;
|
type GeneralEventListener = EventListener;
|
||||||
interface OverlayScrollbarsStatic {
|
interface OverlayScrollbarsStatic {
|
||||||
(target: InitializationTarget | InitializationTargetObject, options?: DeepPartial<Options>, eventListeners?: GeneralInitialEventListeners<EventListenerMap>): OverlayScrollbars;
|
(target: InitializationTarget, options?: DeepPartial<Options>, eventListeners?: GeneralInitialEventListeners<EventListenerMap>): OverlayScrollbars;
|
||||||
plugin(plugin: Plugin | Plugin[]): void;
|
plugin(plugin: Plugin | Plugin[]): void;
|
||||||
env(): Environment;
|
env(): Environment;
|
||||||
}
|
}
|
||||||
@@ -216,10 +207,10 @@ interface Environment {
|
|||||||
};
|
};
|
||||||
flexboxGlue: boolean;
|
flexboxGlue: boolean;
|
||||||
cssCustomProperties: boolean;
|
cssCustomProperties: boolean;
|
||||||
staticDefaultInitialization: DefaultInitialization;
|
staticDefaultInitialization: Initialization;
|
||||||
staticDefaultOptions: Options;
|
staticDefaultOptions: Options;
|
||||||
getDefaultInitialization(): DefaultInitialization;
|
getDefaultInitialization(): Initialization;
|
||||||
setDefaultInitialization(newDefaultInitialization: DeepPartial<DefaultInitialization>): void;
|
setDefaultInitialization(newDefaultInitialization: DeepPartial<Initialization>): void;
|
||||||
getDefaultOptions(): Options;
|
getDefaultOptions(): Options;
|
||||||
setDefaultOptions(newDefaultOptions: DeepPartial<Options>): void;
|
setDefaultOptions(newDefaultOptions: DeepPartial<Options>): void;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user