@w-run/wdesign-ui 0.0.0-stage → 1.0.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/README.md +174 -2
- package/dist/index.d.ts +83 -0
- package/dist/style/ai-msg.css +187 -0
- package/dist/style/alert.css +64 -0
- package/dist/style/audio.css +1363 -0
- package/dist/style/avatar.css +88 -0
- package/dist/style/badge.css +48 -0
- package/dist/style/breadcrumb.css +54 -0
- package/dist/style/button.css +234 -0
- package/dist/style/card.css +71 -0
- package/dist/style/carousel.css +101 -0
- package/dist/style/checkbox.css +129 -0
- package/dist/style/chevron.css +33 -0
- package/dist/style/collapse.css +69 -0
- package/dist/style/command.css +201 -0
- package/dist/style/container.css +7 -0
- package/dist/style/datepicker.css +205 -0
- package/dist/style/descriptions.css +119 -0
- package/dist/style/divider.css +62 -0
- package/dist/style/dot.css +30 -0
- package/dist/style/drawer.css +145 -0
- package/dist/style/dropdown.css +83 -0
- package/dist/style/empty.css +36 -0
- package/dist/style/explorer.css +336 -0
- package/dist/style/file-list.css +92 -0
- package/dist/style/form.css +96 -0
- package/dist/style/grid.css +4 -0
- package/dist/style/group.css +478 -0
- package/dist/style/icon-btn.css +75 -0
- package/dist/style/image-preview.css +81 -0
- package/dist/style/input.css +119 -0
- package/dist/style/list.css +81 -0
- package/dist/style/markdown.css +312 -0
- package/dist/style/modal.css +164 -0
- package/dist/style/notification.css +52 -0
- package/dist/style/otp.css +139 -0
- package/dist/style/pagination.css +120 -0
- package/dist/style/popconfirm.css +87 -0
- package/dist/style/popover.css +110 -0
- package/dist/style/post-item.css +134 -0
- package/dist/style/progress.css +34 -0
- package/dist/style/radio.css +126 -0
- package/dist/style/rate.css +44 -0
- package/dist/style/result.css +54 -0
- package/dist/style/segmented-picker.css +120 -0
- package/dist/style/segmented.css +190 -0
- package/dist/style/select.css +281 -0
- package/dist/style/skeleton.css +31 -0
- package/dist/style/slider.css +81 -0
- package/dist/style/sortable.css +128 -0
- package/dist/style/space.css +25 -0
- package/dist/style/spinner.css +27 -0
- package/dist/style/statistic.css +44 -0
- package/dist/style/steps.css +100 -0
- package/dist/style/switch.css +95 -0
- package/dist/style/table.css +379 -0
- package/dist/style/tabs.css +167 -0
- package/dist/style/tag.css +97 -0
- package/dist/style/timeline.css +521 -0
- package/dist/style/toast.css +37 -0
- package/dist/style/tooltip.css +45 -0
- package/dist/style/tree.css +189 -0
- package/dist/style/typography.css +66 -0
- package/dist/style/upload.css +169 -0
- package/dist/style/vlist.css +49 -0
- package/dist/style/vplayer.css +846 -0
- package/dist/wdesign-ui.css +10300 -0
- package/dist/wdesign-ui.esm.js +16333 -0
- package/package.json +47 -3
- package/tokens.json +385 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/*
|
|
3
|
+
* Switch:开启态用**深色**,不用主题红。
|
|
4
|
+
*
|
|
5
|
+
* 三条理由:
|
|
6
|
+
* 1. 语义:开关表达"这个设置被打开了",不含任何警告意味。
|
|
7
|
+
* 红色的另一半语义是 danger,用它会让"开启通知"看起来像危险操作。
|
|
8
|
+
* 2. 面积:54×33 是组件库里少见的**大面积填充**。
|
|
9
|
+
* 主色应当"少而精",铺满一块控件就不叫点睛了。
|
|
10
|
+
* 3. 一致性:Checkbox / Radio / Tabs / Segmented / Nav 的选中态
|
|
11
|
+
* 都已经是深色(或中性浮起),只有 Switch 还是红的,显得割裂。
|
|
12
|
+
*
|
|
13
|
+
* 主题红仍保留给"你在这里"的位置标记:当前步骤、当前页码、
|
|
14
|
+
* Carousel 当前点、DatePicker 选中日 —— 那些是低频、小面积、
|
|
15
|
+
* 且确实需要引导视线的场合。
|
|
16
|
+
*/
|
|
17
|
+
.wd-switch {
|
|
18
|
+
position: relative;
|
|
19
|
+
width: 54px;
|
|
20
|
+
height: 33px;
|
|
21
|
+
flex: none;
|
|
22
|
+
padding: 0;
|
|
23
|
+
border: 0;
|
|
24
|
+
border-radius: var(--wd-radius-pill);
|
|
25
|
+
background: var(--wd-ink);
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
transition: background var(--wd-dur) ease;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.wd-switch:focus-visible {
|
|
31
|
+
outline: none;
|
|
32
|
+
box-shadow: 0 0 0 4px var(--wd-focus-ring-soft);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.wd-switch--off {
|
|
36
|
+
background: var(--wd-ink-3);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.wd-switch__knob {
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 3px;
|
|
42
|
+
left: 3px;
|
|
43
|
+
width: 27px;
|
|
44
|
+
height: 27px;
|
|
45
|
+
border-radius: 50%;
|
|
46
|
+
background: #fff;
|
|
47
|
+
box-shadow: var(--wd-shadow-knob);
|
|
48
|
+
transition: transform var(--wd-dur) ease;
|
|
49
|
+
transform: translateX(21px);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.wd-switch--off .wd-switch__knob {
|
|
53
|
+
transform: translateX(0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ---- 微交互(精致版)---- */
|
|
57
|
+
.wd-switch__knob {
|
|
58
|
+
transition: transform var(--wd-dur) var(--wd-ease-spring);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media (hover: hover) {
|
|
62
|
+
.wd-switch:not(.wd-switch--off):hover {
|
|
63
|
+
box-shadow: 0 0 0 4px var(--wd-ink-5);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/* JS 增强(addHover):同一份声明,由 .is-hover 驱动,不受 hover 媒体查询限制 */
|
|
67
|
+
.wd-switch:not(.wd-switch--off).is-hover {
|
|
68
|
+
box-shadow: 0 0 0 4px var(--wd-ink-5);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (hover: hover) {
|
|
72
|
+
.wd-switch--off:hover {
|
|
73
|
+
box-shadow: 0 0 0 4px var(--wd-ring-soft);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.wd-switch--off.is-hover {
|
|
77
|
+
box-shadow: 0 0 0 4px var(--wd-ring-soft);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* toggle 后外环脉冲 —— 通过两个不同名的动画随类切换重新触发 */
|
|
81
|
+
.wd-switch::after {
|
|
82
|
+
content: "";
|
|
83
|
+
position: absolute;
|
|
84
|
+
inset: -4px;
|
|
85
|
+
border-radius: inherit;
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.wd-switch:not(.wd-switch--off)::after {
|
|
90
|
+
animation: wd-switch-ring-on var(--wd-dur-slow) var(--wd-ease-out);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.wd-switch--off::after {
|
|
94
|
+
animation: wd-switch-ring-off var(--wd-dur-slow) var(--wd-ease-out);
|
|
95
|
+
}
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.wd-table-wrap {
|
|
3
|
+
background: var(--wd-card);
|
|
4
|
+
border-radius: var(--wd-radius-md);
|
|
5
|
+
overflow-x: auto;
|
|
6
|
+
overflow-y: hidden;
|
|
7
|
+
box-shadow: var(--wd-shadow);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.wd-table-wrap::-webkit-scrollbar {
|
|
11
|
+
height: 4px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.wd-table-wrap::-webkit-scrollbar-thumb {
|
|
15
|
+
background: var(--wd-ink-3);
|
|
16
|
+
border-radius: 999px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* 宽度策略:**内容少时撑满,内容多时横向滚动**。
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ 之前写的是 `width: max-content; min-width: 100%` ——
|
|
23
|
+
* 方向反了:max-content 让表格永远只占内容宽度,
|
|
24
|
+
* 列少时右侧会空出一大片,看起来像"表格没做满"。
|
|
25
|
+
*
|
|
26
|
+
* 正确写法:`width: 100%` 撑满容器,
|
|
27
|
+
* 再用 `min-width: max-content` 保证内容超宽时不被压缩
|
|
28
|
+
* (配合外层 .wd-table-wrap 的 overflow-x: auto 实现横向滚动)。
|
|
29
|
+
*/
|
|
30
|
+
.wd-table {
|
|
31
|
+
width: 100%;
|
|
32
|
+
min-width: max-content;
|
|
33
|
+
border-collapse: separate;
|
|
34
|
+
border-spacing: 0;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.wd-table th {
|
|
39
|
+
padding: 13px 16px;
|
|
40
|
+
text-align: left;
|
|
41
|
+
font-size: 12.5px;
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
color: var(--wd-ink-2);
|
|
44
|
+
background: var(--wd-bg);
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.wd-table td {
|
|
49
|
+
padding: 14px 16px;
|
|
50
|
+
color: var(--wd-ink);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.wd-table tbody tr {
|
|
54
|
+
transition: background var(--wd-dur-fast) ease;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.wd-table--striped tbody tr:nth-child(even) {
|
|
58
|
+
background: var(--wd-bg);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media (hover: hover) {
|
|
62
|
+
.wd-table tbody tr:hover {
|
|
63
|
+
background: var(--wd-tint-1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/* JS 增强(addHover):同一份声明,由 .is-hover 驱动,不受 hover 媒体查询限制 */
|
|
67
|
+
.wd-table tbody tr.is-hover {
|
|
68
|
+
background: var(--wd-tint-1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.wd-table__th {
|
|
72
|
+
cursor: default;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.wd-table__th--sort {
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
user-select: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@media (hover: hover) {
|
|
81
|
+
.wd-table__th--sort:hover {
|
|
82
|
+
color: var(--wd-red-text);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.wd-table__th--sort.is-hover {
|
|
86
|
+
color: var(--wd-red-text);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.wd-table__sort {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
margin-left: 5px;
|
|
92
|
+
vertical-align: middle;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.wd-table__empty {
|
|
96
|
+
padding: 42px 20px;
|
|
97
|
+
text-align: center;
|
|
98
|
+
font-size: 13.5px;
|
|
99
|
+
color: var(--wd-ink-2);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ---- 勾选列 ---- */
|
|
103
|
+
/*
|
|
104
|
+
* 表格勾选框 → 圆形 + 与 WdCheckbox 同一套视觉。
|
|
105
|
+
*
|
|
106
|
+
* ⚠️ 之前是 6px 圆角方块 + 选中时 --wd-red:
|
|
107
|
+
* · 方形与全站「圆形优先」冲突
|
|
108
|
+
* · 红色让"选中一行"读起来像危险操作
|
|
109
|
+
* 现在与 tree / transfer / checkbox 保持一致:
|
|
110
|
+
* 未选 = 空心描边,已选 = 深色实心 + 白勾。
|
|
111
|
+
*/
|
|
112
|
+
.wd-table__check {
|
|
113
|
+
display: inline-flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
width: 18px;
|
|
117
|
+
height: 18px;
|
|
118
|
+
padding: 0;
|
|
119
|
+
border: 0;
|
|
120
|
+
border-radius: 50%;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
background: transparent;
|
|
123
|
+
box-shadow: inset 0 0 0 1.5px var(--wd-ink-4);
|
|
124
|
+
color: #fff;
|
|
125
|
+
transition: background var(--wd-dur-fast) var(--wd-ease-out), box-shadow var(--wd-dur-fast) var(--wd-ease-out);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (hover: hover) {
|
|
129
|
+
.wd-table__check:hover {
|
|
130
|
+
box-shadow: inset 0 0 0 1.5px var(--wd-ink-3);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
.wd-table__check--on,
|
|
134
|
+
.wd-table__check--part {
|
|
135
|
+
background: var(--wd-ink);
|
|
136
|
+
box-shadow: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.wd-table__row--checked {
|
|
140
|
+
background: var(--wd-tint-1);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@media (hover: hover) {
|
|
144
|
+
.wd-table__row--checked:hover {
|
|
145
|
+
background: var(--wd-field-hover);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/* ---- 加载遮罩 ---- */
|
|
149
|
+
.wd-table-wrap {
|
|
150
|
+
position: relative;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.wd-table-wrap--loading {
|
|
154
|
+
min-height: 120px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.wd-table-wrap--loading .wd-table {
|
|
158
|
+
opacity: 0.45;
|
|
159
|
+
pointer-events: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.wd-table__loading {
|
|
163
|
+
position: absolute;
|
|
164
|
+
inset: 0;
|
|
165
|
+
display: flex;
|
|
166
|
+
flex-direction: column;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
gap: 10px;
|
|
170
|
+
font-size: 13px;
|
|
171
|
+
color: var(--wd-ink-2);
|
|
172
|
+
background: color-mix(in srgb, var(--wd-card) 55%, transparent);
|
|
173
|
+
border-radius: inherit;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* =============================================================
|
|
177
|
+
* 增强:尺寸 / 固定列 / 树形 / 行展开
|
|
178
|
+
* ============================================================= */
|
|
179
|
+
/* ---------------- 展开列 / 勾选列固定宽度 ---------------- */
|
|
180
|
+
/*
|
|
181
|
+
* ⚠️ 这两列的宽度必须与 JS 里计算固定列偏移时用的一致
|
|
182
|
+
* (leftOffsets 里按 40 / 44 累加)。改这里要同步改 WdTable.vue 的常量。
|
|
183
|
+
*/
|
|
184
|
+
.wd-table__th--expand,
|
|
185
|
+
.wd-table__td--expand {
|
|
186
|
+
width: 40px;
|
|
187
|
+
min-width: 40px;
|
|
188
|
+
max-width: 40px;
|
|
189
|
+
padding-left: 10px !important;
|
|
190
|
+
padding-right: 0 !important;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.wd-table__th--check,
|
|
194
|
+
.wd-table__td--check {
|
|
195
|
+
width: 44px;
|
|
196
|
+
min-width: 44px;
|
|
197
|
+
max-width: 44px;
|
|
198
|
+
padding-left: 8px !important;
|
|
199
|
+
padding-right: 8px !important;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* ---------------- 尺寸 ---------------- */
|
|
203
|
+
.wd-table--sm th,
|
|
204
|
+
.wd-table--sm td {
|
|
205
|
+
padding: 9px 12px;
|
|
206
|
+
font-size: 12.5px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* ---------------- 固定列 ---------------- */
|
|
210
|
+
/*
|
|
211
|
+
* 固定列必须有不透明背景,否则下方滚动的单元格会透出来。
|
|
212
|
+
* ⚠️ 不能只用 background: var(--wd-bg) —— 斑马纹行有自己的底色,
|
|
213
|
+
* 固定列如果写死背景色,会与斑马纹错位。
|
|
214
|
+
* 这里用 inherit 让固定列跟随行的背景(行有底色时继承行的)。
|
|
215
|
+
*/
|
|
216
|
+
.wd-table-wrap--fixed .wd-table__th--fixed-left,
|
|
217
|
+
.wd-table-wrap--fixed .wd-table__th--fixed-right {
|
|
218
|
+
background: var(--wd-card);
|
|
219
|
+
/* 表头层级最高,压住固定单元格 */
|
|
220
|
+
z-index: 4;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.wd-table-wrap--fixed .wd-table__td--fixed-left,
|
|
224
|
+
.wd-table-wrap--fixed .wd-table__td--fixed-right {
|
|
225
|
+
background: inherit;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.wd-table-wrap--fixed tbody tr {
|
|
229
|
+
/* 固定列 inherit 的基准 */
|
|
230
|
+
background-color: var(--wd-card);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.wd-table-wrap--fixed.wd-table--striped tbody tr:nth-child(even),
|
|
234
|
+
.wd-table-wrap--fixed .wd-table--striped tbody tr:nth-child(even) {
|
|
235
|
+
background-color: var(--wd-bg);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/*
|
|
239
|
+
* 固定列边缘的阴影:暗示"这里可以横向滚动,内容在下面"。
|
|
240
|
+
* 只在有固定列的一侧加,两侧都有就各加一条。
|
|
241
|
+
*/
|
|
242
|
+
.wd-table__th--fixed-left::after,
|
|
243
|
+
.wd-table__td--fixed-left::after {
|
|
244
|
+
content: "";
|
|
245
|
+
position: absolute;
|
|
246
|
+
top: 0;
|
|
247
|
+
bottom: 0;
|
|
248
|
+
right: -6px;
|
|
249
|
+
width: 6px;
|
|
250
|
+
pointer-events: none;
|
|
251
|
+
background: linear-gradient(to right, rgba(0, 0, 0, 0.06), transparent);
|
|
252
|
+
opacity: 0;
|
|
253
|
+
transition: opacity var(--wd-dur-fast) ease;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.wd-table__th--fixed-right::after,
|
|
257
|
+
.wd-table__td--fixed-right::after {
|
|
258
|
+
content: "";
|
|
259
|
+
position: absolute;
|
|
260
|
+
top: 0;
|
|
261
|
+
bottom: 0;
|
|
262
|
+
left: -6px;
|
|
263
|
+
width: 6px;
|
|
264
|
+
pointer-events: none;
|
|
265
|
+
background: linear-gradient(to left, rgba(0, 0, 0, 0.06), transparent);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* 只在滚动时显示阴影 —— 停在最左/最右时不该有 */
|
|
269
|
+
.wd-table-tbl--scrolled-x .wd-table__td--fixed-left::after {
|
|
270
|
+
opacity: 1;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* ---------------- 省略号 ---------------- */
|
|
274
|
+
.wd-table__th--ellipsis,
|
|
275
|
+
.wd-table__td--ellipsis {
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
text-overflow: ellipsis;
|
|
278
|
+
white-space: nowrap;
|
|
279
|
+
max-width: 0; /* 配合 table-layout:fixed 才能生效 */
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* ---------------- 树形 ---------------- */
|
|
283
|
+
.wd-table__indent {
|
|
284
|
+
display: inline-flex;
|
|
285
|
+
align-items: center;
|
|
286
|
+
vertical-align: middle;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.wd-table__tree-toggle {
|
|
290
|
+
display: inline-flex;
|
|
291
|
+
align-items: center;
|
|
292
|
+
justify-content: center;
|
|
293
|
+
width: 20px;
|
|
294
|
+
height: 20px;
|
|
295
|
+
padding: 0;
|
|
296
|
+
margin-right: 4px;
|
|
297
|
+
border: 0;
|
|
298
|
+
/* 图标按钮 → 圆形 */
|
|
299
|
+
border-radius: 50%;
|
|
300
|
+
background: transparent;
|
|
301
|
+
color: var(--wd-ink-3);
|
|
302
|
+
cursor: pointer;
|
|
303
|
+
transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.wd-table__tree-toggle:hover {
|
|
307
|
+
background: var(--wd-field-hover);
|
|
308
|
+
color: var(--wd-ink);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.wd-table__tree-toggle svg {
|
|
312
|
+
transition: transform var(--wd-dur-fast) var(--wd-ease-out);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.wd-table__tree-toggle.is-open svg {
|
|
316
|
+
transform: rotate(90deg);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* 叶子节点的占位:与箭头同宽,保证同级文字左对齐 */
|
|
320
|
+
.wd-table__tree-spacer {
|
|
321
|
+
display: inline-block;
|
|
322
|
+
width: 18px;
|
|
323
|
+
margin-right: 4px;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/* ---------------- 行展开 ---------------- */
|
|
327
|
+
.wd-table__expander {
|
|
328
|
+
display: inline-flex;
|
|
329
|
+
align-items: center;
|
|
330
|
+
justify-content: center;
|
|
331
|
+
width: 22px;
|
|
332
|
+
height: 22px;
|
|
333
|
+
padding: 0;
|
|
334
|
+
border: 0;
|
|
335
|
+
/* 图标按钮 → 圆形 */
|
|
336
|
+
border-radius: 50%;
|
|
337
|
+
background: transparent;
|
|
338
|
+
color: var(--wd-ink-3);
|
|
339
|
+
cursor: pointer;
|
|
340
|
+
transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.wd-table__expander:hover {
|
|
344
|
+
background: var(--wd-field-hover);
|
|
345
|
+
color: var(--wd-ink);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.wd-table__expander svg {
|
|
349
|
+
transition: transform var(--wd-dur-fast) var(--wd-ease-out);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.wd-table__expander.is-open svg {
|
|
353
|
+
transform: rotate(90deg);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.wd-table__row--expanded {
|
|
357
|
+
background: var(--wd-tint-1);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/*
|
|
361
|
+
* 展开详情行:
|
|
362
|
+
* 用浅底 + 内缩,明确表示"这一块属于上一行"。
|
|
363
|
+
* 不加边框 —— 本库无边框。
|
|
364
|
+
*/
|
|
365
|
+
.wd-table__expand-row td {
|
|
366
|
+
padding: 0;
|
|
367
|
+
background: var(--wd-bg);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.wd-table__expand-cell {
|
|
371
|
+
padding: 14px 18px !important;
|
|
372
|
+
font-size: 13px;
|
|
373
|
+
color: var(--wd-ink-2);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.wd-table__expand-empty {
|
|
377
|
+
color: var(--wd-ink-3);
|
|
378
|
+
font-size: 12.5px;
|
|
379
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.wd-tabs {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
gap: 4px;
|
|
6
|
+
padding: 5px;
|
|
7
|
+
background: var(--wd-field);
|
|
8
|
+
border-radius: var(--wd-radius-pill);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* 选中滑块:与 WdSegmented 同一套实现与观感。
|
|
13
|
+
*
|
|
14
|
+
* Tabs 之前只有"选中项换底色",切换是硬切;
|
|
15
|
+
* 而 Segmented(视觉几乎相同)有平滑滑动 —— 两者行为不一致。
|
|
16
|
+
* 这里补上滑动块,让同属"分段切换"的两个组件体验统一。
|
|
17
|
+
*/
|
|
18
|
+
.wd-tabs__slider {
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 5px;
|
|
21
|
+
left: 0;
|
|
22
|
+
z-index: 0;
|
|
23
|
+
border-radius: var(--wd-radius-pill);
|
|
24
|
+
background: var(--wd-card);
|
|
25
|
+
box-shadow: var(--wd-shadow-sm);
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
transition: transform var(--wd-dur-slow) cubic-bezier(0.25, 0.8, 0.35, 1), width var(--wd-dur-slow) cubic-bezier(0.25, 0.8, 0.35, 1), height var(--wd-dur-slow) cubic-bezier(0.25, 0.8, 0.35, 1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* 首帧落位:禁用过渡,避免页面加载时滑块"滑进来" */
|
|
31
|
+
.wd-tabs__slider.is-initial {
|
|
32
|
+
transition: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.wd-tabs--block {
|
|
36
|
+
display: flex;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.wd-tabs--block .wd-tabs__item {
|
|
41
|
+
flex: 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.wd-tabs__item {
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
padding: 9px 18px;
|
|
49
|
+
border: 0;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
background: transparent;
|
|
52
|
+
border-radius: var(--wd-radius-pill);
|
|
53
|
+
font: inherit;
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
color: var(--wd-ink-2);
|
|
57
|
+
transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease, box-shadow var(--wd-dur-fast) ease;
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media (hover: hover) {
|
|
62
|
+
.wd-tabs__item:hover {
|
|
63
|
+
color: var(--wd-ink);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/* JS 增强(addHover):同一份声明,由 .is-hover 驱动,不受 hover 媒体查询限制 */
|
|
67
|
+
.wd-tabs__item.is-hover {
|
|
68
|
+
color: var(--wd-ink);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.wd-tabs__item:focus-visible {
|
|
72
|
+
outline: none;
|
|
73
|
+
box-shadow: 0 0 0 4px var(--wd-focus-ring-soft);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
* 选中项:**底色交给滑块**,项本身透明。
|
|
78
|
+
* 若项自己再画一层白底,会与滑块叠成两层,
|
|
79
|
+
* 在圆角处出现一圈阴影加深的白边。
|
|
80
|
+
*/
|
|
81
|
+
.wd-tabs__item {
|
|
82
|
+
position: relative;
|
|
83
|
+
z-index: 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.wd-tabs__item--active {
|
|
87
|
+
background: transparent;
|
|
88
|
+
color: var(--wd-ink);
|
|
89
|
+
box-shadow: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ---- 微交互(精致版)---- */
|
|
93
|
+
/* 激活项弹入:只在「已就绪」后播放。
|
|
94
|
+
首屏渲染时激活项本就在位,再弹一次会让人觉得页面在抖。 */
|
|
95
|
+
.wd-tabs--anim-ready .wd-tabs__item--active {
|
|
96
|
+
animation: wd-bloom var(--wd-dur-fast) var(--wd-ease-out) forwards;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ---- 可关闭 / 可新建 / 可滚动 ---- */
|
|
100
|
+
.wd-tabs--scrollable {
|
|
101
|
+
max-width: 100%;
|
|
102
|
+
overflow-x: auto;
|
|
103
|
+
scrollbar-width: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.wd-tabs--scrollable::-webkit-scrollbar {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.wd-tabs__item {
|
|
111
|
+
position: relative;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.wd-tabs--closable .wd-tabs__item {
|
|
115
|
+
padding-right: 10px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.wd-tabs__label {
|
|
119
|
+
white-space: nowrap;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.wd-tabs__close {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
width: 16px;
|
|
127
|
+
height: 16px;
|
|
128
|
+
margin-left: 6px;
|
|
129
|
+
border-radius: 50%;
|
|
130
|
+
color: var(--wd-ink-2);
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.wd-tabs__close:hover {
|
|
136
|
+
background: var(--wd-field-hover);
|
|
137
|
+
color: var(--wd-red-text);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.wd-tabs__add {
|
|
141
|
+
flex: none;
|
|
142
|
+
display: inline-flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
width: 30px;
|
|
146
|
+
height: 30px;
|
|
147
|
+
margin-left: 4px;
|
|
148
|
+
padding: 0;
|
|
149
|
+
border: 0;
|
|
150
|
+
border-radius: 50%;
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
background: transparent;
|
|
153
|
+
color: var(--wd-ink-2);
|
|
154
|
+
transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@media (hover: hover) {
|
|
158
|
+
.wd-tabs__add:hover {
|
|
159
|
+
background: var(--wd-field-hover);
|
|
160
|
+
color: var(--wd-red-text);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
.wd-tabs__item--disabled {
|
|
164
|
+
opacity: 0.45;
|
|
165
|
+
cursor: default;
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
}
|