Skip to content

Commit bdbf4ad

Browse files
author
pipeline
committed
v28.1.39 is released
1 parent 7eee9a0 commit bdbf4ad

File tree

173 files changed

+7312
-5908
lines changed

Some content is hidden

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

173 files changed

+7312
-5908
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.38 (2025-01-07)
5+
## 28.1.39 (2024-01-14)
66

77
### Barcode
88

controls/buttons/CHANGELOG.md

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

33
## [Unreleased]
44

5-
## 28.1.38 (2025-01-07)
5+
## 28.1.39 (2024-01-14)
6+
7+
### Switch
8+
9+
#### Bug Fixes
10+
11+
- `#I933399`- The issue with "Checked state not update properly while changing the switch component programmatically using click event of input element" has been resolved.
12+
13+
## 28.1.37 (2024-12-31)
614

715
### Switch
816

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": "28.1.33",
3+
"version": "28.1.37",
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

+8
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ describe('Switch', () => {
114114
element.parentElement.click();
115115
expect(element.parentElement.children[1].classList.contains('e-switch-active')).toEqual(false);
116116
});
117+
it('Programmatic input click updates checked state correctly', () => {
118+
specSwitch = new Switch({change: changeFn}, '#specSwitch');
119+
expect(specSwitch.checked).toEqual(false);
120+
element.click();
121+
expect(specSwitch.checked).toEqual(true);
122+
expect(element.checked).toEqual(true);
123+
expect(i).toEqual(1);
124+
});
117125
it('Switch with change event', () => {
118126
specSwitch = new Switch({change: changeFn}, '#specSwitch');
119127
element.parentElement.click();

controls/buttons/src/switch/switch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
169169
private clickHandler(evt?: Event): void {
170170
this.isDrag = false;
171171
this.focusOutHandler();
172-
const beforeChangeEventArgs: BeforeChangeEventArgs = { event: evt, cancel: false, checked: this.element.checked };
172+
const beforeChangeEventArgs: BeforeChangeEventArgs = { event: evt, cancel: false, checked: this.checked };
173173
this.trigger('beforeChange', beforeChangeEventArgs);
174174
if (!beforeChangeEventArgs.cancel) {
175175
this.changeState(!beforeChangeEventArgs.checked);

controls/calendars/CHANGELOG.md

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

33
## [Unreleased]
44

5-
## 28.1.38 (2025-01-07)
5+
## 28.1.39 (2024-01-14)
6+
7+
### DateRangePicker
8+
9+
#### Bug Fixes
10+
11+
- `#I666998` - Fixed an issue where the start and end date selection was not maintained in the popup.
12+
13+
## 28.1.37 (2024-12-31)
614

715
### DateRangePicker
816

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": "28.1.35",
3+
"version": "28.1.37",
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/spec/daterangepicker/daterangepicker.spec.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -7734,8 +7734,8 @@ describe('DateRangePicker', () => {
77347734
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[2]).dispatchEvent(clickEvent);
77357735
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-year')).toBe(true);
77367736
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-year')).toBe(true);
7737-
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 1, 2019');
7738-
expect(document.querySelector('.e-end-label').innerHTML).toBe('Mar 31, 2019');
7737+
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 8, 2019');
7738+
expect(document.querySelector('.e-end-label').innerHTML).toBe('Mar 10, 2019');
77397739
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
77407740
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
77417741
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
@@ -7756,8 +7756,8 @@ describe('DateRangePicker', () => {
77567756
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[5]).dispatchEvent(clickEvent);;
77577757
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-year')).toBe(true);
77587758
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-year')).toBe(true);
7759-
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 1, 2011');
7760-
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jun 30, 2039');
7759+
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 8, 2011');
7760+
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jun 10, 2039');
77617761
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
77627762
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
77637763
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
@@ -7773,8 +7773,8 @@ describe('DateRangePicker', () => {
77737773
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[2]).dispatchEvent(clickEvent);
77747774
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-decade')).toBe(true);
77757775
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-decade')).toBe(true);
7776-
expect(document.querySelector('.e-start-label').innerHTML).toBe('Jan 1, 2011');
7777-
expect(document.querySelector('.e-end-label').innerHTML).toBe('Dec 31, 2021');
7776+
expect(document.querySelector('.e-start-label').innerHTML).toBe('Jan 8, 2011');
7777+
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jan 10, 2021');
77787778
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
77797779
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
77807780
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
@@ -7798,8 +7798,8 @@ describe('DateRangePicker', () => {
77987798
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[2]).dispatchEvent(clickEvent);
77997799
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-decade')).toBe(true);
78007800
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-decade')).toBe(true);
7801-
expect(document.querySelector('.e-start-label').innerHTML).toBe('Jan 1, 2011');
7802-
expect(document.querySelector('.e-end-label').innerHTML).toBe('Dec 31, 2031');
7801+
expect(document.querySelector('.e-start-label').innerHTML).toBe('Jan 8, 2011');
7802+
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jan 10, 2031');
78037803
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
78047804
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
78057805
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
@@ -7824,8 +7824,8 @@ describe('DateRangePicker', () => {
78247824
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[5]).dispatchEvent(clickEvent);
78257825
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-year')).toBe(true);
78267826
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-year')).toBe(true);
7827-
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 1, 2011');
7828-
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jun 30, 2039');
7827+
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 8, 2011');
7828+
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jun 10, 2039');
78297829
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
78307830
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
78317831
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
@@ -8221,7 +8221,7 @@ describe('DateRangePicker', () => {
82218221
expect(document.querySelector('.e-end-btn').innerHTML).toBe('Dec 31, 2037');
82228222
});
82238223
it('start as Decade and Depth as Year on property', () => {
8224-
daterangepicker = createControl({ value: [new Date('1/1/2019'), new Date('1/31/2039')] },true);
8224+
daterangepicker = createControl({ value: [new Date('1/1/2019'), new Date('1/30/2039')] },true);
82258225
expect(daterangepicker.start).toBe('Month');
82268226
expect(daterangepicker.depth).toBe('Month');
82278227
daterangepicker.depth = 'Year';

controls/calendars/src/daterangepicker/daterangepicker.ts

+42-19
Original file line numberDiff line numberDiff line change
@@ -1544,10 +1544,8 @@ export class DateRangePicker extends CalendarBase {
15441544
if (range.length > 1) {
15451545
this.invalidValueString = null;
15461546
const dateOptions: object = { format: this.formatString, type: 'date', skeleton: 'yMd' };
1547-
const start : Date = this.globalize.parseDate(this.getAmPmValue(range[0]), dateOptions);
1548-
const end : Date = this.globalize.parseDate(this.getAmPmValue(range[1]), dateOptions);
1549-
const startDate: Date = this.getStartEndDate(start, false, range, dateOptions);
1550-
const endDate: Date = this.getStartEndDate(end, true, range, dateOptions);
1547+
const startDate: Date = this.globalize.parseDate(this.getAmPmValue(range[0]).trim(), dateOptions);
1548+
const endDate: Date = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), dateOptions);
15511549
if (!isNullOrUndefined(startDate) && !isNaN(+startDate) && !isNullOrUndefined(endDate) && !isNaN(+endDate)) {
15521550
const prevStartVal: Date = this.startValue;
15531551
this.startValue = startDate;
@@ -1617,12 +1615,10 @@ export class DateRangePicker extends CalendarBase {
16171615
this.updateHiddenInput();
16181616
}
16191617

1620-
private getStartEndDate(date: Date, isEnd: boolean, range: string[], dateOptions: object): Date {
1621-
if (this.depth === 'Month') {
1622-
return this.globalize.parseDate(this.getAmPmValue(range[isEnd ? 1 : 0]).trim(), dateOptions);
1623-
} else if (this.depth === 'Year' && !isNullOrUndefined(date)) {
1618+
private getStartEndDate(date: Date, isEnd: boolean): Date {
1619+
if (this.currentView() === 'Year' && !isNullOrUndefined(date)) {
16241620
return new Date(date.getFullYear(), date.getMonth() + (isEnd ? 1 : 0), isEnd ? 0 : 1);
1625-
} else if (!isNullOrUndefined(date)) {
1621+
} else if (this.currentView() === 'Decade' && !isNullOrUndefined(date)) {
16261622
return new Date(date.getFullYear(), isEnd ? 11 : 0, isEnd ? 31 : 1);
16271623
} else {
16281624
return null;
@@ -2087,7 +2083,7 @@ export class DateRangePicker extends CalendarBase {
20872083
const isDisabledCell: boolean = (!ele.classList.contains(DISABLED) || ele.classList.contains(DATEDISABLED));
20882084
if (!ele.classList.contains(WEEKNUMBER) && isDisabledCell) {
20892085
const eleDate: Date = this.getIdValue(null, ele);
2090-
const startDateValue: Date = new Date(+this.startValue);
2086+
const startDateValue: Date = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
20912087
const eleDateValue: Date = new Date(+eleDate);
20922088
if (eleDateValue.setHours(0, 0, 0, 0) >= startDateValue.setHours(0, 0, 0, 0) && +eleDate <= +currentDate) {
20932089
addClass([ele], RANGEHOVER);
@@ -2126,9 +2122,11 @@ export class DateRangePicker extends CalendarBase {
21262122
const eleDate: Date = this.getIdValue(null, ele);
21272123
const eleDateValue: Date = this.getIdValue(null, ele);
21282124
if (!isNullOrUndefined(this.endValue)) {
2125+
const eleStartDateValue: Date = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
2126+
const eleEndDateValue: Date = this.currentView() === 'Month' ? new Date(+this.endValue) : this.getStartEndDate(new Date(+this.endValue), true);
21292127
if (this.currentView() === this.depth &&
2130-
+eleDateValue.setHours(0, 0, 0, 0) >= +new Date(+this.startValue).setHours(0, 0, 0, 0)
2131-
&& +eleDateValue.setHours(0, 0, 0, 0) <= +new Date(+this.endValue).setHours(0, 0, 0, 0) &&
2128+
+eleDateValue.setHours(0, 0, 0, 0) >= +eleStartDateValue.setHours(0, 0, 0, 0)
2129+
&& +eleDateValue.setHours(0, 0, 0, 0) <= +eleEndDateValue.setHours(0, 0, 0, 0) &&
21322130
!this.isSameStartEnd(new Date(+this.startValue), new Date(+this.endValue)) &&
21332131
+new Date(+this.startValue).setHours(0, 0, 0, 0) >= +this.min
21342132
&& +new Date(+this.endValue).setHours(0, 0, 0, 0) <= +this.max
@@ -2147,7 +2145,7 @@ export class DateRangePicker extends CalendarBase {
21472145
removeClass([ele], [RANGEHOVER]);
21482146
}
21492147
if (!ele.classList.contains(OTHERMONTH)) {
2150-
const startDateValue: Date = new Date(+this.startValue);
2148+
const startDateValue: Date = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
21512149
let eleDateValue: Date = new Date(+eleDate);
21522150
if (this.currentView() === this.depth &&
21532151
+eleDateValue.setHours(0, 0, 0, 0) === +startDateValue.setHours(0, 0, 0, 0)
@@ -2158,7 +2156,7 @@ export class DateRangePicker extends CalendarBase {
21582156
addClass([ele], [STARTDATE, SELECTED]);
21592157
this.addSelectedAttributes(ele, this.startValue, true);
21602158
}
2161-
const endDateValue: Date = new Date(+this.endValue);
2159+
const endDateValue: Date = this.currentView() === 'Month' ? new Date(+this.endValue) : this.getStartEndDate(new Date(+this.endValue), true);
21622160
if (this.currentView() === 'Year') {
21632161
eleDateValue = new Date(eleDateValue.getFullYear(), eleDateValue.getMonth() + 1, 0);
21642162
} else if (this.currentView() === 'Decade') {
@@ -2249,14 +2247,39 @@ export class DateRangePicker extends CalendarBase {
22492247
if (event) {
22502248
event.preventDefault();
22512249
}
2252-
const date: Date = isNullOrUndefined(event) ? this.getIdValue(null, element)
2250+
let isValue: boolean;
2251+
let startDateValue : Date;
2252+
let endDateValue : Date;
2253+
const value: string = (<HTMLInputElement>this.inputElement).value;
2254+
if (!isNullOrUndefined(value) && value.trim() !== '') {
2255+
const range: string[] = value.split(' ' + this.separator + ' ');
2256+
if (range.length > 1 && ((this.currentView() === 'Year' && this.depth === 'Year')
2257+
|| (this.currentView() === 'Decade' && this.depth === 'Decade'))) {
2258+
const dateOptions: object = { format: this.formatString, type: 'date', skeleton: 'yMd' };
2259+
startDateValue = this.globalize.parseDate(this.getAmPmValue(range[0]).trim(), dateOptions);
2260+
endDateValue = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), dateOptions);
2261+
isValue = true;
2262+
}
2263+
}
2264+
let date: Date = isNullOrUndefined(event) ? this.getIdValue(null, element)
22532265
: this.getIdValue(event, null);
2266+
if (!isNullOrUndefined(this.startValue)) {
2267+
if (this.currentView() === 'Year' && this.depth === 'Year') {
2268+
date = new Date(date.getFullYear(), date.getMonth(), this.startValue.getDate());
2269+
} else if (this.currentView() === 'Decade' && this.depth === 'Decade') {
2270+
date = new Date(date.getFullYear(), this.startValue.getMonth(), this.startValue.getDate());
2271+
}
2272+
}
22542273
const y: number = date.getFullYear();
22552274
const m: number = date.getMonth();
2256-
const firstDay: Date = new Date(y, m, 1);
2257-
const lastDay: Date = new Date(y, m + 1, 0);
2258-
const firstMonth: Date = new Date(y, 0, 1);
2259-
const lastMonth: Date = new Date(y, 11, 31);
2275+
const firstDay: Date = isValue ? new Date(y, m, startDateValue.getDate(), startDateValue.getHours(), startDateValue.getMinutes(),
2276+
startDateValue.getSeconds()) : new Date(y, m, 1);
2277+
const lastDay: Date = isValue ? new Date(y, m, endDateValue.getDate(), endDateValue.getHours(), endDateValue.getMinutes(),
2278+
endDateValue.getSeconds()) : new Date(y, m + 1, 0);
2279+
const firstMonth: Date = isValue ? new Date(y, startDateValue.getMonth(), startDateValue.getDate(), startDateValue.getHours(),
2280+
startDateValue.getMinutes(), startDateValue.getSeconds()) : new Date(y, 0, 1);
2281+
const lastMonth: Date = isValue ? new Date(y, endDateValue.getMonth(), endDateValue.getDate(), endDateValue.getHours(),
2282+
endDateValue.getMinutes(), endDateValue.getSeconds()) : new Date(y, 11, 31);
22602283
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue)) {
22612284
if (!this.isMobile || this.isMobile && !this.endButton.element.classList.contains(ACTIVE)) {
22622285
this.removeSelection();

controls/charts/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
## [Unreleased]
44

5+
## 28.1.39 (2024-01-14)
6+
7+
### Chart
8+
9+
#### Bug Fixes
10+
11+
- `#I663652` - The calculations for both sum and intermediate sum indexes have been corrected.
12+
513
## 28.1.38 (2025-01-07)
614

715
### 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.37",
3+
"version": "28.1.38",
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",

0 commit comments

Comments
 (0)