123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- 'use strict';
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['react', 'prop-types', 'ca-ui-toolkit', '../VisualizationContentContainer', '../VisualItem'], function (React, PropTypes, UI_Toolkit, VisualizationContentContainer, VisualItem) {
- var FlexLayout = UI_Toolkit.FlexLayout,
- FlexItem = UI_Toolkit.FlexItem;
- var CustomVisualItems = function (_VisualizationContent) {
- _inherits(CustomVisualItems, _VisualizationContent);
- function CustomVisualItems(props) {
- _classCallCheck(this, CustomVisualItems);
- var _this = _possibleConstructorReturn(this, _VisualizationContent.call(this, props));
- _this.target = undefined;
- _this.targetName = undefined;
- _this.state = {
- isContextMenuOpen: false,
- items: _this.props.items
- };
- return _this;
- }
- CustomVisualItems.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- this.setState({
- items: nextProps.items
- });
- };
- CustomVisualItems.prototype.render = function render() {
- var _this2 = this;
- var items = this.state.items;
- var containerClass = this.props.containerClass;
- var contentItems = [];
- items.forEach(function (item) {
- contentItems.push(_this2.renderVisualizationItem(item));
- });
- return React.createElement(
- FlexLayout,
- {
- className: containerClass,
- fullHeight: true,
- direction: 'column',
- justifyContent: 'flex-start'
- },
- React.createElement(
- FlexItem,
- null,
- React.createElement(
- FlexLayout,
- {
- fullHeight: true,
- direction: 'row',
- wrap: 'wrap'
- },
- contentItems
- )
- )
- );
- };
- CustomVisualItems.prototype.renderVisualizationItem = function renderVisualizationItem(item) {
- var _props = this.props,
- onContextMenuChange = _props.onContextMenuChange,
- handlers = _props.handlers;
- return React.createElement(VisualItem, {
- item: item,
- handlers: handlers,
- onContextMenuChange: onContextMenuChange,
- openSelectBundleFileDialog: this.props.handlers.openSelectBundleFileDialog,
- customVisAction: this.props.customVisAction
- });
- };
- return CustomVisualItems;
- }(VisualizationContentContainer);
- CustomVisualItems.propTypes = {
- items: PropTypes.array,
- isRefreshing: PropTypes.bool,
- containerClass: PropTypes.string.isRequired,
- itemClass: PropTypes.string.isRequired,
- handlers: PropTypes.shape({
- openSelectBundleFileDialog: PropTypes.func.isRequired
- }).isRequired,
- customVisAction: PropTypes.object.isRequired
- };
- CustomVisualItems.defaultProps = {
- items: [],
- onContextMenuChange: function onContextMenuChange() {}
- };
- return CustomVisualItems;
- });
- //# sourceMappingURL=CustomVisualItems.js.map
|