zartui 2.0.80 → 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.
@@ -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
  }
@@ -1,2 +1,4 @@
1
1
  import '../../style/base.css';
2
+ import '../../info/index.css';
3
+ import '../../icon/index.css';
2
4
  import '../index.css';
@@ -1,2 +1,4 @@
1
1
  import '../../style/base.less';
2
+ import '../../info/index.less';
3
+ import '../../icon/index.less';
2
4
  import '../index.less';
@@ -0,0 +1,6 @@
1
+ export var SortOrderEnum;
2
+
3
+ (function (SortOrderEnum) {
4
+ SortOrderEnum["ASCEND"] = "ascend";
5
+ SortOrderEnum["DESCEND"] = "descend";
6
+ })(SortOrderEnum || (SortOrderEnum = {}));
@@ -2,7 +2,8 @@
2
2
  * Vue Router support
3
3
  */
4
4
  function isRedundantNavigation(err) {
5
- return err.name === 'NavigationDuplicated' || err.message && err.message.indexOf('redundant navigation') !== -1;
5
+ return err.name === 'NavigationDuplicated' || // compatible with vue-router@3.3
6
+ err.message && err.message.indexOf('redundant navigation') !== -1;
6
7
  }
7
8
 
8
9
  export function route(router, config) {
@@ -9,6 +9,8 @@ var _utils = require("../utils");
9
9
 
10
10
  var _event = require("../utils/dom/event");
11
11
 
12
+ var _deepClone = require("../utils/deep-clone");
13
+
12
14
  var _portal = require("../mixins/portal");
13
15
 
14
16
  var _relation = require("../mixins/relation");
@@ -36,6 +38,7 @@ var _default2 = createComponent({
36
38
  }), (0, _relation.ChildrenMixin)('ztDropdownMenu')],
37
39
  props: {
38
40
  value: null,
41
+ resetDefaultValue: null,
39
42
  title: String,
40
43
  disabled: Boolean,
41
44
  titleClass: String,
@@ -159,11 +162,17 @@ var _default2 = createComponent({
159
162
  }
160
163
  },
161
164
  select: function select(value) {
165
+ // 标识是否是取消选中这一元素
166
+ var isCancelSelect = true;
167
+
162
168
  if (this.innerValue.indexOf(value) >= 0) {
163
169
  this.innerValue.splice(this.innerValue.indexOf(value), 1);
164
170
  } else {
165
171
  this.innerValue.push(value);
172
+ isCancelSelect = false;
166
173
  }
174
+
175
+ this.$emit('item-select', value, isCancelSelect);
167
176
  },
168
177
  isSelect: function isSelect(value) {
169
178
  if (this.innerValue.indexOf(value) >= 0) {
@@ -173,13 +182,23 @@ var _default2 = createComponent({
173
182
  return false;
174
183
  },
175
184
  reset: function reset() {
176
- this.innerValue = [];
185
+ if (Array.isArray(this.resetDefaultValue)) {
186
+ this.innerValue = (0, _deepClone.deepClone)(this.resetDefaultValue);
187
+ } else {
188
+ this.innerValue = [];
189
+ }
190
+
191
+ this.$emit('reset', this.innerValue);
177
192
  },
178
193
  confirm: function confirm() {
179
194
  this.showPopup = false;
180
195
  this.$emit('input', this.innerValue);
181
196
  this.$emit('change', this.innerValue);
182
197
  this.$emit('confirm', this.innerValue);
198
+ },
199
+ // @exposed-api 给灵珑侧提供的实现修改已选中值的函数
200
+ updateInnerValue: function updateInnerValue(updateValue) {
201
+ this.innerValue = updateValue;
183
202
  }
184
203
  },
185
204
  render: function render() {
@@ -248,6 +267,8 @@ var _default2 = createComponent({
248
267
  _this3.$emit('input', option.value);
249
268
 
250
269
  _this3.$emit('change', option.value);
270
+
271
+ _this3.$emit('item-select', option.value);
251
272
  }
252
273
  }
253
274
  }