-
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.
feat: custom card component created.
- Loading branch information
1 parent
68f76c3
commit ca3371a
Showing
14 changed files
with
354 additions
and
48 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
application/backend/src/main/java/io/typerefinery/websight/models/components/Card.java
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,52 @@ | ||
package io.typerefinery.websight.models.components; | ||
|
||
import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; | ||
|
||
import javax.inject.Inject; | ||
import lombok.Getter; | ||
import org.apache.sling.api.resource.Resource; | ||
import org.apache.sling.api.resource.ResourceResolver; | ||
import org.apache.sling.models.annotations.Default; | ||
import org.apache.sling.models.annotations.Model; | ||
import org.apache.sling.models.annotations.injectorspecific.SlingObject; | ||
|
||
@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) | ||
public class Card { | ||
@SlingObject | ||
private ResourceResolver resourceResolver; | ||
|
||
@Getter | ||
@Inject | ||
@Default(values = "") | ||
public String title; | ||
|
||
|
||
@Getter | ||
@Inject | ||
@Default(values = "") | ||
public String description; | ||
|
||
|
||
@Getter | ||
@Inject | ||
@Default(values = "") | ||
public String subtitle; | ||
|
||
|
||
@Getter | ||
@Inject | ||
public String bgColor; | ||
|
||
|
||
@Getter | ||
@Inject | ||
public String titleColor; | ||
|
||
@Getter | ||
@Inject | ||
public String subtitleColor; | ||
|
||
@Getter | ||
@Inject | ||
public String descriptionColor; | ||
} |
39 changes: 39 additions & 0 deletions
39
application/backend/src/main/java/io/typerefinery/websight/models/components/Tika.java
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,39 @@ | ||
package io.typerefinery.websight.models.components; | ||
|
||
import static org.apache.sling.models.annotations.DefaultInjectionStrategy.OPTIONAL; | ||
|
||
import javax.inject.Inject; | ||
import lombok.Getter; | ||
import org.apache.sling.api.resource.Resource; | ||
import org.apache.sling.api.resource.ResourceResolver; | ||
import org.apache.sling.models.annotations.Default; | ||
import org.apache.sling.models.annotations.Model; | ||
import org.apache.sling.models.annotations.injectorspecific.SlingObject; | ||
|
||
@Model(adaptables = Resource.class, defaultInjectionStrategy = OPTIONAL) | ||
public class Tika { | ||
@SlingObject | ||
private ResourceResolver resourceResolver; | ||
|
||
@Getter | ||
@Inject | ||
@Default(values = "") | ||
public String title; | ||
|
||
|
||
@Getter | ||
@Inject | ||
@Default(values = "") | ||
public String value; | ||
|
||
|
||
@Getter | ||
@Inject | ||
@Default(values = "") | ||
public String icon; | ||
|
||
|
||
@Getter | ||
@Inject | ||
public String badge; | ||
} |
7 changes: 7 additions & 0 deletions
7
...cation/backend/src/main/resources/apps/typerefinery/components/content/card/.content.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,7 @@ | ||
{ | ||
"group": "Typerefinery", | ||
"sling:resourceType": "ws:Component", | ||
"description": "Prime vue card component.", | ||
"title": "Card Item", | ||
"isContainer": true | ||
} |
4 changes: 4 additions & 0 deletions
4
application/backend/src/main/resources/apps/typerefinery/components/content/card/card.html
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,4 @@ | ||
<sly data-sly-use.model="io.typerefinery.websight.models.components.Card" | ||
data-sly-use.template="./template.html" | ||
data-sly-call="${template.card @ title=model.title, description=model.description, subtitle=model.subtitle, icon=model.icon, bgColor=model.bgColor, descriptionColor=model.descriptionColor, titleColor=model.titleColor, subtitleColor=model.subtitleColor}"> | ||
</sly> |
49 changes: 49 additions & 0 deletions
49
...backend/src/main/resources/apps/typerefinery/components/content/card/dialog/.content.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,49 @@ | ||
{ | ||
"sling:resourceType": "wcm/dialogs/dialog", | ||
"tabs": { | ||
"sling:resourceType": "wcm/dialogs/components/tabs", | ||
"generalTab": { | ||
"sling:resourceType": "wcm/dialogs/components/tab", | ||
"label": "General", | ||
"title": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "title", | ||
"label": "Title" | ||
}, | ||
"subtitle": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "subtitle", | ||
"label": "Sub Title" | ||
}, | ||
"description": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "description", | ||
"label": "Description" | ||
} | ||
}, | ||
"stylesTab": { | ||
"sling:resourceType": "wcm/dialogs/components/tab", | ||
"label": "Styling", | ||
"bgColor": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "bgColor", | ||
"label": "Card background color" | ||
}, | ||
"titleColor": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "titleColor", | ||
"label": "Title text color" | ||
}, | ||
"subtitleColor": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "subtitleColor", | ||
"label": "Sub Title text color" | ||
}, | ||
"descriptionColor": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "descriptionColor", | ||
"label": "Description text color" | ||
} | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...cation/backend/src/main/resources/apps/typerefinery/components/content/card/template.html
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,19 @@ | ||
<template data-sly-template.card="${ @ title, description, subtitle, icon, subtitleColor, descriptionColor, titleColor, bgColor }"> | ||
<p-card style="width: 25rem; margin-bottom: 2em" :style='{background:"${bgColor}"}'> | ||
<template #title> | ||
<div :style='{color:"${titleColor}"}'> | ||
${title} | ||
</div> | ||
</template> | ||
<template #subtitle> | ||
<div :style='{color:"${subtitleColor}"}'> | ||
${subtitle} | ||
</div> | ||
</template> | ||
<template #content> | ||
<div :style='{color:"${descriptionColor}"}'> | ||
${description} | ||
</div> | ||
</template> | ||
</p-card> | ||
</template> |
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
7 changes: 7 additions & 0 deletions
7
...cation/backend/src/main/resources/apps/typerefinery/components/content/tika/.content.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,7 @@ | ||
{ | ||
"group": "Typerefinery", | ||
"sling:resourceType": "ws:Component", | ||
"description": "Tika component", | ||
"title": "Tika", | ||
"isContainer": true | ||
} |
54 changes: 54 additions & 0 deletions
54
...backend/src/main/resources/apps/typerefinery/components/content/tika/dialog/.content.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,54 @@ | ||
{ | ||
"sling:resourceType": "wcm/dialogs/dialog", | ||
"tabs": { | ||
"sling:resourceType": "wcm/dialogs/components/tabs", | ||
"generalTab": { | ||
"sling:resourceType": "wcm/dialogs/components/tab", | ||
"label": "General", | ||
"title": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "title", | ||
"label": "Title" | ||
}, | ||
"value": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "value", | ||
"label": "Value" | ||
}, | ||
"icon": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "icon", | ||
"label": "icon" | ||
}, | ||
"badge": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "badge", | ||
"label": "badge" | ||
} | ||
}, | ||
"stylesTab": { | ||
"sling:resourceType": "wcm/dialogs/components/tab", | ||
"label": "Styling", | ||
"bgColor": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "bgColor", | ||
"label": "Card background color" | ||
}, | ||
"titleColor": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "titleColor", | ||
"label": "Title text color" | ||
}, | ||
"subtitleColor": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "subtitleColor", | ||
"label": "Sub Title text color" | ||
}, | ||
"descriptionColor": { | ||
"sling:resourceType": "wcm/dialogs/components/textfield", | ||
"name": "descriptionColor", | ||
"label": "Description text color" | ||
} | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...cation/backend/src/main/resources/apps/typerefinery/components/content/tika/template.html
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,43 @@ | ||
<template data-sly-template.tika="${ @ title, value, badge, icon }"> | ||
<div | ||
style=" | ||
background:#FFF; | ||
width: 280px; | ||
height: 100px; | ||
border-radius: 4px; | ||
display:flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center | ||
" | ||
> | ||
<div | ||
style=" | ||
display:flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 20px; | ||
width: 100%; | ||
height: 100%; | ||
" | ||
> | ||
<div | ||
style=" | ||
display:flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
height: 100%; | ||
" | ||
> | ||
<h6> | ||
${title} | ||
</h6> | ||
<h6> | ||
${value} | ||
</h6> | ||
</div> | ||
<i class="pi pi-check"></i> | ||
</div> | ||
</div> | ||
</template> |
4 changes: 4 additions & 0 deletions
4
application/backend/src/main/resources/apps/typerefinery/components/content/tika/tika.html
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,4 @@ | ||
<sly data-sly-use.model="io.typerefinery.websight.models.components.Tika" | ||
data-sly-use.template="./template.html" | ||
data-sly-call="${template.tika @ title=model.title, value=model.value, badge=model.badge, icon=model.icon}"> | ||
</sly> |
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.