Skip to content

Commit ceca417

Browse files
Merge pull request #3140 from telerik/dependabot/npm_and_yarn/examples/kendo-react-sales-dashboard/kendo-dependencies-675d12032a
chore: bump the kendo-dependencies group across 1 directory with 12 updates
2 parents 18c3644 + 40e746b commit ceca417

File tree

3 files changed

+35
-43
lines changed

3 files changed

+35
-43
lines changed

examples/kendo-react-sales-dashboard/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
"dependencies": {
66
"@progress/kendo-data-query": "^1.7.0",
77
"@progress/kendo-drawing": "^1.21.1",
8-
"@progress/kendo-react-buttons": "^10.0.0",
9-
"@progress/kendo-react-charts": "^10.0.0",
10-
"@progress/kendo-react-dateinputs": "^10.0.0",
11-
"@progress/kendo-react-dialogs": "^10.0.0",
12-
"@progress/kendo-react-dropdowns": "^10.0.0",
13-
"@progress/kendo-react-grid": "^10.0.0",
14-
"@progress/kendo-react-inputs": "^10.0.0",
15-
"@progress/kendo-react-intl": "^10.0.0",
16-
"@progress/kendo-react-layout": "^10.0.0",
17-
"@progress/kendo-react-pdf": "^10.0.0",
18-
"@progress/kendo-react-ripple": "^10.0.0",
19-
"@progress/kendo-theme-material": "^10.0.1",
8+
"@progress/kendo-react-buttons": "^11.0.0",
9+
"@progress/kendo-react-charts": "^11.0.0",
10+
"@progress/kendo-react-dateinputs": "^11.0.0",
11+
"@progress/kendo-react-dialogs": "^11.0.0",
12+
"@progress/kendo-react-dropdowns": "^11.0.0",
13+
"@progress/kendo-react-grid": "^11.0.0",
14+
"@progress/kendo-react-inputs": "^11.0.0",
15+
"@progress/kendo-react-intl": "^11.0.0",
16+
"@progress/kendo-react-layout": "^11.0.0",
17+
"@progress/kendo-react-pdf": "^11.0.0",
18+
"@progress/kendo-react-ripple": "^11.0.0",
19+
"@progress/kendo-theme-material": "^11.0.2",
2020
"hammerjs": "^2.0.8",
2121
"react": "^18.2.0",
2222
"react-dom": "^18.2.0"

examples/kendo-react-sales-dashboard/src/App.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ class App extends Component {
8282
let headerText = this.state.value.replace('Sales','');
8383
return (
8484
<Ripple>
85-
<div className="buttons-right mt-1">
86-
<Button themeColor={'primary'} onClick={this.handleShare} className='mr-2'>Share</Button>
87-
<Button onClick={this.handlePDFExport}>Export to PDF</Button>
88-
</div>
8985
<div className="app-container" ref={(app) => this.app = app}>
9086
<div className="row">
9187
<div className="col-xs-9 col-sm-9 col-md-9 col-lg-9 col-xl-9">
9288
<h1>Sales | {headerText}</h1>
93-
</div>
89+
</div>
90+
<div className="buttons-right mt-1">
91+
<Button themeColor={'primary'} onClick={this.handleShare} className='mr-2'>Share</Button>
92+
<Button onClick={this.handlePDFExport}>Export to PDF</Button>
93+
</div>
9494
</div>
9595
<div className="row">
9696
<div className="col-xs-3 col-sm-3 col-md-3 col-lg-3 col-xl-3">

examples/kendo-react-sales-dashboard/src/components/GridContainer.jsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { Grid, GridColumn as Column } from '@progress/kendo-react-grid';
33
import { Sparkline } from '@progress/kendo-react-charts';
4-
import { process } from '@progress/kendo-data-query';
4+
import { Checkbox } from '@progress/kendo-react-inputs';
55

66
class SparkLineChartCell extends React.Component {
77
render (){
@@ -11,52 +11,44 @@ class SparkLineChartCell extends React.Component {
1111
}
1212
}
1313

14+
class ActiveCell extends React.Component {
15+
render() {
16+
console.log(this.props.dataItem);
17+
return (
18+
<td><Checkbox disabled defaultChecked={this.props.dataItem[this.props.field]} /></td>
19+
)
20+
}
21+
}
22+
1423
export default class GridContainer extends React.Component {
1524

16-
state = {
17-
dataState:{
18-
sort:[{
19-
field: "UnitPrice",
20-
dir:"asc"
21-
}]
22-
}
23-
}
2425
processData = (data) => {
2526
data.forEach(item => {
2627
item.PriceHistory = Array.from({length: 40}, () => Math.floor(Math.random() * 100));
2728
return item
2829
})
29-
return process(data,this.state.dataState);
30+
return data;
3031
}
3132

32-
handleDataStateChange = (e) => {
33-
this.setState({
34-
dataState: e.dataState
35-
})
36-
}
3733

3834
render() {
3935
return (
4036
<div>
4137
<Grid
4238
style={{ height: '300px' }}
4339
data={this.processData(this.props.data)}
44-
{...this.state.dataState}
45-
onDataStateChange={this.handleDataStateChange}
40+
defaultSort={[{
41+
field: "UnitPrice",
42+
dir:"asc"
43+
}]}
4644
sortable
4745
>
4846
<Column field="ProductID" title="ID" sortable={false} width="40px"/>
49-
<Column field="ProductName" title="Name" />
47+
<Column field="ProductName" title="Name" />
5048
<Column field="UnitPrice" title="Price" width="100px" />
5149
<Column field="UnitsInStock" title="In stock" sortable={false} width="100px"/>
52-
<Column field="PriceHistory" title="Price history" cell={SparkLineChartCell}sortable={false} width="200px"/>
53-
<Column field="Discontinued" title="Active" sortable={false} width="100px"
54-
cell={(props) => (
55-
<td>
56-
<input type="checkbox" disabled className="k-checkbox" defaultChecked={props.dataItem[props.field]} />
57-
<label className="k-checkbox-label"></label>
58-
</td>
59-
)} />
50+
<Column field="PriceHistory" title="Price history" cells={{ data: SparkLineChartCell }} sortable={false} width="200px"/>
51+
<Column field="Discontinued" title="Active" sortable={false} width="70px" cells={{ data: ActiveCell }} />
6052
</Grid>
6153
</div>
6254
);

0 commit comments

Comments
 (0)