-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathOutlookStyleLayout.razor
251 lines (227 loc) · 11.1 KB
/
OutlookStyleLayout.razor
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
@page "/splitter/outlook"
@using Syncfusion.Blazor
@using Syncfusion.Blazor.Buttons
@using Syncfusion.Blazor.Inputs
@using Syncfusion.Blazor.Lists
@using Syncfusion.Blazor.Layouts
@using Syncfusion.Blazor.Navigations
@using Syncfusion.Blazor.RichTextEditor
@*Hidden:Lines*@
@inherits SampleBaseComponent
@inject NavigationManager NavigationManager
<PageTitle>Blazor Splitter Outlook-style Layout Example - Syncfusion Demos</PageTitle>
<HeadContent>
<meta name="description" content="This example demonstrates the Outlook-style Layout in Blazor Splitter Component. Explore here for more details." />
<link rel="canonical" href="@canonicalURL" />
</HeadContent>
@*End:Hidden*@
<SampleDescription>
<p>This sample demonstrates the Blazor Splitter component that is used to design Outlook-like applications using multiple horizontal panes. You can resize its panes horizontally to increase dimension.</p>
</SampleDescription>
<ActionDescription>
<p>The TreeView component is used to display mail folders on the left pane, ListView to display details of mail items, and RichTextEditor to create new mail.</p>
</ActionDescription>
<div class="col-lg-12 control-section">
<div class="control_wrapper">
<SfSplitter Height="493px" Width="100%" CssClass="outlook-splitter">
<SplitterEvents OnResizeStop="resizeStop"></SplitterEvents>
<SplitterPanes>
<SplitterPane Size="28%" Min="27%">
<ContentTemplate>
<div>
<div class="outlook-layout-content">
<SfTreeView TValue="TreeData">
<TreeViewFieldsSettings TValue="TreeData" Id="Id" Text="Name" ParentID="Pid" HasChildren="HasChild" Selected="Selected" Expanded="Expanded" DataSource="@localData"></TreeViewFieldsSettings>
<TreeViewTemplates TValue="TreeData">
<NodeTemplate>
<div>
<div class="treeviewdiv">
<div style="float:left">
<span class="treeName">@((context as TreeData).Name)</span>
</div>
@{
@if (((context as TreeData).Count) != 0)
{
<div style="margin-right: 5px; float:right">
<span class="treeCount e-badge e-badge-primary">@((context as TreeData).Count)</span>
</div>
}
}
</div>
</div>
</NodeTemplate>
</TreeViewTemplates>
</SfTreeView>
</div>
</div>
</ContentTemplate>
</SplitterPane>
<SplitterPane Size="33%" Min="23%">
<ContentTemplate>
<div>
<div class="outlook-layout-content">
<SfListView DataSource="@dataSource" CssClass="e-list-template">
<ListViewFieldSettings id="Id" TValue="DataModel" Text="Name"></ListViewFieldSettings>
<ListViewTemplates TValue="DataModel">
<Template>
@{
<div class="settings e-list-wrapper e-list-multi-line e-list-avatar">
<span class="e-list-item-header">@context.Name</span>
<div class="e-list-content">
<div class="status">@context.Content1</div><div id="list-message">@context.Content2</div>
</div>
</div>
}
</Template>
</ListViewTemplates>
</SfListView>
</div>
</div>
</ContentTemplate>
</SplitterPane>
<SplitterPane Size="37%" Min="30%">
<ContentTemplate>
<div>
<div class="outlook-layout-content">
<div style="width: 100%; padding: 15px;">
<table>
<tr>
<td><button class="e-btn e-flat e-outline">To...</button></td>
<td><SfTextBox></SfTextBox></td>
</tr>
<tr>
<td><button class="e-btn e-flat e-outline">Cc...</button></td>
<td><SfTextBox></SfTextBox></td>
</tr>
<tr>
<td><div id="subject-text">Subject</div></td>
<td><SfTextBox></SfTextBox></td>
</tr>
</table>
</div>
<div class="forum">
<div id="createpostholder">
<SfRichTextEditor @ref="RichTextEditorObj" Height="262px">
<RichTextEditorEvents Created="Created"></RichTextEditorEvents>
</SfRichTextEditor>
<div id="buttonSection">
<SfButton IsPrimary="true">Send</SfButton>
<SfButton>Discard</SfButton>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</SplitterPane>
</SplitterPanes>
</SfSplitter>
</div>
</div>
@code {
SfRichTextEditor RichTextEditorObj;
//Hidden:Lines
private string canonicalURL { get; set; }
protected override void OnInitialized()
{
canonicalURL = NavigationManager.Uri.Split("?")[0];
}
//End:Hidden
private List<TreeData> localData = new List<TreeData>()
{
new TreeData { Id = 1, Name = "Favorites", HasChild = true, },
new TreeData { Id = 2, Pid = 1, Name = "Sales Reports", Count = 4 },
new TreeData { Id = 3, Pid = 1, Name = "Sent Items" },
new TreeData { Id = 4, Pid = 1, Name = "Marketing Reports", Count = 6 },
new TreeData { Id = 5, HasChild = true, Name = "Andrew Fuller", Expanded = true },
new TreeData { Id = 6, Pid = 5, Name = "Inbox", Selected = true, Count = 20 },
new TreeData { Id = 7, Pid = 5, Name = "Drafts", Count = 5 },
new TreeData { Id = 8, Pid = 5, Name = "Deleted Items" },
new TreeData { Id = 9, Pid = 5, Name = "Sent Items" },
new TreeData { Id = 10, Pid = 5, Name = "Sales Reports", Count = 4 },
new TreeData { Id = 11, Pid = 5, Name = "Marketing Reports", Count = 6 },
new TreeData { Id = 12, Pid = 5, Name = "Outbox" },
new TreeData { Id = 13, Pid = 5, Name = "Junk Email" },
new TreeData { Id = 14, Pid = 5, Name = "RSS Feed" },
new TreeData { Id = 15, Pid = 5, Name = "Trash" }
};
private List<DataModel> dataSource = new List<DataModel>()
{
new DataModel { Name= "Selma Tally", Content1="Apology marketing email", Content2="Hello Ananya Singleton", Id = "1", Order = 0},
new DataModel { Name= "Illa Russo", Content1="Annual conference", Content2="Hi jeani Moresa", Id = "4", Order = 0},
new DataModel { Name= "Camden Macmellon", Content1="Reference request - Camden hester", Content2="Hello Kerry Best", Id = "3", Order = 0},
new DataModel { Name= "Garth Owen", Content1="Application for Graphic designer", Content2="Hello Illa Russo", Id = "2", Order = 0},
new DataModel { Name= "Ursula Patterson", Content1="Software Developer Interview", Content2="Hello Kerry best", Id = "5", Order = 0},
};
public class DataModel
{
public string Name { get; set; }
public string Content1 { get; set; }
public string Content2 { get; set; }
public string Id { get; set; }
public int Order { get; set; }
}
public class TreeData
{
public int Id { get; set; }
public int? Pid { get; set; }
public string Name { get; set; }
public bool HasChild { get; set; }
public bool Expanded { get; set; }
public int Count { get; set; }
public bool Selected { get; set; }
}
private async Task resizeStop()
{
await this.RichTextEditorObj.RefreshUIAsync();
}
private async Task Created()
{
await this.RichTextEditorObj.RefreshUIAsync();
}
}
<style>
#discard {
margin-left: 7px;
}
.outlook-layout-content table {
width: 100%;
}
.outlook-layout-content td {
padding: 2px;
}
.control-section {
min-height: 370px;
}
.outlook-layout-content .e-treeview .e-list-text {
width: 100%;
}
#groupedList.e-listview .e-list-group-item {
height: 0;
}
.outlook-splitter .settings.e-list-wrapper.e-list-multi-line.e-list-avatar {
padding: 15px;
}
#buttonSection {
padding: 7px;
}
.outlook-layout-content #createpostholder {
padding-right: 4px;
padding-left: 3px;
}
.outlook-splitter #tree ul.e-list-parent.e-ul {
padding: 0 0 0 16px;
}
.material3-dark .e-listview.e-list-template .e-list-wrapper.e-list-multi-line .e-list-item-header,
.material-dark .e-listview.e-list-template .e-list-wrapper.e-list-multi-line .e-list-item-header{
color: #fff;
}
.material3-dark .e-listview.e-list-template .e-list-wrapper.e-list-multi-line .e-list-content,
.material-dark .e-listview.e-list-template .e-list-wrapper.e-list-multi-line .e-list-content{
color: #9ca3af;
}
.tailwind .e-list-parent.e-ul,
.tailwind-dark .e-list-parent.e-ul {
overflow : hidden;
}
</style>