@veltra/mobile 1.1.0 → 1.1.2
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/_internal/bottom-sheet/bottom-sheet.js +68 -0
- package/dist/components/_internal/bottom-sheet/bottom-sheet.js.map +1 -0
- package/dist/components/_internal/bottom-sheet/style.d.ts +1 -0
- package/dist/components/_internal/bottom-sheet/style.js +1 -0
- package/dist/components/_internal/bottom-sheet/style2.css +121 -0
- package/dist/components/_internal/overlay-container.js +16 -0
- package/dist/components/_internal/overlay-container.js.map +1 -0
- package/dist/components/avatar/avatar.js +47 -0
- package/dist/components/avatar/avatar.js.map +1 -0
- package/dist/components/avatar/style.d.ts +1 -0
- package/dist/components/avatar/style.js +1 -0
- package/dist/components/avatar/style2.css +68 -0
- package/dist/components/badge/badge.js +66 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/badge/style.d.ts +1 -0
- package/dist/components/badge/style.js +1 -0
- package/dist/components/badge/style2.css +94 -0
- package/dist/components/button/button.js +88 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/style.d.ts +1 -0
- package/dist/components/button/style.js +1 -0
- package/dist/components/button/style2.css +515 -0
- package/dist/components/card/card.js +31 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/style.d.ts +1 -0
- package/dist/components/card/style.js +1 -0
- package/dist/components/card/style2.css +49 -0
- package/dist/components/cascade/cascade.js +539 -0
- package/dist/components/cascade/cascade.js.map +1 -0
- package/dist/components/cascade/node.js +19 -0
- package/dist/components/cascade/node.js.map +1 -0
- package/dist/components/cascade/style.d.ts +1 -0
- package/dist/components/cascade/style.js +2 -0
- package/dist/components/cascade/style2.css +378 -0
- package/dist/components/check-tag/check-tag.js +40 -0
- package/dist/components/check-tag/check-tag.js.map +1 -0
- package/dist/components/check-tag/style.d.ts +1 -0
- package/dist/components/check-tag/style.js +1 -0
- package/dist/components/check-tag/style2.css +60 -0
- package/dist/components/checkbox/checkbox.js +86 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/style.d.ts +1 -0
- package/dist/components/checkbox/style.js +2 -0
- package/dist/components/checkbox/style2.css +143 -0
- package/dist/components/checkbox-group/checkbox-group.js +109 -0
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -0
- package/dist/components/checkbox-group/style.d.ts +1 -0
- package/dist/components/checkbox-group/style.js +2 -0
- package/dist/components/checkbox-group/style2.css +73 -0
- package/dist/components/collapse/collapse-item.js +116 -0
- package/dist/components/collapse/collapse-item.js.map +1 -0
- package/dist/components/collapse/collapse.js +94 -0
- package/dist/components/collapse/collapse.js.map +1 -0
- package/dist/components/collapse/di.js +6 -0
- package/dist/components/collapse/di.js.map +1 -0
- package/dist/components/collapse/style.d.ts +1 -0
- package/dist/components/collapse/style.js +1 -0
- package/dist/components/collapse/style2.css +164 -0
- package/dist/components/date-picker/date-picker.js +303 -0
- package/dist/components/date-picker/date-picker.js.map +1 -0
- package/dist/components/date-picker/style.d.ts +1 -0
- package/dist/components/date-picker/style.js +2 -0
- package/dist/components/date-picker/style2.css +221 -0
- package/dist/components/descriptions/descriptions-item.js +15 -0
- package/dist/components/descriptions/descriptions-item.js.map +1 -0
- package/dist/components/descriptions/descriptions.js +56 -0
- package/dist/components/descriptions/descriptions.js.map +1 -0
- package/dist/components/descriptions/style.d.ts +1 -0
- package/dist/components/descriptions/style.js +1 -0
- package/dist/components/descriptions/style2.css +112 -0
- package/dist/components/dialog/dialog.js +157 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/dialog/style.d.ts +2 -0
- package/dist/components/dialog/style.js +4 -0
- package/dist/components/dialog/style2.css +162 -0
- package/dist/components/divider/divider.js +40 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/divider/style.d.ts +1 -0
- package/dist/components/divider/style.js +1 -0
- package/dist/components/divider/style2.css +77 -0
- package/dist/components/drawer/drawer.js +173 -0
- package/dist/components/drawer/drawer.js.map +1 -0
- package/dist/components/drawer/style.d.ts +1 -0
- package/dist/components/drawer/style.js +2 -0
- package/dist/components/drawer/style2.css +251 -0
- package/dist/components/empty/empty.js +25 -0
- package/dist/components/empty/empty.js.map +1 -0
- package/dist/components/empty/style.d.ts +1 -0
- package/dist/components/empty/style.js +1 -0
- package/dist/components/empty/style2.css +50 -0
- package/dist/components/form/form.js +112 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/is-field-modified.js +11 -0
- package/dist/components/form/is-field-modified.js.map +1 -0
- package/dist/components/form/style.d.ts +1 -0
- package/dist/components/form/style.js +2 -0
- package/dist/components/form/style2.css +69 -0
- package/dist/components/form/use-form-fields.js +81 -0
- package/dist/components/form/use-form-fields.js.map +1 -0
- package/dist/components/form/use-node-interceptor.js +78 -0
- package/dist/components/form/use-node-interceptor.js.map +1 -0
- package/dist/components/form-item/form-item.js +127 -0
- package/dist/components/form-item/form-item.js.map +1 -0
- package/dist/components/form-item/helper.js +10 -0
- package/dist/components/form-item/helper.js.map +1 -0
- package/dist/components/form-item/style.d.ts +1 -0
- package/dist/components/form-item/style.js +1 -0
- package/dist/components/form-item/style2.css +108 -0
- package/dist/components/form-item/validate.js +96 -0
- package/dist/components/form-item/validate.js.map +1 -0
- package/dist/components/icon/icon.js +25 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/icon/style.d.ts +1 -0
- package/dist/components/icon/style.js +1 -0
- package/dist/components/icon/style2.css +58 -0
- package/dist/components/input/input.js +184 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/style.d.ts +1 -0
- package/dist/components/input/style.js +1 -0
- package/dist/components/input/style2.css +142 -0
- package/dist/components/list/list-item.js +18 -0
- package/dist/components/list/list-item.js.map +1 -0
- package/dist/components/list/list.js +27 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/list/style.d.ts +1 -0
- package/dist/components/list/style.js +1 -0
- package/dist/components/list/style2.css +58 -0
- package/dist/components/loading/directive.d.ts +3 -0
- package/dist/components/loading/directive.js +28 -0
- package/dist/components/loading/directive.js.map +1 -0
- package/dist/components/loading/index.d.ts +3 -0
- package/dist/components/loading/loading.js +31 -0
- package/dist/components/loading/loading.js.map +1 -0
- package/dist/components/loading/style.d.ts +1 -0
- package/dist/components/loading/style.js +2 -0
- package/dist/components/loading/style2.css +144 -0
- package/dist/components/message/helper.js +22 -0
- package/dist/components/message/helper.js.map +1 -0
- package/dist/components/message/index.d.ts +3 -0
- package/dist/components/message/message-box.js +37 -0
- package/dist/components/message/message-box.js.map +1 -0
- package/dist/components/message/message.d.ts +4 -0
- package/dist/components/message/message.js +63 -0
- package/dist/components/message/message.js.map +1 -0
- package/dist/components/message/message2.js +107 -0
- package/dist/components/message/message2.js.map +1 -0
- package/dist/components/message/style.d.ts +1 -0
- package/dist/components/message/style.js +1 -0
- package/dist/components/message/style2.css +148 -0
- package/dist/components/message-confirm/index.d.ts +3 -0
- package/dist/components/message-confirm/message-confirm-box.js +38 -0
- package/dist/components/message-confirm/message-confirm-box.js.map +1 -0
- package/dist/components/message-confirm/message-confirm.d.ts +4 -0
- package/dist/components/message-confirm/message-confirm.js +62 -0
- package/dist/components/message-confirm/message-confirm.js.map +1 -0
- package/dist/components/message-confirm/message-confirm2.js +118 -0
- package/dist/components/message-confirm/message-confirm2.js.map +1 -0
- package/dist/components/message-confirm/style.d.ts +1 -0
- package/dist/components/message-confirm/style.js +1 -0
- package/dist/components/message-confirm/style2.css +135 -0
- package/dist/components/multi-select/multi-select.js +368 -0
- package/dist/components/multi-select/multi-select.js.map +1 -0
- package/dist/components/multi-select/style.d.ts +1 -0
- package/dist/components/multi-select/style.js +2 -0
- package/dist/components/multi-select/style2.css +340 -0
- package/dist/components/number-input/number-input.js +366 -0
- package/dist/components/number-input/number-input.js.map +1 -0
- package/dist/components/number-input/style.d.ts +1 -0
- package/dist/components/number-input/style.js +2 -0
- package/dist/components/number-input/style2.css +117 -0
- package/dist/components/password-input/password-input.js +141 -0
- package/dist/components/password-input/password-input.js.map +1 -0
- package/dist/components/password-input/style.d.ts +1 -0
- package/dist/components/password-input/style.js +2 -0
- package/dist/components/password-input/style2.css +54 -0
- package/dist/components/progress/progress.js +83 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/progress/style.d.ts +1 -0
- package/dist/components/progress/style.js +1 -0
- package/dist/components/progress/style2.css +113 -0
- package/dist/components/radio/radio.js +68 -0
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/radio/style.d.ts +1 -0
- package/dist/components/radio/style.js +1 -0
- package/dist/components/radio/style2.css +130 -0
- package/dist/components/radio-group/radio-group.js +83 -0
- package/dist/components/radio-group/radio-group.js.map +1 -0
- package/dist/components/radio-group/style.d.ts +1 -0
- package/dist/components/radio-group/style.js +2 -0
- package/dist/components/radio-group/style2.css +41 -0
- package/dist/components/segment/segment.js +143 -0
- package/dist/components/segment/segment.js.map +1 -0
- package/dist/components/segment/style.d.ts +1 -0
- package/dist/components/segment/style.js +1 -0
- package/dist/components/segment/style2.css +145 -0
- package/dist/components/select/select.js +254 -0
- package/dist/components/select/select.js.map +1 -0
- package/dist/components/select/style.d.ts +1 -0
- package/dist/components/select/style.js +2 -0
- package/dist/components/select/style2.css +219 -0
- package/dist/components/select/use-options.js +140 -0
- package/dist/components/select/use-options.js.map +1 -0
- package/dist/components/skeleton/skeleton.js +73 -0
- package/dist/components/skeleton/skeleton.js.map +1 -0
- package/dist/components/skeleton/style.d.ts +1 -0
- package/dist/components/skeleton/style.js +1 -0
- package/dist/components/skeleton/style2.css +95 -0
- package/dist/components/space/space.js +46 -0
- package/dist/components/space/space.js.map +1 -0
- package/dist/components/space/style.d.ts +1 -0
- package/dist/components/space/style.js +1 -0
- package/dist/components/space/style2.css +52 -0
- package/dist/components/steps/steps.js +98 -0
- package/dist/components/steps/steps.js.map +1 -0
- package/dist/components/steps/style.d.ts +1 -0
- package/dist/components/steps/style.js +1 -0
- package/dist/components/steps/style2.css +238 -0
- package/dist/components/switch/style.d.ts +1 -0
- package/dist/components/switch/style.js +1 -0
- package/dist/components/switch/style2.css +141 -0
- package/dist/components/switch/switch.js +82 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/tabs/style.d.ts +1 -0
- package/dist/components/tabs/style.js +1 -0
- package/dist/components/tabs/style2.css +243 -0
- package/dist/components/tabs/tabs.js +131 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/tag/style.d.ts +1 -0
- package/dist/components/tag/style.js +1 -0
- package/dist/components/tag/style2.css +200 -0
- package/dist/components/tag/tag.js +51 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/text/style.d.ts +1 -0
- package/dist/components/text/style.js +1 -0
- package/dist/components/text/style2.css +67 -0
- package/dist/components/text/text.js +54 -0
- package/dist/components/text/text.js.map +1 -0
- package/dist/components/textarea/style.d.ts +1 -0
- package/dist/components/textarea/style.js +1 -0
- package/dist/components/textarea/style2.css +141 -0
- package/dist/components/textarea/textarea.js +151 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/textarea/utils.js +16 -0
- package/dist/components/textarea/utils.js.map +1 -0
- package/dist/components/time-picker/style.d.ts +1 -0
- package/dist/components/time-picker/style.js +2 -0
- package/dist/components/time-picker/style2.css +206 -0
- package/dist/components/time-picker/time-picker.js +285 -0
- package/dist/components/time-picker/time-picker.js.map +1 -0
- package/dist/components/timeline/style.d.ts +1 -0
- package/dist/components/timeline/style.js +1 -0
- package/dist/components/timeline/style2.css +101 -0
- package/dist/components/timeline/timeline-item.js +31 -0
- package/dist/components/timeline/timeline-item.js.map +1 -0
- package/dist/components/timeline/timeline.js +16 -0
- package/dist/components/timeline/timeline.js.map +1 -0
- package/dist/components/uploader/style.d.ts +1 -0
- package/dist/components/uploader/style.js +1 -0
- package/dist/components/uploader/style2.css +218 -0
- package/dist/components/uploader/uploader.js +303 -0
- package/dist/components/uploader/uploader.js.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +52 -0
- package/dist/shared/bem.js +13 -0
- package/dist/shared/bem.js.map +1 -0
- package/dist/shared/use-scroll-lock.d.ts +9 -0
- package/dist/shared/use-scroll-lock.js +93 -0
- package/dist/shared/use-scroll-lock.js.map +1 -0
- package/dist/shared/use-touch-gesture.d.ts +61 -0
- package/dist/shared/use-touch-gesture.js +91 -0
- package/dist/shared/use-touch-gesture.js.map +1 -0
- package/dist/types/avatar.d.ts +26 -0
- package/dist/types/badge.d.ts +25 -0
- package/dist/types/button.d.ts +44 -0
- package/dist/types/card.d.ts +12 -0
- package/dist/types/cascade.d.ts +77 -0
- package/dist/types/check-tag.d.ts +18 -0
- package/dist/types/checkbox-group.d.ts +19 -0
- package/dist/types/checkbox.d.ts +14 -0
- package/dist/types/collapse.d.ts +66 -0
- package/dist/types/date-picker.d.ts +35 -0
- package/dist/types/descriptions.d.ts +20 -0
- package/dist/types/dialog.d.ts +49 -0
- package/dist/types/divider.d.ts +12 -0
- package/dist/types/drawer.d.ts +32 -0
- package/dist/types/empty.d.ts +15 -0
- package/dist/types/form-item.d.ts +20 -0
- package/dist/types/form.d.ts +51 -0
- package/dist/types/icon.d.ts +9 -0
- package/dist/types/input.d.ts +48 -0
- package/dist/types/list.d.ts +10 -0
- package/dist/types/loading.d.ts +16 -0
- package/dist/types/message-confirm.d.ts +65 -0
- package/dist/types/message.d.ts +64 -0
- package/dist/types/multi-select.d.ts +35 -0
- package/dist/types/number-input.d.ts +30 -0
- package/dist/types/password-input.d.ts +15 -0
- package/dist/types/progress.d.ts +19 -0
- package/dist/types/radio-group.d.ts +32 -0
- package/dist/types/radio.d.ts +17 -0
- package/dist/types/segment.d.ts +38 -0
- package/dist/types/select.d.ts +62 -0
- package/dist/types/skeleton.d.ts +22 -0
- package/dist/types/space.d.ts +18 -0
- package/dist/types/steps.d.ts +61 -0
- package/dist/types/switch.d.ts +16 -0
- package/dist/types/tabs.d.ts +59 -0
- package/dist/types/tag.d.ts +18 -0
- package/dist/types/text.d.ts +26 -0
- package/dist/types/textarea.d.ts +70 -0
- package/dist/types/time-picker.d.ts +36 -0
- package/dist/types/timeline.d.ts +14 -0
- package/dist/types/uploader.d.ts +47 -0
- package/package.json +1 -1
- package/src/components/descriptions/descriptions.vue +12 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/** flex布局 */
|
|
3
|
+
/**
|
|
4
|
+
* 设置css变量
|
|
5
|
+
* 参数1:变量前缀
|
|
6
|
+
* 参数2: 一个由值组成的列表或者由key, value组成的map
|
|
7
|
+
* css-var(height, (
|
|
8
|
+
* large: 40px
|
|
9
|
+
* default: 32px
|
|
10
|
+
* small: 24px
|
|
11
|
+
* ))
|
|
12
|
+
* 生成的css变量:
|
|
13
|
+
* --u-height-large: 40px;
|
|
14
|
+
* --u-height-default: 32px;
|
|
15
|
+
* --u-height-small: 24px;
|
|
16
|
+
*/
|
|
17
|
+
/** 暗色:`UITheme.render()` 按主题系列写入 html[data-theme] */
|
|
18
|
+
/**
|
|
19
|
+
* 移动端密度 token 层(`--um-*` 前缀,纯 SCSS,不经运行时注入)
|
|
20
|
+
*
|
|
21
|
+
* - 值表是编译期回退值的单一来源:组件样式一律经 `use-var()` 取密度值,
|
|
22
|
+
* 产出 `var(--um-<name>, 回退值)`,宿主可在任意层级用 `--um-*` 覆盖
|
|
23
|
+
* - 配色、圆角、阴影等观感 token 仍走 `@veltra/styles` 的 `--u-*` 预设体系
|
|
24
|
+
* - 本模块只提供值与函数,不产出任何 CSS;组件 SCSS 以
|
|
25
|
+
* `@use '../../styles/tokens' as t;` 引用(下划线 partial,禁止单独编译)
|
|
26
|
+
*/
|
|
27
|
+
.um-dialog__overlay {
|
|
28
|
+
position: fixed;
|
|
29
|
+
inset: 0;
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
outline: none;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
padding: var(--u-gap-large);
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
flex-wrap: nowrap;
|
|
38
|
+
}
|
|
39
|
+
.um-dialog__overlay.is-modal {
|
|
40
|
+
background-color: rgba(0, 0, 0, 0.32);
|
|
41
|
+
pointer-events: auto;
|
|
42
|
+
}
|
|
43
|
+
.um-dialog__overlay.is-fullscreen {
|
|
44
|
+
padding: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.um-dialog {
|
|
48
|
+
pointer-events: auto;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
flex-wrap: nowrap;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
width: 100%;
|
|
55
|
+
max-width: 320px;
|
|
56
|
+
max-height: 86%;
|
|
57
|
+
border-radius: var(--um-panel-radius, 12px);
|
|
58
|
+
background-color: var(--u-bg-color-top);
|
|
59
|
+
box-shadow: var(--u-shadow-lg);
|
|
60
|
+
}
|
|
61
|
+
.um-dialog__header {
|
|
62
|
+
position: relative;
|
|
63
|
+
flex-shrink: 0;
|
|
64
|
+
min-height: var(--um-form-row-height, 48px);
|
|
65
|
+
padding: var(--um-spacing-lg, 16px) var(--um-spacing-lg, 16px) 0;
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
align-items: center;
|
|
69
|
+
flex-wrap: nowrap;
|
|
70
|
+
}
|
|
71
|
+
.um-dialog__title {
|
|
72
|
+
width: 100%;
|
|
73
|
+
font-size: var(--um-font-size-main, 16px);
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
color: var(--u-text-color-title);
|
|
76
|
+
line-height: 1.4;
|
|
77
|
+
text-align: center;
|
|
78
|
+
display: -webkit-box;
|
|
79
|
+
-webkit-box-orient: vertical;
|
|
80
|
+
-webkit-line-clamp: 2;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
}
|
|
83
|
+
.um-dialog__close {
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: 0;
|
|
86
|
+
right: 0;
|
|
87
|
+
min-width: var(--um-touch-target, 44px);
|
|
88
|
+
min-height: var(--um-touch-target, 44px);
|
|
89
|
+
padding: 0;
|
|
90
|
+
border: none;
|
|
91
|
+
background-color: transparent;
|
|
92
|
+
color: var(--u-text-color-second);
|
|
93
|
+
font-size: var(--um-font-size-main, 16px);
|
|
94
|
+
line-height: 1;
|
|
95
|
+
-webkit-appearance: none;
|
|
96
|
+
-webkit-tap-highlight-color: transparent;
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
align-items: center;
|
|
100
|
+
flex-wrap: nowrap;
|
|
101
|
+
}
|
|
102
|
+
.um-dialog__close:active {
|
|
103
|
+
color: var(--u-text-color-main);
|
|
104
|
+
}
|
|
105
|
+
.um-dialog__close > svg {
|
|
106
|
+
width: 1em;
|
|
107
|
+
height: 1em;
|
|
108
|
+
}
|
|
109
|
+
.um-dialog__body {
|
|
110
|
+
flex-grow: 1;
|
|
111
|
+
overflow-y: auto;
|
|
112
|
+
-webkit-overflow-scrolling: touch;
|
|
113
|
+
text-align: center;
|
|
114
|
+
font-size: var(--um-font-size-main, 16px);
|
|
115
|
+
color: var(--u-text-color-second);
|
|
116
|
+
line-height: 1.6;
|
|
117
|
+
padding: var(--um-spacing-lg, 16px);
|
|
118
|
+
word-break: break-word;
|
|
119
|
+
}
|
|
120
|
+
.um-dialog__body.is-align-left {
|
|
121
|
+
text-align: left;
|
|
122
|
+
}
|
|
123
|
+
.um-dialog__body.is-align-right {
|
|
124
|
+
text-align: right;
|
|
125
|
+
}
|
|
126
|
+
.um-dialog__footer {
|
|
127
|
+
flex-shrink: 0;
|
|
128
|
+
gap: var(--um-spacing-md, 12px);
|
|
129
|
+
min-height: var(--um-form-row-height, 48px);
|
|
130
|
+
padding: var(--um-spacing-sm, 8px) var(--um-spacing-lg, 16px);
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: flex-start;
|
|
133
|
+
align-items: center;
|
|
134
|
+
flex-wrap: nowrap;
|
|
135
|
+
}
|
|
136
|
+
.um-dialog__footer > * {
|
|
137
|
+
flex: 1 1 0;
|
|
138
|
+
}
|
|
139
|
+
.um-dialog__footer.is-actions-vertical {
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
}
|
|
142
|
+
.um-dialog__footer.is-actions-vertical > * {
|
|
143
|
+
width: 100%;
|
|
144
|
+
flex-basis: auto;
|
|
145
|
+
}
|
|
146
|
+
.um-dialog.is-fullscreen {
|
|
147
|
+
max-width: none;
|
|
148
|
+
max-height: none;
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: 100%;
|
|
151
|
+
border-radius: 0;
|
|
152
|
+
}
|
|
153
|
+
.um-dialog.is-fullscreen .um-dialog__body {
|
|
154
|
+
padding-bottom: calc(var(--um-spacing-lg, 16px) + env(safe-area-inset-bottom));
|
|
155
|
+
}
|
|
156
|
+
.um-dialog.is-fullscreen .um-dialog__footer {
|
|
157
|
+
padding-bottom: calc(var(--um-spacing-sm, 8px) + env(safe-area-inset-bottom));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.um-dialog__trigger {
|
|
161
|
+
display: inline-flex;
|
|
162
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { bem } from "../../shared/bem.js";
|
|
2
|
+
import { computed, createCommentVNode, createElementBlock, defineComponent, normalizeClass, openBlock, renderSlot, unref, useSlots } from "vue";
|
|
3
|
+
// src/components/divider/divider.vue
|
|
4
|
+
const _hoisted_1 = ["aria-orientation"];
|
|
5
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
+
name: "UDivider",
|
|
7
|
+
__name: "divider",
|
|
8
|
+
props: {
|
|
9
|
+
direction: { default: "horizontal" },
|
|
10
|
+
dashed: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
14
|
+
align: { default: "center" }
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const slots = useSlots();
|
|
18
|
+
const cls = bem("divider");
|
|
19
|
+
const classList = computed(() => [
|
|
20
|
+
cls.b,
|
|
21
|
+
cls.m(__props.direction),
|
|
22
|
+
bem.is("dashed", __props.dashed),
|
|
23
|
+
bem.is("with-text", !!slots.default),
|
|
24
|
+
slots.default && cls.m(__props.align)
|
|
25
|
+
]);
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(), createElementBlock("div", {
|
|
28
|
+
class: normalizeClass(classList.value),
|
|
29
|
+
role: "separator",
|
|
30
|
+
"aria-orientation": __props.direction
|
|
31
|
+
}, [unref(slots).default ? (openBlock(), createElementBlock("span", {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: normalizeClass(unref(cls).e("text"))
|
|
34
|
+
}, [renderSlot(_ctx.$slots, "default")], 2)) : createCommentVNode("v-if", true)], 10, _hoisted_1);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export { _sfc_main as default };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_renderSlot","_createCommentVNode"],"sources":["../../../src/components/divider/divider.vue"],"sourcesContent":["<template>\n <div :class=\"classList\" role=\"separator\" :aria-orientation=\"direction\">\n <span v-if=\"slots.default\" :class=\"cls.e('text')\">\n <slot />\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\n\nimport { bem } from '../../shared/bem'\nimport type { DividerProps } from '../../types/divider'\n\ndefineOptions({ name: 'UDivider' })\n\nconst { direction = 'horizontal', dashed = false, align = 'center' } = defineProps<DividerProps>()\n\nconst slots = useSlots()\nconst cls = bem('divider')\n\nconst classList = computed(() => [\n cls.b,\n cls.m(direction),\n bem.is('dashed', dashed),\n bem.is('with-text', !!slots.default),\n slots.default && cls.m(align)\n])\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;EAkBA,MAAM,QAAQ,SAAS;EACvB,MAAM,MAAM,IAAI,SAAS;EAEzB,MAAM,YAAY,eAAe;GAC/B,IAAI;GACJ,IAAI,EAAE,QAAA,SAAS;GACf,IAAI,GAAG,UAAU,QAAA,MAAM;GACvB,IAAI,GAAG,aAAa,CAAC,CAAC,MAAM,OAAO;GACnC,MAAM,WAAW,IAAI,EAAE,QAAA,KAAK;EAC9B,CAAC;;GA1BC,OAAAA,UAAA,GAAAC,mBAIM,OAAA;IAJA,OAAKC,eAAE,UAAA,KAAS;IAAE,MAAK;IAAa,oBAAkB,QAAA;G,IAC9CC,MAAA,KAAA,CAAK,CAAC,WAAlBH,UAAA,GAAAC,mBAEO,QAAA;;IAFqB,OAAKC,eAAEC,MAAA,GAAA,CAAG,CAAC,EAAC,MAAA,CAAA;G,IACtCC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./style2.css";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/** flex布局 */
|
|
3
|
+
/**
|
|
4
|
+
* 设置css变量
|
|
5
|
+
* 参数1:变量前缀
|
|
6
|
+
* 参数2: 一个由值组成的列表或者由key, value组成的map
|
|
7
|
+
* css-var(height, (
|
|
8
|
+
* large: 40px
|
|
9
|
+
* default: 32px
|
|
10
|
+
* small: 24px
|
|
11
|
+
* ))
|
|
12
|
+
* 生成的css变量:
|
|
13
|
+
* --u-height-large: 40px;
|
|
14
|
+
* --u-height-default: 32px;
|
|
15
|
+
* --u-height-small: 24px;
|
|
16
|
+
*/
|
|
17
|
+
/** 暗色:`UITheme.render()` 按主题系列写入 html[data-theme] */
|
|
18
|
+
/**
|
|
19
|
+
* 移动端密度 token 层(`--um-*` 前缀,纯 SCSS,不经运行时注入)
|
|
20
|
+
*
|
|
21
|
+
* - 值表是编译期回退值的单一来源:组件样式一律经 `use-var()` 取密度值,
|
|
22
|
+
* 产出 `var(--um-<name>, 回退值)`,宿主可在任意层级用 `--um-*` 覆盖
|
|
23
|
+
* - 配色、圆角、阴影等观感 token 仍走 `@veltra/styles` 的 `--u-*` 预设体系
|
|
24
|
+
* - 本模块只提供值与函数,不产出任何 CSS;组件 SCSS 以
|
|
25
|
+
* `@use '../../styles/tokens' as t;` 引用(下划线 partial,禁止单独编译)
|
|
26
|
+
*/
|
|
27
|
+
.um-divider {
|
|
28
|
+
border-top: 1px solid var(--u-border-color);
|
|
29
|
+
margin: var(--um-spacing-lg, 16px) 0;
|
|
30
|
+
}
|
|
31
|
+
.um-divider.is-dashed {
|
|
32
|
+
border-top-style: dashed;
|
|
33
|
+
}
|
|
34
|
+
.um-divider--vertical {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
border-top: none;
|
|
37
|
+
border-left: 1px solid var(--u-border-color);
|
|
38
|
+
height: 1em;
|
|
39
|
+
margin: 0 var(--um-spacing-sm, 8px);
|
|
40
|
+
vertical-align: middle;
|
|
41
|
+
}
|
|
42
|
+
.um-divider--vertical.is-dashed {
|
|
43
|
+
border-left-style: dashed;
|
|
44
|
+
}
|
|
45
|
+
.um-divider.is-with-text {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
border-top: none;
|
|
49
|
+
margin: var(--um-spacing-lg, 16px) 0;
|
|
50
|
+
}
|
|
51
|
+
.um-divider.is-with-text::before, .um-divider.is-with-text::after {
|
|
52
|
+
content: "";
|
|
53
|
+
flex: 1;
|
|
54
|
+
border-top: 1px solid var(--u-border-color);
|
|
55
|
+
}
|
|
56
|
+
.um-divider.is-with-text::before {
|
|
57
|
+
margin-right: var(--um-spacing-sm, 8px);
|
|
58
|
+
}
|
|
59
|
+
.um-divider.is-with-text::after {
|
|
60
|
+
margin-left: var(--um-spacing-sm, 8px);
|
|
61
|
+
}
|
|
62
|
+
.um-divider.is-with-text.is-dashed::before, .um-divider.is-with-text.is-dashed::after {
|
|
63
|
+
border-top-style: dashed;
|
|
64
|
+
}
|
|
65
|
+
.um-divider--left.is-with-text::before {
|
|
66
|
+
flex: none;
|
|
67
|
+
width: 5%;
|
|
68
|
+
}
|
|
69
|
+
.um-divider--right.is-with-text::after {
|
|
70
|
+
flex: none;
|
|
71
|
+
width: 5%;
|
|
72
|
+
}
|
|
73
|
+
.um-divider__text {
|
|
74
|
+
color: var(--u-text-color-main);
|
|
75
|
+
font-size: var(--um-font-size-main, 16px);
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { bem } from "../../shared/bem.js";
|
|
2
|
+
import { getOverlayContainer, useOverlayScrollLock } from "../_internal/overlay-container.js";
|
|
3
|
+
import { shouldCloseByDrag, useTouchGesture } from "../../shared/use-touch-gesture.js";
|
|
4
|
+
import { Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, normalizeStyle, openBlock, renderSlot, shallowRef, toDisplayString, unref, useModel, watch, withCtx, withModifiers } from "vue";
|
|
5
|
+
import { zIndex } from "@veltra/utils";
|
|
6
|
+
import { Close } from "@veltra/icons/normal";
|
|
7
|
+
// src/components/drawer/drawer.vue
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
name: "UDrawer",
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
__name: "drawer",
|
|
12
|
+
props: /*@__PURE__*/ mergeModels({
|
|
13
|
+
modelValue: { type: Boolean },
|
|
14
|
+
placement: { default: "bottom" },
|
|
15
|
+
showClose: { type: Boolean },
|
|
16
|
+
title: {}
|
|
17
|
+
}, {
|
|
18
|
+
"modelValue": {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
"modelModifiers": {}
|
|
23
|
+
}),
|
|
24
|
+
emits: /*@__PURE__*/ mergeModels([
|
|
25
|
+
"update:modelValue",
|
|
26
|
+
"close",
|
|
27
|
+
"closed"
|
|
28
|
+
], ["update:modelValue"]),
|
|
29
|
+
setup(__props, { emit: __emit }) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
const emit = __emit;
|
|
32
|
+
const cls = bem("drawer");
|
|
33
|
+
const overlayCls = bem("drawer-overlay");
|
|
34
|
+
const visible = useModel(__props, "modelValue");
|
|
35
|
+
const overlayVisible = shallowRef(false);
|
|
36
|
+
const drawerVisible = shallowRef(false);
|
|
37
|
+
const overlayZIndex = shallowRef();
|
|
38
|
+
const transitionName = computed(() => `drawer-slide-${props.placement}`);
|
|
39
|
+
const scrollLock = useOverlayScrollLock();
|
|
40
|
+
watch(visible, (v) => {
|
|
41
|
+
if (v) {
|
|
42
|
+
overlayZIndex.value = zIndex();
|
|
43
|
+
resetDrag();
|
|
44
|
+
scrollLock.lock();
|
|
45
|
+
overlayVisible.value = true;
|
|
46
|
+
} else drawerVisible.value = false;
|
|
47
|
+
}, { immediate: true });
|
|
48
|
+
function onOverlayEnter() {
|
|
49
|
+
drawerVisible.value = true;
|
|
50
|
+
}
|
|
51
|
+
function onAfterDrawerLeave() {
|
|
52
|
+
overlayVisible.value = false;
|
|
53
|
+
}
|
|
54
|
+
/** 遮罩退场完成即整条关闭链路结束:解锁背景滚动并通知 closed */
|
|
55
|
+
function onOverlayLeave() {
|
|
56
|
+
scrollLock.unlock();
|
|
57
|
+
emit("closed");
|
|
58
|
+
}
|
|
59
|
+
/** 关闭抽屉:写回 model(emit update:modelValue),滑出经 watch 驱动 */
|
|
60
|
+
const close = () => {
|
|
61
|
+
visible.value = false;
|
|
62
|
+
emit("close");
|
|
63
|
+
};
|
|
64
|
+
/** 各方位沿关闭方向拖拽的轴与符号:bottom 下拉 / top 上推 / left 左拖 / right 右拖 */
|
|
65
|
+
const DRAG_DISMISS = {
|
|
66
|
+
bottom: {
|
|
67
|
+
axis: "y",
|
|
68
|
+
sign: 1
|
|
69
|
+
},
|
|
70
|
+
top: {
|
|
71
|
+
axis: "y",
|
|
72
|
+
sign: -1
|
|
73
|
+
},
|
|
74
|
+
left: {
|
|
75
|
+
axis: "x",
|
|
76
|
+
sign: -1
|
|
77
|
+
},
|
|
78
|
+
right: {
|
|
79
|
+
axis: "x",
|
|
80
|
+
sign: 1
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
/** 沿关闭方向的实时偏移,经 CSS 变量并入滑动过渡,松手回弹或继续滑出 */
|
|
84
|
+
const dragOffset = shallowRef(0);
|
|
85
|
+
const dragging = shallowRef(false);
|
|
86
|
+
const dragStyle = computed(() => {
|
|
87
|
+
return dragOffset.value ? { "--u-drawer-drag": `${dragOffset.value}px` } : void 0;
|
|
88
|
+
});
|
|
89
|
+
const drawerClass = computed(() => {
|
|
90
|
+
return [
|
|
91
|
+
cls.b,
|
|
92
|
+
bem.is(props.placement),
|
|
93
|
+
bem.is("dragging", dragging.value)
|
|
94
|
+
];
|
|
95
|
+
});
|
|
96
|
+
const dragHandlers = useTouchGesture({
|
|
97
|
+
onStart() {
|
|
98
|
+
dragging.value = true;
|
|
99
|
+
},
|
|
100
|
+
onMove(state) {
|
|
101
|
+
const { axis, sign } = DRAG_DISMISS[props.placement];
|
|
102
|
+
dragOffset.value = Math.max(0, sign * (axis === "x" ? state.dx : state.dy));
|
|
103
|
+
},
|
|
104
|
+
onEnd(state) {
|
|
105
|
+
dragging.value = false;
|
|
106
|
+
const { axis, sign } = DRAG_DISMISS[props.placement];
|
|
107
|
+
if (shouldCloseByDrag(state, {
|
|
108
|
+
axis,
|
|
109
|
+
sign
|
|
110
|
+
})) close();
|
|
111
|
+
else dragOffset.value = 0;
|
|
112
|
+
},
|
|
113
|
+
onCancel() {
|
|
114
|
+
dragging.value = false;
|
|
115
|
+
dragOffset.value = 0;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
function resetDrag() {
|
|
119
|
+
dragging.value = false;
|
|
120
|
+
dragOffset.value = 0;
|
|
121
|
+
}
|
|
122
|
+
return (_ctx, _cache) => {
|
|
123
|
+
return openBlock(), createBlock(Teleport, { to: unref(getOverlayContainer)() }, [createVNode(Transition, {
|
|
124
|
+
name: "fade",
|
|
125
|
+
appear: "",
|
|
126
|
+
onEnter: onOverlayEnter,
|
|
127
|
+
onAfterLeave: onOverlayLeave
|
|
128
|
+
}, {
|
|
129
|
+
default: withCtx(() => [overlayVisible.value ? (openBlock(), createElementBlock("div", {
|
|
130
|
+
key: 0,
|
|
131
|
+
class: normalizeClass(unref(overlayCls).b),
|
|
132
|
+
style: normalizeStyle({ zIndex: overlayZIndex.value }),
|
|
133
|
+
onClick: close
|
|
134
|
+
}, [createVNode(Transition, {
|
|
135
|
+
name: transitionName.value,
|
|
136
|
+
appear: "",
|
|
137
|
+
onAfterLeave: onAfterDrawerLeave
|
|
138
|
+
}, {
|
|
139
|
+
default: withCtx(() => [drawerVisible.value ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
140
|
+
class: drawerClass.value,
|
|
141
|
+
style: dragStyle.value,
|
|
142
|
+
onClick: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"]))
|
|
143
|
+
}), [
|
|
144
|
+
createCommentVNode(" 边缘拖拽把手:上/下为整行横把手,左/右为内沿居中的竖把手 "),
|
|
145
|
+
createElementVNode("div", {
|
|
146
|
+
class: normalizeClass(unref(cls).e("grabber")),
|
|
147
|
+
onTouchstartPassive: _cache[0] || (_cache[0] = (...args) => unref(dragHandlers).touchstart && unref(dragHandlers).touchstart(...args)),
|
|
148
|
+
onTouchmove: _cache[1] || (_cache[1] = withModifiers((...args) => unref(dragHandlers).touchmove && unref(dragHandlers).touchmove(...args), ["prevent"])),
|
|
149
|
+
onTouchendPassive: _cache[2] || (_cache[2] = (...args) => unref(dragHandlers).touchend && unref(dragHandlers).touchend(...args)),
|
|
150
|
+
onTouchcancelPassive: _cache[3] || (_cache[3] = (...args) => unref(dragHandlers).touchcancel && unref(dragHandlers).touchcancel(...args))
|
|
151
|
+
}, null, 34),
|
|
152
|
+
__props.title || __props.showClose ? (openBlock(), createElementBlock("div", {
|
|
153
|
+
key: 0,
|
|
154
|
+
class: normalizeClass(unref(cls).e("header"))
|
|
155
|
+
}, [createElementVNode("span", { class: normalizeClass(unref(cls).e("title")) }, toDisplayString(__props.title), 3), __props.showClose ? (openBlock(), createElementBlock("button", {
|
|
156
|
+
key: 0,
|
|
157
|
+
class: normalizeClass(unref(cls).e("close")),
|
|
158
|
+
type: "button",
|
|
159
|
+
"aria-label": "关闭",
|
|
160
|
+
onClick: close
|
|
161
|
+
}, [createVNode(unref(Close))], 2)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true),
|
|
162
|
+
createElementVNode("div", { class: normalizeClass(unref(cls).e("content")) }, [renderSlot(_ctx.$slots, "default")], 2)
|
|
163
|
+
], 16)) : createCommentVNode("v-if", true)]),
|
|
164
|
+
_: 3
|
|
165
|
+
}, 8, ["name"])], 6)) : createCommentVNode("v-if", true)]),
|
|
166
|
+
_: 3
|
|
167
|
+
})], 8, ["to"]);
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
export { _sfc_main as default };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.js","names":["$attrs","_useModel","_openBlock","_createBlock","_Teleport","_unref","_createVNode","_Transition","_withCtx","_createElementBlock","_normalizeClass","_normalizeStyle","_mergeProps","_withModifiers","_createCommentVNode","_createElementVNode","_toDisplayString","_renderSlot"],"sources":["../../../src/components/drawer/drawer.vue"],"sourcesContent":["<template>\n <Teleport :to=\"getOverlayContainer()\">\n <transition name=\"fade\" appear @enter=\"onOverlayEnter\" @after-leave=\"onOverlayLeave\">\n <div\n v-if=\"overlayVisible\"\n :class=\"overlayCls.b\"\n :style=\"{ zIndex: overlayZIndex }\"\n @click=\"close\"\n >\n <transition :name=\"transitionName\" appear @after-leave=\"onAfterDrawerLeave\">\n <div\n v-if=\"drawerVisible\"\n v-bind=\"$attrs\"\n :class=\"drawerClass\"\n :style=\"dragStyle\"\n @click.stop\n >\n <!-- 边缘拖拽把手:上/下为整行横把手,左/右为内沿居中的竖把手 -->\n <div\n :class=\"cls.e('grabber')\"\n @touchstart.passive=\"dragHandlers.touchstart\"\n @touchmove.prevent=\"dragHandlers.touchmove\"\n @touchend.passive=\"dragHandlers.touchend\"\n @touchcancel.passive=\"dragHandlers.touchcancel\"\n />\n\n <div v-if=\"title || showClose\" :class=\"cls.e('header')\">\n <span :class=\"cls.e('title')\">{{ title }}</span>\n\n <button\n v-if=\"showClose\"\n :class=\"cls.e('close')\"\n type=\"button\"\n aria-label=\"关闭\"\n @click=\"close\"\n >\n <Close />\n </button>\n </div>\n\n <div :class=\"cls.e('content')\">\n <slot />\n </div>\n </div>\n </transition>\n </div>\n </transition>\n </Teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Close } from '@veltra/icons/normal'\nimport { zIndex } from '@veltra/utils'\nimport { computed, shallowRef, watch } from 'vue'\n\nimport { bem } from '../../shared/bem'\nimport { shouldCloseByDrag, useTouchGesture } from '../../shared/use-touch-gesture'\nimport type { DrawerEmits, DrawerPlacement, DrawerProps } from '../../types/drawer'\nimport { getOverlayContainer, useOverlayScrollLock } from '../_internal/overlay-container'\n\ndefineOptions({ name: 'UDrawer', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<DrawerProps>(), { placement: 'bottom' })\n\nconst emit = defineEmits<DrawerEmits>()\n\nconst cls = bem('drawer')\nconst overlayCls = bem('drawer-overlay')\n\nconst visible = defineModel<boolean>({ default: false })\n\nconst overlayVisible = shallowRef(false)\nconst drawerVisible = shallowRef(false)\nconst overlayZIndex = shallowRef<number>()\n\nconst transitionName = computed(() => `drawer-slide-${props.placement}`)\n\n// 打开期间锁定背景滚动(body / 设备外壳视口),完全关闭后恢复原滚动位置\nconst scrollLock = useOverlayScrollLock()\n\n// 打开时盖在新一层级上;关闭链路:抽屉滑出 -> 遮罩退场 -> closed\nwatch(\n visible,\n (v) => {\n if (v) {\n overlayZIndex.value = zIndex()\n resetDrag()\n scrollLock.lock()\n overlayVisible.value = true\n } else {\n drawerVisible.value = false\n }\n },\n { immediate: true }\n)\n\nfunction onOverlayEnter() {\n drawerVisible.value = true\n}\n\nfunction onAfterDrawerLeave() {\n overlayVisible.value = false\n}\n\n/** 遮罩退场完成即整条关闭链路结束:解锁背景滚动并通知 closed */\nfunction onOverlayLeave() {\n scrollLock.unlock()\n emit('closed')\n}\n\n/** 关闭抽屉:写回 model(emit update:modelValue),滑出经 watch 驱动 */\nconst close = () => {\n visible.value = false\n emit('close')\n}\n\n// ---- 四向边缘拖拽关闭(实现细节,不新增公开 API) ----\n\n/** 各方位沿关闭方向拖拽的轴与符号:bottom 下拉 / top 上推 / left 左拖 / right 右拖 */\nconst DRAG_DISMISS: Record<DrawerPlacement, { axis: 'x' | 'y'; sign: 1 | -1 }> = {\n bottom: { axis: 'y', sign: 1 },\n top: { axis: 'y', sign: -1 },\n left: { axis: 'x', sign: -1 },\n right: { axis: 'x', sign: 1 }\n}\n\n/** 沿关闭方向的实时偏移,经 CSS 变量并入滑动过渡,松手回弹或继续滑出 */\nconst dragOffset = shallowRef(0)\nconst dragging = shallowRef(false)\n\nconst dragStyle = computed(() => {\n return dragOffset.value ? { '--u-drawer-drag': `${dragOffset.value}px` } : undefined\n})\n\nconst drawerClass = computed(() => {\n return [cls.b, bem.is(props.placement), bem.is('dragging', dragging.value)]\n})\n\nconst dragHandlers = useTouchGesture({\n onStart() {\n dragging.value = true\n },\n onMove(state) {\n const { axis, sign } = DRAG_DISMISS[props.placement]\n // 只跟随朝关闭方向的分量,反方向拖动面板不动\n dragOffset.value = Math.max(0, sign * (axis === 'x' ? state.dx : state.dy))\n },\n onEnd(state) {\n dragging.value = false\n const { axis, sign } = DRAG_DISMISS[props.placement]\n if (shouldCloseByDrag(state, { axis, sign })) {\n close()\n } else {\n dragOffset.value = 0\n }\n },\n onCancel() {\n // 手势被打断(来电、落到多指等):回弹而不是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