From f734fd59c3c254455073525adf655e0e9b6bbd43 Mon Sep 17 00:00:00 2001
From: izbz wh <731215820@qq.com>
Date: Tue, 23 Apr 2019 16:59:47 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E6=AF=8F=E8=A1=8C=E7=AC=AC=E4=B8=80?=
=?UTF-8?q?=E5=88=97padding-left=E4=B8=BA12px=EF=BC=8C=E5=85=B6=E4=BB=96?=
=?UTF-8?q?=E9=BB=98=E8=AE=A48px?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
build/Table.css | 14 +-
build/Table.js | 16 +-
build/lib/multiSelect.js | 2 +-
demo/demolist/Demo01.js | 78 ++++++++++
demo/index.js | 2 +-
dist/demo.css | 4 +
dist/demo.css.map | 2 +-
dist/demo.js | 311 +++++++++++++++++++++++++++------------
dist/demo.js.map | 2 +-
index.html | 2 +-
src/Table.js | 7 +-
src/Table.scss | 17 +++
src/lib/multiSelect.js | 2 +-
13 files changed, 348 insertions(+), 111 deletions(-)
create mode 100644 demo/demolist/Demo01.js
diff --git a/build/Table.css b/build/Table.css
index c32ff8f..9a9ce0f 100644
--- a/build/Table.css
+++ b/build/Table.css
@@ -20,13 +20,15 @@
text-align: left; }
.u-table th {
font-weight: bold;
- text-align: left; }
+ 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); }
+ border-bottom: 1px solid rgb(193, 199, 208);
+ line-height: 1.33; }
.u-table td a {
color: #2196F3; }
.u-table td a:hover {
@@ -55,6 +57,10 @@
.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; }
@@ -352,6 +358,10 @@
.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;
diff --git a/build/Table.js b/build/Table.js
index 6c306ed..5c0b0b9 100644
--- a/build/Table.js
+++ b/build/Table.js
@@ -100,7 +100,8 @@ var propTypes = {
onFilterClear: _propTypes2["default"].func,
syncHover: _propTypes2["default"].bool,
tabIndex: _propTypes2["default"].string,
- hoverContent: _propTypes2["default"].func
+ hoverContent: _propTypes2["default"].func,
+ size: _propTypes2["default"].oneOf(['sm', 'md', 'lg'])
};
var defaultProps = {
@@ -145,7 +146,8 @@ var defaultProps = {
setRowHeight: function setRowHeight() {},
setRowParentIndex: function setRowParentIndex() {},
tabIndex: '0',
- heightConsistent: false
+ heightConsistent: false,
+ size: 'md'
};
var Table = function (_Component) {
@@ -1319,7 +1321,7 @@ var Table = function (_Component) {
var props = this.props;
var clsPrefix = props.clsPrefix;
-
+ var hasFixedLeft = this.columnManager.isAnyColumnsLeftFixed();
var className = props.clsPrefix;
if (props.className) {
className += ' ' + props.className;
@@ -1348,6 +1350,12 @@ var Table = function (_Component) {
show: loading
};
}
+ if (props.size) {
+ className += ' ' + clsPrefix + '-' + props.size;
+ }
+ if (hasFixedLeft) {
+ className += ' has-fixed-left';
+ }
return _react2["default"].createElement(
'div',
@@ -1366,7 +1374,7 @@ var Table = function (_Component) {
this.getEmptyText(),
this.getFooter()
),
- this.columnManager.isAnyColumnsLeftFixed() && _react2["default"].createElement(
+ hasFixedLeft && _react2["default"].createElement(
'div',
{ className: clsPrefix + '-fixed-left' },
this.getLeftFixedTable()
diff --git a/build/lib/multiSelect.js b/build/lib/multiSelect.js
index 759adfd..f6fdf8e 100644
--- a/build/lib/multiSelect.js
+++ b/build/lib/multiSelect.js
@@ -223,7 +223,7 @@ function multiSelect(Table, Checkbox) {
key: "checkbox",
dataIndex: "checkbox",
fixed: "left",
- width: 60,
+ width: 50,
render: function render(text, record, index) {
var attr = {};
record._disabled ? attr.disabled = record._disabled : "";
diff --git a/demo/demolist/Demo01.js b/demo/demolist/Demo01.js
new file mode 100644
index 0000000..b81a867
--- /dev/null
+++ b/demo/demolist/Demo01.js
@@ -0,0 +1,78 @@
+/**
+*
+* @title 基本表格
+* @parent 基础 Basic
+* @description 鼠标hover行时呼出操作按钮。单元格数据过长时,可结合Tooltip组件使用。
+*/
+
+import React, { Component } from "react";
+import {Button,Tooltip} from "tinper-bee";
+import Table from "../../src";
+
+const columns = [
+ {
+ title: "员工编号", dataIndex: "a", key: "a", width: 300, className: "rowClassName",
+ fixed:'left',
+ textAlign:'center',
+ render: (text, record, index) => {
+ return (
+
{ title }
\n{ desc }
\n 查看源码 \n\n { code }
\n
\n {!!scss_code ?\n { scss_code }
\n
: null }\n