UNPKG

ibm-gantt-chart-react

Version:

IBM Gantt Chart React Component.

221 lines (189 loc) 9.18 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("prop-types"), require("react"), require("ibm-gantt-chart")); else if(typeof define === 'function' && define.amd) define(["prop-types", "react", "ibm-gantt-chart"], factory); else if(typeof exports === 'object') exports["ibm-gantt-chart-react"] = factory(require("prop-types"), require("react"), require("ibm-gantt-chart")); else root["ibm-gantt-chart-react"] = factory(root["PropTypes"], root["React"], root[undefined]); })(this, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 4); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__0__; /***/ }), /* 1 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__1__; /***/ }), /* 2 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE__2__; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /* 4 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "GanttChart", function() { return /* reexport */ GanttChart_GanttChart_GanttChart; }); __webpack_require__.d(__webpack_exports__, "version", function() { return /* binding */ version; }); // CONCATENATED MODULE: C:/Users/FredericDelhoume/git/gantt-chart/node_modules/@babel/runtime/helpers/defineProperty/_index.mjs function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // CONCATENATED MODULE: C:/Users/FredericDelhoume/git/gantt-chart/node_modules/@babel/runtime/helpers/esm/defineProperty.js // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(1); var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_); // EXTERNAL MODULE: external {"root":"PropTypes","commonjs2":"prop-types","commonjs":"prop-types","amd":"prop-types"} var external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_ = __webpack_require__(0); var external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_); // EXTERNAL MODULE: external {"commonjs2":"ibm-gantt-chart","commonjs":"ibm-gantt-chart","amd":"ibm-gantt-chart"} var external_commonjs2_ibm_gantt_chart_commonjs_ibm_gantt_chart_amd_ibm_gantt_chart_ = __webpack_require__(2); var external_commonjs2_ibm_gantt_chart_commonjs_ibm_gantt_chart_amd_ibm_gantt_chart_default = /*#__PURE__*/__webpack_require__.n(external_commonjs2_ibm_gantt_chart_commonjs_ibm_gantt_chart_amd_ibm_gantt_chart_); // EXTERNAL MODULE: ./src/components/GanttChart/GanttChart.scss var GanttChart_GanttChart = __webpack_require__(3); // CONCATENATED MODULE: ./src/components/GanttChart/GanttChart.jsx class GanttChart_GanttChart_GanttChart extends external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.PureComponent { componentDidMount() { this.gantt = new external_commonjs2_ibm_gantt_chart_commonjs_ibm_gantt_chart_amd_ibm_gantt_chart_default.a(this.node, this.props.config); } componentDidUpdate(prevProps, prevState) { if (prevProps.config !== this.props.config) { this.node.childNodes.forEach(child => child.remove()); // remove previous Gantt this.gantt = new external_commonjs2_ibm_gantt_chart_commonjs_ibm_gantt_chart_amd_ibm_gantt_chart_default.a(this.node, this.props.config); } } componentWillUnmount() { this.node = undefined; this.gantt = undefined; } render() { const { className, style } = this.props; return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { ref: node => this.node = node, className: className ? `ibm-gantt-chart-react ${className}` : 'ibm-gantt-chart-react', style: style }); } } _defineProperty(GanttChart_GanttChart_GanttChart, "propTypes", { config: external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_default.a.shape({}).isRequired, className: external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_default.a.oneOfType([external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_default.a.string, external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_default.a.array, external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_default.a.object]), style: external_root_PropTypes_commonjs2_prop_types_commonjs_prop_types_amd_prop_types_default.a.shape({}) }); _defineProperty(GanttChart_GanttChart_GanttChart, "defaultProps", { className: undefined, style: undefined }); // CONCATENATED MODULE: ./src/index.js const version = "0.5.33"; // console.log(`[LOADED] ${NAME}@${VERSION}`); /***/ }) /******/ ]); }); //# sourceMappingURL=ibm-gantt-chart-react.js.map