@ts-element-ui/theme-chalk 1.0.0 → 1.3.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.
package/src/image.scss ADDED
@@ -0,0 +1,160 @@
1
+ /**
2
+ * TSElement - Image 图片 组件样式
3
+ */
4
+ @use 'common/var.scss' as *;
5
+
6
+ .ts-image {
7
+ position: relative;
8
+ display: inline-block;
9
+ overflow: hidden;
10
+ vertical-align: middle;
11
+
12
+ &__inner {
13
+ display: block;
14
+ width: 100%;
15
+ height: 100%;
16
+ }
17
+
18
+ &__placeholder,
19
+ &__error {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ width: 100%;
24
+ height: 100%;
25
+ min-height: 32px;
26
+ color: $text-secondary;
27
+ font-size: $font-size-extra-small;
28
+ background-color: $fill-light;
29
+ }
30
+
31
+ &--previewable &__inner {
32
+ cursor: pointer;
33
+ }
34
+
35
+ &--loading &__inner {
36
+ opacity: 0;
37
+ }
38
+ }
39
+
40
+ .ts-image-preview {
41
+ position: fixed;
42
+ inset: 0;
43
+ z-index: 3000;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ overflow: hidden;
48
+
49
+ &__mask {
50
+ position: absolute;
51
+ inset: 0;
52
+ background-color: rgba(0, 0, 0, 0.75);
53
+ }
54
+
55
+ &__img {
56
+ position: relative;
57
+ max-width: 90%;
58
+ max-height: 90%;
59
+ transition: transform 0.3s ease;
60
+ user-select: none;
61
+ }
62
+
63
+ &__close {
64
+ position: absolute;
65
+ top: 20px;
66
+ right: 24px;
67
+ z-index: 2;
68
+ width: 40px;
69
+ height: 40px;
70
+ padding: 0;
71
+ font-size: 28px;
72
+ line-height: 1;
73
+ color: #fff;
74
+ cursor: pointer;
75
+ background: transparent;
76
+ border: 0;
77
+ border-radius: $border-radius-circle;
78
+
79
+ &:hover {
80
+ background-color: rgba(255, 255, 255, 0.15);
81
+ }
82
+ }
83
+
84
+ &__arrow {
85
+ position: absolute;
86
+ top: 50%;
87
+ z-index: 2;
88
+ width: 44px;
89
+ height: 44px;
90
+ padding: 0;
91
+ font-size: 22px;
92
+ color: #fff;
93
+ cursor: pointer;
94
+ background: rgba(0, 0, 0, 0.3);
95
+ border: 0;
96
+ border-radius: $border-radius-circle;
97
+ transform: translateY(-50%);
98
+
99
+ &:hover {
100
+ background-color: rgba(0, 0, 0, 0.5);
101
+ }
102
+
103
+ &--prev {
104
+ left: 24px;
105
+ }
106
+
107
+ &--next {
108
+ right: 24px;
109
+ }
110
+ }
111
+
112
+ &__indicator {
113
+ position: absolute;
114
+ bottom: 24px;
115
+ z-index: 2;
116
+ padding: 2px 10px;
117
+ font-size: $font-size-small;
118
+ color: #fff;
119
+ background-color: rgba(0, 0, 0, 0.4);
120
+ border-radius: $border-radius-round;
121
+ }
122
+
123
+ &__actions {
124
+ position: absolute;
125
+ top: 20px;
126
+ left: 50%;
127
+ z-index: 2;
128
+ display: flex;
129
+ gap: 8px;
130
+ align-items: center;
131
+ padding: 4px 10px;
132
+ background-color: rgba(0, 0, 0, 0.4);
133
+ border-radius: $border-radius-round;
134
+ transform: translateX(-50%);
135
+
136
+ button {
137
+ width: 28px;
138
+ height: 28px;
139
+ padding: 0;
140
+ font-size: $font-size-medium;
141
+ line-height: 1;
142
+ color: #fff;
143
+ cursor: pointer;
144
+ background: transparent;
145
+ border: 0;
146
+ border-radius: $border-radius-circle;
147
+
148
+ &:hover {
149
+ background-color: rgba(255, 255, 255, 0.2);
150
+ }
151
+ }
152
+ }
153
+
154
+ &__scale {
155
+ min-width: 44px;
156
+ font-size: $font-size-extra-small;
157
+ color: #fff;
158
+ text-align: center;
159
+ }
160
+ }
package/src/index.scss CHANGED
@@ -22,13 +22,16 @@
22
22
  @import 'input-number.scss';
23
23
  @import 'select.scss';
24
24
  @import 'cascader.scss';
25
+ @import 'mention.scss';
25
26
  @import 'radio.scss';
26
27
  @import 'checkbox.scss';
27
28
  @import 'switch.scss';
28
29
  @import 'date-picker.scss';
30
+ @import 'time-picker.scss';
29
31
  @import 'color-picker.scss';
30
32
  @import 'rate.scss';
31
33
  @import 'transfer.scss';
34
+ @import 'slider.scss';
32
35
  @import 'form.scss';
33
36
 
34
37
  // ============================================================
@@ -47,6 +50,7 @@
47
50
  @import 'tree.scss';
48
51
  @import 'timeline.scss';
49
52
  @import 'calendar.scss';
53
+ @import 'image.scss';
50
54
 
51
55
  // ============================================================
52
56
  // 导航组件
@@ -0,0 +1,90 @@
1
+ /**
2
+ * TSElement - Mention 提及 组件样式
3
+ */
4
+ @use 'common/var.scss' as *;
5
+
6
+ .ts-mention {
7
+ position: relative;
8
+ display: inline-block;
9
+ width: 100%;
10
+
11
+ &__anchor {
12
+ position: absolute;
13
+ width: 0;
14
+ height: 0;
15
+ pointer-events: none;
16
+ }
17
+
18
+ &__input {
19
+ width: 100%;
20
+ min-height: 80px;
21
+ padding: 8px 12px;
22
+ border: 1px solid var(--ts-border-color);
23
+ border-radius: $border-radius-base;
24
+ background-color: var(--ts-bg-color);
25
+ color: var(--ts-text-color-regular);
26
+ font-family: inherit;
27
+ font-size: $font-size-base;
28
+ line-height: 1.6;
29
+ outline: none;
30
+ resize: vertical;
31
+ transition: $transition-base;
32
+
33
+ &:focus { border-color: var(--ts-color-primary); }
34
+
35
+ &:disabled {
36
+ background-color: var(--ts-fill-color-light);
37
+ cursor: not-allowed;
38
+ }
39
+ }
40
+
41
+ &__clear {
42
+ position: absolute;
43
+ top: 10px;
44
+ right: 10px;
45
+ display: inline-flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ width: 16px;
49
+ height: 16px;
50
+ color: var(--ts-text-color-secondary);
51
+ cursor: pointer;
52
+
53
+ &:hover { color: var(--ts-text-color-regular); }
54
+ }
55
+
56
+ &__popper {
57
+ position: fixed;
58
+ z-index: 2000;
59
+ background-color: var(--ts-bg-color);
60
+ border: 1px solid var(--ts-border-color-lighter);
61
+ border-radius: $border-radius-base;
62
+ box-shadow: var(--ts-box-shadow-light);
63
+ }
64
+ }
65
+
66
+ .ts-mention-panel {
67
+ &__list {
68
+ min-width: 180px;
69
+ max-height: 220px;
70
+ margin: 0;
71
+ padding: 4px 0;
72
+ overflow-y: auto;
73
+ list-style: none;
74
+ }
75
+
76
+ &__item {
77
+ padding: 6px 12px;
78
+ font-size: $font-size-base;
79
+ color: var(--ts-text-color-regular);
80
+ white-space: nowrap;
81
+ cursor: pointer;
82
+ transition: background-color 0.2s;
83
+
84
+ &:hover,
85
+ &.is-active {
86
+ color: var(--ts-color-primary);
87
+ background-color: var(--ts-fill-color-light);
88
+ }
89
+ }
90
+ }
@@ -51,4 +51,32 @@
51
51
 
52
52
  &:hover { background-color: rgba(144, 147, 153, 0.7); }
53
53
  }
54
+
55
+ // 横向滚动条
56
+ &__bar--horizontal {
57
+ height: 6px;
58
+ left: 2px;
59
+ right: 2px;
60
+ bottom: 2px;
61
+ }
62
+
63
+ // 纵向滚动条
64
+ &__bar--vertical {
65
+ width: 6px;
66
+ top: 2px;
67
+ right: 2px;
68
+ bottom: 2px;
69
+ }
70
+
71
+ // always 常显 / 拖动时显示
72
+ &__bar.is-always,
73
+ &.is-dragging &__bar,
74
+ &:hover &__bar {
75
+ opacity: 1;
76
+ }
77
+
78
+ // 常显时 thumb 也保持可见
79
+ &__thumb.is-always {
80
+ opacity: 1;
81
+ }
54
82
  }
package/src/select.scss CHANGED
@@ -54,6 +54,26 @@
54
54
  padding: 6px 0;
55
55
  }
56
56
 
57
+ &__tags { position: relative; }
58
+
59
+ &__collapse-tag { cursor: default; }
60
+
61
+ &__tags-tooltip {
62
+ position: absolute;
63
+ top: 100%;
64
+ left: 0;
65
+ margin-top: 6px;
66
+ padding: 6px 10px;
67
+ white-space: nowrap;
68
+ font-size: $font-size-small;
69
+ color: var(--ts-text-color-regular);
70
+ background-color: var(--ts-bg-color);
71
+ border: 1px solid var(--ts-border-color-lighter);
72
+ border-radius: $border-radius-base;
73
+ box-shadow: var(--ts-box-shadow-light);
74
+ z-index: 1001;
75
+ }
76
+
57
77
  &__option {
58
78
  padding: 9px 16px;
59
79
  font-size: $font-size-base;
@@ -0,0 +1,198 @@
1
+ /**
2
+ * TSElement - Slider 滑块 组件样式
3
+ */
4
+ @use 'common/var.scss' as *;
5
+
6
+ .ts-slider {
7
+ position: relative;
8
+ width: 100%;
9
+ height: 6px;
10
+ margin: 16px 0;
11
+ cursor: pointer;
12
+ touch-action: none;
13
+
14
+ &__bar {
15
+ position: absolute;
16
+ top: 0;
17
+ right: 0;
18
+ bottom: 0;
19
+ left: 0;
20
+ background-color: $border-light;
21
+ border-radius: 3px;
22
+ }
23
+
24
+ &__bar-active {
25
+ position: absolute;
26
+ top: 0;
27
+ bottom: 0;
28
+ background-color: $primary;
29
+ border-radius: 3px;
30
+ }
31
+
32
+ &__stops {
33
+ position: absolute;
34
+ top: 0;
35
+ right: 0;
36
+ bottom: 0;
37
+ left: 0;
38
+ }
39
+
40
+ &__stop {
41
+ position: absolute;
42
+ top: 50%;
43
+ width: 6px;
44
+ height: 6px;
45
+ background-color: #fff;
46
+ border-radius: $border-radius-circle;
47
+ transform: translate(-50%, -50%);
48
+ }
49
+
50
+ &__marks {
51
+ position: absolute;
52
+ top: 0;
53
+ right: 0;
54
+ bottom: 0;
55
+ left: 0;
56
+ }
57
+
58
+ &__mark {
59
+ position: absolute;
60
+ top: 100%;
61
+ margin-top: 8px;
62
+ font-size: $font-size-extra-small;
63
+ color: $text-secondary;
64
+ white-space: nowrap;
65
+ transform: translateX(-50%);
66
+ }
67
+
68
+ &__handle {
69
+ position: absolute;
70
+ top: 50%;
71
+ z-index: 2;
72
+ width: 14px;
73
+ height: 14px;
74
+ background-color: #fff;
75
+ border: 2px solid $primary;
76
+ border-radius: $border-radius-circle;
77
+ transform: translate(-50%, -50%);
78
+ cursor: grab;
79
+ outline: none;
80
+ transition: box-shadow 0.2s;
81
+
82
+ &:hover,
83
+ &:focus-visible {
84
+ box-shadow: 0 0 0 4px rgba(64, 158, 255, 0.2);
85
+ }
86
+ }
87
+
88
+ &__tooltip {
89
+ position: absolute;
90
+ bottom: 100%;
91
+ left: 50%;
92
+ margin-bottom: 8px;
93
+ padding: 4px 8px;
94
+ font-size: $font-size-extra-small;
95
+ color: #fff;
96
+ white-space: nowrap;
97
+ background-color: $text-primary;
98
+ border-radius: $border-radius-base;
99
+ transform: translateX(-50%);
100
+
101
+ &.is-bottom {
102
+ top: 100%;
103
+ bottom: auto;
104
+ margin-top: 8px;
105
+ margin-bottom: 0;
106
+ }
107
+ }
108
+
109
+ &--disabled {
110
+ cursor: not-allowed;
111
+ opacity: 0.5;
112
+
113
+ .ts-slider__handle {
114
+ cursor: not-allowed;
115
+ }
116
+ }
117
+
118
+ &__inputs {
119
+ position: absolute;
120
+ top: 100%;
121
+ left: 0;
122
+ display: flex;
123
+ gap: 12px;
124
+ margin-top: 16px;
125
+ }
126
+
127
+ &__input {
128
+ width: 64px;
129
+ height: 24px;
130
+ padding: 0 8px;
131
+ font-size: $font-size-extra-small;
132
+ color: $text-primary;
133
+ text-align: center;
134
+ border: 1px solid $border-light;
135
+ border-radius: $border-radius-base;
136
+ outline: none;
137
+
138
+ &:focus {
139
+ border-color: $primary;
140
+ }
141
+
142
+ &:disabled {
143
+ cursor: not-allowed;
144
+ }
145
+ }
146
+
147
+ // 垂直模式:从上到下为最大值到最小值
148
+ &.is-vertical {
149
+ .ts-slider__inputs {
150
+ top: 0;
151
+ left: 100%;
152
+ flex-direction: column;
153
+ margin-top: 0;
154
+ margin-left: 16px;
155
+ }
156
+
157
+ width: 6px;
158
+ height: 200px;
159
+ margin: 0 16px;
160
+
161
+ .ts-slider__bar-active {
162
+ top: auto;
163
+ }
164
+
165
+ .ts-slider__handle {
166
+ top: auto;
167
+ left: 50%;
168
+ transform: translate(-50%, 50%);
169
+ }
170
+
171
+ .ts-slider__stop {
172
+ top: auto;
173
+ left: 50%;
174
+ transform: translate(-50%, 50%);
175
+ }
176
+
177
+ .ts-slider__mark {
178
+ top: auto;
179
+ left: 100%;
180
+ margin-top: 0;
181
+ margin-left: 8px;
182
+ transform: translateY(50%);
183
+ }
184
+
185
+ .ts-slider__tooltip {
186
+ bottom: 50%;
187
+ left: 100%;
188
+ margin-bottom: 0;
189
+ margin-left: 8px;
190
+ transform: translateY(50%);
191
+
192
+ &.is-bottom {
193
+ top: auto;
194
+ margin-top: 0;
195
+ }
196
+ }
197
+ }
198
+ }
package/src/table.scss CHANGED
@@ -61,3 +61,131 @@
61
61
  th, td { border-right: 1px solid var(--ts-border-color-lighter); }
62
62
  }
63
63
  }
64
+
65
+ // 固定列(sticky)
66
+ .ts-table {
67
+ overflow-x: auto;
68
+
69
+ &__cell--fixed-left,
70
+ &__cell--fixed-right {
71
+ position: sticky;
72
+ z-index: 2;
73
+ background-color: var(--ts-bg-color);
74
+ }
75
+
76
+ // 最靠近滚动区的一列显示静态阴影
77
+ &__cell.is-last-fixed-left::after,
78
+ &__cell.is-last-fixed-right::after {
79
+ content: '';
80
+ position: absolute;
81
+ top: 0;
82
+ bottom: 0;
83
+ width: 6px;
84
+ pointer-events: none;
85
+ }
86
+
87
+ &__cell.is-last-fixed-left::after {
88
+ right: 0;
89
+ transform: translateX(100%);
90
+ background: linear-gradient(to right, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0));
91
+ }
92
+
93
+ &__cell.is-last-fixed-right::after {
94
+ left: 0;
95
+ transform: translateX(-100%);
96
+ background: linear-gradient(to left, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0));
97
+ }
98
+
99
+ // 表头固定单元格层级高于表体
100
+ &__header th.ts-table__cell--fixed-left,
101
+ &__header th.ts-table__cell--fixed-right {
102
+ z-index: 3;
103
+ background-color: var(--ts-fill-color-lighter);
104
+ }
105
+
106
+ &__footer td.ts-table__cell--fixed-left,
107
+ &__footer td.ts-table__cell--fixed-right {
108
+ z-index: 2;
109
+ background-color: var(--ts-bg-color);
110
+ }
111
+ }
112
+
113
+ // 多级表头 / 树形数据 / 列宽拖拽
114
+ .ts-table {
115
+ &__header th {
116
+ position: relative;
117
+ vertical-align: middle;
118
+ }
119
+
120
+ &__header th.ts-table__cell--group {
121
+ text-align: center;
122
+ font-weight: $font-weight-primary;
123
+ }
124
+
125
+ &__cell-inner {
126
+ display: flex;
127
+ align-items: center;
128
+ }
129
+
130
+ // 树形展开箭头
131
+ &__tree-expand,
132
+ &__tree-placeholder {
133
+ display: inline-flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ flex: 0 0 16px;
137
+ width: 16px;
138
+ height: 16px;
139
+ margin-right: 4px;
140
+ }
141
+
142
+ &__tree-expand {
143
+ cursor: pointer;
144
+ color: var(--ts-text-color-secondary);
145
+ transition: transform 0.2s;
146
+
147
+ &::before {
148
+ content: '';
149
+ width: 0;
150
+ height: 0;
151
+ border-style: solid;
152
+ border-width: 4px 0 4px 6px;
153
+ border-color: transparent transparent transparent currentColor;
154
+ }
155
+
156
+ &.is-expanded {
157
+ transform: rotate(90deg);
158
+ }
159
+ }
160
+
161
+ // 列宽拖拽分隔条
162
+ &__resize-handle {
163
+ position: absolute;
164
+ top: 0;
165
+ right: 0;
166
+ width: 6px;
167
+ height: 100%;
168
+ cursor: col-resize;
169
+ user-select: none;
170
+ z-index: 4;
171
+
172
+ &:hover {
173
+ background-color: var(--ts-color-primary-light-5);
174
+ }
175
+ }
176
+
177
+ &--resizable &__header th {
178
+ user-select: none;
179
+ }
180
+ }
181
+
182
+ // 自定义滚动条(nativeScrollbar = false):隐藏原生滚动条但保留滚动能力
183
+ .ts-table--custom-scrollbar {
184
+ -ms-overflow-style: none;
185
+ scrollbar-width: none;
186
+
187
+ &::-webkit-scrollbar {
188
+ width: 0;
189
+ height: 0;
190
+ }
191
+ }