@progress/kendo-layout-react-wrapper
Version:
Kendo UI Layout wrapper for React
654 lines (600 loc) • 24.3 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
else if(typeof exports === 'object')
exports["KendoLayoutReactWrapper"] = factory(require("react"));
else
root["KendoLayoutReactWrapper"] = factory(root["React"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__) {
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, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // 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 = 2);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
;
/// <reference types="@progress/kendo-ui" />
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var KendoBaseComponent = /** @class */ (function (_super) {
__extends(KendoBaseComponent, _super);
function KendoBaseComponent() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.didMount = false;
_this.elementRef = function (el) {
_this.domNode = el;
};
_this.exposeWidget = function () {
if (_this.props.widgetRef && typeof _this.props.widgetRef === 'function') {
_this.props.widgetRef(_this.widgetInstance);
}
};
_this.overrideDestroy = function () {
_this.widgetDestroy = _this.widgetInstance.destroy;
_this.widgetInstance.destroy = function () {
_this.destroyed = !_this.destroyed;
_this.widgetDestroy.call(_this.widgetInstance);
};
};
return _this;
}
KendoBaseComponent.prototype.componentDidMount = function () {
this.exposeWidget();
this.overrideDestroy();
this.didMount = true;
};
KendoBaseComponent.prototype.componentWillUnmount = function () {
if (!this.destroyed) {
this.widgetDestroy.call(this.widgetInstance);
}
this.exposeWidget();
};
return KendoBaseComponent;
}(React.PureComponent));
exports.default = KendoBaseComponent;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
;
Object.defineProperty(exports, "__esModule", { value: true });
var tabstrip_1 = __webpack_require__(3);
exports.TabStrip = tabstrip_1.default;
var tabs_1 = __webpack_require__(4);
exports.Tabs = tabs_1.default;
var tab_1 = __webpack_require__(5);
exports.Tab = tab_1.default;
var content_1 = __webpack_require__(6);
exports.Content = content_1.default;
var panelbar_1 = __webpack_require__(7);
exports.PanelBar = panelbar_1.default;
var panelitem_1 = __webpack_require__(8);
exports.PanelItem = panelitem_1.default;
var subitems_1 = __webpack_require__(9);
exports.SubItems = subitems_1.default;
var menu_1 = __webpack_require__(10);
exports.Menu = menu_1.default;
var contextmenu_1 = __webpack_require__(11);
exports.ContextMenu = contextmenu_1.default;
var menuitem_1 = __webpack_require__(12);
exports.MenuItem = menuitem_1.default;
var submenu_1 = __webpack_require__(13);
exports.SubMenu = submenu_1.default;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var kendo_base_component_react_wrapper_1 = __webpack_require__(1);
var TabStrip = /** @class */ (function (_super) {
__extends(TabStrip, _super);
function TabStrip() {
return _super !== null && _super.apply(this, arguments) || this;
}
TabStrip.prototype.componentDidMount = function () {
var domNode = this.domNode;
var _a = this.props, children = _a.children, widgetRef = _a.widgetRef, props = __rest(_a, ["children", "widgetRef"]);
if (domNode) {
this.widgetInstance = new kendo.ui.TabStrip(domNode, props);
_super.prototype.componentDidMount.call(this);
}
};
TabStrip.prototype.render = function () {
if (this.didMount) {
var _a = this.props, children = _a.children, widgetRef = _a.widgetRef, dataSource = _a.dataSource, props = __rest(_a, ["children", "widgetRef", "dataSource"]);
this.widgetInstance.setOptions(props);
var widget = this.widgetInstance;
if (widget.options.dataSource !== dataSource) {
widget.setDataSource(dataSource);
}
}
return (React.createElement("div", { ref: this.elementRef }, this.props.children));
};
return TabStrip;
}(kendo_base_component_react_wrapper_1.default));
exports.default = TabStrip;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var Tabs = /** @class */ (function (_super) {
__extends(Tabs, _super);
function Tabs() {
return _super !== null && _super.apply(this, arguments) || this;
}
Tabs.prototype.render = function () {
return (React.createElement("ul", null, this.props.children));
};
return Tabs;
}(React.Component));
exports.default = Tabs;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var Tab = /** @class */ (function (_super) {
__extends(Tab, _super);
function Tab() {
return _super !== null && _super.apply(this, arguments) || this;
}
Tab.prototype.render = function () {
return (React.createElement("li", null, this.props.children));
};
return Tab;
}(React.Component));
exports.default = Tab;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var Content = /** @class */ (function (_super) {
__extends(Content, _super);
function Content() {
return _super !== null && _super.apply(this, arguments) || this;
}
Content.prototype.render = function () {
return (React.createElement("div", null, this.props.children));
};
return Content;
}(React.Component));
exports.default = Content;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var kendo_base_component_react_wrapper_1 = __webpack_require__(1);
var PanelBar = /** @class */ (function (_super) {
__extends(PanelBar, _super);
function PanelBar() {
return _super !== null && _super.apply(this, arguments) || this;
}
PanelBar.prototype.componentDidMount = function () {
var domNode = this.domNode;
var _a = this.props, children = _a.children, widgetRef = _a.widgetRef, props = __rest(_a, ["children", "widgetRef"]);
if (domNode) {
this.widgetInstance = new kendo.ui.PanelBar(domNode, props);
_super.prototype.componentDidMount.call(this);
}
};
PanelBar.prototype.render = function () {
if (this.didMount) {
var _a = this.props, children = _a.children, widgetRef = _a.widgetRef, props = __rest(_a, ["children", "widgetRef"]);
var widget = this.widgetInstance;
if (props.dataSource && props.dataSource === widget.options.dataSource) {
delete props.dataSource;
}
this.widgetInstance.setOptions(props);
}
return (React.createElement("ul", { ref: this.elementRef }, this.props.children));
};
return PanelBar;
}(kendo_base_component_react_wrapper_1.default));
exports.default = PanelBar;
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var PanelItem = /** @class */ (function (_super) {
__extends(PanelItem, _super);
function PanelItem() {
return _super !== null && _super.apply(this, arguments) || this;
}
PanelItem.prototype.render = function () {
return (React.createElement("li", null, this.props.children));
};
return PanelItem;
}(React.Component));
exports.default = PanelItem;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var SubItems = /** @class */ (function (_super) {
__extends(SubItems, _super);
function SubItems() {
return _super !== null && _super.apply(this, arguments) || this;
}
SubItems.prototype.render = function () {
return (React.createElement("ul", null, this.props.children));
};
return SubItems;
}(React.Component));
exports.default = SubItems;
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var kendo_base_component_react_wrapper_1 = __webpack_require__(1);
var Menu = /** @class */ (function (_super) {
__extends(Menu, _super);
function Menu() {
return _super !== null && _super.apply(this, arguments) || this;
}
Menu.prototype.componentDidMount = function () {
var domNode = this.domNode;
var _a = this.props, children = _a.children, widgetRef = _a.widgetRef, props = __rest(_a, ["children", "widgetRef"]);
if (domNode) {
this.widgetInstance = new kendo.ui.Menu(domNode, props);
_super.prototype.componentDidMount.call(this);
}
};
Menu.prototype.render = function () {
if (this.domNode) {
var _a = this.props, children = _a.children, widgetRef = _a.widgetRef, props = __rest(_a, ["children", "widgetRef"]);
var widget = this.widgetInstance;
if (props.dataSource && props.dataSource === widget.options.dataSource) {
delete props.dataSource;
}
this.widgetInstance.setOptions(props);
}
return (React.createElement("ul", { ref: this.elementRef }, this.props.children));
};
return Menu;
}(kendo_base_component_react_wrapper_1.default));
exports.default = Menu;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var kendo_base_component_react_wrapper_1 = __webpack_require__(1);
var ContextMenu = /** @class */ (function (_super) {
__extends(ContextMenu, _super);
function ContextMenu() {
return _super !== null && _super.apply(this, arguments) || this;
}
ContextMenu.prototype.componentDidMount = function () {
var domNode = this.domNode;
var _a = this.props, children = _a.children, widgetRef = _a.widgetRef, props = __rest(_a, ["children", "widgetRef"]);
if (domNode) {
this.widgetInstance = new kendo.ui.ContextMenu(domNode, props);
_super.prototype.componentDidMount.call(this);
}
};
ContextMenu.prototype.render = function () {
if (this.didMount) {
var _a = this.props, children = _a.children, widgetRef = _a.widgetRef, props = __rest(_a, ["children", "widgetRef"]);
var widget = this.widgetInstance;
if (props.dataSource && props.dataSource === widget.options.dataSource) {
delete props.dataSource;
}
this.widgetInstance.setOptions(props);
}
return (React.createElement("ul", { ref: this.elementRef }, this.props.children));
};
return ContextMenu;
}(kendo_base_component_react_wrapper_1.default));
exports.default = ContextMenu;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var MenuItem = /** @class */ (function (_super) {
__extends(MenuItem, _super);
function MenuItem() {
return _super !== null && _super.apply(this, arguments) || this;
}
MenuItem.prototype.render = function () {
return (React.createElement("li", null, this.props.children));
};
return MenuItem;
}(React.Component));
exports.default = MenuItem;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
;
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = __webpack_require__(0);
var SubMenu = /** @class */ (function (_super) {
__extends(SubMenu, _super);
function SubMenu() {
return _super !== null && _super.apply(this, arguments) || this;
}
SubMenu.prototype.render = function () {
return (React.createElement("ul", null, this.props.children));
};
return SubMenu;
}(React.Component));
exports.default = SubMenu;
/***/ })
/******/ ]);
});
//# sourceMappingURL=kendo-layout-react-wrapper.js.map