Icon 样式合并

This commit is contained in:
jonyshi 2019-04-25 14:09:52 +08:00
commit 3bc7da8eb7
30 changed files with 21414 additions and 66170 deletions

View File

@ -131,6 +131,8 @@
border-bottom: 1px solid rgb(193, 199, 208); border-bottom: 1px solid rgb(193, 199, 208);
text-align: center; text-align: center;
position: relative; } position: relative; }
.u-table-placeholder .table-nodata {
font-size: 48px; }
.u-table-expand-icon-col { .u-table-expand-icon-col {
width: 10px; } width: 10px; }
.u-table-row .u-table tr, .u-table-expanded-row .u-table tr { .u-table-row .u-table tr, .u-table-expanded-row .u-table tr {
@ -320,7 +322,7 @@
width: 30px; width: 30px;
height: 38px; height: 38px;
line-height: 38px; line-height: 38px;
right: 12px; right: 0px;
top: 1px; top: 1px;
z-index: 2; z-index: 2;
background: rgb(241, 242, 245); background: rgb(241, 242, 245);
@ -335,7 +337,7 @@
cursor: pointer; } cursor: pointer; }
.u-table-filter-column-pop-cont-item .u-checkbox { .u-table-filter-column-pop-cont-item .u-checkbox {
margin: 0px; } margin: 0px; }
.u-table-filter-column-pop-cont-item > span { .u-table-filter-column-pop-cont-item span.drop-menu-title {
margin-left: -3px; margin-left: -3px;
max-width: 132px; max-width: 132px;
width: auto !important; width: auto !important;
@ -365,6 +367,22 @@
padding-left: 12px; } padding-left: 12px; }
.u-table.has-fixed-left .u-table-scroll tr td:first-child, .u-table.has-fixed-left .u-table-scroll tr th:first-child { .u-table.has-fixed-left .u-table-scroll tr td:first-child, .u-table.has-fixed-left .u-table-scroll tr th:first-child {
padding-left: 8px; } padding-left: 8px; }
.u-table ::-webkit-scrollbar {
width: 8px;
height: 8px; }
.u-table ::-webkit-scrollbar-button {
display: none; }
.u-table ::-webkit-scrollbar-thumb {
background: #d5d5d5 !important;
border-radius: 5px; }
.u-table ::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: #d5d5d5;
position: absolute; }
.u-table ::-webkit-scrollbar-track {
display: none; }
.u-table ::-webkit-scrollbar-track-piece {
display: none; }
.u-table:focus { .u-table:focus {
outline: none; outline: none;
@ -577,28 +595,6 @@
position: absolute; position: absolute;
left: 100; } left: 100; }
::-webkit-scrollbar {
width: 8px;
height: 8px; }
::-webkit-scrollbar-button {
display: none; }
::-webkit-scrollbar-thumb {
background: #d5d5d5 !important;
border-radius: 5px; }
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: #d5d5d5;
position: absolute; }
::-webkit-scrollbar-track {
display: none; }
::-webkit-scrollbar-track-piece {
display: none; }
.header-dispaly-in-row.u-table table { .header-dispaly-in-row.u-table table {
table-layout: fixed; } table-layout: fixed; }

View File

@ -48,6 +48,10 @@ var _beeLoading = require('bee-loading');
var _beeLoading2 = _interopRequireDefault(_beeLoading); var _beeLoading2 = _interopRequireDefault(_beeLoading);
var _beeIcon = require('bee-icon');
var _beeIcon2 = _interopRequireDefault(_beeIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; } function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
@ -137,7 +141,7 @@ var defaultProps = {
return body; return body;
}, },
emptyText: function emptyText() { emptyText: function emptyText() {
return 'No Data'; return _react2["default"].createElement(_beeIcon2["default"], { type: 'uf-nodata', className: 'table-nodata' });
}, },
columns: [], columns: [],
minColumnWidth: 80, minColumnWidth: 80,

View File

@ -239,11 +239,7 @@ function filterColumn(Table, Popover) {
_react2["default"].createElement( _react2["default"].createElement(
_beeCheckbox2["default"], _beeCheckbox2["default"],
paramObj, paramObj,
_react2["default"].createElement( da.title
"span",
null,
da.title
)
) )
); );
}); });

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
@ -20,29 +20,29 @@ exports.ObjectAssign = ObjectAssign;
*/ */
function sortBy(arr, prop, desc) { function sortBy(arr, prop, desc) {
var props = [], var props = [],
ret = [], ret = [],
i = 0, i = 0,
len = arr.length; len = arr.length;
if (typeof prop == 'string') { if (typeof prop == 'string') {
for (; i < len; i++) { for (; i < len; i++) {
var oI = arr[i]; var oI = arr[i];
(props[i] = new String(oI && oI[prop] || ''))._obj = oI; (props[i] = new String(oI && oI[prop] || ''))._obj = oI;
}
} else if (typeof prop == 'function') {
for (; i < len; i++) {
var _oI = arr[i];
(props[i] = new String(_oI && prop(_oI) || ''))._obj = _oI;
}
} else {
throw '参数类型错误';
} }
props.sort(); } else if (typeof prop == 'function') {
for (i = 0; i < len; i++) { for (; i < len; i++) {
ret[i] = props[i]._obj; var _oI = arr[i];
(props[i] = new String(_oI && prop(_oI) || ''))._obj = _oI;
} }
if (desc) ret.reverse(); } else {
return ret; throw '参数类型错误';
}
props.sort();
for (i = 0; i < len; i++) {
ret[i] = props[i]._obj;
}
if (desc) ret.reverse();
return ret;
}; };
/** /**
@ -51,11 +51,11 @@ function sortBy(arr, prop, desc) {
* @param {} property * @param {} property
*/ */
function compare(property) { function compare(property) {
return function (a, b) { return function (a, b) {
var value1 = a[property]; var value1 = a[property];
var value2 = b[property]; var value2 = b[property];
return value1 - value2; return value1 - value2;
}; };
} }
/** /**
@ -63,17 +63,17 @@ function compare(property) {
* @param {*} obj 要拷贝的对象 * @param {*} obj 要拷贝的对象
*/ */
function ObjectAssign(obj) { function ObjectAssign(obj) {
var b = obj instanceof Array; var b = obj instanceof Array;
var tagObj = b ? [] : {}; var tagObj = b ? [] : {};
if (b) { if (b) {
//数组 //数组
obj.forEach(function (da) { obj.forEach(function (da) {
var _da = {}; var _da = {};
_extends(_da, da); _extends(_da, da);
tagObj.push(_da); tagObj.push(_da);
}); });
} else { } else {
_extends(tagObj, obj); _extends(tagObj, obj);
} }
return tagObj; return tagObj;
} }

View File

@ -44,9 +44,13 @@ var scrollbarMeasure = {
function measureScrollbar() { function measureScrollbar() {
var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'vertical'; var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'vertical';
if (typeof document === 'undefined' || typeof window === 'undefined') { if (typeof document === 'undefined' || typeof window === 'undefined') {
return 0; return 0;
} }
var tableDom = document.querySelector('.u-table');
var currentDom = tableDom ? tableDom : document.body;
if (scrollbarSize) { if (scrollbarSize) {
return scrollbarSize; return scrollbarSize;
} }
@ -54,7 +58,7 @@ function measureScrollbar() {
Object.keys(scrollbarMeasure).forEach(function (scrollProp) { Object.keys(scrollbarMeasure).forEach(function (scrollProp) {
scrollDiv.style[scrollProp] = scrollbarMeasure[scrollProp]; scrollDiv.style[scrollProp] = scrollbarMeasure[scrollProp];
}); });
document.body.appendChild(scrollDiv); currentDom.appendChild(scrollDiv);
var size = 0; var size = 0;
if (direction === 'vertical') { if (direction === 'vertical') {
size = scrollDiv.offsetWidth - scrollDiv.clientWidth; size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
@ -62,7 +66,7 @@ function measureScrollbar() {
size = scrollDiv.offsetHeight - scrollDiv.clientHeight; size = scrollDiv.offsetHeight - scrollDiv.clientHeight;
} }
document.body.removeChild(scrollDiv); currentDom.removeChild(scrollDiv);
scrollbarSize = size; scrollbarSize = size;
return scrollbarSize; return scrollbarSize;
} }

View File

@ -8,14 +8,13 @@
// @import "../node_modules/bee-pagination/src/Pagination.scss"; // @import "../node_modules/bee-pagination/src/Pagination.scss";
// @import "../node_modules/bee-checkbox/src/Checkbox.scss"; // @import "../node_modules/bee-checkbox/src/Checkbox.scss";
// @import "../node_modules/bee-select/src/Select.scss"; // @import "../node_modules/bee-select/src/Select.scss";
// @import "../node_modules/bee-form/src/Form.scss";
// @import "../node_modules/bee-popover/src/Popover.scss"; // @import "../node_modules/bee-popover/src/Popover.scss";
// @import "../node_modules/bee-tooltip/src/Tooltip.scss"; // @import "../node_modules/bee-tooltip/src/Tooltip.scss";
// @import "../node_modules/bee-message/build/Message.css"; // @import "../node_modules/bee-message/build/Message.css";
// @import "../node_modules/bee-dropdown/build/Dropdown.css"; // @import "../node_modules/bee-dropdown/build/Dropdown.css";
// @import "../node_modules/bee-input-number/build/InputNumber.css"; // @import "../node_modules/bee-input-number/build/InputNumber.css";
// @import "../node_modules/bee-modal/build/Modal.css"; // @import "../node_modules/bee-modal/build/Modal.css";
@import "../src/Table.scss"; // @import "../src/Table.scss";
//引入日期控件样式文件 //引入日期控件样式文件

View File

@ -2,7 +2,7 @@
* *
* @title 横向滚动条 * @title 横向滚动条
* @parent 滚动 Scroll View * @parent 滚动 Scroll View
* @description 设置`scroll`属性支持横向或纵向滚动x/y的取值可以是正整数百分比布尔值 * @description 设置`scroll`属性支持横向或纵向滚动x的取值可以是正整数(自动转为相应的像素值)百分比相对于表格真实宽度的百分比大于100%时会出现滚动条布尔值y的取值是正整数
* demo0201 * demo0201
*/ */

View File

@ -7,13 +7,13 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import {Button,Checkbox} from "tinper-bee"; import {Checkbox} from "tinper-bee";
import Table from "../../src"; import Table from "../../src";
import sum from "../../src/lib/sum.js"; import sum from "../../src/lib/sum.js";
import multiSelect from "../../src/lib/multiSelect.js"; import multiSelect from "../../src/lib/multiSelect.js";
let ComplexTable = multiSelect(sum(Table), Checkbox); let ComplexTable = multiSelect(sum(Table), Checkbox);
let _sum = 0;
const columns = [ const columns = [
{ {
title: "单据编号", title: "单据编号",
@ -81,6 +81,8 @@ function getData(){
total: i + Math.floor(Math.random()*10), total: i + Math.floor(Math.random()*10),
money: 20 * Math.floor(Math.random()*10) money: 20 * Math.floor(Math.random()*10)
}); });
_sum += data[i].total;
_sum += data[i].money;
} }
return data; return data;
} }
@ -90,32 +92,20 @@ class Demo35 extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
data: getData() data: getData(),
sum:_sum
}; };
} }
changeData = ()=>{
this.setState({
data: getData()
});
}
render() { render() {
const {data} = this.state; const {data} = this.state;
return ( return (
<div> <div>
<Button
className="editable-add-btn"
onClick={this.changeData}
>
动态设置数据源
</Button>
<ComplexTable <ComplexTable
columns={columns} columns={columns}
data={data} data={data}
bordered bordered
// scroll={{ x: "130%", y: 140 }} footer={currentData => <div>总计: {_sum}</div>}
/> />
</div> </div>
); );

View File

@ -1,307 +0,0 @@
/**
*
* @title 编辑态表格
* @parent 编辑 Editor
* @description 这是带有多种不同格式的编辑态表格编辑态是通过使用不同的render来达到不同编辑格式
* demo0501
*/
import React from "react";
import {Animate,Tooltip,FormControl,Button,Form,Icon,Checkbox,Select} from "tinper-bee";
import Table from "../../src";
import Datepicker from "bee-datepicker";
import renderInput from "../../build/render/InputRender.js";
import renderDate from "../../build/render/DateRender.js";
import renderSelect from "../../build/render/SelectRender.js";
const InputRender = renderInput(Form, FormControl, Icon);
const DateRender = renderDate(Datepicker, Icon);
const SelectRender = renderSelect(Select, Icon);
const format = "YYYY-MM-DD";
const format2 = "YYYY-MM";
const format3 = "YYYY-MM-DD HH:mm:ss";
const dateInputPlaceholder = "选择日期";
const dateInputPlaceholder2 = "选择年月";
const dataSource = [
{
key: "boyuzhou",
value: "jack"
},
{
key: "renhualiu",
value: "lucy"
},
{
key: "yuzhao",
value: "yiminghe"
}
];
class Demo41 extends React.Component {
constructor(props) {
super(props);
this.state = {
dataSource: [
{
key: "0",
name: "沉鱼",
number: "10",
age: "y",
address: "jack",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
},
{
key: "1",
name: "落雁",
number: "100",
age: "y",
address: "lucy",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
},
{
key: "2",
name: "闭月",
number: "1000",
age: "n",
address: "lucy",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
},
{
key: "3",
name: "羞花",
number: "9999",
age: "y",
address: "lucy",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
}
],
count: 4
};
this.columns = [
{
title: "普通输入",
dataIndex: "name",
key: "name",
width: "150px",
render: (text, record, index) => (
<InputRender
name="name"
placeholder="请输入姓名"
value={text}
isclickTrigger={true}
check={this.check}
onChange={this.onInputChange(index, "name")}
isRequire={true}
method="blur"
errorMessage={
<Tooltip overlay={"错误提示"}>
<Icon type="uf-exc-c" className="" />
</Tooltip>
}
/>
)
},
{
title: "货币输入",
dataIndex: "number",
key: "number",
width: "150px",
render: (text, record, index) => (
<InputRender
format="Currency"
name="number"
placeholder="请输入货币"
value={text}
isclickTrigger={true}
check={this.check}
onChange={this.onInputChange(index, "number")}
isRequire={true}
method="blur"
errorMessage={
<Tooltip overlay={"错误提示"}>
<Icon type="uf-exc-c" className="" />
</Tooltip>
}
reg={/^[0-9]+$/}
/>
)
},
{
title: "复选",
dataIndex: "age",
key: "age",
width: "100px",
render: (text, record, index) => (
<Checkbox
checked={record.age}
onChange={this.onCheckChange(index, "age")}
/>
)
},
{
title: "下拉框",
dataIndex: "address",
key: "address",
width: "200px",
render: (text, record, index) => {
return (
<SelectRender
dataSource={dataSource}
isclickTrigger={true}
value={text}
onChange={this.onSelectChange(index, "address")}
size="sm"
>
<Option value="jack">boyuzhou</Option>
<Option value="lucy">renhualiu</Option>
<Option value="disabled" disabled>
Disabled
</Option>
<Option value="yiminghe">yuzhao</Option>
</SelectRender>
);
}
},
{
title: "年月日",
dataIndex: "datepicker",
key: "datepicker",
width: "200px",
render: (text, record, index) => {
return (
<DateRender
value={text}
isclickTrigger={true}
format={format}
onSelect={this.onDateSelect}
onChange={this.onDateChange}
placeholder={dateInputPlaceholder}
/>
);
}
},
{
title: "年月",
dataIndex: "MonthPicker",
key: "MonthPicker",
width: "200px",
render: (text, record, index) => {
return (
<DateRender
value={text}
type="MonthPicker"
isclickTrigger={true}
format={format2}
onSelect={this.onSelect}
onChange={this.onChange}
placeholder={dateInputPlaceholder2}
/>
);
}
}
];
}
check = (flag, obj) => {
console.log(flag);
console.log(obj);
};
onInputChange = (index, key) => {
return value => {
const dataSource = [...this.state.dataSource];
dataSource[index][key] = value;
this.setState({ dataSource });
};
};
onCheckChange = (index, key) => {
return value => {
const dataSource = [...this.state.dataSource];
dataSource[index][key] = value;
this.setState({ dataSource });
};
};
onSelectChange = (index, key) => {
return value => {
console.log(`selected ${value}`);
const dataSource = [...this.state.dataSource];
dataSource[index][key] = value;
this.setState({ dataSource });
};
};
onDateChange = d => {
console.log(d);
};
onDateSelect = d => {
console.log(d);
};
onDelete = index => {
return () => {
const dataSource = [...this.state.dataSource];
dataSource.splice(index, 1);
this.setState({ dataSource });
};
};
handleAdd = () => {
const { count, dataSource } = this.state;
const newData = {
key: count,
name: `凤姐 ${count}`,
age: 32,
address: "jack",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
};
this.setState({
dataSource: [...dataSource, newData],
count: count + 1
});
};
getBodyWrapper = body => {
return (
<Animate
transitionName="move"
component="tbody"
className={body.props.className}
>
{body.props.children}
</Animate>
);
};
getData = () => {
console.log(this.state.dataSource);
};
render() {
const { dataSource } = this.state;
const columns = this.columns;
return (
<div>
<Button
className="editable-add-btn"
onClick={this.handleAdd}
>
添加一行
</Button>
<Button
style={{marginLeft:"5px"}}
className="editable-add-btn"
onClick={this.getData}
>
获取数据
</Button>
<Table
data={dataSource}
columns={columns}
getBodyWrapper={this.getBodyWrapper}
/>
</div>
);
}
}
export default Demo41;

View File

@ -1,13 +1,15 @@
/** /**
* *
* @title 单元格编辑 * @title 单元格编辑
* @description 可以对单元格进行编辑的表格示例中给出输入框+必填校验下拉框编辑模式以及输入模式的必填校验 * @parent 编辑 Editor
* @description 可以对单元格进行编辑的表格示例中给出输入框下拉框参照的编辑模式以及两类校验通过对 coloums 配置 render 属性实现渲染不同格式的编辑态单元格
* demo0502 * demo0502
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import Table from "../../src"; import Table from "../../src";
import { Icon, Select, Tooltip } from "tinper-bee"; import { Icon, Select, Tooltip, Form } from "tinper-bee";
const Option = Select.Option; const Option = Select.Option;
import { RefTreeWithInput } from "ref-tree";
class StringEditCell extends Component { class StringEditCell extends Component {
constructor(props, context) { constructor(props, context) {
@ -47,7 +49,7 @@ class StringEditCell extends Component {
{editable ? ( {editable ? (
<div className="editable-cell-input-wrapper"> <div className="editable-cell-input-wrapper">
<input <input
className="u-form-control" className={value ? "u-form-control" : "u-form-control error"}
autoFocus autoFocus
defaultValue={this.props.value} defaultValue={this.props.value}
value={value} value={value}
@ -58,7 +60,7 @@ class StringEditCell extends Component {
{value === "" ? ( {value === "" ? (
<Tooltip <Tooltip
inverse inverse
className="tp-501" className="tp-0502"
placement="bottom" placement="bottom"
overlay={ overlay={
<div className="help-tip"> <div className="help-tip">
@ -80,7 +82,7 @@ class StringEditCell extends Component {
} }
} }
const SELECT_SOURCE = ["xx供应商", "yy供应商", "zz供应商", "aa供应商", "bb供应商"]; const SELECT_SOURCE = ["男", "女"];
class SelectEditCell extends Component { class SelectEditCell extends Component {
constructor(props, context) { constructor(props, context) {
@ -91,9 +93,9 @@ class SelectEditCell extends Component {
}; };
} }
handleSelect = (value) => { handleSelect = value => {
this.setState({ value }); this.setState({ value });
} };
commitChange = () => { commitChange = () => {
this.setState({ editable: false }); this.setState({ editable: false });
@ -136,45 +138,340 @@ class SelectEditCell extends Component {
} }
} }
const option = {
title: "树",
searchable: true,
multiple: false,
param: {
refCode: "neworganizition_tree"
},
checkStrictly: true,
disabled: false,
nodeDisplay: record => {
return record.refname;
},
displayField: record => {
return record.refname;
}, //显示内容的键
valueField: "refpk", //真实 value 的键
refModelUrl: {
treeUrl: "https://mock.yonyoucloud.com/mock/358/blobRefTree",
treeUrl: "/pap_basedoc/common-ref/blobRefTree"
},
matchUrl: "/pap_basedoc/common-ref/matchPKRefJSON",
filterUrl: "/pap_basedoc/common-ref/filterRefJSON",
lazyModal: false,
strictMode: true,
lang: "zh_CN",
treeData: [
{
code: "org1",
children: [
{
code: "bj",
entityType: "mainEntity",
name: "北京总部-简",
pid: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
refcode: "bj",
refpk: "5305416e-e7b4-4051-90bd-12d12942295b",
id: "5305416e-e7b4-4051-90bd-12d12942295b",
isLeaf: "true",
refname: "北京总部-简"
},
{
code: "xd",
entityType: "mainEntity",
name: "新道-简",
pid: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
refcode: "xd",
refpk: "b691afff-ea83-4a3f-affa-beb2be9cba52",
id: "b691afff-ea83-4a3f-affa-beb2be9cba52",
isLeaf: "true",
refname: "新道-简"
},
{
code: "yy3",
entityType: "mainEntity",
name: "test3",
pid: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
refcode: "yy3",
refpk: "e75694d9-7c00-4e9e-9573-d29465ae79a9",
id: "e75694d9-7c00-4e9e-9573-d29465ae79a9",
isLeaf: "true",
refname: "test3"
},
{
code: "yy1",
entityType: "mainEntity",
name: "test1",
pid: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
refcode: "yy1",
refpk: "fd32ceeb-57a8-4f44-816e-fa660f5715ab",
id: "fd32ceeb-57a8-4f44-816e-fa660f5715ab",
isLeaf: "true",
refname: "test1"
},
{
code: "dept2",
children: [
{
code: "cs",
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "测试部-简",
pid: "0ebbb6d8-250a-4d1d-a019-7ae951629a2c",
refcode: "cs",
refpk: "cc43a66a-438d-4106-937f-bec44406f771",
id: "cc43a66a-438d-4106-937f-bec44406f771",
isLeaf: "true",
refname: "测试部-简"
},
{
code: "qd",
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "前端部-简",
pid: "0ebbb6d8-250a-4d1d-a019-7ae951629a2c",
refcode: "qd",
refpk: "73a10edd-aae8-4f31-af25-1f48f0a3b344",
id: "73a10edd-aae8-4f31-af25-1f48f0a3b344",
isLeaf: "true",
refname: "前端部-简"
}
],
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "生产处",
refcode: "dept2",
refpk: "0ebbb6d8-250a-4d1d-a019-7ae951629a2c",
id: "0ebbb6d8-250a-4d1d-a019-7ae951629a2c",
refname: "生产处"
},
{
code: "dept1",
children: [
{
code: "dept1_2",
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "财务二科",
pid: "95b60f35-ed0b-454e-b948-fb45ae30b911",
refcode: "dept1_2",
refpk: "55b7fff1-6579-4ca9-92b7-3271d288b9f3",
id: "55b7fff1-6579-4ca9-92b7-3271d288b9f3",
isLeaf: "true",
refname: "财务二科"
},
{
code: "dept1_1",
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "财务一科",
pid: "95b60f35-ed0b-454e-b948-fb45ae30b911",
refcode: "dept1_1",
refpk: "9711d912-3184-4063-90c5-1facc727813c",
id: "9711d912-3184-4063-90c5-1facc727813c",
isLeaf: "true",
refname: "财务一科"
}
],
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "财务处",
refcode: "dept1",
refpk: "95b60f35-ed0b-454e-b948-fb45ae30b911",
id: "95b60f35-ed0b-454e-b948-fb45ae30b911",
refname: "财务处"
}
],
entityType: "mainEntity",
name: "用友集团",
refcode: "org1",
refpk: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
refname: "用友集团"
}
]
};
const RefEditCell = Form.createForm()(
class RefComponentWarpper extends Component {
constructor(props, context) {
super(props, context);
this.state = {
value: this.props.value.d,
editable: false
};
this.refWarp = React.createRef();
}
edit = () => {
this.setState({ editable: true }, () => this.refWarp.focus());
};
handleSelect = values => {
this.setState({ value: values[0] });
};
commitChange = () => {
this.setState({ editable: false });
if (this.props.onChange) {
this.props.onChange(this.state.value);
}
};
onRefBlur = e => {
// 消除点击子组件,父组件先失焦再聚焦的事件触发过程带来的副作用
const __REF_CONTENT__ = document.querySelector("div.ref-core-modal");
if (!__REF_CONTENT__ && e.target === this.refWarp) {
this.commitChange();
}
};
render() {
const { getFieldProps, getFieldError } = this.props.form;
const { value, editable } = this.state;
return editable ? (
<div
ref={el => (this.refWarp = el)}
className="editable-cell-input-wrapper"
tabIndex={-1}
onBlur={this.onRefBlur}
>
<RefTreeWithInput
{...option}
onSave={this.handleSelect}
getRefTreeData={this.getRefTreeData}
{...getFieldProps("code1", {
initialValue: JSON.stringify(value),
rules: [
{
message: "请输入请选择",
pattern: /[^{"refname":"","refpk":""}|{"refpk":"","refname":""}]/
}
]
})}
/>
<span
className="error"
style={{ display: "block", color: "#f53c32" }}
>
{getFieldError("code1")}
</span>
</div>
) : (
<div className="editable-cell-text-wrapper" onClick={this.edit}>
{value.name || " "}
</div>
);
}
}
);
const dataSource = [ const dataSource = [
{ name: "NU03910001", quality: "xx供应商", level: 70, key: "1" }, {
{ name: "NU03910002", quality: "yy供应商", level: 75, key: "2" }, a: "ASVAL_201903280005",
{ name: "NU03910003", quality: "zz供应商", level: 50, key: "3" }, b: "小张",
{ name: "NU03910004", quality: "aa供应商", level: 70, key: "4" }, c: "男",
{ name: "NU03910005", quality: "bb供应商", level: 60, key: "5" } d: {
code: "dept1_2",
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "财务二科",
pid: "95b60f35-ed0b-454e-b948-fb45ae30b911",
refcode: "dept1_2",
refpk: "55b7fff1-6579-4ca9-92b7-3271d288b9f3",
id: "55b7fff1-6579-4ca9-92b7-3271d288b9f3",
isLeaf: "true",
refname: "财务二科"
},
key: "1"
},
{
a: "ASVAL_201903200004",
b: "小明",
c: "男",
d: {
code: "dept1_2",
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "财务二科",
pid: "95b60f35-ed0b-454e-b948-fb45ae30b911",
refcode: "dept1_2",
refpk: "55b7fff1-6579-4ca9-92b7-3271d288b9f3",
id: "55b7fff1-6579-4ca9-92b7-3271d288b9f3",
isLeaf: "true",
refname: "财务二科"
},
key: "2"
},
{
a: "ASVAL_201903120002",
b: "小红",
c: "女",
d: {
code: "dept1_1",
entityType: "subEntity",
organization_id: "a4cf0601-51e6-4012-9967-b7a64a4b2d47",
name: "财务一科",
pid: "95b60f35-ed0b-454e-b948-fb45ae30b911",
refcode: "dept1_1",
refpk: "9711d912-3184-4063-90c5-1facc727813c",
id: "9711d912-3184-4063-90c5-1facc727813c",
isLeaf: "true",
refname: "财务一科"
},
key: "3"
}
]; ];
class Demo501 extends Component { class Demo0502 extends Component {
constructor(props, context) { constructor(props, context) {
super(props); super(props);
this.columns = [ this.columns = [
{ {
title: "订单编号", title: "员工编号",
dataIndex: "name", dataIndex: "a",
key: "name", key: "a"
},
{
title: "名字",
dataIndex: "b",
key: "b",
render: (text, record, index) => ( render: (text, record, index) => (
<StringEditCell <StringEditCell
colName="名字"
value={text} value={text}
colName={"订单编号"} onChange={this.onCellChange(index, "b")}
onChange={this.onCellChange(index, "name")}
/> />
) )
}, },
{ {
title: "供应商名称", title: "性别",
dataIndex: "quality", dataIndex: "c",
key: "quality", key: "c",
width: 100,
render: (text, record, index) => ( render: (text, record, index) => (
<SelectEditCell <SelectEditCell
value={text} value={text}
onChange={this.onCellChange(index, "quality")} onChange={this.onCellChange(index, "c")}
/> />
) )
}, },
{ {
title: "采购数量", title: "部门",
dataIndex: "level", dataIndex: "d",
key: "level" key: "d",
width: 215,
render: (text, record, index) => (
<RefEditCell
value={record}
onChange={this.onCellChange(index, "d")}
/>
)
},
{
key: "placeholder"
} }
]; ];
@ -193,11 +490,11 @@ class Demo501 extends Component {
render() { render() {
return ( return (
<div className="demo501"> <div className="demo0502">
<Table data={this.state.dataSource} columns={this.columns} /> <Table data={this.state.dataSource} columns={this.columns} />
</div> </div>
); );
} }
} }
export default Demo501; export default Demo0502;

View File

@ -1,14 +1,42 @@
.demo501 { .demo0502 {
.u-table-row {
td {
padding: 5px 8px;
input.error {
border-color: #F44336;
}
}
.editable-cell {
height: 30px;
}
&-hover {
.editable-cell-text-wrapper {
line-height: 18px;
border: 1px solid #c1c7d0;
}
}
.u-form-control,
.u-select-selection {
height: 30px;
}
}
.editable-cell-text-wrapper { .editable-cell-text-wrapper {
box-sizing: border-box;
line-height: 20px;
border-radius: 3px;
&:hover { &:hover {
border: 1px dashed #A5ADBA; line-height: 18px;
border: 1px solid #a5adba;
} }
} }
.require { .require {
position: absolute; position: absolute;
top: 2px; top: 2px;
color: red; color: #F44336;
font-size: 20px; font-size: 20px;
} }
} }
@ -17,7 +45,7 @@
color: #F44336; color: #F44336;
} }
.tp-501 { .tp-0502 {
.tooltip-arrow { .tooltip-arrow {
border-bottom-color: #F44336 !important; border-bottom-color: #F44336 !important;
} }

View File

@ -13,28 +13,26 @@ import dragColumn from '../../src/lib/dragColumn';
const columns23 = [ const columns23 = [
{ {
title: "名字", title: "订单编号",
dataIndex: "a", dataIndex: "a",
key: "a", key: "a",
width: '200', width: '200',
fixed:'left' fixed:'left'
}, },
{ {
title: "性别", title: "单据日期",
dataIndex: "b", dataIndex: "b",
key: "b", key: "b",
width: '600' width: '600'
}, },
{ {
title: "年龄", title: "供应商",
dataIndex: "c", dataIndex: "c",
key: "c", key: "c",
width: '200', width: '200',
sumCol: true,
sorter: (a, b) => a.c - b.c
}, },
{ {
title: "武功级别", title: "联系人",
dataIndex: "d", dataIndex: "d",
key: "d", key: "d",
width: 500, width: 500,
@ -42,13 +40,9 @@ const columns23 = [
]; ];
const data23 = [ const data23 = [
{ a: "杨过", b: "男", c: 30,d:'内行', key: "2" }, { a: "NU0391001", b: "2019-03-01", c: "xx供应商",d:'Tom', key: "2" },
{ a: "令狐冲", b: "男", c: 41,d:'大侠', key: "1" }, { a: "NU0391002", b: "2018-11-02", c: "yy供应商",d:'Jack', key: "1" },
{ a: "郭靖", b: "男", c: 25,d:'大侠', key: "31" } , { a: "杨过", b: "男", c: 30,d:'内行', key: "21" }, { a: "NU0391003", b: "2019-05-03", c: "zz供应商",d:'Jane', key: "3" }
{ a: "令狐冲", b: "男", c: 41,d:'大侠', key: "11" },
{ a: "郭靖", b: "男", c: 25,d:'大侠', key: "32" } , { a: "杨过", b: "男", c: 30,d:'内行', key: "22" },
{ a: "令狐冲", b: "男", c: 41,d:'大侠', key: "12" },
{ a: "郭靖", b: "男", c: 25,d:'大侠', key: "3" }
]; ];
const DragColumnTable = dragColumn(Table); const DragColumnTable = dragColumn(Table);

View File

@ -27,9 +27,9 @@ const columns16 = [
); );
} }
}, },
{ title: "用户名", dataIndex: "a", key: "a", width: 250 }, { title: "订单编号", dataIndex: "a", key: "a", width: 250 },
{ id: "123", title: "性别", dataIndex: "b", key: "b", width: 100 }, { id: "123", title: "单据日期", dataIndex: "b", key: "b", width: 100 },
{ title: "年龄", dataIndex: "c", key: "c", width: 200 }, { title: "供应商", dataIndex: "c", key: "c", width: 200 },
]; ];
const columns17 = [ const columns17 = [
@ -48,16 +48,16 @@ const columns17 = [
); );
} }
}, },
{ title: "用户名", dataIndex: "a", key: "a", width: 100 }, { title: "订单编号", dataIndex: "a", key: "a", width: 100 },
{ id: "123", title: "性别", dataIndex: "b", key: "b", width: 100 }, { id: "123", title: "单据日期", dataIndex: "b", key: "b", width: 100 },
{ title: "年龄", dataIndex: "c", key: "c", width: 200 }, { title: "供应商", dataIndex: "c", key: "c", width: 200 },
]; ];
const data16 = [ const data16 = [
{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" }, { a: "NU0391001", b: "2019-03-01", c: "xx供应商", d: "操作", key: "1" },
{ a: "杨过", b: "男", c: 67, d: "操作", key: "2" }, { a: "NU0391002", b: "2018-11-02", c: "yy供应商", d: "操作", key: "2" },
{ a: "郭靖", b: "男", c: 25, d: "操作", key: "3" } { a: "NU0391003", b: "2019-05-03", c: "zz供应商", d: "操作", key: "3" }
]; ];
@ -86,15 +86,15 @@ class Demo16 extends Component {
if(expanded){ if(expanded){
if(record.key==='1'){ if(record.key==='1'){
new_obj[record.key] = [ new_obj[record.key] = [
{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" }, { a: "NU0391056", b: "2019-03-01", c: "gys1", d: "操作", key: "1" },
{ a: "杨过", b: "男", c: 67, d: "操作", key: "2" } { a: "NU0391057", b: "2018-11-02", c: "gys2", d: "操作", key: "2" },
] ]
this.setState({ this.setState({
data_obj:new_obj data_obj:new_obj
}) })
}else{ }else{
new_obj[record.key] = [ new_obj[record.key] = [
{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" } { a: "NU0391079", b: "2019-04-17", c: "gys5", d: "操作", key: "3" },
] ]
this.setState({ this.setState({
data_obj:new_obj data_obj:new_obj

View File

@ -13,19 +13,19 @@ import Table from '../../src';
const columns4 = [ const columns4 = [
{ {
title: "Name", title: "订单编号",
dataIndex: "name", dataIndex: "name",
key: "name", key: "name",
width: "40%" width: "40%"
}, },
{ {
title: "Age", title: "单据日期",
dataIndex: "age", dataIndex: "age",
key: "age", key: "age",
width: "30%" width: "30%"
}, },
{ {
title: "Address", title: "供应商",
dataIndex: "address", dataIndex: "address",
key: "address" key: "address"
} }
@ -34,53 +34,53 @@ const columns4 = [
const data4 = [ const data4 = [
{ {
key: 1, key: 1,
name: "John Brown sr.", name: "NU0391001",
age: 60, age: "2019-03-01",
address: "New York No. 1 Lake Park", address: "供应商1",
children: [ children: [
{ {
key: 11, key: 11,
name: "John Brown", name: "NU0391002",
age: 42, age: "2019-03-02",
address: "New York No. 2 Lake Park" address: "供应商2"
}, },
{ {
key: 12, key: 12,
name: "John Brown jr.", name: "NU0391003",
age: 30, age: "2019-03-03",
address: "New York No. 3 Lake Park", address: "供应商3",
children: [ children: [
{ {
key: 121, key: 121,
name: "Jimmy Brown", name: "NU0391004",
age: 16, age: "2019-03-04",
address: "New York No. 3 Lake Park" address: "供应商4"
} }
] ]
}, },
{ {
key: 13, key: 13,
name: "Jim Green sr.", name: "NU0391005",
age: 72, age: "2019-03-05",
address: "London No. 1 Lake Park", address: "供应商5",
children: [ children: [
{ {
key: 131, key: 131,
name: "Jim Green", name: "NU0391006",
age: 42, age: "2019-03-06",
address: "London No. 2 Lake Park", address: "供应商6",
children: [ children: [
{ {
key: 1311, key: 1311,
name: "Jim Green jr.", name: "NU0391007",
age: 25, age: "2019-03-07",
address: "London No. 3 Lake Park" address: "供应商7"
}, },
{ {
key: 1312, key: 1312,
name: "Jimmy Green sr.", name: "NU0391008",
age: 18, age: "2019-03-08",
address: "London No. 4 Lake Park" address: "供应商8"
} }
] ]
} }
@ -90,9 +90,9 @@ const data4 = [
}, },
{ {
key: 2, key: 2,
name: "Joe Black", name: "NU0391009",
age: 32, age: "2019-03-09",
address: "Sidney No. 1 Lake Park" address: "供应商9"
} }
]; ];
class Demo4 extends Component { class Demo4 extends Component {

View File

@ -2,7 +2,7 @@
* *
* @title 图片在表格中的展示 * @title 图片在表格中的展示
* @parent 扩展行 Expanded Row * @parent 扩展行 Expanded Row
* @description 根据图片高度自动撑开行高可结合图片查看器使用 http://design.yonyoucloud.com/tinper-bee/bee-viewer * @description 根据图片高度自动撑开行高可结合图片查看器使用 http://design.yonyoucloud.com/tinper-bee/bee-viewer, 注如果图片在固定列中可以使用heightConsistent属性当此属性为true就不会出现错行问题
* demo1107 * demo1107
*/ */

View File

@ -60,6 +60,7 @@ class Demo8 extends Component {
onSelect={this.handleSelect.bind(this)} onSelect={this.handleSelect.bind(this)}
onDataNumSelect={this.dataNumSelect} onDataNumSelect={this.dataNumSelect}
showJump={true} showJump={true}
noBorder={true}
total={100} total={100}
dataNum={2} dataNum={2}
/> />

View File

@ -1,141 +0,0 @@
/**
*
* @title 表格+搜索
* @parent 搜索 search
* @description 搜索刷新表格数据
* demo1602
*/
import React, { Component } from "react";
import {Icon,FormControl,InputGroup} from "tinper-bee";
import Table from "../../src";
class Search extends Component {
state = {
searchValue: "",
empty: false
};
/**
* 搜索
*/
handleSearch = () => {
let { onSearch } = this.props;
this.setState({
empty: true
});
onSearch && onSearch(this.state.searchValue);
};
/**
* 捕获回车
* @param e
*/
handleKeyDown = e => {
if (e.keyCode === 13) {
this.handleSearch();
}
};
/**
* 输入框改变
* @param e
*/
handleChange = (e) => {
this.setState({
searchValue: e
});
};
/**
* 清空输入框
*/
emptySearch = () => {
let { onEmpty } = this.props;
this.setState({
searchValue: "",
empty: false
});
onEmpty && onEmpty();
};
render() {
return (
<InputGroup simple className="search-component">
<FormControl
onChange={this.handleChange}
value={this.state.searchValue}
onKeyDown={this.handleKeyDown}
placeholder="请输入用户名"
type="text"
/>
{this.state.empty ? (
<Icon
type="uf-close-c"
onClick={this.emptySearch}
className="empty-search"
/>
) : null}
<InputGroup.Button onClick={this.handleSearch} shape="border">
<Icon type="uf-search" />
</InputGroup.Button>
</InputGroup>
);
}
}
const columns = [
{ title: "员工编号", dataIndex: "a", key: "a", width: 300, className: "rowClassName"},
{ title: "员工姓名", dataIndex: "b", key: "b", width: 500 },
{ title: "性别", dataIndex: "c", key: "c", width: 500 },
{ title: "部门", dataIndex: "d", key: "d", width: 200 }
];
const userData = [
{ a: "ASVAL_201903280005", b: "小张", c: "男", d: "财务二科", key: "1" },
{ a: "ASVAL_201903200004", b: "小明", c: "男", d: "财务一科", key: "2" },
{ a: "ASVAL_201903120002", b: "小红", c: "女", d: "财务一科", key: "3" }
];
class Demo9 extends Component {
constructor(props) {
super(props);
this.state = {
data: userData
};
}
handleSearch = value => {
if (value === "") {
return this.setState({
data: userData
});
}
let regExp = new RegExp(value, "ig");
let data = userData.filter(item => regExp.test(item.a));
this.setState({
data
});
};
handleEmpty = () => {
this.setState({
data: userData
});
};
render() {
return (
<div>
<div className="clearfix">
<Search onSearch={this.handleSearch} onEmpty={this.handleEmpty} />
</div>
<Table columns={columns} data={this.state.data} />
</div>
);
}
}
export default Demo9;

File diff suppressed because one or more lines are too long

662
dist/demo.css vendored
View File

@ -1,632 +1,3 @@
/* FormGroup */
/* Navlayout */
.u-table {
font-size: 12px;
color: #212121;
position: relative;
line-height: 1.33;
overflow: hidden; }
.u-table-body {
position: relative; }
.u-table-hiden-drag {
position: relative; }
.u-table-hiden-drag-li {
position: absolute;
top: 0px;
left: 0px; }
.u-table table {
width: 100%;
border-collapse: collapse;
text-align: left; }
.u-table th {
font-weight: bold;
text-align: left;
line-height: 16px; }
.u-table th[colspan] {
text-align: center; }
.u-table th ::last-child {
overflow: hidden; }
.u-table td {
border-bottom: 1px solid rgb(193, 199, 208);
line-height: 1.33; }
.u-table td a {
color: #2196F3; }
.u-table td a:hover {
color: #1565c0; }
.u-table td a:active {
color: #1565c0; }
.u-table thead tr:last-child {
border-bottom: 1px solid #C1C7D0; }
.u-table thead tr > th:last-child {
border-right: none; }
.u-table tr:hover td .uf-eye {
visibility: visible !important; }
.u-table tr tr a {
color: #2196F3; }
.u-table tr tr a:hover {
color: #1565c0; }
.u-table tr tr a:active {
color: #1565c0; }
.u-table tr.tr-row-hover {
background: rgb(235, 236, 240); }
.u-table th,
.u-table td {
padding: 12px 8px;
word-break: break-all; }
.u-table th.text-center,
.u-table td.text-center {
text-align: center; }
.u-table th.text-right,
.u-table td.text-right {
text-align: right; }
.u-table-sm td {
padding: 8px 8px; }
.u-table-lg td {
padding: 16px 8px; }
.u-table tr.filterable th {
padding-top: 5px !important;
padding-bottom: 5px !important; }
.u-table tr.filterable th .filterContext {
height: 35px; }
.u-table tr.filterable th .u-select-selection--single {
height: 26px; }
.u-table-row-hover {
background: rgb(235, 236, 240); }
.u-table-scroll {
overflow: auto; }
.u-table-bordered table {
border: 1px solid rgb(193, 199, 208);
box-sizing: border-box;
table-layout: fixed; }
.u-table-bordered .u-table-header > table {
border-bottom: 0; }
.u-table-bordered .u-table-header ~ .u-table-body table, .u-table-bordered .u-table-header ~ .u-table-body-outer table {
border-top: 0px; }
.u-table-bordered th {
border-bottom: 1px solid rgb(193, 199, 208);
box-sizing: border-box; }
.u-table-bordered th,
.u-table-bordered td {
border-right: 1px solid rgb(193, 199, 208);
box-sizing: border-box; }
.u-table-drag-border tr th.th-can-not-drag {
overflow: hidden; }
.u-table-header {
overflow: hidden;
background: rgb(241, 242, 245);
color: rgb(33, 33, 33); }
.u-table.fixed-height td {
padding: 0px 8px; }
.u-table-fixed-header .u-table-body {
background: #fff;
position: relative; }
.u-table-fixed-left .u-table-body-inner {
margin-right: -20px;
padding-right: 20px; }
.u-table-fixed-header .u-table-fixed-left .u-table-body-inner {
padding-right: 0px; }
.u-table-fixed-header .u-table-body-inner {
height: 100%; }
.u-table-fixed-header .u-table-scroll .u-table-header {
overflow-x: scroll;
padding-bottom: 20px;
margin-bottom: -20px;
overflow-y: scroll;
box-sizing: border-box; }
.u-table-title {
padding: 12px 8px;
border-top: 1px solid rgb(193, 199, 208); }
.u-table-content {
position: relative; }
.u-table-footer {
padding: 12px 8px;
border-bottom: 1px solid rgb(193, 199, 208); }
.u-table-footer .u-table-scroll {
overflow-x: hidden; }
.u-table-footer .u-table {
margin: -12px -8px; }
.u-table-placeholder {
padding: 12px 8px;
background: #fff;
border-bottom: 1px solid rgb(193, 199, 208);
text-align: center;
position: relative; }
.u-table-placeholder .table-nodata {
font-size: 48px; }
.u-table-expand-icon-col {
width: 10px; }
.u-table-row .u-table tr, .u-table-expanded-row .u-table tr {
background: #fff; }
.u-table-row .u-table tr.u-table-row-hover, .u-table-expanded-row .u-table tr.u-table-row-hover {
background: rgb(235, 236, 240); }
.u-table-row-expand-icon, .u-table-expanded-row-expand-icon {
cursor: pointer;
display: inline-block;
margin-right: 0px;
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
border: 1px solid rgb(193, 199, 208);
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background: #fff;
margin-right: 10px; }
.u-table-row-spaced, .u-table-expanded-row-spaced {
visibility: hidden; }
.u-table-row-spaced:after, .u-table-expanded-row-spaced:after {
content: "."; }
.u-table-row-expanded:after, .u-table-expanded-row-expanded:after {
content: "-"; }
.u-table-row-collapsed:after, .u-table-expanded-row-collapsed:after {
content: "+"; }
.u-table-row.selected {
background: #FFF7E7; }
.u-table tr.u-table-expanded-row {
background: #f7f7f7; }
.u-table tr.u-table-expanded-row:hover {
background: #f7f7f7; }
.u-table tr.u-table-expanded-row .u-table {
z-index: 1; }
.u-table-column-hidden {
display: none; }
.u-table-prev-columns-page, .u-table-next-columns-page {
cursor: pointer;
color: #666;
z-index: 1; }
.u-table-prev-columns-page:hover, .u-table-next-columns-page:hover {
color: #2db7f5; }
.u-table-prev-columns-page-disabled, .u-table-next-columns-page-disabled {
cursor: not-allowed;
color: #999; }
.u-table-prev-columns-page-disabled:hover, .u-table-next-columns-page-disabled:hover {
color: #999; }
.u-table-prev-columns-page {
margin-right: 8px; }
.u-table-prev-columns-page:before {
content: "<"; }
.u-table-next-columns-page {
float: right; }
.u-table-next-columns-page:before {
content: ">"; }
.u-table-fixed-left, .u-table-fixed-right {
position: absolute;
top: 0;
overflow: hidden;
z-index: 1; }
.u-table-fixed-left table, .u-table-fixed-right table {
width: auto;
background: #fff; }
.u-table-fixed-left {
left: 0;
box-shadow: 4px 0 4px rgba(100, 100, 100, 0.1); }
.u-table-fixed-left-body-inner {
margin-right: -20px;
padding-right: 20px; }
.u-table-fixed-left-fixed-header .u-table-fixed-left .u-table-fixed-left-body-inner {
padding-right: 0; }
.u-table-fixed-right {
right: 0;
box-shadow: -4px 0 4px rgba(100, 100, 100, 0.1); }
.u-table-fixed-right-expanded-row {
color: transparent;
pointer-events: none; }
.u-table-scroll-position-left .u-table-fixed-left {
box-shadow: none; }
.u-table-scroll-position-right .u-table-fixed-right {
box-shadow: none; }
.u-table-thead .filter-text, .u-table-thead .filter-dropdown, .u-table-thead .filter-date {
font-weight: normal; }
.u-table-thead .filter-wrap {
display: -ms-flexbox;
display: flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-align: center;
align-items: center; }
.u-table-thead .filter-wrap .filter-btns {
min-width: 58px; }
.u-table-thead th {
background: rgb(241, 242, 245);
color: rgb(33, 33, 33);
background-clip: padding-box;
-moz-user-select: -moz-none;
-webkit-user-select: none;
/*
Introduced in IE 10.
*/
-ms-user-select: none;
user-select: none; }
.u-table-thead th .bee-table-column-sorter {
position: relative;
margin-left: 4px;
height: 16px;
vertical-align: middle;
text-align: center;
display: inline-block;
margin-top: -3px; }
.u-table-thead th .bee-table-column-sorter i {
padding: 0px;
font-weight: 600;
color: #505F79; }
.u-table-thead th .bee-table-column-sorter > .bee-table-column-sorter-down,
.u-table-thead th .bee-table-column-sorter > .bee-table-column-sorter-up, .u-table-thead th .bee-table-column-sorter > .bee-table-column-sorter-flat {
line-height: 16px;
display: block;
width: 34px;
cursor: pointer; }
.u-table-thead th .bee-table-column-sorter-down.on .uf-triangle-down,
.u-table-thead th .bee-table-column-sorter-down.on .uf-triangle-up,
.u-table-thead th .bee-table-column-sorter-up.on .uf-triangle-down,
.u-table-thead th .bee-table-column-sorter-up.on .uf-triangle-up {
color: #108ee9; }
.u-table-thead th .bee-table-column-sorter .uf-triangle-down,
.u-table-thead th .bee-table-column-sorter .uf-triangle-up {
filter: none;
font-size: 12px; }
.u-table-thead th .bee-table-column-sorter .uf-triangle-down,
.u-table-thead th .bee-table-column-sorter .uf-triangle-up {
display: inline-block;
padding: 0;
font-size: 12px;
font-size: 8px\9;
transform: scale(0.66667) rotate(0deg);
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=1, M12=0, M21=0, M22=1)";
zoom: 1;
line-height: 4px;
height: 4px;
color: #999; }
.u-table-thead th:hover .bee-table-column-sorter {
display: inline-block; }
.u-table-thead .th-drag {
cursor: move; }
.u-table-thead .th-drag:hover {
background: rgb(235, 236, 240); }
.u-table-thead .th-drag-hover {
background: #ccc; }
.u-table-thead-th {
position: relative; }
.u-table-thead-th-drag-gap {
height: 100%;
position: absolute;
right: -10px;
top: 0;
width: 20px;
box-sizing: border-box;
z-index: 1; }
.u-table-thead-th-drag-gap .online {
height: 100%;
width: 1px;
background: transparent;
margin: 0 auto; }
.u-table-thead-th-drag-gap .online-hover {
background: #000000; }
.u-table-thead-th-drag-gap:hover {
cursor: col-resize; }
.u-table-thead-th-drag-gap:hover .online {
background: #000000; }
.u-table-thead-th:last-child-drag-gap {
border: none; }
.u-table-filter-column-pop-cont {
margin: 0px;
max-height: 300px;
overflow-y: scroll;
color: #212121; }
.u-table-filter-column-clear-setting {
cursor: pointer;
margin-bottom: 4px; }
.u-table-filter-column-cont {
position: relative; }
.u-table-filter-column-filter-icon {
position: absolute;
width: 30px;
height: 38px;
line-height: 38px;
right: 12px;
top: 1px;
z-index: 2;
background: rgb(241, 242, 245);
text-align: center;
cursor: pointer; }
.u-table-filter-column-filter-icon i.uf {
padding: 0px;
color: #505F79; }
.u-table-filter-column-pop-cont-item {
margin-top: 8px;
font-size: 12px;
cursor: pointer; }
.u-table-filter-column-pop-cont-item .u-checkbox {
margin: 0px; }
.u-table-filter-column-pop-cont-item > span {
margin-left: -3px;
max-width: 132px;
width: auto !important;
min-width: 56px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
vertical-align: middle; }
.u-table-filter-column-pop .u-modal-dialog {
border: 1px solid #ccc;
background: #fff; }
.u-table-row-fixed-columns-in-body {
display: none;
pointer-events: none; }
.u-table .u-checkbox {
height: 14px;
line-height: 14px;
margin: 0px; }
.u-table .u-checkbox .u-checkbox-label {
line-height: 14px;
padding-left: 16px; }
.u-table .u-checkbox .u-checkbox-label:before, .u-table .u-checkbox .u-checkbox-label:after {
width: 14px;
height: 14px; }
.u-table .u-table-scroll tr td:first-child, .u-table .u-table-scroll tr th:first-child, .u-table .u-table-fixed-left tr td:first-child, .u-table .u-table-fixed-left tr th:first-child {
padding-left: 12px; }
.u-table.has-fixed-left .u-table-scroll tr td:first-child, .u-table.has-fixed-left .u-table-scroll tr th:first-child {
padding-left: 8px; }
.u-table:focus {
outline: none;
box-shadow: 0 0 0; }
.u-table-bordered .u-table-drag-gap {
background: #e9e9e9; }
.u-table.bordered table {
border-collapse: collapse; }
.u-table.bordered th,
.u-table.bordered td {
border: 1px solid rgb(193, 199, 208); }
.move-enter,
.move-appear {
opacity: 0;
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
animation-duration: 2.5s;
animation-fill-mode: both;
animation-play-state: paused; }
.move-leave {
animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
animation-duration: 0.5s;
animation-fill-mode: both;
animation-play-state: paused; }
.move-enter.move-enter-active,
.move-appear.move-enter-active {
animation-name: moveLeftIn;
animation-play-state: running; }
.move-leave.move-leave-active {
animation-name: moveRightOut;
animation-play-state: running; }
@keyframes moveLeftIn {
0% {
transform-origin: 0 0;
transform: translateX(30px);
opacity: 0;
background: rgb(238,238,238); }
20% {
transform-origin: 0 0;
transform: translateX(0);
opacity: 1; }
80% {
background: rgb(238,238,238); }
100% {
background: transparent;
opacity: 1; } }
@keyframes moveRightOut {
0% {
transform-origin: 0 0;
transform: translateX(0);
opacity: 1; }
100% {
transform-origin: 0 0;
transform: translateX(-30px);
opacity: 0; } }
.formItem-style {
height: unset;
min-height: unset;
padding: 0; }
.errMessage-style {
display: none;
border: none;
/* margin-top: 5px; */
/* margin-bottom: 5px; */
background: transparent;
color: #f22c1d;
/* padding-left: 12px; */
/* padding-right: 12px; */
margin: 0;
position: absolute;
padding: 0;
top: 3px;
right: 0; }
.editable-cell {
position: relative; }
.editable-cell-input-wrapper,
.editable-cell-text-wrapper {
padding-right: 24px; }
.editable-cell-input-wrapper .u-form-item.formItem-style .u-label {
display: none; }
.editable-cell-input-wrapper .u-input-group .u-form-control {
height: 26px;
font-size: 12px; }
.editable-cell-text-wrapper {
padding: 5px 24px 5px 5px;
height: 30px; }
.editable-cell-icon,
.editable-cell-icon-check {
position: absolute;
top: 0;
right: 0;
width: 20px;
cursor: pointer; }
.editable-cell-icon {
line-height: 28px;
display: none; }
.editable-cell-icon-check {
line-height: 28px; }
.editable-cell:hover .editable-cell-icon {
display: inline-block; }
.editable-cell-icon:hover,
.editable-cell-icon-check:hover {
color: #2db7f5; }
.editable-add-btn {
margin-bottom: 8px; }
.search-component {
margin-bottom: 20px; }
.search-component .empty-search {
position: absolute;
right: 45px;
z-index: 20;
top: 5px;
color: #524e4e;
cursor: pointer; }
.search-component.u-input-group.simple {
float: right; }
.search-component.u-input-group.simple .u-form-control {
width: 251px;
background: #f5f5f5;
border-color: #f5f5f5;
border-radius: 20px; }
.search-component.u-input-group.simple .u-input-group-btn {
top: 3px;
right: 20px;
position: absolute; }
.col-resize-container {
height: 0px;
position: relative; }
.col-resize-container + .table-col-resizer:first-of-type {
table-layout: fixed; }
.col-resize-container .active-drag .icon {
visibility: visible; }
.col-resize-container .last-handle {
display: none; }
.col-resize-container .drag-handle {
margin-left: -5px;
position: absolute;
z-index: 5;
width: 10px;
cursor: col-resize; }
.col-resize-container .drag-handle .icon {
color: #40b0dc;
top: -1px;
position: absolute;
visibility: hidden; }
.col-resize-container .drag-handle .icon:first-child {
left: -2px; }
.col-resize-container .drag-handle .icon:last-child {
left: 6px; }
.col-resize-container .drag-handle:hover .icon {
visibility: visible; }
.col-resize-container .drag-handle:hover .col-resizer {
border: 1px solid; }
.col-resize-container .drag-handle.disabled-drag {
cursor: default;
display: none; }
.col-resize-container .drag-handle .col-resizer {
position: absolute;
width: 1px;
height: 100%;
top: 0px;
left: 3px; }
.u-filter-dropdown-menu-wrap {
z-index: 1800; }
.u-filter-dropdown-menu-wrap .u-dropdown-menu li.u-dropdown-menu-item {
line-height: 26px;
height: 26px;
padding: 0px 16px 0 16px;
cursor: pointer; }
.filter-wrap .u-form-control {
height: 26px; }
.filter-wrap .u-input-number.u-input-group.simple .u-input-group-btn .icon-group {
height: 26px; }
.u-row-hover {
position: absolute;
right: 24px;
display: none;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: center;
justify-content: center;
background: transparent; }
.u-row-hover2 {
position: absolute;
left: 100; }
::-webkit-scrollbar {
width: 8px;
height: 8px; }
::-webkit-scrollbar-button {
display: none; }
::-webkit-scrollbar-thumb {
background: #d5d5d5 !important;
border-radius: 5px; }
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: #d5d5d5;
position: absolute; }
::-webkit-scrollbar-track {
display: none; }
::-webkit-scrollbar-track-piece {
display: none; }
.header-dispaly-in-row.u-table table {
table-layout: fixed; }
.header-dispaly-in-row th {
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: middle;
overflow: hidden; }
.body-dispaly-in-row.u-table table {
table-layout: fixed; }
.body-dispaly-in-row td {
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: middle;
overflow: hidden; }
.u-table-drag-hidden-cont {
position: absolute;
top: -1000px; }
.selected { .selected {
background: #FFF7E7; } background: #FFF7E7; }
@ -654,22 +25,43 @@
padding-top: 0px; padding-top: 0px;
padding-bottom: 0px; } padding-bottom: 0px; }
.demo501 .editable-cell-text-wrapper:hover { .demo0502 .u-table-row td {
border: 1px dashed #A5ADBA; } padding: 5px 8px; }
.demo0502 .u-table-row td input.error {
border-color: #F44336; }
.demo501 .require { .demo0502 .u-table-row .editable-cell {
height: 30px; }
.demo0502 .u-table-row-hover .editable-cell-text-wrapper {
line-height: 18px;
border: 1px solid #c1c7d0; }
.demo0502 .u-table-row .u-form-control,
.demo0502 .u-table-row .u-select-selection {
height: 30px; }
.demo0502 .editable-cell-text-wrapper {
box-sizing: border-box;
line-height: 20px;
border-radius: 3px; }
.demo0502 .editable-cell-text-wrapper:hover {
line-height: 18px;
border: 1px solid #a5adba; }
.demo0502 .require {
position: absolute; position: absolute;
top: 2px; top: 2px;
color: red; color: #F44336;
font-size: 20px; } font-size: 20px; }
.help-tip { .help-tip {
color: #F44336; } color: #F44336; }
.tp-501 .tooltip-arrow { .tp-0502 .tooltip-arrow {
border-bottom-color: #F44336 !important; } border-bottom-color: #F44336 !important; }
.tp-501 .tooltip-inner { .tp-0502 .tooltip-inner {
border-color: #F44336 !important; } border-color: #F44336 !important; }
th .drop-menu .uf { th .drop-menu .uf {

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

83697
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,94 +1,95 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "2.0.13", "version": "2.0.13",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",
"react-component", "react-component",
"bee-table", "bee-table",
"iuap-design", "iuap-design",
"tinper-bee", "tinper-bee",
"Table" "Table"
],
"engines": {
"node": ">=6.0.0"
},
"jest": {
"moduleFileExtensions": [
"js",
"jsx"
], ],
"transform": { "engines": {
"^.+\\.js$": "babel-jest" "node": ">=6.0.0"
},
"jest": {
"moduleFileExtensions": [
"js",
"jsx"
],
"transform": {
"^.+\\.js$": "babel-jest"
}
},
"homepage": "https://github.com/tinper-bee/bee-table.git",
"author": "Yonyou FED",
"repository": "http://github.com/tinper-bee/bee-table",
"bugs": "https://github.com/tinper-bee/bee-table.git/issues",
"license": "MIT",
"main": "./build/index.js",
"config": {
"port": 3000,
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"scripts": {
"dev": "bee-tools run start",
"build": "bee-tools run build",
"lint": "bee-tools run lint",
"test": "jest",
"chrome": "bee-tools run chrome",
"coveralls": "jest",
"browsers": "bee-tools run browsers",
"pub": "bee-tools run pub",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
},
"dependencies": {
"bee-button": "latest",
"bee-checkbox": "latest",
"bee-datepicker": "^2.0.9",
"bee-dropdown": "^2.0.3",
"bee-form-control": "latest",
"bee-icon": "latest",
"bee-input-number": "^2.0.5",
"bee-loading": "^1.0.6",
"bee-locale": "0.0.11",
"bee-menus": "^2.0.2",
"bee-select": "^2.0.9",
"classnames": "^2.2.5",
"component-classes": "^1.2.6",
"lodash.clonedeep": "^4.5.0",
"object-path": "^0.11.3",
"shallowequal": "^1.0.2",
"throttle-debounce": "^2.0.1",
"tinper-bee-core": "latest",
"warning": "^3.0.0"
},
"peerDependencies": {
"react": "^15.3.0 || ^16.0",
"react-dom": "^15.3.0 || ^16.0",
"prop-types": "^15.6.0"
},
"devDependencies": {
"babel-jest": "^22.0.4",
"bee-clipboard": "^2.0.0",
"bee-drawer": "0.0.2",
"bee-layout": "latest",
"bee-pagination": "^2.0.5",
"bee-panel": "latest",
"bee-popover": "^2.0.0",
"chai": "^3.5.0",
"console-polyfill": "~0.2.1",
"cz-conventional-changelog": "^2.1.0",
"enzyme": "^2.9.1",
"es5-shim": "~4.1.10",
"jest": "^22.0.4",
"react": "^16.6.3",
"react-addons-test-utils": "^15.5.0",
"react-dom": "^16.6.3",
"ref-tree": "^2.0.1-beta.1",
"reqwest": "^2.0.5",
"tinper-bee": "latest"
} }
},
"homepage": "https://github.com/tinper-bee/bee-table.git",
"author": "Yonyou FED",
"repository": "http://github.com/tinper-bee/bee-table",
"bugs": "https://github.com/tinper-bee/bee-table.git/issues",
"license": "MIT",
"main": "./build/index.js",
"config": {
"port": 3000,
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"scripts": {
"dev": "bee-tools run start",
"build": "bee-tools run build",
"lint": "bee-tools run lint",
"test": "jest",
"chrome": "bee-tools run chrome",
"coveralls": "jest",
"browsers": "bee-tools run browsers",
"pub": "bee-tools run pub",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
},
"dependencies": {
"bee-button": "latest",
"bee-checkbox": "latest",
"bee-datepicker": "^2.0.9",
"bee-dropdown": "^2.0.3",
"bee-form-control": "latest",
"bee-icon": "latest",
"bee-input-number": "^2.0.5",
"bee-loading": "^1.0.6",
"bee-locale": "0.0.11",
"bee-menus": "^2.0.2",
"bee-select": "^2.0.9",
"classnames": "^2.2.5",
"component-classes": "^1.2.6",
"lodash.clonedeep": "^4.5.0",
"object-path": "^0.11.3",
"shallowequal": "^1.0.2",
"throttle-debounce": "^2.0.1",
"tinper-bee-core": "latest",
"warning": "^3.0.0"
},
"peerDependencies": {
"react": "^15.3.0 || ^16.0",
"react-dom": "^15.3.0 || ^16.0",
"prop-types": "^15.6.0"
},
"devDependencies": {
"babel-jest": "^22.0.4",
"bee-clipboard": "^2.0.0",
"bee-drawer": "0.0.2",
"bee-layout": "latest",
"bee-pagination": "^2.0.5",
"bee-panel": "latest",
"bee-popover": "^2.0.0",
"chai": "^3.5.0",
"console-polyfill": "~0.2.1",
"cz-conventional-changelog": "^2.1.0",
"enzyme": "^2.9.1",
"es5-shim": "~4.1.10",
"jest": "^22.0.4",
"react": "^16.6.3",
"react-addons-test-utils": "^15.5.0",
"react-dom": "^16.6.3",
"reqwest": "^2.0.5",
"tinper-bee": "latest"
}
} }

View File

@ -569,7 +569,7 @@ $icon-color:#505F79;
} }
} }
&-pop-cont-item>span{ &-pop-cont-item span.drop-menu-title{
margin-left: -3px; margin-left: -3px;
max-width: 132px; max-width: 132px;
width: auto !important; width: auto !important;
@ -621,6 +621,31 @@ $icon-color:#505F79;
} }
} }
} }
// 滚动条样式复写
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-button {
display: none;
}
::-webkit-scrollbar-thumb {
background: #d5d5d5 !important;
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: #d5d5d5;
position: absolute;
}
::-webkit-scrollbar-track {
display: none;
}
::-webkit-scrollbar-track-piece {
display: none;
}
} }
.u-table:focus{ .u-table:focus{
outline: none; outline: none;
@ -901,31 +926,7 @@ $icon-color:#505F79;
left: 100; left: 100;
} }
// 滚动条样式复写
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-button {
display: none;
}
::-webkit-scrollbar-thumb {
background: #d5d5d5 !important;
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: #d5d5d5;
position: absolute;
}
::-webkit-scrollbar-track {
display: none;
}
::-webkit-scrollbar-track-piece {
display: none;
}
// 表格显示里面的内容显示在一行 // 表格显示里面的内容显示在一行
.header-dispaly-in-row{ .header-dispaly-in-row{

View File

@ -110,7 +110,7 @@ export default function filterColumn(Table, Popover) {
> >
<Checkbox {...paramObj}> <Checkbox {...paramObj}>
<span>{da.title}</span> {da.title}
</Checkbox> </Checkbox>
</div> </div>
); );

View File

@ -14,9 +14,13 @@ const scrollbarMeasure = {
}; };
export function measureScrollbar(direction = 'vertical') { export function measureScrollbar(direction = 'vertical') {
if (typeof document === 'undefined' || typeof window === 'undefined') { if (typeof document === 'undefined' || typeof window === 'undefined') {
return 0; return 0;
} }
const tableDom =document.querySelector('.u-table');
let currentDom = tableDom?tableDom:document.body;
if (scrollbarSize) { if (scrollbarSize) {
return scrollbarSize; return scrollbarSize;
} }
@ -24,7 +28,7 @@ export function measureScrollbar(direction = 'vertical') {
Object.keys(scrollbarMeasure).forEach(scrollProp => { Object.keys(scrollbarMeasure).forEach(scrollProp => {
scrollDiv.style[scrollProp] = scrollbarMeasure[scrollProp]; scrollDiv.style[scrollProp] = scrollbarMeasure[scrollProp];
}); });
document.body.appendChild(scrollDiv); currentDom.appendChild(scrollDiv);
let size = 0; let size = 0;
if (direction === 'vertical') { if (direction === 'vertical') {
size = scrollDiv.offsetWidth - scrollDiv.clientWidth; size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
@ -32,7 +36,7 @@ export function measureScrollbar(direction = 'vertical') {
size = scrollDiv.offsetHeight - scrollDiv.clientHeight; size = scrollDiv.offsetHeight - scrollDiv.clientHeight;
} }
document.body.removeChild(scrollDiv); currentDom.removeChild(scrollDiv);
scrollbarSize = size; scrollbarSize = size;
return scrollbarSize; return scrollbarSize;
} }