import type { Graphics } from "./Graphics"; import type { Layout } from "./Layout"; import type { IContainer } from "./backend/Renderer"; import type { Scrollbar } from "./Scrollbar"; import type { DataItem, IComponentDataItem } from "./Component"; import { Children } from "../util/Children"; import { Sprite, ISpriteSettings, ISpritePrivate, ISpriteEvents } from "./Sprite"; import { Rectangle } from "./Rectangle"; import type { IDisposer } from "../util/Disposer"; export interface IContainerSettings extends ISpriteSettings { /** * Left padding in pixels. */ paddingLeft?: number; /** * Right padding in pixels. */ paddingRight?: number; /** * Top padding in pixels. */ paddingTop?: number; /** * Bottom padding in pixels. */ paddingBottom?: number; /** * Element drawn behind the container's content, sized to fill the * container. * * @see {@link https://www.amcharts.com/docs/v5/concepts/containers/#Background} for more info */ background?: Graphics; /** * How children are arranged, e.g. `root.horizontalLayout`, * `root.verticalLayout` or `root.gridLayout`. Without a layout, children * are placed by their own `x` and `y`. * * @see {@link https://www.amcharts.com/docs/v5/concepts/containers/#Layout} for more info */ layout?: Layout | null; /** * An element whose shape clips the container's children. * * @see {@link https://www.amcharts.com/docs/v5/concepts/containers/#Masks} for more info */ mask?: Graphics | null; /** * Clips all content that goes outside the container's bounds. */ maskContent?: boolean; /** * Makes every descendant, not just direct children, interactive when the * container itself is interactive. * * @default true */ interactiveChildren?: boolean; /** * Applies every state set on the container to its children too. * * @see {@link https://www.amcharts.com/docs/v5/concepts/containers/#States} for more info * * @default false */ setStateOnChildren?: boolean; /** * A [[Scrollbar]] that scrolls the content vertically when it does not fit * in the container. * * @see {@link https://www.amcharts.com/docs/v5/concepts/containers/#Scrollbar} for more info */ verticalScrollbar?: Scrollbar; /** * Lays out the children in reverse order. * * @since 5.1.1 */ reverseChildren?: boolean; /** * HTML content of the container. It can hold data placeholders, such as * `{category}`. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/html-content/} for more info * @since 5.2.11 */ html?: string; } export interface IContainerEvents extends ISpriteEvents { } export interface IContainerPrivate extends ISpritePrivate { /** * The `
` element that holds the container's `html` content. */ htmlElement?: HTMLDivElement; /** * A wrapper `
` for `htmlElement`. * * @since 5.11.2 */ htmlElementWrapper?: HTMLDivElement; /** * @ignore */ wrapperContainer?: Container; } /** * An element that holds child elements, arranges them with a layout, and can * have a background. * * Its children can be any [[Sprite]], from basic shapes to whole charts. * * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/containers/} for more info * @important */ export declare class Container extends Sprite { _settings: IContainerSettings; _privateSettings: IContainerPrivate; _events: IContainerEvents; _display: IContainer; _childrenDisplay: IContainer; /** * The container's child elements. */ children: Children; _percentageSizeChildren: Array; _percentagePositionChildren: Array; static className: string; static classNames: Array; _prevWidth: number; _prevHeight: number; protected _contentWidth: number; protected _contentHeight: number; protected _contentMask: Rectangle | undefined; protected _vsbd0: IDisposer | undefined; protected _vsbd1: IDisposer | undefined; protected _hsbd0: IDisposer | undefined; protected _hsbd1: IDisposer | undefined; _childrenPrep: boolean; _childrenUpdt: boolean; protected _afterNew(): void; /** * Returns the sub-element held in `key`, creating it with `f` if there is * none, and merging `themeTags` into whichever element ends up there. * * The tags describe the role the element plays within this class, so an * element passed in by a user (or by a parsed config) needs them just as * much as a default one - without them the theme rules keyed on those tags * never match and the element renders unstyled. * * @ignore */ _setDefaultTagged(key: Key, themeTags: Array, f: () => Value): NonNullable | Value; _afterChanged(): void; protected _dispose(): void; _beforeChanged(): void; _changed(): void; _updateSize(): void; protected updateBackground(): void; _applyThemes(force?: boolean): boolean; _applyState(name: string): void; _applyStateAnimated(name: string, duration?: number): void; /** * Returns the container's width without padding, in pixels. * * @return Inner width (px) */ innerWidth(): number; /** * Returns the container's height without padding, in pixels. * * @return Inner height (px) */ innerHeight(): number; _getBounds(): void; _updateBounds(): void; /** * @ignore */ markDirty(): void; _prepareChildren(): void; _updateHTMLContent(): void; /** * Scrolls the container so that the child comes into view, if it is out of * view. Works only on a container with a `verticalScrollbar`. * * @param child Child to scroll to * @since 5.10.5 */ scrollToChild(child: Sprite): void; _updateChildren(): void; _processTemplateField(): void; /** * @ignore */ walkChildren(f: (child: Sprite, index?: number) => void): void; /** * Calls `f` for each child, including the background, vertical scrollbar * and mask. */ eachChildren(f: (child: Sprite) => void): void; /** * Returns all children, including the background, vertical scrollbar and * mask. */ allChildren(): Array; _setDataItem(dataItem?: DataItem): void; contentWidth(): number; contentHeight(): number; } //# sourceMappingURL=Container.d.ts.map