-
Notifications
You must be signed in to change notification settings - Fork 208
/
StandardContentLayouts.ts
115 lines (105 loc) · 4.33 KB
/
StandardContentLayouts.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module ContentView
*/
import { ContentLayoutProps } from "./ContentLayoutProps";
/**
* Class that define Standard Content Layouts that can be used to specify how the content is arranged in a frontstage.
* @public
*/
export class StandardContentLayouts {
public static readonly singleView: ContentLayoutProps = {
id: "uia:singleView",
description: "Single Content View",
};
public static readonly fourQuadrants: ContentLayoutProps = {
id: "uia:fourQuadrants",
description: "Four Views, two stacked on the left, two stacked on the right",
verticalSplit: {
id: "uia:fourQuadrantVerticalSplit",
percentage: 0.50,
lock: false,
minSizeLeft: 100,
minSizeRight: 100,
left: { horizontalSplit: { id: "uia:fourQuadrantsLeftHorizontal", percentage: 0.50, top: 0, bottom: 1, lock: false, minSizeTop: 50, minSizeBottom: 50 } },
right: { horizontalSplit: { id: "uia:fourQuadrantsRightHorizontal", percentage: 0.50, top: 2, bottom: 3, lock: false, minSizeTop: 50, minSizeBottom: 50 } },
},
};
public static readonly twoVerticalSplit: ContentLayoutProps = {
id: "uia:twoVerticalSplit",
description: "Two Views, side by side",
verticalSplit: {
id: "uia:twoViewsVerticalSplit",
percentage: 0.50,
left: 0,
right: 1,
},
};
public static readonly twoHorizontalSplit: ContentLayoutProps = {
id: "uia:twoHorizontalSplit",
description: "Two views, stack one on top of the other",
horizontalSplit: {
id: "uia:twoViewsHorizontalSplit",
percentage: 0.50,
lock: false,
top: 0,
bottom: 1,
},
};
public static readonly threeViewsTwoOnLeft: ContentLayoutProps = {
id: "uia:threeViewsTwoOnLeft",
description: "Three views, one on the right with the two on the left stacked one of top of the other",
verticalSplit: {
id: "uia:twoViewsOnLeftSplit",
percentage: 0.50,
left: { horizontalSplit: { id: "uia:twoViewsOnLeftHorizontal", percentage: 0.50, top: 0, bottom: 1, lock: false, minSizeTop: 50, minSizeBottom: 50 } },
right: 2,
},
};
public static readonly threeViewsTwoOnRight: ContentLayoutProps = {
id: "uia:threeViewsTwoOnRight",
description: "Three views, one on the left with the two on the right stacked one of top of the other",
verticalSplit: {
id: "uia:twoViewsOnRightSplit",
percentage: 0.50,
left: 0,
right: { horizontalSplit: { id: "uia:twoViewsOnRightHorizontal", percentage: 0.50, top: 1, bottom: 2, lock: false, minSizeTop: 50, minSizeBottom: 50 } },
},
};
public static readonly threeViewsTwoOnBottom: ContentLayoutProps = {
id: "uia:threeViewsTwoOnBottom",
description: "Three Views, one on top and two side by side on the bottom",
horizontalSplit: {
id: "uia:threeViewsTwoOnBottomHorizontal",
percentage: 0.50,
lock: false,
top: 0,
bottom: { verticalSplit: { id: "uia:twoViewsOnBottomVertical", percentage: 0.50, left: 1, right: 2, lock: false, minSizeLeft: 50, minSizeRight: 50 } },
},
};
public static readonly threeViewsTwoOnTop: ContentLayoutProps = {
id: "uia:threeViewsTwoOnTop",
description: "Three Views, two side by side on top and one on the bottom",
horizontalSplit: {
id: "uia:twoViewsOnTopHorizontal",
percentage: 0.50,
lock: false,
top: { verticalSplit: { id: "uia:twoViewsOnTopVertical", percentage: 0.50, left: 0, right: 1, lock: false, minSizeLeft: 50, minSizeRight: 50 } },
bottom: 2,
},
};
// provides and iterable list of standard content layouts
public static readonly availableLayouts: ContentLayoutProps[] = [
StandardContentLayouts.singleView,
StandardContentLayouts.fourQuadrants,
StandardContentLayouts.twoVerticalSplit,
StandardContentLayouts.twoHorizontalSplit,
StandardContentLayouts.threeViewsTwoOnLeft,
StandardContentLayouts.threeViewsTwoOnRight,
StandardContentLayouts.threeViewsTwoOnBottom,
StandardContentLayouts.threeViewsTwoOnTop,
];
}