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://docs.amcharts.com/v5/concepts/common-elements/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://docs.amcharts.com/v5/concepts/common-elements/containers/#layout} for more info */ layout?: Layout | null; /** * An element whose shape clips the container's children. * * @see {@link https://docs.amcharts.com/v5/concepts/common-elements/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://docs.amcharts.com/v5/concepts/common-elements/containers/} 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://docs.amcharts.com/v5/concepts/common-elements/containers/#scrollbar} for more info */ verticalScrollbar?: Scrollbar; /** * Lays out the children in reverse order. * * @since 5.1.1 */ reverseChildren?: boolean; /** * With `"rtl"`, a horizontal or grid layout places the children from right * to left, as a mirror image of `"ltr"`: a child's `marginLeft` ends up on * its right. Rows of a grid still go from top to bottom. A vertical layout * lines up children with no `x` of their own on the right. For right-to-left * languages, e.g. on a legend: * `am5.Legend.new(root, { direction: "rtl" })`. * * A container with a width of its own starts at its right edge; one sized * by its content keeps its size. * * Not set, a legend follows the root element's `direction`, and a legend's * items follow their legend; other containers are left to right. * * @since 5.22.0 */ direction?: "ltr" | "rtl"; /** * HTML content of the container. It can hold data placeholders, such as * `{category}`. * * @see {@link https://docs.amcharts.com/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://docs.amcharts.com/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; protected _scrollbarRestore: { maskContent?: boolean; paddingRight?: number; } | 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; /** * Whether a horizontal or grid layout places the children from the right: * the container's own `direction`, else the root's for a legend, and the * legend's for its items. * * @ignore */ _isRtl(): boolean; _updateBounds(): void; /** * @ignore */ markDirty(): void; /** * Lays the children out again. Unlike `markDirty()`, it leaves the * container's layer alone: whatever moves marks its own. * * @ignore */ _markDirtyLayout(): 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; /** * @ignore */ _nameForExport(parentName?: string): string | undefined; _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