Skip to content

Commit 7be7f6b

Browse files
author
pipeline
committed
v24.2.3 is released
1 parent 4d8786a commit 7be7f6b

File tree

87 files changed

+1146
-1951
lines changed

Some content is hidden

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

87 files changed

+1146
-1951
lines changed

README.md

Lines changed: 204 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,217 @@
1-
# Syncfusion React Component Demo Samples
1+
# React Sample Configuration
22

3-
Welcome to the demo samples repository for Syncfusion React components! This repository contains a collection of sample applications showcasing the usage of various Syncfusion components in a React environment.
3+
## Adding your sample folder
4+
Create new folder in 'src' location and name the folder as control name for example "grid” it is control name.
45

5-
## Prerequisites
6+
_Note: Do not use whitespace at any cause in folder’s name. Use “-” instead of space._
67

7-
- [Node.js](https://nodejs.org/en) - `v16+`
8+
## Adding the sample
89

9-
## Run the samples
10+
Add the sample component tsx file in the sample folder.Below steps are need to be considered on sample creation
1011

11-
To run the sample applications locally, follow these steps
12+
* Sample component must extend the "SampleBase" component class from the path "src/common/sample-base" file.
13+
* Sample tag must be enclosed between the "control-section" div.
14+
* In all samples description is need to be added. Add sample description within the div tag with id as **description**.
1215

13-
1. Install the required dependencies using npm
16+
```javascript
17+
import * as ReactDOM from 'react-dom';
18+
import * as React from 'react';
19+
import { SampleBase } from '../common/sample-base';
20+
export class Default extends SampleBase<{}, {}> {
21+
22+
render() {
23+
return (
24+
<div className = 'control-pane'>
25+
<div className='control-section'>
26+
//sample component tags
27+
</div>
28+
<div id="description">
29+
// sample description
30+
</div>
31+
</div>
32+
)
33+
}
34+
}
1435

15-
```bash
36+
```
37+
Refer the [sample](https://github.com/syncfusion/ej2-react-samples/blob/master/src/grid/default.tsx) for example sample component.
38+
39+
Note: Do not use whitespace at any cause in file’s name. Use “-” instead of space.
40+
41+
## Adding property section
42+
To add the "propertypane” in the sample use tag `PropertyPane` from "common/property-pane" .Configure your sample properties as like below code snippet.
43+
44+
```
45+
<PropertyPane title='Properties'>
46+
<table id="property" title="Properties" className='property-panel-table' style={{ width: '100%' }}>
47+
<tr>
48+
<td style={{ width: '30%' }}>
49+
<div className="col-md-4" style={{ paddingTop: "8px" }}>
50+
GridLines
51+
</div>
52+
</td>
53+
<td style={{ width: '70%', paddingRight: '10px' }}>
54+
<div>
55+
<select id="ddl" name="ddl" onChange={this.change.bind(this)} className="form-control" style={{ padding: "6px" }} ref={d => this.dropElement = d}>
56+
<option value="default">Default</option>
57+
<option value="both">Both</option>
58+
<option value="none">None</option>
59+
<option value="horizontal">Horizontal</option>
60+
<option value="vertical">Vertical</option>
61+
</select>
62+
</div>
63+
</td>
64+
</tr>
65+
</table>
66+
</PropertyPane>
67+
68+
```
69+
Refer the [PropertyPanesample](https://github.com/syncfusion/ej2-react-samples/blob/master/src/grid/adaptive.tsx) for propertyPane example.
70+
71+
## Add Routing for your sample
72+
73+
Create the "config.tsx” file inside of your control folder.Configure your "config.tsx file" file as like below code snippet.
74+
75+
```
76+
export const GridSampleOrder:Object = [
77+
{ 'path': 'grid/default', 'component':'Default', 'name': 'Default Functionalities', 'order': '01', 'category': 'Grid' },
78+
{ 'path': 'grid/gridlines', 'component':'GridLines', 'name': 'GridLines', 'order': '01', 'category': 'Grid', hideOnDevice: true }
79+
]
80+
81+
```
82+
83+
**Fields Description:**
84+
85+
* _path :_ Specifies the sample router path. Path must be same as "sampleFolderName/sampleFileName".
86+
87+
* _component :_ Specifies the name of the sample component.
88+
89+
* _name :_ Specifies the sample name to be displayed.
90+
91+
* _order :_ Specifies the order in which sample to be displayed.
92+
93+
* _category :_ Specifies the sample category.
94+
95+
*Note: set **hideOnDevice** as true if you want to hide a sample in devices.*
96+
97+
## Configure Sample List
98+
99+
Add your samples in “samplelist.tsx” located in “/src/common” folder
100+
1. Import your sampleOrder array from the component config file.
101+
2. Add your samples in samplesList as Like below
102+
103+
```
104+
import * as React from 'react';
105+
import { GridSampleOrder } from '../grid/config';
106+
107+
export let samplesList: any = [
108+
109+
{
110+
'name': 'Grid', 'category': 'Grids', 'order': '02', 'path': 'grid', 'samples': GridSampleOrder
111+
}
112+
];
113+
```
114+
115+
## Adding your control dependency
116+
117+
Add your dependency in “package.json” file inside the dependencies.
118+
119+
Note: Here, '\*' Specifies that install the latest published package form the online. '\*' is recommended for Syncfusion packages.
120+
121+
```
122+
"dependencies": {
123+
"@syncfusion/ej2-react-grids": "*"
124+
},
125+
```
126+
# Using the samples
127+
128+
## Installing
129+
130+
Before installation check `@syncfusion:registry=http://nexus.syncfusion.com/repository/ej2-production/` is available in npmrc file. Then use the below command to install all dependent packages.
131+
132+
```
16133
npm install
17134
```
18135

19-
2. Start the development server using gulp
136+
## Build
20137

21-
```bash
22-
gulp serve
138+
Use `npm run build` command to compile the source files. It calls the following tasks synchronously,
139+
140+
1. SEO changes
141+
2. Build
142+
3. Styles ship
143+
4. Site-map generate.
144+
145+
### SEO changes
146+
147+
It will set meta data and description for the h1 tag to show our components first in search engine. Use the below command to run it individual.
148+
149+
```
150+
gulp SEO-changes
23151
```
24152

25-
3. Open your web browser and navigate to the specified localhost address to view the samples.
153+
### Build
154+
155+
Use the below command to generate scripts, styles, locale and sample lists.
156+
157+
```
158+
gulp build
159+
```
160+
It runs the following tasks synchronously,
161+
162+
1. Scripts
163+
2. Styles
164+
165+
#### **Scripts**
166+
167+
It compiles the Typescript files and use the below command to run this task.
168+
169+
```
170+
gulp scripts
171+
```
172+
173+
#### **Styles**
174+
175+
`gulp styles` command is used to compile default themes. It calls the following two tasks synchronously.
176+
177+
1. Default theme
178+
2. Compile styles
179+
180+
#### Default theme
181+
182+
Use the below command to generate default theme files.
183+
184+
```
185+
gulp default-theme
186+
```
187+
188+
#### Compile Styles
189+
It compiles the scss file to css file. To run this task use the below command,
190+
191+
```
192+
gulp compile-styles
193+
```
194+
195+
### Styles Shipping
196+
197+
It copies css files for themes from node_modules. Use the below command to run it individual.
198+
199+
```
200+
gulp styles-ship
201+
```
202+
203+
### Site map generation
204+
205+
The below command combines sample of all components and store it in sitemap-demos.xml file to index our components, samples, documents in search engine.
206+
207+
```
208+
gulp sitemap-generate
209+
```
210+
211+
## Running the Sample Browser
212+
213+
To run your sample browser you can use any of the following command.
214+
215+
```
216+
gulp serve
217+
```

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-react-samples",
3-
"version": "24.1.41",
3+
"version": "24.2.3",
44
"description": "Examples of React UI Components",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",
@@ -49,8 +49,7 @@
4949
"react-router": "6.16.0",
5050
"react-router-dom": "6.16.0",
5151
"marked": "5.1.2",
52-
"codemirror": "5.65.15",
53-
"browser-sync": "^2.29.3"
52+
"codemirror": "5.65.15"
5453
},
5554
"devDependencies": {
5655
"@microsoft/signalr": "7.0.11",
@@ -77,10 +76,11 @@
7776
"source-map-loader": "1.0.2",
7877
"style-loader": "2.0.0",
7978
"typescript": "5.2.2",
79+
"sass": "^1.63.6",
80+
"browser-sync": "^2.29.3",
8081
"webpack": "^4.41.5",
8182
"webpack-cli": "^4.1.0",
82-
"webpack-stream": "^6.0.0",
83-
"sass": "^1.63.6"
83+
"webpack-stream": "^6.0.0"
8484
},
8585
"scripts": {
8686
"build": "gulp build",

src/diagram/activity-functional.tsx

Lines changed: 1 addition & 40 deletions
Large diffs are not rendered by default.

src/diagram/activity.tsx

Lines changed: 4 additions & 41 deletions
Large diffs are not rendered by default.

src/diagram/complex-hierarchical-tree-functional.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import {
2525
import { CheckBoxComponent } from "@syncfusion/ej2-react-buttons";
2626
import { multiParentData } from './diagram-data';
2727

28-
const SAMPLE_CSS = `.image-pattern-style {
28+
const SAMPLE_CSS = `
29+
/* For orientation and subtree alignment in property panel*/
30+
.image-pattern-style {
2931
background-color: white;
3032
background-size: contain;
3133
background-repeat: no-repeat;
@@ -57,8 +59,6 @@ const SAMPLE_CSS = `.image-pattern-style {
5759
border-width: 2px;
5860
}
5961
60-
61-
6262
.diagram-control-pane .col-xs-6 {
6363
padding-left: 0px;
6464
padding-right: 0px;

src/diagram/complex-hierarchical-tree.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import {
2525
import { CheckBoxComponent } from "@syncfusion/ej2-react-buttons";
2626
import { multiParentData } from './diagram-data';
2727

28-
const SAMPLE_CSS = `.image-pattern-style {
28+
const SAMPLE_CSS = `
29+
/* For orientation and subtree alignment in property panel*/
30+
.image-pattern-style {
2931
background-color: white;
3032
background-size: contain;
3133
background-repeat: no-repeat;

src/diagram/connectors-functional.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ let decoratorshape = [
117117
{ shape: 'DoubleArrow', text: 'Double Arrow' }
118118
];
119119

120-
const SAMPLE_CSS = `.image-pattern-style {
120+
const SAMPLE_CSS = `
121+
/* For connector type and style change in property panel*/
122+
.image-pattern-style {
121123
background-color: white;
122124
background-size: contain;
123125
background-repeat: no-repeat;
@@ -148,15 +150,6 @@ const SAMPLE_CSS = `.image-pattern-style {
148150
border-color: #006CE6;
149151
border-width: 2px;
150152
}
151-
152-
.e-colorpicker-wrapper .e-split-btn-wrapper .e-split-colorpicker.e-split-btn .e-selected-color .e-split-preview{
153-
width: 100px!important;
154-
margin-left: -40px!important;
155-
}
156-
.e-colorpicker-wrapper .e-split-btn-wrapper .e-split-colorpicker.e-split-btn{
157-
width: 110px!important;
158-
}
159-
160153
label{
161154
display: inline-block;
162155
font-size: 13px;

src/diagram/connectors.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ let connectors: ConnectorModel[] = [
102102
}
103103
];
104104

105-
const SAMPLE_CSS = `.image-pattern-style {
105+
const SAMPLE_CSS = `
106+
/* For connector type and style change in property panel*/
107+
.image-pattern-style {
106108
background-color: white;
107109
background-size: contain;
108110
background-repeat: no-repeat;
@@ -134,14 +136,6 @@ const SAMPLE_CSS = `.image-pattern-style {
134136
border-width: 2px;
135137
}
136138
137-
.e-colorpicker-wrapper .e-split-btn-wrapper .e-split-colorpicker.e-split-btn .e-selected-color .e-split-preview{
138-
width: 100px!important;
139-
margin-left: -40px!important;
140-
}
141-
.e-colorpicker-wrapper .e-split-btn-wrapper .e-split-colorpicker.e-split-btn{
142-
width: 110px!important;
143-
}
144-
145139
label{
146140
display: inline-block;
147141
font-size: 13px;

0 commit comments

Comments
 (0)