forked from alitech-uz/frappe-gantt-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3c635a
commit c4ead49
Showing
5 changed files
with
157 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,82 @@ | ||
{ | ||
"name": "frappe-gantt-react", | ||
"version": "0.2.2", | ||
"license": "MIT", | ||
"main": "./index.js", | ||
"types": "./typings/main.d.ts", | ||
"author": { | ||
"name": "Mohammed Abdulkereem", | ||
"email": "[email protected]" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mohammed-io/frappe-gantt-react" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/mohammed-io/frappe-gantt-react/issues" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"frappe gantt wrapper", | ||
"gantt", | ||
"svg", | ||
"simple gantt", | ||
"project timeline", | ||
"interactive gantt", | ||
"project management" | ||
], | ||
"dependencies": { | ||
"frappe-gantt": "^0.3.0", | ||
"moment": "^2.24.0", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-scripts": "3.0.0" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"dist": "npm run tsc ;rollup -c", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject", | ||
"tsc": "tsc -p tsconfig.prod.json" | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
"name": "frappe-gantt-react-extended", | ||
"version": "0.2.2", | ||
"license": "MIT", | ||
"main": "./index.js", | ||
"types": "./typings/main.d.ts", | ||
"author": { | ||
"name": "Mohammed Abdulkereem", | ||
"email": "[email protected]" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Alisher778/frappe-gantt-react-extended" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Alisher778/frappe-gantt-react-extended/issues" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"frappe gantt wrapper", | ||
"gantt", | ||
"svg", | ||
"simple gantt", | ||
"project timeline", | ||
"interactive gantt", | ||
"project management" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-proposal-optional-chaining": "^7.2.0", | ||
"@babel/preset-env": "^7.4.4", | ||
"@babel/preset-react": "^7.0.0", | ||
"@svgr/rollup": "^4.2.0", | ||
"@types/jest": "24.0.12", | ||
"@types/node": "11.13.9", | ||
"@types/react": "16.8.15", | ||
"@types/react-dom": "16.8.4", | ||
"node-sass": "^4.12.0", | ||
"parcel-bundler": "^1.12.3", | ||
"rollup": "^1.11.0", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.3.4", | ||
"rollup-plugin-node-resolve": "^4.2.3", | ||
"rollup-plugin-peer-deps-external": "^2.2.0", | ||
"rollup-plugin-postcss": "^2.0.3", | ||
"rollup-plugin-sass": "^1.2.2", | ||
"rollup-plugin-terser": "^4.0.4", | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"rollup-plugin-url": "^2.2.1", | ||
"typescript": "3.4.5" | ||
} | ||
} | ||
"dependencies": { | ||
"frappe-gantt": "^0.3.0", | ||
"frappe-gantt-extended": "^0.0.1", | ||
"moment": "^2.24.0", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-scripts": "3.0.0" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"dist": "npm run tsc ;rollup -c", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject", | ||
"tsc": "tsc -p tsconfig.prod.json" | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-proposal-optional-chaining": "^7.2.0", | ||
"@babel/preset-env": "^7.4.4", | ||
"@babel/preset-react": "^7.0.0", | ||
"@svgr/rollup": "^4.2.0", | ||
"@types/jest": "24.0.12", | ||
"@types/node": "11.13.9", | ||
"@types/react": "16.8.15", | ||
"@types/react-dom": "16.8.4", | ||
"node-sass": "^4.12.0", | ||
"parcel-bundler": "^1.12.3", | ||
"rollup": "^1.11.0", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.3.4", | ||
"rollup-plugin-node-resolve": "^4.2.3", | ||
"rollup-plugin-peer-deps-external": "^2.2.0", | ||
"rollup-plugin-postcss": "^2.0.3", | ||
"rollup-plugin-sass": "^1.2.2", | ||
"rollup-plugin-terser": "^4.0.4", | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"rollup-plugin-url": "^2.2.1", | ||
"typescript": "3.4.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
declare module "frappe-gantt"; | ||
declare module "frappe-gantt-extended"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,87 @@ | ||
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = __importStar(require("react")); | ||
var frappe_gantt_1 = __importDefault(require("frappe-gantt")); | ||
var frappe_gantt_1 = __importDefault(require("frappe-gantt-extended")); | ||
var ViewMode_1 = require("./ViewMode"); | ||
var frappeGanttDefaultProps = { | ||
viewMode: ViewMode_1.ViewMode.Day, | ||
onTasksChange: function (tasks) { }, | ||
onClick: function (task) { }, | ||
onDateChange: function (task, start, end) { }, | ||
onProgressChange: function (task, progress) { }, | ||
onViewChange: function (mode) { } | ||
viewMode: ViewMode_1.ViewMode.Day, | ||
onTasksChange: function (tasks) { }, | ||
onClick: function (task) { }, | ||
onDateChange: function (task, start, end) { }, | ||
onProgressChange: function (task, progress) { }, | ||
onViewChange: function (mode) { } | ||
}; | ||
var FrappeGantt = /** @class */ (function (_super) { | ||
__extends(FrappeGantt, _super); | ||
function FrappeGantt() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this._target = react_1.createRef(); | ||
_this._svg = react_1.createRef(); | ||
_this._gantt = null; | ||
_this.state = { | ||
viewMode: null | ||
}; | ||
return _this; | ||
} | ||
FrappeGantt.getDerivedStateFromProps = function (nextProps, state) { | ||
return { | ||
viewMode: nextProps.viewMode | ||
}; | ||
}; | ||
FrappeGantt.prototype.componentDidUpdate = function () { | ||
if (this._gantt) { | ||
this._gantt.change_view_mode(this.state.viewMode); | ||
} | ||
__extends(FrappeGantt, _super); | ||
function FrappeGantt() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this._target = react_1.createRef(); | ||
_this._svg = react_1.createRef(); | ||
_this._gantt = null; | ||
_this.state = { | ||
viewMode: null | ||
}; | ||
FrappeGantt.prototype.componentDidMount = function () { | ||
var _this = this; | ||
this._gantt = new frappe_gantt_1.default(this._svg.current, this.props.tasks, { | ||
on_click: this.props.onClick, | ||
on_view_change: this.props.onViewChange, | ||
on_progress_change: function (task, progress) { | ||
_this.props.onProgressChange(task, progress); | ||
_this.props.onTasksChange(_this.props.tasks); | ||
}, | ||
on_date_change: function (task, start, end) { | ||
_this.props.onDateChange(task, start, end); | ||
_this.props.onTasksChange(_this.props.tasks); | ||
} | ||
}); | ||
if (this._gantt) { | ||
this._gantt.change_view_mode(this.state.viewMode); | ||
} | ||
var midOfSvg = this._svg.current.clientWidth * 0.5; | ||
this._target.current.scrollLeft = midOfSvg; | ||
return _this; | ||
} | ||
FrappeGantt.getDerivedStateFromProps = function (nextProps, state) { | ||
return { | ||
viewMode: nextProps.viewMode | ||
}; | ||
FrappeGantt.prototype.render = function () { | ||
return (<div style={{ overflow: "scroll" }} ref={this._target}> | ||
<svg ref={this._svg} width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink"/> | ||
</div>); | ||
}; | ||
FrappeGantt.defaultProps = frappeGanttDefaultProps; | ||
return FrappeGantt; | ||
}; | ||
FrappeGantt.prototype.componentDidUpdate = function () { | ||
if (this._gantt) { | ||
this._gantt.change_view_mode(this.state.viewMode); | ||
} | ||
}; | ||
FrappeGantt.prototype.componentDidMount = function () { | ||
var _this = this; | ||
this._gantt = new frappe_gantt_1.default(this._svg.current, this.props.tasks, { | ||
on_click: this.props.onClick, | ||
on_view_change: this.props.onViewChange, | ||
on_progress_change: function (task, progress) { | ||
_this.props.onProgressChange(task, progress); | ||
_this.props.onTasksChange(_this.props.tasks); | ||
}, | ||
on_date_change: function (task, start, end) { | ||
_this.props.onDateChange(task, start, end); | ||
_this.props.onTasksChange(_this.props.tasks); | ||
} | ||
}); | ||
if (this._gantt) { | ||
this._gantt.change_view_mode(this.state.viewMode); | ||
} | ||
var midOfSvg = this._svg.current.clientWidth * 0.5; | ||
this._target.current.scrollLeft = midOfSvg; | ||
}; | ||
FrappeGantt.prototype.render = function () { | ||
return (<div style={{ overflow: "scroll" }} ref={this._target}> | ||
<svg ref={this._svg} width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" /> | ||
</div>); | ||
}; | ||
FrappeGantt.defaultProps = frappeGanttDefaultProps; | ||
return FrappeGantt; | ||
}(react_1.default.Component)); | ||
exports.FrappeGantt = FrappeGantt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters