|
1 | 1 | (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.JSGantt = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
2 | 2 | "use strict";
|
3 | 3 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 4 | +exports.JSGantt = void 0; |
4 | 5 | var jsGantt = require("./src/jsgantt");
|
5 | 6 | module.exports = jsGantt.JSGantt;
|
6 | 7 | exports.JSGantt = jsGantt.JSGantt;
|
7 | 8 |
|
8 | 9 | },{"./src/jsgantt":6}],2:[function(require,module,exports){
|
9 | 10 | "use strict";
|
10 | 11 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 12 | +exports.GanttChart = void 0; |
11 | 13 | var lang = require("./lang");
|
12 | 14 | var events_1 = require("./events");
|
13 | 15 | var general_utils_1 = require("./utils/general_utils");
|
@@ -160,6 +162,7 @@ exports.GanttChart = function (pDiv, pFormat) {
|
160 | 162 | this.DrawDependencies = draw_dependencies_1.DrawDependencies.bind(this);
|
161 | 163 | this.getArrayLocationByID = draw_utils_1.getArrayLocationByID.bind(this);
|
162 | 164 | this.drawSelector = draw_utils_1.drawSelector.bind(this);
|
| 165 | + this.printChart = general_utils_1.printChart.bind(this); |
163 | 166 | this.clearDependencies = function () {
|
164 | 167 | var parent = this.getLines();
|
165 | 168 | if (this.vEventsChange.line &&
|
@@ -840,6 +843,7 @@ exports.GanttChart = function (pDiv, pFormat) {
|
840 | 843 | },{"./draw_columns":3,"./draw_dependencies":4,"./events":5,"./lang":8,"./options":9,"./task":10,"./utils/date_utils":11,"./utils/draw_utils":12,"./utils/general_utils":13,"./xml":14}],3:[function(require,module,exports){
|
841 | 844 | "use strict";
|
842 | 845 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 846 | +exports.draw_task_headings = exports.draw_bottom = exports.draw_header = exports.COLUMN_ORDER = void 0; |
843 | 847 | var date_utils_1 = require("./utils/date_utils");
|
844 | 848 | var task_1 = require("./task");
|
845 | 849 | var events_1 = require("./events");
|
@@ -1009,6 +1013,7 @@ exports.draw_task_headings = function (column, vTmpRow, vLangs, vLang, vAddition
|
1009 | 1013 | },{"./events":5,"./task":10,"./utils/date_utils":11,"./utils/draw_utils":12}],4:[function(require,module,exports){
|
1010 | 1014 | "use strict";
|
1011 | 1015 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 1016 | +exports.DrawDependencies = exports.drawDependency = void 0; |
1012 | 1017 | exports.drawDependency = function (x1, y1, x2, y2, pType, pClass) {
|
1013 | 1018 | var vDir = 1;
|
1014 | 1019 | var vBend = false;
|
@@ -1105,6 +1110,7 @@ exports.DrawDependencies = function (vDebug) {
|
1105 | 1110 | },{}],5:[function(require,module,exports){
|
1106 | 1111 | "use strict";
|
1107 | 1112 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 1113 | +exports.addListenerDependencies = exports.addListenerInputCell = exports.addListenerClickCell = exports.addScrollListeners = exports.addFormatListeners = exports.addFolderListeners = exports.updateGridHeaderWidth = exports.addThisRowListeners = exports.addTooltipListeners = exports.syncScroll = exports.removeListener = exports.addListener = exports.showToolTip = exports.mouseOut = exports.mouseOver = exports.show = exports.hide = exports.folder = void 0; |
1108 | 1114 | var general_utils_1 = require("./utils/general_utils");
|
1109 | 1115 | // Function to open/close and hide/show children of specified task
|
1110 | 1116 | exports.folder = function (pID, ganttObj) {
|
@@ -1505,6 +1511,7 @@ var vColumnsNames = {
|
1505 | 1511 | Copyright (c) 2009, Shlomy Gantz BlueBrick Inc.
|
1506 | 1512 | */
|
1507 | 1513 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 1514 | +exports.JSGantt = void 0; |
1508 | 1515 | var events_1 = require("./events");
|
1509 | 1516 | var general_utils_1 = require("./utils/general_utils");
|
1510 | 1517 | var xml_1 = require("./xml");
|
@@ -1568,10 +1575,11 @@ exports.JSGantt.criticalPath = general_utils_1.criticalPath;
|
1568 | 1575 | },{"./draw":2,"./events":5,"./json":7,"./task":10,"./utils/date_utils":11,"./utils/general_utils":13,"./xml":14}],7:[function(require,module,exports){
|
1569 | 1576 | "use strict";
|
1570 | 1577 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
| 1578 | + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |
1571 | 1579 | return new (P || (P = Promise))(function (resolve, reject) {
|
1572 | 1580 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
1573 | 1581 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
1574 |
| - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } |
| 1582 | + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |
1575 | 1583 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
1576 | 1584 | });
|
1577 | 1585 | };
|
@@ -1603,6 +1611,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
1603 | 1611 | }
|
1604 | 1612 | };
|
1605 | 1613 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 1614 | +exports.addJSONTask = exports.parseJSONString = exports.parseJSON = void 0; |
1606 | 1615 | var task_1 = require("./task");
|
1607 | 1616 | var general_utils_1 = require("./utils/general_utils");
|
1608 | 1617 | /**
|
@@ -1760,6 +1769,7 @@ exports.addJSONTask = function (pGanttVar, pJsonObj) {
|
1760 | 1769 | },{"./task":10,"./utils/general_utils":13}],8:[function(require,module,exports){
|
1761 | 1770 | "use strict";
|
1762 | 1771 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 1772 | +exports.ko = exports.hu = exports.cs = exports.ja = exports.tr = exports.id = exports.nl = exports.sv = exports.cn = exports.ru = exports.fr = exports.pt = exports.de = exports.es = exports.en = void 0; |
1763 | 1773 | var es = {
|
1764 | 1774 | 'january': 'Enero',
|
1765 | 1775 | 'february': 'Febrero',
|
@@ -2872,6 +2882,7 @@ exports.ko = ko;
|
2872 | 2882 | },{}],9:[function(require,module,exports){
|
2873 | 2883 | "use strict";
|
2874 | 2884 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 2885 | +exports.includeGetSet = void 0; |
2875 | 2886 | var date_utils_1 = require("./utils/date_utils");
|
2876 | 2887 | var draw_columns_1 = require("./draw_columns");
|
2877 | 2888 | exports.includeGetSet = function () {
|
@@ -3094,6 +3105,7 @@ var __assign = (this && this.__assign) || function () {
|
3094 | 3105 | return __assign.apply(this, arguments);
|
3095 | 3106 | };
|
3096 | 3107 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 3108 | +exports.processRows = exports.ClearTasks = exports.RemoveTaskItem = exports.AddTaskItemObject = exports.AddTaskItem = exports.createTaskInfo = exports.TaskItem = exports.TaskItemObject = exports.sortTasks = exports.taskLink = void 0; |
3097 | 3109 | var general_utils_1 = require("./utils/general_utils");
|
3098 | 3110 | var draw_utils_1 = require("./utils/draw_utils");
|
3099 | 3111 | var date_utils_1 = require("./utils/date_utils");
|
@@ -3815,6 +3827,7 @@ exports.processRows = function (pList, pID, pRow, pLevel, pOpen, pUseSort, vDebu
|
3815 | 3827 | },{"./utils/date_utils":11,"./utils/draw_utils":12,"./utils/general_utils":13}],11:[function(require,module,exports){
|
3816 | 3828 | "use strict";
|
3817 | 3829 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 3830 | +exports.getIsoWeek = exports.parseDateFormatStr = exports.formatDateStr = exports.parseDateStr = exports.coerceDate = exports.getMaxDate = exports.getMinDate = void 0; |
3818 | 3831 | /**
|
3819 | 3832 | * DATES
|
3820 | 3833 | */
|
@@ -4110,6 +4123,7 @@ exports.getIsoWeek = function (pDate) {
|
4110 | 4123 | },{}],12:[function(require,module,exports){
|
4111 | 4124 | "use strict";
|
4112 | 4125 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 4126 | +exports.drawSelector = exports.sLine = exports.CalcTaskXY = exports.getArrayLocationByID = exports.newNode = exports.makeInput = void 0; |
4113 | 4127 | var events_1 = require("../events");
|
4114 | 4128 | exports.makeInput = function (formattedValue, editable, type, value, choices) {
|
4115 | 4129 | if (type === void 0) { type = 'text'; }
|
@@ -4274,6 +4288,7 @@ exports.drawSelector = function (pPos) {
|
4274 | 4288 | },{"../events":5}],13:[function(require,module,exports){
|
4275 | 4289 | "use strict";
|
4276 | 4290 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 4291 | +exports.printChart = exports.calculateStartEndFromDepend = exports.makeRequestOldBrowsers = exports.makeRequest = exports.moveToolTip = exports.updateFlyingObj = exports.isParentElementOrSelf = exports.criticalPath = exports.hashKey = exports.hashString = exports.fadeToolTip = exports.hideToolTip = exports.isIE = exports.getOffset = exports.calculateCurrentDateOffset = exports.getScrollbarWidth = exports.getScrollPositions = exports.benchMark = exports.getZoomFactor = exports.delayedHide = exports.stripUnwanted = exports.stripIds = exports.changeFormat = exports.findObj = exports.internalPropertiesLang = exports.internalProperties = void 0; |
4277 | 4292 | exports.internalProperties = ['pID', 'pName', 'pStart', 'pEnd', 'pClass', 'pLink', 'pMile', 'pRes', 'pComp', 'pGroup', 'pParent',
|
4278 | 4293 | 'pOpen', 'pDepend', 'pCaption', 'pNotes', 'pGantt', 'pCost', 'pPlanStart', 'pPlanEnd'];
|
4279 | 4294 | exports.internalPropertiesLang = {
|
@@ -4724,10 +4739,26 @@ exports.makeRequestOldBrowsers = function (pFile, vDebug) {
|
4724 | 4739 | };
|
4725 | 4740 | exports.calculateStartEndFromDepend = function (tasksList) {
|
4726 | 4741 | };
|
| 4742 | +exports.printChart = function (width, height, css) { |
| 4743 | + if (css === void 0) { css = undefined; } |
| 4744 | + if (css === undefined) { |
| 4745 | + css = // Default injected CSS |
| 4746 | + "@media print {\n @page {\n size: " + width + "mm " + height + "mm;\n }\n /* set gantt container to the same width as the page */\n .gchartcontainer {\n width: " + width + "mm;\n }\n };"; |
| 4747 | + } |
| 4748 | + var $container = document.querySelector('.gchartcontainer'); |
| 4749 | + $container.insertAdjacentHTML('afterbegin', "<style>" + css + "</style>"); |
| 4750 | + // Remove the print CSS when the print dialog is closed |
| 4751 | + window.addEventListener('afterprint', function () { |
| 4752 | + $container.removeChild($container.children[0]); |
| 4753 | + }, { 'once': true }); |
| 4754 | + // Trigger the print |
| 4755 | + window.print(); |
| 4756 | +}; |
4727 | 4757 |
|
4728 | 4758 | },{}],14:[function(require,module,exports){
|
4729 | 4759 | "use strict";
|
4730 | 4760 | Object.defineProperty(exports, "__esModule", { value: true });
|
| 4761 | +exports.getXMLTask = exports.getXMLProject = exports.AddXMLTask = exports.getXMLNodeValue = exports.findXMLNode = exports.parseXMLString = exports.parseXML = void 0; |
4731 | 4762 | var task_1 = require("./task");
|
4732 | 4763 | var date_utils_1 = require("./utils/date_utils");
|
4733 | 4764 | var draw_utils_1 = require("./utils/draw_utils");
|
|
0 commit comments