Skip to content

Commit 5e693e0

Browse files
authored
Merge pull request #31 from Deepika5698/master
Updated React samples
2 parents e83b62b + 17652e5 commit 5e693e0

File tree

894 files changed

+21594
-25022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

894 files changed

+21594
-25022
lines changed

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,6 @@
129129
"checkbox",
130130
"dropdown",
131131
"dropdown-button",
132-
null
132+
"virtualize"
133133
]
134134
}

index.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@
2727
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet"></link>
2828
<link rel="shortcut icon" href="favicon.ico" />
2929
<style id="themelink"></style>
30+
<link rel="stylesheet" href="./src/common/codemirror/lib/codemirror.css">
31+
<link rel="stylesheet" href="./src/common/codemirror/theme/mbo.css">
3032
<link rel="stylesheet" type="text/css" href="./styles/index.css" />
31-
<link rel="stylesheet" type="text/css" href="./src/common/lib/highlightjs/styles/default.css" />
32-
<link href="src/common/lib/content/codemirror.css" rel="stylesheet"></link>
33+
<script src="./src/common/codemirror/lib/codemirror.js"></script>
34+
<script src="./src/common/codemirror/mode/javascript/javascript.js"></script>
35+
<script src="./src/common/codemirror/mode/jsx/jsx.js"></script>
36+
<script src="./src/common/codemirror/mode/xml/xml.js"></script>
37+
<script src="./src/common/codemirror/mode/css/css.js"></script>
3338
<script>
3439
var orgin = location.origin;
3540
var baseref = location.href.split('#')[0].replace(orgin, '');
@@ -199,14 +204,22 @@
199204
<span class='sb-icons sb-theme-select sb-icon-icon-selection'></span>
200205
<span class="switch-text">Tailwind CSS Dark</span>
201206
</li>
202-
<li class='active' id="material">
207+
<li class='e-list' id="material">
203208
<span class='sb-icons sb-theme-select sb-icon-icon-selection'></span>
204209
<span class="switch-text">Material</span>
205210
</li>
206211
<li class="e-list" id="material-dark">
207212
<span class='sb-icons sb-theme-select sb-icon-icon-selection'></span>
208213
<span class="switch-text">Material Dark</span>
209214
</li>
215+
<li class='active' id="material3">
216+
<span class='sb-icons sb-theme-select sb-icon-icon-selection'></span>
217+
<span class="switch-text">Material 3</span>
218+
</li>
219+
<li class="e-list" id="material3-dark">
220+
<span class='sb-icons sb-theme-select sb-icon-icon-selection'></span>
221+
<span class="switch-text">Material 3 Dark</span>
222+
</li>
210223
<li id="fabric">
211224
<span class='sb-icons sb-theme-select sb-icon-icon-selection'></span>
212225
<span class="switch-text">Fabric</span>
@@ -255,6 +268,8 @@
255268
<option value="tailwind-dark">Tailwind CSS Dark</option>
256269
<option value="material">Material</option>
257270
<option value="material-dark">Material Dark</option>
271+
<option value="material3">Material 3</option>
272+
<option value="material3-dark">Material 3 Dark</option>
258273
<option value="fabric">Fabric</option>
259274
<option value="fabric-dark">Fabric Dark</option>
260275
<option value="bootstrap4">Bootstrap v4</option>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-react-samples",
3-
"version": "21.1.35",
3+
"version": "22.1.34",
44
"description": "Examples of React UI Components",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",
@@ -60,7 +60,7 @@
6060
"@types/marked": "^0.3.0",
6161
"@types/codemirror": "0.0.56",
6262
"marked": "^0.3.19",
63-
"codemirror": "^5.37.0",
63+
"codemirror": "^5.65.12",
6464
"tributejs": "^3.7.3"
6565
},
6666
"devDependencies": {

src/accordion/config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const AccordionSampleOrder: Object = [
22
{ 'path': 'accordion/default', 'component': 'Default', 'name': 'Default Functionalities', 'description': 'The sample demonstrates that default functionalities of the Accordion component which works by expand and collapse action in React platform.', 'order': '01', 'category': 'Accordion', 'api': '{ "AccordionComponent": ["items"] }' },
3-
{ 'path': 'accordion/ajax', 'component': 'AjaxContent', 'name': 'Ajax Content', 'description': 'The sample demonstrates how to load the content to the Accordion component from external sources using Ajax library in React platform.', 'order': '01', 'category': 'Accordion', 'api': '{ "AccordionComponent": ["expandMode", "expanding"] }' },
3+
{ 'path': 'accordion/templates', 'component': 'Templates', 'name': 'Templates', 'description': 'This sample demonstrates the template functionalities of the Accordion with an example of loading an Accordion content using content property in React platform.', 'order': '01', 'category': 'Accordion', 'api': '{ "AccordionComponent": ["expandMode", "expanding"] }' },
44
{ 'path': 'accordion/icon', 'component': 'Icons', 'name': 'Icons', 'description': 'The sample demonstrates how to represent pane headers with an icon in Accordion component which populates from items collection in React platform.', 'order': '01', 'category': 'Accordion' },
55
{ 'path': 'accordion/keyboard-interaction', 'component': 'KeyboardInteraction', 'name': 'Keyboard Interaction', 'description': 'The sample showcases the keyboard shortcuts applicable on Accordion component with details in React platform.', 'order': '01', 'category': 'Accordion', 'api': '{ "AccordionComponent": ["items"] }' }
66
]

src/accordion/default-functional.tsx

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,42 @@
11
import * as ReactDOM from 'react-dom';
22
import * as React from 'react';
3+
import { useEffect } from 'react';
34
import { AccordionComponent, AccordionItemDirective, AccordionItemsDirective } from '@syncfusion/ej2-react-navigations';
45
import { updateSampleSection } from '../common/sample-base';
56

6-
function Default() {
7-
React.useEffect(() => {
7+
const Default = () => {
8+
useEffect(() => {
89
updateSampleSection();
910
}, [])
1011

11-
function acrdnheader1() {
12+
const acrdnheader1 = () => {
1213
return (
13-
<div>
14-
ASP.NET
15-
</div>
14+
<div>ASP.NET</div>
1615
);
1716
}
18-
function acrdnheader2() {
17+
const acrdnheader2 = () => {
1918
return (
20-
<div>
21-
ASP.NET MVC
22-
</div>
19+
<div>ASP.NET MVC</div>
2320
);
2421
}
25-
function acrdnheader3() {
22+
const acrdnheader3 = () => {
2623
return (
27-
<div>
28-
JavaScript
29-
</div>
24+
<div>JavaScript</div>
3025
);
3126
}
32-
function acrdnContent1() {
27+
const acrdnContent1 = () => {
3328
return (
34-
<div>
35-
Microsoft ASP.NET is a set of technologies in the Microsoft .NET Framework for building Web applications and XML Web services. ASP.NET pages execute on the server and generate markup such as HTML, WML, or XML that is sent to a desktop or mobile browser. ASP.NET pages use a compiled,event-driven programming model that improves performance and enables the separation of application logic and user interface.
36-
</div>
29+
<div>Microsoft ASP.NET is a set of technologies in the Microsoft .NET Framework for building Web applications and XML Web services. ASP.NET pages execute on the server and generate markup such as HTML, WML, or XML that is sent to a desktop or mobile browser. ASP.NET pages use a compiled,event-driven programming model that improves performance and enables the separation of application logic and user interface.</div>
3730
);
3831
}
39-
function acrdnContent2() {
32+
const acrdnContent2 = () => {
4033
return (
41-
<div>
42-
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating Web applications.The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication.
43-
</div>
34+
<div>The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating Web applications.The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication.</div>
4435
);
4536
}
46-
function acrdnContent3() {
37+
const acrdnContent3 = () => {
4738
return (
48-
<div>
49-
JavaScript (JS) is an interpreted computer programming language.It was originally implemented as part of web browsers so that client-side scripts could interact with the user, control the browser, communicate asynchronously, and alter the document content that was displayed.More recently, however, it has become common in both game development and the creation of desktop applications.
50-
</div>
39+
<div>JavaScript (JS) is an interpreted computer programming language.It was originally implemented as part of web browsers so that client-side scripts could interact with the user, control the browser, communicate asynchronously, and alter the document content that was displayed.More recently, however, it has become common in both game development and the creation of desktop applications.</div>
5140
);
5241
}
5342
return (
@@ -62,7 +51,8 @@ function Default() {
6251
<AccordionItemDirective header={acrdnheader3} content={acrdnContent3} />
6352
</AccordionItemsDirective>
6453
</AccordionComponent>
65-
</div></div>
54+
</div>
55+
</div>
6656
<div id="action-description">
6757
<p>
6858
This sample demonstrates the default functionalities of the <code>Accordion</code>. Click on the <code>header</code> element to expand/collapse the corresponding Accordion panel, and displays its content.
@@ -75,12 +65,11 @@ function Default() {
7565
</p>
7666
<p>
7767
More information about Accordion can be found in this <a target="_blank"
78-
href="https://ej2.syncfusion.com/react/documentation/accordion/getting-started/">
79-
documentation</a> section.
68+
href="https://ej2.syncfusion.com/react/documentation/accordion/getting-started/">
69+
documentation</a> section.
8070
</p>
8171
</div>
8272
</div>
83-
8473
);
8574
}
8675
export default Default;

src/accordion/icon-functional.tsx

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,113 @@
11
import * as ReactDOM from 'react-dom';
22
import * as React from 'react';
3+
import { useEffect } from 'react';
34
import { AccordionComponent, AccordionItemDirective, AccordionItemsDirective } from '@syncfusion/ej2-react-navigations';
45
import { updateSampleSection } from '../common/sample-base';
56
import './accordion.component.css'
67

7-
function Icons() {
8-
React.useEffect(() => {
8+
const Icons = () => {
9+
useEffect(() => {
910
updateSampleSection();
1011
}, [])
1112

12-
function acrdnHeader1() {
13+
const acrdnHeader1 = () => {
1314
return (
1415
<div>Athletics</div>
1516
)
1617
}
17-
function acrdnHeader2() {
18+
const acrdnHeader2 = () => {
1819
return (
1920
<div>Water Games</div>
2021
)
2122
}
22-
function acrdnHeader3() {
23+
const acrdnHeader3 = () => {
2324
return (
2425
<div>Racing</div>
2526
)
2627
}
27-
function acrdnHeader4() {
28+
const acrdnHeader4 = () => {
2829
return (
2930
<div>Indoor Games</div>
3031
)
3132
}
32-
function athletics() {
33+
const athletics = () => {
3334
return(
3435
<div id="athletics">
35-
<li><span className='e-acrdn-icons e-content-icon marathon'></span>Marathon</li>
36-
<li><span className='e-acrdn-icons e-content-icon javelin'></span>Javelin Throw</li>
37-
<li><span className='e-acrdn-icons e-content-icon discus'></span>Discus Throw</li>
38-
<li><span className='e-acrdn-icons e-content-icon highjump'></span>High Jump</li>
39-
<li><span className='e-acrdn-icons e-content-icon longjump'></span>Long Jump</li>
36+
<li><span className='e-acrdn-icons e-content-icon marathon'></span>Marathon</li>
37+
<li><span className='e-acrdn-icons e-content-icon javelin'></span>Javelin Throw</li>
38+
<li><span className='e-acrdn-icons e-content-icon discus'></span>Discus Throw</li>
39+
<li><span className='e-acrdn-icons e-content-icon highjump'></span>High Jump</li>
40+
<li><span className='e-acrdn-icons e-content-icon longjump'></span>Long Jump</li>
4041
</div>
41-
);
42+
);
4243
}
43-
function water_games() {
44+
const water_games = () => {
4445
return(
4546
<div id="water_games">
46-
<li><span className='e-acrdn-icons e-content-icon dive'></span>Diving</li>
47-
<li><span className='e-acrdn-icons e-content-icon swimming'></span>Swimming</li>
48-
<li><span className='e-acrdn-icons e-content-icon marathan_swim'></span>Marathon Swimming</li>
49-
<li><span className='e-acrdn-icons e-content-icon sync_swim'></span>Synchronized Swimming</li>
50-
<li><span className='e-acrdn-icons e-content-icon waterpolo'></span>Water Polo</li>
51-
</div>
52-
);
47+
<li><span className='e-acrdn-icons e-content-icon dive'></span>Diving</li>
48+
<li><span className='e-acrdn-icons e-content-icon swimming'></span>Swimming</li>
49+
<li><span className='e-acrdn-icons e-content-icon marathan_swim'></span>Marathon Swimming</li>
50+
<li><span className='e-acrdn-icons e-content-icon sync_swim'></span>Synchronized Swimming</li>
51+
<li><span className='e-acrdn-icons e-content-icon waterpolo'></span>Water Polo</li>
52+
</div>
53+
);
5354
}
54-
function racing_games() {
55+
const racing_games = () => {
5556
return(
5657
<div id="racing_games">
57-
<li><span className='e-acrdn-icons e-content-icon cycle_BMX'></span>Cycling BMX</li>
58-
<li><span className='e-acrdn-icons e-content-icon cycle_Mountain'></span>Cycling Mountain Bike</li>
59-
<li><span className='e-acrdn-icons e-content-icon cycle'></span>Cycle Racing</li>
60-
<li><span className='e-acrdn-icons e-content-icon sailing'></span>Sailing</li>
61-
<li><span className='e-acrdn-icons e-content-icon rowing'></span>Rowing</li>
62-
</div>
63-
);
58+
<li><span className='e-acrdn-icons e-content-icon cycle_BMX'></span>Cycling BMX</li>
59+
<li><span className='e-acrdn-icons e-content-icon cycle_Mountain'></span>Cycling Mountain Bike</li>
60+
<li><span className='e-acrdn-icons e-content-icon cycle'></span>Cycle Racing</li>
61+
<li><span className='e-acrdn-icons e-content-icon sailing'></span>Sailing</li>
62+
<li><span className='e-acrdn-icons e-content-icon rowing'></span>Rowing</li>
63+
</div>
64+
);
6465
}
6566

66-
function indoor_games() {
67-
return(
68-
<div id="indoor_games">
69-
<li><span className='e-acrdn-icons e-content-icon tennis'></span>Table Tennis</li>
70-
<li><span className='e-acrdn-icons e-content-icon badminton'></span>Badminton</li>
71-
<li><span className='e-acrdn-icons e-content-icon volleyball'></span>Volleyball</li>
72-
<li><span className='e-acrdn-icons e-content-icon boxing'></span>Boxing</li>
73-
<li><span className='e-acrdn-icons e-content-icon swimming_In'></span>Swimming</li>
74-
</div>
75-
);
76-
}
67+
const indoor_games = () => {
68+
return(
69+
<div id="indoor_games">
70+
<li><span className='e-acrdn-icons e-content-icon tennis'></span>Table Tennis</li>
71+
<li><span className='e-acrdn-icons e-content-icon badminton'></span>Badminton</li>
72+
<li><span className='e-acrdn-icons e-content-icon volleyball'></span>Volleyball</li>
73+
<li><span className='e-acrdn-icons e-content-icon boxing'></span>Boxing</li>
74+
<li><span className='e-acrdn-icons e-content-icon swimming_In'></span>Swimming</li>
75+
</div>
76+
);
77+
}
7778
return (
7879
<div className='control-pane'>
7980
<div className='control-section accordion-control-section'>
8081
<div className= 'control Accordion-sample' style = {{margin: '25px 0' }}>
81-
{/* Render the Accoridon Component */}
82-
<AccordionComponent>
83-
<AccordionItemsDirective>
82+
{/* Render the Accoridon Component */}
83+
<AccordionComponent>
84+
<AccordionItemsDirective>
8485
<AccordionItemDirective header= {acrdnHeader1} iconCss='e-athletics e-acrdn-icons' content={ athletics } expanded={true} />
8586
<AccordionItemDirective header= {acrdnHeader2} iconCss='e-water-game e-acrdn-icons' content={ water_games } />
8687
<AccordionItemDirective header= {acrdnHeader3} iconCss='e-racing-games e-acrdn-icons'content={ racing_games } />
8788
<AccordionItemDirective header= {acrdnHeader4} iconCss='e-indoor-games e-acrdn-icons' content={ indoor_games } />
88-
</AccordionItemsDirective>
89-
</AccordionComponent>
90-
</div></div>
89+
</AccordionItemsDirective>
90+
</AccordionComponent>
91+
</div>
92+
</div>
9193
<div id="action-description">
92-
<p>
93-
This sample demonstrates the icon representation of the <code>Accordion</code>. Click on the header element to expand/collapse the corresponding Accordion panel, and displays its content.
94-
</p>
95-
</div>
94+
<p>
95+
This sample demonstrates the icon representation of the <code>Accordion</code>. Click on the header element to expand/collapse the corresponding Accordion panel, and displays its content.
96+
</p>
97+
</div>
9698
<div id='description'>
97-
<p>
98-
<p>
99-
This Accordion is populated with icons which renders by mapping the <code>iconCss</code> field. This sample illustrates
100-
the some of the games list.
101-
</p>
102-
<p>
103-
More information about Accordion can be found in this <a target="_blank" href="https://ej2.syncfusion.com/react/documentation/accordion/getting-started/">
104-
documentation</a> section.
105-
</p>
106-
</p>
99+
<p>
100+
<p>
101+
This Accordion is populated with icons which renders by mapping the <code>iconCss</code> field. This sample illustrates
102+
the some of the games list.
103+
</p>
104+
<p>
105+
More information about Accordion can be found in this <a target="_blank" href="https://ej2.syncfusion.com/react/documentation/accordion/getting-started/">
106+
documentation</a> section.
107+
</p>
108+
</p>
107109
</div>
108110
</div>
109-
110111
);
111112
}
112113
export default Icons;

0 commit comments

Comments
 (0)