wx-sky-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +138 -0
- package/miniprogram_dist/action-sheet/index.d.ts +0 -0
- package/miniprogram_dist/action-sheet/index.js +67 -0
- package/miniprogram_dist/action-sheet/index.js.map +1 -0
- package/miniprogram_dist/action-sheet/index.json +6 -0
- package/miniprogram_dist/action-sheet/index.wxml +62 -0
- package/miniprogram_dist/action-sheet/index.wxss +227 -0
- package/miniprogram_dist/action-sheet/index.wxss.map +1 -0
- package/miniprogram_dist/badge/index.d.ts +0 -0
- package/miniprogram_dist/badge/index.js +114 -0
- package/miniprogram_dist/badge/index.js.map +1 -0
- package/miniprogram_dist/badge/index.json +6 -0
- package/miniprogram_dist/badge/index.wxml +16 -0
- package/miniprogram_dist/badge/index.wxss +105 -0
- package/miniprogram_dist/badge/index.wxss.map +1 -0
- package/miniprogram_dist/button/index.d.ts +0 -0
- package/miniprogram_dist/button/index.js +140 -0
- package/miniprogram_dist/button/index.js.map +1 -0
- package/miniprogram_dist/button/index.json +6 -0
- package/miniprogram_dist/button/index.wxml +28 -0
- package/miniprogram_dist/button/index.wxss +211 -0
- package/miniprogram_dist/button/index.wxss.map +1 -0
- package/miniprogram_dist/cell/index.d.ts +0 -0
- package/miniprogram_dist/cell/index.js +55 -0
- package/miniprogram_dist/cell/index.js.map +1 -0
- package/miniprogram_dist/cell/index.json +6 -0
- package/miniprogram_dist/cell/index.wxml +37 -0
- package/miniprogram_dist/cell/index.wxss +82 -0
- package/miniprogram_dist/cell/index.wxss.map +1 -0
- package/miniprogram_dist/checkbox/index.d.ts +0 -0
- package/miniprogram_dist/checkbox/index.js +50 -0
- package/miniprogram_dist/checkbox/index.js.map +1 -0
- package/miniprogram_dist/checkbox/index.json +6 -0
- package/miniprogram_dist/checkbox/index.wxml +16 -0
- package/miniprogram_dist/checkbox/index.wxss +87 -0
- package/miniprogram_dist/checkbox/index.wxss.map +1 -0
- package/miniprogram_dist/common/utils/index.d.ts +22 -0
- package/miniprogram_dist/common/utils/index.js +46 -0
- package/miniprogram_dist/common/utils/index.js.map +1 -0
- package/miniprogram_dist/datetime-picker/calendar.d.ts +1 -0
- package/miniprogram_dist/datetime-picker/calendar.js +424 -0
- package/miniprogram_dist/datetime-picker/calendar.js.map +1 -0
- package/miniprogram_dist/datetime-picker/calendar.json +8 -0
- package/miniprogram_dist/datetime-picker/calendar.wxml +86 -0
- package/miniprogram_dist/datetime-picker/calendar.wxss +352 -0
- package/miniprogram_dist/datetime-picker/calendar.wxss.map +1 -0
- package/miniprogram_dist/datetime-picker/index.d.ts +1 -0
- package/miniprogram_dist/datetime-picker/index.js +672 -0
- package/miniprogram_dist/datetime-picker/index.js.map +1 -0
- package/miniprogram_dist/datetime-picker/index.json +9 -0
- package/miniprogram_dist/datetime-picker/index.wxml +125 -0
- package/miniprogram_dist/datetime-picker/index.wxss +243 -0
- package/miniprogram_dist/datetime-picker/index.wxss.map +1 -0
- package/miniprogram_dist/datetime-picker/time-picker.d.ts +0 -0
- package/miniprogram_dist/datetime-picker/time-picker.js +83 -0
- package/miniprogram_dist/datetime-picker/time-picker.js.map +1 -0
- package/miniprogram_dist/datetime-picker/time-picker.json +6 -0
- package/miniprogram_dist/datetime-picker/time-picker.wxml +36 -0
- package/miniprogram_dist/datetime-picker/time-picker.wxss +75 -0
- package/miniprogram_dist/datetime-picker/time-picker.wxss.map +1 -0
- package/miniprogram_dist/datetime-picker/util.d.ts +172 -0
- package/miniprogram_dist/datetime-picker/util.js +404 -0
- package/miniprogram_dist/datetime-picker/util.js.map +1 -0
- package/miniprogram_dist/dialog/index.d.ts +0 -0
- package/miniprogram_dist/dialog/index.js +81 -0
- package/miniprogram_dist/dialog/index.js.map +1 -0
- package/miniprogram_dist/dialog/index.json +6 -0
- package/miniprogram_dist/dialog/index.wxml +55 -0
- package/miniprogram_dist/dialog/index.wxss +143 -0
- package/miniprogram_dist/dialog/index.wxss.map +1 -0
- package/miniprogram_dist/dropdown-select/index.d.ts +4 -0
- package/miniprogram_dist/dropdown-select/index.js +84 -0
- package/miniprogram_dist/dropdown-select/index.js.map +1 -0
- package/miniprogram_dist/dropdown-select/index.json +6 -0
- package/miniprogram_dist/dropdown-select/index.wxml +42 -0
- package/miniprogram_dist/dropdown-select/index.wxss +189 -0
- package/miniprogram_dist/dropdown-select/index.wxss.map +1 -0
- package/miniprogram_dist/editor/index.d.ts +0 -0
- package/miniprogram_dist/editor/index.js +254 -0
- package/miniprogram_dist/editor/index.js.map +1 -0
- package/miniprogram_dist/editor/index.json +6 -0
- package/miniprogram_dist/editor/index.wxml +142 -0
- package/miniprogram_dist/editor/index.wxss +613 -0
- package/miniprogram_dist/editor/index.wxss.map +1 -0
- package/miniprogram_dist/float-button/index.d.ts +0 -0
- package/miniprogram_dist/float-button/index.js +281 -0
- package/miniprogram_dist/float-button/index.js.map +1 -0
- package/miniprogram_dist/float-button/index.json +8 -0
- package/miniprogram_dist/float-button/index.wxml +68 -0
- package/miniprogram_dist/float-button/index.wxss +119 -0
- package/miniprogram_dist/float-button/index.wxss.map +1 -0
- package/miniprogram_dist/html-renderer/index.d.ts +1 -0
- package/miniprogram_dist/html-renderer/index.js +74 -0
- package/miniprogram_dist/html-renderer/index.js.map +1 -0
- package/miniprogram_dist/html-renderer/index.json +6 -0
- package/miniprogram_dist/html-renderer/index.wxml +79 -0
- package/miniprogram_dist/html-renderer/index.wxss +200 -0
- package/miniprogram_dist/html-renderer/index.wxss.map +1 -0
- package/miniprogram_dist/html-renderer/parser.d.ts +12 -0
- package/miniprogram_dist/html-renderer/parser.js +103 -0
- package/miniprogram_dist/html-renderer/parser.js.map +1 -0
- package/miniprogram_dist/icon/index.d.ts +1 -0
- package/miniprogram_dist/icon/index.js +231 -0
- package/miniprogram_dist/icon/index.js.map +1 -0
- package/miniprogram_dist/icon/index.json +6 -0
- package/miniprogram_dist/icon/index.wxml +13 -0
- package/miniprogram_dist/icon/index.wxss +14 -0
- package/miniprogram_dist/icon/index.wxss.map +1 -0
- package/miniprogram_dist/icon/presets.d.ts +7 -0
- package/miniprogram_dist/icon/presets.js +68 -0
- package/miniprogram_dist/icon/presets.js.map +1 -0
- package/miniprogram_dist/index.d.ts +6 -0
- package/miniprogram_dist/index.js +9 -0
- package/miniprogram_dist/index.js.map +1 -0
- package/miniprogram_dist/input/index.d.ts +0 -0
- package/miniprogram_dist/input/index.js +137 -0
- package/miniprogram_dist/input/index.js.map +1 -0
- package/miniprogram_dist/input/index.json +6 -0
- package/miniprogram_dist/input/index.wxml +57 -0
- package/miniprogram_dist/input/index.wxss +331 -0
- package/miniprogram_dist/input/index.wxss.map +1 -0
- package/miniprogram_dist/nav-bar/index.d.ts +0 -0
- package/miniprogram_dist/nav-bar/index.js +162 -0
- package/miniprogram_dist/nav-bar/index.js.map +1 -0
- package/miniprogram_dist/nav-bar/index.json +9 -0
- package/miniprogram_dist/nav-bar/index.wxml +46 -0
- package/miniprogram_dist/nav-bar/index.wxss +160 -0
- package/miniprogram_dist/nav-bar/index.wxss.map +1 -0
- package/miniprogram_dist/popup-select/index.d.ts +4 -0
- package/miniprogram_dist/popup-select/index.js +70 -0
- package/miniprogram_dist/popup-select/index.js.map +1 -0
- package/miniprogram_dist/popup-select/index.json +6 -0
- package/miniprogram_dist/popup-select/index.wxml +48 -0
- package/miniprogram_dist/popup-select/index.wxss +184 -0
- package/miniprogram_dist/popup-select/index.wxss.map +1 -0
- package/miniprogram_dist/progress/index.d.ts +0 -0
- package/miniprogram_dist/progress/index.js +120 -0
- package/miniprogram_dist/progress/index.js.map +1 -0
- package/miniprogram_dist/progress/index.json +6 -0
- package/miniprogram_dist/progress/index.wxml +31 -0
- package/miniprogram_dist/progress/index.wxss +163 -0
- package/miniprogram_dist/progress/index.wxss.map +1 -0
- package/miniprogram_dist/radio/index.d.ts +0 -0
- package/miniprogram_dist/radio/index.js +52 -0
- package/miniprogram_dist/radio/index.js.map +1 -0
- package/miniprogram_dist/radio/index.json +6 -0
- package/miniprogram_dist/radio/index.wxml +16 -0
- package/miniprogram_dist/radio/index.wxss +62 -0
- package/miniprogram_dist/radio/index.wxss.map +1 -0
- package/miniprogram_dist/rate/index.d.ts +0 -0
- package/miniprogram_dist/rate/index.js +128 -0
- package/miniprogram_dist/rate/index.js.map +1 -0
- package/miniprogram_dist/rate/index.json +6 -0
- package/miniprogram_dist/rate/index.wxml +31 -0
- package/miniprogram_dist/rate/index.wxss +89 -0
- package/miniprogram_dist/rate/index.wxss.map +1 -0
- package/miniprogram_dist/select-input/index.d.ts +0 -0
- package/miniprogram_dist/select-input/index.js +116 -0
- package/miniprogram_dist/select-input/index.js.map +1 -0
- package/miniprogram_dist/select-input/index.json +6 -0
- package/miniprogram_dist/select-input/index.wxml +43 -0
- package/miniprogram_dist/select-input/index.wxss +143 -0
- package/miniprogram_dist/select-input/index.wxss.map +1 -0
- package/miniprogram_dist/skeleton/index.d.ts +0 -0
- package/miniprogram_dist/skeleton/index.js +102 -0
- package/miniprogram_dist/skeleton/index.js.map +1 -0
- package/miniprogram_dist/skeleton/index.json +6 -0
- package/miniprogram_dist/skeleton/index.wxml +40 -0
- package/miniprogram_dist/skeleton/index.wxss +103 -0
- package/miniprogram_dist/skeleton/index.wxss.map +1 -0
- package/miniprogram_dist/slider/index.d.ts +0 -0
- package/miniprogram_dist/slider/index.js +180 -0
- package/miniprogram_dist/slider/index.js.map +1 -0
- package/miniprogram_dist/slider/index.json +6 -0
- package/miniprogram_dist/slider/index.wxml +38 -0
- package/miniprogram_dist/slider/index.wxss +132 -0
- package/miniprogram_dist/slider/index.wxss.map +1 -0
- package/miniprogram_dist/subsection/index.d.ts +0 -0
- package/miniprogram_dist/subsection/index.js +85 -0
- package/miniprogram_dist/subsection/index.js.map +1 -0
- package/miniprogram_dist/subsection/index.json +6 -0
- package/miniprogram_dist/subsection/index.wxml +55 -0
- package/miniprogram_dist/subsection/index.wxss +150 -0
- package/miniprogram_dist/subsection/index.wxss.map +1 -0
- package/miniprogram_dist/swipe-cell/index.d.ts +0 -0
- package/miniprogram_dist/swipe-cell/index.js +91 -0
- package/miniprogram_dist/swipe-cell/index.js.map +1 -0
- package/miniprogram_dist/swipe-cell/index.json +6 -0
- package/miniprogram_dist/swipe-cell/index.wxml +30 -0
- package/miniprogram_dist/swipe-cell/index.wxss +42 -0
- package/miniprogram_dist/swipe-cell/index.wxss.map +1 -0
- package/miniprogram_dist/swiper/index.d.ts +0 -0
- package/miniprogram_dist/swiper/index.js +82 -0
- package/miniprogram_dist/swiper/index.js.map +1 -0
- package/miniprogram_dist/swiper/index.json +6 -0
- package/miniprogram_dist/swiper/index.wxml +53 -0
- package/miniprogram_dist/swiper/index.wxss +123 -0
- package/miniprogram_dist/swiper/index.wxss.map +1 -0
- package/miniprogram_dist/switch/index.d.ts +0 -0
- package/miniprogram_dist/switch/index.js +53 -0
- package/miniprogram_dist/switch/index.js.map +1 -0
- package/miniprogram_dist/switch/index.json +6 -0
- package/miniprogram_dist/switch/index.wxml +21 -0
- package/miniprogram_dist/switch/index.wxss +198 -0
- package/miniprogram_dist/switch/index.wxss.map +1 -0
- package/miniprogram_dist/tag/index.d.ts +0 -0
- package/miniprogram_dist/tag/index.js +114 -0
- package/miniprogram_dist/tag/index.js.map +1 -0
- package/miniprogram_dist/tag/index.json +6 -0
- package/miniprogram_dist/tag/index.wxml +19 -0
- package/miniprogram_dist/tag/index.wxss +182 -0
- package/miniprogram_dist/tag/index.wxss.map +1 -0
- package/miniprogram_dist/textarea/index.d.ts +0 -0
- package/miniprogram_dist/textarea/index.js +143 -0
- package/miniprogram_dist/textarea/index.js.map +1 -0
- package/miniprogram_dist/textarea/index.json +6 -0
- package/miniprogram_dist/textarea/index.wxml +59 -0
- package/miniprogram_dist/textarea/index.wxss +242 -0
- package/miniprogram_dist/textarea/index.wxss.map +1 -0
- package/miniprogram_dist/toast/index.d.ts +0 -0
- package/miniprogram_dist/toast/index.js +92 -0
- package/miniprogram_dist/toast/index.js.map +1 -0
- package/miniprogram_dist/toast/index.json +8 -0
- package/miniprogram_dist/toast/index.wxml +30 -0
- package/miniprogram_dist/toast/index.wxss +116 -0
- package/miniprogram_dist/toast/index.wxss.map +1 -0
- package/miniprogram_dist/uploader/index.d.ts +8 -0
- package/miniprogram_dist/uploader/index.js +192 -0
- package/miniprogram_dist/uploader/index.js.map +1 -0
- package/miniprogram_dist/uploader/index.json +8 -0
- package/miniprogram_dist/uploader/index.wxml +88 -0
- package/miniprogram_dist/uploader/index.wxss +179 -0
- package/miniprogram_dist/uploader/index.wxss.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Component({
|
|
3
|
+
options: {
|
|
4
|
+
virtualHost: true // 开启虚拟节点以减少 Skyline 节点层级,提升样式继承效率
|
|
5
|
+
},
|
|
6
|
+
properties: {
|
|
7
|
+
checked: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
value: false
|
|
10
|
+
},
|
|
11
|
+
disabled: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
value: false
|
|
14
|
+
},
|
|
15
|
+
loading: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
value: false
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
type: String,
|
|
21
|
+
value: 'primary' // 预置主题:primary, success, warning, danger, info
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
type: String,
|
|
25
|
+
value: 'normal' // 尺寸:normal (104x60rpx), small (84x48rpx)
|
|
26
|
+
},
|
|
27
|
+
// 开启态时胶囊内嵌入的自定义文本 (如 '开', 'ON')
|
|
28
|
+
activeText: {
|
|
29
|
+
type: String,
|
|
30
|
+
value: ''
|
|
31
|
+
},
|
|
32
|
+
// 关闭态时胶囊内嵌入的自定义文本 (如 '关', 'OFF')
|
|
33
|
+
inactiveText: {
|
|
34
|
+
type: String,
|
|
35
|
+
value: ''
|
|
36
|
+
},
|
|
37
|
+
customStyle: {
|
|
38
|
+
type: String,
|
|
39
|
+
value: ''
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
methods: {
|
|
43
|
+
onTap() {
|
|
44
|
+
if (this.data.disabled || this.data.loading) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const nextChecked = !this.data.checked;
|
|
48
|
+
this.triggerEvent('change', nextChecked);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/switch/index.ts"],"names":[],"mappings":";AAAA,SAAS,CAAC;IACR,OAAO,EAAE;QACP,WAAW,EAAE,IAAI,CAAC,kCAAkC;KACrD;IAED,UAAU,EAAE;QACV,OAAO,EAAE;YACP,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,KAAK;SACb;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,KAAK;SACb;QACD,OAAO,EAAE;YACP,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,KAAK;SACb;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,SAAS,CAAC,+CAA+C;SACjE;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,QAAQ,CAAC,0CAA0C;SAC3D;QACD,gCAAgC;QAChC,UAAU,EAAE;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,EAAE;SACV;QACD,iCAAiC;QACjC,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,EAAE;SACV;QACD,WAAW,EAAE;YACX,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,EAAE;SACV;KACF;IAED,OAAO,EAAE;QACP,KAAK;YACH,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC5C,OAAO;YACT,CAAC;YACD,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACvC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC3C,CAAC;KACF;CACF,CAAC,CAAC","file":"index.js","sourcesContent":["Component({\r\n options: {\r\n virtualHost: true // 开启虚拟节点以减少 Skyline 节点层级,提升样式继承效率\r\n },\r\n \r\n properties: {\r\n checked: {\r\n type: Boolean,\r\n value: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n value: false\r\n },\r\n loading: {\r\n type: Boolean,\r\n value: false\r\n },\r\n type: {\r\n type: String,\r\n value: 'primary' // 预置主题:primary, success, warning, danger, info\r\n },\r\n size: {\r\n type: String,\r\n value: 'normal' // 尺寸:normal (104x60rpx), small (84x48rpx)\r\n },\r\n // 开启态时胶囊内嵌入的自定义文本 (如 '开', 'ON')\r\n activeText: {\r\n type: String,\r\n value: ''\r\n },\r\n // 关闭态时胶囊内嵌入的自定义文本 (如 '关', 'OFF')\r\n inactiveText: {\r\n type: String,\r\n value: ''\r\n },\r\n customStyle: {\r\n type: String,\r\n value: ''\r\n }\r\n },\r\n\r\n methods: {\r\n onTap() {\r\n if (this.data.disabled || this.data.loading) {\r\n return;\r\n }\r\n const nextChecked = !this.data.checked;\r\n this.triggerEvent('change', nextChecked);\r\n }\r\n }\r\n});\r\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<view
|
|
2
|
+
class="sky-switch sky-switch--{{ type }} sky-switch--{{ size }} {{ checked ? 'sky-switch--checked' : '' }} {{ disabled || loading ? 'sky-switch--disabled' : '' }} {{ loading ? 'sky-switch--loading' : '' }}"
|
|
3
|
+
style="{{ customStyle }}"
|
|
4
|
+
bindtap="onTap"
|
|
5
|
+
>
|
|
6
|
+
<!-- 胶囊内嵌状态文字 (Active / Inactive) -->
|
|
7
|
+
<text
|
|
8
|
+
wx:if="{{ checked && activeText }}"
|
|
9
|
+
class="sky-switch__label sky-switch__label--active"
|
|
10
|
+
>{{ activeText }}</text>
|
|
11
|
+
|
|
12
|
+
<text
|
|
13
|
+
wx:if="{{ !checked && inactiveText }}"
|
|
14
|
+
class="sky-switch__label sky-switch__label--inactive"
|
|
15
|
+
>{{ inactiveText }}</text>
|
|
16
|
+
|
|
17
|
+
<!-- 滑块节点 -->
|
|
18
|
+
<view class="sky-switch__node">
|
|
19
|
+
<view wx:if="{{ loading }}" class="sky-switch__loading"></view>
|
|
20
|
+
</view>
|
|
21
|
+
</view>
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/* ========================================== */
|
|
3
|
+
/* Skyline-UI Switch 开关组件样式 (Sass) */
|
|
4
|
+
/* ========================================== */
|
|
5
|
+
/* 60 - 2 * 4 */
|
|
6
|
+
/* 104 - 52 - 2 * 4 */
|
|
7
|
+
/* 48 - 2 * 3 */
|
|
8
|
+
/* 84 - 42 - 2 * 3 */
|
|
9
|
+
.sky-switch {
|
|
10
|
+
position: relative;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
15
|
+
/* 极致的高级防直角打磨细节 */
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
outline: none;
|
|
18
|
+
-webkit-tap-highlight-color: transparent; /* 彻底消除移动端点击时默认的半透明直角高亮框 */
|
|
19
|
+
/* 经典未选中背景 (克制中性灰) */
|
|
20
|
+
background-color: #dee2e6;
|
|
21
|
+
/* ==================== 尺寸变体 ==================== */
|
|
22
|
+
}
|
|
23
|
+
.sky-switch--normal {
|
|
24
|
+
width: 104rpx;
|
|
25
|
+
height: 60rpx;
|
|
26
|
+
border-radius: 9999rpx;
|
|
27
|
+
padding: 4rpx;
|
|
28
|
+
}
|
|
29
|
+
.sky-switch--normal .sky-switch__node {
|
|
30
|
+
width: 52rpx;
|
|
31
|
+
height: 52rpx;
|
|
32
|
+
}
|
|
33
|
+
.sky-switch--normal {
|
|
34
|
+
/* normal 状态下的字号与定位 */
|
|
35
|
+
}
|
|
36
|
+
.sky-switch--normal .sky-switch__label {
|
|
37
|
+
font-size: 20rpx;
|
|
38
|
+
}
|
|
39
|
+
.sky-switch--normal .sky-switch__label--active {
|
|
40
|
+
left: 20rpx;
|
|
41
|
+
}
|
|
42
|
+
.sky-switch--normal .sky-switch__label--inactive {
|
|
43
|
+
right: 20rpx;
|
|
44
|
+
}
|
|
45
|
+
.sky-switch--small {
|
|
46
|
+
width: 84rpx;
|
|
47
|
+
height: 48rpx;
|
|
48
|
+
border-radius: 9999rpx;
|
|
49
|
+
padding: 3rpx;
|
|
50
|
+
}
|
|
51
|
+
.sky-switch--small .sky-switch__node {
|
|
52
|
+
width: 42rpx;
|
|
53
|
+
height: 42rpx;
|
|
54
|
+
}
|
|
55
|
+
.sky-switch--small {
|
|
56
|
+
/* small 状态下的字号与定位 */
|
|
57
|
+
}
|
|
58
|
+
.sky-switch--small .sky-switch__label {
|
|
59
|
+
font-size: 16rpx;
|
|
60
|
+
}
|
|
61
|
+
.sky-switch--small .sky-switch__label--active {
|
|
62
|
+
left: 14rpx;
|
|
63
|
+
}
|
|
64
|
+
.sky-switch--small .sky-switch__label--inactive {
|
|
65
|
+
right: 14rpx;
|
|
66
|
+
}
|
|
67
|
+
.sky-switch {
|
|
68
|
+
/* ==================== 状态内嵌文本 (Inline Text) ==================== */
|
|
69
|
+
}
|
|
70
|
+
.sky-switch__label {
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: 0;
|
|
73
|
+
bottom: 0;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
font-weight: 700;
|
|
78
|
+
line-height: 1;
|
|
79
|
+
z-index: 1; /* 保证文字处于背景之上,但会被滑块自然覆盖 */
|
|
80
|
+
user-select: none;
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
/* 伴随状态淡入 */
|
|
83
|
+
animation: label-fade-anim 200ms ease both;
|
|
84
|
+
}
|
|
85
|
+
.sky-switch__label--active {
|
|
86
|
+
color: #ffffff;
|
|
87
|
+
}
|
|
88
|
+
.sky-switch__label--inactive {
|
|
89
|
+
color: #adb5bd; /* 优雅的中性灰 */
|
|
90
|
+
}
|
|
91
|
+
.sky-switch {
|
|
92
|
+
/* ==================== 内部滑块 (Premium Node) ==================== */
|
|
93
|
+
}
|
|
94
|
+
.sky-switch__node {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: row;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
background-color: #ffffff;
|
|
100
|
+
border-radius: 9999rpx;
|
|
101
|
+
z-index: 2; /* 确保滑块在文字之上,达成完美的遮挡拟物感 */
|
|
102
|
+
/* 淡雅多重灰阶阴影 (常规但极致高级) */
|
|
103
|
+
box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.08), 0 2rpx 4rpx rgba(0, 0, 0, 0.03);
|
|
104
|
+
/* 使用 translate3d 触发合成器硬件加速位移 */
|
|
105
|
+
transform: translate3d(0, 0, 0);
|
|
106
|
+
transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1), width 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
107
|
+
}
|
|
108
|
+
.sky-switch {
|
|
109
|
+
/* ==================== 状态变体 ==================== */
|
|
110
|
+
/* 1. 选中态 (Checked) */
|
|
111
|
+
}
|
|
112
|
+
.sky-switch--checked.sky-switch--normal .sky-switch__node {
|
|
113
|
+
transform: translate3d(44rpx, 0, 0);
|
|
114
|
+
}
|
|
115
|
+
.sky-switch--checked.sky-switch--small .sky-switch__node {
|
|
116
|
+
transform: translate3d(36rpx, 0, 0);
|
|
117
|
+
}
|
|
118
|
+
.sky-switch {
|
|
119
|
+
/* 2. 禁用与加载态 (Disabled / Loading) */
|
|
120
|
+
}
|
|
121
|
+
.sky-switch--disabled {
|
|
122
|
+
opacity: 0.55;
|
|
123
|
+
pointer-events: none; /* 彻底失效 */
|
|
124
|
+
}
|
|
125
|
+
.sky-switch {
|
|
126
|
+
/* ==================== 按压微拉伸形变 (Micro-interaction) ==================== */
|
|
127
|
+
}
|
|
128
|
+
.sky-switch:active:not(.sky-switch--disabled) {
|
|
129
|
+
/* 2a. 未选中态按压:滑块朝右方拉伸 */
|
|
130
|
+
}
|
|
131
|
+
.sky-switch:active:not(.sky-switch--disabled):not(.sky-switch--checked).sky-switch--normal .sky-switch__node {
|
|
132
|
+
width: 60rpx; /* 52 -> 60rpx */
|
|
133
|
+
}
|
|
134
|
+
.sky-switch:active:not(.sky-switch--disabled):not(.sky-switch--checked).sky-switch--small .sky-switch__node {
|
|
135
|
+
width: 48rpx; /* 42 -> 48rpx */
|
|
136
|
+
}
|
|
137
|
+
.sky-switch:active:not(.sky-switch--disabled) {
|
|
138
|
+
/* 2b. 选中态按压:滑块向左方拉伸 (通过平移回缩 + 宽度增加实现向左挤压效果) */
|
|
139
|
+
}
|
|
140
|
+
.sky-switch:active:not(.sky-switch--disabled).sky-switch--checked.sky-switch--normal .sky-switch__node {
|
|
141
|
+
width: 60rpx;
|
|
142
|
+
transform: translate3d(36rpx, 0, 0);
|
|
143
|
+
}
|
|
144
|
+
.sky-switch:active:not(.sky-switch--disabled).sky-switch--checked.sky-switch--small .sky-switch__node {
|
|
145
|
+
width: 48rpx;
|
|
146
|
+
transform: translate3d(30rpx, 0, 0);
|
|
147
|
+
}
|
|
148
|
+
.sky-switch {
|
|
149
|
+
/* ==================== 主题色体系 (HSL Colors) ==================== */
|
|
150
|
+
}
|
|
151
|
+
.sky-switch--checked.sky-switch--primary {
|
|
152
|
+
background-color: hsl(250, 85%, 55%);
|
|
153
|
+
}
|
|
154
|
+
.sky-switch--checked.sky-switch--success {
|
|
155
|
+
background-color: hsl(150, 80%, 40%);
|
|
156
|
+
}
|
|
157
|
+
.sky-switch--checked.sky-switch--warning {
|
|
158
|
+
background-color: hsl(35, 90%, 50%);
|
|
159
|
+
}
|
|
160
|
+
.sky-switch--checked.sky-switch--danger {
|
|
161
|
+
background-color: hsl(355, 85%, 55%);
|
|
162
|
+
}
|
|
163
|
+
.sky-switch--checked.sky-switch--info {
|
|
164
|
+
background-color: hsl(200, 85%, 50%);
|
|
165
|
+
}
|
|
166
|
+
.sky-switch {
|
|
167
|
+
/* ==================== 纯 CSS 物理手绘 Loading 图标 ==================== */
|
|
168
|
+
}
|
|
169
|
+
.sky-switch__loading {
|
|
170
|
+
box-sizing: border-box;
|
|
171
|
+
width: 50%;
|
|
172
|
+
height: 50%;
|
|
173
|
+
border: 3rpx solid #dee2e6;
|
|
174
|
+
border-radius: 9999rpx;
|
|
175
|
+
/* 形成四分之三圆环缺口 */
|
|
176
|
+
border-top-color: transparent;
|
|
177
|
+
/* Skyline 级的纯合成器线程旋转动画 */
|
|
178
|
+
animation: sky-rotate 0.8s linear infinite;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* ==================== 旋转关键帧 ==================== */
|
|
182
|
+
@keyframes sky-rotate {
|
|
183
|
+
from {
|
|
184
|
+
transform: rotate(0deg);
|
|
185
|
+
}
|
|
186
|
+
to {
|
|
187
|
+
transform: rotate(360deg);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/* ==================== 文字淡现关键帧 ==================== */
|
|
191
|
+
@keyframes label-fade-anim {
|
|
192
|
+
from {
|
|
193
|
+
opacity: 0;
|
|
194
|
+
}
|
|
195
|
+
to {
|
|
196
|
+
opacity: 1;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["switch/index.scss","common/style/theme.scss","common/style/mixins.scss"],"names":[],"mappings":";AAGA;AACA;AACA;AAKiC;AACA;AAKD;AACA;AAEhC;EACE;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;AAEA;EACA,kBCgBiB;ADdjB;;AAEA;EACE,OA9BkB;EA+BlB,QA9BmB;EA+BnB,eC2BsB;ED1BtB,SA/BoB;;AAiCpB;EACE,OAjCoB;EAkCpB,QAlCoB;;AA0BxB;AAWE;;AACA;EACE;;AAEA;EACE;;AAGF;EACE;;AAKN;EACE,OAjDiB;EAkDjB,QAjDkB;EAkDlB,eCEsB;EDDtB,SAlDmB;;AAoDnB;EACE,OApDmB;EAqDnB,QArDmB;;AA6CvB;AAWE;;AACA;EACE;;AAEA;EACE;;AAGF;EACE;;AA9DR;AAmEE;;AACA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;;AAEA;EACE,OC5DY;;AD+Dd;EACE,OC3Da,SD2Da;;AAzFhC;AA6FE;;AAEA;EEnGA;EACA;EACA;EACA;EFkGE,kBCxEc;EDyEd,eCnDsB;EDoDtB;AAEA;EACA;AAGA;EACA;EACA;;AA3GJ;AA+GE;AAEA;;AAGI;EACE;;AAIF;EACE;;AA1HR;AA+HE;;AACA;EACE;EACA;;AAlIJ;AAqIE;;AAEA;AACE;;AAGI;EACE;;AAIF;EACE;;AAVR;AAeE;;AAGI;EACE;EACA;;AAIF;EACE;EACA;;AAjKV;AAuKE;;AAEA;EACE,kBCpLgB;;ADuLlB;EACE,kBClLgB;;ADqLlB;EACE,kBClLgB;;ADqLlB;EACE,kBClLe;;ADqLjB;EACE,kBClLa;;ADRjB;AA6LE;;AAEA;EACE;EACA;EACA;EACA;EACA,eCrJsB;ADuJtB;EACA;AAEA;EACA;;;AAIJ;AACA;EACE;IACE;;EAEF;IACE;;;AAIJ;AACA;EACE;IACE;;EAEF;IACE","file":"index.wxss","sourcesContent":["@use \"../common/style/theme.scss\" as *;\n@use \"../common/style/mixins.scss\" as *;\n\n/* ========================================== */\n/* Skyline-UI Switch 开关组件样式 (Sass) */\n/* ========================================== */\n\n$switch-normal-width: 104rpx;\n$switch-normal-height: 60rpx;\n$switch-normal-padding: 4rpx;\n$switch-normal-node-size: 52rpx; /* 60 - 2 * 4 */\n$switch-normal-translate: 44rpx; /* 104 - 52 - 2 * 4 */\n\n$switch-small-width: 84rpx;\n$switch-small-height: 48rpx;\n$switch-small-padding: 3rpx;\n$switch-small-node-size: 42rpx; /* 48 - 2 * 3 */\n$switch-small-translate: 36rpx; /* 84 - 42 - 2 * 3 */\n\n.sky-switch {\n position: relative;\n box-sizing: border-box;\n display: inline-block;\n cursor: pointer;\n transition: background-color $sky-transition-duration $sky-transition-timing;\n \n /* 极致的高级防直角打磨细节 */\n overflow: hidden;\n outline: none;\n -webkit-tap-highlight-color: transparent; /* 彻底消除移动端点击时默认的半透明直角高亮框 */\n \n /* 经典未选中背景 (克制中性灰) */\n background-color: $sky-color-gray-4;\n \n /* ==================== 尺寸变体 ==================== */\n \n &--normal {\n width: $switch-normal-width;\n height: $switch-normal-height;\n border-radius: $sky-border-radius-round;\n padding: $switch-normal-padding;\n \n .sky-switch__node {\n width: $switch-normal-node-size;\n height: $switch-normal-node-size;\n }\n\n /* normal 状态下的字号与定位 */\n .sky-switch__label {\n font-size: 20rpx;\n \n &--active {\n left: 20rpx;\n }\n \n &--inactive {\n right: 20rpx;\n }\n }\n }\n \n &--small {\n width: $switch-small-width;\n height: $switch-small-height;\n border-radius: $sky-border-radius-round;\n padding: $switch-small-padding;\n \n .sky-switch__node {\n width: $switch-small-node-size;\n height: $switch-small-node-size;\n }\n\n /* small 状态下的字号与定位 */\n .sky-switch__label {\n font-size: 16rpx;\n \n &--active {\n left: 14rpx;\n }\n \n &--inactive {\n right: 14rpx;\n }\n }\n }\n\n /* ==================== 状态内嵌文本 (Inline Text) ==================== */\n &__label {\n position: absolute;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n font-weight: 700;\n line-height: 1;\n z-index: 1; /* 保证文字处于背景之上,但会被滑块自然覆盖 */\n user-select: none;\n pointer-events: none;\n \n /* 伴随状态淡入 */\n animation: label-fade-anim 200ms ease both;\n \n &--active {\n color: $sky-color-white;\n }\n \n &--inactive {\n color: $sky-color-gray-5; /* 优雅的中性灰 */\n }\n }\n\n /* ==================== 内部滑块 (Premium Node) ==================== */\n \n &__node {\n @include flex-center;\n background-color: $sky-color-white;\n border-radius: $sky-border-radius-round;\n z-index: 2; /* 确保滑块在文字之上,达成完美的遮挡拟物感 */\n \n /* 淡雅多重灰阶阴影 (常规但极致高级) */\n box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.08), \n 0 2rpx 4rpx rgba(0, 0, 0, 0.03);\n \n /* 使用 translate3d 触发合成器硬件加速位移 */\n transform: translate3d(0, 0, 0);\n transition: transform $sky-transition-duration $sky-transition-timing,\n width $sky-transition-duration $sky-transition-timing;\n }\n\n /* ==================== 状态变体 ==================== */\n\n /* 1. 选中态 (Checked) */\n &--checked {\n &.sky-switch--normal {\n .sky-switch__node {\n transform: translate3d($switch-normal-translate, 0, 0);\n }\n }\n &.sky-switch--small {\n .sky-switch__node {\n transform: translate3d($switch-small-translate, 0, 0);\n }\n }\n }\n \n /* 2. 禁用与加载态 (Disabled / Loading) */\n &--disabled {\n opacity: 0.55;\n pointer-events: none; /* 彻底失效 */\n }\n\n /* ==================== 按压微拉伸形变 (Micro-interaction) ==================== */\n \n &:active:not(.sky-switch--disabled) {\n /* 2a. 未选中态按压:滑块朝右方拉伸 */\n &:not(.sky-switch--checked) {\n &.sky-switch--normal {\n .sky-switch__node {\n width: $switch-normal-node-size + 8rpx; /* 52 -> 60rpx */\n }\n }\n &.sky-switch--small {\n .sky-switch__node {\n width: $switch-small-node-size + 6rpx; /* 42 -> 48rpx */\n }\n }\n }\n \n /* 2b. 选中态按压:滑块向左方拉伸 (通过平移回缩 + 宽度增加实现向左挤压效果) */\n &.sky-switch--checked {\n &.sky-switch--normal {\n .sky-switch__node {\n width: $switch-normal-node-size + 8rpx;\n transform: translate3d($switch-normal-translate - 8rpx, 0, 0);\n }\n }\n &.sky-switch--small {\n .sky-switch__node {\n width: $switch-small-node-size + 6rpx;\n transform: translate3d($switch-small-translate - 6rpx, 0, 0);\n }\n }\n }\n }\n\n /* ==================== 主题色体系 (HSL Colors) ==================== */\n \n &--checked.sky-switch--primary {\n background-color: $sky-color-primary;\n }\n \n &--checked.sky-switch--success {\n background-color: $sky-color-success;\n }\n \n &--checked.sky-switch--warning {\n background-color: $sky-color-warning;\n }\n \n &--checked.sky-switch--danger {\n background-color: $sky-color-danger;\n }\n \n &--checked.sky-switch--info {\n background-color: $sky-color-info;\n }\n\n /* ==================== 纯 CSS 物理手绘 Loading 图标 ==================== */\n \n &__loading {\n box-sizing: border-box;\n width: 50%;\n height: 50%;\n border: 3rpx solid $sky-color-gray-4;\n border-radius: $sky-border-radius-round;\n \n /* 形成四分之三圆环缺口 */\n border-top-color: transparent;\n \n /* Skyline 级的纯合成器线程旋转动画 */\n animation: sky-rotate 0.8s linear infinite;\n }\n}\n\n/* ==================== 旋转关键帧 ==================== */\n@keyframes sky-rotate {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* ==================== 文字淡现关键帧 ==================== */\n@keyframes label-fade-anim {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n","// ==========================================\r\n// Skyline-UI 极具质感的现代设计系统 (SCSS)\r\n// ==========================================\r\n\r\n// --- 品牌色体系 (HSL Tailored Colors) ---\r\n$sky-brand-h: 250; // 主品牌色相 (优雅深紫/蓝色调)\r\n$sky-brand-s: 85%;\r\n$sky-brand-l: 55%;\r\n\r\n$sky-color-primary: hsl($sky-brand-h, $sky-brand-s, $sky-brand-l);\r\n$sky-color-primary-hover: hsl($sky-brand-h, $sky-brand-s, $sky-brand-l - 8%);\r\n$sky-color-primary-active: hsl($sky-brand-h, $sky-brand-s, $sky-brand-l - 15%);\r\n$sky-color-primary-light: hsl($sky-brand-h, $sky-brand-s, 95%);\r\n\r\n// 辅助色体系 (意图表达)\r\n$sky-color-success: hsl(150, 80%, 40%);\r\n$sky-color-success-active: hsl(150, 80%, 32%);\r\n$sky-color-success-light: hsl(150, 80%, 96%);\r\n\r\n$sky-color-warning: hsl(35, 90%, 50%);\r\n$sky-color-warning-active: hsl(35, 90%, 42%);\r\n$sky-color-warning-light: hsl(35, 90%, 96%);\r\n\r\n$sky-color-danger: hsl(355, 85%, 55%);\r\n$sky-color-danger-active: hsl(355, 85%, 45%);\r\n$sky-color-danger-light: hsl(355, 85%, 96%);\r\n\r\n$sky-color-info: hsl(200, 85%, 50%);\r\n$sky-color-info-active: hsl(200, 85%, 42%);\r\n$sky-color-info-light: hsl(200, 85%, 96%);\r\n\r\n// --- Tag 标签组件专用色系 (莫兰迪低饱和) ---\r\n$sky-tag-blue: #edf2ff;\r\n$sky-tag-blue-text: #3b5bdb;\r\n$sky-tag-green: #ebfbee;\r\n$sky-tag-green-text: #2b8a3e;\r\n$sky-tag-yellow: #fff9db;\r\n$sky-tag-yellow-text: #f08c00;\r\n$sky-tag-red: #ffeef0;\r\n$sky-tag-red-text: #fa5252;\r\n$sky-tag-info: #e7f5ff;\r\n$sky-tag-info-text: #1c7ed6;\r\n\r\n// --- 纯净的中性色调 (Sleek Grays) ---\r\n$sky-color-white: #ffffff;\r\n$sky-color-gray-1: #f8f9fa; // 极浅背景\r\n$sky-color-gray-2: #f1f3f5; // 浅灰背景\r\n$sky-color-gray-3: #e9ecef; // 边框线/失效态\r\n$sky-color-gray-4: #dee2e6;\r\n$sky-color-gray-5: #adb5bd; // 提示文本\r\n$sky-color-gray-6: #868e96;\r\n$sky-color-gray-7: #495057; // 次级文本\r\n$sky-color-gray-8: #343a40;\r\n$sky-color-gray-9: #212529; // 主级文本\r\n\r\n// --- 阴影系统 (Premium Shadows) ---\r\n$sky-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);\r\n$sky-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);\r\n$sky-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);\r\n$sky-shadow-primary: 0 4px 14px rgba(100, 80, 240, 0.2);\r\n\r\n// --- 圆角规范 (Borders) ---\r\n$sky-border-radius-xs: 4rpx;\r\n$sky-border-radius-sm: 8rpx;\r\n$sky-border-radius-md: 12rpx;\r\n$sky-border-radius-lg: 20rpx;\r\n$sky-border-radius-round: 9999rpx;\r\n\r\n// --- 字体与字号规范 (Typography) ---\r\n$sky-font-family: -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", Helvetica, \"Segoe UI\", Arial, Roboto, sans-serif;\r\n$sky-font-size-xs: 20rpx;\r\n$sky-font-size-sm: 24rpx;\r\n$sky-font-size-md: 28rpx;\r\n$sky-font-size-lg: 32rpx;\r\n$sky-font-size-xl: 36rpx;\r\n\r\n// --- 动效与过渡 (Transitions) ---\r\n$sky-transition-duration: 200ms;\r\n$sky-transition-timing: cubic-bezier(0.4, 0, 0.2, 1);\r\n\r\n// --- 间距规范 (Spacing) ---\r\n$sky-spacing-xs: 8rpx;\r\n$sky-spacing-sm: 16rpx;\r\n$sky-spacing-md: 24rpx;\r\n$sky-spacing-lg: 32rpx;\r\n$sky-spacing-xl: 48rpx;\r\n\r\n// --- 组件高度规范 (Component Heights) ---\r\n$sky-height-sm: 56rpx;\r\n$sky-height-md: 72rpx;\r\n$sky-height-lg: 88rpx;\r\n$sky-height-xl: 96rpx;\r\n\r\n// --- 层级规范 (Z-Index) ---\r\n$sky-z-dropdown: 100;\r\n$sky-z-fixed: 500;\r\n$sky-z-popup: 1000;\r\n$sky-z-toast: 2000;\r\n","// ==========================================\r\n// Skyline-UI Flex 布局与样式混合宏 (SCSS)\r\n// ==========================================\r\n\r\n@mixin flex-row {\r\n display: flex;\r\n flex-direction: row;\r\n}\r\n\r\n@mixin flex-column {\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n@mixin flex-center {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n@mixin flex-align-center {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n}\r\n\r\n@mixin absolute-full {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n// 文本溢出隐藏 (在微信小程序 Flex 布局下,通常需要在容器上设置 overflow 和 flex)\r\n@mixin text-ellipsis {\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n}\r\n\r\n// 多行文本溢出隐藏\r\n@mixin text-ellipsis-multiline($lines: 2) {\r\n display: -webkit-box;\r\n -webkit-box-orient: vertical;\r\n -webkit-line-clamp: $lines;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n}\r\n\r\n// 安全区域底部适配\r\n@mixin safe-area-bottom {\r\n padding-bottom: constant(safe-area-inset-bottom);\r\n padding-bottom: env(safe-area-inset-bottom);\r\n}\r\n\r\n// 1px 高清屏边框 (使用 transform 缩放方案)\r\n@mixin hairline-border($color: $sky-color-gray-3, $radius: 0) {\r\n position: relative;\r\n &::after {\r\n content: '';\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 200%;\r\n height: 200%;\r\n border: 1px solid $color;\r\n border-radius: $radius * 2;\r\n transform: scale(0.5);\r\n transform-origin: 0 0;\r\n box-sizing: border-box;\r\n pointer-events: none;\r\n }\r\n}\r\n\r\n// 禁用态通用样式\r\n@mixin disabled-state {\r\n opacity: 0.5;\r\n pointer-events: none;\r\n cursor: not-allowed;\r\n}\r\n\r\n// 按钮重置\r\n@mixin button-reset {\r\n border: none;\r\n outline: none;\r\n padding: 0;\r\n margin: 0;\r\n background: none;\r\n -webkit-tap-highlight-color: transparent;\r\n}\r\n"]}
|
|
File without changes
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Component({
|
|
3
|
+
options: {
|
|
4
|
+
virtualHost: true // 开启虚拟节点降低 Skyline DOM 层级嵌套
|
|
5
|
+
},
|
|
6
|
+
properties: {
|
|
7
|
+
// 标签类型:default (灰), primary (蓝紫), success (绿), warning (黄), danger (红), info (蔚蓝)
|
|
8
|
+
type: {
|
|
9
|
+
type: String,
|
|
10
|
+
value: 'default'
|
|
11
|
+
},
|
|
12
|
+
// 标签尺寸:normal, medium, large
|
|
13
|
+
size: {
|
|
14
|
+
type: String,
|
|
15
|
+
value: 'normal'
|
|
16
|
+
},
|
|
17
|
+
// 是否为镂空 Plain 样式 (白底彩框)
|
|
18
|
+
plain: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
value: false
|
|
21
|
+
},
|
|
22
|
+
// 是否为胶囊圆角身段
|
|
23
|
+
round: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
value: false
|
|
26
|
+
},
|
|
27
|
+
// 是否可关闭 (展示右侧微型叉)
|
|
28
|
+
closeable: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
value: false
|
|
31
|
+
},
|
|
32
|
+
// 自定义背景色 (若为 plain 镂空,此色会自动智能演变为边框色)
|
|
33
|
+
color: {
|
|
34
|
+
type: String,
|
|
35
|
+
value: ''
|
|
36
|
+
},
|
|
37
|
+
// 自定义文本颜色
|
|
38
|
+
textColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
value: ''
|
|
41
|
+
},
|
|
42
|
+
// 附加自定义样式
|
|
43
|
+
customStyle: {
|
|
44
|
+
type: String,
|
|
45
|
+
value: ''
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
data: {
|
|
49
|
+
isClosing: false, // 操纵缩退过渡
|
|
50
|
+
destroyed: false, // 物理 DOM 卸载
|
|
51
|
+
tagStyle: '' // 动态行内演变样式
|
|
52
|
+
},
|
|
53
|
+
observers: {
|
|
54
|
+
'plain, color, textColor': function () {
|
|
55
|
+
this.recalculateStyle();
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
lifetimes: {
|
|
59
|
+
attached() {
|
|
60
|
+
this.recalculateStyle();
|
|
61
|
+
},
|
|
62
|
+
detached() {
|
|
63
|
+
if (this._timer) {
|
|
64
|
+
clearTimeout(this._timer);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
// 智能折算行内演变样式
|
|
70
|
+
recalculateStyle() {
|
|
71
|
+
const { color, textColor, plain } = this.data;
|
|
72
|
+
const styleArr = [];
|
|
73
|
+
if (color || textColor) {
|
|
74
|
+
if (plain) {
|
|
75
|
+
/* 镂空状态:白底。color 演化为 border 边框色与 text 文本色 */
|
|
76
|
+
styleArr.push('background-color: transparent !important;');
|
|
77
|
+
const finalBorderColor = color || textColor;
|
|
78
|
+
const finalTextColor = textColor || color;
|
|
79
|
+
if (finalBorderColor) {
|
|
80
|
+
styleArr.push(`border-color: ${finalBorderColor} !important;`);
|
|
81
|
+
}
|
|
82
|
+
if (finalTextColor) {
|
|
83
|
+
styleArr.push(`color: ${finalTextColor} !important;`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
/* 填充状态:彩色背景 */
|
|
88
|
+
if (color) {
|
|
89
|
+
styleArr.push(`background-color: ${color} !important;`);
|
|
90
|
+
styleArr.push(`border-color: ${color} !important;`); // 边框也同步成底色以防穿帮
|
|
91
|
+
}
|
|
92
|
+
if (textColor) {
|
|
93
|
+
styleArr.push(`color: ${textColor} !important;`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
this.setData({
|
|
98
|
+
tagStyle: styleArr.join(' ')
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
// 优雅过渡关闭
|
|
102
|
+
onClose() {
|
|
103
|
+
// 1. 先触发闭合过渡
|
|
104
|
+
this.setData({ isClosing: true });
|
|
105
|
+
// 2. 待 200ms 弹性缩退动画播放完毕后,执行物理卸载,并向外抛出事件
|
|
106
|
+
this._timer = setTimeout(() => {
|
|
107
|
+
this.setData({ destroyed: true });
|
|
108
|
+
this.triggerEvent('close');
|
|
109
|
+
}, 200);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tag/index.ts"],"names":[],"mappings":"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","file":"index.js","sourcesContent":["Component({\r\n options: {\r\n virtualHost: true // 开启虚拟节点降低 Skyline DOM 层级嵌套\r\n },\r\n\r\n properties: {\r\n // 标签类型:default (灰), primary (蓝紫), success (绿), warning (黄), danger (红), info (蔚蓝)\r\n type: {\r\n type: String,\r\n value: 'default'\r\n },\r\n // 标签尺寸:normal, medium, large\r\n size: {\r\n type: String,\r\n value: 'normal'\r\n },\r\n // 是否为镂空 Plain 样式 (白底彩框)\r\n plain: {\r\n type: Boolean,\r\n value: false\r\n },\r\n // 是否为胶囊圆角身段\r\n round: {\r\n type: Boolean,\r\n value: false\r\n },\r\n // 是否可关闭 (展示右侧微型叉)\r\n closeable: {\r\n type: Boolean,\r\n value: false\r\n },\r\n // 自定义背景色 (若为 plain 镂空,此色会自动智能演变为边框色)\r\n color: {\r\n type: String,\r\n value: ''\r\n },\r\n // 自定义文本颜色\r\n textColor: {\r\n type: String,\r\n value: ''\r\n },\r\n // 附加自定义样式\r\n customStyle: {\r\n type: String,\r\n value: ''\r\n }\r\n },\r\n\r\n data: {\r\n isClosing: false, // 操纵缩退过渡\r\n destroyed: false, // 物理 DOM 卸载\r\n tagStyle: '' // 动态行内演变样式\r\n },\r\n\r\n observers: {\r\n 'plain, color, textColor': function() {\r\n this.recalculateStyle();\r\n }\r\n },\r\n\r\n lifetimes: {\r\n attached() {\r\n this.recalculateStyle();\r\n },\r\n detached() {\r\n if ((this as any)._timer) {\r\n clearTimeout((this as any)._timer);\r\n }\r\n }\r\n },\r\n\r\n methods: {\r\n // 智能折算行内演变样式\r\n recalculateStyle() {\r\n const { color, textColor, plain } = this.data;\r\n const styleArr: string[] = [];\r\n\r\n if (color || textColor) {\r\n if (plain) {\r\n /* 镂空状态:白底。color 演化为 border 边框色与 text 文本色 */\r\n styleArr.push('background-color: transparent !important;');\r\n const finalBorderColor = color || textColor;\r\n const finalTextColor = textColor || color;\r\n \r\n if (finalBorderColor) {\r\n styleArr.push(`border-color: ${finalBorderColor} !important;`);\r\n }\r\n if (finalTextColor) {\r\n styleArr.push(`color: ${finalTextColor} !important;`);\r\n }\r\n } else {\r\n /* 填充状态:彩色背景 */\r\n if (color) {\r\n styleArr.push(`background-color: ${color} !important;`);\r\n styleArr.push(`border-color: ${color} !important;`); // 边框也同步成底色以防穿帮\r\n }\r\n if (textColor) {\r\n styleArr.push(`color: ${textColor} !important;`);\r\n }\r\n }\r\n }\r\n\r\n this.setData({\r\n tagStyle: styleArr.join(' ')\r\n });\r\n },\r\n\r\n // 优雅过渡关闭\r\n onClose() {\r\n // 1. 先触发闭合过渡\r\n this.setData({ isClosing: true });\r\n\r\n // 2. 待 200ms 弹性缩退动画播放完毕后,执行物理卸载,并向外抛出事件\r\n (this as any)._timer = setTimeout(() => {\r\n this.setData({ destroyed: true });\r\n this.triggerEvent('close');\r\n }, 200);\r\n }\r\n }\r\n});\r\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<view
|
|
2
|
+
wx:if="{{ !destroyed }}"
|
|
3
|
+
class="sky-tag {{ type ? 'sky-tag--' + type : '' }} {{ size ? 'sky-tag--' + size : '' }} {{ plain ? 'sky-tag--plain' : '' }} {{ round ? 'sky-tag--round' : '' }} {{ isClosing ? 'sky-tag--closing' : '' }}"
|
|
4
|
+
style="{{ customStyle }} {{ tagStyle }}"
|
|
5
|
+
>
|
|
6
|
+
<!-- 标签默认插槽文本内容 -->
|
|
7
|
+
<text class="sky-tag__text"><slot></slot></text>
|
|
8
|
+
|
|
9
|
+
<!-- 右侧纯 CSS 物理手绘关闭删除叉 -->
|
|
10
|
+
<view
|
|
11
|
+
wx:if="{{ closeable }}"
|
|
12
|
+
class="sky-tag__close"
|
|
13
|
+
hover-class="sky-tag__close--hover"
|
|
14
|
+
hover-stay-time="70"
|
|
15
|
+
catchtap="onClose"
|
|
16
|
+
>
|
|
17
|
+
<view class="sky-tag__close-icon"></view>
|
|
18
|
+
</view>
|
|
19
|
+
</view>
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/* ========================================== */
|
|
3
|
+
/* Skyline-UI Tag 标签组件样式 (Sass) */
|
|
4
|
+
/* ========================================== */
|
|
5
|
+
.sky-tag {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
vertical-align: middle;
|
|
12
|
+
border: 1px solid transparent;
|
|
13
|
+
border-radius: 6rpx; /* 默认微小圆角 (6rpx) */
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
line-height: 1;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
/* 极致防直角 Tap 高亮 */
|
|
18
|
+
outline: none;
|
|
19
|
+
-webkit-tap-highlight-color: transparent;
|
|
20
|
+
/* 离场过渡属性 */
|
|
21
|
+
transition: transform 200ms cubic-bezier(0.25, 1, 0.5, 1), opacity 200ms ease;
|
|
22
|
+
/* ==================== 1. 莫兰迪低饱和色系变体 ==================== */
|
|
23
|
+
/* 灰色默认 */
|
|
24
|
+
}
|
|
25
|
+
.sky-tag--default {
|
|
26
|
+
background-color: #f1f3f5;
|
|
27
|
+
border-color: #e9ecef;
|
|
28
|
+
color: #495057;
|
|
29
|
+
}
|
|
30
|
+
.sky-tag--default.sky-tag--plain {
|
|
31
|
+
border-color: #dee2e6;
|
|
32
|
+
color: #868e96;
|
|
33
|
+
}
|
|
34
|
+
.sky-tag {
|
|
35
|
+
/* 品牌蓝紫 */
|
|
36
|
+
}
|
|
37
|
+
.sky-tag--primary {
|
|
38
|
+
background-color: #edf2ff;
|
|
39
|
+
border-color: #edf2ff;
|
|
40
|
+
color: #3b5bdb;
|
|
41
|
+
}
|
|
42
|
+
.sky-tag--primary.sky-tag--plain {
|
|
43
|
+
border-color: #3b5bdb;
|
|
44
|
+
color: #3b5bdb;
|
|
45
|
+
}
|
|
46
|
+
.sky-tag {
|
|
47
|
+
/* 典雅翠绿 */
|
|
48
|
+
}
|
|
49
|
+
.sky-tag--success {
|
|
50
|
+
background-color: #ebfbee;
|
|
51
|
+
border-color: #ebfbee;
|
|
52
|
+
color: #2b8a3e;
|
|
53
|
+
}
|
|
54
|
+
.sky-tag--success.sky-tag--plain {
|
|
55
|
+
border-color: #2b8a3e;
|
|
56
|
+
color: #2b8a3e;
|
|
57
|
+
}
|
|
58
|
+
.sky-tag {
|
|
59
|
+
/* 琥珀温暖黄 */
|
|
60
|
+
}
|
|
61
|
+
.sky-tag--warning {
|
|
62
|
+
background-color: #fff9db;
|
|
63
|
+
border-color: #fff9db;
|
|
64
|
+
color: #f08c00;
|
|
65
|
+
}
|
|
66
|
+
.sky-tag--warning.sky-tag--plain {
|
|
67
|
+
border-color: #f08c00;
|
|
68
|
+
color: #f08c00;
|
|
69
|
+
}
|
|
70
|
+
.sky-tag {
|
|
71
|
+
/* 珊瑚危险红 */
|
|
72
|
+
}
|
|
73
|
+
.sky-tag--danger {
|
|
74
|
+
background-color: #ffeef0;
|
|
75
|
+
border-color: #ffeef0;
|
|
76
|
+
color: #fa5252;
|
|
77
|
+
}
|
|
78
|
+
.sky-tag--danger.sky-tag--plain {
|
|
79
|
+
border-color: #fa5252;
|
|
80
|
+
color: #fa5252;
|
|
81
|
+
}
|
|
82
|
+
.sky-tag {
|
|
83
|
+
/* 蔚蓝信息蓝 */
|
|
84
|
+
}
|
|
85
|
+
.sky-tag--info {
|
|
86
|
+
background-color: #e7f5ff;
|
|
87
|
+
border-color: #e7f5ff;
|
|
88
|
+
color: #1c7ed6;
|
|
89
|
+
}
|
|
90
|
+
.sky-tag--info.sky-tag--plain {
|
|
91
|
+
border-color: #1c7ed6;
|
|
92
|
+
color: #1c7ed6;
|
|
93
|
+
}
|
|
94
|
+
.sky-tag {
|
|
95
|
+
/* ==================== 2. 镂空样式 (白底彩边,继承于变体) ==================== */
|
|
96
|
+
}
|
|
97
|
+
.sky-tag--plain {
|
|
98
|
+
background-color: #ffffff !important;
|
|
99
|
+
}
|
|
100
|
+
.sky-tag {
|
|
101
|
+
/* ==================== 3. 尺寸规范 (呼吸感内边距) ==================== */
|
|
102
|
+
/* 精致小号 */
|
|
103
|
+
}
|
|
104
|
+
.sky-tag--normal {
|
|
105
|
+
height: 38rpx;
|
|
106
|
+
padding: 0 10rpx;
|
|
107
|
+
font-size: 20rpx;
|
|
108
|
+
}
|
|
109
|
+
.sky-tag {
|
|
110
|
+
/* 匀称中号 */
|
|
111
|
+
}
|
|
112
|
+
.sky-tag--medium {
|
|
113
|
+
height: 46rpx;
|
|
114
|
+
padding: 0 16rpx;
|
|
115
|
+
font-size: 24rpx;
|
|
116
|
+
}
|
|
117
|
+
.sky-tag {
|
|
118
|
+
/* 大气大号 */
|
|
119
|
+
}
|
|
120
|
+
.sky-tag--large {
|
|
121
|
+
height: 54rpx;
|
|
122
|
+
padding: 0 20rpx;
|
|
123
|
+
font-size: 28rpx;
|
|
124
|
+
}
|
|
125
|
+
.sky-tag {
|
|
126
|
+
/* ==================== 4. 胶囊圆角 (Round) ==================== */
|
|
127
|
+
}
|
|
128
|
+
.sky-tag--round {
|
|
129
|
+
border-radius: 999rpx;
|
|
130
|
+
}
|
|
131
|
+
.sky-tag {
|
|
132
|
+
/* ==================== 5. 右侧纯 CSS 物理手绘关闭小叉 ==================== */
|
|
133
|
+
}
|
|
134
|
+
.sky-tag .sky-tag__close {
|
|
135
|
+
width: 28rpx;
|
|
136
|
+
height: 100%;
|
|
137
|
+
margin-left: 8rpx;
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
border-radius: 50%;
|
|
144
|
+
transition: background-color 150ms ease;
|
|
145
|
+
}
|
|
146
|
+
.sky-tag {
|
|
147
|
+
/* 点击删除小叉微按压态反馈 */
|
|
148
|
+
}
|
|
149
|
+
.sky-tag .sky-tag__close--hover {
|
|
150
|
+
background-color: rgba(0, 0, 0, 0.06);
|
|
151
|
+
}
|
|
152
|
+
.sky-tag .sky-tag__close-icon {
|
|
153
|
+
position: relative;
|
|
154
|
+
width: 14rpx;
|
|
155
|
+
height: 14rpx;
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
box-sizing: border-box;
|
|
160
|
+
/* 采用 currentColor 保证叉的颜色始终与父标签的主题文字色保持绝对一致 */
|
|
161
|
+
}
|
|
162
|
+
.sky-tag .sky-tag__close-icon::before, .sky-tag .sky-tag__close-icon::after {
|
|
163
|
+
content: " ";
|
|
164
|
+
position: absolute;
|
|
165
|
+
width: 2rpx;
|
|
166
|
+
height: 14rpx;
|
|
167
|
+
background-color: currentColor;
|
|
168
|
+
border-radius: 1px;
|
|
169
|
+
}
|
|
170
|
+
.sky-tag .sky-tag__close-icon::before {
|
|
171
|
+
transform: rotate(45deg);
|
|
172
|
+
}
|
|
173
|
+
.sky-tag .sky-tag__close-icon::after {
|
|
174
|
+
transform: rotate(-45deg);
|
|
175
|
+
}
|
|
176
|
+
.sky-tag {
|
|
177
|
+
/* ==================== 6. 点击关闭时平滑缩退动效 (离场) ==================== */
|
|
178
|
+
}
|
|
179
|
+
.sky-tag--closing {
|
|
180
|
+
opacity: 0;
|
|
181
|
+
transform: scale(0);
|
|
182
|
+
}
|