Skip to content

[pull] master from syncfusion:master #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]

## 29.2.4 (2025-05-14)
## 29.2.5 (2025-05-21)

### Barcode

Expand Down
2 changes: 1 addition & 1 deletion controls/base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## [Unreleased]

## 29.2.4 (2025-05-14)
## 29.2.5 (2025-05-21)

### Common

Expand Down
8 changes: 8 additions & 0 deletions controls/buttons/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## [Unreleased]

## 29.2.5 (2025-05-21)

### Switch

#### Bug Fixes

- `#I959152` - Fixed the issue of the click event being triggered twice when placing a switch within a label tag. Additionally, resolved a script error that occurred when placing the switch within a dialog.

## 29.1.33 (2025-03-25)

### Chip
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": "29.1.33",
"version": "29.2.4",
"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
9 changes: 8 additions & 1 deletion controls/buttons/spec/check-box.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,13 @@ describe('CheckBox', () => {
checkbox.getLabel();
checkbox.appendTo('#checkbox');
});

it('Vue CheckBox with updateVueArrayModel function', function () {
checkbox = new CheckBox({ indeterminate: null });
checkbox.isVue = true;
checkbox.value = ['games', 'volleyball'];
checkbox.appendTo('#checkbox');
checkbox.element.value = 'volleyball';
checkbox.updateVueArrayModel();
});
});
});
34 changes: 29 additions & 5 deletions controls/buttons/spec/switch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,22 +434,25 @@ describe('Switch', () => {

describe('Parent element click event prevented while clicking on switch component', () => {
let switchBtn: Switch;
let input: HTMLElement;
let parentElement: HTMLElement;
let input: HTMLElement; let input1: HTMLElement;
let parentElement: HTMLElement; let parentElement1: HTMLElement;
let parentChecked: boolean = false;
beforeEach(() => {
parentElement = createElement('div', {
id: 'form'
}) as HTMLElement;
parentElement = createElement('div', { id: 'form' }) as HTMLElement;
parentElement1 = createElement('label', { id: 'label1' }) as HTMLElement;
input = createElement('input', { id: 'switch1' }) as HTMLElement;
input1 = createElement('input', { id: 'switch2' }) as HTMLElement;
parentElement.appendChild(input);
parentElement1.appendChild(input1);
parentElement.onclick = function () {
parentChecked = true;
}
document.body.appendChild(parentElement);
document.body.appendChild(parentElement1);
});
afterEach(() => {
parentElement.remove();
parentElement1.remove();
switchBtn.destroy();
})
it('ej2-918217: Parent element click event prevented while clicking on switch component in angular platforms.', () => {
Expand All @@ -459,6 +462,27 @@ describe('Switch', () => {
switchBtn.click();
expect(parentChecked).toBeTruthy();
});
it('959152: Click event trigger twice when we placed switch component within the label tag', () => {
switchBtn = new Switch({
checked: true
}, '#switch2');
switchBtn.element.parentElement.click();
expect(switchBtn.checked).toEqual(false);
});
it('Coverage improvement for switch focus handler', () => {
switchBtn = new Switch({
checked: true
}, '#switch1');
switchBtn.isAngular = true;
(switchBtn as any).mouseLeaveHandler();
const keyArgs: KeyboardEvent = new KeyboardEvent('keyup', {
key: 'space',
code: 'Space',
bubbles: true,
cancelable: true
});
(switchBtn as any).switchFocusHandler(keyArgs);
});
});

describe('Switch in HTML5 forms', () => {
Expand Down
14 changes: 8 additions & 6 deletions controls/buttons/src/check-box/check-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,15 +591,17 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp

protected unWireEvents(): void {
const wrapper: Element = this.wrapper;
EventHandler.remove(wrapper, 'click', this.clickHandler);
EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
EventHandler.remove(this.element, 'focus', this.focusHandler);
EventHandler.remove(this.element, 'focusout', this.focusOutHandler);
const label: Element = wrapper.getElementsByTagName('label')[0];
if (label) {
EventHandler.remove(label, 'mousedown', this.labelMouseDownHandler);
EventHandler.remove(label, 'mouseup', this.labelMouseUpHandler);
EventHandler.remove(label, 'mouseleave', this.labelMouseLeaveHandler);
if (wrapper) {
EventHandler.remove(wrapper, 'click', this.clickHandler);
const label: Element = wrapper.getElementsByTagName('label')[0];
if (label) {
EventHandler.remove(label, 'mousedown', this.labelMouseDownHandler);
EventHandler.remove(label, 'mouseup', this.labelMouseUpHandler);
EventHandler.remove(label, 'mouseleave', this.labelMouseLeaveHandler);
}
}
const formElem: HTMLFormElement = <HTMLFormElement>closest(this.element, 'form');
if (formElem) {
Expand Down
12 changes: 7 additions & 5 deletions controls/buttons/src/radio-button/radio-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,13 @@ export class RadioButton extends Component<HTMLInputElement> implements INotifyP
EventHandler.remove(this.element, 'focus', this.focusHandler);
EventHandler.remove(this.element, 'focusout', this.focusOutHandler);
EventHandler.remove(this.element, 'keyup', this.keyUpHandler);
const rippleLabel: Element = label.getElementsByTagName('label')[0];
if (rippleLabel) {
EventHandler.remove(rippleLabel, 'mousedown', this.labelMouseDownHandler);
EventHandler.remove(rippleLabel, 'mouseup', this.labelMouseUpHandler);
EventHandler.remove(rippleLabel, 'mouseleave', this.labelMouseLeaveHandler);
if (label) {
const rippleLabel: Element = label.getElementsByTagName('label')[0];
if (rippleLabel) {
EventHandler.remove(rippleLabel, 'mousedown', this.labelMouseDownHandler);
EventHandler.remove(rippleLabel, 'mouseup', this.labelMouseUpHandler);
EventHandler.remove(rippleLabel, 'mouseleave', this.labelMouseLeaveHandler);
}
}
if (this.formElement) {
EventHandler.remove(this.formElement, 'reset', this.formResetHandler);
Expand Down
27 changes: 18 additions & 9 deletions controls/buttons/src/switch/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
}
}
private clickHandler(evt?: Event): void {
if (evt && this.element.closest('label')) {
if (evt.target !== this.element) { return; }
}
this.isDrag = false;
this.focusOutHandler();
const beforeChangeEventArgs: BeforeChangeEventArgs = { event: evt, cancel: false, checked: this.checked };
Expand All @@ -191,7 +194,9 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
if (this.formElement) {
EventHandler.remove(this.formElement, 'reset', this.formResetHandler);
}
destroy(this, this.getWrapper() as Element, this.tagName);
if (this.getWrapper()) {
destroy(this, this.getWrapper() as Element, this.tagName);
}
if (this.refreshing) {
['e-control', 'e-switch', 'e-lib'].forEach((key: string) => {
this.element.classList.add(key);
Expand Down Expand Up @@ -514,14 +519,18 @@ export class Switch extends Component<HTMLInputElement> implements INotifyProper
}
private unWireEvents(): void {
const wrapper: Element = this.getWrapper() as Element;
EventHandler.remove(wrapper, 'click', this.clickHandler);
EventHandler.remove(this.element, 'focus', this.focusHandler);
EventHandler.remove(this.element, 'focusout', this.focusOutHandler);
EventHandler.remove(this.element, 'mouseup', this.delegateMouseUpHandler);
EventHandler.remove(this.element, 'keyup', this.delegateKeyUpHandler);
EventHandler.remove(wrapper, 'mousedown mouseup', this.rippleHandler);
EventHandler.remove(wrapper, 'mouseleave', this.mouseLeaveHandler);
EventHandler.remove(wrapper, 'touchstart touchmove touchend', this.switchMouseUp);
if (wrapper) {
EventHandler.remove(wrapper, 'click', this.clickHandler);
EventHandler.remove(wrapper, 'mousedown mouseup', this.rippleHandler);
EventHandler.remove(wrapper, 'mouseleave', this.mouseLeaveHandler);
EventHandler.remove(wrapper, 'touchstart touchmove touchend', this.switchMouseUp);
}
if (this.element) {
EventHandler.remove(this.element, 'focus', this.focusHandler);
EventHandler.remove(this.element, 'focusout', this.focusOutHandler);
EventHandler.remove(this.element, 'mouseup', this.delegateMouseUpHandler);
EventHandler.remove(this.element, 'keyup', this.delegateKeyUpHandler);
}
}

/**
Expand Down
8 changes: 8 additions & 0 deletions controls/calendars/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## [Unreleased]

## 29.2.5 (2025-05-21)

### DatePicker

#### Bug Fixes

- `#I711579` - Fixed an issue where the DatePicker popup did not close on mobile devices when clicking outside of it.

## 29.1.40 (2025-04-29)

### 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": "29.1.40",
"version": "29.2.4",
"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
9 changes: 6 additions & 3 deletions controls/calendars/src/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1145,10 +1145,13 @@ export class DatePicker extends Calendar implements IInput {
const target: HTMLElement = <HTMLElement>e.target;
if (!(closest(target, '.e-datepicker.e-popup-wrapper')) && !isNullOrUndefined(this.inputWrapper)
&& !(closest(target, '.' + INPUTCONTAINER) === this.inputWrapper.container)
&& (!target.classList.contains('e-day'))
&& (!target.classList.contains('e-dlg-overlay'))) {
&& (!target.classList.contains('e-day'))) {
this.hide(e);
this.focusOut();
if (target.classList.contains('e-dlg-overlay')) {
e.preventDefault();
} else {
this.focusOut();
}
} else if (closest(target, '.e-datepicker.e-popup-wrapper')) {
// Fix for close the popup when select the previously selected value.
if ( target.classList.contains('e-day')
Expand Down
8 changes: 6 additions & 2 deletions controls/calendars/src/datetimepicker/datetimepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,10 +1180,14 @@ export class DateTimePicker extends DatePicker {
event.preventDefault();
}
if (!(closest(target, '[id="' + (this.popupObject && this.popupObject.element.id + '"]'))) && target !== this.inputElement
&& target !== this.timeIcon && !isNullOrUndefined(this.inputWrapper) && target !== this.inputWrapper.container && !target.classList.contains('e-dlg-overlay')) {
&& target !== this.timeIcon && !isNullOrUndefined(this.inputWrapper) && target !== this.inputWrapper.container) {
if (this.isTimePopupOpen()) {
this.hide(event);
this.focusOut();
if (target.classList.contains('e-dlg-overlay')) {
event.preventDefault();
} else {
this.focusOut();
}
}
} else if (target !== this.inputElement) {
if (!Browser.isDevice) {
Expand Down
9 changes: 6 additions & 3 deletions controls/calendars/src/timepicker/timepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2454,11 +2454,14 @@ export class TimePicker extends Component<HTMLElement> implements IInput {
if (!(closest(target, '[id="' + this.popupObj.element.id + '"]')) && target !== this.inputElement
&& target !== (this.inputWrapper && this.inputWrapper.buttons[0]) &&
target !== (this.inputWrapper && this.inputWrapper.clearButton) &&
target !== (this.inputWrapper && this.inputWrapper.container)
&& (!target.classList.contains('e-dlg-overlay'))) {
target !== (this.inputWrapper && this.inputWrapper.container)) {
if (this.isPopupOpen()) {
this.hide();
this.focusOut();
if (target.classList.contains('e-dlg-overlay')) {
event.preventDefault();
} else {
this.focusOut();
}
}
} else if (target !== this.inputElement) {
if (!Browser.isDevice) {
Expand Down
13 changes: 13 additions & 0 deletions controls/charts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

## [Unreleased]

## 29.2.5 (2025-05-21)

### Chart

#### Features

- `#I668455` - Provided support for setting offset values for labels in category axes.

#### Bug Fixes

- `#I722486` - Chart empty point mode now works properly in ASP.NET MVC Chart.
- `#I725935` - Console error no longer occurs when toggling combination line and stacked area series.

## 29.2.4 (2025-05-14)

### 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": "29.1.41",
"version": "29.2.4",
"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
8 changes: 8 additions & 0 deletions controls/charts/src/chart/axis/axis-model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,14 @@ export interface AxisModel {
*/
description?: string;

/**
* Specifies an offset value that determines where the first label appears on the category axis.
* This helps control the alignment of axis labels by shifting the starting position.
*
* @default null
*/
intervalOffset?: number;

/**
* The `tabIndex` value for the axis, determining its position in the tab order.
*
Expand Down
9 changes: 9 additions & 0 deletions controls/charts/src/chart/axis/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,15 @@ export class Axis extends ChildProperty<Axis> {
@Property(null)
public description: string;

/**
* Specifies an offset value that determines where the first label appears on the category axis.
* This helps control the alignment of axis labels by shifting the starting position.
*
* @default null
*/
@Property(null)
public intervalOffset: number;

/**
* The `tabIndex` value for the axis, determining its position in the tab order.
*
Expand Down
2 changes: 1 addition & 1 deletion controls/charts/src/chart/axis/category-axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class Category extends NiceInterval {
/** Generate axis labels */
axis.visibleLabels = [];
axis.visibleRange.interval = axis.visibleRange.interval < 1 ? 1 : axis.visibleRange.interval;
let tempInterval: number = Math.ceil(axis.visibleRange.min);
let tempInterval: number = axis.intervalOffset ? axis.intervalOffset : Math.ceil(axis.visibleRange.min);
let labelStyle: Font;
if (axis.zoomFactor < 1 || axis.zoomPosition > 0) {
tempInterval = axis.visibleRange.min - (axis.visibleRange.min % axis.visibleRange.interval);
Expand Down
5 changes: 3 additions & 2 deletions controls/charts/src/chart/series/stacking-area-series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class StackingAreaSeries extends LineBase {
if (visiblePoints[i as number].visible && withInRange(visiblePoints[i - 1], visiblePoints[i as number],
visiblePoints[i + 1], series)) {
const startvalue: number = series.index > 0 && index !== undefined ?
this.chart.visibleSeries[index as number].stackedValues.endValues[pointIndex as number] :
this.chart.visibleSeries[series.index as number].stackedValues.endValues[pointIndex as number] :
stackedvalue.startValues[pointIndex as number];
point1 = getCoordinate(
visiblePoints[i as number].xValue, (!series.visible && series.isLegendClicked) ? startvalue :
Expand Down Expand Up @@ -118,7 +118,8 @@ export class StackingAreaSeries extends LineBase {
const previousSeries: Series = this.getPreviousSeries(series);
if (previousSeries.emptyPointSettings.mode !== 'Drop' || !previousSeries.points[j as number].isEmpty) {
point2 = getCoordinate(visiblePoints[j as number].xValue, (!series.visible && series.isLegendClicked && series.index > 0
&& index !== undefined) ? this.chart.visibleSeries[index as number].stackedValues.endValues[pointIndex as number]
&& index !== undefined) ?
this.chart.visibleSeries[series.index as number].stackedValues.endValues[pointIndex as number]
: stackedvalue.startValues[pointIndex as number], xAxis, yAxis, isInverted, series);
if (stackedvalue.startValues[pointIndex as number] === stackedvalue.endValues[pointIndex as number]) {
point2.y = Math.floor(point2.y);
Expand Down
2 changes: 1 addition & 1 deletion controls/charts/src/common/model/base-model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ export interface EmptyPointSettingsModel {
* @default Gap
*/

mode?: EmptyPointMode | AccEmptyPointMode;
mode?: EmptyPointMode;

}

Expand Down
2 changes: 1 addition & 1 deletion controls/charts/src/common/model/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ export class EmptyPointSettings extends ChildProperty<EmptyPointSettings> {
*/

@Property('Gap')
public mode: EmptyPointMode | AccEmptyPointMode;
public mode: EmptyPointMode;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion controls/diagrams/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#### Bug Fixes

- `#I952617` - Connectors in the layout will now render with the correct appearance when a specific type is explicitly defined in the `getConnectorDefaults` function.
- `#I713407` - Connectors in the layout will now render with the correct appearance when a specific type is explicitly defined in the `getConnectorDefaults` function.
- `#F196439` - Independent nodes in complex hierarchical trees will now render without overlapping other nodes.
- `#I700206` - Now connectors will not overlap nodes of varying size in layout.
- `#I713490` - Now the nodes will have property defined in `getNodeDefaults` on performing undo and redo.
Expand Down
Loading