(type: string, x = 0, y = 0, button = 0)
| 90 | } |
| 91 | |
| 92 | export 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 | |
| 114 | export function dateToStrWithArr(date: Date, arr = ['yy', 'mm', 'dd'], splitter = '-') { |
| 115 | const padZero = (value) => { |
no outgoing calls