-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af27b61
commit 031ce77
Showing
2 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
packages/dm-core-plugins/blueprints/list/docs/Documentation.md
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,27 @@ | ||
Lists display information where objects listed are structured the same. In dm applications it's also a great way for user to navigate nested items and objects. | ||
|
||
## Table of contents | ||
- [Passing data](#passing-data) | ||
- [Scope to list](#scope) | ||
- [Headers](#headers) | ||
|
||
## Passing data \{#passing-data} | ||
|
||
### Scope to list \{#scope} | ||
List expects an array of objects. Array is passed to the plugin by using the scope method in ViewConfig. | ||
```json {4} | ||
"viewConfig": { | ||
"type": "CORE:ViewConfig", | ||
"recipe": {…}, | ||
"scope": "array_attribute_name" | ||
} | ||
``` | ||
|
||
### Headers \{#headers} | ||
Select data fields by passing attribute name in `headers` config. | ||
```json {3} | ||
"config": { | ||
"type": "PLUGINS:dm-core-plugins/table/ListPluginConfig", | ||
"headers": ["first_name", "last_name", "age"] | ||
} | ||
``` |
100 changes: 100 additions & 0 deletions
100
packages/dm-core-plugins/blueprints/list/docs/Examples/Basic.json
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,100 @@ | ||
{ | ||
"title": "Basic List", | ||
"description": "Minimal example for use of list plugin", | ||
"note": "", | ||
"showDemo": true, | ||
"entityFilePrefix": "cars", | ||
"blueprint": { | ||
"name": "CarList", | ||
"type": "dmss://system/SIMOS/Blueprint", | ||
"attributes": [ | ||
{ | ||
"name": "type", | ||
"type": "dmss://system/SIMOS/BlueprintAttribute", | ||
"attributeType": "string" | ||
}, | ||
{ | ||
"name": "name", | ||
"type": "dmss://system/SIMOS/BlueprintAttribute", | ||
"attributeType": "string" | ||
}, | ||
{ | ||
"name": "cars", | ||
"type": "dmss://system/SIMOS/BlueprintAttribute", | ||
"attributeType": "./Car", | ||
"dimensions": "*" | ||
} | ||
] | ||
}, | ||
"entity": { | ||
"type": "./CarList", | ||
"cars": [ | ||
{ | ||
"_id": "volvo-in-car-list", | ||
"name": "Volvo", | ||
"type": "./Car", | ||
"color": "White", | ||
"model": "XC40" | ||
}, | ||
{ | ||
"_id": "audi-in-car-list", | ||
"name": "Audi", | ||
"type": "./Car", | ||
"color": "Black", | ||
"model": "A2" | ||
}, | ||
{ | ||
"_id": "bmw-in-car-list", | ||
"name": "BMW", | ||
"type": "./Car", | ||
"color": "Blue", | ||
"model": "X1" | ||
} | ||
] | ||
}, | ||
"recipe": { | ||
"name": "cars", | ||
"type": "CORE:UiRecipe", | ||
"description": "List of cars", | ||
"plugin": "@development-framework/dm-core-plugins/list", | ||
"config": { | ||
"type": "PLUGINS:dm-core-plugins/list/ListPluginConfig", | ||
"headers": ["name", "color", "model"] | ||
} | ||
}, | ||
"scope": "cars", | ||
"childBlueprints": [ | ||
{ | ||
"name": "Car", | ||
"type": "CORE:Blueprint", | ||
"description": "", | ||
"attributes": [ | ||
{ | ||
"name": "type", | ||
"type": "dmss://system/SIMOS/BlueprintAttribute", | ||
"attributeType": "string", | ||
"optional": false | ||
}, | ||
{ | ||
"name": "name", | ||
"type": "CORE:BlueprintAttribute", | ||
"attributeType": "string", | ||
"label": "Manufacturer" | ||
}, | ||
{ | ||
"name": "model", | ||
"type": "CORE:BlueprintAttribute", | ||
"attributeType": "string", | ||
"label": "Model" | ||
}, | ||
{ | ||
"name": "color", | ||
"type": "CORE:BlueprintAttribute", | ||
"attributeType": "string", | ||
"label": "Color", | ||
"optional": true | ||
} | ||
] | ||
} | ||
] | ||
} |