Skip to content

Commit

Permalink
Merge branch 'main' into evshi/execute-code
Browse files Browse the repository at this point in the history
  • Loading branch information
anserwaseem authored Sep 12, 2024
2 parents cc02a94 + 0f9525d commit dd04e24
Show file tree
Hide file tree
Showing 24 changed files with 638 additions and 222 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-hornets-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ensembleui/react-runtime": patch
---

hotfix screen level style support
6 changes: 6 additions & 0 deletions .changeset/cyan-bananas-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ensembleui/react-kitchen-sink": patch
"@ensembleui/react-runtime": patch
---

modernize PopupMenu widget
6 changes: 6 additions & 0 deletions .changeset/gold-spies-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ensembleui/react-kitchen-sink": patch
"@ensembleui/react-runtime": patch
---

Added support to customize nooption in search widget
5 changes: 5 additions & 0 deletions .changeset/great-pigs-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ensembleui/react-runtime": patch
---

Remove navigation glitch from sidebar menu
5 changes: 5 additions & 0 deletions .changeset/healthy-readers-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ensembleui/react-framework": patch
---

ensure user atom overwrite keys
6 changes: 6 additions & 0 deletions .changeset/metal-pugs-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ensembleui/react-kitchen-sink": patch
"@ensembleui/react-runtime": patch
---

Fix datagrid rows deselected issue
5 changes: 5 additions & 0 deletions .changeset/neat-wasps-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ensembleui/react-runtime": patch
---

fix required field validation with form.validate
6 changes: 6 additions & 0 deletions .changeset/popular-dryers-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ensembleui/react-kitchen-sink": patch
"@ensembleui/react-runtime": patch
---

fix Datagrid's defaultSelectedRowKeys
5 changes: 5 additions & 0 deletions .changeset/rare-meals-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ensembleui/react-runtime": patch
---

Added support of form.onChange
6 changes: 6 additions & 0 deletions .changeset/swift-elephants-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ensembleui/react-kitchen-sink": patch
"@ensembleui/react-runtime": patch
---

added support for screen lavel font colour support
14 changes: 11 additions & 3 deletions apps/kitchen-sink/src/ensemble/screens/forms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ View:
onResponse:
executeCode: |
console.log('getData', response.body);
header:
title:
Header:
Expand All @@ -45,7 +45,7 @@ View:
options:
height: 50px
width: 80px

- Icon:
- Text:
styles:
Expand All @@ -67,6 +67,9 @@ View:
styles:
gap: 8px
labelPosition: top
onChange:
executeCode: |
console.log({fields})
onSubmit:
executeCode:
body: |
Expand Down Expand Up @@ -151,7 +154,6 @@ View:
maxLength: 2
validator:
required: true
minLength: 4
maxLength: 2
label: Text input with min and max length
- TextInput:
Expand Down Expand Up @@ -231,6 +233,12 @@ View:
label: submit form by id
onTap:
executeCode: myForm.submit()
- Button:
label: Validate form
onTap:
executeCode: myForm.validate()
- Text:
text: Validation result ${myForm.isValid}

- Text:
styles:
Expand Down
3 changes: 2 additions & 1 deletion apps/kitchen-sink/src/ensemble/screens/home.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ View:
Header:

styles:
className: topView
scrollableView: true
backgroundColor: ${colors.primary['200']}

Expand Down Expand Up @@ -103,7 +104,7 @@ View:
name: Settings
onItemSelect:
executeCode: |
ensemble.setTheme(theme)
ensemble.setTheme(value.theme)
- Text:
styles:
Expand Down
204 changes: 156 additions & 48 deletions apps/kitchen-sink/src/ensemble/screens/widgets.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
View:
styles:
scrollableView: true
onLoad:
executeCode:
body: |-
ensemble.storage.set('activeIndex',3);
ensemble.storage.set('loaderStat', false);
ensemble.storage.set("skip", 10)
ensemble.storage.set("iconSize", 40)
ensemble.storage.set("iconName", "Abc")
ensemble.storage.set("iconName", "MoreHoriz")
onComplete:
invokeApi:
name: getDummyProductsByPaginate
inputs:
skip: 0
limit: 10
limit: 17
onResponse:
executeCode: |
const res = response.body.products;
Expand All @@ -25,20 +26,78 @@ View:
inputs:
message: "Inputs to header widget"

styles:
scrollableView: true

body:
Column:
crossAxis: stretch
gap: 12px
styles:
names: page
children:
- Icon:
name: ArrowBack
onTap:
navigateBack:
- Row:
styles:
crossAxis: center
mainAxis: spaceBetween
children:
- Icon:
name: ArrowBack
onTap:
navigateBack:
- PopupMenu:
showDivider: true
enabled: ${ensemble.storage.get("dummyProducts")?.at(0)?.id === 1}
trigger: hover
styles:
height: 200px
onItemSelect:
showToast:
message: Your selected brand's ${value?.product ? "rating" :"price"} is ${value?.product?.rating || value?.value}
item-template:
data:
[
'${ensemble.storage.get("dummyProducts")[0]}',
'${ensemble.storage.get("dummyProducts")[2]}',
'${ensemble.storage.get("dummyProducts")[4]}',
]
name: product
template:
Text:
text: ${product.rating} stars
items:
- label: All Clients
value: all clients
- label: Client Name
value: client name
- label: Location Group
type: group
items:
- label: Location Name 1
value: location name 1
visible: false
- label: Location Name 2
value: location name 2
enabled: false
- label: Location Name 3
value: location name 3
- label: Client Menu
items:
- label: Sub Client 1
value: sub client 1
- label: Child Client Menu
items: "${getDummyProductsByPaginate.body.products.map(p => ({label: p.title, value: p.price, visible: p.price > 10, enabled: p.rating < 4})) ?? []}"
- label: Sub Client 2
value: sub client 2
widget:
Icon:
name: ${ensemble.storage.get("iconName")}
color: "#365898"
styles:
padding: 5
borderWidth: 1
borderRadius: 6
cursor: pointer
borderColor: "#DFE1E6"
backgroundColor: white

- Row:
gap: 4px
children:
Expand Down Expand Up @@ -75,32 +134,62 @@ View:
- Avatar:
name: " 4Dr. cabin4 i "

- Lottie:
id: MyLottie
source: https://lottie.host/3568da34-6083-42fc-a254-74d9c1e15b2f/wcVmO2igxm.json
repeat: false
autoPlay: true
- Row:
styles:
margin: 20px
height: 200px
backgroundColor: "#f0f0f0"
width: 200px
transform: rotate(1deg)
onTap:
executeCode: |-
console.log("Tapped");
onForward:
executeCode: |-
console.log("Forwarded");
onReverse:
executeCode: |-
console.log("Reversed");
onPause:
executeCode: |-
console.log("Paused");
onComplete:
executeCode: |-
console.log("Completed");
mainAxis: spaceBetween
crossAxis: center
children:
- Lottie:
id: MyLottie
source: https://lottie.host/3568da34-6083-42fc-a254-74d9c1e15b2f/wcVmO2igxm.json
repeat: false
autoPlay: true
styles:
margin: 20px
height: 200px
backgroundColor: "#f0f0f0"
width: 200px
transform: rotate(1deg)
onTap:
executeCode: |-
console.log("Tapped");
onForward:
executeCode: |-
console.log("Forwarded");
onReverse:
executeCode: |-
console.log("Reversed");
onPause:
executeCode: |-
console.log("Paused");
onComplete:
executeCode: |-
console.log("Completed");
- PopupMenu:
trigger: contextMenu
styles:
backgroundColor: ${colors.gray['50']}
onItemSelect:
showToast:
message: navigated to ${value.str}
item-template:
data: ["File", "Edit", "View", "Settings", "Help"]
name: str
template:
Row:
children:
- Icon:
name: NavigateNext
- Text:
text: ${str}
widget:
Text:
text: Right Click here
styles:
color: ${colors.gray['700']}
backgroundColor: ${colors.gray['100']}
padding: 100px
borderRadius: 12px

- Row:
styles:
Expand Down Expand Up @@ -287,6 +376,8 @@ View:
widget:
DataGrid:
id: "myDataGridExample2"
allowSelection: true
defaultSelectedRowKeys: [5, 6]
styles:
headerStyle:
backgroundColor: "white"
Expand All @@ -295,23 +386,30 @@ View:
hasDivider: true
borderBottom: false
DataColumns: ["id", "title", "description"]
pageSize: 10
pageSize: 17
totalRows: 100
onRowsSelected:
executeCode: |
console.log(selectedRowKeys, selectedRows)
onPageChange:
invokeAPI:
name: getDummyProductsByPaginate
inputs:
skip: ${ensemble.storage.get('skip') * (page - 1)}
limit: ${pageSize}
onResponse:
executeCode: |
const prevItem = ensemble.storage.get("dummyProducts")
const res = response.body.products;
ensemble.storage.set("dummyProducts", [...res])
executeCode:
body: |
myDataGridExample2.setRowsSelected([]);
onComplete:
invokeAPI:
name: getDummyProductsByPaginate
inputs:
skip: ${ensemble.storage.get('skip') * (page - 1)}
limit: ${pageSize}
onResponse:
executeCode: |
const prevItem = ensemble.storage.get("dummyProducts")
const res = response.body.products;
ensemble.storage.set("dummyProducts", [...res])
item-template:
data: ${ensemble.storage.get('dummyProducts')}
name: dummyData
key: ${dummyData.key}
key: ${dummyData.id}
template:
DataRow:
item-template:
Expand All @@ -320,7 +418,17 @@ View:
template:
Text:
text: ${value}

- Button:
label: get selected rows
onTap:
executeCode: |
console.log(myDataGridExample2.rowsSelected)
- Button:
label: select first 3 rows
onTap:
executeCode: |
const keys = ensemble.storage.get('dummyProducts').map(dp => dp.id);
myDataGridExample2.setRowsSelected(keys.slice(0, 3));
- Card:
styles:
maxWidth: unset
Expand Down
Loading

0 comments on commit dd04e24

Please sign in to comment.