@veltra/desktop 1.15.0 → 1.15.1
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/dist/components/alert/alert.js +31 -28
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/style.d.ts +1 -1
- package/dist/components/alert/style.js +1 -0
- package/dist/components/alert/style2.css +5 -1
- package/dist/components/auto-complete/style2.css +1 -0
- package/dist/components/back-top/style2.css +11 -2
- package/dist/components/badge/badge.js +15 -15
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/style2.css +10 -1
- package/dist/components/batch-edit/batch-edit-form.js +108 -97
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.js +11 -5
- package/dist/components/batch-edit/batch-edit.js.map +1 -1
- package/dist/components/batch-edit/style2.css +25 -1
- package/dist/components/breadcrumb/style2.css +4 -1
- package/dist/components/button/style2.css +3 -2
- package/dist/components/carousel/carousel.js +5 -3
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/carousel/style2.css +7 -1
- package/dist/components/carousel/use-carousel.js +16 -2
- package/dist/components/carousel/use-carousel.js.map +1 -1
- package/dist/components/cascade/style2.css +16 -0
- package/dist/components/check-tag/check-tag.js +11 -5
- package/dist/components/check-tag/check-tag.js.map +1 -1
- package/dist/components/check-tag/style2.css +10 -0
- package/dist/components/checkbox/checkbox-button.js +8 -3
- package/dist/components/checkbox/checkbox-button.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +5 -9
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox/style2.css +32 -2
- package/dist/components/chip/style2.css +4 -0
- package/dist/components/code-editor/code-editor.js +26 -3
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/code-editor/style2.css +38 -3
- package/dist/components/collapse/collapse-item.js +4 -1
- package/dist/components/collapse/collapse-item.js.map +1 -1
- package/dist/components/collapse/collapse.js +1 -1
- package/dist/components/collapse/collapse.js.map +1 -1
- package/dist/components/collapse/style2.css +6 -3
- package/dist/components/condition-editor/style2.css +24 -6
- package/dist/components/contextmenu/contextmenu-sub.js +13 -7
- package/dist/components/contextmenu/contextmenu-sub.js.map +1 -1
- package/dist/components/contextmenu/style2.css +14 -1
- package/dist/components/date-panel/style2.css +9 -1
- package/dist/components/dialog/style2.css +5 -1
- package/dist/components/dialog/use-maximum.js +6 -0
- package/dist/components/dialog/use-maximum.js.map +1 -1
- package/dist/components/drawer/style2.css +4 -0
- package/dist/components/dual-nav/style2.css +5 -2
- package/dist/components/expression-editor/style2.css +17 -5
- package/dist/components/file-viewer/style2.css +8 -2
- package/dist/components/float-button/float-button.js +1 -1
- package/dist/components/float-button/float-button.js.map +1 -1
- package/dist/components/float-button/style2.css +2 -3
- package/dist/components/form-item/style2.css +13 -1
- package/dist/components/grid-input/style2.css +15 -3
- package/dist/components/group-nav/style2.css +16 -7
- package/dist/components/icon/style2.css +1 -1
- package/dist/components/image-cropper/style2.css +4 -1
- package/dist/components/image-previewer/image-previewer.js +14 -2
- package/dist/components/image-previewer/image-previewer.js.map +1 -1
- package/dist/components/image-previewer/style.d.ts +1 -1
- package/dist/components/image-previewer/style.js +1 -0
- package/dist/components/image-previewer/style2.css +9 -14
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/input/style2.css +13 -1
- package/dist/components/kanban/kanban-column.js +1 -0
- package/dist/components/kanban/kanban-column.js.map +1 -1
- package/dist/components/kanban/style2.css +6 -2
- package/dist/components/layout/layout-resizer.js +8 -1
- package/dist/components/layout/layout-resizer.js.map +1 -1
- package/dist/components/layout/layout.js +11 -1
- package/dist/components/layout/layout.js.map +1 -1
- package/dist/components/layout/style2.css +22 -0
- package/dist/components/loading/style2.css +26 -7
- package/dist/components/message/style2.css +18 -2
- package/dist/components/message-confirm/style2.css +11 -0
- package/dist/components/multi-select/multi-select.js +21 -18
- package/dist/components/multi-select/multi-select.js.map +1 -1
- package/dist/components/multi-select/style2.css +13 -0
- package/dist/components/nav/nav-sub.js +8 -2
- package/dist/components/nav/nav-sub.js.map +1 -1
- package/dist/components/nav/style2.css +50 -26
- package/dist/components/notification/style2.css +21 -0
- package/dist/components/number-input/style2.css +5 -2
- package/dist/components/paginator/style2.css +1 -0
- package/dist/components/password-input/style2.css +10 -1
- package/dist/components/pop-confirm/pop-confirm.js +1 -1
- package/dist/components/pop-confirm/pop-confirm.js.map +1 -1
- package/dist/components/progress/style2.css +2 -2
- package/dist/components/progress-nodes/style2.css +3 -3
- package/dist/components/radio/radio.js +1 -4
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/radio/style2.css +11 -1
- package/dist/components/rate/style2.css +7 -0
- package/dist/components/rich-text-editor/style2.css +6 -3
- package/dist/components/scroll/style2.css +2 -2
- package/dist/components/segment/segment.js +5 -1
- package/dist/components/segment/segment.js.map +1 -1
- package/dist/components/segment/style2.css +6 -0
- package/dist/components/select/select.js +5 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/style2.css +11 -1
- package/dist/components/steps/style2.css +21 -2
- package/dist/components/switch/style2.css +10 -2
- package/dist/components/table/style2.css +20 -7
- package/dist/components/tabs/style2.css +9 -3
- package/dist/components/tag/style2.css +16 -7
- package/dist/components/textarea/style2.css +9 -1
- package/dist/components/theme/style2.css +38 -29
- package/dist/components/time-picker/style2.css +4 -1
- package/dist/components/tip/style2.css +11 -0
- package/dist/components/transfer/style2.css +21 -1
- package/dist/components/transfer/transfer-list.js +20 -17
- package/dist/components/transfer/transfer-list.js.map +1 -1
- package/dist/components/tree/style2.css +5 -2
- package/package.json +1 -1
- package/src/components/alert/alert.vue +18 -16
- package/src/components/alert/style.scss +9 -1
- package/src/components/alert/style.ts +1 -0
- package/src/components/auto-complete/style.scss +3 -0
- package/src/components/back-top/style.scss +17 -3
- package/src/components/badge/badge.vue +6 -7
- package/src/components/badge/style.scss +20 -1
- package/src/components/batch-edit/__test__/batch-edit.test.ts +10 -0
- package/src/components/batch-edit/batch-edit-form.vue +95 -83
- package/src/components/batch-edit/batch-edit.vue +18 -3
- package/src/components/batch-edit/style.scss +39 -3
- package/src/components/breadcrumb/style.scss +5 -1
- package/src/components/button/style.scss +4 -2
- package/src/components/carousel/carousel.vue +8 -2
- package/src/components/carousel/style.scss +10 -1
- package/src/components/carousel/use-carousel.ts +17 -2
- package/src/components/cascade/style.scss +27 -0
- package/src/components/check-tag/check-tag.vue +13 -3
- package/src/components/check-tag/style.scss +21 -0
- package/src/components/checkbox/checkbox-button.vue +11 -1
- package/src/components/checkbox/checkbox.vue +6 -2
- package/src/components/checkbox/style.scss +51 -2
- package/src/components/chip/style.scss +11 -0
- package/src/components/code-editor/code-editor.vue +24 -3
- package/src/components/code-editor/style.scss +54 -4
- package/src/components/collapse/collapse-item.vue +10 -1
- package/src/components/collapse/collapse.vue +3 -1
- package/src/components/collapse/style.scss +10 -7
- package/src/components/condition-editor/style.scss +39 -12
- package/src/components/contextmenu/contextmenu-sub.vue +9 -7
- package/src/components/contextmenu/style.scss +17 -1
- package/src/components/date-panel/style.scss +22 -1
- package/src/components/dialog/style.scss +6 -1
- package/src/components/dialog/use-maximum.ts +8 -0
- package/src/components/drawer/style.scss +5 -0
- package/src/components/dual-nav/style.scss +9 -4
- package/src/components/expression-editor/style.scss +27 -9
- package/src/components/file-viewer/style.scss +12 -2
- package/src/components/float-button/float-button.vue +1 -1
- package/src/components/float-button/style.scss +4 -3
- package/src/components/form-item/style.scss +16 -2
- package/src/components/grid-input/style.scss +6 -1
- package/src/components/group-nav/style.scss +30 -13
- package/src/components/icon/style.scss +2 -1
- package/src/components/image-cropper/style.scss +6 -1
- package/src/components/image-previewer/image-previewer.vue +20 -2
- package/src/components/image-previewer/style.scss +17 -14
- package/src/components/image-previewer/style.ts +1 -0
- package/src/components/input/input.vue +2 -8
- package/src/components/input/style.scss +19 -1
- package/src/components/kanban/kanban-column.vue +2 -0
- package/src/components/kanban/style.scss +11 -2
- package/src/components/layout/__test__/layout.test.ts +135 -0
- package/src/components/layout/layout-resizer.vue +8 -1
- package/src/components/layout/layout.vue +17 -1
- package/src/components/layout/style.scss +31 -6
- package/src/components/loading/style.scss +39 -8
- package/src/components/message/style.scss +20 -2
- package/src/components/message-confirm/style.scss +13 -0
- package/src/components/multi-select/multi-select.vue +13 -10
- package/src/components/multi-select/style.scss +14 -0
- package/src/components/multi-tree-select/__test__/multi-tree-select.test.ts +4 -2
- package/src/components/nav/nav-sub.vue +10 -2
- package/src/components/nav/style.scss +37 -13
- package/src/components/notification/style.scss +13 -0
- package/src/components/number-input/style.scss +8 -2
- package/src/components/paginator/style.scss +3 -0
- package/src/components/password-input/style.scss +15 -1
- package/src/components/pop-confirm/pop-confirm.vue +1 -1
- package/src/components/progress/style.scss +3 -3
- package/src/components/progress-nodes/style.scss +5 -5
- package/src/components/radio/radio.vue +1 -1
- package/src/components/radio/style.scss +19 -1
- package/src/components/rate/style.scss +9 -0
- package/src/components/rich-text-editor/style.scss +11 -6
- package/src/components/scroll/style.scss +3 -3
- package/src/components/segment/segment.vue +13 -1
- package/src/components/segment/style.scss +13 -3
- package/src/components/select/select.vue +1 -1
- package/src/components/select/style.scss +22 -1
- package/src/components/steps/style.scss +27 -5
- package/src/components/switch/style.scss +13 -2
- package/src/components/table/style.scss +44 -20
- package/src/components/tabs/style.scss +16 -3
- package/src/components/tag/style.scss +18 -1
- package/src/components/textarea/style.scss +15 -2
- package/src/components/theme/style.scss +62 -40
- package/src/components/time-picker/style.scss +9 -1
- package/src/components/tip/style.scss +13 -0
- package/src/components/transfer/style.scss +31 -1
- package/src/components/transfer/transfer-list.vue +18 -15
- package/src/components/tree/style.scss +8 -3
|
@@ -46,9 +46,7 @@ $root-name: batch-edit;
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
background-color: fn.use-var(bg-color, top);
|
|
48
48
|
border-radius: var(--u-batch-edit-form-radius);
|
|
49
|
-
box-shadow:
|
|
50
|
-
0 1px 2px fn.color-a(shadow, 40, color),
|
|
51
|
-
0 12px 32px -16px fn.color-a(shadow, 50, color);
|
|
49
|
+
box-shadow: fn.use-var(shadow, lg);
|
|
52
50
|
overflow: hidden;
|
|
53
51
|
isolation: isolate;
|
|
54
52
|
min-height: 0;
|
|
@@ -191,3 +189,41 @@ $root-name: batch-edit;
|
|
|
191
189
|
display: none;
|
|
192
190
|
}
|
|
193
191
|
}
|
|
192
|
+
|
|
193
|
+
// ---------- 侧栏进出过渡 ----------
|
|
194
|
+
// 入场从右轻移淡入(normal/ease-out),离场快速纯淡出(出场快于入场);
|
|
195
|
+
// 弹框模式的显隐由弹框外壳负责,排除 is-dialog
|
|
196
|
+
#{fn.bem($root-name, form)}:not(.is-dialog) {
|
|
197
|
+
&.u-batch-edit-form-enter-active {
|
|
198
|
+
transition:
|
|
199
|
+
opacity fn.use-var(transition, normal) fn.use-var(transition, ease-out),
|
|
200
|
+
transform fn.use-var(transition, normal) fn.use-var(transition, ease-out);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&.u-batch-edit-form-leave-active {
|
|
204
|
+
transition:
|
|
205
|
+
opacity fn.use-var(transition, fast) fn.use-var(transition, ease-out),
|
|
206
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&.u-batch-edit-form-enter-from {
|
|
210
|
+
opacity: 0;
|
|
211
|
+
transform: translateX(12px);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&.u-batch-edit-form-leave-to {
|
|
215
|
+
opacity: 0;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// ---------- 表单内容快速淡入 ----------
|
|
220
|
+
// 替代全局 fade(250ms + out-in 空窗):本地 fast,无 out-in
|
|
221
|
+
.u-batch-edit-fade-enter-active,
|
|
222
|
+
.u-batch-edit-fade-leave-active {
|
|
223
|
+
transition: opacity fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.u-batch-edit-fade-enter-from,
|
|
227
|
+
.u-batch-edit-fade-leave-to {
|
|
228
|
+
opacity: 0;
|
|
229
|
+
}
|
|
@@ -42,12 +42,16 @@ $root-name: breadcrumb;
|
|
|
42
42
|
text-decoration: none;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
border-radius: fn.use-var(radius, small);
|
|
45
|
-
transition: color
|
|
45
|
+
transition: color fn.use-var(transition, fast) fn.use-var(transition, ease);
|
|
46
46
|
|
|
47
47
|
@include m.is-not(disabled) {
|
|
48
48
|
&:hover {
|
|
49
49
|
color: fn.use-var(color, primary);
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
&:active {
|
|
53
|
+
opacity: 0.7;
|
|
54
|
+
}
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
&:focus-visible {
|
|
@@ -23,7 +23,8 @@ $root-name: button;
|
|
|
23
23
|
background-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
24
24
|
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
25
25
|
color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
26
|
-
box-shadow fn.use-var(transition, fast) fn.use-var(transition, ease)
|
|
26
|
+
box-shadow fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
27
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
27
28
|
-webkit-tap-highlight-color: transparent; /* For some Androids */
|
|
28
29
|
gap: fn.use-var(gap-small);
|
|
29
30
|
|
|
@@ -38,8 +39,9 @@ $root-name: button;
|
|
|
38
39
|
border-color: fn.component-var(button, default-hover-border, transparent);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
&:active {
|
|
42
|
+
&:active:not(.is-disabled):not(.is-loading) {
|
|
42
43
|
box-shadow: none;
|
|
44
|
+
transform: scale(0.97);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
@include m.is(disabled, loading) {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:class="cls.b"
|
|
4
|
+
role="region"
|
|
5
|
+
aria-roledescription="carousel"
|
|
6
|
+
@mouseenter="pauseAutoplay"
|
|
7
|
+
@mouseleave="resumeAutoplay"
|
|
8
|
+
>
|
|
3
9
|
<div :class="cls.e('track')" :style="trackStyle">
|
|
4
10
|
<slot />
|
|
5
11
|
</div>
|
|
@@ -77,7 +83,7 @@ const unregister = (uid: number) => {
|
|
|
77
83
|
if (index > -1) itemUids.value.splice(index, 1)
|
|
78
84
|
}
|
|
79
85
|
|
|
80
|
-
const { current, canPrev, canNext, goTo, prev, next } = useCarousel({
|
|
86
|
+
const { current, canPrev, canNext, goTo, prev, next, pauseAutoplay, resumeAutoplay } = useCarousel({
|
|
81
87
|
model,
|
|
82
88
|
count: () => itemUids.value.length,
|
|
83
89
|
autoplay: () => autoplay,
|
|
@@ -48,6 +48,10 @@ $root-name: carousel;
|
|
|
48
48
|
transform: translateY(-50%) scale(1.08);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
&:active:not(:disabled) {
|
|
52
|
+
transform: translateY(-50%) scale(0.95);
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
&:focus-visible {
|
|
52
56
|
box-shadow: fn.use-var(focus-ring);
|
|
53
57
|
}
|
|
@@ -90,12 +94,17 @@ $root-name: carousel;
|
|
|
90
94
|
background-color: fn.color-a(text-color, 40, white);
|
|
91
95
|
transition:
|
|
92
96
|
width fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
93
|
-
background-color fn.use-var(transition, fast) fn.use-var(transition, ease)
|
|
97
|
+
background-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
98
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
94
99
|
|
|
95
100
|
&:hover {
|
|
96
101
|
background-color: fn.color-a(text-color, 70, white);
|
|
97
102
|
}
|
|
98
103
|
|
|
104
|
+
&:active {
|
|
105
|
+
transform: scale(0.9);
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
&:focus-visible {
|
|
100
109
|
box-shadow: fn.use-var(focus-ring);
|
|
101
110
|
}
|
|
@@ -56,6 +56,9 @@ export function useCarousel({ model, count, autoplay, interval, loop }: UseCarou
|
|
|
56
56
|
|
|
57
57
|
let timer: ReturnType<typeof setInterval> | undefined
|
|
58
58
|
|
|
59
|
+
/** 悬停暂停标记:暂停期间 watch 触发的重启一律忽略,离开后才恢复 */
|
|
60
|
+
let hoverPaused = false
|
|
61
|
+
|
|
59
62
|
const stopAutoplay = () => {
|
|
60
63
|
if (timer !== undefined) {
|
|
61
64
|
clearInterval(timer)
|
|
@@ -65,13 +68,25 @@ export function useCarousel({ model, count, autoplay, interval, loop }: UseCarou
|
|
|
65
68
|
|
|
66
69
|
const startAutoplay = () => {
|
|
67
70
|
stopAutoplay()
|
|
68
|
-
if (!toValue(autoplay) || pageCount() < 2) return
|
|
71
|
+
if (hoverPaused || !toValue(autoplay) || pageCount() < 2) return
|
|
69
72
|
timer = setInterval(() => step(1), toValue(interval))
|
|
70
73
|
}
|
|
71
74
|
|
|
75
|
+
/** 悬停暂停自动播放 */
|
|
76
|
+
const pauseAutoplay = () => {
|
|
77
|
+
hoverPaused = true
|
|
78
|
+
stopAutoplay()
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** 离开后恢复自动播放:重建定时器重置整个间隔,不立即跳帧 */
|
|
82
|
+
const resumeAutoplay = () => {
|
|
83
|
+
hoverPaused = false
|
|
84
|
+
startAutoplay()
|
|
85
|
+
}
|
|
86
|
+
|
|
72
87
|
watch([autoplay, count, interval, current], startAutoplay)
|
|
73
88
|
|
|
74
89
|
onScopeDispose(stopAutoplay)
|
|
75
90
|
|
|
76
|
-
return { current, canPrev, canNext, goTo, prev, next }
|
|
91
|
+
return { current, canPrev, canNext, goTo, prev, next, pauseAutoplay, resumeAutoplay }
|
|
77
92
|
}
|
|
@@ -101,6 +101,10 @@ $menu-name: $root-name + '-panel-item';
|
|
|
101
101
|
max-width: 200px;
|
|
102
102
|
flex-grow: 1;
|
|
103
103
|
|
|
104
|
+
// 新列随「从左往右钻取」语义从右侧轻移淡入;纯 CSS 动画不阻塞连续下钻
|
|
105
|
+
animation: cascade-panel-item-enter fn.use-var(transition, fast) fn.use-var(transition, ease-out)
|
|
106
|
+
both;
|
|
107
|
+
|
|
104
108
|
&:not(:last-child) {
|
|
105
109
|
border-right: fn.use-var(border);
|
|
106
110
|
}
|
|
@@ -111,6 +115,16 @@ $menu-name: $root-name + '-panel-item';
|
|
|
111
115
|
user-select: none;
|
|
112
116
|
gap: 4px;
|
|
113
117
|
@include m.flex($justify: space-between);
|
|
118
|
+
transition:
|
|
119
|
+
background-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
120
|
+
color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
121
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
122
|
+
|
|
123
|
+
@include m.is-not(disabled) {
|
|
124
|
+
&:active {
|
|
125
|
+
transform: scale(0.98);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
114
128
|
|
|
115
129
|
&:hover {
|
|
116
130
|
background-color: fn.use-var(bg-color, hover);
|
|
@@ -152,3 +166,16 @@ $menu-name: $root-name + '-panel-item';
|
|
|
152
166
|
flex-shrink: 0;
|
|
153
167
|
}
|
|
154
168
|
}
|
|
169
|
+
|
|
170
|
+
// 新子面板列入场:透明 + 右移 8px 归位(fast,钻取方向从左往右)
|
|
171
|
+
@keyframes cascade-panel-item-enter {
|
|
172
|
+
from {
|
|
173
|
+
opacity: 0;
|
|
174
|
+
transform: translateX(8px);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
to {
|
|
178
|
+
opacity: 1;
|
|
179
|
+
transform: none;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:class="classList"
|
|
4
|
+
role="checkbox"
|
|
5
|
+
:aria-checked="currentValue"
|
|
6
|
+
tabindex="0"
|
|
7
|
+
@click="handleChange"
|
|
8
|
+
@keydown.enter.prevent="handleChange"
|
|
9
|
+
@keydown.space.prevent="handleChange"
|
|
10
|
+
>
|
|
3
11
|
<slot />
|
|
4
12
|
</div>
|
|
5
13
|
</template>
|
|
@@ -18,11 +26,13 @@ const props = withDefaults(defineProps<CheckTagProps>(), {})
|
|
|
18
26
|
|
|
19
27
|
const emits = defineEmits<CheckTagEmits>()
|
|
20
28
|
|
|
29
|
+
const currentValue = computed(() => props.modelValue ?? props.checked ?? false)
|
|
30
|
+
|
|
21
31
|
const classList = computed(() => {
|
|
22
|
-
return [cls.b, bem.is('checked',
|
|
32
|
+
return [cls.b, bem.is('checked', currentValue.value)]
|
|
23
33
|
})
|
|
24
34
|
|
|
25
35
|
const handleChange = () => {
|
|
26
|
-
emits('update:modelValue', !
|
|
36
|
+
emits('update:modelValue', !currentValue.value)
|
|
27
37
|
}
|
|
28
38
|
</script>
|
|
@@ -14,10 +14,21 @@
|
|
|
14
14
|
border: 1px solid fn.use-var(color-primary);
|
|
15
15
|
border-radius: fn.use-var(radius-default);
|
|
16
16
|
background: fn.use-var(color-primary-light-9);
|
|
17
|
+
transition:
|
|
18
|
+
color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
19
|
+
background-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
20
|
+
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
21
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
22
|
+
|
|
17
23
|
&:hover {
|
|
18
24
|
background-color: fn.use-var(color-primary-light-7);
|
|
19
25
|
}
|
|
20
26
|
|
|
27
|
+
// 根元素可聚焦(tabindex 驱动),ring 直接落在根上
|
|
28
|
+
&:focus-visible {
|
|
29
|
+
box-shadow: fn.use-var(focus-ring);
|
|
30
|
+
}
|
|
31
|
+
|
|
21
32
|
@include m.is(checked) {
|
|
22
33
|
cursor: pointer;
|
|
23
34
|
color: #fff;
|
|
@@ -25,9 +36,19 @@
|
|
|
25
36
|
background-color: fn.use-var(color-primary-dark-3);
|
|
26
37
|
}
|
|
27
38
|
|
|
39
|
+
@include m.is-not(disabled) {
|
|
40
|
+
&:active {
|
|
41
|
+
transform: scale(0.97);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
28
45
|
@include m.is(disabled) {
|
|
29
46
|
cursor: not-allowed;
|
|
30
47
|
color: fn.use-var(text-color, disabled);
|
|
31
48
|
background-color: fn.use-var(color, disabled);
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
background-color: fn.use-var(color, disabled);
|
|
52
|
+
}
|
|
32
53
|
}
|
|
33
54
|
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
v-if="!readonly"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:class="className"
|
|
6
|
+
role="checkbox"
|
|
7
|
+
:aria-checked="!!checked"
|
|
8
|
+
tabindex="0"
|
|
9
|
+
@click="handleInput"
|
|
10
|
+
@keydown.enter.prevent="handleInput"
|
|
11
|
+
@keydown.space.prevent="handleInput"
|
|
12
|
+
>
|
|
3
13
|
<slot />
|
|
4
14
|
</div>
|
|
5
15
|
|
|
@@ -9,12 +9,16 @@
|
|
|
9
9
|
/>
|
|
10
10
|
|
|
11
11
|
<span :class="cls.e('wrap')">
|
|
12
|
-
<svg
|
|
12
|
+
<svg
|
|
13
|
+
:class="[cls.e('check'), bem.is('on', !!checked)]"
|
|
14
|
+
viewBox="0 0 64 64"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
>
|
|
13
17
|
<path
|
|
14
18
|
d="M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51 c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92 C54.13,15.78,51.93,15.55,50.42,16.76z"
|
|
15
19
|
></path>
|
|
16
20
|
</svg>
|
|
17
|
-
<span
|
|
21
|
+
<span :class="[cls.m('indeterminate'), bem.is('on', !checked && !!indeterminate)]"></span>
|
|
18
22
|
</span>
|
|
19
23
|
|
|
20
24
|
<span :class="cls.e('label')" v-if="$slots.default"><slot /> </span>
|
|
@@ -59,6 +59,7 @@ $root-name: checkbox;
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
@include m.e(wrap) {
|
|
62
|
+
position: relative;
|
|
62
63
|
border: fn.use-var(border, width) fn.use-var(border, style)
|
|
63
64
|
#{fn.component-var(checkbox, border, fn.use-var(text-color, assist))};
|
|
64
65
|
border-radius: fn.use-var(radius, small);
|
|
@@ -66,10 +67,29 @@ $root-name: checkbox;
|
|
|
66
67
|
transition:
|
|
67
68
|
background-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
68
69
|
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
69
|
-
box-shadow fn.use-var(transition, fast) fn.use-var(transition, ease)
|
|
70
|
+
box-shadow fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
71
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
70
72
|
@include m.flex(inline-flex, center);
|
|
71
73
|
}
|
|
72
74
|
|
|
75
|
+
// 对勾与半选条常驻渲染、绝对定位叠放,靠 scale + opacity 互斥过渡
|
|
76
|
+
@include m.e(check) {
|
|
77
|
+
position: absolute;
|
|
78
|
+
inset: 0;
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
transform: scale(0.6);
|
|
82
|
+
opacity: 0;
|
|
83
|
+
transition:
|
|
84
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out),
|
|
85
|
+
opacity fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
86
|
+
|
|
87
|
+
@include m.is(on) {
|
|
88
|
+
transform: scale(1);
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
73
93
|
@include m.is-not(disabled, readonly) {
|
|
74
94
|
&:hover {
|
|
75
95
|
@include m.bem($root-name, wrap) {
|
|
@@ -77,6 +97,12 @@ $root-name: checkbox;
|
|
|
77
97
|
}
|
|
78
98
|
}
|
|
79
99
|
|
|
100
|
+
&:active {
|
|
101
|
+
@include m.bem($root-name, wrap) {
|
|
102
|
+
transform: scale(0.9);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
80
106
|
// label 不可聚焦,ring 由视觉隐藏的原生 input 驱动
|
|
81
107
|
#{fn.bem($root-name, native)}:focus-visible + #{fn.bem($root-name, wrap)} {
|
|
82
108
|
box-shadow: fn.use-var(focus-ring);
|
|
@@ -88,10 +114,22 @@ $root-name: checkbox;
|
|
|
88
114
|
}
|
|
89
115
|
|
|
90
116
|
@include m.m(indeterminate) {
|
|
117
|
+
position: absolute;
|
|
118
|
+
inset: 0;
|
|
119
|
+
margin: auto;
|
|
91
120
|
background-color: fn.component-var(checkbox, color, #fff);
|
|
92
121
|
width: 10px;
|
|
93
122
|
height: 2px;
|
|
94
|
-
|
|
123
|
+
transform: scale(0.6);
|
|
124
|
+
opacity: 0;
|
|
125
|
+
transition:
|
|
126
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out),
|
|
127
|
+
opacity fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
128
|
+
|
|
129
|
+
@include m.is(on) {
|
|
130
|
+
transform: scale(1);
|
|
131
|
+
opacity: 1;
|
|
132
|
+
}
|
|
95
133
|
}
|
|
96
134
|
}
|
|
97
135
|
|
|
@@ -104,11 +142,22 @@ $button-name: checkbox-button;
|
|
|
104
142
|
cursor: pointer;
|
|
105
143
|
user-select: none;
|
|
106
144
|
padding: 0 0.8em;
|
|
145
|
+
transition:
|
|
146
|
+
background-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
147
|
+
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
148
|
+
color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
149
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
107
150
|
|
|
108
151
|
&:focus-visible {
|
|
109
152
|
box-shadow: fn.use-var(focus-ring);
|
|
110
153
|
}
|
|
111
154
|
|
|
155
|
+
@include m.is-not(disabled) {
|
|
156
|
+
&:active {
|
|
157
|
+
transform: scale(0.97);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
112
161
|
@include m.size using ($size) {
|
|
113
162
|
height: fn.use-var(form-component-height, $size);
|
|
114
163
|
border-radius: fn.use-var(radius, $size);
|
|
@@ -37,6 +37,11 @@ $root-name: chip;
|
|
|
37
37
|
background-color: fn.use-var(bg-color, top);
|
|
38
38
|
color: fn.use-var(text-color, main);
|
|
39
39
|
white-space: nowrap;
|
|
40
|
+
transition:
|
|
41
|
+
border-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
42
|
+
background-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
43
|
+
color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
44
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
@include m.e(label) {
|
|
@@ -64,6 +69,12 @@ $root-name: chip;
|
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
&:active {
|
|
73
|
+
@include m.bem($root-name, face) {
|
|
74
|
+
transform: scale(0.97);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
67
78
|
// label 不可聚焦,ring 由视觉隐藏的原生 input 驱动
|
|
68
79
|
#{fn.bem($root-name, native)}:focus-visible + #{fn.bem($root-name, face)} {
|
|
69
80
|
box-shadow: fn.use-var(focus-ring);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<Teleport to="body" :disabled="!zoomed">
|
|
6
6
|
<div
|
|
7
7
|
ref="zoomWrap"
|
|
8
|
-
:class="[cls.e('zoom-wrap'), bem.is('zoomed', zoomed)]"
|
|
8
|
+
:class="[cls.e('zoom-wrap'), bem.is('zoomed', zoomed), bem.is('zoom-leave', zoomLeaving)]"
|
|
9
9
|
:style="zoomed ? { zIndex: zoomZIndex } : undefined"
|
|
10
10
|
tabindex="-1"
|
|
11
11
|
@keyup.esc="exitZoom"
|
|
@@ -106,6 +106,15 @@ const { disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {
|
|
|
106
106
|
/** 放大状态:复用同一组件根 DOM / 同一 EditorView 实例,Teleport 移入 body 全屏遮罩 */
|
|
107
107
|
const zoomed = shallowRef(false)
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* 退出放大的离场标记:遮罩先播放离场动画(is-zoom-leave,时长对齐 fast token),
|
|
111
|
+
* 动画结束后再切回 display: contents,避免放大↔内联硬切。
|
|
112
|
+
* 根 DOM 不能条件渲染(EditorView 复用),故离场不能交给 <Transition>。
|
|
113
|
+
*/
|
|
114
|
+
const zoomLeaving = shallowRef(false)
|
|
115
|
+
const ZOOM_LEAVE_MS = 150
|
|
116
|
+
let zoomLeaveTimer: ReturnType<typeof setTimeout> | undefined
|
|
117
|
+
|
|
109
118
|
/** 放大期间原位置占位的高度(取放大前组件根高度) */
|
|
110
119
|
const placeholderHeight = shallowRef('')
|
|
111
120
|
|
|
@@ -150,6 +159,12 @@ const hasToolbar = computed(
|
|
|
150
159
|
|
|
151
160
|
function enterZoom() {
|
|
152
161
|
if (disabled.value || zoomed.value) return
|
|
162
|
+
// 离场途中再次进入:取消未完成的退出,直接回到放大态
|
|
163
|
+
if (zoomLeaveTimer) {
|
|
164
|
+
clearTimeout(zoomLeaveTimer)
|
|
165
|
+
zoomLeaveTimer = undefined
|
|
166
|
+
zoomLeaving.value = false
|
|
167
|
+
}
|
|
153
168
|
const root = rootRef.value
|
|
154
169
|
if (root) placeholderHeight.value = `${root.offsetHeight}px`
|
|
155
170
|
zoomZIndex.value = zIndex()
|
|
@@ -166,8 +181,13 @@ function enterZoom() {
|
|
|
166
181
|
}
|
|
167
182
|
|
|
168
183
|
function exitZoom() {
|
|
169
|
-
if (!zoomed.value) return
|
|
170
|
-
|
|
184
|
+
if (!zoomed.value || zoomLeaving.value) return
|
|
185
|
+
zoomLeaving.value = true
|
|
186
|
+
zoomLeaveTimer = setTimeout(() => {
|
|
187
|
+
zoomLeaveTimer = undefined
|
|
188
|
+
zoomLeaving.value = false
|
|
189
|
+
zoomed.value = false
|
|
190
|
+
}, ZOOM_LEAVE_MS)
|
|
171
191
|
}
|
|
172
192
|
|
|
173
193
|
/** 放大期间锁定 body 滚动,退出后恢复原值 */
|
|
@@ -405,6 +425,7 @@ watch(
|
|
|
405
425
|
)
|
|
406
426
|
|
|
407
427
|
onBeforeUnmount(() => {
|
|
428
|
+
clearTimeout(zoomLeaveTimer)
|
|
408
429
|
destroyEditor()
|
|
409
430
|
if (zoomed.value) document.body.style.overflow = prevBodyOverflow
|
|
410
431
|
})
|
|
@@ -26,8 +26,8 @@ $root-name: code-editor;
|
|
|
26
26
|
box-shadow: fn.use-var(shadow, emboss);
|
|
27
27
|
overflow: hidden;
|
|
28
28
|
transition:
|
|
29
|
-
border-color
|
|
30
|
-
box-shadow
|
|
29
|
+
border-color fn.use-var(transition, normal) fn.use-var(transition, ease),
|
|
30
|
+
box-shadow fn.use-var(transition, normal) fn.use-var(transition, ease);
|
|
31
31
|
|
|
32
32
|
&:hover,
|
|
33
33
|
&:focus-within {
|
|
@@ -62,12 +62,18 @@ $root-name: code-editor;
|
|
|
62
62
|
cursor: pointer;
|
|
63
63
|
font-size: 14px;
|
|
64
64
|
color: var(--u-code-editor-gutter-fg);
|
|
65
|
-
transition:
|
|
65
|
+
transition:
|
|
66
|
+
color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
67
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
66
68
|
|
|
67
69
|
&:hover {
|
|
68
70
|
color: fn.use-var(color, primary);
|
|
69
71
|
}
|
|
70
72
|
|
|
73
|
+
&:not(.is-disabled):active {
|
|
74
|
+
transform: scale(0.94);
|
|
75
|
+
}
|
|
76
|
+
|
|
71
77
|
@include m.is(disabled) {
|
|
72
78
|
cursor: not-allowed;
|
|
73
79
|
|
|
@@ -99,9 +105,21 @@ $root-name: code-editor;
|
|
|
99
105
|
display: flex;
|
|
100
106
|
align-items: center;
|
|
101
107
|
justify-content: center;
|
|
102
|
-
background-color:
|
|
108
|
+
background-color: fn.color-a(bg-color, 35, black);
|
|
103
109
|
// 遮罩主动聚焦承接 Esc(对齐 dialog 遮罩),不显示焦点框
|
|
104
110
|
outline: none;
|
|
111
|
+
|
|
112
|
+
// 进出放大用 animation:display: contents ↔ fixed 翻转时 transition 无法起跳。
|
|
113
|
+
// 曲线/时长对齐共享 fade-scale(ease-out + scale 0.96→1 / 收尾 0.98→消隐)。
|
|
114
|
+
// 不能改用 <Transition> 条件渲染:编辑器根 DOM / EditorView 实例要求跨 zoom 复用。
|
|
115
|
+
animation: u-code-editor-zoom-in fn.use-var(transition, normal)
|
|
116
|
+
fn.use-var(transition, ease-out) both;
|
|
117
|
+
|
|
118
|
+
@include m.is(zoom-leave) {
|
|
119
|
+
animation: u-code-editor-zoom-out fn.use-var(transition, fast)
|
|
120
|
+
fn.use-var(transition, ease-out) both;
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
}
|
|
105
123
|
}
|
|
106
124
|
}
|
|
107
125
|
|
|
@@ -207,3 +225,35 @@ $root-name: code-editor;
|
|
|
207
225
|
}
|
|
208
226
|
}
|
|
209
227
|
}
|
|
228
|
+
|
|
229
|
+
// 放大进出场(见 __zoom-wrap.is-zoomed 内注释)
|
|
230
|
+
@keyframes u-code-editor-zoom-in {
|
|
231
|
+
from {
|
|
232
|
+
opacity: 0;
|
|
233
|
+
transform: scale(0.96);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@keyframes u-code-editor-zoom-out {
|
|
238
|
+
to {
|
|
239
|
+
opacity: 0;
|
|
240
|
+
transform: scale(0.98);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// 减弱动态效果:保留淡入淡出,去掉缩放位移
|
|
245
|
+
@media (prefers-reduced-motion: reduce) {
|
|
246
|
+
@keyframes u-code-editor-zoom-in {
|
|
247
|
+
from {
|
|
248
|
+
opacity: 0;
|
|
249
|
+
transform: none;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
@keyframes u-code-editor-zoom-out {
|
|
254
|
+
to {
|
|
255
|
+
opacity: 0;
|
|
256
|
+
transform: none;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
@@ -81,7 +81,10 @@ const headerClassList = computed(() => [
|
|
|
81
81
|
|
|
82
82
|
const expandTransition =
|
|
83
83
|
context?.expandTransition ??
|
|
84
|
-
new ExpandTransition({
|
|
84
|
+
new ExpandTransition({
|
|
85
|
+
transition:
|
|
86
|
+
'height 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1)'
|
|
87
|
+
})
|
|
85
88
|
|
|
86
89
|
const handleClick = () => {
|
|
87
90
|
if (props.disabled) return
|
|
@@ -118,7 +121,12 @@ watch(isActive, async (active) => {
|
|
|
118
121
|
await nextTick()
|
|
119
122
|
}
|
|
120
123
|
if (!wrapperEl.value || !isActive.value) return
|
|
124
|
+
// 内容淡入:ExpandTransition 的 opacity 选项不作用于 expand()/collapse() 路径,
|
|
125
|
+
// 此处手动驱动(transition 串已含 opacity 时长),与高度动画同步;
|
|
126
|
+
// expand() 内部强制 reflow 后再恢复 opacity,过渡才会生效
|
|
127
|
+
wrapperEl.value.style.opacity = '0'
|
|
121
128
|
expandTransition.expand(wrapperEl.value)
|
|
129
|
+
wrapperEl.value.style.opacity = '1'
|
|
122
130
|
return
|
|
123
131
|
}
|
|
124
132
|
if (!wrapperEl.value) return
|
|
@@ -126,6 +134,7 @@ watch(isActive, async (active) => {
|
|
|
126
134
|
expandTransition.collapse(wrapperEl.value, () => {
|
|
127
135
|
if (!isActive.value && props.destroyOnCollapse) contentMounted.value = false
|
|
128
136
|
})
|
|
137
|
+
wrapperEl.value.style.opacity = '0'
|
|
129
138
|
})
|
|
130
139
|
|
|
131
140
|
onBeforeUnmount(() => {
|
|
@@ -22,8 +22,10 @@ const emit = defineEmits<CollapseEmits>()
|
|
|
22
22
|
|
|
23
23
|
const cls = bem('collapse')
|
|
24
24
|
|
|
25
|
+
// 高度与 opacity 同一 transition 串:expand()/collapse() 路径的淡入由 collapse-item 手动驱动
|
|
25
26
|
const expandTransition = new ExpandTransition({
|
|
26
|
-
transition:
|
|
27
|
+
transition:
|
|
28
|
+
'height 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1)'
|
|
27
29
|
})
|
|
28
30
|
|
|
29
31
|
const { size } = useFormFallbackProps([props], { size: 'default' })
|