Skip to content

Commit 8c082e7

Browse files
[v0.1.0] Major Refactor (frappe#57)
* [v0.1.0] Major Refactor - Remove moment and Snap dependencies - Use Rollup as build tool - Use Prettier for linting/styling - Use Jest for testing - Use yarn * Change Bar hover behaviour, Bar animation * Corner radius configurable
1 parent 2abbb1d commit 8c082e7

20 files changed

+7701
-3446
lines changed

.babelrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"presets": ["es2015"],
3-
"plugins": ["babel-plugin-add-module-exports"]
2+
"presets": ["env"]
43
}

.eslintrc

100755100644
+5-180
Original file line numberDiff line numberDiff line change
@@ -1,182 +1,7 @@
11
{
2-
"ecmaFeatures": {
3-
"globalReturn": true,
4-
"jsx": true,
5-
"modules": true
6-
},
7-
8-
"env": {
9-
"browser": true,
10-
"es6": true,
11-
"node": true
12-
},
13-
14-
"globals": {
15-
"document": false,
16-
"escape": false,
17-
"navigator": false,
18-
"unescape": false,
19-
"window": false,
20-
"describe": true,
21-
"before": true,
22-
"it": true,
23-
"expect": true,
24-
"sinon": true
25-
},
26-
27-
"parser": "babel-eslint",
28-
29-
"plugins": [
30-
31-
],
32-
33-
"rules": {
34-
"block-scoped-var": 2,
35-
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
36-
"comma-dangle": [2, "never"],
37-
"comma-spacing": [2, { "before": false, "after": true }],
38-
"comma-style": [2, "last"],
39-
"complexity": 0,
40-
"consistent-return": 2,
41-
"consistent-this": 0,
42-
"curly": [2, "multi-line"],
43-
"default-case": 0,
44-
"dot-location": [2, "property"],
45-
"dot-notation": 0,
46-
"eol-last": 2,
47-
"eqeqeq": [2, "allow-null"],
48-
"func-names": 0,
49-
"func-style": 0,
50-
"generator-star-spacing": [2, "both"],
51-
"guard-for-in": 0,
52-
"handle-callback-err": [2, "^(err|error|anySpecificError)$" ],
53-
"indent": [2, "tab", { "SwitchCase": 1 }],
54-
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
55-
"linebreak-style": 0,
56-
"max-depth": 0,
57-
"max-len": [2, 120, 4],
58-
"max-nested-callbacks": 0,
59-
"max-params": 0,
60-
"max-statements": 0,
61-
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
62-
"new-parens": 2,
63-
"no-alert": 0,
64-
"no-array-constructor": 2,
65-
"no-bitwise": 0,
66-
"no-caller": 2,
67-
"no-catch-shadow": 0,
68-
"no-cond-assign": 2,
69-
"no-console": 0,
70-
"no-constant-condition": 0,
71-
"no-continue": 0,
72-
"no-control-regex": 2,
73-
"no-debugger": 2,
74-
"no-delete-var": 2,
75-
"no-div-regex": 0,
76-
"no-dupe-args": 2,
77-
"no-dupe-keys": 2,
78-
"no-duplicate-case": 2,
79-
"no-else-return": 2,
80-
"no-empty": 0,
81-
"no-empty-character-class": 2,
82-
"no-empty-label": 2,
83-
"no-eq-null": 0,
84-
"no-eval": 2,
85-
"no-ex-assign": 2,
86-
"no-extend-native": 2,
87-
"no-extra-bind": 2,
88-
"no-extra-boolean-cast": 2,
89-
"no-extra-parens": 0,
90-
"no-extra-semi": 0,
91-
"no-extra-strict": 0,
92-
"no-fallthrough": 2,
93-
"no-floating-decimal": 2,
94-
"no-func-assign": 2,
95-
"no-implied-eval": 2,
96-
"no-inline-comments": 0,
97-
"no-inner-declarations": [2, "functions"],
98-
"no-invalid-regexp": 2,
99-
"no-irregular-whitespace": 2,
100-
"no-iterator": 2,
101-
"no-label-var": 2,
102-
"no-labels": 2,
103-
"no-lone-blocks": 0,
104-
"no-lonely-if": 0,
105-
"no-loop-func": 0,
106-
"no-mixed-requires": 0,
107-
"no-mixed-spaces-and-tabs": [2, false],
108-
"no-multi-spaces": 2,
109-
"no-multi-str": 2,
110-
"no-multiple-empty-lines": [2, { "max": 1 }],
111-
"no-native-reassign": 2,
112-
"no-negated-in-lhs": 2,
113-
"no-nested-ternary": 0,
114-
"no-new": 2,
115-
"no-new-func": 2,
116-
"no-new-object": 2,
117-
"no-new-require": 2,
118-
"no-new-wrappers": 2,
119-
"no-obj-calls": 2,
120-
"no-octal": 2,
121-
"no-octal-escape": 2,
122-
"no-path-concat": 0,
123-
"no-plusplus": 0,
124-
"no-process-env": 0,
125-
"no-process-exit": 0,
126-
"no-proto": 2,
127-
"no-redeclare": 2,
128-
"no-regex-spaces": 2,
129-
"no-reserved-keys": 0,
130-
"no-restricted-modules": 0,
131-
"no-return-assign": 2,
132-
"no-script-url": 0,
133-
"no-self-compare": 2,
134-
"no-sequences": 2,
135-
"no-shadow": 0,
136-
"no-shadow-restricted-names": 2,
137-
"no-spaced-func": 2,
138-
"no-sparse-arrays": 2,
139-
"no-sync": 0,
140-
"no-ternary": 0,
141-
"no-throw-literal": 2,
142-
"no-trailing-spaces": 2,
143-
"no-undef": 2,
144-
"no-undef-init": 2,
145-
"no-undefined": 0,
146-
"no-underscore-dangle": 0,
147-
"no-unneeded-ternary": 2,
148-
"no-unreachable": 2,
149-
"no-unused-expressions": 0,
150-
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
151-
"no-var": 0,
152-
"no-void": 0,
153-
"no-warning-comments": 0,
154-
"no-with": 2,
155-
"one-var": 0,
156-
"operator-assignment": 0,
157-
"operator-linebreak": [2, "after"],
158-
"padded-blocks": 0,
159-
"quote-props": 0,
160-
"quotes": [2, "single", "avoid-escape"],
161-
"radix": 2,
162-
"semi": [2, "always"],
163-
"semi-spacing": 0,
164-
"sort-vars": 0,
165-
"space-before-blocks": [2, "always"],
166-
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
167-
"space-in-brackets": 0,
168-
"space-in-parens": [2, "never"],
169-
"space-infix-ops": 2,
170-
"space-return-throw-case": 2,
171-
"space-unary-ops": [2, { "words": true, "nonwords": false }],
172-
"spaced-comment": [2, "always"],
173-
"strict": 0,
174-
"use-isnan": 2,
175-
"valid-jsdoc": 0,
176-
"valid-typeof": 2,
177-
"vars-on-top": 2,
178-
"wrap-iife": [2, "any"],
179-
"wrap-regex": 0,
180-
"yoda": [2, "never"]
181-
}
2+
"extends": ["plugin:prettier/recommended"],
3+
"parserOptions": {
4+
"ecmaVersion": 6,
5+
"sourceType": "module"
6+
}
1827
}

.prettierrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"tabWidth": 4,
3+
"singleQuote": true
4+
}

dist/frappe-gantt.css

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
.gantt .grid-background {
2+
fill: none; }
3+
4+
.gantt .grid-header {
5+
fill: #ffffff;
6+
stroke: #e0e0e0;
7+
stroke-width: 1.4; }
8+
9+
.gantt .grid-row {
10+
fill: #ffffff; }
11+
12+
.gantt .grid-row:nth-child(even) {
13+
fill: #f5f5f5; }
14+
15+
.gantt .row-line {
16+
stroke: #ebeff2; }
17+
18+
.gantt .tick {
19+
stroke: #e0e0e0;
20+
stroke-width: 0.2; }
21+
.gantt .tick.thick {
22+
stroke-width: 0.4; }
23+
24+
.gantt .today-highlight {
25+
fill: #fcf8e3;
26+
opacity: 0.5; }
27+
28+
.gantt .arrow {
29+
fill: none;
30+
stroke: #666;
31+
stroke-width: 1.4; }
32+
33+
.gantt .bar {
34+
fill: #b8c2cc;
35+
stroke: #8D99A6;
36+
stroke-width: 0;
37+
transition: stroke-width .3s ease;
38+
user-select: none; }
39+
40+
.gantt .bar-progress {
41+
fill: #a3a3ff; }
42+
43+
.gantt .bar-invalid {
44+
fill: transparent;
45+
stroke: #8D99A6;
46+
stroke-width: 1;
47+
stroke-dasharray: 5; }
48+
.gantt .bar-invalid ~ .bar-label {
49+
fill: #555; }
50+
51+
.gantt .bar-label {
52+
fill: #fff;
53+
dominant-baseline: central;
54+
text-anchor: middle;
55+
font-size: 12px;
56+
font-weight: lighter; }
57+
.gantt .bar-label.big {
58+
fill: #555;
59+
text-anchor: start; }
60+
61+
.gantt .handle {
62+
fill: #ddd;
63+
cursor: ew-resize;
64+
opacity: 0;
65+
visibility: hidden;
66+
transition: opacity .3s ease; }
67+
68+
.gantt .bar-wrapper {
69+
cursor: pointer; }
70+
.gantt .bar-wrapper:hover .bar {
71+
fill: #a9b5c1; }
72+
.gantt .bar-wrapper:hover .bar-progress {
73+
fill: #8a8aff; }
74+
.gantt .bar-wrapper:hover .handle {
75+
visibility: visible;
76+
opacity: 1; }
77+
.gantt .bar-wrapper.active .bar {
78+
fill: #a9b5c1; }
79+
.gantt .bar-wrapper.active .bar-progress {
80+
fill: #8a8aff; }
81+
82+
.gantt .lower-text, .gantt .upper-text {
83+
font-size: 12px;
84+
text-anchor: middle; }
85+
86+
.gantt .upper-text {
87+
fill: #555; }
88+
89+
.gantt .lower-text {
90+
fill: #333; }
91+
92+
.gantt .hide {
93+
display: none; }
94+
95+
.gantt-container {
96+
position: relative;
97+
font-size: 12px; }
98+
.gantt-container .popup-wrapper {
99+
position: absolute;
100+
top: 0;
101+
left: 0;
102+
background: rgba(0, 0, 0, 0.8);
103+
padding: 0;
104+
color: #959da5;
105+
border-radius: 3px; }
106+
.gantt-container .popup-wrapper .title {
107+
border-bottom: 3px solid #a3a3ff;
108+
padding: 10px; }
109+
.gantt-container .popup-wrapper .subtitle {
110+
padding: 10px;
111+
color: #dfe2e5; }
112+
.gantt-container .popup-wrapper .pointer {
113+
position: absolute;
114+
height: 5px;
115+
margin: 0 0 0 -5px;
116+
border: 5px solid transparent;
117+
border-top-color: rgba(0, 0, 0, 0.8); }

0 commit comments

Comments
 (0)