Skip to content

Commit

Permalink
v28.1.39 is released
Browse files Browse the repository at this point in the history
  • Loading branch information
pipeline committed Jan 14, 2025
1 parent 7eee9a0 commit bdbf4ad
Show file tree
Hide file tree
Showing 173 changed files with 7,312 additions and 5,908 deletions.
2 changes: 1 addition & 1 deletion controls/barcodegenerator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## [Unreleased]

## 28.1.38 (2025-01-07)
## 28.1.39 (2024-01-14)

### Barcode

Expand Down
10 changes: 9 additions & 1 deletion controls/buttons/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

## [Unreleased]

## 28.1.38 (2025-01-07)
## 28.1.39 (2024-01-14)

### Switch

#### Bug Fixes

- `#I933399`- The issue with "Checked state not update properly while changing the switch component programmatically using click event of input element" has been resolved.

## 28.1.37 (2024-12-31)

### Switch

Expand Down
2 changes: 1 addition & 1 deletion controls/buttons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@syncfusion/ej2-buttons",
"version": "28.1.33",
"version": "28.1.37",
"description": "A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch.",
"author": "Syncfusion Inc.",
"license": "SEE LICENSE IN license",
Expand Down
8 changes: 8 additions & 0 deletions controls/buttons/spec/switch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ describe('Switch', () => {
element.parentElement.click();
expect(element.parentElement.children[1].classList.contains('e-switch-active')).toEqual(false);
});
it('Programmatic input click updates checked state correctly', () => {
specSwitch = new Switch({change: changeFn}, '#specSwitch');
expect(specSwitch.checked).toEqual(false);
element.click();
expect(specSwitch.checked).toEqual(true);
expect(element.checked).toEqual(true);
expect(i).toEqual(1);
});
it('Switch with change event', () => {
specSwitch = new Switch({change: changeFn}, '#specSwitch');
element.parentElement.click();
Expand Down
2 changes: 1 addition & 1 deletion controls/buttons/src/switch/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
private clickHandler(evt?: Event): void {
this.isDrag = false;
this.focusOutHandler();
const beforeChangeEventArgs: BeforeChangeEventArgs = { event: evt, cancel: false, checked: this.element.checked };
const beforeChangeEventArgs: BeforeChangeEventArgs = { event: evt, cancel: false, checked: this.checked };
this.trigger('beforeChange', beforeChangeEventArgs);
if (!beforeChangeEventArgs.cancel) {
this.changeState(!beforeChangeEventArgs.checked);
Expand Down
10 changes: 9 additions & 1 deletion controls/calendars/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

## [Unreleased]

## 28.1.38 (2025-01-07)
## 28.1.39 (2024-01-14)

### DateRangePicker

#### Bug Fixes

- `#I666998` - Fixed an issue where the start and end date selection was not maintained in the popup.

## 28.1.37 (2024-12-31)

### DateRangePicker

Expand Down
2 changes: 1 addition & 1 deletion controls/calendars/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@syncfusion/ej2-calendars",
"version": "28.1.35",
"version": "28.1.37",
"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.",
"author": "Syncfusion Inc.",
"license": "SEE LICENSE IN license",
Expand Down
22 changes: 11 additions & 11 deletions controls/calendars/spec/daterangepicker/daterangepicker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7734,8 +7734,8 @@ describe('DateRangePicker', () => {
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[2]).dispatchEvent(clickEvent);
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-year')).toBe(true);
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-year')).toBe(true);
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 1, 2019');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Mar 31, 2019');
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 8, 2019');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Mar 10, 2019');
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
Expand All @@ -7756,8 +7756,8 @@ describe('DateRangePicker', () => {
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[5]).dispatchEvent(clickEvent);;
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-year')).toBe(true);
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-year')).toBe(true);
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 1, 2011');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jun 30, 2039');
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 8, 2011');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jun 10, 2039');
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
Expand All @@ -7773,8 +7773,8 @@ describe('DateRangePicker', () => {
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[2]).dispatchEvent(clickEvent);
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-decade')).toBe(true);
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-decade')).toBe(true);
expect(document.querySelector('.e-start-label').innerHTML).toBe('Jan 1, 2011');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Dec 31, 2021');
expect(document.querySelector('.e-start-label').innerHTML).toBe('Jan 8, 2011');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jan 10, 2021');
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
Expand All @@ -7798,8 +7798,8 @@ describe('DateRangePicker', () => {
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[2]).dispatchEvent(clickEvent);
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-decade')).toBe(true);
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-decade')).toBe(true);
expect(document.querySelector('.e-start-label').innerHTML).toBe('Jan 1, 2011');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Dec 31, 2031');
expect(document.querySelector('.e-start-label').innerHTML).toBe('Jan 8, 2011');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jan 10, 2031');
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
Expand All @@ -7824,8 +7824,8 @@ describe('DateRangePicker', () => {
(<HTMLElement>document.querySelectorAll('.e-right-calendar .e-content td')[5]).dispatchEvent(clickEvent);
expect(document.querySelector('.e-left-calendar .e-content').classList.contains('e-year')).toBe(true);
expect(document.querySelector('.e-right-calendar .e-content').classList.contains('e-year')).toBe(true);
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 1, 2011');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jun 30, 2039');
expect(document.querySelector('.e-start-label').innerHTML).toBe('Mar 8, 2011');
expect(document.querySelector('.e-end-label').innerHTML).toBe('Jun 10, 2039');
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-next')).dispatchEvent(clickEvent);
expect(document.querySelectorAll('.e-end-date').length).toBe(0);
(<HTMLElement>document.querySelector('.e-right-calendar .e-header .e-prev')).dispatchEvent(clickEvent);
Expand Down Expand Up @@ -8221,7 +8221,7 @@ describe('DateRangePicker', () => {
expect(document.querySelector('.e-end-btn').innerHTML).toBe('Dec 31, 2037');
});
it('start as Decade and Depth as Year on property', () => {
daterangepicker = createControl({ value: [new Date('1/1/2019'), new Date('1/31/2039')] },true);
daterangepicker = createControl({ value: [new Date('1/1/2019'), new Date('1/30/2039')] },true);
expect(daterangepicker.start).toBe('Month');
expect(daterangepicker.depth).toBe('Month');
daterangepicker.depth = 'Year';
Expand Down
61 changes: 42 additions & 19 deletions controls/calendars/src/daterangepicker/daterangepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1544,10 +1544,8 @@ export class DateRangePicker extends CalendarBase {
if (range.length > 1) {
this.invalidValueString = null;
const dateOptions: object = { format: this.formatString, type: 'date', skeleton: 'yMd' };
const start : Date = this.globalize.parseDate(this.getAmPmValue(range[0]), dateOptions);
const end : Date = this.globalize.parseDate(this.getAmPmValue(range[1]), dateOptions);
const startDate: Date = this.getStartEndDate(start, false, range, dateOptions);
const endDate: Date = this.getStartEndDate(end, true, range, dateOptions);
const startDate: Date = this.globalize.parseDate(this.getAmPmValue(range[0]).trim(), dateOptions);
const endDate: Date = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), dateOptions);
if (!isNullOrUndefined(startDate) && !isNaN(+startDate) && !isNullOrUndefined(endDate) && !isNaN(+endDate)) {
const prevStartVal: Date = this.startValue;
this.startValue = startDate;
Expand Down Expand Up @@ -1617,12 +1615,10 @@ export class DateRangePicker extends CalendarBase {
this.updateHiddenInput();
}

private getStartEndDate(date: Date, isEnd: boolean, range: string[], dateOptions: object): Date {
if (this.depth === 'Month') {
return this.globalize.parseDate(this.getAmPmValue(range[isEnd ? 1 : 0]).trim(), dateOptions);
} else if (this.depth === 'Year' && !isNullOrUndefined(date)) {
private getStartEndDate(date: Date, isEnd: boolean): Date {
if (this.currentView() === 'Year' && !isNullOrUndefined(date)) {
return new Date(date.getFullYear(), date.getMonth() + (isEnd ? 1 : 0), isEnd ? 0 : 1);
} else if (!isNullOrUndefined(date)) {
} else if (this.currentView() === 'Decade' && !isNullOrUndefined(date)) {
return new Date(date.getFullYear(), isEnd ? 11 : 0, isEnd ? 31 : 1);
} else {
return null;
Expand Down Expand Up @@ -2087,7 +2083,7 @@ export class DateRangePicker extends CalendarBase {
const isDisabledCell: boolean = (!ele.classList.contains(DISABLED) || ele.classList.contains(DATEDISABLED));
if (!ele.classList.contains(WEEKNUMBER) && isDisabledCell) {
const eleDate: Date = this.getIdValue(null, ele);
const startDateValue: Date = new Date(+this.startValue);
const startDateValue: Date = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
const eleDateValue: Date = new Date(+eleDate);
if (eleDateValue.setHours(0, 0, 0, 0) >= startDateValue.setHours(0, 0, 0, 0) && +eleDate <= +currentDate) {
addClass([ele], RANGEHOVER);
Expand Down Expand Up @@ -2126,9 +2122,11 @@ export class DateRangePicker extends CalendarBase {
const eleDate: Date = this.getIdValue(null, ele);
const eleDateValue: Date = this.getIdValue(null, ele);
if (!isNullOrUndefined(this.endValue)) {
const eleStartDateValue: Date = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
const eleEndDateValue: Date = this.currentView() === 'Month' ? new Date(+this.endValue) : this.getStartEndDate(new Date(+this.endValue), true);
if (this.currentView() === this.depth &&
+eleDateValue.setHours(0, 0, 0, 0) >= +new Date(+this.startValue).setHours(0, 0, 0, 0)
&& +eleDateValue.setHours(0, 0, 0, 0) <= +new Date(+this.endValue).setHours(0, 0, 0, 0) &&
+eleDateValue.setHours(0, 0, 0, 0) >= +eleStartDateValue.setHours(0, 0, 0, 0)
&& +eleDateValue.setHours(0, 0, 0, 0) <= +eleEndDateValue.setHours(0, 0, 0, 0) &&
!this.isSameStartEnd(new Date(+this.startValue), new Date(+this.endValue)) &&
+new Date(+this.startValue).setHours(0, 0, 0, 0) >= +this.min
&& +new Date(+this.endValue).setHours(0, 0, 0, 0) <= +this.max
Expand All @@ -2147,7 +2145,7 @@ export class DateRangePicker extends CalendarBase {
removeClass([ele], [RANGEHOVER]);
}
if (!ele.classList.contains(OTHERMONTH)) {
const startDateValue: Date = new Date(+this.startValue);
const startDateValue: Date = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
let eleDateValue: Date = new Date(+eleDate);
if (this.currentView() === this.depth &&
+eleDateValue.setHours(0, 0, 0, 0) === +startDateValue.setHours(0, 0, 0, 0)
Expand All @@ -2158,7 +2156,7 @@ export class DateRangePicker extends CalendarBase {
addClass([ele], [STARTDATE, SELECTED]);
this.addSelectedAttributes(ele, this.startValue, true);
}
const endDateValue: Date = new Date(+this.endValue);
const endDateValue: Date = this.currentView() === 'Month' ? new Date(+this.endValue) : this.getStartEndDate(new Date(+this.endValue), true);
if (this.currentView() === 'Year') {
eleDateValue = new Date(eleDateValue.getFullYear(), eleDateValue.getMonth() + 1, 0);
} else if (this.currentView() === 'Decade') {
Expand Down Expand Up @@ -2249,14 +2247,39 @@ export class DateRangePicker extends CalendarBase {
if (event) {
event.preventDefault();
}
const date: Date = isNullOrUndefined(event) ? this.getIdValue(null, element)
let isValue: boolean;
let startDateValue : Date;
let endDateValue : Date;
const value: string = (<HTMLInputElement>this.inputElement).value;
if (!isNullOrUndefined(value) && value.trim() !== '') {
const range: string[] = value.split(' ' + this.separator + ' ');
if (range.length > 1 && ((this.currentView() === 'Year' && this.depth === 'Year')
|| (this.currentView() === 'Decade' && this.depth === 'Decade'))) {
const dateOptions: object = { format: this.formatString, type: 'date', skeleton: 'yMd' };
startDateValue = this.globalize.parseDate(this.getAmPmValue(range[0]).trim(), dateOptions);
endDateValue = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), dateOptions);
isValue = true;
}
}
let date: Date = isNullOrUndefined(event) ? this.getIdValue(null, element)
: this.getIdValue(event, null);
if (!isNullOrUndefined(this.startValue)) {
if (this.currentView() === 'Year' && this.depth === 'Year') {
date = new Date(date.getFullYear(), date.getMonth(), this.startValue.getDate());
} else if (this.currentView() === 'Decade' && this.depth === 'Decade') {
date = new Date(date.getFullYear(), this.startValue.getMonth(), this.startValue.getDate());
}
}
const y: number = date.getFullYear();
const m: number = date.getMonth();
const firstDay: Date = new Date(y, m, 1);
const lastDay: Date = new Date(y, m + 1, 0);
const firstMonth: Date = new Date(y, 0, 1);
const lastMonth: Date = new Date(y, 11, 31);
const firstDay: Date = isValue ? new Date(y, m, startDateValue.getDate(), startDateValue.getHours(), startDateValue.getMinutes(),
startDateValue.getSeconds()) : new Date(y, m, 1);
const lastDay: Date = isValue ? new Date(y, m, endDateValue.getDate(), endDateValue.getHours(), endDateValue.getMinutes(),
endDateValue.getSeconds()) : new Date(y, m + 1, 0);
const firstMonth: Date = isValue ? new Date(y, startDateValue.getMonth(), startDateValue.getDate(), startDateValue.getHours(),
startDateValue.getMinutes(), startDateValue.getSeconds()) : new Date(y, 0, 1);
const lastMonth: Date = isValue ? new Date(y, endDateValue.getMonth(), endDateValue.getDate(), endDateValue.getHours(),
endDateValue.getMinutes(), endDateValue.getSeconds()) : new Date(y, 11, 31);
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue)) {
if (!this.isMobile || this.isMobile && !this.endButton.element.classList.contains(ACTIVE)) {
this.removeSelection();
Expand Down
8 changes: 8 additions & 0 deletions controls/charts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## [Unreleased]

## 28.1.39 (2024-01-14)

### Chart

#### Bug Fixes

- `#I663652` - The calculations for both sum and intermediate sum indexes have been corrected.

## 28.1.38 (2025-01-07)

### Chart
Expand Down
2 changes: 1 addition & 1 deletion controls/charts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@syncfusion/ej2-charts",
"version": "28.1.37",
"version": "28.1.38",
"description": "Feature-rich chart control with built-in support for over 25 chart types, technical indictors, trendline, zooming, tooltip, selection, crosshair and trackball.",
"author": "Syncfusion Inc.",
"license": "SEE LICENSE IN license",
Expand Down
Loading

0 comments on commit bdbf4ad

Please sign in to comment.