@operato/gantt 8.0.0-alpha.10 → 8.0.0-alpha.25
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 +9 -0
- package/dist/src/gantt-chart-controller.d.ts +12 -6
- package/dist/src/gantt-chart-controller.js +149 -29
- package/dist/src/gantt-chart-controller.js.map +1 -1
- package/dist/src/ox-gantt-chart.d.ts +2 -0
- package/dist/src/ox-gantt-chart.js +41 -69
- package/dist/src/ox-gantt-chart.js.map +1 -1
- package/dist/src/ox-gantt-resize-splitter.d.ts +6 -2
- package/dist/src/ox-gantt-resize-splitter.js +70 -39
- package/dist/src/ox-gantt-resize-splitter.js.map +1 -1
- package/dist/src/ox-gantt.js +9 -0
- package/dist/src/ox-gantt.js.map +1 -1
- package/dist/src/ox-resource-chart.js +2 -0
- package/dist/src/ox-resource-chart.js.map +1 -1
- package/dist/src/ox-task-tooltip.d.ts +3 -1
- package/dist/src/ox-task-tooltip.js +36 -11
- package/dist/src/ox-task-tooltip.js.map +1 -1
- package/dist/stories/ox-gantt.stories.js +16 -0
- 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 +171 -37
- package/src/ox-gantt-chart.ts +46 -69
- package/src/ox-gantt-resize-splitter.ts +72 -44
- package/src/ox-gantt.ts +9 -0
- package/src/ox-resource-chart.ts +2 -0
- package/src/ox-task-tooltip.ts +31 -9
- package/stories/ox-gantt.stories.ts +16 -0
package/src/ox-gantt.ts
CHANGED
|
@@ -23,6 +23,7 @@ export class OxGantt extends localize(i18next)(LitElement) {
|
|
|
23
23
|
font-family: Arial, sans-serif;
|
|
24
24
|
text-wrap: nowrap;
|
|
25
25
|
position: relative;
|
|
26
|
+
user-select: none;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
.container {
|
|
@@ -49,6 +50,7 @@ export class OxGantt extends localize(i18next)(LitElement) {
|
|
|
49
50
|
overflow-y: overlay;
|
|
50
51
|
box-sizing: border-box;
|
|
51
52
|
border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-outline));
|
|
53
|
+
overscroll-behavior: none; /* diabled rubber-band effect */
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
.resource-chart-container {
|
|
@@ -56,6 +58,7 @@ export class OxGantt extends localize(i18next)(LitElement) {
|
|
|
56
58
|
padding: 0;
|
|
57
59
|
box-sizing: border-box;
|
|
58
60
|
border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-outline));
|
|
61
|
+
overscroll-behavior: none;
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
.task-container {
|
|
@@ -64,6 +67,8 @@ export class OxGantt extends localize(i18next)(LitElement) {
|
|
|
64
67
|
display: flex;
|
|
65
68
|
overflow: hidden;
|
|
66
69
|
box-sizing: border-box;
|
|
70
|
+
user-select: none;
|
|
71
|
+
overscroll-behavior: none;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
.task-table-container {
|
|
@@ -72,6 +77,7 @@ export class OxGantt extends localize(i18next)(LitElement) {
|
|
|
72
77
|
overflow-y: overlay;
|
|
73
78
|
box-sizing: border-box;
|
|
74
79
|
border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-outline));
|
|
80
|
+
overscroll-behavior: none; /* diabled rubber-band effect */
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
.task-chart-container {
|
|
@@ -104,6 +110,9 @@ export class OxGantt extends localize(i18next)(LitElement) {
|
|
|
104
110
|
border: 1px solid var(--ox-gantt-border-color, var(--md-sys-color-outline));
|
|
105
111
|
padding: 4px;
|
|
106
112
|
text-align: left;
|
|
113
|
+
white-space: nowrap;
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
text-overflow: ellipsis;
|
|
107
116
|
}
|
|
108
117
|
|
|
109
118
|
th {
|
package/src/ox-resource-chart.ts
CHANGED
|
@@ -16,12 +16,14 @@ export class OxResourceChart extends LitElement {
|
|
|
16
16
|
display: flex;
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
position: relative;
|
|
19
|
+
user-select: none;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
div[chart-container] {
|
|
22
23
|
flex-direction: column;
|
|
23
24
|
overflow-x: auto;
|
|
24
25
|
overflow-y: hidden;
|
|
26
|
+
overscroll-behavior: none;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
svg[header] {
|
package/src/ox-task-tooltip.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LitElement, html, css } from 'lit'
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js'
|
|
2
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
|
3
3
|
|
|
4
4
|
@customElement('ox-task-tooltip')
|
|
5
5
|
export class OxTaskTooltip extends LitElement {
|
|
6
6
|
static styles = css`
|
|
7
7
|
:host {
|
|
8
|
-
position: fixed;
|
|
8
|
+
position: fixed;
|
|
9
9
|
background-color: var(--ox-gantt-tooltip-background-color, var(--md-sys-color-surface-variant, #f9f9f9));
|
|
10
10
|
border: 1px solid var(--ox-gantt-tooltip-border-color, var(--md-sys-color-outline, #ccc));
|
|
11
11
|
padding: var(--spacing-medium, 10px);
|
|
@@ -21,17 +21,18 @@ export class OxTaskTooltip extends LitElement {
|
|
|
21
21
|
transition:
|
|
22
22
|
visibility 0.1s,
|
|
23
23
|
opacity 0.1s;
|
|
24
|
-
opacity: 0;
|
|
24
|
+
opacity: 0;
|
|
25
25
|
}
|
|
26
26
|
:host([visible]) {
|
|
27
27
|
visibility: visible;
|
|
28
|
-
opacity: 1;
|
|
28
|
+
opacity: 1;
|
|
29
29
|
}
|
|
30
30
|
.title {
|
|
31
31
|
font-weight: bold;
|
|
32
32
|
font-size: 16px;
|
|
33
33
|
margin-bottom: 8px;
|
|
34
|
-
color: var(--ox-gantt-tooltip-title-color, var(--md-sys-color-primary, #0078d4));
|
|
34
|
+
color: var(--ox-gantt-tooltip-title-color, var(--md-sys-color-primary, #0078d4));
|
|
35
|
+
outline: none;
|
|
35
36
|
}
|
|
36
37
|
.detail {
|
|
37
38
|
display: grid;
|
|
@@ -42,14 +43,24 @@ export class OxTaskTooltip extends LitElement {
|
|
|
42
43
|
.label {
|
|
43
44
|
font-weight: bold;
|
|
44
45
|
color: var(--ox-gantt-tooltip-color, var(--md-sys-color-secondary, #333));
|
|
45
|
-
text-align: right;
|
|
46
|
+
text-align: right;
|
|
46
47
|
}
|
|
47
48
|
.colon {
|
|
48
49
|
text-align: center;
|
|
49
50
|
color: var(--ox-gantt-tooltip-color, var(--md-sys-color-secondary, #333));
|
|
50
51
|
}
|
|
51
52
|
.value {
|
|
52
|
-
text-align: left;
|
|
53
|
+
text-align: left;
|
|
54
|
+
color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));
|
|
55
|
+
}
|
|
56
|
+
.close-button {
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 4px;
|
|
59
|
+
right: 8px;
|
|
60
|
+
background: none;
|
|
61
|
+
border: none;
|
|
62
|
+
font-size: 16px;
|
|
63
|
+
cursor: pointer;
|
|
53
64
|
color: var(--ox-gantt-tooltip-color, var(--md-sys-color-on-surface, #333));
|
|
54
65
|
}
|
|
55
66
|
`
|
|
@@ -59,6 +70,9 @@ export class OxTaskTooltip extends LitElement {
|
|
|
59
70
|
@property({ type: String }) endDate = ''
|
|
60
71
|
@property({ type: Number }) progress = 0
|
|
61
72
|
@property({ type: String }) type = ''
|
|
73
|
+
@property({ type: Boolean, attribute: true }) visible: boolean = false
|
|
74
|
+
|
|
75
|
+
@query('.title') titleElement!: HTMLDivElement
|
|
62
76
|
|
|
63
77
|
show(x: number, y: number) {
|
|
64
78
|
const tooltipWidth = this.offsetWidth
|
|
@@ -100,15 +114,23 @@ export class OxTaskTooltip extends LitElement {
|
|
|
100
114
|
}
|
|
101
115
|
|
|
102
116
|
this.setAttribute('visible', '')
|
|
117
|
+
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
this.titleElement.addEventListener('blur', this.hide)
|
|
120
|
+
this.titleElement.focus({ preventScroll: true })
|
|
121
|
+
}, 500)
|
|
103
122
|
}
|
|
104
123
|
|
|
105
|
-
hide() {
|
|
124
|
+
hide = () => {
|
|
125
|
+
this.titleElement.removeEventListener('blur', this.hide)
|
|
106
126
|
this.removeAttribute('visible')
|
|
107
127
|
}
|
|
108
128
|
|
|
109
129
|
render() {
|
|
110
130
|
return html`
|
|
111
|
-
<div class="
|
|
131
|
+
<div class="close-button" @click=${this.hide} @touchstart=${this.hide}>✕</div>
|
|
132
|
+
<div class="title" tabindex="0">${this.title}</div>
|
|
133
|
+
|
|
112
134
|
<div class="detail">
|
|
113
135
|
<span class="label">Type</span><span class="colon">:</span><span class="value">${this.type}</span>
|
|
114
136
|
<span class="label">Start Date</span><span class="colon">:</span><span class="value">${this.startDate}</span>
|
|
@@ -68,6 +68,22 @@ const Template: Story<ArgTypes> = ({
|
|
|
68
68
|
</style>
|
|
69
69
|
|
|
70
70
|
<style>
|
|
71
|
+
html,
|
|
72
|
+
body {
|
|
73
|
+
margin: 0;
|
|
74
|
+
padding: 0;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
|
|
77
|
+
overscroll-behavior: none;
|
|
78
|
+
|
|
79
|
+
/* This is a font-stack that tries to use the system-default sans-serifs first */
|
|
80
|
+
font-family: Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
81
|
+
line-height: 1.5;
|
|
82
|
+
-webkit-font-smoothing: antialiased;
|
|
83
|
+
|
|
84
|
+
accent-color: var(--md-sys-color-primary);
|
|
85
|
+
}
|
|
86
|
+
|
|
71
87
|
body {
|
|
72
88
|
width: 100%;
|
|
73
89
|
height: 800px;
|