Skip to content

Commit 23c7582

Browse files
author
pipeline
committed
v19.1.65 is released
1 parent 5529713 commit 23c7582

File tree

140 files changed

+10944
-690
lines changed

Some content is hidden

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

140 files changed

+10944
-690
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-
## 19.1.64 (2021-05-19)
5+
## 19.1.65 (2021-05-25)
66

77
### Barcode
88

controls/base/CHANGELOG.md

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

33
## [Unreleased]
44

5-
## 19.1.64 (2021-05-19)
5+
## 19.1.65 (2021-05-25)
66

77
### Common
88

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": "19.1.63",
3+
"version": "19.1.64",
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/calendar/calendar.ts

+12
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,18 @@ export class CalendarBase extends Component<HTMLElement> implements INotifyPrope
763763
}
764764
}
765765
}
766+
protected resetCalendar(): void {
767+
detach(this.calendarElement);
768+
detach(this.tableBodyElement);
769+
detach(this.table);
770+
detach(this.tableHeadElement);
771+
detach(this.nextIcon);
772+
detach(this.previousIcon);
773+
detach(this.footer);
774+
this.todayElement = null;
775+
this.renderDayCellArgs = null;
776+
this.calendarElement = this.tableBodyElement = this.footer = this.tableHeadElement = this.nextIcon = this.previousIcon = this.table = null;
777+
}
766778
protected checkDeviceMode(ref?: object): void {
767779
if (Browser.isDevice && isBlazor() && ref) {
768780
// eslint-disable-next-line @typescript-eslint/no-explicit-any

controls/calendars/src/datepicker/datepicker.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,9 @@ export class DatePicker extends Calendar implements IInput {
567567
Input.addAttributes({ 'aria-label': 'select' }, this.inputWrapper.buttons[0]);
568568
addClass([this.inputWrapper.container], DATEWRAPPER);
569569
}
570-
protected updateInput(): void {
570+
protected updateInput(isDynamic: boolean = false): void {
571571
let formatOptions: DateFormatOptions;
572-
if (this.value && !this.isCalendar()) {
572+
if (this.value && !this.isCalendar() && !isDynamic) {
573573
if (!this.isBlazorServer) {
574574
this.disabledDates();
575575
}
@@ -1287,8 +1287,11 @@ export class DatePicker extends Calendar implements IInput {
12871287
if (this.popupObj) {
12881288
this.popupObj.destroy();
12891289
}
1290+
this.resetCalendar();
12901291
detach(this.popupWrapper);
12911292
this.popupObj = this.popupWrapper = null;
1293+
this.preventArgs = null;
1294+
this.calendarKeyboardModules = null;
12921295
this.setAriaAttributes();
12931296
}, targetExitViewport: () => {
12941297
if (!Browser.isDevice) {
@@ -1346,7 +1349,7 @@ export class DatePicker extends Calendar implements IInput {
13461349
protected changeTrigger(event?: MouseEvent | KeyboardEvent): void {
13471350
if (this.inputElement.value !== this.previousElementValue) {
13481351
if (((this.previousDate && this.previousDate.valueOf()) !== (this.value && this.value.valueOf()))) {
1349-
if (this.isDynamicValueChanged) {
1352+
if (this.isDynamicValueChanged && this.isCalendar()) {
13501353
this.popupUpdate();
13511354
}
13521355
this.changedArgs.value = this.value;
@@ -2045,7 +2048,7 @@ export class DatePicker extends Calendar implements IInput {
20452048
this.updateInputValue('');
20462049
this.currentDate = new Date(new Date().setHours(0, 0, 0, 0));
20472050
}
2048-
this.updateInput();
2051+
this.updateInput(true);
20492052
if (+this.previousDate !== +this.value) {
20502053
this.changeTrigger(null);
20512054
}
@@ -2123,7 +2126,7 @@ export class DatePicker extends Calendar implements IInput {
21232126
Input.addFloating(this.inputElement, this.floatLabelType, this.placeholder);
21242127
break;
21252128
default:
2126-
if (this.calendarElement && !this.isBlazorServer) {
2129+
if (this.calendarElement && !this.isBlazorServer && this.isCalendar()) {
21272130
super.onPropertyChanged(newProp, oldProp);
21282131
}
21292132
break;

controls/charts/CHANGELOG.md

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

33
## [Unreleased]
44

5-
## 19.1.64 (2021-05-19)
5+
## 19.1.65 (2021-05-25)
66

77
### Chart
88

controls/circulargauge/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## [Unreleased]
66

7-
## 19.1.64 (2021-05-19)
7+
## 19.1.65 (2021-05-25)
88

99
### CircularGauge
1010

controls/compression/CHANGELOG.md

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

33
## [Unreleased]
44

5-
## 19.1.64 (2021-05-19)
5+
## 19.1.65 (2021-05-25)
66

77
### Compression
88

controls/data/CHANGELOG.md

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

33
## [Unreleased]
44

5-
## 19.1.64 (2021-05-19)
5+
## 19.1.65 (2021-05-25)
66

77
### DataManager
88

controls/diagrams/CHANGELOG.md

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

33
## [Unreleased]
44

5+
## 19.1.65 (2021-05-25)
6+
7+
### Diagram
8+
9+
#### Bug Fixes
10+
11+
- `#I327071` - the issue "When node is placed at the bottom position of the diagram component the tooltip position is rendered wrongly" issue has been fixed.
12+
513
## 19.1.64 (2021-05-19)
614

715
### Diagram

controls/diagrams/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-diagrams",
3-
"version": "19.1.63",
3+
"version": "19.1.64",
44
"description": "Feature-rich diagram control to create diagrams like flow charts, organizational charts, mind maps, and BPMN diagrams. Its rich feature set includes built-in shapes, editing, serializing, exporting, printing, overview, data binding, and automatic layouts.",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",

controls/diagrams/spec/diagram/command-manager/command-manager.spec.ts

+49
Original file line numberDiff line numberDiff line change
@@ -401,4 +401,53 @@ describe('SendToBack exception', () => {
401401
expect(zIndexBeforeCall === zIndexAfterCall).toBe(true);
402402
done();
403403
});
404+
});
405+
describe('Default Template tooltip', () => {
406+
var diagram: Diagram;
407+
let ele: HTMLElement;
408+
let mouseEvents: MouseEvents = new MouseEvents();
409+
beforeAll((): void => {
410+
const isDef = (o: any) => o !== undefined && o !== null;
411+
if (!isDef(window.performance)) {
412+
console.log("Unsupported environment, window.performance.memory is unavailable");
413+
this.skip(); //Skips test (in Chai)
414+
return;
415+
}
416+
ele = createElement('div', { id: 'tooltipCheck' });
417+
document.body.appendChild(ele);
418+
let connector: ConnectorModel = {
419+
id: 'connector1', sourcePoint: { x: 300, y: 100 }, targetPoint: { x: 400, y: 200 }
420+
};
421+
let node: NodeModel = {
422+
id: 'node1', width: 100, height: 100, offsetX: 100, offsetY: 450, annotations: [{ content: 'Node1' }]
423+
};
424+
let node2: NodeModel = {
425+
id: 'node2', width: 100, height: 100, offsetX: 550, offsetY: 450, annotations: [{ content: 'Node1' }],
426+
tooltip: { openOn: 'Custom' }
427+
};
428+
diagram = new Diagram({
429+
width: '1000px', height: '500px',
430+
nodes: [node, node2],
431+
connectors: [connector],
432+
});
433+
diagram.appendTo('#tooltipCheck');
434+
});
435+
afterAll((): void => {
436+
diagram.destroy();
437+
ele.remove();
438+
});
439+
it('Checking custom tooltip template with default template', (done: Function) => {
440+
let diagramCanvas: HTMLElement = document.getElementById(diagram.element.id + 'content');
441+
diagram.showTooltip(diagram.nodes[1]);
442+
setTimeout(() => { done(); }, 50);
443+
});
444+
it('Checking tooltip on mouse enter of custom object', (done: Function) => {
445+
let diagramCanvas: HTMLElement = document.getElementById(diagram.element.id + 'content');
446+
mouseEvents.mouseMoveEvent(diagramCanvas, 320, 320);
447+
let tooltipElement: HTMLElement = document.getElementsByClassName('e-tooltip-wrap e-popup e-control e-popup-open')[0] as HTMLElement;
448+
expect(tooltipElement !== null).toBe(true);
449+
expect(tooltipElement.offsetLeft).toEqual(522);
450+
expect(tooltipElement.offsetTop).toEqual(517);
451+
done();
452+
});
404453
});

controls/diagrams/spec/diagram/objects/swim-lane.spec.ts

+57
Original file line numberDiff line numberDiff line change
@@ -10484,5 +10484,62 @@ describe('Swimlane interaction from different lane', () => {
1048410484
expect(node.parentId === 'swimlanestackCanvas10').toBe(true);
1048510485
done();
1048610486
});
10487+
it('swimlane with lower Zindex children', function (done) {
10488+
console.log("swimlane with lower Zindex children")
10489+
diagram.clear();
10490+
diagram.add({
10491+
id: 'node1', width: 100, height: 100, offsetX: 100, offsetY: 100,
10492+
});
10493+
diagram.add({
10494+
id: 'node2', width: 100, height: 100, offsetX: 400, offsetY: 100,
10495+
});
10496+
diagram.add({
10497+
id: 'conn1',
10498+
sourceID: "node1", targetID: "node2"
10499+
});
10500+
diagram.add({
10501+
id: 'swimlane',
10502+
shape: {
10503+
type: 'SwimLane',
10504+
orientation: 'Horizontal',
10505+
header: {
10506+
annotation: { content: 'ONLINE PURCHASE STATUS' },
10507+
height: 50,
10508+
},
10509+
lanes: [
10510+
{
10511+
id: 'stackCanvas1',
10512+
header: {
10513+
annotation: { content: 'CUSTOMER' }, width: 50,
10514+
style: { fontSize: 11 }
10515+
},
10516+
height: 100,
10517+
}
10518+
],
10519+
},
10520+
offsetX: 720, offsetY: 270,
10521+
height: 100,
10522+
width: 650,
10523+
});
10524+
diagram.select([diagram.nodes[0], diagram.nodes[1]]);
10525+
mouseEvents.mouseDownEvent(diagramCanvas, 100, 100);
10526+
mouseEvents.mouseMoveEvent(diagramCanvas, 300, 300);
10527+
mouseEvents.mouseMoveEvent(diagramCanvas, 300, 400);
10528+
mouseEvents.mouseMoveEvent(diagramCanvas, 700, 300);
10529+
mouseEvents.mouseUpEvent(diagramCanvas, 700, 300);
10530+
setTimeout(function () {
10531+
console.log("Swim lane zindex update issue ");
10532+
10533+
expect(diagram.nodes[0].zIndex === 16 && diagram.nodes[1].zIndex === 17 && diagram.connectors[0].zIndex === 18).toBe(true);
10534+
done();
10535+
}, 1000);
10536+
});
10537+
it('swimlane with lower Zindex unde', function (done) {
10538+
diagram.undo();
10539+
expect(diagram.nodes.length !==0).toBe(true);
10540+
done();
10541+
diagram.redo();
10542+
});
10543+
1048710544
});
1048810545
});

controls/diagrams/src/diagram/interaction/command-manager.ts

+75-7
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import { Layer } from '../diagram/layer';
5151
import { SelectorConstraints, Direction, DiagramConstraints } from '../enum/enum';
5252
import { PageSettings } from '../diagram/page-settings';
5353
import { DiagramScroller, Segment } from '../interaction/scroller';
54-
import { remove, isBlazor } from '@syncfusion/ej2-base';
54+
import { remove, isBlazor, isNullOrUndefined } from '@syncfusion/ej2-base';
5555
import { ConnectTool } from './tool';
5656
import { getOppositeDirection, getPortDirection, findAngle, Intersection } from './../utility/connector';
5757
import { ILayout } from '../layout/layout-base';
@@ -172,6 +172,22 @@ export class CommandHandler {
172172
public showTooltip(
173173
node: IElement, position: PointModel, content: string | HTMLElement, toolName: string,
174174
isTooltipVisible: boolean): void {
175+
let targetId: string;
176+
let targetEle: HTMLElement;
177+
if (node instanceof Selector) {
178+
if ((node.nodes.length == 1) && node.connectors.length == 0) { targetId = node.nodes[0].id }
179+
else if ((node.nodes.length == 0) && node.connectors.length == 1) { targetId = node.connectors[0].id }
180+
else {
181+
targetEle = document.getElementById(this.diagram.element.id + '_SelectorElement');
182+
}
183+
} else if (node instanceof Node) {
184+
targetId = (node as Node).id;
185+
} else {
186+
targetId = (node as Connector).id;
187+
}
188+
if (isNullOrUndefined(targetEle) && !isNullOrUndefined(targetId)) {
189+
targetEle = document.getElementById(targetId + '_groupElement');
190+
}
175191
if (isTooltipVisible) {
176192
this.diagram.tooltipObject.position = 'BottomCenter';
177193
this.diagram.tooltipObject.animation = { open: { delay: 0, duration: 0 } };
@@ -198,19 +214,17 @@ export class CommandHandler {
198214
}
199215

200216
this.diagram.tooltipObject.content = content;
201-
const tooltipOffset: PointModel = getTooltipOffset(this.diagram, { x: position.x, y: position.y }, node, toolName ===
202-
'ConnectTool' ? 'Mouse' : 'Object');
203-
this.diagram.tooltipObject.offsetX = tooltipOffset.x + (toolName === 'ConnectTool' ? 10 : 0);
204-
this.diagram.tooltipObject.offsetY = tooltipOffset.y + 10;
217+
this.diagram.tooltipObject.offsetX = 0;
218+
this.diagram.tooltipObject.offsetY = 0;
205219
if (isBlazor()) {
206220
(this.diagram.tooltipObject as BlazorTooltip).updateTooltip(this.diagram.element);
207221
} else {
208-
( this.diagram.tooltipObject as Tooltip).dataBind();
222+
(this.diagram.tooltipObject as Tooltip).refresh(targetEle);
209223
}
210224
if (isTooltipVisible) {
211225
setTimeout(
212226
() => {
213-
( this.diagram.tooltipObject as Tooltip).open(this.diagram.element);
227+
(this.diagram.tooltipObject as Tooltip).open(targetEle);
214228
},
215229
1);
216230
}
@@ -5441,7 +5455,61 @@ Remove terinal segment in initial
54415455
addChildToContainer(this.diagram, parent, node);
54425456
}
54435457
}
5458+
/**
5459+
*
5460+
* @private
5461+
*/
5462+
public updateLaneChildrenZindex(node: Node, target: IElement): void {
5463+
let lowerIndexobject: Node = this.findLeastIndexObject(node, target) as Node;
5464+
let swimlane: Node = this.diagram.nameTable[(target as Node).parentId];
5465+
if (swimlane.zIndex > lowerIndexobject.zIndex) {
5466+
let layerIndex: number = this.diagram.layers.indexOf(this.diagram.getActiveLayer());
5467+
const layerZIndexTable: {} = (this.diagram.layers[layerIndex] as Layer).zIndexTable;
5468+
let startIndex: number = lowerIndexobject.zIndex;
5469+
let endIndex: number = swimlane.zIndex;
5470+
for (var i = endIndex; i >= startIndex; i--) {
5471+
if (startIndex !== i) {
5472+
if (!layerZIndexTable[i - 1]) {
5473+
layerZIndexTable[i - 1] = layerZIndexTable[i];
5474+
this.diagram.nameTable[layerZIndexTable[i - 1]].zIndex = i;
5475+
delete layerZIndexTable[i];
5476+
} else {
5477+
//bringing the objects forward
5478+
layerZIndexTable[i] = layerZIndexTable[i - 1];
5479+
this.diagram.nameTable[layerZIndexTable[i]].zIndex = i;
5480+
}
5481+
} else {
5482+
layerZIndexTable[i] = swimlane.id;
5483+
this.diagram.nameTable[swimlane.id].zIndex = i;
5484+
}
5485+
}
5486+
if (this.diagram.mode === 'SVG') {
5487+
this.moveSvgNode((target as Node).parentId, lowerIndexobject.id);
5488+
this.updateNativeNodeIndex((target as Node).parentId, lowerIndexobject.id);
54445489

5490+
} else {
5491+
this.diagram.refreshCanvasLayers();
5492+
}
5493+
}
5494+
}
5495+
private findLeastIndexConnector(edges: string[], target: IElement, index: Node | Connector): Node | Connector {
5496+
for (let i: number = 0; i < edges.length; i++) {
5497+
let connector: Connector = this.diagram.nameTable[edges[i]];
5498+
if ((index as Node).zIndex > connector.zIndex) {
5499+
index = connector
5500+
}
5501+
}
5502+
return index;
5503+
}
5504+
private findLeastIndexObject(node: Node, target: IElement): Node | Connector {
5505+
let lowerIndexobject: Node | Connector = node as Node;
5506+
if(node instanceof Node) {
5507+
lowerIndexobject = this.findLeastIndexConnector(node.inEdges, target, lowerIndexobject) as Node;
5508+
lowerIndexobject = this.findLeastIndexConnector(node.outEdges, target, lowerIndexobject) as Node;
5509+
}
5510+
5511+
return lowerIndexobject;
5512+
}
54455513
/**
54465514
* checkSelection method \
54475515
*

0 commit comments

Comments
 (0)