@ttk/component
Version:
ttk组件库
84 lines (73 loc) • 2.64 kB
JavaScript
import { _ as _defineProperty } from '../defineProperty-847730aa.js';
import { _ as _objectWithoutProperties } from '../objectWithoutProperties-0c3c7796.js';
import React__default from 'react';
import classNames from 'classnames';
import noSearch from './style/img/noSearch.png';
import noCustomers from './style/img/noCustomers.png';
import noContent from './style/img/noContent.png';
import noNetwork from './style/img/noNetwork.png';
import noDocoments from './style/img/noDocoments.png';
import noMessage from './style/img/noMessage.png';
import noAccountWarp from './style/img/noAccountWarp.png';
import systemMaintenance from './style/img/systemMaintenance.png';
import '../_commonjsHelpers-471920d6.js';
var _excluded = ["className", "style", "width", "height", "type", "children", "small", "size", "imgStyle", "spanStyle"];
//无客户 noCustomers
//无内容 noContent 默认值
//无网络 //无网络
//无文件 noDocoments
//无消息 noMessage
//无账套 noAccountWarp
//系统维护中 systemMaintenance
var pngs = {
noSearch: noSearch,
noCustomers: noCustomers,
noContent: noContent,
noNetwork: noNetwork,
noDocoments: noDocoments,
noMessage: noMessage,
noAccountWarp: noAccountWarp,
systemMaintenance: systemMaintenance
};
function NoDataComponent(props) {
var _classNames;
var className = props.className,
style = props.style,
width = props.width,
height = props.height,
type = props.type,
children = props.children,
small = props.small,
size = props.size,
imgStyle = props.imgStyle,
spanStyle = props.spanStyle;
_objectWithoutProperties(props, _excluded);
var img = 'noContent'; // size: 可选值为 mini small large 或者不设
className = classNames((_classNames = {
'mk-nodata': true
}, _defineProperty(_classNames, className, !!className), _defineProperty(_classNames, 'small', !!small), _defineProperty(_classNames, size, !!size), _classNames));
style = style || {};
if (width) {
//style.flex = `0 0 ${width}px`
style.width = "".concat(width, "px");
}
if (height) {
//style.flex = `0 0 ${height}px`
style.height = "".concat(height, "px");
}
if (type) {
img = type;
}
return /*#__PURE__*/React__default.createElement("div", {
className: className,
style: style
}, /*#__PURE__*/React__default.createElement("img", {
className: "mk-nodata-img",
style: imgStyle,
src: pngs[img]
}), /*#__PURE__*/React__default.createElement("span", {
className: "mk-nodata-message",
style: spanStyle
}, children));
}
export { NoDataComponent as default };