UNPKG

3.75 kBSource Map (JSON)View Raw
1{"version":3,"file":"ScrollablePane.types.js","sourceRoot":"../src/","sources":["components/ScrollablePane/ScrollablePane.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgG/B;;GAEG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAgB;IACtB,MAAM,EAAE,QAAoB;CAC7B,CAAC;AAoBF,MAAM,CAAC,IAAM,qBAAqB,GAAG,KAAK,CAAC,aAAa,CAAyB,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { IRefObject, IStyleFunctionOrObject } from '../../Utilities';\nimport { IStyle, ITheme } from '../../Styling';\nimport { ScrollablePaneBase } from './ScrollablePane.base';\nimport { Sticky } from '../Sticky/Sticky';\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport interface IScrollablePane {\n /** Triggers a layout update for the pane. */\n forceLayoutUpdate(): void;\n /** Gets the current scroll position of the scrollable pane */\n getScrollPosition(): number;\n}\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport interface IScrollablePaneProps extends React.HTMLAttributes<HTMLElement | ScrollablePaneBase> {\n // export interface IScrollablePaneProps extends React.Props<ScrollablePaneBase> {\n /**\n * Optional callback to access the IScrollablePane interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IScrollablePane>;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules\n */\n styles?: IStyleFunctionOrObject<IScrollablePaneStyleProps, IScrollablePaneStyles>;\n\n /**\n * Theme provided by HOC.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the ScrollablePane\n * @defaultvalue undefined\n */\n className?: string;\n\n /**\n * Sets the initial scroll position of the ScrollablePane\n */\n initialScrollPosition?: number;\n\n scrollbarVisibility?: ScrollbarVisibility;\n}\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport interface IScrollablePaneStyleProps {\n /**\n * Accept theme prop.\n */\n theme: ITheme;\n\n /**\n * Accept custom classNames\n */\n className?: string;\n\n scrollbarVisibility?: IScrollablePaneProps['scrollbarVisibility'];\n\n // Insert ScrollablePane style props below\n}\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport interface IScrollablePaneStyles {\n /**\n * Style set for the root element.\n */\n root: IStyle;\n /**\n * Style set for the stickyAbove element.\n */\n stickyAbove: IStyle;\n /**\n * Style set for the stickyBelow element.\n */\n stickyBelow: IStyle;\n /**\n * Style set for the stickyBelowItems element.\n */\n stickyBelowItems: IStyle;\n /**\n * Style set for the contentContainer element.\n */\n contentContainer: IStyle;\n}\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport const ScrollbarVisibility = {\n auto: 'auto' as 'auto',\n always: 'always' as 'always',\n};\n\n/**\n * {@docCategory ScrollablePane}\n */\nexport type ScrollbarVisibility = typeof ScrollbarVisibility[keyof typeof ScrollbarVisibility];\n\nexport interface IScrollablePaneContext {\n scrollablePane?: {\n subscribe: (handler: (container: HTMLElement, stickyContainer: HTMLElement) => void) => void;\n unsubscribe: (handler: (container: HTMLElement, stickyContainer: HTMLElement) => void) => void;\n addSticky: (sticky: Sticky) => void;\n removeSticky: (sticky: Sticky) => void;\n updateStickyRefHeights: () => void;\n sortSticky: (sticky: Sticky, sortAgain?: boolean) => void;\n notifySubscribers: (sort?: boolean) => void;\n syncScrollSticky: (sticky: Sticky) => void;\n };\n}\n\nexport const ScrollablePaneContext = React.createContext<IScrollablePaneContext>({ scrollablePane: undefined });\n"]}
\No newline at end of file