-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation: Transfer demos to TS #2825
Merged
ivanblinov2k17
merged 32 commits into
DevExpress:23_2
from
ivanblinov2k17:ts-navigation
Nov 13, 2023
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
0af2bd3
Typestat config created + files renamed
ivanblinov2k17 a6e95c7
Enhance types with typestat
ivanblinov2k17 d66739b
Improve typings + add missing @types/react-dom package
ivanblinov2k17 4e6d107
Typings improvments
ivanblinov2k17 9a5e59c
fix cannot use jsx components in vscode
ivanblinov2k17 8d718b9
Types improv + tsconf changes to remove component is not tsx problem
ivanblinov2k17 249269c
Merge remote-tracking branch 'DevExtreme/23_2' into ts-navigation
ivanblinov2k17 ad123e2
Check tsc version on CI
ivanblinov2k17 b624d3b
Revert printing tsc version on CI
ivanblinov2k17 6d48643
Revert TSConfig changes
ivanblinov2k17 51a4869
Generate JS from ts
ivanblinov2k17 71c90e9
Revert bad js generation result for DateBox and DateRangeBox
ivanblinov2k17 aafc163
Fix sysemJs index.js import to tsx in index.html
ivanblinov2k17 a02ab86
Final TS enhansments
ivanblinov2k17 c6c4145
generate js
ivanblinov2k17 5aa81e3
Exclude Vue from ts config because it's polluting react JSX with wron…
ivanblinov2k17 53f55ce
Revert excluding vue from ts
ivanblinov2k17 47e97a7
Merge branch '23_2' into ts-navigation
ivanblinov2k17 223f334
Merge branch '23_2' into ts-navigation
ivanblinov2k17 be8b1b4
Update ts for tabs demos (merge)
ivanblinov2k17 aafa521
Fix minor errors
ivanblinov2k17 573ef9f
Missed extension in tabpanel
ivanblinov2k17 39f86ad
Merge branch '23_2' into ts-navigation
ivanblinov2k17 7a573fa
Merge branch '23_2' into ts-navigation
ivanblinov2k17 8fd51fa
Drawer: navigationList fix file extension
ivanblinov2k17 63addb4
Merge branch '23_2' into ts-navigation
ivanblinov2k17 e3d6b49
Fix generate-js
ivanblinov2k17 e619400
Fix missing merge changes
ivanblinov2k17 282da3e
Merge branch '23_2' into ts-navigation
ivanblinov2k17 294a4e1
Fix styles generation
ivanblinov2k17 1d425f1
Merge branch '23_2' into ts-navigation
ivanblinov2k17 6e65eb5
generate js
ivanblinov2k17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
...vigationRightToLeftSupport/React/index.js → .../Demos/Accordion/Overview/React/index.tsx
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,116 @@ | ||
import React from 'react'; | ||
import Accordion from 'devextreme-react/accordion'; | ||
import CheckBox from 'devextreme-react/check-box'; | ||
import TagBox from 'devextreme-react/tag-box'; | ||
import Slider, { Tooltip, Label } from 'devextreme-react/slider'; | ||
import service from './data.js'; | ||
import CustomTitle from './CustomTitle.js'; | ||
import CustomItem from './CustomItem.js'; | ||
|
||
const companyLabel = { 'aria-label': 'Company' }; | ||
const companies = service.getCompanies(); | ||
const App = () => { | ||
const [selectedItems, setSelectedItems] = React.useState([companies[0]]); | ||
const [multiple, setMultiple] = React.useState(false); | ||
const [collapsible, setCollapsible] = React.useState(false); | ||
const [animationDuration, setAnimationDuration] = React.useState(300); | ||
const selectionChanged = React.useCallback( | ||
(e) => { | ||
let newItems = [...selectedItems]; | ||
e.removedItems.forEach((item) => { | ||
const index = newItems.indexOf(item); | ||
if (index >= 0) { | ||
newItems.splice(index, 1); | ||
} | ||
}); | ||
if (e.addedItems.length) { | ||
newItems = [...newItems, ...e.addedItems]; | ||
} | ||
setSelectedItems(newItems); | ||
}, | ||
[selectedItems, setSelectedItems], | ||
); | ||
const selectedItemsChanged = React.useCallback( | ||
(e) => { | ||
setSelectedItems(e.value); | ||
}, | ||
[setSelectedItems], | ||
); | ||
const multipleChanged = React.useCallback( | ||
(e) => { | ||
setMultiple(e.value); | ||
}, | ||
[setMultiple], | ||
); | ||
const collapsibleChanged = React.useCallback( | ||
(e) => { | ||
setCollapsible(e.value); | ||
}, | ||
[setCollapsible], | ||
); | ||
const animationDurationChanged = React.useCallback( | ||
(e) => { | ||
setAnimationDuration(e.value); | ||
}, | ||
[setAnimationDuration], | ||
); | ||
return ( | ||
<div id="accordion"> | ||
<Accordion | ||
dataSource={companies} | ||
collapsible={collapsible} | ||
multiple={multiple} | ||
animationDuration={animationDuration} | ||
selectedItems={selectedItems} | ||
onSelectionChanged={selectionChanged} | ||
itemTitleRender={CustomTitle} | ||
itemRender={CustomItem} | ||
id="accordion-container" | ||
/> | ||
<div className="options"> | ||
<div className="caption">Options</div> | ||
<div className="option"> | ||
<CheckBox | ||
text="Multiple enabled" | ||
value={multiple} | ||
onValueChanged={multipleChanged} | ||
/> | ||
</div> | ||
<div className="option"> | ||
<CheckBox | ||
text="Collapsible enabled" | ||
value={collapsible} | ||
onValueChanged={collapsibleChanged} | ||
/> | ||
</div> | ||
<div className="option"> | ||
<span>Animation duration</span> | ||
<Slider | ||
min={0} | ||
max={1000} | ||
value={animationDuration} | ||
onValueChanged={animationDurationChanged} | ||
> | ||
<Tooltip | ||
enabled={true} | ||
position="bottom" | ||
/> | ||
<Label visible={true} /> | ||
</Slider> | ||
</div> | ||
<div className="option"> | ||
<span className="caption">Selected Items</span> | ||
<TagBox | ||
dataSource={companies} | ||
displayExpr="CompanyName" | ||
value={selectedItems} | ||
inputAttr={companyLabel} | ||
onValueChanged={selectedItemsChanged} | ||
disabled={!multiple} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export default App; |
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,34 @@ | ||
import React from 'react'; | ||
|
||
export default function CustomItem(data) { | ||
return ( | ||
<div> | ||
<div> | ||
<p> | ||
<b>{data.City} </b>(<span>{data.State}</span>) | ||
</p> | ||
<p> | ||
<span>{data.Zipcode} </span> | ||
<span>{data.Address}</span> | ||
</p> | ||
</div> | ||
<div> | ||
<p> | ||
Phone: <b>{data.Phone}</b> | ||
</p> | ||
<p> | ||
Fax: <b>{data.Fax}</b> | ||
</p> | ||
<p> | ||
Website:{' '} | ||
<a | ||
href={data.Website} | ||
target="_blank" | ||
> | ||
{data.Website} | ||
</a> | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
} |
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,5 @@ | ||
import React from 'react'; | ||
|
||
export default function CustomTitle(data) { | ||
return <div className="header">{data.CompanyName}</div>; | ||
} |
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,51 @@ | ||
const companies = [ | ||
{ | ||
ID: 1, | ||
CompanyName: 'Super Mart of the West', | ||
Address: '702 SW 8th Street', | ||
City: 'Bentonville', | ||
State: 'Arkansas', | ||
Zipcode: 72716, | ||
Phone: '(800) 555-2797', | ||
Fax: '(800) 555-2171', | ||
Website: 'http://www.nowebsitesupermart.com', | ||
}, | ||
{ | ||
ID: 2, | ||
CompanyName: 'Electronics Depot', | ||
Address: '2455 Paces Ferry Road NW', | ||
City: 'Atlanta', | ||
State: 'Georgia', | ||
Zipcode: 30339, | ||
Phone: '(800) 595-3232', | ||
Fax: '(800) 595-3231', | ||
Website: 'http://www.nowebsitedepot.com', | ||
}, | ||
{ | ||
ID: 3, | ||
CompanyName: 'K&S Music', | ||
Address: '1000 Nicllet Mall', | ||
City: 'Minneapolis', | ||
State: 'Minnesota', | ||
Zipcode: 55403, | ||
Phone: '(612) 304-6073', | ||
Fax: '(612) 304-6074', | ||
Website: 'http://www.nowebsitemusic.com', | ||
}, | ||
{ | ||
ID: 4, | ||
CompanyName: "Tom's Club", | ||
Address: '999 Lake Drive', | ||
City: 'Issaquah', | ||
State: 'Washington', | ||
Zipcode: 98027, | ||
Phone: '(800) 955-2292', | ||
Fax: '(800) 955-2293', | ||
Website: 'http://www.nowebsitetomsclub.com', | ||
}, | ||
]; | ||
export default { | ||
getCompanies() { | ||
return companies; | ||
}, | ||
}; |
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,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>DevExtreme Demo</title> | ||
<meta | ||
http-equiv="X-UA-Compatible" | ||
content="IE=edge" | ||
/> | ||
<meta | ||
http-equiv="Content-Type" | ||
content="text/html; charset=utf-8" | ||
/> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="../../../../../node_modules/devextreme-dist/css/dx.light.css" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="styles.css" | ||
/> | ||
|
||
<script src="../../../../../node_modules/core-js/client/shim.min.js"></script> | ||
<script src="../../../../../node_modules/systemjs/dist/system.js"></script> | ||
<script | ||
type="text/javascript" | ||
src="config.js" | ||
></script> | ||
<script type="text/javascript"> | ||
System.import("./index.js"); | ||
</script> | ||
</head> | ||
|
||
<body class="dx-viewport"> | ||
<div class="demo-container"> | ||
<div id="app"></div> | ||
</div> | ||
</body> | ||
</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,5 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App.js'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('app')); |
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 @@ | ||
#accordion { | ||
height: 700px; | ||
} | ||
|
||
#accordion .header { | ||
font-size: 20px; | ||
} | ||
|
||
#accordion .header, | ||
#accordion p { | ||
margin: 0; | ||
} | ||
|
||
#accordion-container { | ||
margin-right: 400px; | ||
} | ||
|
||
.dx-theme-material #accordion .dx-accordion-item-title { | ||
display: flex; | ||
} | ||
|
||
.dx-theme-material #accordion .header { | ||
align-self: center; | ||
} | ||
|
||
.options { | ||
padding: 20px; | ||
position: absolute; | ||
bottom: 0; | ||
right: 0; | ||
width: 340px; | ||
top: 0; | ||
background-color: rgba(191, 191, 191, 0.15); | ||
} | ||
|
||
.options > .caption { | ||
font-weight: 500; | ||
font-size: 18px; | ||
} | ||
|
||
.option { | ||
margin-top: 10px; | ||
} | ||
|
||
.option > .caption { | ||
margin-top: 10px; | ||
display: inline-block; | ||
} | ||
|
||
.option > .dx-tagbox { | ||
margin-top: 2px; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Potentially unsafe external link Medium