-
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.
Loading status checks…
updated library and demo application
1 parent
ec58376
commit 8c5eec1
Showing
31 changed files
with
361 additions
and
228 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.toolbar { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
height: 60px; | ||
display: flex; | ||
align-items: center; | ||
background-color: #1976d2; | ||
color: white; | ||
font-weight: 600; | ||
} | ||
|
||
.toolbar img { | ||
margin: 0 16px; | ||
} | ||
|
||
.container { | ||
margin-top: 60px; | ||
padding: 1rem; | ||
} | ||
|
||
footer { | ||
margin-top: 8px; | ||
display: flex; | ||
align-items: center; | ||
line-height: 20px; | ||
} | ||
|
||
footer a { | ||
display: flex; | ||
align-items: center; | ||
} |
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,4 +1,6 @@ | ||
import { Component } from '@angular/core'; | ||
import { PropertiesConfiguration } from 'ngx-property-editor'; | ||
import { Contact } from './model/contact'; | ||
|
||
@Component({ | ||
selector: 'demo-root', | ||
|
@@ -23,7 +25,7 @@ export class AppComponent { | |
/** | ||
* Display the properties of this object by the property table and editor. | ||
*/ | ||
public data: any = { | ||
public data: Contact = new Contact({ | ||
gender: 'male', | ||
firstname: 'Charlie', | ||
lastname: 'Brown', | ||
|
@@ -32,6 +34,13 @@ export class AppComponent { | |
email: '[email protected]', | ||
favorite: true, | ||
rating: 4, | ||
}; | ||
}); | ||
|
||
/** | ||
* Configuration of displayed properties including name, data type, displayed value etc. | ||
* If undefined, the configuration will be automatically generated from the properties | ||
* of the `data` object. | ||
*/ | ||
public propertiesConfiguration: PropertiesConfiguration | undefined = Contact.propertiesConfiguration; | ||
|
||
} |
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,85 @@ | ||
import { PropertiesConfiguration, PropertyConfiguration } from 'ngx-property-editor'; | ||
|
||
export class Contact { | ||
|
||
public gender: 'male' | 'female' | undefined; | ||
public firstname: string | undefined; | ||
public lastname: string | undefined; | ||
public birthday: Date | undefined; | ||
public tel: string | undefined; | ||
public email: string | undefined; | ||
public favorite: boolean = false; | ||
public rating: number | undefined; | ||
|
||
constructor(data?: { | ||
gender?: 'male' | 'female' | undefined, | ||
firstname?: string | undefined, | ||
lastname?: string | undefined, | ||
birthday?: Date | undefined, | ||
tel?: string | undefined, | ||
email?: string | undefined, | ||
favorite?: boolean | undefined, | ||
rating?: number | undefined, | ||
}) { | ||
this.gender = data?.gender; | ||
this.firstname = data?.firstname; | ||
this.lastname = data?.lastname; | ||
this.birthday = data?.birthday; | ||
this.tel = data?.tel; | ||
this.email = data?.email; | ||
this.favorite = data?.favorite || false; | ||
this.rating = data?.rating; | ||
} | ||
|
||
public static get propertiesConfiguration(): PropertiesConfiguration { | ||
return [ | ||
new PropertyConfiguration({ | ||
propertyName: 'gender', | ||
propertyType: 'select', | ||
dataSource: [ | ||
{ name: 'male', value: 'male' }, | ||
{ name: 'female', value: 'female' }, | ||
], | ||
displayPropertyName: 'name', | ||
valuePropertyName: 'value', | ||
editable: true, | ||
}), | ||
new PropertyConfiguration({ | ||
propertyName: 'firstname', | ||
propertyType: 'string', | ||
editable: true, | ||
}), | ||
new PropertyConfiguration({ | ||
propertyName: 'lastname', | ||
propertyType: 'string', | ||
editable: true, | ||
}), | ||
new PropertyConfiguration({ | ||
propertyName: 'birthday', | ||
propertyType: 'date', | ||
editable: true, | ||
}), | ||
new PropertyConfiguration({ | ||
propertyName: 'tel', | ||
propertyType: 'tel', | ||
editable: true, | ||
}), | ||
new PropertyConfiguration({ | ||
propertyName: 'email', | ||
propertyType: 'email', | ||
editable: true, | ||
}), | ||
new PropertyConfiguration({ | ||
propertyName: 'favorite', | ||
propertyType: 'boolean', | ||
editable: true, | ||
}), | ||
new PropertyConfiguration({ | ||
propertyName: 'rating', | ||
propertyType: 'rating', | ||
editable: true, | ||
}), | ||
]; | ||
} | ||
|
||
} |
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
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
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.