11## Table of Contents
22
33- [ Generate a card component with the schematics command] ( #generate-a-card-component-with-the-schematics-command )
4- - [ Flags and options that can be used in the generation process] ( #flags-and-options-that-can-be-used-in-the-generation-process )
5- - [ Generate a component with a custom name] ( #generate-a-component-with-a-custom-name )
6- - [ Exclude one or more properties from the generation] ( #exclude-one-or-more-properties-from-the-generation )
7- - [ Multi-version support for Aspect Models] ( #multi-version-support-for-aspect-models )
8- - [ Manual adaptions in _ app.module.ts_ ] ( #manual-adaptions-in-appmodulets )
9- - [ Show customized information in the card with ng-template] ( #show-customized-information-in-the-card-with-ng-template )
10- - [ Export functionality] ( #export-functionality )
11- - [ Custom icons for the command bar] ( #custom-icons-for-the-command-bar )
12- - [ Add translations] ( #add-translations )
13- - [ Pre-load config file] ( #pre-load-config-file )
14- - [ Skip Installation] ( #skip-install )
15- - [ Overwrite] ( #overwrite )
16- - [ Add material css theme] ( #Add-material-css-theme )
17- - [ Set View Encapsulation strategy] ( #Set-View-Encapsulation-strategy )
4+ - [ Flags and options that can be used in the generation process] ( #flags-and-options-that-can-be-used-in-the-generation-process )
5+ - [ Generate a component with a custom name] ( #generate-a-component-with-a-custom-name )
6+ - [ Exclude one or more properties from the generation] ( #exclude-one-or-more-properties-from-the-generation )
7+ - [ Multi-version support for Aspect Models] ( #multi-version-support-for-aspect-models )
8+ - [ Show customized information in the card with ng-template] ( #show-customized-information-in-the-card-with-ng-template )
9+ - [ Export functionality] ( #export-functionality )
10+ - [ Custom icons for the command bar] ( #custom-icons-for-the-command-bar )
11+ - [ Add translations] ( #add-translations )
12+ - [ Pre-load config file] ( #pre-load-config-file )
13+ - [ Skip Installation] ( #skip-install )
14+ - [ Overwrite] ( #overwrite )
15+ - [ Add material css theme] ( #Add-material-css-theme )
16+ - [ Set View Encapsulation strategy] ( #Set-View-Encapsulation-strategy )
1817
1918# Generate a card component with the schematics command
2019
@@ -54,9 +53,9 @@ this will be the result in the generated component .ts file
5453
5554``` typescript
5655@Component ({
57- selector: ' esmf-sdk-ui-movement-card' ,
58- templateUrl: ' ./movement-card.component.html' ,
59- styleUrls: [' ./movement-card.component.scss' ],
56+ selector: ' esmf-sdk-ui-movement-card' ,
57+ templateUrl: ' ./movement-card.component.html' ,
58+ styleUrls: [' ./movement-card.component.scss' ],
6059})
6160export class MovementCardComponent {}
6261```
@@ -72,9 +71,9 @@ selector.
7271
7372``` typescript
7473@Component ({
75- selector: ' esmf-sdk-ui-custom-card' , // <- provided name reflected in the selector name
76- templateUrl: ' ./custom-card.component.html' , // <- provided name reflected in the component path
77- styleUrls: [' ./custom-card.component.scss' ], // <- provided name reflected in the component files
74+ selector: ' esmf-sdk-ui-custom-card' , // <- provided name reflected in the selector name
75+ templateUrl: ' ./custom-card.component.html' , // <- provided name reflected in the component path
76+ styleUrls: [' ./custom-card.component.scss' ], // <- provided name reflected in the component files
7877})
7978export class CustomCardComponent {} // <- provided name reflected in the component class name
8079```
@@ -148,54 +147,15 @@ component and the language files.
148147
149148---
150149
151- ## Manual adaptions in _ app.module.ts_
152-
153- Please note that you (eventually) need to manually adapt file
154- _ src/app/app.module.ts_ in order to specify which versions of the card UI
155- component you would like to use. In the example below, versions 1.0.0 and
156- 1.1.0 are to be used as components.
157-
158- ``` typescript
159- import {NgModule } from ' @angular/core' ;
160- import {BrowserModule } from ' @angular/platform-browser' ;
161-
162- import {AppComponent } from ' ./app.component' ;
163- import {BrowserAnimationsModule } from ' @angular/platform-browser/animations' ;
164- import {
165- MovementCardModule as MovementCardModule_v100
166- } from ' ./shared/components/movement-card/v100/movement-card.module' ;
167- import {
168- MovementCardModule as MovementCardModule_v110
169- } from ' ./shared/components/movement-card/v110/movement-card.module' ;
170-
171- @NgModule ({
172- imports: [
173- MovementCardModule_v100 , // <-- Manually added
174- MovementTCardModule_v110 // <-- Manually added
175- ]
176- })
177- ```
178-
179- This gives you the choice to decide which UI components (and in which version) are used to compose your web application.
180- You then can use this specific version of the card UI component, e.g. in _ src/app/app.component.html_ :
181-
182- ``` angular2html
183-
184- <esmf-sdk-ui-movement-card-v100></esmf-sdk-ui-movement-card-v100>
185- <esmf-sdk-ui-movement-card-v110></esmf-sdk-ui-movement-card-v110>
186- ```
187-
188- ---
189-
190150## Show customized information in the card with ng-template
191151
192152In your parent HTML file, you have the ability to define a custom ng-template.
193153This template will be integrated directly into the card's content.
194154
195155You can either:
196156
197- * Utilize the pre-defined elements and their values, or
198- * Introduce entirely custom content according to your requirements.
157+ - Utilize the pre-defined elements and their values, or
158+ - Introduce entirely custom content according to your requirements.
199159
200160This flexibility allows you to tailor the card's appearance and behavior to fit specific scenarios.
201161
@@ -207,23 +167,35 @@ Without versioning:
207167
208168``` html
209169<esmf-sdk-ui-movement-card-v100 >
210- <ng-template #cardTemplate let-data let-element =" <componentName>CardValues" let-getElementValue =" getElementValue" let-translateService =" translateService" >
211- <div class =" data-card-element" *ngFor =" let elem of element" >
212- <b >{{ elem + ".preferredName" | transloco }}</b >: {{ getElementValue(data, elem) }}
213- </div >
214- </ng-template >
170+ <ng-template
171+ #cardTemplate
172+ let-data
173+ let-element =" <componentName>CardValues"
174+ let-getElementValue =" getElementValue"
175+ let-translateService =" translateService"
176+ >
177+ <div class =" data-card-element" *ngFor =" let elem of element" >
178+ <b >{{ elem + ".preferredName" | transloco }}</b >: {{ getElementValue(data, elem) }}
179+ </div >
180+ </ng-template >
215181</esmf-sdk-ui-movement-card-v100 >
216182```
217183
218184With versioning:
219185
220186``` html
221187<esmf-sdk-ui-movement-card-v100 >
222- <ng-template #cardTemplate let-data let-element =" <componentName>CardValues" let-getElementValue =" getElementValue" let-translateService =" translateService" >
223- <div class =" data-card-element" *ngFor =" let elem of element" >
224- <b >{{ 'movement.v210.' + elem + ".preferredName" | transloco }}</b >: {{ getElementValue(data, elem) }}
225- </div >
226- </ng-template >
188+ <ng-template
189+ #cardTemplate
190+ let-data
191+ let-element =" <componentName>CardValues"
192+ let-getElementValue =" getElementValue"
193+ let-translateService =" translateService"
194+ >
195+ <div class =" data-card-element" *ngFor =" let elem of element" >
196+ <b >{{ 'movement.v210.' + elem + ".preferredName" | transloco }}</b >: {{ getElementValue(data, elem) }}
197+ </div >
198+ </ng-template >
227199</esmf-sdk-ui-movement-card-v100 >
228200```
229201
@@ -251,35 +223,35 @@ By pressing it, a modal dialog window will appear with multiple options.
251223
2522241 . If the data is handled on the client side, the following options will appear:
253225
254- 1 . Export all pages (by default)
255- Pressing this button will result into a full data export to a csv file.
256- 2 . Export only first page
257- If this option appears, this will lead to a csv file being exported including only the first page from the view.
226+ 1 . Export all pages (by default)
227+ Pressing this button will result into a full data export to a csv file.
228+ 2 . Export only first page
229+ If this option appears, this will lead to a csv file being exported including only the first page from the view.
258230
2592312 . If the data is handled remotely, the following options will be visible:
260232
261- 1 . Export all pages (by default) - option which exports a csv containing the set of data which can be visible on
262- that
263- page.
264- 2 . Export only first page
265- If this option appears, this will lead to a csv file being exported including only the first page from the view.
266- 3 . Export all pages (only if an ExtendedCsvExporter function is passed to the card through bindings) - will result
267- in exporting the data by calling an external function passed to the generated component through binding by using
268- the ` extendedCsvExporter ` attribute.
233+ 1 . Export all pages (by default) - option which exports a csv containing the set of data which can be visible on
234+ that
235+ page.
236+ 2 . Export only first page
237+ If this option appears, this will lead to a csv file being exported including only the first page from the view.
238+ 3 . Export all pages (only if an ExtendedCsvExporter function is passed to the card through bindings) - will result
239+ in exporting the data by calling an external function passed to the generated component through binding by using
240+ the ` extendedCsvExporter ` attribute.
269241
270- ``` html
271- <esmf-sdk-ui-movement-card-v321 [extendedCsvExporter] =" csvExporter" ></esmf-sdk-ui-movement-card-v321 >
272- ```
242+ ``` html
243+ <esmf-sdk-ui-movement-card-v321 [extendedCsvExporter] =" csvExporter" ></esmf-sdk-ui-movement-card-v321 >
244+ ```
273245
274246 The ` csvExporter ` function will have a type ` ExtendedCsvExporter ` exported in the component's service file, and it
275247 will need to implement a function with 2 arguments, the displayed columns and the RQL query which will query the data
276248 from the backend.
277249
278- ```typescript
279- export interface ExtendedCsvExporter {
280- export(displayedColumns: string[], rqlQuery: string): void;
281- }
282- ```
250+ ``` typescript
251+ export interface ExtendedCsvExporter {
252+ export(displayedColumns : string [], rqlQuery : string ): void ;
253+ }
254+ ```
283255
284256 If this function is not exposed to the component, this option will not appear in the export dialog window.
285257
@@ -317,38 +289,38 @@ ng generate @esmf/semantic-ui-schematics:card --configFile=<config-file-name>-wi
317289
318290Example of configuration file:
319291
320- [ // ] : # ( TODO check this is up to date )
292+ [ // ] : # ' TODO check this is up to date '
321293
322294``` json
323295{
324- "aspectModelTFiles" : [" FOLDER\\ Movement.ttl" ],
325- "excludedProperties" : [],
326- "configFile" : " wizard.config.json" ,
327- "complexProps" : [
328- {
329- "prop" : " position" ,
330- "propsToShow" : [" x" , " y" , " z" ]
331- }
332- ],
333- "selectedModelElementUrn" : " urn:samm:org.eclipse.esmf.test:1.0.0#Movement" ,
334- "jsonAccessPath" : " " ,
335- "defaultSortingCol" : " moving" ,
336- "customRowActions" : [" schedule" ],
337- "addCommandBar" : true ,
338- "enabledCommandBarFunctions" : [" addCustomCommandBarActions" , " addSearchBar" , " addEnumQuickFilters" , " addDateQuickFilters" ],
339- "customCommandBarActions" : [" edit.svg" ],
340- "enableRemoteDataHandling" : true ,
341- "enableVersionSupport" : true ,
342- "overwrite" : true ,
343- "getOptionalMaterialTheme" : false ,
344- "datePickers" : [
345- {
346- "propertyUrn" : " urn:samm:org.eclipse.test:1.0.0#datePicker" ,
347- "datePicker" : {
348- "type" : " singleDatePicker"
349- }
296+ "aspectModelTFiles" : [" FOLDER\\ Movement.ttl" ],
297+ "excludedProperties" : [],
298+ "configFile" : " wizard.config.json" ,
299+ "complexProps" : [
300+ {
301+ "prop" : " position" ,
302+ "propsToShow" : [" x" , " y" , " z" ]
303+ }
304+ ],
305+ "selectedModelElementUrn" : " urn:samm:org.eclipse.esmf.test:1.0.0#Movement" ,
306+ "jsonAccessPath" : " " ,
307+ "defaultSortingCol" : " moving" ,
308+ "customRowActions" : [" schedule" ],
309+ "addCommandBar" : true ,
310+ "enabledCommandBarFunctions" : [" addCustomCommandBarActions" , " addSearchBar" , " addEnumQuickFilters" , " addDateQuickFilters" ],
311+ "customCommandBarActions" : [" edit.svg" ],
312+ "enableRemoteDataHandling" : true ,
313+ "enableVersionSupport" : true ,
314+ "overwrite" : true ,
315+ "getOptionalMaterialTheme" : false ,
316+ "datePickers" : [
317+ {
318+ "propertyUrn" : " urn:samm:org.eclipse.test:1.0.0#datePicker" ,
319+ "datePicker" : {
320+ "type" : " singleDatePicker"
350321 }
351- ]
322+ }
323+ ]
352324}
353325```
354326
0 commit comments