zartui 2.0.80-beta.2 → 2.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js CHANGED
@@ -74,7 +74,7 @@ import Tag from './tag';
74
74
  import Timeline from './timeline';
75
75
  import Toast from './toast';
76
76
  import Uploader from './uploader';
77
- var version = '2.0.80-beta.2';
77
+ var version = '2.0.81';
78
78
 
79
79
  function install(Vue) {
80
80
  var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Timeline, Toast, Uploader];
package/es/style/var.less CHANGED
@@ -1066,11 +1066,16 @@
1066
1066
  @backtop-box-shadow: 0 4px 12px 0 rgba(5,140,230,0.40);
1067
1067
 
1068
1068
  // Table
1069
- @table-border-radius: @border-radius-lg;
1070
1069
  @table-head-height: 40px;
1071
1070
  @table-head-font-size: 14px;
1071
+ @table-head-color: @blue;
1072
+ @table-head-background: #E6F5FF;
1073
+ @table-body-background: #F5FAFF;
1072
1074
  @table-row-height: 40px;
1073
1075
  @table-row-font-size: 14px;
1076
+ @table-row-color: #2D4B73;
1077
+ @table-row-background: #fff;
1078
+ @table-sort-default-color: #c8c9cc;
1074
1079
 
1075
1080
  // Fold-Dialog
1076
1081
  @foldDialog-padding: 0 16px 12px 16px;
@@ -1 +1 @@
1
- .zt2-table{position:relative;border-radius:8px;scrollbar-width:none;-ms-overflow-style:none}.zt2-table::-webkit-scrollbar{display:none;width:0;height:0}.zt2-table__normal-box{display:-webkit-box;display:-webkit-flex;display:flex;overflow-x:scroll;position:relative}.zt2-table__fixed-left-box{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;top:0;left:-1px;z-index:2}.zt2-table__fixed-right-box{display:-webkit-box;display:-webkit-flex;display:flex;position:absolute;top:0;right:-1px;z-index:2}.zt2-table__fixed-left-box.shadow::after{content:"";position:absolute;top:0;right:-10px;width:10px;height:100%;opacity:.06;background-image:-webkit-linear-gradient(left,#000 0,rgba(0,0,0,0) 100%);background-image:linear-gradient(90deg,#000 0,rgba(0,0,0,0) 100%)}.zt2-table__fixed-right-box.shadow::before{content:"";position:absolute;top:0;left:-10px;width:10px;height:100%;opacity:.06;background-image:-webkit-linear-gradient(left,#000 0,rgba(0,0,0,0) 100%);background-image:linear-gradient(90deg,#000 0,rgba(0,0,0,0) 100%)}.zt2-table__head{-webkit-flex-shrink:0;flex-shrink:0}.zt2-table__head-item{height:40px;font-weight:600;font-size:14px;text-align:center;line-height:40px}.zt2-table__table-data{height:40px;font-size:14px;text-align:center;line-height:40px}.zt2-table.zt2-table--no-border .zt2-table__fixed-head::after,.zt2-table.zt2-table--no-border .zt2-table__head-item::after,.zt2-table.zt2-table--no-border .zt2-table__head::after,.zt2-table.zt2-table--no-border .zt2-table__normal-box::after,.zt2-table.zt2-table--no-border .zt2-table__table-data::after{border:none}
1
+ .zt2-table table{border-collapse:separate;border-spacing:0;width:100%;table-layout:auto;box-sizing:border-box}.zt2-table--fixed{overflow:auto scroll}.zt2-table--fixed::-webkit-scrollbar{width:0;height:0}.zt2-table--fixed table{table-layout:fixed}.zt2-table--thead-fixed{position:-webkit-sticky!important;position:sticky!important;z-index:2}.zt2-table--fix-left{position:-webkit-sticky!important;position:sticky!important;z-index:2}.zt2-table--bordered{border-left:1px solid #f0f0f0}.zt2-table--bordered>table{border-top:1px solid #f0f0f0}.zt2-table--bordered .zt2-table__thead>tr>th{border-right:1px solid #f0f0f0;border-bottom:1px solid #f0f0f0}.zt2-table--bordered .zt2-table__tbody>tr>td{border-bottom:1px solid #f0f0f0;border-right:1px solid #f0f0f0}.zt2-table__thead>tr>th{box-sizing:border-box;overflow-wrap:break-word;height:40px;font-weight:600;font-size:14px;color:#0091fa;text-align:center;line-height:40px;background:#e6f5ff}.zt2-table__head{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.zt2-table__head-sort{display:-webkit-inline-box;display:-webkit-inline-flex;display:inline-flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;color:#c8c9cc}.zt2-table__sort-active{color:#0091fa}.zt2-table__tbody>tr>td{box-sizing:border-box;overflow-wrap:break-word;height:40px;font-size:14px;color:#2d4b73;text-align:center;line-height:40px;background:#fff}.zt2-table--striped .zt2-table__tbody>tr:nth-child(even)>td{background:#f5faff}.zt2-table--left-last{border-right:none!important}.zt2-table--left-last::after{content:"";position:absolute;top:0;right:-10px;width:10px;height:100%;opacity:.06;background-image:-webkit-linear-gradient(left,#000 0,rgba(0,0,0,0) 100%);background-image:linear-gradient(90deg,#000 0,rgba(0,0,0,0) 100%)}
package/es/table/index.js CHANGED
@@ -1,14 +1,12 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import { createNamespace } from '../utils';
2
- import { BORDER_LEFT, BORDER_BOTTOM, BORDER_RIGHT, BORDER_SURROUND, BORDER_TOP_BOTTOM } from '../utils/constant';
3
+ import Icon from '../icon/index';
4
+ import { SortOrderEnum } from './type';
3
5
 
4
6
  var _createNamespace = createNamespace('table'),
5
7
  createComponent = _createNamespace[0],
6
8
  bem = _createNamespace[1];
7
9
 
8
- var defaultData = function defaultData() {
9
- return {};
10
- };
11
-
12
10
  export default createComponent({
13
11
  props: {
14
12
  headList: {
@@ -19,268 +17,198 @@ export default createComponent({
19
17
  type: Array,
20
18
  default: []
21
19
  },
22
- outline: {
20
+ bordered: {
23
21
  type: Boolean,
24
22
  default: true
25
23
  },
26
- headColor: {
27
- type: String,
28
- default: "#000"
29
- },
30
- headBackground: {
31
- type: String,
32
- default: "#fafafa"
33
- },
34
- dataColor: {
35
- type: String,
36
- default: "#000"
37
- },
38
- dataBackground: {
39
- type: String,
40
- default: "#fff"
41
- },
42
- hideTableHead: {
24
+ striped: {
43
25
  type: Boolean,
44
26
  default: false
45
27
  }
46
28
  },
47
29
  data: function data() {
48
- return defaultData();
30
+ return {
31
+ pingedLeft: false,
32
+ sortOrder: '',
33
+ sortKey: ''
34
+ };
49
35
  },
50
36
  computed: {
51
- fixedColumnLeft: function fixedColumnLeft() {
37
+ fixedColumn: function fixedColumn() {
52
38
  return this.headList.filter(function (v) {
53
- return v.fixedLeft;
39
+ return v.fixed;
54
40
  });
55
41
  },
56
- fixedColumnRight: function fixedColumnRight() {
57
- return this.headList.filter(function (v) {
58
- return v.fixedRight;
59
- });
42
+ fixed: function fixed() {
43
+ return this.fixedColumn.length > 0;
60
44
  },
61
- resortHeadList: function resortHeadList() {
62
- // 对表头数组重新排序,需要固定的表头向左对齐
63
- return this.fixedColumnLeft.concat(this.headList.filter(function (v) {
64
- return !v.fixedLeft && !v.fixedRight;
65
- })).concat(this.fixedColumnRight);
66
- },
67
- hasSummary: function hasSummary() {
68
- return this.headList.filter(function (v) {
69
- return v.showSummary;
70
- }).length > 0;
71
- }
72
- },
73
- mounted: function mounted() {
74
- var columnTotalWidth = 0;
75
- this.headList.forEach(function (v, i) {
76
- var dom = document.getElementById("tableHead" + i);
77
-
78
- if (dom) {
79
- columnTotalWidth += dom.clientWidth || 0;
80
- }
81
- });
82
- var box = document.getElementById("normalBoxID");
83
- var boxWidth = 0;
84
-
85
- if (box) {
86
- boxWidth = box.clientWidth;
87
- }
88
-
89
- if (this.fixedColumnLeft && this.fixedColumnLeft.length || this.fixedColumnRight && this.fixedColumnRight.length) {
90
- // 当表格横向出现滚动时,给固定列加一个box-shadow
91
- var fixedBoxRight = document.getElementById("fixedRightBoxID");
92
-
93
- if (fixedBoxRight && columnTotalWidth > boxWidth) {
94
- fixedBoxRight.classList.add("shadow");
95
- }
96
-
97
- if (box) {
98
- box.addEventListener("scroll", function (e) {
99
- var fixedBoxLeft = document.getElementById("fixedLeftBoxID");
100
-
101
- if (fixedBoxLeft) {
102
- if (e && e.target && e.target.scrollLeft > 0) {
103
- fixedBoxLeft.classList.add("shadow");
104
- } else {
105
- fixedBoxLeft.classList.remove("shadow");
106
- }
107
- }
108
-
109
- if (fixedBoxRight) {
110
- if (e && e.target && e.target.scrollLeft + e.target.clientWidth >= columnTotalWidth - 1) {
111
- fixedBoxRight.classList.remove("shadow");
112
- } else {
113
- fixedBoxRight.classList.add("shadow");
114
- }
115
- }
116
- });
117
- }
118
- } // 获取需固定列的实际宽度,用于设置绝对定位元素的宽度
119
-
120
-
121
- var fixedLeftIndexList = this.headList.map(function (v, i) {
122
- if (v.fixedLeft) {
123
- return "tableHead" + i;
124
- } else {
125
- return "";
126
- }
127
- }).filter(function (v) {
128
- return v !== "";
129
- });
130
-
131
- if (fixedLeftIndexList.length > 0) {
132
- fixedLeftIndexList.forEach(function (current, index) {
133
- var fixedDom = document.getElementById("fixedHeadLeft" + index);
134
- var normalDom = document.getElementById(current);
135
-
136
- if (fixedDom && normalDom) {
137
- fixedDom.style.width = normalDom.offsetWidth + "px";
45
+ formatColumns: function formatColumns() {
46
+ var _this = this;
47
+
48
+ var columns = [];
49
+ var left = 0;
50
+ this.headList.forEach(function (element, index) {
51
+ var column = {};
52
+ var preColumn = _this.headList[index - 1];
53
+ var nextColumn = _this.headList[index + 1];
54
+
55
+ if (element.sorter && element.defaultSortOrder) {
56
+ _this.sortOrder = element.defaultSortOrder || '';
57
+ _this.sortKey = element.key;
138
58
  }
139
- }, 0);
140
- } // 获取需固定列的实际宽度,用于设置绝对定位元素的宽度
141
59
 
142
-
143
- var fixedRightIndexList = this.headList.map(function (v, i) {
144
- if (v.fixedRight) {
145
- return "tableHead" + i;
146
- } else {
147
- return "";
148
- }
149
- }).filter(function (v) {
150
- return v !== "";
151
- });
152
-
153
- if (fixedRightIndexList.length > 0) {
154
- fixedRightIndexList.forEach(function (current, index) {
155
- var fixedDom = document.getElementById("fixedHeadRight" + index);
156
- var normalDom = document.getElementById(current);
157
-
158
- if (fixedDom && normalDom) {
159
- fixedDom.style.width = normalDom.offsetWidth + "px";
60
+ if (preColumn) {
61
+ left += Number(preColumn.width.split('px')[0]);
62
+ column.left = left + "px";
63
+ } else {
64
+ column.left = 0;
160
65
  }
161
- }, 0); // 当存在右侧固定列,且列宽度不足以撑满容器时,将最后一列宽度拉长到填满
162
-
163
- if (columnTotalWidth < boxWidth) {
164
- var lastColumn = document.getElementById("tableHead" + (this.headList.length - 1));
165
66
 
166
- if (lastColumn) {
167
- lastColumn.classList.add("widen");
168
- lastColumn.style.width = "unset";
169
- lastColumn.style.flex = "1";
67
+ if (element.fixed && !nextColumn.fixed) {
68
+ column.lastFixLeft = true;
170
69
  }
171
- }
70
+
71
+ columns.push(_extends({}, element, column));
72
+ });
73
+ return columns;
172
74
  }
173
75
  },
174
- watch: {},
175
76
  methods: {
176
- genColumn: function genColumn(headObj, index, isFixed) {
177
- var h = this.$createElement;
178
-
179
- var _ref = this,
180
- slots = _ref.slots,
181
- hideTableHead = _ref.hideTableHead;
182
-
183
- var headItemStyle = {
184
- color: this.headColor,
185
- background: this.headBackground
186
- };
187
- var dataStyle = {
188
- color: this.dataColor,
189
- background: this.dataBackground
190
- };
191
- var idName = "tableHead" + index;
192
-
193
- if (isFixed === "left") {
194
- idName = "fixedHeadLeft" + index;
77
+ onScroll: function onScroll(_ref) {
78
+ var currentTarget = _ref.currentTarget,
79
+ scrollLeft = _ref.scrollLeft;
80
+ var mergedScrollLeft = typeof scrollLeft === 'number' ? scrollLeft : currentTarget.scrollLeft;
81
+ this.pingedLeft = mergedScrollLeft > 0;
82
+ },
83
+ getNextSortOrder: function getNextSortOrder(type) {
84
+ if (!type) {
85
+ return SortOrderEnum.ASCEND;
195
86
  }
196
87
 
197
- if (isFixed === "right") {
198
- idName = "fixedHeadRight" + index;
88
+ if (type === SortOrderEnum.ASCEND) {
89
+ return SortOrderEnum.DESCEND;
199
90
  }
200
91
 
201
- var headRender = slots("head" + headObj.id) || headObj.label;
92
+ return '';
93
+ },
94
+ onHeaderClick: function onHeaderClick(data) {
95
+ if (!data.sorter) return;
96
+ this.sortOrder = this.getNextSortOrder(data.key === this.sortKey ? this.sortOrder : '');
97
+ this.sortKey = data.key;
98
+ this.$emit('sort', {
99
+ order: this.sortOrder,
100
+ key: data.key
101
+ });
102
+ },
103
+ getHead: function getHead(colData) {
104
+ var _this2 = this;
105
+
106
+ var h = this.$createElement;
202
107
 
203
- if ((headObj.fixedLeft || headObj.fixedRight) && !isFixed) {
204
- // 被固定列遮住的列不显示内容
205
- headRender = "";
108
+ if ((colData == null ? void 0 : colData.colSpan) !== 0) {
109
+ return h("th", {
110
+ "class": bem({
111
+ 'fix-left': colData.fixed,
112
+ 'left-last': colData.lastFixLeft && this.pingedLeft
113
+ }),
114
+ "style": {
115
+ left: colData.fixed ? colData.left : ''
116
+ },
117
+ "attrs": {
118
+ "colspan": (colData == null ? void 0 : colData.colSpan) !== 1 ? colData == null ? void 0 : colData.colSpan : null
119
+ }
120
+ }, [h("div", {
121
+ "class": bem('head'),
122
+ "on": {
123
+ "click": function click() {
124
+ return _this2.onHeaderClick(colData);
125
+ }
126
+ }
127
+ }, [h("span", [colData.label]), colData.sorter ? h("span", {
128
+ "class": bem('head-sort')
129
+ }, [h(Icon, {
130
+ "class": [colData.key === this.sortKey && this.sortOrder === SortOrderEnum.ASCEND ? bem('sort-active') : ''],
131
+ "attrs": {
132
+ "name": "spinner-shrink",
133
+ "size": "12"
134
+ },
135
+ "style": {
136
+ marginBottom: '-3px'
137
+ }
138
+ }), h(Icon, {
139
+ "class": [colData.key === this.sortKey && this.sortOrder === SortOrderEnum.DESCEND ? bem('sort-active') : ''],
140
+ "attrs": {
141
+ "name": "spinner-expand",
142
+ "size": "12"
143
+ },
144
+ "style": {
145
+ marginTop: '-3px'
146
+ }
147
+ })]) : ''])]);
206
148
  }
149
+ },
150
+ onClick: function onClick() {},
151
+ getBody: function getBody(rowData, rowIndex) {
152
+ var _this3 = this;
153
+
154
+ var h = this.$createElement;
155
+ return h("tr", [this.formatColumns.map(function (colData) {
156
+ var _additionalCellProps, _additionalCellProps2, _additionalCellProps3, _additionalCellProps4, _additionalCellProps5, _additionalCellProps6;
207
157
 
208
- return h("div", {
209
- "class": [bem(isFixed ? "fixed-head" : "head"), isFixed ? BORDER_SURROUND : BORDER_RIGHT],
210
- "attrs": {
211
- "id": idName
212
- },
213
- "style": isFixed ? "" : headObj.width ? "width:" + headObj.width + ";" : ""
214
- }, [h("div", {
215
- "directives": [{
216
- name: "show",
217
- value: !hideTableHead
218
- }],
219
- "class": [bem("head-item"), BORDER_TOP_BOTTOM],
220
- "style": headItemStyle
221
- }, [headRender]), this.dataList.map(function (data) {
222
- var hide = (headObj.fixedLeft || headObj.fixedRight) && !isFixed;
158
+ var additionalCellProps;
223
159
 
224
- if (hide) {
225
- // 被固定列遮住的列不显示内容
226
- return h("div", {
227
- "class": [bem("table-data"), BORDER_BOTTOM],
228
- "style": dataStyle
229
- });
230
- } else if (data[headObj.key] && data[headObj.key].id && slots("data" + data[headObj.key].id)) {
231
- return slots("data" + data[headObj.key].id);
232
- } else {
233
- return h("div", {
234
- "class": [bem("table-data"), BORDER_BOTTOM],
235
- "style": dataStyle
236
- }, [data[headObj.key]]);
160
+ if (colData.customCell) {
161
+ additionalCellProps = colData.customCell(rowData, rowIndex);
237
162
  }
238
- }), this.hasSummary ? headObj.showSummary ? h("div", {
239
- "class": [bem("head-item"), BORDER_BOTTOM],
240
- "style": headItemStyle
241
- }, [this.dataList.reduce(function (prev, curr) {
242
- return prev + curr[headObj.key];
243
- }, 0)]) : h("div", {
244
- "class": [bem("head-item"), BORDER_BOTTOM],
245
- "style": headItemStyle
246
- }, [headObj.summaryLabel || ""]) : ""]);
163
+
164
+ var style = _extends({}, colData.style);
165
+
166
+ style.left = colData.fixed ? colData.left : '';
167
+ return ((_additionalCellProps = additionalCellProps) == null ? void 0 : _additionalCellProps.rowSpan) !== 0 && ((_additionalCellProps2 = additionalCellProps) == null ? void 0 : _additionalCellProps2.colSpan) !== 0 && h("td", {
168
+ "on": {
169
+ "click": function click() {
170
+ return colData.onClick && colData.onClick(rowData, rowIndex);
171
+ }
172
+ },
173
+ "class": bem({
174
+ 'fix-left': colData.fixed,
175
+ 'left-last': colData.lastFixLeft && _this3.pingedLeft
176
+ }),
177
+ "attrs": {
178
+ "colspan": ((_additionalCellProps3 = additionalCellProps) == null ? void 0 : _additionalCellProps3.colSpan) !== 1 ? (_additionalCellProps4 = additionalCellProps) == null ? void 0 : _additionalCellProps4.colSpan : null,
179
+ "rowspan": ((_additionalCellProps5 = additionalCellProps) == null ? void 0 : _additionalCellProps5.rowSpan) !== 1 ? (_additionalCellProps6 = additionalCellProps) == null ? void 0 : _additionalCellProps6.rowSpan : null
180
+ },
181
+ "style": style
182
+ }, [rowData[colData.key]]);
183
+ })]);
247
184
  }
248
185
  },
249
186
  render: function render(h) {
250
- var _this = this;
187
+ var _this4 = this;
251
188
 
252
- var showFixed = this.dataList && this.dataList.length;
253
189
  return h("div", {
254
- "class": bem(["", this.outline ? "" : "no-border"])
255
- }, [h("div", {
256
- "attrs": {
257
- "id": "normalBoxID"
258
- },
259
- "class": [bem("normal-box"), BORDER_LEFT]
260
- }, [this.resortHeadList.map(function (x, i) {
261
- return _this.genColumn(x, i);
262
- })]), h("div", {
263
- "directives": [{
264
- name: "show",
265
- value: showFixed
266
- }],
267
- "attrs": {
268
- "id": "fixedLeftBoxID"
269
- },
270
- "class": bem("fixed-left-box")
271
- }, [this.fixedColumnLeft.map(function (x, i) {
272
- return _this.genColumn(x, i, "left");
273
- })]), h("div", {
274
- "directives": [{
275
- name: "show",
276
- value: showFixed
277
- }],
278
- "attrs": {
279
- "id": "fixedRightBoxID"
280
- },
281
- "class": bem("fixed-right-box")
282
- }, [this.fixedColumnRight.map(function (x, i) {
283
- return _this.genColumn(x, i, "right");
284
- })])]);
190
+ "class": bem({
191
+ fixed: this.fixed,
192
+ bordered: this.bordered,
193
+ striped: this.striped
194
+ }),
195
+ "on": {
196
+ "scroll": this.onScroll
197
+ }
198
+ }, [h("table", [h("colgroup", [this.headList.map(function (item) {
199
+ return h("col", {
200
+ "style": {
201
+ width: item.width
202
+ }
203
+ });
204
+ })]), h("thead", {
205
+ "class": bem('thead')
206
+ }, [h("tr", [this.formatColumns.map(function (colData) {
207
+ return _this4.getHead(colData);
208
+ })])]), h("tbody", {
209
+ "class": bem('tbody')
210
+ }, [this.dataList.map(function (rowData, rowIndex) {
211
+ return _this4.getBody(rowData, rowIndex);
212
+ })])])]);
285
213
  }
286
214
  });
@@ -1,73 +1,134 @@
1
1
  @import '../style/var';
2
+
2
3
  .@{base-prefix}-table {
3
- position: relative;
4
- border-radius: @table-border-radius;
5
- scrollbar-width: none; /* firefox */
6
- -ms-overflow-style: none; /* IE 10+ */
7
- &::-webkit-scrollbar {
8
- display: none;
9
- width: 0;
10
- height: 0;
4
+ table {
5
+ border-collapse: separate;
6
+ border-spacing: 0;
7
+ width: 100%;
8
+ table-layout: auto;
9
+ box-sizing: border-box;
11
10
  }
12
- &__normal-box {
13
- display: flex;
14
- overflow-x: scroll;
15
- position: relative;
11
+
12
+ &--fixed {
13
+ overflow: auto scroll;
14
+
15
+ &::-webkit-scrollbar {
16
+ width: 0;
17
+ height: 0;
18
+ }
19
+
20
+ table {
21
+ table-layout: fixed;
22
+ }
16
23
 
17
24
  }
18
- &__fixed-left-box {
19
- display: flex;
20
- position: absolute;
21
- top: 0;
22
- left: -1px;
25
+
26
+ &--thead-fixed {
27
+ position: sticky !important;
23
28
  z-index: 2;
24
29
  }
25
- &__fixed-right-box {
26
- display: flex;
27
- position: absolute;
28
- top: 0;
29
- right: -1px;
30
+
31
+ &--fix-left {
32
+ position: sticky !important;
30
33
  z-index: 2;
31
34
  }
32
- &__fixed-left-box.shadow::after {
33
- content: "";
34
- position: absolute;
35
- top: 0;
36
- right: -10px;
37
- width: 10px;
38
- height: 100%;
39
- opacity: 0.06;
40
- background-image: linear-gradient(90deg, #000000 0%, rgba(0,0,0,0.00) 100%);
35
+
36
+ &--bordered {
37
+ border-left: 1px solid #f0f0f0;
38
+
39
+ >table {
40
+ border-top: 1px solid #f0f0f0;
41
+ }
42
+
43
+ .@{base-prefix}-table__thead {
44
+ >tr {
45
+ >th {
46
+ border-right: 1px solid #f0f0f0;
47
+ border-bottom: 1px solid #f0f0f0;
48
+ }
49
+ }
50
+ }
51
+
52
+ .@{base-prefix}-table__tbody {
53
+ >tr {
54
+ >td {
55
+ border-bottom: 1px solid #f0f0f0;
56
+ border-right: 1px solid #f0f0f0;
57
+ }
58
+ }
59
+ }
41
60
  }
42
- &__fixed-right-box.shadow::before {
43
- content: "";
44
- position: absolute;
45
- top: 0;
46
- left: -10px;
47
- width: 10px;
48
- height: 100%;
49
- opacity: 0.06;
50
- background-image: linear-gradient(90deg, #000000 0%, rgba(0,0,0,0.00) 100%);
61
+
62
+ &__thead {
63
+ >tr {
64
+ >th {
65
+ box-sizing: border-box;
66
+ overflow-wrap: break-word;
67
+ height: @table-head-height;
68
+ font-weight: 600;
69
+ font-size: @table-head-font-size;
70
+ color: @table-head-color;
71
+ text-align: center;
72
+ line-height: @table-head-height;
73
+ background: @table-head-background;
74
+ }
75
+ }
51
76
  }
77
+
52
78
  &__head {
53
- flex-shrink: 0;
79
+ display: flex;
80
+ justify-content: center;
81
+ }
82
+
83
+ &__head-sort {
84
+ display: inline-flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ flex-direction: column;
88
+ color: @table-sort-default-color;
54
89
  }
55
- &__head-item {
56
- height: @table-head-height;
57
- font-weight: 600;
58
- font-size: @table-head-font-size;
59
- text-align: center;
60
- line-height: @table-head-height;
90
+
91
+ &__sort-active {
92
+ color: @blue;
93
+ }
94
+
95
+ &__tbody {
96
+ >tr {
97
+ >td {
98
+ box-sizing: border-box;
99
+ overflow-wrap: break-word;
100
+ height: @table-row-height;
101
+ font-size: @table-row-font-size;
102
+ color: @table-row-color;
103
+ text-align: center;
104
+ line-height: @table-row-height;
105
+ background: @table-row-background;
106
+ }
107
+ }
61
108
  }
62
- &__table-data {
63
- height: @table-row-height;
64
- font-size: @table-row-font-size;
65
- text-align: center;
66
- line-height: @table-row-height;
109
+
110
+ &--striped {
111
+ .@{base-prefix}-table__tbody {
112
+ >tr:nth-child(even) {
113
+ >td {
114
+ background: @table-body-background;
115
+ }
116
+ }
117
+ }
67
118
  }
68
- &.@{base-prefix}-table--no-border {
69
- .@{base-prefix}-table__normal-box::after, .@{base-prefix}-table__fixed-head::after, .@{base-prefix}-table__head::after, .@{base-prefix}-table__head-item::after, .@{base-prefix}-table__table-data::after {
70
- border: none;
119
+
120
+ &--left-last {
121
+ border-right: none !important;
122
+
123
+ &::after {
124
+ content: "";
125
+ position: absolute;
126
+ top: 0;
127
+ right: -10px;
128
+ width: 10px;
129
+ height: 100%;
130
+ opacity: 0.06;
131
+ background-image: linear-gradient(90deg, #000000 0%, rgba(0, 0, 0, 0) 100%);
71
132
  }
72
133
  }
73
134
  }