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

View File

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

View File

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