Skip to content

Commit ba98486

Browse files
author
pipeline
committed
v28.1.36 is released
1 parent b875752 commit ba98486

File tree

574 files changed

+39236
-958
lines changed

Some content is hidden

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

574 files changed

+39236
-958
lines changed

controls/barcodegenerator/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [Unreleased]
44

5-
## 28.1.35 (2024-12-18)
5+
## 28.1.36 (2024-12-24)
66

77
### Barcode
88

controls/buttons/CHANGELOG.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
## [Unreleased]
44

5-
## 28.1.35 (2024-12-18)
5+
## 28.1.36 (2024-12-24)
6+
7+
### Switch
8+
9+
#### Bug Fixes
10+
11+
- `#I664001`- The issue with "Form reset functionality does not work properly for the switch component when it is in a disabled state" has been resolved.
12+
13+
## 28.1.33 (2024-12-12)
614

715
### Switch
816

917
#### Features
1018

11-
- The Switch component now includes a `beforeChange` event, allowing users to intercept and manage state changes before they occur, such as for validation or cancellation.
19+
- The Switch component now includes a `beforeChange` event, which enables users to intercept and manage state changes before they occur. This feature supports custom logic, such as validation or cancellation, thereby offering greater flexibility.
1220

1321
### Chip
1422

controls/buttons/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-buttons",
3-
"version": "18.64.1",
3+
"version": "28.1.33",
44
"description": "A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/buttons/spec/switch.spec.ts

+40
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,47 @@ describe('Switch', () => {
612612
specSwitch = new Switch({ enablePersistence: undefined }, '#specSwitch');
613613
expect(specSwitch.htmlAttributes).toEqual({});
614614
});
615+
});
615616

617+
describe('Form reset behavior testing', () => {
618+
let formElement: HTMLFormElement;
619+
beforeEach(() => {
620+
formElement = createElement('form', {
621+
id: 'form'
622+
}) as HTMLFormElement;
623+
document.body.appendChild(formElement);
624+
});
625+
afterEach(() => {
626+
formElement.remove();
627+
});
628+
it('Form reset should reset switches even when some are disabled', () => {
629+
const switches: { [key: string]: Switch } = {};
630+
[1, 2, 3, 4].forEach((item) => {
631+
const input = createElement('input', { id: `element${item}`, type: 'checkbox' } as any);
632+
formElement.appendChild(input);
633+
switches[`element${item}`] = new Switch({ onLabel: 'On', offLabel: 'Off' }, `#element${item}`);
634+
});
635+
const data = {
636+
element1: 1,
637+
element2: 0,
638+
element3: 0,
639+
element4: 1
640+
};
641+
[1, 2, 3, 4].forEach((item) => {
642+
const attr = `element${item}` as keyof typeof data;
643+
switches[attr].checked = true;
644+
switches[attr].disabled = data[attr] === 0;
645+
});
646+
formElement.reset();
647+
[1, 2, 3, 4].forEach((item) => {
648+
const attr = `element${item}` as keyof typeof data;
649+
// Ensure checked state is reset
650+
expect(switches[attr].checked).toBeFalsy();
651+
// Check if switch is disabled or not
652+
expect(switches[attr].disabled).toBe(data[attr] === 0);
653+
});
654+
});
616655
});
617656
});
618657

658+

controls/buttons/src/switch/switch.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
188188
if (!this.disabled) {
189189
this.unWireEvents();
190190
}
191+
if (this.formElement) {
192+
EventHandler.remove(this.formElement, 'reset', this.formResetHandler);
193+
}
191194
destroy(this, this.getWrapper() as Element, this.tagName);
192195
if (this.refreshing) {
193196
['e-control', 'e-switch', 'e-lib'].forEach((key: string) => {
@@ -364,6 +367,9 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
364367
if (!this.disabled) {
365368
this.wireEvents();
366369
}
370+
if (this.formElement) {
371+
EventHandler.add(this.formElement, 'reset', this.formResetHandler, this);
372+
}
367373
this.renderComplete();
368374
this.updateHtmlAttribute();
369375
}
@@ -505,9 +511,6 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
505511
EventHandler.add(wrapper, 'mousedown mouseup', this.rippleHandler, this);
506512
EventHandler.add(wrapper, 'mouseleave', this.mouseLeaveHandler, this);
507513
EventHandler.add(wrapper, 'touchstart touchmove touchend', this.switchMouseUp, this);
508-
if (this.formElement) {
509-
EventHandler.add(this.formElement, 'reset', this.formResetHandler, this);
510-
}
511514
}
512515
private unWireEvents(): void {
513516
const wrapper: Element = this.getWrapper() as Element;
@@ -519,9 +522,6 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
519522
EventHandler.remove(wrapper, 'mousedown mouseup', this.rippleHandler);
520523
EventHandler.remove(wrapper, 'mouseleave', this.mouseLeaveHandler);
521524
EventHandler.remove(wrapper, 'touchstart touchmove touchend', this.switchMouseUp);
522-
if (this.formElement) {
523-
EventHandler.remove(this.formElement, 'reset', this.formResetHandler);
524-
}
525525
}
526526

527527
/**
@@ -546,4 +546,3 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
546546
this.element.focus();
547547
}
548548
}
549-

controls/buttons/styles/button/_tailwind3-definition.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ $btn-icon-font-size: $text-sm !default;
2424
$btn-small-icon-font-size: $text-xs !default;
2525
$btn-bigger-icon-font-size: $text-base !default;
2626
$btn-bigger-small-icon-font-size: $text-base !default;
27-
$btn-round-small-height: 28px !default;
28-
$btn-round-small-width: 28px !default;
27+
$btn-round-small-height: 24px !default;
28+
$btn-round-small-width: 24px !default;
2929
$btn-round-height: 32px !default;
3030
$btn-round-width: 32px !default;
31-
$btn-round-bigger-small-height: 34px !default;
32-
$btn-round-bigger-small-width: 34px !default;
33-
$btn-round-bigger-height: 38px !default;
34-
$btn-round-bigger-width: 38px !default;
31+
$btn-round-bigger-small-height: 36px !default;
32+
$btn-round-bigger-small-width: 36px !default;
33+
$btn-round-bigger-height: 40px !default;
34+
$btn-round-bigger-width: 40px !default;
3535
$btn-round-font-size: $text-sm !default;
3636
$btn-small-round-font-size: $text-xs !default;
3737
$btn-bigger-round-font-size: $text-base !default;

controls/calendars/CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
## [Unreleased]
44

5+
## 28.1.36 (2024-12-24)
6+
7+
### DateRangePicker
8+
9+
#### Bug Fixes
10+
11+
- `#I664732` - Fixed an issue where the overlay was displayed even when the popup was prevented from opening in mobile mode.
12+
13+
- `#I664735` - Removed unnecessary conditional code for adding CSS classes based on device type.
14+
515
## 19.3.46 (2021-10-19)
616

717
### TimePicker

controls/calendars/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-calendars",
3-
"version": "18.32.5",
3+
"version": "28.1.35",
44
"description": "A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/calendars/src/datepicker/datepicker.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1723,6 +1723,11 @@ export class DatePicker extends Calendar implements IInput {
17231723
// eslint-disable-next-line @typescript-eslint/no-explicit-any
17241724
super.setOverlayIndex(this.mobilePopupWrapper, this.popupObj.element, this.modal, Browser.isDevice as any);
17251725
this.setAriaAttributes();
1726+
if (Browser.isDevice) {
1727+
const dlgOverlay: any = this.createElement('div', { className: 'e-dlg-overlay'});
1728+
dlgOverlay.style.zIndex = (this.zIndex - 1).toString();
1729+
this.mobilePopupWrapper.appendChild(dlgOverlay);
1730+
}
17261731
} else {
17271732
this.popupObj.destroy();
17281733
this.popupWrapper = this.popupObj = null;
@@ -1735,11 +1740,6 @@ export class DatePicker extends Calendar implements IInput {
17351740
}
17361741
EventHandler.add(document, 'mousedown touchstart', this.documentHandler, this);
17371742
});
1738-
if (Browser.isDevice) {
1739-
const dlgOverlay: any = this.createElement('div', { className: 'e-dlg-overlay'});
1740-
dlgOverlay.style.zIndex = (this.zIndex - 1).toString();
1741-
this.mobilePopupWrapper.appendChild(dlgOverlay);
1742-
}
17431743
}
17441744
}
17451745
/**

controls/calendars/src/daterangepicker/daterangepicker.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -3633,9 +3633,6 @@ export class DateRangePicker extends CalendarBase {
36333633

36343634
if (this.isMobile) {
36353635
this.popupObj.element.classList.add(DEVICE);
3636-
if (!this.isMobile) {
3637-
this.popupObj.element.classList.add('e-bigger');
3638-
}
36393636
}
36403637
if (this.isMobile && this.isCustomWindow) {
36413638
addClass([this.modal], [DEVICE, ROOT, 'e-range-modal']);
@@ -4556,13 +4553,13 @@ export class DateRangePicker extends CalendarBase {
45564553
this.popupObj.element,
45574554
this.modal,
45584555
this.isMobile || Browser.isDevice);
4556+
if (Browser.isDevice) {
4557+
const dlgOverlay: HTMLElement = this.createElement('div', { className: 'e-dlg-overlay' });
4558+
dlgOverlay.style.zIndex = (this.zIndex - 1).toString();
4559+
this.mobileRangePopupWrap.appendChild(dlgOverlay);
4560+
}
45594561
}
45604562
});
4561-
if (Browser.isDevice) {
4562-
const dlgOverlay: HTMLElement = this.createElement('div', { className: 'e-dlg-overlay'});
4563-
dlgOverlay.style.zIndex = (this.zIndex - 1).toString();
4564-
this.mobileRangePopupWrap.appendChild(dlgOverlay);
4565-
}
45664563
}
45674564
}
45684565
}

controls/calendars/src/timepicker/timepicker.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -2661,18 +2661,18 @@ export class TimePicker extends Component<HTMLElement> implements IInput {
26612661
addClass([this.inputWrapper.container], FOCUS);
26622662
EventHandler.add(document, 'mousedown touchstart', this.documentClickHandler, this);
26632663
this.setOverlayIndex(this.mobileTimePopupWrap, this.popupObj.element, this.modal, Browser.isDevice as any);
2664+
if (Browser.isDevice) {
2665+
const dlgOverlay: HTMLElement = this.createElement('div', { className: 'e-dlg-overlay'});
2666+
dlgOverlay.style.zIndex = (this.zIndex - 1).toString();
2667+
this.mobileTimePopupWrap.appendChild(dlgOverlay);
2668+
}
26642669
} else {
26652670
this.popupObj.destroy();
26662671
this.popupWrapper = this.listTag = undefined;
26672672
this.liCollections = this.timeCollections = this.disableItemCollection = [];
26682673
this.popupObj = null;
26692674
}
26702675
});
2671-
if (Browser.isDevice) {
2672-
const dlgOverlay: HTMLElement = this.createElement('div', { className: 'e-dlg-overlay'});
2673-
dlgOverlay.style.zIndex = (this.zIndex - 1).toString();
2674-
this.mobileTimePopupWrap.appendChild(dlgOverlay);
2675-
}
26762676
}
26772677
}
26782678
/* eslint-enable valid-jsdoc, jsdoc/require-param */

controls/charts/CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
## [Unreleased]
44

5+
## 28.1.36 (2024-12-24)
6+
7+
### Chart
8+
9+
#### Bug Fixes
10+
11+
- `#I665246` - Now, the chart point click and double-click events are working properly in the waterfall chart.
12+
- `#I662191` - Now, zooming is restricted for the mouse wheel, similar to selection zoom.
13+
- `#I666272` - Now, the y-axis range is set properly for the waterfall series.
14+
- `#I666317` - The exceptions that occurred during React Jest testing have been resolved.
15+
516
## 28.1.35 (2024-12-18)
617

718
### Chart

controls/charts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-charts",
3-
"version": "28.1.33",
3+
"version": "28.1.35",
44
"description": "Feature-rich chart control with built-in support for over 25 chart types, technical indictors, trendline, zooming, tooltip, selection, crosshair and trackball.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/charts/spec/chart/series/waterfall-series.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ describe('Waterfall Series', () => {
10911091
loaded = (args: Object): void => {
10921092
let series: HTMLElement = document.getElementById('container_Series_0_Connector_');
10931093
let d: string = series.getAttribute('d');
1094-
expect(d).toBe('M 18.31875000000001 371.5 L 314.43125 371.5 M 184.69374999999997 371.5 L 341.06874999999997 371.5 M 490.80625000000003 148.6 L 507.44374999999997 148.6 ');
1094+
expect(d).toBe('M 158.05624999999998 371.5 L 174.69375000000002 371.5 M 324.43125000000003 371.5 L 341.06874999999997 371.5 M 490.80625000000003 148.6 L 507.44374999999997 148.6 ');
10951095
done();
10961096
};
10971097
chart.loaded = loaded;
@@ -1101,7 +1101,7 @@ describe('Waterfall Series', () => {
11011101
loaded = (args: Object): void => {
11021102
let series: HTMLElement = document.getElementById('container_Series_0_Connector_');
11031103
let d: string = series.getAttribute('d');
1104-
expect(d).toBe('M 18.31875000000001 371.5 L 314.43125 371.5 M 184.69374999999997 371.5 L 341.06874999999997 371.5 M 490.80625000000003 148.6 L 507.44374999999997 148.6 ');
1104+
expect(d).toBe('M 158.05624999999998 371.5 L 174.69375000000002 371.5 M 324.43125000000003 371.5 L 341.06874999999997 371.5 M 490.80625000000003 148.6 L 507.44374999999997 148.6 ');
11051105
done();
11061106
};
11071107
chart.series[0].marker.visible=true;
@@ -1112,7 +1112,7 @@ describe('Waterfall Series', () => {
11121112
loaded = (args: Object): void => {
11131113
let series: HTMLElement = document.getElementById('container_Series_0_Connector_');
11141114
let d: string = series.getAttribute('d');
1115-
expect(d).toBe('M 507.44374999999997 371.5 L 490.80625000000003 371.5 M 341.06874999999997 371.5 L 324.43125000000003 371.5 M 174.69374999999997 148.6 L 158.05625000000003 148.6 ');
1115+
expect(d).toBe('M 647.1812500000001 371.5 L 351.06874999999997 371.5 M 480.80625000000003 371.5 L 324.43125000000003 371.5 M 174.69374999999997 148.6 L 158.05625000000003 148.6 ');
11161116
done();
11171117
};
11181118
chart.primaryXAxis.isInversed=true;

controls/charts/src/chart/series/chart-series.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,9 @@ export class SeriesBase extends ChildProperty<SeriesBase> {
11921192
}
11931193
this.updateSplineValue();
11941194
this.updateYAxisForErrorBars();
1195+
if (this instanceof Series && this.type === 'Waterfall' && isNullOrUndefined(this.yAxis.minimum)) {
1196+
this.yMin = Math.min(...this.chart.waterfallSeriesModule.cumulativeSums);
1197+
}
11951198
}
11961199
/**
11971200
* Calculates the errorbar and adds a range to axis if errorbar exeeds to the actual range.

controls/charts/src/chart/series/waterfall-series.ts

+17-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ import { animationMode } from '@syncfusion/ej2-base';
1212
*/
1313

1414
export class WaterfallSeries extends ColumnBase {
15+
/**
16+
* Store the cumulative values of each index.
17+
*
18+
* @private
19+
*/
20+
public cumulativeSums: number[] = [];
1521

1622
/**
1723
* Render waterfall series.
@@ -94,11 +100,15 @@ export class WaterfallSeries extends ColumnBase {
94100
direction = direction.concat('M' + ' ' + y + ' ' + (series.xAxis.isInversed ? (prevRegion.y + prevRegion.height) : prevRegion.y) + ' ' +
95101
'L' + ' ' + y + ' ' + (series.xAxis.isInversed ? currentYValue : (currentYValue + currentRegion.height)) + ' ');
96102
} else {
103+
let connectorX: number = prevRegion.x;
97104
if (beforePoint.yValue === 0) {
98-
prevRegion.x = ((prevRegion.x + prevRegion.width / 2) - (rect.width / 2));
105+
connectorX = ((connectorX + prevRegion.width / 2) + (rect.width / 2)) - prevRegion.width;
99106
currentXValue = ((currentRegion.x + currentRegion.width / 2) + (rect.width / 2)) - currentRegion.width;
100107
}
101-
direction = direction.concat('M' + ' ' + (series.xAxis.isInversed ? prevRegion.x : (prevRegion.x + prevRegion.width)) + ' ' + y + ' ' +
108+
if (point.yValue === 0) {
109+
currentXValue = ((currentRegion.x + currentRegion.width / 2) - (rect.width / 2));
110+
}
111+
direction = direction.concat('M' + ' ' + (series.xAxis.isInversed ? connectorX : (connectorX + prevRegion.width)) + ' ' + y + ' ' +
102112
'L' + ' ' + (series.xAxis.isInversed ? (currentXValue + currentRegion.width) : currentXValue) + ' ' + y + ' ');
103113
}
104114
}
@@ -206,6 +216,11 @@ export class WaterfallSeries extends ColumnBase {
206216
const data: Object[] = json; let index: number; let sumValue : number = 0;
207217
const intermediateSum: number[] = series.intermediateSumIndexes;
208218
const sumIndex: number[] = series.sumIndexes;
219+
let cumulativeSum: number = 0;
220+
for (let i: number = 0; i < data.length; i++) {
221+
cumulativeSum += data[i as number][series.yName] !== undefined ? data[i as number][series.yName] : 0;
222+
this.cumulativeSums.push(cumulativeSum);
223+
}
209224
if (intermediateSum !== undefined && intermediateSum.length > 0) {
210225
for (let i: number = 0; i < intermediateSum.length; i++) {
211226
for (let j: number = 0; j < data.length; j++) {

controls/charts/src/chart/user-interaction/zooming.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,14 @@ export class Zoom {
494494
if (axis.zoomPosition !== zoomPosition || axis.zoomFactor !== zoomFactor) {
495495
zoomFactor = (zoomPosition + zoomFactor) > 1 ? (1 - zoomPosition) : zoomFactor;
496496
}
497-
argsData.currentZoomFactor = zoomFactor;
498-
argsData.currentZoomPosition = zoomPosition;
497+
if (parseFloat(argsData.currentZoomFactor.toFixed(3)) <= 0.001) {
498+
argsData.currentZoomFactor = argsData.previousZoomFactor;
499+
argsData.currentZoomPosition = argsData.previousZoomPosition;
500+
}
501+
else {
502+
argsData.currentZoomFactor = zoomFactor;
503+
argsData.currentZoomPosition = zoomPosition;
504+
}
499505
}
500506
if (argsData.currentZoomFactor === argsData.previousZoomFactor &&
501507
argsData.currentZoomPosition === argsData.previousZoomPosition) {

controls/charts/src/common/user-interaction/tooltip.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ export class BaseTooltip extends ChartData {
353353

354354
public fadeOut(data: PointData[]): void {
355355
const svgElement: HTMLElement = this.chart.enableCanvas ? this.getElement(this.element.id + '_tooltip_group') :
356-
this.getElement(this.element.id + '_tooltip_svg');
356+
this.getElement(this.element.id + '_tooltip_svg') || this.getElement(this.element.id + '_tooltipparent_template');
357357
const isTooltip: boolean = (svgElement && parseInt(svgElement.getAttribute('opacity'), 10) > 0);
358358
if (!isTooltip) {
359359
this.valueX = null;

0 commit comments

Comments
 (0)