[ADF-3275] Select CardView item (#3530)

* Select card view item

* package json fix

* package json fix

* console.log removed

* Usage of generic
This commit is contained in:
Alex Bolboșenco
2018-06-27 16:14:13 +03:00
committed by Eugenio Romano
parent da8ffdfe5e
commit 7563f91665
13 changed files with 338 additions and 1 deletions

View File

@@ -79,6 +79,12 @@ Defining properties from Typescript:
value: [],
key: 'key-value-pairs'
}),
new CardViewSelectItemModel({
label: 'Select box',
value: 'one',
options$: of([{ key: 'one', label: 'One' }, { key: 'two', label: 'Two' }]),
key: 'select'
}),
...
]
```
@@ -105,6 +111,7 @@ You define the property list, the [`CardViewComponent`](../core/card-view.compon
- [**CardViewIntItemModel**](#card-int-item) - _for integer items_
- [**CardViewFloatItemModel**](#card-float-item) - _for float items_
- [**CardViewKeyValuePairsItemModel**](#card-key-values-pairs-item) - _for key-value-pairs items_
- [**CardViewSelectItemModel**](#card-select-item) - _for select items_
Each of these types implements the [Card View Item interface](card-view-item.interface.md):
@@ -309,6 +316,23 @@ const keyValuePairsItemProperty = new CardViewKeyValuePairsItemModel(options);
| value\* | `[{ name: '', value: '' }, ...]` | | The original data value for the item |
#### Card Select Item
[`CardViewSelectItemModel`](../../lib/core/card-view/models/card-view-selectitem.model.ts) is a property type for select properties.
```ts
const selectItemProperty = new CardViewSelectItemModel(options);
```
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| label\* | string | | Item label |
| key\* | string | | Identifying key (important when editing the item) |
| editable | boolean | false | Toggles whether the item is editable |
| value | string | | The original data value for the item |
| options$\* | Observable<CardViewSelectItemOption[]> | | The original data value for the item |
## See also