@xihan-ui/styles 1.1.0 → 2.1.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/CHANGELOG.md +5055 -6
- package/README.md +22 -2
- package/component-tokens.d.ts +4197 -0
- package/component-tokens.js +2 -0
- package/components.tokens.json +79785 -0
- package/css/accordion.css +131 -75
- package/css/affix.css +16 -1
- package/css/alert.css +114 -67
- package/css/anchor.css +99 -27
- package/css/approval.css +461 -0
- package/css/avatar-group.css +14 -6
- package/css/avatar.css +33 -9
- package/css/back-top.css +103 -48
- package/css/badge.css +42 -14
- package/css/bar-code.css +62 -0
- package/css/breadcrumb.css +40 -21
- package/css/button-group.css +146 -24
- package/css/button.css +116 -99
- package/css/calendar-picker.css +448 -0
- package/css/calendar-range-picker.css +517 -0
- package/css/card.css +54 -77
- package/css/carousel.css +412 -68
- package/css/cascader.css +427 -246
- package/css/checkbox-group.css +225 -77
- package/css/checkbox.css +174 -37
- package/css/clipboard.css +266 -47
- package/css/code-view.css +279 -0
- package/css/collapsible.css +108 -63
- package/css/color-field.css +158 -0
- package/css/color-picker.css +170 -184
- package/css/color-slider.css +274 -0
- package/css/color-swatch-picker.css +243 -0
- package/css/color-swatch.css +35 -0
- package/css/combobox.css +265 -273
- package/css/command.css +397 -0
- package/css/context-menu.css +181 -108
- package/css/date-field.css +94 -121
- package/css/date-picker.css +484 -249
- package/css/date-range-picker.css +557 -0
- package/css/description.css +51 -0
- package/css/descriptions.css +133 -87
- package/css/dialog.css +245 -68
- package/css/diff-view.css +428 -0
- package/css/download-trigger.css +155 -46
- package/css/drawer.css +188 -111
- package/css/editable.css +172 -152
- package/css/empty-state.css +80 -11
- package/css/field-array.css +190 -0
- package/css/field.css +84 -31
- package/css/fieldset.css +51 -18
- package/css/file-upload.css +134 -36
- package/css/flex.css +20 -1
- package/css/float-button.css +238 -57
- package/css/floating-panel.css +171 -92
- package/css/focus.css +46 -0
- package/css/forced-colors.css +93 -0
- package/css/form.css +254 -77
- package/css/gradient-text.css +34 -10
- package/css/grid.css +516 -5
- package/css/heatmap.css +87 -29
- package/css/highlight.css +20 -5
- package/css/hover-card.css +95 -47
- package/css/icon-wrapper.css +15 -3
- package/css/icon.css +74 -8
- package/css/image-cropper.css +143 -29
- package/css/image-viewer.css +148 -89
- package/css/image.css +30 -1
- package/css/infinite-scroll.css +51 -1
- package/css/input-group.css +277 -0
- package/css/json-viewer.css +102 -45
- package/css/kbd.css +72 -0
- package/css/label.css +78 -0
- package/css/layers.css +5 -0
- package/css/layout.css +175 -31
- package/css/list.css +24 -3
- package/css/listbox.css +215 -65
- package/css/loading-bar.css +52 -3
- package/css/log.css +144 -9
- package/css/markdown-stream.css +149 -0
- package/css/marquee.css +27 -1
- package/css/masonry.css +7 -0
- package/css/matrix-code.css +67 -0
- package/css/mention.css +232 -152
- package/css/menu.css +178 -83
- package/css/menubar.css +202 -136
- package/css/message-feed.css +197 -0
- package/css/navigation-menu.css +142 -90
- package/css/notification.css +178 -100
- package/css/number-animation.css +7 -0
- package/css/number-field.css +120 -277
- package/css/overlay-arrow.css +12 -7
- package/css/page-header.css +99 -14
- package/css/pagination.css +173 -135
- package/css/password-input.css +222 -219
- package/css/pin-input.css +101 -67
- package/css/pointer.css +36 -0
- package/css/popconfirm.css +182 -93
- package/css/popover.css +119 -77
- package/css/progress.css +60 -12
- package/css/prompt-input.css +224 -0
- package/css/question-flow.css +513 -0
- package/css/radio-group.css +147 -30
- package/css/rating.css +193 -43
- package/css/reasoning.css +336 -0
- package/css/reset.css +84 -6
- package/css/resizable.css +143 -19
- package/css/scroll-area.css +68 -7
- package/css/scrollbar.css +47 -13
- package/css/segmented.css +94 -29
- package/css/select.css +286 -274
- package/css/separator.css +101 -1
- package/css/side-nav.css +131 -75
- package/css/signature-pad.css +74 -54
- package/css/skeleton.css +84 -11
- package/css/slider.css +132 -39
- package/css/sortable.css +123 -28
- package/css/spinner.css +126 -12
- package/css/splitter.css +29 -8
- package/css/statistic.css +55 -0
- package/css/steps.css +206 -72
- package/css/switch.css +268 -36
- package/css/table.css +429 -143
- package/css/tabs.css +475 -52
- package/css/tag-group.css +223 -0
- package/css/tag.css +118 -28
- package/css/tags-input.css +156 -274
- package/css/text-field.css +101 -249
- package/css/time-field.css +100 -128
- package/css/time-picker.css +321 -252
- package/css/time-range-picker.css +717 -0
- package/css/timeline.css +202 -68
- package/css/timer.css +56 -52
- package/css/timestamp.css +34 -0
- package/css/toast.css +373 -144
- package/css/toggle-group.css +309 -76
- package/css/toggle.css +116 -85
- package/css/tone.css +47 -0
- package/css/tool-call.css +421 -0
- package/css/toolbar.css +181 -33
- package/css/tooltip.css +105 -36
- package/css/tour.css +181 -152
- package/css/transfer.css +351 -138
- package/css/tree-select.css +321 -216
- package/css/tree.css +172 -122
- package/css/truncate.css +65 -0
- package/css/typography.css +228 -5
- package/css/undefined.css +10 -1
- package/css/virtualizer.css +9 -10
- package/css/visually-hidden.css +7 -0
- package/css/watermark.css +7 -0
- package/family/action-control.css +487 -0
- package/family/collection-item.css +770 -0
- package/family/field-chrome.css +298 -0
- package/family/motion.css +166 -0
- package/family/swatch.css +59 -0
- package/index.css +41658 -128
- package/index.unlayered.css +33356 -17825
- package/package.json +49 -17
- package/css/calendar.css +0 -367
- package/css/code-block.css +0 -91
- package/css/composer.css +0 -134
- package/css/countdown.css +0 -26
- package/css/dynamic-input.css +0 -220
- package/css/ellipsis.css +0 -52
- package/css/hotkeys.css +0 -90
- package/css/popselect.css +0 -391
- package/css/qr-code.css +0 -55
- package/css/result.css +0 -119
- package/css/space.css +0 -117
- package/css/thread.css +0 -120
- package/css/time.css +0 -25
package/css/tree-select.css
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
from {
|
|
6
|
-
opacity: 0;
|
|
7
|
-
scale: var(--xh-motion-scale-enter);
|
|
8
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-Present XiHanFun and contributors.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
|
4
|
+
*/
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
@keyframes xh-pop-out {
|
|
16
|
-
from {
|
|
17
|
-
opacity: 1;
|
|
18
|
-
scale: 1;
|
|
19
|
-
}
|
|
6
|
+
/* TreeSelect 独立皮肤同时传递引入字段视觉盒、字段内动作与浮层集合行;full bundle 递归去重。 */
|
|
7
|
+
@import '../family/field-chrome.css';
|
|
8
|
+
@import '../family/action-control.css';
|
|
9
|
+
@import '../family/collection-item.css';
|
|
20
10
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
scale: var(--xh-motion-scale-enter);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
11
|
+
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
|
|
12
|
+
@import '../family/motion.css';
|
|
27
13
|
|
|
28
14
|
@layer xihan.components {
|
|
29
15
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
@@ -36,12 +22,23 @@
|
|
|
36
22
|
/* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,内容层继承它限高;
|
|
37
23
|
引擎没算(尚未落位 / 无引擎)时不额外限高 */
|
|
38
24
|
--xh-_tree-select-available-h: 100vh;
|
|
25
|
+
/* 落定那一侧的可用宽度,同样由定位引擎经内联自定义属性写进来,行内轴据此夹取;
|
|
26
|
+
引擎没算(尚未落位 / 无引擎 / 贴边归零)时退到视口宽 */
|
|
27
|
+
--xh-_tree-select-available-w: 100vw;
|
|
28
|
+
/* 触发器实测宽度,由定位引擎经内联自定义属性写进来,内容层拿它当最小宽的下界;
|
|
29
|
+
引擎没算(尚未落位 / 无引擎)时为 0,max 取静态档,等于不抬宽 */
|
|
30
|
+
--xh-_tree-select-anchor-w: 0px;
|
|
31
|
+
/* 独立浮层先截断祖先方向,再按自身 placement 开启一侧。 */
|
|
32
|
+
--xh-_overlay-enter-up: 0;
|
|
33
|
+
--xh-_overlay-enter-down: 0;
|
|
34
|
+
--xh-_overlay-enter-left: 0;
|
|
35
|
+
--xh-_overlay-enter-right: 0;
|
|
39
36
|
|
|
40
37
|
/* 树的自绘条浮在内容之上:轨道不上底色,实色轨道会沿内容边缘糊出一条灰带 */
|
|
41
38
|
--xh-scrollbar-track-bg: transparent;
|
|
42
39
|
|
|
43
40
|
position: fixed;
|
|
44
|
-
z-index: var(--xh-tree-select-layer, var(--xh-layer-popover));
|
|
41
|
+
z-index: var(--xh-tree-select-layer, var(--xh-_layer, var(--xh-layer-popover)));
|
|
45
42
|
/* 空壳不吃指针,交互只发生在 content 里 */
|
|
46
43
|
pointer-events: none;
|
|
47
44
|
}
|
|
@@ -51,31 +48,41 @@
|
|
|
51
48
|
visibility: hidden;
|
|
52
49
|
}
|
|
53
50
|
|
|
51
|
+
/* 位移按实际落位的物理方向给,不随书写方向翻转。 */
|
|
52
|
+
[data-scope='tree-select'][data-part='positioner'][data-placement^='top'] {
|
|
53
|
+
--xh-_overlay-enter-down: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[data-scope='tree-select'][data-part='positioner'][data-placement^='bottom'] {
|
|
57
|
+
--xh-_overlay-enter-up: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-scope='tree-select'][data-part='positioner'][data-placement^='left'] {
|
|
61
|
+
--xh-_overlay-enter-right: 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[data-scope='tree-select'][data-part='positioner'][data-placement^='right'] {
|
|
65
|
+
--xh-_overlay-enter-left: 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
54
68
|
/* 私有槽同时声明在根与 positioner 上:浮层被搬到 portal 落点,不是根的后代,继承不过去 */
|
|
55
69
|
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner']) {
|
|
56
|
-
/*
|
|
70
|
+
/* 作者塞进触发器指示符槽 / 清除钮的图标跟着尺寸档走,与皮肤画的兜底字形同一把尺。这支只管作者放进
|
|
71
|
+
盒与行里的图标:面板里自绘的状态字形(展开方向、行尾对号与半选杠)是指示符,各部件在自己身上
|
|
72
|
+
把 --xh-icon-size 改接到 --xh-control-indicator-* 一族的盒尺 */
|
|
57
73
|
--xh-icon-size: var(--xh-tree-select-icon-size, var(--xh-glyph-size-md));
|
|
58
74
|
|
|
59
|
-
/*
|
|
75
|
+
/* 尺寸档只换这几个私有槽,盒与树里的行都从这两处继承它们,换档不必给每个部件各写一条选择器;
|
|
76
|
+
形态三档由家族按 control 上的 data-variant 生成,浮层与树不跟着变,皮肤不再声明 */
|
|
60
77
|
--xh-_tree-select-h: var(--xh-control-h-md);
|
|
61
78
|
--xh-_tree-select-px: var(--xh-control-px-md);
|
|
62
79
|
--xh-_tree-select-row-py: var(--xh-list-option-py-md);
|
|
63
80
|
--xh-_tree-select-row-px: var(--xh-control-px-md);
|
|
64
81
|
--xh-_tree-select-gap: var(--xh-control-gap-md);
|
|
65
82
|
--xh-_tree-select-font-size: var(--xh-control-font-md);
|
|
66
|
-
--xh-_tree-select-label-font-size: var(--xh-control-font-md);
|
|
67
|
-
|
|
68
|
-
/* 形态档只换触发框的描边与底色这三个槽,浮层与树不跟着变:
|
|
69
|
-
变的是「这是个输入位」的表达方式,不是弹出内容的表达方式 */
|
|
70
|
-
--xh-_tree-select-border: var(--xh-border-control);
|
|
71
|
-
--xh-_tree-select-border-hover: var(--xh-border-control-hover);
|
|
72
|
-
--xh-_tree-select-bg: var(--xh-bg-canvas);
|
|
73
83
|
|
|
74
|
-
/*
|
|
75
|
-
--xh-_tree-select-
|
|
76
|
-
|
|
77
|
-
/* 聚焦环恒用固定环色;校验失败时换成告警环色 */
|
|
78
|
-
--xh-_tree-select-ring: var(--xh-ring-focus);
|
|
84
|
+
/* 强调色随语气走,只落在勾选标记上;没写 data-tone 时退回品牌色 */
|
|
85
|
+
--xh-_tree-select-accent: var(--xh-_tone, var(--xh-fg-brand));
|
|
79
86
|
}
|
|
80
87
|
|
|
81
88
|
/* 标签一行、盒一行的两行堆叠 */
|
|
@@ -83,6 +90,12 @@
|
|
|
83
90
|
display: inline-flex;
|
|
84
91
|
flex-direction: column;
|
|
85
92
|
gap: var(--xh-tree-select-gap, var(--xh-space-1));
|
|
93
|
+
|
|
94
|
+
/* 不传尺寸时一律这么宽,宽度不随内容走;父容器给不出这么宽时整件跟着收,地板同步让步,不越出父容器。
|
|
95
|
+
地板不高过缺省宽:使用者把缺省宽钉到底线以下时不必再放开底线 */
|
|
96
|
+
inline-size: var(--xh-tree-select-control-w, var(--xh-control-w));
|
|
97
|
+
min-inline-size: min(var(--xh-tree-select-control-w, var(--xh-control-w)), var(--xh-tree-select-control-min-w, var(--xh-control-min-w)), 100%);
|
|
98
|
+
max-inline-size: 100%;
|
|
86
99
|
}
|
|
87
100
|
|
|
88
101
|
/* 只要声明了 display 就盖掉了 UA 的 [hidden]{display:none},作者手动收起时要自己还回去 */
|
|
@@ -90,29 +103,6 @@
|
|
|
90
103
|
display: none;
|
|
91
104
|
}
|
|
92
105
|
|
|
93
|
-
/* —— 形态 —— */
|
|
94
|
-
/* 形态只决定描边与底色怎么用;用哪族颜色由 data-tone 决定,没写 tone 就沿用原来的中性配色 */
|
|
95
|
-
/* outline 就是缺省那一身:描边加画布底,写出来只为让三档并列可读 */
|
|
96
|
-
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-variant='outline'] {
|
|
97
|
-
--xh-_tree-select-border: var(--xh-border-control);
|
|
98
|
-
--xh-_tree-select-border-hover: var(--xh-border-control-hover);
|
|
99
|
-
--xh-_tree-select-bg: var(--xh-bg-canvas);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* subtle 是填充式:底色接过「这里能点」的表达,描边随之让位 */
|
|
103
|
-
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-variant='subtle'] {
|
|
104
|
-
--xh-_tree-select-border: transparent;
|
|
105
|
-
--xh-_tree-select-border-hover: var(--xh-_tone-border, var(--xh-border-control-hover));
|
|
106
|
-
--xh-_tree-select-bg: var(--xh-_tone-subtle, var(--xh-bg-subtle));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/* 无框:底与常态描边透明,悬停浮出描边,聚焦由焦点环表达 */
|
|
110
|
-
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-variant='ghost'] {
|
|
111
|
-
--xh-_tree-select-border: transparent;
|
|
112
|
-
--xh-_tree-select-border-hover: var(--xh-_tone-border, var(--xh-border-control-hover));
|
|
113
|
-
--xh-_tree-select-bg: transparent;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
106
|
/* —— 尺寸 —— */
|
|
117
107
|
/* 缺省档写在上面的基础规则里 */
|
|
118
108
|
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-size='sm'] {
|
|
@@ -123,7 +113,6 @@
|
|
|
123
113
|
--xh-_tree-select-row-px: var(--xh-control-px-sm);
|
|
124
114
|
--xh-_tree-select-gap: var(--xh-control-gap-sm);
|
|
125
115
|
--xh-_tree-select-font-size: var(--xh-control-font-sm);
|
|
126
|
-
--xh-_tree-select-label-font-size: var(--xh-control-font-sm);
|
|
127
116
|
}
|
|
128
117
|
|
|
129
118
|
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-size='lg'] {
|
|
@@ -134,12 +123,11 @@
|
|
|
134
123
|
--xh-_tree-select-row-px: var(--xh-control-px-lg);
|
|
135
124
|
--xh-_tree-select-gap: var(--xh-control-gap-lg);
|
|
136
125
|
--xh-_tree-select-font-size: var(--xh-control-font-lg);
|
|
137
|
-
--xh-_tree-select-label-font-size: var(--xh-control-font-lg);
|
|
138
126
|
}
|
|
139
127
|
|
|
140
128
|
[data-scope='tree-select'][data-part='label'] {
|
|
141
129
|
color: var(--xh-tree-select-label-fg, var(--xh-fg-default));
|
|
142
|
-
font-size: var(--xh-tree-select-label-font-size, var(--xh-
|
|
130
|
+
font-size: var(--xh-tree-select-label-font-size, var(--xh-text-label-size));
|
|
143
131
|
font-weight: var(--xh-tree-select-label-font-weight, var(--xh-text-label-weight));
|
|
144
132
|
line-height: var(--xh-leading-none);
|
|
145
133
|
}
|
|
@@ -149,56 +137,36 @@
|
|
|
149
137
|
color: var(--xh-fg-subtle);
|
|
150
138
|
}
|
|
151
139
|
|
|
152
|
-
/*
|
|
140
|
+
/* 盒:描边、底色、圆角、控件高度、行内内衬、聚焦环、五态与悬停由 Field Chrome 家族画在这一层,
|
|
141
|
+
触发按钮与清空按钮在里面并排;Tab 停靠点是盒里的 trigger(展开后才移进树里),环由家族的
|
|
142
|
+
:focus-within 画在盒上。组件只映射既有公开槽(shadow 缺省 none:字段静息描边式、无影);盒里是按钮 */
|
|
153
143
|
[data-scope='tree-select'][data-part='control'] {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
gap: var(--xh-tree-select-control-gap, var(--xh-_tree-select-gap));
|
|
157
|
-
min-inline-size: var(--xh-tree-select-control-min-w, var(--xh-control-min-w));
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
144
|
+
--xh-field-control-height: var(--xh-tree-select-control-h, var(--xh-_tree-select-h));
|
|
145
|
+
--xh-field-control-padding-inline: var(--xh-tree-select-control-px, var(--xh-_tree-select-px));
|
|
146
|
+
--xh-field-control-gap: var(--xh-tree-select-control-gap, var(--xh-_tree-select-gap));
|
|
147
|
+
--xh-field-control-min-inline-size: var(--xh-tree-select-control-min-w, var(--xh-control-min-w));
|
|
148
|
+
--xh-field-control-radius: var(--xh-tree-select-control-radius, var(--xh-shape-control));
|
|
149
|
+
--xh-field-bg-rest: var(--xh-tree-select-control-bg, var(--xh-_field-variant-bg-rest));
|
|
150
|
+
--xh-field-bg-hover: var(--xh-tree-select-control-bg-hover, var(--xh-_field-variant-bg-hover));
|
|
151
|
+
--xh-field-bg-read-only: var(--xh-tree-select-control-bg-readonly, var(--xh-_field-variant-bg-read-only));
|
|
152
|
+
--xh-field-bg-disabled: var(--xh-tree-select-control-bg-disabled, var(--xh-_field-variant-bg-disabled));
|
|
153
|
+
--xh-field-fg-rest: var(--xh-tree-select-control-fg, var(--xh-fg-default));
|
|
154
|
+
--xh-field-border-rest: var(--xh-tree-select-control-border, var(--xh-_field-variant-border-rest));
|
|
155
|
+
--xh-field-border-hover: var(--xh-tree-select-control-border-hover, var(--xh-_field-variant-border-hover));
|
|
156
|
+
--xh-field-border-focus: var(--xh-tree-select-control-border-focus, var(--xh-_field-variant-border-focus));
|
|
157
|
+
--xh-field-border-invalid: var(--xh-tree-select-control-border-invalid, var(--xh-_field-variant-border-invalid));
|
|
158
|
+
--xh-field-ring-focus: var(--xh-ring-focus);
|
|
159
|
+
--xh-field-ring-invalid: var(--xh-ring-invalid);
|
|
160
|
+
--xh-field-shadow-rest: var(--xh-tree-select-control-shadow, none);
|
|
161
|
+
--xh-field-cursor-rest: pointer;
|
|
162
|
+
/* 家族 chrome 会重写 --xh-icon-size,使用者图标槽必须经桥接槽下发才能在盒内生效 */
|
|
163
|
+
--xh-field-glyph-size: var(--xh-tree-select-icon-size, var(--xh-_field-size-glyph-size));
|
|
166
164
|
}
|
|
167
165
|
|
|
168
166
|
[data-scope='tree-select'][data-part='control'][hidden] {
|
|
169
167
|
display: none;
|
|
170
168
|
}
|
|
171
169
|
|
|
172
|
-
/* hover 只在中性态换描边:invalid 正拿边框颜色说事,被 hover 盖掉那条信息就没了 */
|
|
173
|
-
[data-scope='tree-select'][data-part='control']:hover:not([data-disabled], [data-invalid]) {
|
|
174
|
-
border-color: var(--xh-tree-select-control-border-hover, var(--xh-_tree-select-border-hover));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/* Tab 停靠点是盒里的 trigger(展开后才移进树里),环画在盒上 */
|
|
178
|
-
[data-scope='tree-select'][data-part='control']:focus-within:not([data-disabled]) {
|
|
179
|
-
border-color: var(--xh-tree-select-control-border-focus, var(--xh-_tone, var(--xh-border-control-focus)));
|
|
180
|
-
outline: var(--xh-ring-width) solid var(--xh-_tree-select-ring);
|
|
181
|
-
outline-offset: var(--xh-ring-offset);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
[data-scope='tree-select'][data-part='control'][data-invalid] {
|
|
185
|
-
border-color: var(--xh-tree-select-control-border-invalid, var(--xh-border-invalid));
|
|
186
|
-
|
|
187
|
-
/* 校验失败时环也跟着变红:两圈等宽相邻却一红一蓝,读的人不知道哪个才是当前状态 */
|
|
188
|
-
--xh-_tree-select-ring: var(--xh-ring-invalid);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/* 只读仍可聚焦、浮层仍展得开、树仍能浏览,所以不置灰,只把底色压下去表示「改不动」 */
|
|
192
|
-
[data-scope='tree-select'][data-part='control'][data-readonly] {
|
|
193
|
-
background: var(--xh-tree-select-control-bg-readonly, var(--xh-bg-subtle));
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
[data-scope='tree-select'][data-part='control'][data-disabled] {
|
|
197
|
-
background: var(--xh-tree-select-control-bg-disabled, var(--xh-bg-subtle));
|
|
198
|
-
color: var(--xh-fg-disabled);
|
|
199
|
-
cursor: not-allowed;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
170
|
/* 盒内那颗可聚焦的按钮:不画描边不铺底也不自带高度,只占满剩余宽度、排布回显与箭头 */
|
|
203
171
|
[data-scope='tree-select'][data-part='trigger'] {
|
|
204
172
|
display: inline-flex;
|
|
@@ -225,7 +193,6 @@
|
|
|
225
193
|
/* trigger 是单体控件,用原生 disabled(树里的集合条目一律 aria-disabled,写 :disabled 永不命中) */
|
|
226
194
|
[data-scope='tree-select'][data-part='trigger']:disabled {
|
|
227
195
|
color: var(--xh-fg-disabled);
|
|
228
|
-
cursor: not-allowed;
|
|
229
196
|
}
|
|
230
197
|
|
|
231
198
|
/* 多选时值会连成很长一串,必须能截断;框宽由盒定,这里得允许自己被压缩 */
|
|
@@ -250,8 +217,9 @@
|
|
|
250
217
|
}
|
|
251
218
|
|
|
252
219
|
/* 有值时清空钮顶上来,箭头让位:两个图标并排堆着,用户分不清点哪个。
|
|
253
|
-
|
|
254
|
-
|
|
220
|
+
判据查的是盒里此刻真有一颗没收起的清空钮,不是「有没有值」——
|
|
221
|
+
作者没摆清空钮时箭头照常留着,不然让了位没人接,指示符整个消失 */
|
|
222
|
+
[data-scope='tree-select'][data-part='control']:has([data-part='clear-trigger']:not([hidden])) [data-part='indicator'] {
|
|
255
223
|
display: none;
|
|
256
224
|
}
|
|
257
225
|
|
|
@@ -261,7 +229,7 @@
|
|
|
261
229
|
align-items: center;
|
|
262
230
|
justify-content: center;
|
|
263
231
|
color: var(--xh-tree-select-indicator-fg, var(--xh-fg-muted));
|
|
264
|
-
transition: rotate var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
232
|
+
transition: rotate var(--xh-motion-duration-micro) var(--xh-motion-ease-enter-strong);
|
|
265
233
|
}
|
|
266
234
|
|
|
267
235
|
[data-scope='tree-select'][data-part='indicator'][hidden] {
|
|
@@ -276,66 +244,76 @@
|
|
|
276
244
|
color: var(--xh-fg-disabled);
|
|
277
245
|
}
|
|
278
246
|
|
|
279
|
-
/*
|
|
247
|
+
/* 盒内靠右的小方钮,不撑高那一行:正方视觉盒、inset 圆角、悬停 100 / 按下 200 与 0.97 按压、粗指针热区与
|
|
248
|
+
:focus-visible 关环(盒的 :focus-within 已画了一圈)全由 Action Control 的 field-inset ghost 档给,
|
|
249
|
+
组件只映射既有覆盖槽 */
|
|
280
250
|
[data-scope='tree-select'][data-part='clear-trigger'] {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
251
|
+
--xh-action-visual-size: var(--xh-tree-select-action-size, var(--xh-_action-profile-visual-size));
|
|
252
|
+
--xh-action-min-inline-size: var(--xh-tree-select-action-size, var(--xh-_action-profile-visual-size));
|
|
253
|
+
--xh-action-radius: var(--xh-tree-select-action-radius, var(--xh-shape-inset));
|
|
254
|
+
/* 底色阶梯由 ghost 档给(透明 → 100 → 200),使用者槽只作覆盖入口 */
|
|
255
|
+
--xh-action-bg-rest: var(--xh-tree-select-action-bg, var(--xh-_action-variant-bg-rest));
|
|
256
|
+
--xh-action-bg-hover: var(--xh-tree-select-action-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
257
|
+
--xh-action-bg-pressed: var(--xh-tree-select-action-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
258
|
+
--xh-action-fg-rest: var(--xh-tree-select-action-fg, var(--xh-fg-muted));
|
|
259
|
+
--xh-action-fg-hover: var(--xh-tree-select-action-fg-hover, var(--xh-fg-default));
|
|
260
|
+
--xh-action-border-rest: transparent;
|
|
261
|
+
--xh-action-highlight-rest: transparent;
|
|
262
|
+
--xh-action-shadow-rest: none;
|
|
263
|
+
--xh-action-shadow-hover: none;
|
|
264
|
+
--xh-action-shadow-pressed: none;
|
|
265
|
+
--xh-action-font-size: var(--xh-tree-select-action-font-size, var(--xh-text-secondary-size));
|
|
266
|
+
/* 配方尚未把 profile 字形档灌进 --xh-icon-size,钮内字形先按 field-inset 档逐钮取值 */
|
|
267
|
+
--xh-icon-size: var(--xh-_action-profile-glyph-size);
|
|
268
|
+
|
|
269
|
+
border-width: 0;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/* 没值时连接层给的是 hidden 属性;家族那条 display 会把 UA 规则盖掉 */
|
|
300
273
|
[data-scope='tree-select'][data-part='clear-trigger'][hidden] {
|
|
301
274
|
display: none;
|
|
302
275
|
}
|
|
303
276
|
|
|
304
|
-
[data-scope='tree-select'][data-part='clear-trigger']:hover {
|
|
305
|
-
background: var(--xh-tree-select-action-bg-hover, var(--xh-bg-subtle-hover));
|
|
306
|
-
color: var(--xh-tree-select-action-fg-hover, var(--xh-fg-default));
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
[data-scope='tree-select'][data-part='clear-trigger']:active {
|
|
310
|
-
background: var(--xh-tree-select-action-bg-active, var(--xh-bg-subtle-active));
|
|
311
|
-
scale: var(--xh-motion-scale-press);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/* 清空按钮退出了 Tab 序列(tabindex=-1),正常操作走不到这里;
|
|
315
|
-
留着是给程序化聚焦兜底,落焦时得看得见 */
|
|
316
|
-
[data-scope='tree-select'][data-part='clear-trigger']:focus-visible {
|
|
317
|
-
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
318
|
-
outline-offset: var(--xh-ring-offset);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
277
|
[data-scope='tree-select'][data-part='content'] {
|
|
278
|
+
position: relative;
|
|
322
279
|
display: flex;
|
|
323
280
|
flex-direction: column;
|
|
324
|
-
|
|
325
|
-
|
|
281
|
+
/* min 优先于 max,锚点与静态下界也必须受可用宽度约束。 */
|
|
282
|
+
min-inline-size: min(
|
|
283
|
+
max(var(--xh-tree-select-content-min-w, var(--xh-overlay-min-w)), var(--xh-_tree-select-anchor-w)),
|
|
284
|
+
var(--xh-_tree-select-available-w)
|
|
285
|
+
);
|
|
286
|
+
/* 静态档与落位后的可用宽度取小:窄视口下面板伸出去,最右侧的内容就点不到了 */
|
|
287
|
+
max-inline-size: min(var(--xh-tree-select-content-max-w, var(--xh-overlay-max-w)), var(--xh-_tree-select-available-w));
|
|
326
288
|
max-block-size: min(var(--xh-tree-select-content-max-h, var(--xh-overlay-max-h)), var(--xh-_tree-select-available-h));
|
|
327
289
|
padding-block: var(--xh-tree-select-content-py, var(--xh-space-1));
|
|
328
290
|
padding-inline: var(--xh-tree-select-content-px, var(--xh-space-1));
|
|
329
|
-
border: var(--xh-stroke-thin) solid var(--xh-tree-select-content-border, var(--xh-border
|
|
330
|
-
border-radius: var(--xh-tree-select-content-radius, var(--xh-shape-
|
|
331
|
-
background: var(--xh-tree-select-content-bg, var(--xh-bg
|
|
332
|
-
color: var(--xh-tree-select-content-fg, var(--xh-fg
|
|
333
|
-
box-shadow: var(--xh-tree-select-content-shadow, var(--xh-
|
|
291
|
+
border: var(--xh-stroke-thin) solid var(--xh-tree-select-content-border, var(--xh-material-frosted-border));
|
|
292
|
+
border-radius: var(--xh-tree-select-content-radius, var(--xh-shape-overlay));
|
|
293
|
+
background: var(--xh-tree-select-content-bg, var(--xh-material-frosted-bg));
|
|
294
|
+
color: var(--xh-tree-select-content-fg, var(--xh-material-frosted-fg));
|
|
295
|
+
box-shadow: var(--xh-tree-select-content-shadow, var(--xh-material-frosted-shadow));
|
|
296
|
+
-webkit-backdrop-filter: var(--xh-tree-select-content-backdrop, var(--xh-material-frosted-backdrop));
|
|
297
|
+
backdrop-filter: var(--xh-tree-select-content-backdrop, var(--xh-material-frosted-backdrop));
|
|
334
298
|
/* 两轴一起给:深层节点靠缩进往行末推,横向溢出是常态,得够得着 */
|
|
335
299
|
overflow: auto;
|
|
300
|
+
/* 浮层滚动面:滚到头不把页面一起带走 */
|
|
301
|
+
overscroll-behavior: contain;
|
|
336
302
|
pointer-events: auto;
|
|
337
303
|
}
|
|
338
304
|
|
|
305
|
+
/* 顶光位于真实边框内侧,不参与布局或拦截树行操作。 */
|
|
306
|
+
[data-scope='tree-select'][data-part='content']::before {
|
|
307
|
+
content: '';
|
|
308
|
+
position: absolute;
|
|
309
|
+
inset-block-start: 0;
|
|
310
|
+
inset-inline: 0;
|
|
311
|
+
block-size: var(--xh-stroke-thin);
|
|
312
|
+
border-radius: inherit;
|
|
313
|
+
background: var(--xh-tree-select-content-highlight, var(--xh-material-frosted-highlight));
|
|
314
|
+
pointer-events: none;
|
|
315
|
+
}
|
|
316
|
+
|
|
339
317
|
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 dialog 一致:
|
|
340
318
|
收起态连接层会给 content 打 hidden,而上面那条 display 正是要盖掉 UA 的
|
|
341
319
|
[hidden]{display:none}——退场动画得先能播。presence 读的是 content 的 animationName,
|
|
@@ -348,13 +326,13 @@
|
|
|
348
326
|
}
|
|
349
327
|
|
|
350
328
|
[data-scope='tree-select'][data-part='content'][data-state='open'] {
|
|
351
|
-
animation: xh-
|
|
329
|
+
animation: xh-overlay-slide-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
352
330
|
}
|
|
353
331
|
|
|
354
332
|
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
355
333
|
免得动画结束到真收起之间闪一下原样 */
|
|
356
334
|
[data-scope='tree-select'][data-part='content'][data-state='closed'] {
|
|
357
|
-
animation: xh-
|
|
335
|
+
animation: xh-overlay-slide-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
358
336
|
}
|
|
359
337
|
|
|
360
338
|
/* 边框、底色与滚动都归 content,树本身只把行竖着排开 */
|
|
@@ -368,11 +346,56 @@
|
|
|
368
346
|
display: none;
|
|
369
347
|
}
|
|
370
348
|
|
|
371
|
-
/*
|
|
372
|
-
|
|
373
|
-
[data-scope='tree-select'][data-part='
|
|
374
|
-
|
|
375
|
-
|
|
349
|
+
/* 空态占位:待在 content 里、tree 的兄弟(role=tree 只许拥有 treeitem 与 group)。
|
|
350
|
+
盒与阴影归 content,这里只画一句居中的次要文字 */
|
|
351
|
+
[data-scope='tree-select'][data-part='empty'] {
|
|
352
|
+
display: block;
|
|
353
|
+
flex: none;
|
|
354
|
+
padding-block: var(--xh-tree-select-empty-py, var(--xh-space-3));
|
|
355
|
+
padding-inline: var(--xh-tree-select-empty-px, var(--xh-_tree-select-row-px));
|
|
356
|
+
color: var(--xh-tree-select-empty-fg, var(--xh-material-frosted-fg-muted));
|
|
357
|
+
font-size: var(--xh-tree-select-empty-font-size, var(--xh-_tree-select-font-size));
|
|
358
|
+
line-height: var(--xh-leading-none);
|
|
359
|
+
text-align: center;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* 上面给了 display,UA 的 [hidden]{display:none} 已被盖掉,这里补回来 */
|
|
363
|
+
[data-scope='tree-select'][data-part='empty'][hidden] {
|
|
364
|
+
display: none;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* 在途占位:与空态占位同一个位置、同一副观感,两者不同屏 */
|
|
368
|
+
[data-scope='tree-select'][data-part='loading'] {
|
|
369
|
+
display: block;
|
|
370
|
+
flex: none;
|
|
371
|
+
padding-block: var(--xh-tree-select-loading-py, var(--xh-space-3));
|
|
372
|
+
padding-inline: var(--xh-tree-select-loading-px, var(--xh-_tree-select-row-px));
|
|
373
|
+
color: var(--xh-tree-select-loading-fg, var(--xh-material-frosted-fg-muted));
|
|
374
|
+
font-size: var(--xh-tree-select-loading-font-size, var(--xh-_tree-select-font-size));
|
|
375
|
+
line-height: var(--xh-leading-none);
|
|
376
|
+
text-align: center;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
[data-scope='tree-select'][data-part='loading'][hidden] {
|
|
380
|
+
display: none;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/* 浮层底部的操作区:排在树下面,与树之间用一条分隔线断开;不参与收缩,行再多也压不扁它 */
|
|
384
|
+
[data-scope='tree-select'][data-part='footer'] {
|
|
385
|
+
display: flex;
|
|
386
|
+
flex: none;
|
|
387
|
+
align-items: center;
|
|
388
|
+
gap: var(--xh-tree-select-footer-gap, var(--xh-space-2));
|
|
389
|
+
padding-block: var(--xh-tree-select-footer-py, var(--xh-space-2));
|
|
390
|
+
padding-inline: var(--xh-tree-select-footer-px, var(--xh-space-2));
|
|
391
|
+
border-block-start: var(--xh-stroke-thin) solid var(--xh-tree-select-footer-border, var(--xh-material-frosted-separator));
|
|
392
|
+
color: var(--xh-tree-select-footer-fg, var(--xh-material-frosted-fg-muted));
|
|
393
|
+
font-size: var(--xh-tree-select-footer-font-size, var(--xh-text-secondary-size));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* 上面给了 display,UA 的 [hidden]{display:none} 已被盖掉,这里补回来 */
|
|
397
|
+
[data-scope='tree-select'][data-part='footer'][hidden] {
|
|
398
|
+
display: none;
|
|
376
399
|
}
|
|
377
400
|
|
|
378
401
|
[data-scope='tree-select'][data-part='tree']:not([tabindex='0']):focus-visible {
|
|
@@ -399,110 +422,176 @@
|
|
|
399
422
|
outline: none;
|
|
400
423
|
}
|
|
401
424
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/* 行:叶子与分支共用同一套盒子,两种行在视觉上必须齐平 */
|
|
425
|
+
/* 行:叶子与分支共用同一套盒子,两种行在视觉上必须齐平。网格、尺寸档、悬停 / 高亮 100、按下 200 与
|
|
426
|
+
选中标记由 Collection Item 家族按 overlay 语境给(选中 = 透明底 + 行尾对号,正文保持 rest 色与常规
|
|
427
|
+
字重),公开 TreeSelect 槽只映射到家族合同。data-highlighted 跟的是连接层记的焦点行(指针与键盘共用),
|
|
428
|
+
环只在真正的键盘焦点上接回,见下 */
|
|
409
429
|
[data-scope='tree-select'][data-part='item'],
|
|
410
430
|
[data-scope='tree-select'][data-part='branch-control'] {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
gap: var(--xh-tree-select-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
431
|
+
--xh-collection-block-padding: var(--xh-tree-select-item-py, var(--xh-_tree-select-row-py));
|
|
432
|
+
--xh-collection-inline-padding: var(--xh-tree-select-item-px, var(--xh-_tree-select-row-px));
|
|
433
|
+
--xh-collection-gap: var(--xh-tree-select-item-gap, var(--xh-_tree-select-gap));
|
|
434
|
+
--xh-collection-font-size: var(--xh-tree-select-item-font-size, var(--xh-_tree-select-font-size));
|
|
435
|
+
--xh-collection-radius: var(--xh-tree-select-item-radius, var(--xh-shape-control));
|
|
436
|
+
--xh-collection-glyph-size: var(--xh-tree-select-icon-size, var(--xh-_collection-glyph-size));
|
|
437
|
+
--xh-collection-fg-rest: var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg));
|
|
438
|
+
--xh-collection-fg-hover: var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg));
|
|
439
|
+
--xh-collection-fg-keyboard-highlight: var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg));
|
|
440
|
+
--xh-collection-fg-selected: var(--xh-tree-select-item-fg-selected, var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg)));
|
|
441
|
+
--xh-collection-fg-selected-highlight: var(--xh-tree-select-item-fg-selected, var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg)));
|
|
442
|
+
--xh-collection-fg-selected-hover: var(--xh-tree-select-item-fg-selected, var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg)));
|
|
443
|
+
--xh-collection-fg-selected-pressed: var(--xh-tree-select-item-fg-selected, var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg)));
|
|
444
|
+
--xh-collection-fg-pressed: var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg));
|
|
445
|
+
--xh-collection-font-weight-selected: var(--xh-tree-select-item-font-weight-selected, var(--xh-font-weight-regular));
|
|
446
|
+
--xh-collection-font-weight-selected-highlight: var(--xh-tree-select-item-font-weight-selected, var(--xh-font-weight-regular));
|
|
447
|
+
--xh-collection-font-weight-selected-hover: var(--xh-tree-select-item-font-weight-selected, var(--xh-font-weight-regular));
|
|
448
|
+
--xh-collection-font-weight-selected-pressed: var(--xh-tree-select-item-font-weight-selected, var(--xh-font-weight-regular));
|
|
449
|
+
--xh-collection-bg-hover: var(--xh-tree-select-item-bg-hover, var(--xh-bg-subtle));
|
|
450
|
+
--xh-collection-bg-keyboard-highlight: var(--xh-tree-select-item-bg-hover, var(--xh-bg-subtle));
|
|
451
|
+
--xh-collection-bg-selected-highlight: var(--xh-tree-select-item-bg-hover, var(--xh-bg-subtle));
|
|
452
|
+
--xh-collection-bg-selected-hover: var(--xh-tree-select-item-bg-hover, var(--xh-bg-subtle));
|
|
453
|
+
--xh-collection-bg-pressed: var(--xh-tree-select-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
454
|
+
--xh-collection-bg-selected-pressed: var(--xh-tree-select-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
455
|
+
--xh-collection-outline-keyboard-highlight: transparent;
|
|
456
|
+
--xh-collection-outline-selected-highlight: transparent;
|
|
457
|
+
--xh-collection-indicator-fg-rest: var(--xh-tree-select-item-check-fg, var(--xh-tree-select-item-indicator-fg, var(--xh-_tree-select-accent)));
|
|
458
|
+
--xh-collection-indicator-fg-checked: var(--xh-tree-select-item-check-fg, var(--xh-tree-select-item-indicator-fg, var(--xh-_tree-select-accent)));
|
|
459
|
+
--xh-collection-indicator-fg-selected: var(--xh-tree-select-item-check-fg, var(--xh-tree-select-item-indicator-fg, var(--xh-_tree-select-accent)));
|
|
460
|
+
--xh-collection-indicator-fg-selected-hover: var(--xh-tree-select-item-check-fg, var(--xh-tree-select-item-indicator-fg, var(--xh-_tree-select-accent)));
|
|
461
|
+
--xh-collection-indicator-fg-selected-highlight: var(--xh-tree-select-item-check-fg, var(--xh-tree-select-item-indicator-fg, var(--xh-_tree-select-accent)));
|
|
462
|
+
--xh-collection-indicator-fg-selected-pressed: var(--xh-tree-select-item-check-fg, var(--xh-tree-select-item-indicator-fg, var(--xh-_tree-select-accent)));
|
|
463
|
+
|
|
419
464
|
/* 行高留出文字的上下伸展空间,行内那层 overflow:hidden 才不会把字削掉 */
|
|
420
|
-
line-height: var(--xh-tree-select-
|
|
465
|
+
line-height: var(--xh-tree-select-item-leading, var(--xh-leading-normal));
|
|
421
466
|
white-space: nowrap;
|
|
422
|
-
cursor: pointer;
|
|
423
467
|
user-select: none;
|
|
424
|
-
transition:
|
|
425
|
-
background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
426
|
-
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
427
468
|
}
|
|
428
469
|
|
|
470
|
+
/* 家族给了 display,UA 的 [hidden]{display:none} 已被盖掉,这里补回来 */
|
|
429
471
|
[data-scope='tree-select'][data-part='item'][hidden],
|
|
430
472
|
[data-scope='tree-select'][data-part='branch-control'][hidden] {
|
|
431
473
|
display: none;
|
|
432
474
|
}
|
|
433
475
|
|
|
434
|
-
/*
|
|
435
|
-
|
|
436
|
-
[data-scope='tree-select'][data-part='item']
|
|
437
|
-
|
|
438
|
-
|
|
476
|
+
/* 叶子在家族网格的首列放一格与分支箭头等宽的占位:两种行的文字起点才对得齐;
|
|
477
|
+
选中标记独立固定在行尾(indicator 列),不再同时承担层级缩进 */
|
|
478
|
+
[data-scope='tree-select'][data-part='item']::before {
|
|
479
|
+
content: '';
|
|
480
|
+
grid-column: prefix;
|
|
481
|
+
grid-row: 1 / span 2;
|
|
482
|
+
inline-size: var(--xh-tree-select-branch-indicator-size, var(--xh-control-indicator-size));
|
|
483
|
+
margin-inline-end: var(--xh-tree-select-item-gap, var(--xh-_tree-select-gap));
|
|
439
484
|
}
|
|
440
485
|
|
|
441
|
-
/*
|
|
442
|
-
|
|
443
|
-
[data-scope='tree-select'][data-part='item']
|
|
444
|
-
[data-scope='tree-select'][data-part='branch-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
486
|
+
/* 键盘焦点出现时环才接回并立即到位,不压在背景过渡的中间帧上:叶子自己承载焦点,
|
|
487
|
+
分支的焦点在 branch 上、环画在它那一行 */
|
|
488
|
+
[data-scope='tree-select'][data-part='item']:focus-visible:not(:hover),
|
|
489
|
+
[data-scope='tree-select'][data-part='branch']:focus-visible > [data-scope='tree-select'][data-part='branch-control'] {
|
|
490
|
+
--xh-collection-outline-keyboard-highlight: var(--xh-ring-focus);
|
|
491
|
+
--xh-collection-outline-selected-highlight: var(--xh-ring-focus);
|
|
448
492
|
|
|
449
|
-
|
|
450
|
-
[data-scope='tree-select'][data-part='item']:focus-visible {
|
|
451
|
-
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
452
|
-
outline-offset: calc(-1 * var(--xh-ring-width));
|
|
493
|
+
transition: none;
|
|
453
494
|
}
|
|
454
495
|
|
|
455
|
-
/*
|
|
456
|
-
|
|
457
|
-
[data-scope='tree-select'][data-part='item'][data-disabled],
|
|
496
|
+
/* 分支行不是 treeitem 本体(aria-disabled 在 branch 上),禁用面按连接层的 data-disabled 映射到家族槽:
|
|
497
|
+
字色降级、悬停 / 高亮 / 按下不换面、光标 not-allowed */
|
|
458
498
|
[data-scope='tree-select'][data-part='branch-control'][data-disabled] {
|
|
459
|
-
|
|
460
|
-
|
|
499
|
+
--xh-collection-fg-rest: var(--xh-fg-disabled);
|
|
500
|
+
--xh-collection-fg-hover: var(--xh-fg-disabled);
|
|
501
|
+
--xh-collection-fg-keyboard-highlight: var(--xh-fg-disabled);
|
|
502
|
+
--xh-collection-fg-pressed: var(--xh-fg-disabled);
|
|
503
|
+
--xh-collection-bg-hover: transparent;
|
|
504
|
+
--xh-collection-bg-keyboard-highlight: transparent;
|
|
505
|
+
--xh-collection-bg-pressed: transparent;
|
|
506
|
+
--xh-collection-cursor-rest: not-allowed;
|
|
507
|
+
--xh-collection-cursor-hover: not-allowed;
|
|
508
|
+
--xh-collection-cursor-keyboard-highlight: not-allowed;
|
|
509
|
+
--xh-collection-cursor-pressed: not-allowed;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/* 懒分支取数失败不预设错误面(文案与重试归作者结构接线):家族按 data-error 给的告警面在这里映射回常态 */
|
|
513
|
+
[data-scope='tree-select'][data-part='branch-control'][data-error] {
|
|
514
|
+
--xh-collection-bg-error: transparent;
|
|
515
|
+
--xh-collection-fg-error: var(--xh-material-frosted-fg);
|
|
516
|
+
--xh-collection-description-fg-error: var(--xh-material-frosted-fg-muted);
|
|
517
|
+
--xh-collection-indicator-fg-error: var(--xh-_tree-select-accent);
|
|
518
|
+
--xh-collection-outline-error: transparent;
|
|
461
519
|
}
|
|
462
520
|
|
|
521
|
+
/* 取数失败的行仍可激活(Enter / 点行触发重试),而家族的悬停、高亮与按下三段都排除了 [data-error]:
|
|
522
|
+
这里在家族解算点上把同一阶梯接回(行槽以 item 取名、叶子与分支行共用,登记见 check-spacing-slots):
|
|
523
|
+
悬停与键盘高亮 100 档、按下 200 档并走按下时长,
|
|
524
|
+
键盘焦点环随 branch 的 :focus-visible 画在这一行;禁用分支不进这三段 */
|
|
525
|
+
[data-scope='tree-select'][data-part='branch-control'][data-error]:not([data-disabled]):is(:hover, [data-highlighted]) {
|
|
526
|
+
--xh-_collection-bg: var(--xh-tree-select-item-bg-hover, var(--xh-bg-subtle));
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
[data-scope='tree-select'][data-part='branch']:focus-visible > [data-scope='tree-select'][data-part='branch-control'][data-error]:not([data-disabled]) {
|
|
530
|
+
--xh-_collection-bg: var(--xh-tree-select-item-bg-hover, var(--xh-bg-subtle));
|
|
531
|
+
--xh-_collection-outline: var(--xh-ring-focus);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
[data-scope='tree-select'][data-part='branch-control'][data-error]:not([data-disabled]):is(:active, [data-pressed]) {
|
|
535
|
+
--xh-_collection-bg: var(--xh-tree-select-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
536
|
+
|
|
537
|
+
transition-duration: var(--xh-motion-duration-press);
|
|
538
|
+
transition-timing-function: var(--xh-motion-ease-press);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/* 正文落在家族网格的 text 列;网格项默认最小尺寸是内容尺寸,不归零则长文本把行撑破、省略号轮不上 */
|
|
463
542
|
[data-scope='tree-select'][data-part='item-text'],
|
|
464
543
|
[data-scope='tree-select'][data-part='branch-text'] {
|
|
465
|
-
flex: 1;
|
|
466
544
|
min-inline-size: 0;
|
|
467
545
|
overflow: hidden;
|
|
468
546
|
white-space: nowrap;
|
|
469
547
|
text-overflow: ellipsis;
|
|
470
548
|
}
|
|
471
549
|
|
|
472
|
-
/*
|
|
550
|
+
/* 勾选标记落在家族网格的 indicator 列;未选中时占位不塌,切换选中不引起行宽抖动。
|
|
551
|
+
尺寸槽按各自部件取名:行内的勾与展开箭头分别是 item- 与 branch- 段,
|
|
552
|
+
触发器上那枚箭头是 --xh-tree-select-indicator-*,三处各调各的。
|
|
553
|
+
盒里的对号 / 半选杠是指示符:在自己身上把 --xh-icon-size 改接到盒的尺,兜底字形与作者
|
|
554
|
+
塞进盒里的 XhIcon 读同一把尺、与盒同边长;不读家族按档下发到行的 --xh-icon-size——那支只管
|
|
555
|
+
作者放进行里的图标,按图标档取的 20px 会比 16 / 14 的盒还大 */
|
|
473
556
|
[data-scope='tree-select'][data-part='item-indicator'] {
|
|
557
|
+
--xh-icon-size: var(--xh-tree-select-item-indicator-size, var(--xh-control-indicator-size));
|
|
558
|
+
|
|
474
559
|
display: inline-flex;
|
|
475
|
-
flex: none;
|
|
476
560
|
align-items: center;
|
|
477
561
|
justify-content: center;
|
|
478
|
-
inline-size: var(--xh-tree-select-indicator-size, var(--xh-control-indicator-size));
|
|
479
|
-
|
|
480
|
-
visibility: hidden;
|
|
562
|
+
inline-size: var(--xh-tree-select-item-indicator-size, var(--xh-control-indicator-size));
|
|
563
|
+
block-size: var(--xh-tree-select-item-indicator-size, var(--xh-control-indicator-size));
|
|
481
564
|
}
|
|
482
565
|
|
|
483
566
|
[data-scope='tree-select'][data-part='item-indicator'][hidden] {
|
|
484
567
|
display: none;
|
|
485
568
|
}
|
|
486
569
|
|
|
487
|
-
|
|
570
|
+
/* 家族只按行的 aria-selected 显示对号:分支行的 aria-selected 在 branch 上、半选没有选中语义,
|
|
571
|
+
这两档按标记自身的 data-selected / data-indeterminate 显形 */
|
|
572
|
+
[data-scope='tree-select'][data-part='item-indicator']:is([data-selected], [data-indeterminate]) {
|
|
488
573
|
visibility: visible;
|
|
489
574
|
}
|
|
490
575
|
|
|
576
|
+
/* 分支行的禁用不在行的 aria-disabled 上(那在 branch 上),标记按自身的 data-disabled 降级 */
|
|
491
577
|
[data-scope='tree-select'][data-part='item-indicator'][data-disabled] {
|
|
492
578
|
color: var(--xh-fg-disabled);
|
|
493
579
|
}
|
|
494
580
|
|
|
495
581
|
/* 展开箭头与方向指示符:两者都可能被作者用作「点这里展开」的把手,
|
|
496
|
-
|
|
582
|
+
所以尺寸与叶子的勾选标记一致,两种行的文字起点才对得齐。
|
|
583
|
+
盒里的 chevron 是指示符:与盒同边长,--xh-icon-size 在自己身上改接到盒的尺 */
|
|
497
584
|
[data-scope='tree-select'][data-part='branch-trigger'],
|
|
498
585
|
[data-scope='tree-select'][data-part='branch-indicator'] {
|
|
586
|
+
--xh-icon-size: var(--xh-tree-select-branch-indicator-size, var(--xh-control-indicator-size));
|
|
587
|
+
|
|
499
588
|
display: inline-flex;
|
|
500
589
|
flex: none;
|
|
501
590
|
align-items: center;
|
|
502
591
|
justify-content: center;
|
|
503
|
-
inline-size: var(--xh-tree-select-indicator-size, var(--xh-control-indicator-size));
|
|
592
|
+
inline-size: var(--xh-tree-select-branch-indicator-size, var(--xh-control-indicator-size));
|
|
504
593
|
color: var(--xh-tree-select-branch-indicator-fg, var(--xh-fg-subtle));
|
|
505
|
-
transition: rotate var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
594
|
+
transition: rotate var(--xh-motion-duration-micro) var(--xh-motion-ease-enter-strong);
|
|
506
595
|
}
|
|
507
596
|
|
|
508
597
|
[data-scope='tree-select'][data-part='branch-trigger'][hidden],
|
|
@@ -542,11 +631,14 @@
|
|
|
542
631
|
}
|
|
543
632
|
|
|
544
633
|
/* 收起态的唯一开关:display 盖掉了 UA 的 [hidden]{display:none},漏了这条整棵子树就收不起来 */
|
|
545
|
-
[data-scope='tree-select'][data-part='branch-content'][hidden]
|
|
634
|
+
[data-scope='tree-select'][data-part='branch-content'][hidden],
|
|
635
|
+
[data-scope='tree-select'][data-part='branch-content'][data-state='closed'] {
|
|
546
636
|
display: none;
|
|
547
637
|
}
|
|
548
638
|
|
|
549
|
-
/*
|
|
639
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中。
|
|
640
|
+
尺寸读各部件的 --xh-icon-size:触发器箭头与清除钮的叉按图标档,行尾对号 / 半选杠与展开 chevron
|
|
641
|
+
读部件自己改接过的盒尺、与盒同边长(见上面两块) */
|
|
550
642
|
[data-scope='tree-select'][data-part='indicator']:empty::before {
|
|
551
643
|
content: '';
|
|
552
644
|
display: inline-block;
|
|
@@ -569,6 +661,11 @@
|
|
|
569
661
|
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
570
662
|
}
|
|
571
663
|
|
|
664
|
+
[data-scope='tree-select'][data-part='item-indicator'][data-indeterminate]:not([data-selected]):empty::before {
|
|
665
|
+
-webkit-mask-image: var(--xh-glyph-mark-minus);
|
|
666
|
+
mask-image: var(--xh-glyph-mark-minus);
|
|
667
|
+
}
|
|
668
|
+
|
|
572
669
|
[data-scope='tree-select'][data-part='branch-trigger']:empty::before,
|
|
573
670
|
[data-scope='tree-select'][data-part='branch-indicator']:empty::before {
|
|
574
671
|
content: '';
|
|
@@ -591,4 +688,12 @@
|
|
|
591
688
|
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
592
689
|
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
593
690
|
}
|
|
691
|
+
|
|
692
|
+
@media print {
|
|
693
|
+
/* 打印:定位层与遮罩是交互期才存在的东西,落到纸上只会盖住底下的正文。
|
|
694
|
+
收起写在这份皮肤里而不是 reset:reset 层排在组件层之前,组件层里任何一条 display 都压得住它。 */
|
|
695
|
+
[data-scope='tree-select'][data-part='positioner'] {
|
|
696
|
+
display: none;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
594
699
|
}
|