MCPcopy
hub / github.com/DevCloudFE/ng-devui / createMouseEvent

Function createMouseEvent

devui/utils/testing/event-helper.ts:92–112  ·  view source on GitHub ↗
(type: string, x = 0, y = 0, button = 0)

Source from the content-addressed store, hash-verified

90}
91
92export function createMouseEvent(type: string, x = 0, y = 0, button = 0): MouseEvent {
93 const event = document.createEvent('MouseEvent');
94 event.initMouseEvent(
95 type,
96 true /* canBubble */,
97 false /* cancelable */,
98 window /* view */,
99 0 /* detail */,
100 x /* screenX */,
101 y /* screenY */,
102 x /* clientX */,
103 y /* clientY */,
104 false /* ctrlKey */,
105 false /* altKey */,
106 false /* shiftKey */,
107 false /* metaKey */,
108 button /* button */,
109 null /* relatedTarget */
110 );
111 return event;
112}
113
114export function dateToStrWithArr(date: Date, arr = ['yy', 'mm', 'dd'], splitter = '-') {
115 const padZero = (value) => {

Callers 4

headerDragFunction · 0.90
dispatchMouseEventFunction · 0.85

Calls

no outgoing calls

Tested by 1

headerDragFunction · 0.72