• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

naver / egjs-infinitegrid / 3869242514

pending completion
3869242514

Pull #527

github

GitHub
Merge 42f03d580 into 6db0bffc8
Pull Request #527: feat: upgrade to Angular 15 and enable partial compilation

523 of 649 branches covered (80.59%)

Branch coverage included in aggregate %.

1349 of 1446 relevant lines covered (93.29%)

114.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.64
/packages/infinitegrid/src/InfiniteGridItem.ts
1
import { GridItem, GridItemStatus, MOUNT_STATE } from "@egjs/grid";
1✔
2
import { INVISIBLE_POS, ITEM_TYPE } from "./consts";
1✔
3
import { InfiniteGridItemInfo } from "./types";
4

5

6
export interface InfiniteGridItemStatus extends GridItemStatus {
7
  type?: ITEM_TYPE;
8
  groupKey?: string | number;
9
  key?: string | number;
10
  html?: string;
11
}
12

13
/**
14
 * @extends Grid.GridItem
15
 */
16
export class InfiniteGridItem extends GridItem implements Required<InfiniteGridItemInfo> {
1✔
17
  public groupKey: string | number;
18
  public readonly html: string;
19
  constructor(horizontal: boolean, itemStatus?: Partial<InfiniteGridItemStatus>) {
822✔
20
    super(horizontal, {
1,642✔
21
      html: "",
22
      type: ITEM_TYPE.NORMAL,
23
      cssRect: { top: INVISIBLE_POS, left: INVISIBLE_POS },
24
      ...itemStatus,
25
    } as GridItemStatus);
26

27
    if (this.type === ITEM_TYPE.VIRTUAL) {
821✔
28
      if (this.rect.width || this.rect.height) {
79✔
29
        this.mountState = MOUNT_STATE.UNMOUNTED;
60✔
30
      }
31
      const orgRect = this.orgRect;
79✔
32
      const rect = this.rect;
79✔
33
      const cssRect = this.cssRect;
79✔
34

35
      if (cssRect.width) {
79✔
36
        rect.width = cssRect.width;
60✔
37
      } else if (orgRect.width) {
19!
38
        rect.width = orgRect.width;
×
39
      }
40
      if (cssRect.height) {
79✔
41
        rect.height = cssRect.height;
60✔
42
      } else if (orgRect.height) {
19!
43
        rect.height = orgRect.height;
×
44
      }
45
    }
46
  }
47
  public getVirtualStatus(): Partial<InfiniteGridItemStatus> {
1✔
48
    return {
68✔
49
      type: ITEM_TYPE.VIRTUAL,
50
      groupKey: this.groupKey,
51
      key: this.key,
52
      orgRect: this.orgRect,
53
      rect: this.rect,
54
      cssRect: this.cssRect,
55
      attributes: this.attributes,
56
    };
57
  }
58
  public getMinimizedStatus(): Partial<InfiniteGridItemStatus> {
1✔
59
    const status: Partial<InfiniteGridItemStatus> = {
147✔
60
      ...super.getMinimizedStatus(),
61
      type: ITEM_TYPE.NORMAL,
62
      groupKey: this.groupKey,
63
    };
64
    if (this.html) {
147!
65
      status.html = this.html;
147✔
66
    }
67
    return status;
147✔
68
  }
69
}
1✔
70

71
export interface InfiniteGridItem extends Required<InfiniteGridItemStatus> {}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc