Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tejainece/webide_splitter

A splitter component for Angular Dart
https://github.com/tejainece/webide_splitter

Last synced: about 2 months ago
JSON representation

A splitter component for Angular Dart

Awesome Lists containing this project

README

        

# Splitter

Provides a splitter component for Angular Dart

# Demo

+ [Vertical layout](https://tejainece.github.com/webide_splitter/web/vertical)
+ [Horizontal layout](https://tejainece.github.com/webide_splitter/web/horizontal)
+ [Nested layout](https://tejainece.github.com/webide_splitter/web/nested)

# Simple example

```dart
@Component(
selector: 'my-app',
styles: const [
'''
:host {
display: block;
width: 100%;
height: 100%;
}

.container {
width: 50%;
height: 50%;
display: flex;
flex-direction: row;
background-color: black;
}

.panel {
height: 100%;
width: calc((100% - 14px) / 3);
}
'''
],
template: r'''








''',
directives: const [materialDirectives, Splitter],
providers: const [materialProviders],
)
class AppComponent {}
```

More examples:

+ [Vertical](https://github.com/tejainece/webide_splitter/tree/master/web/vertical)
+ [Horizontal](https://github.com/tejainece/webide_splitter/tree/master/web/horizontal)
+ [Nested](https://github.com/tejainece/webide_splitter/tree/master/web/nested)

# Usage

## Parent

### Layout
Parent must use flex layout. The direction of flex layout must be chosen
depending on the orientation of the panel layout.

For vertical layout,

```css
.container {
display: flex;
flex-direction: row;
}
```

For horizontal layout,

```css
.container {
display: flex;
flex-direction: column;
}
```

### Size
Parent must have defined size.

```
.container {
width: 50%;
height: 100%;
}
```

## Children/panels

Children's tran-section size must fill the parent. Care must be taken that
splitter's transaction size is deducted.

Children's cross-section size must fill the parent.

For vertical layout,

```
.panel {
height: 100%;
width: calc((100% - 14px) / 3);
}
```

For horizontal layout,

```
.panel {
width: 100%;
height: calc((100% - 14px) / 3);
}
```