Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitter(Docs): Add splitter topic #1876

Merged
merged 19 commits into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 165 additions & 0 deletions en/components/splitter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
---
title: Angular Splitter | Split Panes | Ignite UI for Angular | Infragistics
_description: Use the Angular Splitter component to create a simple split layout splitting the view horizontally or vertically into multiple collapsible split panes.
_keywords: angular splitter, igniteui for angular, infragistics
---

## Splitter

The Ignite UI for Angular Splitter component provides a framework for a simple split layout splitting the view horizontally or vertically into multiple smaller areas called split panes.
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved

### Demo
<div class="sample-container loading" style="height: 450px">
<iframe id="splitter-horizontal-iframe" src='{environment:dvDemosBaseUrl}/layouts/splitter-horizontal' width="100%" height="100%" seamless frameBorder="0" onload="onXPlatSampleIframeContentLoaded(this);"></iframe>
</div>
<div>
<button data-localize="stackblitz" disabled class="stackblitz-btn" data-iframe-id="splitter-horizontal-iframe" data-demos-base-url="{environment:dvDemosBaseUrl}">View on StackBlitz
</button>
</div>

<div class="divider--half"></div>

### Usage

To start using the **igxSplitter** first we need to import the **IgxSplitterModule** in our **app.module**:
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved
```typescript
// app.module.ts
...
import { IgxSplitterModule } from 'igniteui-angular';

@NgModule({
...
imports: [..., IgxSplitterModule],
...
})
export class AppModule {}
```

After that we can add the markup for our component:
```html
<!-- splitter.component.html -->
<igx-splitter>
<igx-splitter-pane>
...
</igx-splitter-pane>
<igx-splitter-pane>
...
</igx-splitter-pane>
<igx-splitter-pane>
...
</igx-splitter-pane>
</igx-splitter>
```
The Initialization of the **igxSplitter** is done by using the **igx-splitter** tag. Multiple splitter panes can be defined under a single **igx-splitter**. The content of the pane is templatable and will be rendered in its own resizable container.
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved


#### Orientation

The splitter can be vertical or horizontal, which is defined by the [`type`]({environment:angularApiUrl}/classes/igxsplittercomponent.html#type) input. The default value is Vertical.
```typescript
public type = SplitterType.Horizontal;
```
```html
<igx-splitter [type]="type">
<igx-splitter-pane>
...
</igx-splitter-pane>
<igx-splitter-pane>
...
</igx-splitter-pane>
</igx-splitter>
```

#### Configuring panes

The **igxSplitterPane** contains several input properties. We can set the initial pane size by using the [`size`]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html#size) input property. The [`minSize`]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html#minSize) and [`maxSize`]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html#maxSize) input properties can be used to set the minimum or maximum allowed size of the pane. Resizing beyond `minSize` and `maxSize` is not allowed.
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved
```html
<igx-splitter>
<igx-splitter-pane size='300px' minSize='100px'>
...
</igx-splitter-pane>
<igx-splitter-pane size='300px' maxSize='500px'>
...
</igx-splitter-pane>
</igx-splitter>
```
If we want to disallow resizing of a pane, we can set the [`resizable`]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html#resizable) input property to **false**.
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved
```html
<igx-splitter>
<igx-splitter-pane [resizable]='false'>
...
</igx-splitter-pane>
<igx-splitter-pane>
...
</igx-splitter-pane>
</igx-splitter>
```

#### Nested panes

We can nest splitter components to create a more complex layout inside a splitter pane.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We can nest splitter components to create a more complex layout inside a splitter pane.
You can nest splitter components to create a more complex layout inside a splitter pane.

```typescript
public typeHorizontal = SplitterType.Horizontal;
public typeVertical = SplitterType.Vertical;
```
```html
<igx-splitter style='height: 30vh;' [type]='typeHorizontal' >
<igx-splitter-pane>
<igx-splitter [type]='typeVertical' [style.width]='"100%"'>
<igx-splitter-pane>
Pane1.1
</igx-splitter-pane>
<igx-splitter-pane>
Pane1.2
</igx-splitter-pane>
</igx-splitter>
</igx-splitter-pane>
<igx-splitter-pane>
<igx-splitter [type]='typeVertical' [style.width]='"100%"'>
<igx-splitter-pane>
Pane2.1
</igx-splitter-pane>
<igx-splitter-pane>
Pane2.2
</igx-splitter-pane>
</igx-splitter>
</igx-splitter-pane>
</igx-splitter>
```

#### Demo
<div class="sample-container loading" style="height: 450px">
<iframe id="splitter-nested-iframe" src='{environment:dvDemosBaseUrl}/layouts/splitter-nested' width="100%" height="100%" seamless frameBorder="0" onload="onXPlatSampleIframeContentLoaded(this);"></iframe>
</div>
<div>
<button data-localize="stackblitz" disabled class="stackblitz-btn" data-iframe-id="splitter-nested-iframe" data-demos-base-url="{environment:dvDemosBaseUrl}">View on StackBlitz
</button>
</div>

### Keyboard navigation

Keyboard navigation is available by default in the splitter component. When we focus a splitter bar and press one of the following key combinations, the described behavior is performed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Keyboard navigation is available by default in the splitter component. When we focus a splitter bar and press one of the following key combinations, the described behavior is performed.
The splitter bar may also be interacted with by the keyboard. When focused the following key combinations are available:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not exactly "navigation" interactions


#### Key combinations
- `Arrow Up` - Moves up the splitter bar in a vertical splitter
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved
- `Arrow Down` - Moves down the splitter bar in a vertical splitter
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved
- `Arrow Left` - Moves left the splitter bar in a horizontal splitter
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved
- `Arrow Right` - Moves right the splitter bar in a horizontal splitter
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved
- `Ctrl + Arrow Up` - Expands/Collapses a pane in a vertical splitter
- `Ctrl + Arrow Down` - Expands/Collapses a pane in a vertical splitter
- `Ctrl + Arrow Left` - Expands/Collapses a pane in a horizontal splitter
- `Ctrl + Arrow Right` - Expands/Collapses a pane in a horizontal splitter


### API References
<div class="divider--half"></div>

* [IgxSplitterComponent]({environment:angularApiUrl}/classes/igxsplittercomponent.html)
* [IgxSplitterPaneComponent]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html)
* [SplitterType]({environment:angularApiUrl}/enums/splittertype.html)

<div class="divider--half"></div>
Our community is active and always welcoming to new ideas.
* [Ignite UI for Angular **Forums**](https://www.infragistics.com/community/forums/f/ignite-ui-for-angular)
* [Ignite UI for Angular **GitHub**](https://github.com/IgniteUI/igniteui-angular)

3 changes: 3 additions & 0 deletions en/components/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,9 @@
- name: Expansion Panel
href: expansion_panel.md
new: false
- name: Splitter
href: splitter.md
new: true
- name: Notifications
header: true
- name: Banner
Expand Down
165 changes: 165 additions & 0 deletions jp/components/splitter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
---
ChronosSF marked this conversation as resolved.
Show resolved Hide resolved
title: Angular Splitter | Split Panes | Ignite UI for Angular | Infragistics
_description: Use the Angular Splitter component to create a simple split layout splitting the view horizontally or vertically into multiple collapsible split panes.
_keywords: angular splitter, igniteui for angular, infragistics
---

## Splitter

The Ignite UI for Angular Splitter component provides a framework for a simple split layout splitting the view horizontally or vertically into multiple smaller areas called split panes.

### Demo
<div class="sample-container loading" style="height: 450px">
<iframe id="splitter-horizontal-iframe" src='{environment:dvDemosBaseUrl}/layouts/splitter-horizontal' width="100%" height="100%" seamless frameBorder="0" onload="onXPlatSampleIframeContentLoaded(this);"></iframe>
</div>
<div>
<button data-localize="stackblitz" disabled class="stackblitz-btn" data-iframe-id="splitter-horizontal-iframe" data-demos-base-url="{environment:dvDemosBaseUrl}">View on StackBlitz
</button>
</div>

<div class="divider--half"></div>

### Usage

To start using the **igxSplitter** first we need to import the **IgxSplitterModule** in our **app.module**:
```typescript
// app.module.ts
...
import { IgxSplitterModule } from 'igniteui-angular';

@NgModule({
...
imports: [..., IgxSplitterModule],
...
})
export class AppModule {}
```

After that we can add the markup for our component:
```html
<!-- splitter.component.html -->
<igx-splitter>
<igx-splitter-pane>
...
</igx-splitter-pane>
<igx-splitter-pane>
...
</igx-splitter-pane>
<igx-splitter-pane>
...
</igx-splitter-pane>
</igx-splitter>
```
The Initialization of the **igxSplitter** is done by using the **igx-splitter** tag. Multiple splitter panes can be defined under a single **igx-splitter**. The content of the pane is templatable and will be rendered in its own resizable container.


#### Orientation

The splitter can be vertical or horizontal, which is defined by the [`type`]({environment:angularApiUrl}/classes/igxsplittercomponent.html#type) input. The default value is Vertical.
```typescript
public type = SplitterType.Horizontal;
```
```html
<igx-splitter [type]="type">
<igx-splitter-pane>
...
</igx-splitter-pane>
<igx-splitter-pane>
...
</igx-splitter-pane>
</igx-splitter>
```

#### Configuring panes

The **igxSplitterPane** contains several input properties. We can set the initial pane size by using the [`size`]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html#size) input property. The [`minSize`]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html#minSize) and [`maxSize`]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html#maxSize) input properties can be used to set the minimum or maximum allowed size of the pane. Resizing beyond `minSize` and `maxSize` is not allowed.
```html
<igx-splitter>
<igx-splitter-pane size='300px' minSize='100px'>
...
</igx-splitter-pane>
<igx-splitter-pane size='300px' maxSize='500px'>
...
</igx-splitter-pane>
</igx-splitter>
```
If we want to disallow resizing of a pane, we can set the [`resizable`]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html#resizable) input property to **false**.
```html
<igx-splitter>
<igx-splitter-pane [resizable]='false'>
...
</igx-splitter-pane>
<igx-splitter-pane>
...
</igx-splitter-pane>
</igx-splitter>
```

#### Nested panes

We can nest splitter components to create a more complex layout inside a splitter pane.
```typescript
public typeHorizontal = SplitterType.Horizontal;
public typeVertical = SplitterType.Vertical;
```
```html
<igx-splitter style='height: 30vh;' [type]='typeHorizontal' >
<igx-splitter-pane>
<igx-splitter [type]='typeVertical' [style.width]='"100%"'>
<igx-splitter-pane>
Pane1.1
</igx-splitter-pane>
<igx-splitter-pane>
Pane1.2
</igx-splitter-pane>
</igx-splitter>
</igx-splitter-pane>
<igx-splitter-pane>
<igx-splitter [type]='typeVertical' [style.width]='"100%"'>
<igx-splitter-pane>
Pane2.1
</igx-splitter-pane>
<igx-splitter-pane>
Pane2.2
</igx-splitter-pane>
</igx-splitter>
</igx-splitter-pane>
</igx-splitter>
```

#### Demo
<div class="sample-container loading" style="height: 450px">
<iframe id="splitter-nested-iframe" src='{environment:dvDemosBaseUrl}/layouts/splitter-nested' width="100%" height="100%" seamless frameBorder="0" onload="onXPlatSampleIframeContentLoaded(this);"></iframe>
</div>
<div>
<button data-localize="stackblitz" disabled class="stackblitz-btn" data-iframe-id="splitter-nested-iframe" data-demos-base-url="{environment:dvDemosBaseUrl}">View on StackBlitz
</button>
</div>

### Keyboard navigation

Keyboard navigation is available by default in the splitter component. When we focus a splitter bar and press one of the following key combinations, the described behavior is performed.

#### Key combinations
- `Arrow Up` - Moves up the splitter bar in a vertical splitter
- `Arrow Down` - Moves down the splitter bar in a vertical splitter
- `Arrow Left` - Moves left the splitter bar in a horizontal splitter
- `Arrow Right` - Moves right the splitter bar in a horizontal splitter
- `Ctrl + Arrow Up` - Expands/Collapses a pane in a vertical splitter
- `Ctrl + Arrow Down` - Expands/Collapses a pane in a vertical splitter
- `Ctrl + Arrow Left` - Expands/Collapses a pane in a horizontal splitter
- `Ctrl + Arrow Right` - Expands/Collapses a pane in a horizontal splitter


### API References
<div class="divider--half"></div>

* [IgxSplitterComponent]({environment:angularApiUrl}/classes/igxsplittercomponent.html)
* [IgxSplitterPaneComponent]({environment:angularApiUrl}/classes/igxsplitterpanecomponent.html)
* [SplitterType]({environment:angularApiUrl}/enums/splittertype.html)

<div class="divider--half"></div>
Our community is active and always welcoming to new ideas.
* [Ignite UI for Angular **Forums**](https://www.infragistics.com/community/forums/f/ignite-ui-for-angular)
* [Ignite UI for Angular **GitHub**](https://github.com/IgniteUI/igniteui-angular)

3 changes: 3 additions & 0 deletions jp/components/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,9 @@
- name: Expansion Panel
href: expansion_panel.md
new: false
name: Splitter
href: splitter.md
new: true
- name: 通知
header: true
- name: Banner
Expand Down