forked from valor-software/ngx-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Doc: added documentation for all implemented components (fixes valor-…
- Loading branch information
Showing
103 changed files
with
3,213 additions
and
1,207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,49 @@ | ||
The **accordion directive** builds on top of the collapse directive to provide a list of items, with collapsible bodies that are collapsed or expanded by clicking on the item's header. | ||
### Usage | ||
```typescript | ||
import {accordion} from 'ng2-bootstrap'; | ||
``` | ||
|
||
We can control whether expanding an item will cause the other items to close, using the `close-others` attribute on accordion. | ||
### Annotations | ||
```typescript | ||
// class Accordion | ||
@Component({ | ||
selector: 'accordion, [accordion]', | ||
properties: ['templateUrl', 'closeOthers'], | ||
host: { | ||
'[class.panel-group]': 'true' | ||
} | ||
}) | ||
|
||
The body of each accordion group is transcluded in to the body of the collapsible element. | ||
// class AccordionGroup | ||
@Component({ | ||
selector: 'accordion-group, [accordion-group]', | ||
properties: ['templateUrl', 'heading', 'isOpen', 'isDisabled', 'panelClass'], | ||
host: { | ||
'[class.panel-open]': 'isOpen' | ||
}, | ||
lifecycle: [LifecycleEvent.onInit, LifecycleEvent.onDestroy] | ||
}) | ||
|
||
### Accordion Settings ### | ||
// class AccordionHeading | ||
@Directive({ | ||
selector: 'accordion-heading, [accordion-heading]' | ||
}) | ||
|
||
* `is-open` <i class="glyphicon glyphicon-eye-open"></i> (Defaults: false) : | ||
Whether accordion group is open or closed. | ||
* `template-url` (Defaults: `template/accordion/accordion.html`) : | ||
Add ability to override the template url used | ||
|
||
### Accordion Group Settings ### | ||
export const accordion:Array<any> = [Accordion, AccordionGroup, AccordionHeading]; | ||
``` | ||
|
||
* `panel-class` (Defaults: `panel-default`) : | ||
Add ability to use Bootstrap's contextual panel classes (panel-primary, panel-success, panel-info, etc...) or your own. This must be a string. | ||
* `template-url` (Defaults: `template/accordion/accordion-group.html`) : | ||
Add ability to override the template url used. Note that this must be a string | ||
### Accordion properties | ||
- `close-others` (`?boolean=false`) - if `true` expanding one item will close all others | ||
- `template-url` (*not yet supported*) - allows to override the template url of component (default: `components/accordion/accordion.html`) | ||
|
||
### Accordion Group properties | ||
- `heading` (`?string=''`) - clickable text in accordion's group header | ||
- `is-open` (`?boolean=false`) - is accordion group open or closed | ||
- `is-disabled` (`?boolean=false`) - if `true` disables accordion group | ||
- `panel-class` (`?string='panel-default'`) - provides an ability to use Bootstrap's contextual panel classes (`panel-primary`, `panel-success`, `panel-info`, etc...). List of all available classes [link](http://getbootstrap.com/components/#panels-alternatives) | ||
- `template-url` (*not yet supported*) - allows to override the template url of component (default: `components/accordion/accordion-group.html`) | ||
|
||
### Accordion heading | ||
|
||
Instead of the `heading` attribute on the `accordion-group`, you can use an `accordion-heading` attribute on `template` element inside a group that will be used as the group's header. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The **accordion component** builds on top of the collapse directive to provide a list of items, with collapsible bodies that are collapsed or expanded by clicking on the item's header. | ||
|
||
Base specifications: [bootstrap 3](http://getbootstrap.com/javascript/#collapse-example-accordion) or [bootstrap 4](http://v4-alpha.getbootstrap.com/components/collapse/#accordion-example) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### Usage | ||
```typescript | ||
import {Alert} from 'ng2-bootstrap'; | ||
``` | ||
|
||
### Annotations | ||
```typescript | ||
// class Alert | ||
@Component({ | ||
selector: 'alert', | ||
properties: ['type', 'dismissible', 'dismissOnTimeout'], | ||
events: ['close'], | ||
lifecycle: [LifecycleEvent.onInit] | ||
}) | ||
``` | ||
|
||
### Alert properties | ||
- `type` (`?:string='warning'`) - provide one of the four supported contextual classes: | ||
`success`,`info`, `warning`, `danger` | ||
- `dismissible` (`?:boolean=false`) - determines if an inline close button is displayed | ||
- `dismiss-on-timeout` (`?number=0`) - number of milliseconds, if specified sets a timeout duration, after which the alert will be closed | ||
- `template-url` (*not yet supported*) - allows to provide message template | ||
|
||
### Alert events | ||
- `close` - fired when `alert` closed with inline button or by timeout, `$event` is an instance of `Alert` component | ||
|
||
*Will be deprecated*: The presence of the `(close)` event handler determines | ||
if a close button is displayed, use `dismissible` instead | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Provides contextual feedback messages for typical user actions with the handful of available and flexible alert messages. | ||
|
||
Base specifications: [bootstrap 3](http://getbootstrap.com/components/#alerts) or [bootstrap 4](http://v4-alpha.getbootstrap.com/components/alerts/) | ||
|
||
This directive can be used to generate alerts from the dynamic model data (using the `ng-for` directive). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.