@operato/gantt 8.0.0-alpha.33 → 8.0.0-alpha.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/src/gantt-chart-controller.d.ts +4 -11
- package/dist/src/gantt-chart-controller.js +72 -137
- package/dist/src/gantt-chart-controller.js.map +1 -1
- package/dist/src/ox-gantt-chart.d.ts +368 -2
- package/dist/src/ox-gantt-chart.js +40 -78
- package/dist/src/ox-gantt-chart.js.map +1 -1
- package/dist/stories/ox-gantt.stories.js +1 -1
- package/dist/stories/ox-gantt.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/gantt-chart-controller.ts +71 -139
- package/src/ox-gantt-chart.ts +36 -77
- package/stories/ox-gantt.stories.ts +1 -1
|
@@ -3,7 +3,372 @@ import './ox-resource-chart.js';
|
|
|
3
3
|
import { LitElement, PropertyValues, PropertyValueMap } from 'lit';
|
|
4
4
|
import { Task, TimeScale } from './types.js';
|
|
5
5
|
import { OxTaskTooltip } from './ox-task-tooltip.js';
|
|
6
|
-
|
|
6
|
+
declare const OxGanttChart_base: (new (...args: any[]) => {
|
|
7
|
+
__pointers: Map<number, {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}>;
|
|
11
|
+
__lastTapTime: number;
|
|
12
|
+
__lastPinchDistance: number;
|
|
13
|
+
__dragStart: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
} | null;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
19
|
+
handlePointerDown: (e: PointerEvent) => void;
|
|
20
|
+
handlePointerMove: (e: PointerEvent) => void;
|
|
21
|
+
handlePointerUp: (e: PointerEvent) => void;
|
|
22
|
+
handlePinch(): void;
|
|
23
|
+
handleDrag(point: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
}): void;
|
|
27
|
+
handleTap(point: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
}): void;
|
|
31
|
+
getDistance(p1: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
}, p2: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
}): number;
|
|
38
|
+
addGlobalListeners(): void;
|
|
39
|
+
removeGlobalListeners(): void;
|
|
40
|
+
accessKey: string;
|
|
41
|
+
readonly accessKeyLabel: string;
|
|
42
|
+
autocapitalize: string;
|
|
43
|
+
dir: string;
|
|
44
|
+
draggable: boolean;
|
|
45
|
+
hidden: boolean;
|
|
46
|
+
inert: boolean;
|
|
47
|
+
innerText: string;
|
|
48
|
+
lang: string;
|
|
49
|
+
readonly offsetHeight: number;
|
|
50
|
+
readonly offsetLeft: number;
|
|
51
|
+
readonly offsetParent: Element | null;
|
|
52
|
+
readonly offsetTop: number;
|
|
53
|
+
readonly offsetWidth: number;
|
|
54
|
+
outerText: string;
|
|
55
|
+
popover: string | null;
|
|
56
|
+
spellcheck: boolean;
|
|
57
|
+
title: string;
|
|
58
|
+
translate: boolean;
|
|
59
|
+
attachInternals(): ElementInternals;
|
|
60
|
+
click(): void;
|
|
61
|
+
hidePopover(): void;
|
|
62
|
+
showPopover(): void;
|
|
63
|
+
togglePopover(force?: boolean): boolean;
|
|
64
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
65
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
66
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
67
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
68
|
+
readonly attributes: NamedNodeMap;
|
|
69
|
+
readonly classList: DOMTokenList;
|
|
70
|
+
className: string;
|
|
71
|
+
readonly clientHeight: number;
|
|
72
|
+
readonly clientLeft: number;
|
|
73
|
+
readonly clientTop: number;
|
|
74
|
+
readonly clientWidth: number;
|
|
75
|
+
id: string;
|
|
76
|
+
innerHTML: string;
|
|
77
|
+
readonly localName: string;
|
|
78
|
+
readonly namespaceURI: string | null;
|
|
79
|
+
onfullscreenchange: ((this: Element, ev: Event) => any) | null;
|
|
80
|
+
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
|
|
81
|
+
outerHTML: string;
|
|
82
|
+
readonly ownerDocument: Document;
|
|
83
|
+
readonly part: DOMTokenList;
|
|
84
|
+
readonly prefix: string | null;
|
|
85
|
+
readonly scrollHeight: number;
|
|
86
|
+
scrollLeft: number;
|
|
87
|
+
scrollTop: number;
|
|
88
|
+
readonly scrollWidth: number;
|
|
89
|
+
readonly shadowRoot: ShadowRoot | null;
|
|
90
|
+
slot: string;
|
|
91
|
+
readonly tagName: string;
|
|
92
|
+
attachShadow(init: ShadowRootInit): ShadowRoot;
|
|
93
|
+
checkVisibility(options?: CheckVisibilityOptions): boolean;
|
|
94
|
+
closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
|
|
95
|
+
closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
|
|
96
|
+
closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
|
|
97
|
+
closest<E extends Element = Element>(selectors: string): E | null;
|
|
98
|
+
computedStyleMap(): StylePropertyMapReadOnly;
|
|
99
|
+
getAttribute(qualifiedName: string): string | null;
|
|
100
|
+
getAttributeNS(namespace: string | null, localName: string): string | null;
|
|
101
|
+
getAttributeNames(): string[];
|
|
102
|
+
getAttributeNode(qualifiedName: string): Attr | null;
|
|
103
|
+
getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
|
|
104
|
+
getBoundingClientRect(): DOMRect;
|
|
105
|
+
getClientRects(): DOMRectList;
|
|
106
|
+
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
|
|
107
|
+
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
|
|
108
|
+
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
|
|
109
|
+
getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
|
|
110
|
+
getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
111
|
+
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
|
|
112
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
|
|
113
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
|
|
114
|
+
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
|
|
115
|
+
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
|
|
116
|
+
getHTML(options?: GetHTMLOptions): string;
|
|
117
|
+
hasAttribute(qualifiedName: string): boolean;
|
|
118
|
+
hasAttributeNS(namespace: string | null, localName: string): boolean;
|
|
119
|
+
hasAttributes(): boolean;
|
|
120
|
+
hasPointerCapture(pointerId: number): boolean;
|
|
121
|
+
insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
|
|
122
|
+
insertAdjacentHTML(position: InsertPosition, string: string): void;
|
|
123
|
+
insertAdjacentText(where: InsertPosition, data: string): void;
|
|
124
|
+
matches(selectors: string): boolean;
|
|
125
|
+
releasePointerCapture(pointerId: number): void;
|
|
126
|
+
removeAttribute(qualifiedName: string): void;
|
|
127
|
+
removeAttributeNS(namespace: string | null, localName: string): void;
|
|
128
|
+
removeAttributeNode(attr: Attr): Attr;
|
|
129
|
+
requestFullscreen(options?: FullscreenOptions): Promise<void>;
|
|
130
|
+
requestPointerLock(options?: PointerLockOptions): Promise<void>;
|
|
131
|
+
scroll(options?: ScrollToOptions): void;
|
|
132
|
+
scroll(x: number, y: number): void;
|
|
133
|
+
scrollBy(options?: ScrollToOptions): void;
|
|
134
|
+
scrollBy(x: number, y: number): void;
|
|
135
|
+
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
|
|
136
|
+
scrollTo(options?: ScrollToOptions): void;
|
|
137
|
+
scrollTo(x: number, y: number): void;
|
|
138
|
+
setAttribute(qualifiedName: string, value: string): void;
|
|
139
|
+
setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
|
|
140
|
+
setAttributeNode(attr: Attr): Attr | null;
|
|
141
|
+
setAttributeNodeNS(attr: Attr): Attr | null;
|
|
142
|
+
setHTMLUnsafe(html: string): void;
|
|
143
|
+
setPointerCapture(pointerId: number): void;
|
|
144
|
+
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
|
|
145
|
+
webkitMatchesSelector(selectors: string): boolean;
|
|
146
|
+
readonly baseURI: string;
|
|
147
|
+
readonly childNodes: NodeListOf<ChildNode>;
|
|
148
|
+
readonly firstChild: ChildNode | null;
|
|
149
|
+
readonly isConnected: boolean;
|
|
150
|
+
readonly lastChild: ChildNode | null;
|
|
151
|
+
readonly nextSibling: ChildNode | null;
|
|
152
|
+
readonly nodeName: string;
|
|
153
|
+
readonly nodeType: number;
|
|
154
|
+
nodeValue: string | null;
|
|
155
|
+
readonly parentElement: HTMLElement | null;
|
|
156
|
+
readonly parentNode: ParentNode | null;
|
|
157
|
+
readonly previousSibling: ChildNode | null;
|
|
158
|
+
textContent: string | null;
|
|
159
|
+
appendChild<T extends Node>(node: T): T;
|
|
160
|
+
cloneNode(deep?: boolean): Node;
|
|
161
|
+
compareDocumentPosition(other: Node): number;
|
|
162
|
+
contains(other: Node | null): boolean;
|
|
163
|
+
getRootNode(options?: GetRootNodeOptions): Node;
|
|
164
|
+
hasChildNodes(): boolean;
|
|
165
|
+
insertBefore<T extends Node>(node: T, child: Node | null): T;
|
|
166
|
+
isDefaultNamespace(namespace: string | null): boolean;
|
|
167
|
+
isEqualNode(otherNode: Node | null): boolean;
|
|
168
|
+
isSameNode(otherNode: Node | null): boolean;
|
|
169
|
+
lookupNamespaceURI(prefix: string | null): string | null;
|
|
170
|
+
lookupPrefix(namespace: string | null): string | null;
|
|
171
|
+
normalize(): void;
|
|
172
|
+
removeChild<T extends Node>(child: T): T;
|
|
173
|
+
replaceChild<T extends Node>(node: Node, child: T): T;
|
|
174
|
+
readonly ELEMENT_NODE: 1;
|
|
175
|
+
readonly ATTRIBUTE_NODE: 2;
|
|
176
|
+
readonly TEXT_NODE: 3;
|
|
177
|
+
readonly CDATA_SECTION_NODE: 4;
|
|
178
|
+
readonly ENTITY_REFERENCE_NODE: 5;
|
|
179
|
+
readonly ENTITY_NODE: 6;
|
|
180
|
+
readonly PROCESSING_INSTRUCTION_NODE: 7;
|
|
181
|
+
readonly COMMENT_NODE: 8;
|
|
182
|
+
readonly DOCUMENT_NODE: 9;
|
|
183
|
+
readonly DOCUMENT_TYPE_NODE: 10;
|
|
184
|
+
readonly DOCUMENT_FRAGMENT_NODE: 11;
|
|
185
|
+
readonly NOTATION_NODE: 12;
|
|
186
|
+
readonly DOCUMENT_POSITION_DISCONNECTED: 1;
|
|
187
|
+
readonly DOCUMENT_POSITION_PRECEDING: 2;
|
|
188
|
+
readonly DOCUMENT_POSITION_FOLLOWING: 4;
|
|
189
|
+
readonly DOCUMENT_POSITION_CONTAINS: 8;
|
|
190
|
+
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
|
|
191
|
+
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
|
|
192
|
+
dispatchEvent(event: Event): boolean;
|
|
193
|
+
ariaAtomic: string | null;
|
|
194
|
+
ariaAutoComplete: string | null;
|
|
195
|
+
ariaBrailleLabel: string | null;
|
|
196
|
+
ariaBrailleRoleDescription: string | null;
|
|
197
|
+
ariaBusy: string | null;
|
|
198
|
+
ariaChecked: string | null;
|
|
199
|
+
ariaColCount: string | null;
|
|
200
|
+
ariaColIndex: string | null;
|
|
201
|
+
ariaColSpan: string | null;
|
|
202
|
+
ariaCurrent: string | null;
|
|
203
|
+
ariaDescription: string | null;
|
|
204
|
+
ariaDisabled: string | null;
|
|
205
|
+
ariaExpanded: string | null;
|
|
206
|
+
ariaHasPopup: string | null;
|
|
207
|
+
ariaHidden: string | null;
|
|
208
|
+
ariaInvalid: string | null;
|
|
209
|
+
ariaKeyShortcuts: string | null;
|
|
210
|
+
ariaLabel: string | null;
|
|
211
|
+
ariaLevel: string | null;
|
|
212
|
+
ariaLive: string | null;
|
|
213
|
+
ariaModal: string | null;
|
|
214
|
+
ariaMultiLine: string | null;
|
|
215
|
+
ariaMultiSelectable: string | null;
|
|
216
|
+
ariaOrientation: string | null;
|
|
217
|
+
ariaPlaceholder: string | null;
|
|
218
|
+
ariaPosInSet: string | null;
|
|
219
|
+
ariaPressed: string | null;
|
|
220
|
+
ariaReadOnly: string | null;
|
|
221
|
+
ariaRequired: string | null;
|
|
222
|
+
ariaRoleDescription: string | null;
|
|
223
|
+
ariaRowCount: string | null;
|
|
224
|
+
ariaRowIndex: string | null;
|
|
225
|
+
ariaRowSpan: string | null;
|
|
226
|
+
ariaSelected: string | null;
|
|
227
|
+
ariaSetSize: string | null;
|
|
228
|
+
ariaSort: string | null;
|
|
229
|
+
ariaValueMax: string | null;
|
|
230
|
+
ariaValueMin: string | null;
|
|
231
|
+
ariaValueNow: string | null;
|
|
232
|
+
ariaValueText: string | null;
|
|
233
|
+
role: string | null;
|
|
234
|
+
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
|
|
235
|
+
getAnimations(options?: GetAnimationsOptions): Animation[];
|
|
236
|
+
after(...nodes: (Node | string)[]): void;
|
|
237
|
+
before(...nodes: (Node | string)[]): void;
|
|
238
|
+
remove(): void;
|
|
239
|
+
replaceWith(...nodes: (Node | string)[]): void;
|
|
240
|
+
readonly nextElementSibling: Element | null;
|
|
241
|
+
readonly previousElementSibling: Element | null;
|
|
242
|
+
readonly childElementCount: number;
|
|
243
|
+
readonly children: HTMLCollection;
|
|
244
|
+
readonly firstElementChild: Element | null;
|
|
245
|
+
readonly lastElementChild: Element | null;
|
|
246
|
+
append(...nodes: (Node | string)[]): void;
|
|
247
|
+
prepend(...nodes: (Node | string)[]): void;
|
|
248
|
+
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
|
|
249
|
+
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
|
|
250
|
+
querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
|
|
251
|
+
querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
|
|
252
|
+
querySelector<E extends Element = Element>(selectors: string): E | null;
|
|
253
|
+
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
|
|
254
|
+
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
|
|
255
|
+
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
|
|
256
|
+
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
|
|
257
|
+
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
|
|
258
|
+
replaceChildren(...nodes: (Node | string)[]): void;
|
|
259
|
+
readonly assignedSlot: HTMLSlotElement | null;
|
|
260
|
+
readonly attributeStyleMap: StylePropertyMap;
|
|
261
|
+
readonly style: CSSStyleDeclaration;
|
|
262
|
+
contentEditable: string;
|
|
263
|
+
enterKeyHint: string;
|
|
264
|
+
inputMode: string;
|
|
265
|
+
readonly isContentEditable: boolean;
|
|
266
|
+
onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
267
|
+
onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
268
|
+
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
269
|
+
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
270
|
+
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
|
|
271
|
+
onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
272
|
+
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
|
|
273
|
+
onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
274
|
+
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
275
|
+
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
276
|
+
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
277
|
+
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
278
|
+
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
279
|
+
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
280
|
+
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
281
|
+
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
282
|
+
oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
283
|
+
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
284
|
+
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
285
|
+
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
286
|
+
oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
287
|
+
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
288
|
+
ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
289
|
+
ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
290
|
+
ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
291
|
+
ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
292
|
+
ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
293
|
+
ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
294
|
+
ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
|
|
295
|
+
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
296
|
+
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
297
|
+
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
298
|
+
onerror: OnErrorEventHandler;
|
|
299
|
+
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
|
|
300
|
+
onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
|
|
301
|
+
ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
302
|
+
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
303
|
+
oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
304
|
+
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
305
|
+
onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
306
|
+
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
|
|
307
|
+
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
308
|
+
onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
309
|
+
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
310
|
+
onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
311
|
+
onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
312
|
+
onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
313
|
+
onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
314
|
+
onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
315
|
+
onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
316
|
+
onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
317
|
+
onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
318
|
+
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
|
|
319
|
+
onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
|
|
320
|
+
onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
321
|
+
onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
322
|
+
onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
323
|
+
onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
324
|
+
onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
325
|
+
onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
326
|
+
onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
327
|
+
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
328
|
+
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
329
|
+
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
330
|
+
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
|
|
331
|
+
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
|
|
332
|
+
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
333
|
+
onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
334
|
+
onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
|
|
335
|
+
onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
336
|
+
onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
337
|
+
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
|
|
338
|
+
onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
339
|
+
onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
340
|
+
onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
341
|
+
onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
342
|
+
onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
343
|
+
onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
344
|
+
onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
345
|
+
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
|
|
346
|
+
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
347
|
+
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
348
|
+
ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
349
|
+
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
350
|
+
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
351
|
+
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
352
|
+
ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
|
|
353
|
+
ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
354
|
+
ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
355
|
+
ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
356
|
+
ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
|
|
357
|
+
onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
358
|
+
onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
359
|
+
onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
360
|
+
onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
361
|
+
onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
362
|
+
onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
|
|
363
|
+
onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
|
|
364
|
+
autofocus: boolean;
|
|
365
|
+
readonly dataset: DOMStringMap;
|
|
366
|
+
nonce?: string;
|
|
367
|
+
tabIndex: number;
|
|
368
|
+
blur(): void;
|
|
369
|
+
focus(options?: FocusOptions): void;
|
|
370
|
+
}) & typeof LitElement;
|
|
371
|
+
export declare class OxGanttChart extends OxGanttChart_base {
|
|
7
372
|
static styles: import("lit").CSSResult[];
|
|
8
373
|
fromDate: string;
|
|
9
374
|
toDate: string;
|
|
@@ -17,8 +382,8 @@ export declare class OxGanttChart extends LitElement {
|
|
|
17
382
|
container: HTMLDivElement;
|
|
18
383
|
tooltip: OxTaskTooltip;
|
|
19
384
|
private ganttChartController;
|
|
20
|
-
constructor();
|
|
21
385
|
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
386
|
+
connectedCallback(): void;
|
|
22
387
|
disconnectedCallback(): void;
|
|
23
388
|
updated(changedProperties: PropertyValues<this>): void;
|
|
24
389
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -38,3 +403,4 @@ export declare class OxGanttChart extends LitElement {
|
|
|
38
403
|
finalizeSelection(startX: number, endX: number): void;
|
|
39
404
|
clearSelection(): void;
|
|
40
405
|
}
|
|
406
|
+
export {};
|
|
@@ -9,7 +9,20 @@ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typesca
|
|
|
9
9
|
import { ScrollbarStyles } from '@operato/styles';
|
|
10
10
|
import { GanttChartController } from './gantt-chart-controller';
|
|
11
11
|
import { levelDown, levelUp } from './utils';
|
|
12
|
-
|
|
12
|
+
import { gesture } from '@operato/utils/gesture-mixin.js';
|
|
13
|
+
let OxGanttChart = class OxGanttChart extends gesture(LitElement) {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.fromDate = new Date(new Date().getFullYear(), 0, 1)
|
|
17
|
+
.toISOString()
|
|
18
|
+
.split('T')[0];
|
|
19
|
+
this.toDate = new Date(new Date().getFullYear(), 11, 31)
|
|
20
|
+
.toISOString()
|
|
21
|
+
.split('T')[0];
|
|
22
|
+
this.axisScale = 'week-day';
|
|
23
|
+
this.tasks = [];
|
|
24
|
+
this.locale = 'en-US';
|
|
25
|
+
}
|
|
13
26
|
static { this.styles = [
|
|
14
27
|
MDTypeScaleStyles,
|
|
15
28
|
ScrollbarStyles,
|
|
@@ -26,6 +39,7 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
26
39
|
overflow-x: auto;
|
|
27
40
|
overflow-y: hidden;
|
|
28
41
|
overscroll-behavior: none;
|
|
42
|
+
touch-action: none;
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
svg {
|
|
@@ -68,25 +82,22 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
68
82
|
}
|
|
69
83
|
`
|
|
70
84
|
]; }
|
|
71
|
-
constructor() {
|
|
72
|
-
super();
|
|
73
|
-
this.fromDate = new Date(new Date().getFullYear(), 0, 1)
|
|
74
|
-
.toISOString()
|
|
75
|
-
.split('T')[0];
|
|
76
|
-
this.toDate = new Date(new Date().getFullYear(), 11, 31)
|
|
77
|
-
.toISOString()
|
|
78
|
-
.split('T')[0];
|
|
79
|
-
this.axisScale = 'week-day';
|
|
80
|
-
this.tasks = [];
|
|
81
|
-
this.locale = 'en-US';
|
|
82
|
-
this.ganttChartController = new GanttChartController(this, this.fromDate, this.toDate, this.axisScale);
|
|
83
|
-
}
|
|
84
85
|
firstUpdated(_changedProperties) {
|
|
85
86
|
this.initHeaderGestureHandlers();
|
|
86
87
|
this.addEventListener('date-range-cleared', e => this.clearSelection());
|
|
87
88
|
}
|
|
89
|
+
connectedCallback() {
|
|
90
|
+
super.connectedCallback();
|
|
91
|
+
this.ganttChartController = new GanttChartController(this, this.fromDate, this.toDate, this.axisScale);
|
|
92
|
+
this.addEventListener('pinch', this.ganttChartController.handlePinchForBody);
|
|
93
|
+
this.addEventListener('drag', this.ganttChartController.handleDragForBody);
|
|
94
|
+
this.addEventListener('doubletap', this.ganttChartController.handleDoubleTapForBody);
|
|
95
|
+
}
|
|
88
96
|
disconnectedCallback() {
|
|
89
97
|
super.disconnectedCallback();
|
|
98
|
+
this.removeEventListener('pinch', this.ganttChartController.handlePinchForBody);
|
|
99
|
+
this.removeEventListener('drag', this.ganttChartController.handleDragForBody);
|
|
100
|
+
this.removeEventListener('doubletap', this.ganttChartController.handleDoubleTapForBody);
|
|
90
101
|
this.ganttChartController.dispose();
|
|
91
102
|
}
|
|
92
103
|
updated(changedProperties) {
|
|
@@ -94,8 +105,9 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
94
105
|
this.ganttChartController.updateRange(this.fromDate, this.toDate);
|
|
95
106
|
}
|
|
96
107
|
if (changedProperties.has('tasks')) {
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
108
|
+
const flattenTasks = this.flattenTasks(this.tasks);
|
|
109
|
+
this.ganttChartController.setTasks(flattenTasks);
|
|
110
|
+
this.svgBody.style.height = Math.max(flattenTasks.length * 30, 2000) + 'px';
|
|
99
111
|
}
|
|
100
112
|
if (changedProperties.has('locale')) {
|
|
101
113
|
this.updateLocale(this.locale);
|
|
@@ -115,16 +127,7 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
115
127
|
}
|
|
116
128
|
render() {
|
|
117
129
|
return html `
|
|
118
|
-
<div
|
|
119
|
-
chart-container
|
|
120
|
-
@wheel=${(e) => this.ganttChartController.handleWheelForBody(e, this.container)}
|
|
121
|
-
@mousedown=${(e) => this.ganttChartController.handleTouchStartForBody(e, this.container)}
|
|
122
|
-
@mousemove=${(e) => this.ganttChartController.handleTouchMoveForBody(e, this.container)}
|
|
123
|
-
@mouseup=${(e) => this.ganttChartController.handleTouchEndForBody(e)}
|
|
124
|
-
@touchstart=${(e) => this.ganttChartController.handleTouchStartForBody(e, this.container)}
|
|
125
|
-
@touchmove=${(e) => this.ganttChartController.handleTouchMoveForBody(e, this.container)}
|
|
126
|
-
@touchend=${(e) => this.ganttChartController.handleTouchEndForBody(e)}
|
|
127
|
-
>
|
|
130
|
+
<div chart-container @wheel=${(e) => this.ganttChartController.handleWheelForBody(e, this.container)}>
|
|
128
131
|
<svg
|
|
129
132
|
header
|
|
130
133
|
@date-range-selected=${(e) => this.handleDateRangeSelected(e)}
|
|
@@ -228,74 +231,33 @@ let OxGanttChart = class OxGanttChart extends LitElement {
|
|
|
228
231
|
}
|
|
229
232
|
initHeaderGestureHandlers() {
|
|
230
233
|
const header = d3.select(this.svgHeader);
|
|
231
|
-
let isDragging = false;
|
|
232
234
|
let startX = null;
|
|
233
|
-
const
|
|
235
|
+
const handlePointerDown = (event) => {
|
|
234
236
|
event.preventDefault();
|
|
235
237
|
event.stopPropagation();
|
|
236
|
-
isDragging = true;
|
|
237
|
-
const touch = event.touches[0];
|
|
238
238
|
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
239
|
-
startX =
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
event.preventDefault();
|
|
243
|
-
event.stopPropagation();
|
|
244
|
-
if (isDragging && startX !== null) {
|
|
245
|
-
const touch = event.touches[0];
|
|
246
|
-
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
247
|
-
const currentX = touch.clientX - containerOffsetX;
|
|
248
|
-
this.highlightSelection(startX, currentX);
|
|
249
|
-
}
|
|
239
|
+
startX = event.clientX - containerOffsetX;
|
|
240
|
+
window.addEventListener('pointermove', handlePointerMove);
|
|
241
|
+
window.addEventListener('pointerup', handlePointerUp);
|
|
250
242
|
};
|
|
251
|
-
const
|
|
243
|
+
const handlePointerMove = (event) => {
|
|
252
244
|
event.preventDefault();
|
|
253
245
|
event.stopPropagation();
|
|
254
|
-
if (!isDragging || startX === null) {
|
|
255
|
-
const touch = event.changedTouches[0];
|
|
256
|
-
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
257
|
-
const clickX = touch.clientX - containerOffsetX;
|
|
258
|
-
this.finalizeSelection(clickX, clickX);
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
const touch = event.changedTouches[0];
|
|
262
|
-
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
263
|
-
const endX = touch.clientX - containerOffsetX;
|
|
264
|
-
this.finalizeSelection(startX, endX);
|
|
265
|
-
isDragging = false;
|
|
266
|
-
startX = null;
|
|
267
|
-
};
|
|
268
|
-
const handleMouseDown = (event) => {
|
|
269
|
-
isDragging = true;
|
|
270
|
-
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
271
|
-
startX = event.clientX - containerOffsetX;
|
|
272
|
-
};
|
|
273
|
-
const handleMouseMove = (event) => {
|
|
274
|
-
if (!isDragging || startX === null)
|
|
275
|
-
return;
|
|
276
246
|
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
277
247
|
const currentX = event.clientX - containerOffsetX;
|
|
278
248
|
this.highlightSelection(startX, currentX);
|
|
279
249
|
};
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
250
|
+
const handlePointerUp = (event) => {
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
event.stopPropagation();
|
|
253
|
+
window.removeEventListener('pointermove', handlePointerMove);
|
|
254
|
+
window.removeEventListener('pointerup', handlePointerUp);
|
|
287
255
|
const containerOffsetX = header.node().getBoundingClientRect().left;
|
|
288
256
|
const endX = event.clientX - containerOffsetX;
|
|
289
257
|
this.finalizeSelection(startX, endX);
|
|
290
|
-
isDragging = false;
|
|
291
258
|
startX = null;
|
|
292
259
|
};
|
|
293
|
-
header.on('
|
|
294
|
-
header.on('mousemove', handleMouseMove);
|
|
295
|
-
header.on('mouseup', handleMouseUp);
|
|
296
|
-
header.on('touchstart', handleTouchStart);
|
|
297
|
-
header.on('touchmove', handleTouchMove);
|
|
298
|
-
header.on('touchend', handleTouchEnd);
|
|
260
|
+
header.on('pointerdown', handlePointerDown);
|
|
299
261
|
}
|
|
300
262
|
highlightSelection(startX, endX) {
|
|
301
263
|
const header = d3.select(this.svgHeader);
|