@qn-pandora/pandora-visualization
Version:
Pandora 通用可视化库
36 lines (35 loc) • 1.51 kB
JavaScript
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 (Object.prototype.hasOwnProperty.call(b, 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 __());
};
})();
import React from 'react';
import { Spin } from 'antd';
import { colors } from './constants';
var BlockPicker = React.lazy(function () {
return import('react-color').then(function (_a) {
var BlockPicker = _a.BlockPicker;
return ({ default: BlockPicker });
});
});
var BlockPickers = /** @class */ (function (_super) {
__extends(BlockPickers, _super);
function BlockPickers() {
return _super !== null && _super.apply(this, arguments) || this;
}
BlockPickers.prototype.render = function () {
var _a = this.props, fontColor = _a.fontColor, onChange = _a.onChange;
return (React.createElement(React.Suspense, { fallback: React.createElement(Spin, null) },
React.createElement(BlockPicker, { colors: colors, color: fontColor, onChange: onChange })));
};
return BlockPickers;
}(React.Component));
export default BlockPickers;