Skip to content

Commit 00e22d0

Browse files
author
pipeline
committed
v31.1.22 is released
1 parent 09dfc4d commit 00e22d0

File tree

234 files changed

+3825
-1568
lines changed

Some content is hidden

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

234 files changed

+3825
-1568
lines changed

controls/base/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## [Unreleased]
44

5+
## 31.1.22 (2025-10-01)
6+
7+
### Common
8+
9+
#### Bug Fixes
10+
11+
- `#I756987` - Resolved the security issue from base library by replacing `Math.random` function with `Crypto.getRandomValues`.
12+
513
## 31.1.20 (2025-09-10)
614

715
### Common

controls/base/releasenotes/README.md

Lines changed: 0 additions & 183 deletions
This file was deleted.

controls/base/styles/definition/_bds.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
--color-sf-text-tertiary: #{#475467};
3535
--color-sf-text-tertiary-hover: #{#344054};
3636
--color-sf-text-tertiary-on-brand: #{#eaecf0};
37-
--color-sf-text-quarterary: #{#101828};
37+
--color-sf-text-quarterary: #{#667085};
3838
--color-sf-text-quarterary-on-brand: #{#101828};
3939
--color-sf-text-white: #{#fff};
4040
--color-sf-text-disabled: #{#667085};

controls/blockeditor/src/blockeditor/utils/common.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { StyleModel } from '../models/index';
99
*/
1010
export function generateUniqueId(prefix?: string): string {
1111
const timestamp: string = Date.now().toString(36); // Base36 timestamp (millisecond precision)
12-
const randomPart: string = Math.random().toString(36).substring(2, 10); // 8 random characters
12+
const randomPart: string = getRandomNumber().toString(36).substring(2, 10); // 8 random characters
1313
return `${prefix ? prefix + '-' : ''}${timestamp}${randomPart}`.toLowerCase();
1414
}
1515

@@ -379,3 +379,13 @@ export function createBaseSvg(viewBox: string = '0 0 24 24'): SVGSVGElement {
379379
height: '18'
380380
});
381381
}
382+
383+
/**
384+
* @returns {number} A cryptographically secure random number.
385+
* @hidden
386+
*/
387+
export function getRandomNumber(): number {
388+
const array: Uint32Array = new Uint32Array(1);
389+
window.crypto.getRandomValues(array);
390+
return array[0] / (0xFFFFFFFF + 1);
391+
}

controls/calendars/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [Unreleased]
44

5-
## 31.1.21 (2025-09-23)
5+
## 31.1.22 (2025-10-01)
66

77
### DatePicker
88

controls/charts/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,33 @@
22

33
## [Unreleased]
44

5+
## 31.1.22 (2025-10-01)
6+
7+
### Chart
8+
9+
#### Bug Fixes
10+
11+
- `#I747736` - Now, the combination stacking and stacking of 100 different series renders properly.
12+
- `#I757693` - Now, the space on the left margin has adjusted properly after placing the axis label inside.
13+
14+
#### Feature
15+
16+
- `#I764441` - Support for the text render event has been added to stacking labels.
17+
518
## 31.1.21 (2025-09-23)
619

720
### Chart
821

922
#### Bug Fixes
1023

24+
- `#I764449` - Now the stacking label is positioned properly when zooming is performed.
25+
26+
## 31.1.20 (2025-09-17)
27+
28+
### Chart
29+
30+
#### Bug Fixes
31+
1132
- `#F69182` - Columns with a single X-axis value now render with the correct width.
1233
- `#I762508` - The legend highlight now works correctly when the highlight mode is set to `Series`.
1334
- `#I760409` - The Zoom toolbar tooltip will be displayed on the pop-up.

controls/charts/spec/chart/axis/axis.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import { AreaSeries } from '../../../src/chart/series/area-series';
1010
import { Category } from '../../../src/chart/axis/category-axis';
1111
import '../../../node_modules/es6-promise/dist/es6-promise';
1212
import { MouseEvents } from '../base/events.spec';
13-
import { unbindResizeEvents } from '../base/data.spec';
13+
import { secureRandom, unbindResizeEvents } from '../base/data.spec';
1414
import { EmitType } from '@syncfusion/ej2-base';
1515
import { DateTime, Zoom, ScrollBar } from '../../../src/index' ;
1616
import { Logarithmic } from '../../../src/index';
1717
import { ILoadedEventArgs, IAxisLabelRenderEventArgs, IAxisLabelClickEventArgs } from '../../../src/chart/model/chart-interface';
18-
import {profile , inMB, getMemoryProfile} from '../../common.spec';
18+
import {profile , inMB, getMemoryProfile } from '../../common.spec';
1919
import { categoryData } from '../base/data.spec';
2020
Chart.Inject(LineSeries, Category, ColumnSeries, DateTime, Logarithmic, Zoom, ScrollBar, AreaSeries);
2121

@@ -1615,14 +1615,14 @@ describe('Chart Control', () =>{
16151615
numericSeriesData.push(point);
16161616
}
16171617
function getRndInteger(min: number, max: number) {
1618-
return Math.floor(Math.random() * (max - min)) + min;
1618+
return Math.floor(secureRandom() * (max - min)) + min;
16191619
}
16201620
let value: number = 80;
16211621
for (i = 1; i < 500; i++) {
1622-
if (Math.random() > .5) {
1623-
value += Math.random();
1622+
if (secureRandom() > .5) {
1623+
value += secureRandom();
16241624
} else {
1625-
value -= Math.random();
1625+
value -= secureRandom();
16261626
}
16271627
point = { x: new Date(1990, i + 2, i), y: value.toFixed(1) };
16281628
dateTimeData.push(point);

controls/charts/spec/chart/axis/stripline.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import { SeriesModel } from '../../../src/chart/series/chart-series-model';
1515
import { LineSeries } from '../../../src/chart/series/line-series';
1616
import { AreaSeries } from '../../../src/chart/series/area-series';
1717
import { Legend } from '../../../src/chart/legend/legend';
18-
import { unbindResizeEvents } from '../base/data.spec';
18+
import { secureRandom, unbindResizeEvents } from '../base/data.spec';
1919
import '../../../node_modules/es6-promise/dist/es6-promise';
20-
import {profile , inMB, getMemoryProfile} from '../../common.spec';
20+
import {profile , inMB, getMemoryProfile } from '../../common.spec';
2121
Chart.Inject(LineSeries, AreaSeries, Legend, StripLine, DateTime, Category, Logarithmic, DateTimeCategory);
2222
let i: number; let data: Points[] = []; let seriesCollection: SeriesModel[] = [];
2323
for (let j: number = 0; j < 5; j++) {
2424
for (i = 0; i < 10; i++) {
25-
data.push({ x: i, y: Math.random() * 100 });
25+
data.push({ x: i, y: secureRandom() * 100 });
2626
}
2727
seriesCollection[j] = {
2828
name: 'Series ' + j,

controls/charts/spec/chart/base/data.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ import { Browser, EventHandler } from '@syncfusion/ej2-base';
66
import { Chart } from '../../../src/chart/chart';
77
import { ChartLocation } from '../../../src/common/utils/helper';
88

9+
/**
10+
* Generates a cryptographically secure random number in the range [0, 1).
11+
*
12+
* This method uses the browser's `window.crypto.getRandomValues()` to produce
13+
* an unsigned 32-bit integer and scales the result to a floating-point value
14+
* between 0 (inclusive) and 1 (exclusive), similar to `secureRandom()` but
15+
* with cryptographic security.
16+
*
17+
* @returns {number} A random floating-point number greater than or equal to 0 and less than 1.
18+
* @private
19+
*/
20+
export function secureRandom(): number {
21+
const array: Uint32Array = new Uint32Array(1);
22+
window.crypto.getRandomValues(array);
23+
return array[0] / (0xFFFFFFFF + 1);
24+
}
25+
926
export function unbindResizeEvents(chart: Chart): boolean {
1027
if (Browser.isTouch && chart.isOrientation()) {
1128
EventHandler.remove(<HTMLElement & Window>window, 'orientationchange', chart.chartResize);

controls/charts/spec/chart/legend/legend.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import { Legend } from '../../../src/chart/legend/legend';
1919
import { Selection } from '../../../src/chart/user-interaction/selection';
2020
import { MouseEvents } from '../base/events.spec';
2121
import { ILegendRenderEventArgs } from '../../../src/chart/model/chart-interface';
22-
import { unbindResizeEvents } from '../base/data.spec';
22+
import { secureRandom, unbindResizeEvents } from '../base/data.spec';
2323
import '../../../node_modules/es6-promise/dist/es6-promise';
2424
import { EmitType } from '@syncfusion/ej2-base';
2525
import { ILoadedEventArgs } from '../../../src/chart/model/chart-interface';
26-
import {profile , inMB, getMemoryProfile} from '../../common.spec';
26+
import {profile , inMB, getMemoryProfile } from '../../common.spec';
2727
import { DateTime } from '../../../src/chart/axis/date-time-axis';
2828
import { Tooltip } from '../../../src/chart/user-interaction/tooltip';
2929
import { categoryData, categoryData1 } from '../base/data.spec';
@@ -34,7 +34,7 @@ let colors: string[] = ['#663AB6', '#EB3F79', '#F8AB1D', '#B82E3D', '#049CB1', '
3434
let toggle: boolean = true;
3535
for (let j: number = 0; j < 20; j++) {
3636
for (i = 0; i < 10; i++) {
37-
value = Math.random() * 100;
37+
value = secureRandom() * 100;
3838
currentPoint = { x: i, y: value };
3939
data.push(currentPoint);
4040
}

0 commit comments

Comments
 (0)