@egjs/grid
Advanced tools
Comparing version 1.10.0-beta.0 to 1.10.0-beta.1
import Component from "@egjs/component"; | ||
import { DestroyOptions, SizeRect } from "./types"; | ||
import { OnResizeWatcherResize } from "./ResizeWatcher"; | ||
export interface ContainerManagerOptions { | ||
@@ -9,2 +10,3 @@ horizontal?: boolean; | ||
useResizeObserver?: boolean; | ||
useObserveChildren?: boolean; | ||
} | ||
@@ -15,3 +17,3 @@ export interface ContainerManagerStatus { | ||
export interface ContainerManagerEvents { | ||
resize: void; | ||
resize: OnResizeWatcherResize; | ||
} | ||
@@ -26,2 +28,4 @@ export declare class ContainerManager extends Component<ContainerManagerEvents> { | ||
getRect(): SizeRect; | ||
observeChildren(children: Element[]): void; | ||
unobserveChildren(children: Element[]): void; | ||
setRect(rect: SizeRect): void; | ||
@@ -28,0 +32,0 @@ getInlineSize(): number; |
@@ -13,3 +13,3 @@ import Grid from "./Grid"; | ||
export * from "./consts"; | ||
export { GetterSetter, withGridMethods, withMethods, } from "./utils"; | ||
export { GetterSetter, withGridMethods, withMethods, getMountedElements, getUpdatedItems, } from "./utils"; | ||
export default Grid; |
@@ -9,3 +9,15 @@ import { SizeRect } from "./types"; | ||
rectBox?: "border-box" | "content-box"; | ||
childrenRectBox?: "border-box" | "content-box"; | ||
} | ||
export interface OnResizeWatcherResize { | ||
isResizeContainer: boolean; | ||
childEntries: ResizeWatcherEntry[]; | ||
} | ||
export interface ResizeWatcherEntry { | ||
target: Element; | ||
size?: { | ||
inlineSize: number; | ||
blockSize: number; | ||
}; | ||
} | ||
export declare class ResizeWatcher { | ||
@@ -19,2 +31,3 @@ private _resizeTimer; | ||
private _options; | ||
private _updatedEntries; | ||
constructor(container: HTMLElement | string, options?: ResizeWatherOptions); | ||
@@ -24,7 +37,11 @@ getRect(): SizeRect; | ||
resize(): void; | ||
listen(callback: () => void): this; | ||
observeChildren(children: Element[]): void; | ||
unobserveChildren(children: Element[]): void; | ||
listen(callback: (e: OnResizeWatcherResize) => void): this; | ||
destroy(): void; | ||
private _init; | ||
private _onWindowResize; | ||
private _onObserve; | ||
private _scheduleResize; | ||
private _onResize; | ||
private _scheduleResize; | ||
} |
@@ -25,2 +25,3 @@ import { GRID_METHODS } from "./consts"; | ||
useResizeObserver?: boolean; | ||
useObserveChildren?: boolean; | ||
externalItemRenderer?: ItemRenderer | null; | ||
@@ -27,0 +28,0 @@ externalContainerManager?: ContainerManager | null; |
import Grid from "./Grid"; | ||
import { GRID_PROPERTY_TYPES } from "./consts"; | ||
import { GridItem } from "./GridItem"; | ||
import { ResizeWatcherEntry } from "./ResizeWatcher"; | ||
export declare function getKeys<T extends Record<string, any>>(obj: T): Array<keyof T>; | ||
export declare function getUpdatedItems(items: GridItem[], entries: ResizeWatcherEntry[]): GridItem[]; | ||
export declare function getMountedItems(items: GridItem[]): GridItem[]; | ||
export declare function getMountedElements(items: GridItem[]): HTMLElement[]; | ||
export declare function isString(val: any): val is string; | ||
@@ -5,0 +10,0 @@ export declare function isObject(val: any): val is object; |
{ | ||
"name": "@egjs/grid", | ||
"version": "1.10.0-beta.0", | ||
"version": "1.10.0-beta.1", | ||
"description": "A component that can arrange items according to the type of grids", | ||
@@ -5,0 +5,0 @@ "main": "dist/grid.cjs.js", |
@@ -23,3 +23,5 @@ /** | ||
withMethods, | ||
getMountedElements, | ||
getUpdatedItems, | ||
} from "./utils"; | ||
export default Grid; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1422712
51
15466