Skip to content

Commit 6597099

Browse files
author
pipeline
committed
v18.4.46 is released
1 parent e1ca32e commit 6597099

File tree

219 files changed

+12053
-8645
lines changed

Some content is hidden

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

219 files changed

+12053
-8645
lines changed

controls/base/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-base",
3-
"version": "18.4.43",
3+
"version": "18.4.44",
44
"description": "A common package of Essential JS 2 base libraries, methods and class definitions",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/buttons/CHANGELOG.md

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

33
## [Unreleased]
44

5+
## 18.4.44 (2021-02-23)
6+
7+
### CheckBox
8+
9+
#### Bug Fixes
10+
11+
- Issue with destroy has been fixed.
12+
513
## 18.4.41 (2021-02-02)
614

715
### CheckBox

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.4.41",
3+
"version": "18.4.44",
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/radio-button.spec.ts

+5
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ describe('RadioButton', () => {
149149
let htmlele: Element = document.body;
150150
expect(window.getComputedStyle(htmlele).backgroundColor).toBe('rgb(0, 0, 255)');
151151
});
152+
it('Enable Html Attributes testing', () => {
153+
radio = new RadioButton({ htmlAttributes: {'title':'Choose Option'}, label: '<style>body{background:rgb(0, 0, 255)}</style>' }, '#radio');
154+
let htmlele: Element = document.body;
155+
expect(window.getComputedStyle(htmlele).backgroundColor).toBe('rgb(0, 0, 255)');
156+
});
152157
});
153158

154159
describe('Notify property changes of', () => {

controls/buttons/src/check-box/check-box.ts

+12-5
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
238238
}
239239

240240
private focusOutHandler(): void {
241-
this.getWrapper().classList.remove('e-focus');
241+
let wrapper: Element = this.getWrapper();
242+
if (wrapper) {
243+
wrapper.classList.remove('e-focus');
244+
}
242245
this.isFocused = false;
243246
}
244247

@@ -259,7 +262,7 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
259262
}
260263

261264
private getWrapper(): Element {
262-
if (this.element.parentElement) {
265+
if (this.element && this.element.parentElement) {
263266
return this.element.parentElement.parentElement;
264267
} else {
265268
return null;
@@ -455,15 +458,19 @@ export class CheckBox extends Component<HTMLInputElement> implements INotifyProp
455458
}
456459

457460
private setText(text: string): void {
458-
let label: Element = this.getWrapper().getElementsByClassName(LABEL)[0];
461+
let wrapper: Element = this.getWrapper();
462+
if (!wrapper) {
463+
return;
464+
}
465+
let label: Element = wrapper.getElementsByClassName(LABEL)[0];
459466
if (label) {
460467
label.textContent = text;
461468
} else {
462469
text = (this.enableHtmlSanitizer) ? SanitizeHtmlHelper.sanitize(text) : text;
463470
label = this.createElement('span', { className: LABEL, innerHTML: text });
464-
let labelWrap: Element = this.getWrapper().getElementsByTagName('label')[0];
471+
let labelWrap: Element = wrapper.getElementsByTagName('label')[0];
465472
if (this.labelPosition === 'Before') {
466-
labelWrap.insertBefore(label, this.getWrapper().getElementsByClassName(FRAME)[0]);
473+
labelWrap.insertBefore(label, wrapper.getElementsByClassName(FRAME)[0]);
467474
} else {
468475
labelWrap.appendChild(label);
469476
}

controls/buttons/src/radio-button/radio-button.ts

+28-17
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ export class RadioButton extends Component<HTMLInputElement> implements INotifyP
130130

131131
private changeHandler(event: Event): void {
132132
this.checked = true; this.dataBind();
133-
let value: string = this.isVue ? this.element.value : this.value;
133+
let value: string = this.element.getAttribute('value');
134+
value = this.isVue && value ? this.element.value : this.value;
134135
this.trigger('change', <ChangeArgs>{ value: value, event: event });
135136
if (this.tagName === 'EJS-RADIOBUTTON') {
136137
event.stopPropagation();
@@ -181,7 +182,10 @@ export class RadioButton extends Component<HTMLInputElement> implements INotifyP
181182
}
182183

183184
private focusOutHandler(): void {
184-
this.getLabel().classList.remove('e-focus');
185+
let label: Element = this.getLabel();
186+
if (label) {
187+
label.classList.remove('e-focus');
188+
}
185189
}
186190

187191
protected getModuleName(): string {
@@ -215,7 +219,11 @@ export class RadioButton extends Component<HTMLInputElement> implements INotifyP
215219
}
216220

217221
private getLabel(): Element {
218-
return this.element.nextElementSibling;
222+
if (this.element) {
223+
return this.element.nextElementSibling;
224+
} else {
225+
return null;
226+
}
219227
}
220228

221229
private initialize(): void {
@@ -227,10 +235,11 @@ export class RadioButton extends Component<HTMLInputElement> implements INotifyP
227235
if (this.name) {
228236
this.element.setAttribute('name', this.name);
229237
}
230-
if (this.isVue && this.element.value && this.element.value === this.value) {
238+
let value: string = this.element.getAttribute('value');
239+
if (this.isVue && value && value === this.value) {
231240
this.checked = true;
232241
}
233-
if (this.value && (!this.isVue || !this.element.value)) {
242+
if (this.isVue ? this.value && !value : this.value) {
234243
this.element.setAttribute('value', this.value);
235244
}
236245
if (this.checked) {
@@ -393,18 +402,20 @@ export class RadioButton extends Component<HTMLInputElement> implements INotifyP
393402

394403
private setText(text: string): void {
395404
let label: Element = this.getLabel();
396-
let textLabel: Element = label.getElementsByClassName(LABEL)[0];
397-
if (textLabel) {
398-
textLabel.textContent = text;
399-
} else {
400-
text = (this.enableHtmlSanitizer) ? SanitizeHtmlHelper.sanitize(text) : text;
401-
textLabel = this.createElement('span', { className: LABEL, innerHTML: text });
402-
label.appendChild(textLabel);
403-
}
404-
if (this.labelPosition === 'Before') {
405-
this.getLabel().classList.add('e-right');
406-
} else {
407-
this.getLabel().classList.remove('e-right');
405+
if (label) {
406+
let textLabel: Element = label.getElementsByClassName(LABEL)[0];
407+
if (textLabel) {
408+
textLabel.textContent = text;
409+
} else {
410+
text = (this.enableHtmlSanitizer) ? SanitizeHtmlHelper.sanitize(text) : text;
411+
textLabel = this.createElement('span', { className: LABEL, innerHTML: text });
412+
label.appendChild(textLabel);
413+
}
414+
if (this.labelPosition === 'Before') {
415+
this.getLabel().classList.add('e-right');
416+
} else {
417+
this.getLabel().classList.remove('e-right');
418+
}
408419
}
409420
}
410421

controls/calendars/src/calendar/calendar.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export class CalendarBase extends Component<HTMLElement> implements INotifyPrope
102102
protected isDateSelected: boolean = true;
103103
private blazorRef: object;
104104
private serverModuleName: string;
105+
protected timezone: string;
105106
protected defaultKeyConfigs: { [key: string]: string };
106107
protected previousDateTime: Date;
107108
protected isTodayClicked: boolean = false;
@@ -974,7 +975,7 @@ export class CalendarBase extends Component<HTMLElement> implements INotifyPrope
974975
protected renderDays(currentDate: Date, value?: Date, multiSelection?: boolean, values?: Date[], isTodayDate?: boolean): HTMLElement[] {
975976
let tdEles: HTMLElement[] = [];
976977
let cellsCount: number = 42;
977-
let todayDate: Date = isTodayDate ? new Date(+currentDate) : new Date();
978+
let todayDate: Date = isTodayDate ? new Date(+currentDate) : this.getDate(new Date(), this.timezone);
978979
let localDate: Date = new Date(this.checkValue(currentDate));
979980
let minMaxDate: Date;
980981
let numCells: number = this.weekNumber ? 8 : 7;
@@ -2146,6 +2147,12 @@ export class CalendarBase extends Component<HTMLElement> implements INotifyPrope
21462147
this.setProperties({ depth: 'Month' }, true);
21472148
}
21482149
}
2150+
protected getDate(date: Date, timezone: string): Date {
2151+
if (timezone) {
2152+
date = new Date(date.toLocaleString('en-US', { timeZone: timezone }));
2153+
}
2154+
return date;
2155+
}
21492156
}
21502157

21512158
/**
@@ -2288,6 +2295,9 @@ export class Calendar extends CalendarBase {
22882295
let timeZoneDiff: number = serverTimezoneDiff + clientTimeZoneDiff;
22892296
timeZoneDiff = this.isDayLightSaving() ? timeZoneDiff-- : timeZoneDiff;
22902297
this.value = new Date(this.value.getTime() + (timeZoneDiff * 60 * 60 * 1000));
2298+
} else if (!isNullOrUndefined(this.timezone)) {
2299+
let date: Date = this.value || new Date();
2300+
this.setProperties({ value: super.getDate(date, this.timezone) }, true);
22912301
}
22922302
}
22932303
protected formResetHandler(): void {
@@ -2346,7 +2356,7 @@ export class Calendar extends CalendarBase {
23462356
protected todayButtonClick(e?: MouseEvent | KeyboardEvent): void {
23472357
if (this.showTodayButton) {
23482358
let tempValue: Date = this.generateTodayVal(this.value);
2349-
this.setProperties({ value: tempValue }, true);
2359+
this.setProperties({ value: super.getDate(tempValue, this.timezone) }, true);
23502360
this.isTodayClicked = true;
23512361
this.todayButtonEvent = e;
23522362
if (this.isMultiSelection) {

controls/charts/CHANGELOG.md

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

33
## [Unreleased]
44

5+
## 18.4.46 (2021-03-02)
6+
7+
### Chart
8+
9+
#### Bug Fixes
10+
11+
- `#156827` - Axis line break label alignment issue has been fixed.
12+
513
## 18.4.44 (2021-02-23)
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": "18.4.43",
3+
"version": "18.4.44",
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)