[Feature]左侧展开收起图标的行高由16px改为14px

This commit is contained in:
yangchch6 2019-04-25 16:57:19 +08:00
parent 0d4bdeb4ec
commit f04b26e573
17 changed files with 568 additions and 345 deletions

View File

@ -146,7 +146,7 @@
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
line-height: 14px;
border: 1px solid rgb(193, 199, 208);
user-select: none;
background: #fff;
@ -162,9 +162,9 @@
.u-table-row.selected {
background: #FFF7E7; }
.u-table tr.u-table-expanded-row {
background: #f7f7f7; }
background: #DFE1E6; }
.u-table tr.u-table-expanded-row:hover {
background: #f7f7f7; }
background: #DFE1E6; }
.u-table tr.u-table-expanded-row .u-table {
z-index: 1; }
.u-table-column-hidden {

View File

@ -106,9 +106,9 @@ function sum(Table) {
return _this;
}
/**
* 获取当前的表格类型
*
/**
* 获取当前的表格类型
*
*/

View File

@ -1,7 +1,7 @@
'use strict';
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; };
@ -9,71 +9,71 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
exports.sortBy = sortBy;
exports.compare = compare;
exports.ObjectAssign = ObjectAssign;
/*
* 快速排序按某个属性或按获取排序依据的函数来排序.
* @method soryBy
* @static
* @param {array} arr 待处理数组
* @param {string|function} prop 排序依据属性获取
* @param {boolean} desc 降序
* @return {array} 返回排序后的新数组
/*
* 快速排序按某个属性或按获取排序依据的函数来排序.
* @method soryBy
* @static
* @param {array} arr 待处理数组
* @param {string|function} prop 排序依据属性获取
* @param {boolean} desc 降序
* @return {array} 返回排序后的新数组
*/
function sortBy(arr, prop, desc) {
var props = [],
ret = [],
i = 0,
len = arr.length;
if (typeof prop == 'string') {
for (; i < len; i++) {
var oI = arr[i];
(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 '参数类型错误';
var props = [],
ret = [],
i = 0,
len = arr.length;
if (typeof prop == 'string') {
for (; i < len; i++) {
var oI = arr[i];
(props[i] = new String(oI && oI[prop] || ''))._obj = oI;
}
props.sort();
for (i = 0; i < len; i++) {
ret[i] = props[i]._obj;
} else if (typeof prop == 'function') {
for (; i < len; i++) {
var _oI = arr[i];
(props[i] = new String(_oI && prop(_oI) || ''))._obj = _oI;
}
if (desc) ret.reverse();
return ret;
} else {
throw '参数类型错误';
}
props.sort();
for (i = 0; i < len; i++) {
ret[i] = props[i]._obj;
}
if (desc) ret.reverse();
return ret;
};
/**
* 数组对象排序
* console.log(arr.sort(compare('age')))
* @param {} property
/**
* 数组对象排序
* console.log(arr.sort(compare('age')))
* @param {} property
*/
function compare(property) {
return function (a, b) {
var value1 = a[property];
var value2 = b[property];
return value1 - value2;
};
return function (a, b) {
var value1 = a[property];
var value2 = b[property];
return value1 - value2;
};
}
/**
* 简单数组数据对象拷贝
* @param {*} obj 要拷贝的对象
/**
* 简单数组数据对象拷贝
* @param {*} obj 要拷贝的对象
*/
function ObjectAssign(obj) {
var b = obj instanceof Array;
var tagObj = b ? [] : {};
if (b) {
//数组
obj.forEach(function (da) {
var _da = {};
_extends(_da, da);
tagObj.push(_da);
});
} else {
_extends(tagObj, obj);
}
return tagObj;
var b = obj instanceof Array;
var tagObj = b ? [] : {};
if (b) {
//数组
obj.forEach(function (da) {
var _da = {};
_extends(_da, da);
tagObj.push(_da);
});
} else {
_extends(tagObj, obj);
}
return tagObj;
}

View File

@ -19,11 +19,11 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
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) : _defaults(subClass, superClass); }
/**
* 渲染checkbox
* @param Checkbox
* @param Icon
* @returns {CheckboxRender}
/**
* 渲染checkbox
* @param Checkbox
* @param Icon
* @returns {CheckboxRender}
*/
function renderCheckbox(Checkbox, Icon) {
return function (_Component) {

View File

@ -28,12 +28,12 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
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) : _defaults(subClass, superClass); }
/**
* 渲染输入框
* @param Form
* @param Input
* @param Icon
* @returns {InputRender}
/**
* 渲染输入框
* @param Form
* @param Input
* @param Icon
* @returns {InputRender}
*/
function renderInput(Form, Input, Icon) {
var _class, _temp2;

View File

@ -26,11 +26,11 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
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) : _defaults(subClass, superClass); }
/**
* 渲染下拉框
* @param Select
* @param Icon
* @returns {SelectRender}
/**
* 渲染下拉框
* @param Select
* @param Icon
* @returns {SelectRender}
*/
function renderSelect(Select, Icon) {
var _class, _temp2;

View File

@ -11,49 +11,20 @@ import {Button,Tooltip} from "tinper-bee";
import Table from "../../src";
const columns = [
{
title: "员工编号", dataIndex: "a", key: "a", width: 120, className: "rowClassName",
fixed:'left',
render: (text, record, index) => {
return (
<Tooltip inverse overlay={text}>
<span tootip={text} style={{
display: "block",
width: "80px",
textOverflow: "ellipsis",
overflow: "hidden",
whiteSpace: "nowrap",
verticalAlign: "bottom",
}}>{text}</span>
</Tooltip>
);
}
},
{ title: "员工姓名", dataIndex: "b", key: "b", width:100 },
{ title: "性别", dataIndex: "c", key: "c", width: 100 },
{ title: "员工编号", dataIndex: "a", key: "a", width: 150 },
{ title: "员工姓名", dataIndex: "b", key: "b", width:100},
{ title: "性别", dataIndex: "c", key: "c", width: 100},
{ title: "部门", dataIndex: "d", key: "d", width: 100 },
{ title: "职级", dataIndex: "e", key: "e", width: 100 }
];
const data = [
{ a: "ASVAL_201903280005", b: "小张", c: "男", d: "财务二科", e: "M1", key: "1" },
{ a: "ASVAL_201903200004", b: "小明", c: "男", d: "财务一科", e: "T1", key: "2" },
{ a: "ASVAL_201903120002", b: "小红", c: "女", d: "财务一科", e: "T2", key: "3" }
{ a: "ASVAL_20190328", b: "小张", c: "男", d: "财务二科", e: "M1", key: "1" },
{ a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "2" },
{ a: "ASVAL_20190312", b: "小红", c: "女", d: "财务一科", e: "T2", key: "3" }
];
class Demo01 extends Component {
constructor(props) {
super(props);
this.state = {
data: data
}
}
handleClick = () => {
console.log('这是第' , this.currentIndex , '行');
console.log('内容:' , this.currentRecord);
}
class Demo0101 extends Component {
render() {
return (
<Table
@ -64,4 +35,4 @@ class Demo01 extends Component {
}
}
export default Demo01;
export default Demo0101;

View File

@ -9,9 +9,8 @@
import React, { Component } from 'react';
import Table from '../../src';
import Icon from 'bee-icon';
const columns02 = [
const columns = [
{
title: "员工编号",
dataIndex: "num",
@ -31,7 +30,7 @@ const columns02 = [
}
];
const data02 = [];
const data = [];
// 在此自定义无数据时的展示内容
const emptyFunc = () => 'No Data';
@ -40,8 +39,8 @@ class Demo02 extends Component {
render() {
return (
<Table
columns={columns02}
data={data02}
columns={columns}
data={data}
// emptyText={emptyFunc}
/>
)

View File

@ -2,7 +2,7 @@
*
* @title 固定表头
* @parent 基础 Basic
* @description 设置`scroll.y`指定滚动区域的高度达到固定表头效果
* @description 设置`scroll.y`指定滚动区域的高度达到固定表头效果
* demo0103
*/

39
demo/demolist/Demo0107.js Normal file
View File

@ -0,0 +1,39 @@
/**
*
* @title 带边框
* @parent 基础 Basic
* @description 设置 `bordered` 属性可添加表格边框线
* demo0107
*/
import React, { Component } from "react";
import {Button,Tooltip} from "tinper-bee";
import Table from "../../src";
const columns = [
{ title: "员工编号", dataIndex: "a", key: "a", width: 150 },
{ title: "员工姓名", dataIndex: "b", key: "b", width:100},
{ title: "性别", dataIndex: "c", key: "c", width: 100},
{ title: "部门", dataIndex: "d", key: "d", width: 100 },
{ title: "职级", dataIndex: "e", key: "e", width: 100 }
];
const data = [
{ a: "ASVAL_20190328", b: "小张", c: "男", d: "财务二科", e: "M1", key: "1" },
{ a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "2" },
{ a: "ASVAL_20190312", b: "小红", c: "女", d: "财务一科", e: "T2", key: "3" }
];
class Demo06 extends Component {
render() {
return (
<Table
columns={columns}
data={data}
bordered
/>
);
}
}
export default Demo06;

File diff suppressed because one or more lines are too long

6
dist/demo.css vendored
View File

@ -146,7 +146,7 @@
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
line-height: 14px;
border: 1px solid rgb(193, 199, 208);
-webkit-user-select: none;
-moz-user-select: none;
@ -165,9 +165,9 @@
.u-table-row.selected {
background: #FFF7E7; }
.u-table tr.u-table-expanded-row {
background: #f7f7f7; }
background: #DFE1E6; }
.u-table tr.u-table-expanded-row:hover {
background: #f7f7f7; }
background: #DFE1E6; }
.u-table tr.u-table-expanded-row .u-table {
z-index: 1; }
.u-table-column-hidden {

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

632
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

@ -48,16 +48,16 @@
"dependencies": {
"bee-button": "latest",
"bee-checkbox": "latest",
"bee-datepicker": "^2.0.9",
"bee-dropdown": "^2.0.3",
"bee-datepicker": "^2.0.28",
"bee-dropdown": "^2.0.4",
"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-input-number": "^2.0.7",
"bee-loading": "^1.0.9",
"bee-locale": "0.0.13",
"bee-menus": "^2.0.6",
"bee-radio": "^2.0.8",
"bee-select": "^2.0.9",
"bee-select": "^2.0.11",
"classnames": "^2.2.5",
"component-classes": "^1.2.6",
"lodash.clonedeep": "^4.5.0",

View File

@ -270,7 +270,7 @@ $icon-color:#505F79;
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
line-height: 14px;
border: 1px solid $table-border-color;
user-select: none;
background: #fff;
@ -297,9 +297,9 @@ $icon-color:#505F79;
}
}
tr.u-table-expanded-row {
background: #f7f7f7;
background: #DFE1E6;
&:hover {
background: #f7f7f7;
background: #DFE1E6;
}
.u-table {
// padding: 0 40px 0 20px;