xt-element-ui 1.3.4 → 1.4.0

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.
@@ -0,0 +1,197 @@
1
+ @import '../../../styles/variables.scss';
2
+
3
+ .xt-tabs {
4
+ display: flex;
5
+ flex-direction: column;
6
+ }
7
+
8
+ .xt-tabs--left,
9
+ .xt-tabs--right {
10
+ flex-direction: row;
11
+ }
12
+
13
+ .xt-tabs__header {
14
+ position: relative;
15
+ border-bottom: 1px solid $xt-color-border-light;
16
+ padding-bottom: 0;
17
+ }
18
+
19
+ .xt-tabs--card .xt-tabs__header {
20
+ border-bottom: none;
21
+ background: $xt-color-bg-secondary;
22
+ padding: 4px 4px 0;
23
+ border-radius: 4px 4px 0 0;
24
+ }
25
+
26
+ .xt-tabs--left .xt-tabs__header {
27
+ border-right: 1px solid $xt-color-border-light;
28
+ border-bottom: none;
29
+ padding-right: 0;
30
+ }
31
+
32
+ .xt-tabs--right .xt-tabs__header {
33
+ border-left: 1px solid $xt-color-border-light;
34
+ border-bottom: none;
35
+ padding-left: 0;
36
+ }
37
+
38
+ .xt-tabs__nav {
39
+ display: flex;
40
+ }
41
+
42
+ .xt-tabs--left .xt-tabs__nav,
43
+ .xt-tabs--right .xt-tabs__nav {
44
+ flex-direction: column;
45
+ }
46
+
47
+ .xt-tabs__nav-item {
48
+ position: relative;
49
+ padding: 12px 20px;
50
+ font-size: 14px;
51
+ color: $xt-color-text-secondary;
52
+ cursor: pointer;
53
+ transition: color 0.3s ease;
54
+ }
55
+
56
+ .xt-tabs--card .xt-tabs__nav-item {
57
+ margin-bottom: -1px;
58
+ border-radius: 4px 4px 0 0;
59
+ background: transparent;
60
+ border: 1px solid transparent;
61
+ }
62
+
63
+ .xt-tabs--card .xt-tabs__nav-item--active {
64
+ background: $xt-color-bg-primary;
65
+ border-color: $xt-color-border-light;
66
+ border-bottom-color: $xt-color-bg-primary;
67
+ }
68
+
69
+ .xt-tabs__nav-item:hover {
70
+ color: $xt-color-primary;
71
+ }
72
+
73
+ .xt-tabs__nav-item--active {
74
+ color: $xt-color-primary;
75
+ font-weight: 500;
76
+ }
77
+
78
+ .xt-tabs__nav-link {
79
+ display: inline-block;
80
+ }
81
+
82
+ .xt-tabs__nav-indicator {
83
+ position: absolute;
84
+ bottom: 0;
85
+ height: 2px;
86
+ background: $xt-color-primary;
87
+ transition: left 0.3s ease, width 0.3s ease;
88
+ }
89
+
90
+ .xt-tabs--left .xt-tabs__nav-indicator {
91
+ bottom: auto;
92
+ left: auto;
93
+ right: 0;
94
+ width: 2px;
95
+ height: auto;
96
+ top: 0;
97
+ }
98
+
99
+ .xt-tabs--right .xt-tabs__nav-indicator {
100
+ bottom: auto;
101
+ right: auto;
102
+ left: 0;
103
+ width: 2px;
104
+ height: auto;
105
+ top: 0;
106
+ }
107
+
108
+ .xt-tabs--card .xt-tabs__nav-indicator {
109
+ display: none;
110
+ }
111
+
112
+ .xt-tabs__content {
113
+ flex: 1;
114
+ padding: 20px 0;
115
+ }
116
+
117
+ .xt-tabs--card .xt-tabs__content {
118
+ border: 1px solid $xt-color-border-light;
119
+ border-top: none;
120
+ border-radius: 0 0 4px 4px;
121
+ padding: 20px;
122
+ }
123
+
124
+ .xt-tabs--left .xt-tabs__content,
125
+ .xt-tabs--right .xt-tabs__content {
126
+ padding: 0 20px;
127
+ }
128
+
129
+ .xt-tabs__pane {
130
+ animation: xt-tabs-fade-in 0.3s ease;
131
+ }
132
+
133
+ @keyframes xt-tabs-fade-in {
134
+ from {
135
+ opacity: 0;
136
+ transform: translateY(10px);
137
+ }
138
+ to {
139
+ opacity: 1;
140
+ transform: translateY(0);
141
+ }
142
+ }
143
+
144
+ .xt-tabs-fade-enter-active,
145
+ .xt-tabs-fade-leave-active {
146
+ transition: opacity 0.3s ease, transform 0.3s ease;
147
+ }
148
+
149
+ .xt-tabs-fade-enter {
150
+ opacity: 0;
151
+ transform: translateY(10px);
152
+ }
153
+
154
+ .xt-tabs-fade-leave-to {
155
+ opacity: 0;
156
+ transform: translateY(-10px);
157
+ }
158
+
159
+ [data-theme='dark'], html.dark {
160
+ .xt-tabs__header {
161
+ border-color: $xt-dark-color-border;
162
+ }
163
+
164
+ .xt-tabs--card .xt-tabs__header {
165
+ background: $xt-dark-color-bg-secondary;
166
+ }
167
+
168
+ .xt-tabs--card .xt-tabs__nav-item--active {
169
+ background: $xt-dark-color-bg-primary;
170
+ border-color: $xt-dark-color-border;
171
+ border-bottom-color: $xt-dark-color-bg-primary;
172
+ }
173
+
174
+ .xt-tabs--left .xt-tabs__header {
175
+ border-color: $xt-dark-color-border;
176
+ }
177
+
178
+ .xt-tabs--right .xt-tabs__header {
179
+ border-color: $xt-dark-color-border;
180
+ }
181
+
182
+ .xt-tabs__nav-item {
183
+ color: $xt-dark-color-text-secondary;
184
+ }
185
+
186
+ .xt-tabs__nav-item:hover {
187
+ color: $xt-dark-color-primary;
188
+ }
189
+
190
+ .xt-tabs__nav-item--active {
191
+ color: $xt-dark-color-primary;
192
+ }
193
+
194
+ .xt-tabs--card .xt-tabs__content {
195
+ border-color: $xt-dark-color-border;
196
+ }
197
+ }
@@ -5,7 +5,9 @@
5
5
  type ? 'xt-text--' + type : '',
6
6
  'xt-text--' + size,
7
7
  { 'xt-text--bold': bold },
8
- { 'xt-text--money': format === 'money' }
8
+ { 'xt-text--money': format === 'money' },
9
+ { 'xt-text--ellipsis': ellipsis },
10
+ { 'xt-text--ellipsis-multiline': ellipsis && ellipsisRows > 1 }
9
11
  ]"
10
12
  :style="customStyle"
11
13
  >
@@ -43,6 +45,15 @@ export default {
43
45
  type: [String, Number],
44
46
  default: ''
45
47
  },
48
+ ellipsis: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ ellipsisRows: {
53
+ type: Number,
54
+ default: 1,
55
+ validator: (val) => val >= 1 && val <= 10
56
+ },
46
57
 
47
58
  // 格式化模式:normal 普通 | thousand 千分位 | money 金额
48
59
  format: {
@@ -98,6 +109,9 @@ export default {
98
109
  if (this.letterSpacing) {
99
110
  style.letterSpacing = typeof this.letterSpacing === 'number' ? `${this.letterSpacing}px` : this.letterSpacing
100
111
  }
112
+ if (this.ellipsis && this.ellipsisRows > 1) {
113
+ style.WebkitLineClamp = this.ellipsisRows
114
+ }
101
115
  return style
102
116
  },
103
117
 
@@ -52,6 +52,24 @@
52
52
  font-weight: bold;
53
53
  }
54
54
 
55
+ // 单行省略
56
+ .xt-text--ellipsis {
57
+ display: inline-block;
58
+ overflow: hidden;
59
+ text-overflow: ellipsis;
60
+ white-space: nowrap;
61
+ max-width: 100%;
62
+ }
63
+
64
+ // 多行省略
65
+ .xt-text--ellipsis-multiline {
66
+ display: -webkit-box;
67
+ overflow: hidden;
68
+ -webkit-box-orient: vertical;
69
+ text-overflow: ellipsis;
70
+ max-width: 100%;
71
+ }
72
+
55
73
  // 金额样式
56
74
  .xt-text--money {
57
75
  font-family: 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
package/src/index.js CHANGED
@@ -30,6 +30,9 @@ import XtMap from './components/xt-map'
30
30
  import XtMapProvider from './components/xt-map-provider'
31
31
  import XtGridBox from './components/xt-grid-box'
32
32
  import XtGridItem from './components/xt-grid-item'
33
+ import XtProgress from './components/xt-progress'
34
+ import XtTabs from './components/xt-tabs'
35
+ import XtBadge from './components/xt-badge'
33
36
  import ExDatePicker from './components/ex-date-picker'
34
37
  import ExButton from './components/ex-button'
35
38
  import ExChart from './components/ex-chart' // ExChart 组件(基于 ECharts 封装)
@@ -54,6 +57,9 @@ const components = [
54
57
  XtMapProvider,
55
58
  XtGridBox,
56
59
  XtGridItem,
60
+ XtProgress,
61
+ XtTabs,
62
+ XtBadge,
57
63
  ExDatePicker,
58
64
  ExButton,
59
65
  ExChart,
@@ -115,9 +121,7 @@ if (typeof window !== 'undefined' && window.Vue) {
115
121
  // 导出
116
122
  export default {
117
123
  install,
118
- // 导出组件列表
119
124
  components,
120
- // 按需导出组件
121
125
  XtButton,
122
126
  XtInput,
123
127
  XtFlexBox,
@@ -132,6 +136,9 @@ export default {
132
136
  XtMapProvider,
133
137
  XtGridBox,
134
138
  XtGridItem,
139
+ XtProgress,
140
+ XtTabs,
141
+ XtBadge,
135
142
  ExDatePicker,
136
143
  ExButton,
137
144
  ExCard,