build version 0.0.1

This commit is contained in:
Faris Ansari 2016-12-28 12:22:03 +05:30
parent abfbaa709b
commit cf3e4bbd8f
8 changed files with 54 additions and 64 deletions

16
dist/frappe-gantt.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
{ {
"name": "frappe-gantt", "name": "frappe-gantt",
"version": "0.0.1", "version": "0.0.1",
"description": "Visualize tasks on a timeline", "description": "A simple, modern, interactive gantt library for the web",
"main": "lib/gantt.js", "main": "dist/frappe-gantt.js",
"scripts": { "scripts": {
"build": "webpack --mode=build", "build": "webpack --mode=build",
"dev": "webpack --progress --colors --watch --mode=dev", "dev": "webpack --progress --colors --watch --mode=dev",
@ -34,7 +34,9 @@
"gantt", "gantt",
"svg", "svg",
"simple gantt", "simple gantt",
"project timeline" "project timeline",
"interactive gantt",
"project management"
], ],
"author": "Faris Ansari", "author": "Faris Ansari",
"license": "MIT", "license": "MIT",

View File

@ -17,6 +17,14 @@ export default function Gantt(element, tasks, config) {
function init() { function init() {
set_defaults(); set_defaults();
// expose methods
self.change_view_mode = change_view_mode;
self.unselect_all = unselect_all;
self.view_is = view_is;
self.get_bar = get_bar;
self.trigger_event = trigger_event;
// initialize with default view mode // initialize with default view mode
change_view_mode(self.config.view_mode); change_view_mode(self.config.view_mode);
} }
@ -61,7 +69,6 @@ export default function Gantt(element, tasks, config) {
// fire viewmode_change event // fire viewmode_change event
trigger_event('view_change', [mode]); trigger_event('view_change', [mode]);
} }
self.change_view_mode = change_view_mode;
function prepare() { function prepare() {
prepare_tasks(); prepare_tasks();
@ -113,6 +120,7 @@ export default function Gantt(element, tasks, config) {
return task; return task;
}); });
} }
function prepare_dependencies() { function prepare_dependencies() {
self.dependency_map = {}; self.dependency_map = {};
@ -480,7 +488,6 @@ export default function Gantt(element, tasks, config) {
el.removeClass('active'); el.removeClass('active');
}); });
} }
self.unselect_all = unselect_all;
function view_is(modes) { function view_is(modes) {
if (typeof modes === 'string') { if (typeof modes === 'string') {
@ -492,7 +499,6 @@ export default function Gantt(element, tasks, config) {
return false; return false;
} }
} }
self.view_is = view_is;
function get_task(id) { function get_task(id) {
return self.tasks.find((task) => { return self.tasks.find((task) => {
@ -505,14 +511,12 @@ export default function Gantt(element, tasks, config) {
return bar.task.id === id; return bar.task.id === id;
}); });
} }
self.get_bar = get_bar; // required in Bar
function trigger_event(event, args) { function trigger_event(event, args) {
if(self.config['on_' + event]) { if(self.config['on_' + event]) {
self.config['on_' + event].apply(null, args); self.config['on_' + event].apply(null, args);
} }
} }
self.trigger_event = trigger_event;
init(); init();

View File

@ -11,36 +11,35 @@ $blue: #a3a3ff;
$handle-color: #ddd; $handle-color: #ddd;
.gantt { .gantt {
#grid {
.grid-background { .grid-background {
fill: none; fill: none;
} }
.grid-header { .grid-header {
fill: #ffffff; fill: #ffffff;
stroke: $border-color; stroke: $border-color;
stroke-width: 1.4; stroke-width: 1.4;
} }
.grid-row { .grid-row {
fill: #ffffff; fill: #ffffff;
} }
.grid-row:nth-child(even) { .grid-row:nth-child(even) {
fill: $light-bg; fill: $light-bg;
} }
.row-line { .row-line {
stroke: $light-border-color; stroke: $light-border-color;
} }
.tick { .tick {
stroke: $border-color; stroke: $border-color;
stroke-width: 0.2; stroke-width: 0.2;
&.thick { &.thick {
stroke-width: 0.4; stroke-width: 0.4;
}
}
.today-highlight {
fill: $light-yellow;
opacity: 0.5;
} }
} }
.today-highlight {
fill: $light-yellow;
opacity: 0.5;
}
#arrow { #arrow {
fill: none; fill: none;

View File

@ -1,19 +0,0 @@
import chai from 'chai';
import Library from '../lib/library.js';
chai.expect();
const expect = chai.expect;
let lib;
describe('Given an instance of my library', function () {
before(function () {
lib = new Library();
});
describe('when I need the name', function () {
it('should return the name', () => {
expect(lib.name).to.be.equal('Library');
});
});
});