UNPKG

2.2 kBPlain TextView Raw
1import { JustifiedGrid, JustifiedGridOptions } from "@egjs/grid";
2import InfiniteGrid from "../InfiniteGrid";
3import { InfiniteGridOptions } from "../types";
4import { InfiniteGridGetterSetter } from "../utils";
5
6/**
7 * @typedef
8 * @extends InfiniteGridOptions
9 * @extends Grid.JustifiedGrid.JustifiedGridOptions
10 */
11export interface JustifiedInfiniteGridOptions extends JustifiedGridOptions, InfiniteGridOptions {
12}
13
14/**
15 * 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedInfiniteGrid is a grid that the item is filled up on the basis of a line given a size.
16 * If 'data-grid-inline-offset' or 'data-grid-content-offset' are set for item element, the ratio is maintained except for the offset value.
17 * If 'data-grid-maintained-target' is set for an element whose ratio is to be maintained, the item is rendered while maintaining the ratio of the element.
18 * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. JustifiedInfiniteGrid는 용어의 의미대로 너비가 주어진 사이즈를 기준으로 아이템가 가득 차도록 배치하는 Grid다.
19 * 아이템 엘리먼트에 'data-grid-inline-offset' 또는 'data-grid-content-offset'를 설정하면 offset 값을 제외하고 비율을 유지한다.
20 * 비율을 유지하고 싶은 엘리먼트에 'data-grid-maintained-target'을 설정한다면 해당 엘리먼트의 비율을 유지하면서 아이템이 렌더링이 된다.
21 * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>
22 * @param {JustifiedInfiniteGridOptions} options - The option object of the JustifiedInfiniteGrid module <ko>JustifiedInfiniteGrid 모듈의 옵션 객체</ko>
23 */
24@InfiniteGridGetterSetter
25export class JustifiedInfiniteGrid extends InfiniteGrid<JustifiedInfiniteGridOptions> {
26 public static propertyTypes = {
27 ...InfiniteGrid.propertyTypes,
28 ...JustifiedGrid.propertyTypes,
29 };
30 public static defaultOptions: Required<JustifiedInfiniteGridOptions> = {
31 ...InfiniteGrid.defaultOptions,
32 ...JustifiedGrid.defaultOptions,
33 gridConstructor: JustifiedGrid,
34 } as const;
35}