wedux-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +184 -0
- package/miniprogram_dist/behaviors/formField.js +35 -0
- package/miniprogram_dist/components/avatar/avatar.js +70 -0
- package/miniprogram_dist/components/avatar/avatar.json +4 -0
- package/miniprogram_dist/components/avatar/avatar.scss +68 -0
- package/miniprogram_dist/components/avatar/avatar.wxml +15 -0
- package/miniprogram_dist/components/avatar-group/avatar-group.js +45 -0
- package/miniprogram_dist/components/avatar-group/avatar-group.json +7 -0
- package/miniprogram_dist/components/avatar-group/avatar-group.scss +4 -0
- package/miniprogram_dist/components/avatar-group/avatar-group.wxml +3 -0
- package/miniprogram_dist/components/back-top/back-top.js +68 -0
- package/miniprogram_dist/components/back-top/back-top.json +4 -0
- package/miniprogram_dist/components/back-top/back-top.scss +43 -0
- package/miniprogram_dist/components/back-top/back-top.wxml +10 -0
- package/miniprogram_dist/components/badge/badge.js +100 -0
- package/miniprogram_dist/components/badge/badge.json +4 -0
- package/miniprogram_dist/components/badge/badge.scss +98 -0
- package/miniprogram_dist/components/badge/badge.wxml +11 -0
- package/miniprogram_dist/components/button/button.js +152 -0
- package/miniprogram_dist/components/button/button.json +4 -0
- package/miniprogram_dist/components/button/button.scss +499 -0
- package/miniprogram_dist/components/button/button.wxml +21 -0
- package/miniprogram_dist/components/button-group/button-group.js +51 -0
- package/miniprogram_dist/components/button-group/button-group.json +4 -0
- package/miniprogram_dist/components/button-group/button-group.scss +8 -0
- package/miniprogram_dist/components/button-group/button-group.wxml +3 -0
- package/miniprogram_dist/components/calendar/calendar.js +308 -0
- package/miniprogram_dist/components/calendar/calendar.json +4 -0
- package/miniprogram_dist/components/calendar/calendar.scss +141 -0
- package/miniprogram_dist/components/calendar/calendar.wxml +47 -0
- package/miniprogram_dist/components/card/card.js +44 -0
- package/miniprogram_dist/components/card/card.json +4 -0
- package/miniprogram_dist/components/card/card.scss +143 -0
- package/miniprogram_dist/components/card/card.wxml +31 -0
- package/miniprogram_dist/components/checkbox/checkbox.js +43 -0
- package/miniprogram_dist/components/checkbox/checkbox.json +4 -0
- package/miniprogram_dist/components/checkbox/checkbox.scss +77 -0
- package/miniprogram_dist/components/checkbox/checkbox.wxml +13 -0
- package/miniprogram_dist/components/checkbox-button/checkbox-button.js +43 -0
- package/miniprogram_dist/components/checkbox-button/checkbox-button.json +4 -0
- package/miniprogram_dist/components/checkbox-button/checkbox-button.scss +39 -0
- package/miniprogram_dist/components/checkbox-button/checkbox-button.wxml +8 -0
- package/miniprogram_dist/components/checkbox-group/checkbox-group.js +84 -0
- package/miniprogram_dist/components/checkbox-group/checkbox-group.json +4 -0
- package/miniprogram_dist/components/checkbox-group/checkbox-group.scss +9 -0
- package/miniprogram_dist/components/checkbox-group/checkbox-group.wxml +3 -0
- package/miniprogram_dist/components/color-picker/color-picker.js +348 -0
- package/miniprogram_dist/components/color-picker/color-picker.json +7 -0
- package/miniprogram_dist/components/color-picker/color-picker.scss +383 -0
- package/miniprogram_dist/components/color-picker/color-picker.wxml +232 -0
- package/miniprogram_dist/components/date-picker/date-picker.js +1289 -0
- package/miniprogram_dist/components/date-picker/date-picker.json +7 -0
- package/miniprogram_dist/components/date-picker/date-picker.scss +468 -0
- package/miniprogram_dist/components/date-picker/date-picker.wxml +214 -0
- package/miniprogram_dist/components/divider/divider.js +34 -0
- package/miniprogram_dist/components/divider/divider.json +4 -0
- package/miniprogram_dist/components/divider/divider.scss +75 -0
- package/miniprogram_dist/components/divider/divider.wxml +8 -0
- package/miniprogram_dist/components/drawer/drawer.js +104 -0
- package/miniprogram_dist/components/drawer/drawer.json +4 -0
- package/miniprogram_dist/components/drawer/drawer.scss +171 -0
- package/miniprogram_dist/components/drawer/drawer.wxml +22 -0
- package/miniprogram_dist/components/ellipsis/ellipsis.js +38 -0
- package/miniprogram_dist/components/ellipsis/ellipsis.json +4 -0
- package/miniprogram_dist/components/ellipsis/ellipsis.scss +22 -0
- package/miniprogram_dist/components/ellipsis/ellipsis.wxml +7 -0
- package/miniprogram_dist/components/flex/flex.js +81 -0
- package/miniprogram_dist/components/flex/flex.json +4 -0
- package/miniprogram_dist/components/flex/flex.scss +4 -0
- package/miniprogram_dist/components/flex/flex.wxml +3 -0
- package/miniprogram_dist/components/float-button/float-button.js +78 -0
- package/miniprogram_dist/components/float-button/float-button.json +4 -0
- package/miniprogram_dist/components/float-button/float-button.scss +54 -0
- package/miniprogram_dist/components/float-button/float-button.wxml +9 -0
- package/miniprogram_dist/components/form/form.js +142 -0
- package/miniprogram_dist/components/form/form.json +4 -0
- package/miniprogram_dist/components/form/form.scss +11 -0
- package/miniprogram_dist/components/form/form.wxml +3 -0
- package/miniprogram_dist/components/form/validator.js +220 -0
- package/miniprogram_dist/components/form-item/form-item.js +240 -0
- package/miniprogram_dist/components/form-item/form-item.json +4 -0
- package/miniprogram_dist/components/form-item/form-item.scss +59 -0
- package/miniprogram_dist/components/form-item/form-item.wxml +33 -0
- package/miniprogram_dist/components/gradient-text/gradient-text.js +54 -0
- package/miniprogram_dist/components/gradient-text/gradient-text.json +4 -0
- package/miniprogram_dist/components/gradient-text/gradient-text.scss +7 -0
- package/miniprogram_dist/components/gradient-text/gradient-text.wxml +1 -0
- package/miniprogram_dist/components/h/h.js +60 -0
- package/miniprogram_dist/components/h/h.json +4 -0
- package/miniprogram_dist/components/h/h.scss +53 -0
- package/miniprogram_dist/components/h/h.wxml +1 -0
- package/miniprogram_dist/components/highlight/highlight.js +77 -0
- package/miniprogram_dist/components/highlight/highlight.json +4 -0
- package/miniprogram_dist/components/highlight/highlight.scss +8 -0
- package/miniprogram_dist/components/highlight/highlight.wxml +12 -0
- package/miniprogram_dist/components/infinite-scroll/infinite-scroll.js +31 -0
- package/miniprogram_dist/components/infinite-scroll/infinite-scroll.json +4 -0
- package/miniprogram_dist/components/infinite-scroll/infinite-scroll.scss +31 -0
- package/miniprogram_dist/components/infinite-scroll/infinite-scroll.wxml +12 -0
- package/miniprogram_dist/components/input/input.js +59 -0
- package/miniprogram_dist/components/input/input.json +4 -0
- package/miniprogram_dist/components/input/input.scss +96 -0
- package/miniprogram_dist/components/input/input.wxml +34 -0
- package/miniprogram_dist/components/input-otp/input-otp.js +106 -0
- package/miniprogram_dist/components/input-otp/input-otp.json +4 -0
- package/miniprogram_dist/components/input-otp/input-otp.scss +122 -0
- package/miniprogram_dist/components/input-otp/input-otp.wxml +38 -0
- package/miniprogram_dist/components/layout/layout.js +50 -0
- package/miniprogram_dist/components/layout/layout.json +4 -0
- package/miniprogram_dist/components/layout/layout.scss +10 -0
- package/miniprogram_dist/components/layout/layout.wxml +3 -0
- package/miniprogram_dist/components/layout-content/layout-content.js +47 -0
- package/miniprogram_dist/components/layout-content/layout-content.json +4 -0
- package/miniprogram_dist/components/layout-content/layout-content.scss +5 -0
- package/miniprogram_dist/components/layout-content/layout-content.wxml +13 -0
- package/miniprogram_dist/components/layout-footer/layout-footer.js +59 -0
- package/miniprogram_dist/components/layout-footer/layout-footer.json +4 -0
- package/miniprogram_dist/components/layout-footer/layout-footer.scss +23 -0
- package/miniprogram_dist/components/layout-footer/layout-footer.wxml +16 -0
- package/miniprogram_dist/components/layout-header/layout-header.js +59 -0
- package/miniprogram_dist/components/layout-header/layout-header.json +4 -0
- package/miniprogram_dist/components/layout-header/layout-header.scss +23 -0
- package/miniprogram_dist/components/layout-header/layout-header.wxml +16 -0
- package/miniprogram_dist/components/layout-sider/layout-sider.js +48 -0
- package/miniprogram_dist/components/layout-sider/layout-sider.json +4 -0
- package/miniprogram_dist/components/layout-sider/layout-sider.scss +13 -0
- package/miniprogram_dist/components/layout-sider/layout-sider.wxml +5 -0
- package/miniprogram_dist/components/list/list.js +55 -0
- package/miniprogram_dist/components/list/list.json +4 -0
- package/miniprogram_dist/components/list/list.scss +51 -0
- package/miniprogram_dist/components/list/list.wxml +9 -0
- package/miniprogram_dist/components/list-item/list-item.js +24 -0
- package/miniprogram_dist/components/list-item/list-item.json +4 -0
- package/miniprogram_dist/components/list-item/list-item.scss +51 -0
- package/miniprogram_dist/components/list-item/list-item.wxml +14 -0
- package/miniprogram_dist/components/navigation-bar/navigation-bar.js +77 -0
- package/miniprogram_dist/components/navigation-bar/navigation-bar.json +4 -0
- package/miniprogram_dist/components/navigation-bar/navigation-bar.scss +63 -0
- package/miniprogram_dist/components/navigation-bar/navigation-bar.wxml +35 -0
- package/miniprogram_dist/components/number-animation/number-animation.js +124 -0
- package/miniprogram_dist/components/number-animation/number-animation.json +4 -0
- package/miniprogram_dist/components/number-animation/number-animation.scss +3 -0
- package/miniprogram_dist/components/number-animation/number-animation.wxml +1 -0
- package/miniprogram_dist/components/popover/popover.js +183 -0
- package/miniprogram_dist/components/popover/popover.json +4 -0
- package/miniprogram_dist/components/popover/popover.scss +69 -0
- package/miniprogram_dist/components/popover/popover.wxml +19 -0
- package/miniprogram_dist/components/qr-code/qr-code.js +216 -0
- package/miniprogram_dist/components/qr-code/qr-code.json +4 -0
- package/miniprogram_dist/components/qr-code/qr-code.scss +8 -0
- package/miniprogram_dist/components/qr-code/qr-code.wxml +16 -0
- package/miniprogram_dist/components/radio/radio.js +38 -0
- package/miniprogram_dist/components/radio/radio.json +4 -0
- package/miniprogram_dist/components/radio/radio.scss +50 -0
- package/miniprogram_dist/components/radio/radio.wxml +12 -0
- package/miniprogram_dist/components/radio-button/radio-button.js +39 -0
- package/miniprogram_dist/components/radio-button/radio-button.json +4 -0
- package/miniprogram_dist/components/radio-button/radio-button.scss +39 -0
- package/miniprogram_dist/components/radio-button/radio-button.wxml +8 -0
- package/miniprogram_dist/components/radio-group/radio-group.js +72 -0
- package/miniprogram_dist/components/radio-group/radio-group.json +4 -0
- package/miniprogram_dist/components/radio-group/radio-group.scss +9 -0
- package/miniprogram_dist/components/radio-group/radio-group.wxml +3 -0
- package/miniprogram_dist/components/rate/rate.js +90 -0
- package/miniprogram_dist/components/rate/rate.json +4 -0
- package/miniprogram_dist/components/rate/rate.scss +59 -0
- package/miniprogram_dist/components/rate/rate.wxml +16 -0
- package/miniprogram_dist/components/select/select.js +201 -0
- package/miniprogram_dist/components/select/select.json +7 -0
- package/miniprogram_dist/components/select/select.scss +235 -0
- package/miniprogram_dist/components/select/select.wxml +79 -0
- package/miniprogram_dist/components/stepper/stepper.js +113 -0
- package/miniprogram_dist/components/stepper/stepper.json +4 -0
- package/miniprogram_dist/components/stepper/stepper.scss +73 -0
- package/miniprogram_dist/components/stepper/stepper.wxml +23 -0
- package/miniprogram_dist/components/switch/switch.js +42 -0
- package/miniprogram_dist/components/switch/switch.json +4 -0
- package/miniprogram_dist/components/switch/switch.scss +77 -0
- package/miniprogram_dist/components/switch/switch.wxml +10 -0
- package/miniprogram_dist/components/tab-bar/tab-bar.js +53 -0
- package/miniprogram_dist/components/tab-bar/tab-bar.json +4 -0
- package/miniprogram_dist/components/tab-bar/tab-bar.scss +53 -0
- package/miniprogram_dist/components/tab-bar/tab-bar.wxml +12 -0
- package/miniprogram_dist/components/tag/tag.js +87 -0
- package/miniprogram_dist/components/tag/tag.json +4 -0
- package/miniprogram_dist/components/tag/tag.scss +138 -0
- package/miniprogram_dist/components/tag/tag.wxml +12 -0
- package/miniprogram_dist/components/textarea/textarea.js +46 -0
- package/miniprogram_dist/components/textarea/textarea.json +4 -0
- package/miniprogram_dist/components/textarea/textarea.scss +51 -0
- package/miniprogram_dist/components/textarea/textarea.wxml +20 -0
- package/miniprogram_dist/components/theme-provider/presets.js +101 -0
- package/miniprogram_dist/components/theme-provider/theme-provider.js +34 -0
- package/miniprogram_dist/components/theme-provider/theme-provider.json +4 -0
- package/miniprogram_dist/components/theme-provider/theme-provider.scss +3 -0
- package/miniprogram_dist/components/theme-provider/theme-provider.wxml +3 -0
- package/miniprogram_dist/components/time-picker/time-picker.js +136 -0
- package/miniprogram_dist/components/time-picker/time-picker.json +7 -0
- package/miniprogram_dist/components/time-picker/time-picker.scss +135 -0
- package/miniprogram_dist/components/time-picker/time-picker.wxml +47 -0
- package/miniprogram_dist/components/tooltip/tooltip.js +179 -0
- package/miniprogram_dist/components/tooltip/tooltip.json +4 -0
- package/miniprogram_dist/components/tooltip/tooltip.scss +66 -0
- package/miniprogram_dist/components/tooltip/tooltip.wxml +17 -0
- package/miniprogram_dist/components/tree/tree.js +647 -0
- package/miniprogram_dist/components/tree/tree.json +4 -0
- package/miniprogram_dist/components/tree/tree.scss +178 -0
- package/miniprogram_dist/components/tree/tree.wxml +59 -0
- package/miniprogram_dist/components/tree-select/tree-select.js +260 -0
- package/miniprogram_dist/components/tree-select/tree-select.json +8 -0
- package/miniprogram_dist/components/tree-select/tree-select.scss +250 -0
- package/miniprogram_dist/components/tree-select/tree-select.wxml +118 -0
- package/miniprogram_dist/components/upload/upload.js +387 -0
- package/miniprogram_dist/components/upload/upload.json +4 -0
- package/miniprogram_dist/components/upload/upload.scss +258 -0
- package/miniprogram_dist/components/upload/upload.wxml +142 -0
- package/miniprogram_dist/components/watermark/watermark.js +260 -0
- package/miniprogram_dist/components/watermark/watermark.json +4 -0
- package/miniprogram_dist/components/watermark/watermark.scss +35 -0
- package/miniprogram_dist/components/watermark/watermark.wxml +13 -0
- package/miniprogram_dist/libs/qrcodegen.js +714 -0
- package/miniprogram_dist/libs/seemly.min.js +547 -0
- package/miniprogram_dist/libs/tempo_1_0_0.js +1264 -0
- package/miniprogram_dist/libs/validator_13_56_26.min.js +5282 -0
- package/miniprogram_dist/styles/demo.scss +96 -0
- package/miniprogram_dist/styles/iconfont.scss +91 -0
- package/miniprogram_dist/styles/theme.scss +126 -0
- package/miniprogram_dist/styles/tokens.scss +292 -0
- package/miniprogram_dist/utils/relations.js +21 -0
- package/package.json +25 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
.w-btn {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
height: var(--w-btn-height);
|
|
6
|
+
padding: 0 var(--spacing-xl);
|
|
7
|
+
border-radius: var(--w-btn-radius);
|
|
8
|
+
font-size: var(--w-btn-font-size);
|
|
9
|
+
font-weight: 400;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
transition: opacity 0.2s;
|
|
12
|
+
position: relative;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
border: 2rpx solid transparent;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Reset native button styles */
|
|
19
|
+
wx-button:not([size='mini']) {
|
|
20
|
+
width: auto;
|
|
21
|
+
margin: 0;
|
|
22
|
+
outline: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Block */
|
|
26
|
+
.w-btn--block {
|
|
27
|
+
display: flex;
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Strong */
|
|
32
|
+
.w-btn--strong {
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Round (pill) */
|
|
37
|
+
.w-btn--round,
|
|
38
|
+
.w-btn--round.w-btn--size-medium,
|
|
39
|
+
.w-btn--round.w-btn--size-small {
|
|
40
|
+
border-radius: 9999rpx;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ——— Filled Types ——— */
|
|
44
|
+
|
|
45
|
+
.w-btn--primary {
|
|
46
|
+
background: var(--color-brand);
|
|
47
|
+
color: #ffffff;
|
|
48
|
+
border-color: var(--color-brand);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.w-btn--success {
|
|
52
|
+
background: var(--color-success);
|
|
53
|
+
color: #ffffff;
|
|
54
|
+
border-color: var(--color-success);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.w-btn--info {
|
|
58
|
+
background: var(--color-info);
|
|
59
|
+
color: #ffffff;
|
|
60
|
+
border-color: var(--color-info);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.w-btn--warning {
|
|
64
|
+
background: var(--color-warning);
|
|
65
|
+
color: #ffffff;
|
|
66
|
+
border-color: var(--color-warning);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.w-btn--error {
|
|
70
|
+
background: var(--color-danger);
|
|
71
|
+
color: #ffffff;
|
|
72
|
+
border-color: var(--color-danger);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.w-btn--default {
|
|
76
|
+
background: var(--color-bg-elevated);
|
|
77
|
+
color: var(--color-text-primary);
|
|
78
|
+
border-color: var(--color-separator);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.w-btn--tertiary {
|
|
82
|
+
background: var(--color-bg-base);
|
|
83
|
+
color: var(--color-text-primary);
|
|
84
|
+
border-color: transparent;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* ——— Secondary variant (light tinted bg, colored text) ——— */
|
|
88
|
+
|
|
89
|
+
.w-btn--secondary.w-btn--primary {
|
|
90
|
+
background: rgba(7, 193, 96, 0.12);
|
|
91
|
+
color: var(--color-brand);
|
|
92
|
+
border-color: transparent;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.w-btn--secondary.w-btn--success {
|
|
96
|
+
background: rgba(116, 182, 0, 0.12);
|
|
97
|
+
color: var(--color-success);
|
|
98
|
+
border-color: transparent;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.w-btn--secondary.w-btn--info {
|
|
102
|
+
background: rgba(16, 174, 255, 0.12);
|
|
103
|
+
color: var(--color-info);
|
|
104
|
+
border-color: transparent;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.w-btn--secondary.w-btn--warning {
|
|
108
|
+
background: rgba(250, 157, 59, 0.12);
|
|
109
|
+
color: var(--color-warning);
|
|
110
|
+
border-color: transparent;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.w-btn--secondary.w-btn--error {
|
|
114
|
+
background: rgba(250, 81, 81, 0.12);
|
|
115
|
+
color: var(--color-danger);
|
|
116
|
+
border-color: transparent;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.w-btn--secondary.w-btn--default {
|
|
120
|
+
background: rgba(0, 0, 0, 0.06);
|
|
121
|
+
color: var(--color-text-primary);
|
|
122
|
+
border-color: transparent;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.w-btn--secondary.w-btn--tertiary {
|
|
126
|
+
background: rgba(0, 0, 0, 0.04);
|
|
127
|
+
color: var(--color-text-secondary);
|
|
128
|
+
border-color: transparent;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* ——— Tertiary variant (extra-light tinted bg, colored text) ——— */
|
|
132
|
+
|
|
133
|
+
.w-btn--primary.w-btn--tertiary {
|
|
134
|
+
background: rgba(7, 193, 96, 0.06);
|
|
135
|
+
color: var(--color-brand);
|
|
136
|
+
border-color: transparent;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.w-btn--success.w-btn--tertiary {
|
|
140
|
+
background: rgba(116, 182, 0, 0.06);
|
|
141
|
+
color: var(--color-success);
|
|
142
|
+
border-color: transparent;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.w-btn--info.w-btn--tertiary {
|
|
146
|
+
background: rgba(16, 174, 255, 0.06);
|
|
147
|
+
color: var(--color-info);
|
|
148
|
+
border-color: transparent;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.w-btn--warning.w-btn--tertiary {
|
|
152
|
+
background: rgba(250, 157, 59, 0.06);
|
|
153
|
+
color: var(--color-warning);
|
|
154
|
+
border-color: transparent;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.w-btn--error.w-btn--tertiary {
|
|
158
|
+
background: rgba(250, 81, 81, 0.06);
|
|
159
|
+
color: var(--color-danger);
|
|
160
|
+
border-color: transparent;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* ——— Ghost variant (transparent bg, solid colored border) ——— */
|
|
164
|
+
|
|
165
|
+
.w-btn--ghost.w-btn--primary {
|
|
166
|
+
background: transparent;
|
|
167
|
+
color: var(--color-brand);
|
|
168
|
+
border-color: var(--color-brand);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.w-btn--ghost.w-btn--success {
|
|
172
|
+
background: transparent;
|
|
173
|
+
color: var(--color-success);
|
|
174
|
+
border-color: var(--color-success);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.w-btn--ghost.w-btn--info {
|
|
178
|
+
background: transparent;
|
|
179
|
+
color: var(--color-info);
|
|
180
|
+
border-color: var(--color-info);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.w-btn--ghost.w-btn--warning {
|
|
184
|
+
background: transparent;
|
|
185
|
+
color: var(--color-warning);
|
|
186
|
+
border-color: var(--color-warning);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.w-btn--ghost.w-btn--error {
|
|
190
|
+
background: transparent;
|
|
191
|
+
color: var(--color-danger);
|
|
192
|
+
border-color: var(--color-danger);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.w-btn--ghost.w-btn--default {
|
|
196
|
+
background: transparent;
|
|
197
|
+
color: var(--color-text-primary);
|
|
198
|
+
border-color: var(--color-separator);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* ——— Dashed variant (transparent bg, dashed border) ——— */
|
|
202
|
+
|
|
203
|
+
.w-btn--dashed {
|
|
204
|
+
border-style: dashed;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.w-btn--dashed.w-btn--primary {
|
|
208
|
+
background: transparent;
|
|
209
|
+
color: var(--color-brand);
|
|
210
|
+
border-color: var(--color-brand);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.w-btn--dashed.w-btn--success {
|
|
214
|
+
background: transparent;
|
|
215
|
+
color: var(--color-success);
|
|
216
|
+
border-color: var(--color-success);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.w-btn--dashed.w-btn--info {
|
|
220
|
+
background: transparent;
|
|
221
|
+
color: var(--color-info);
|
|
222
|
+
border-color: var(--color-info);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.w-btn--dashed.w-btn--warning {
|
|
226
|
+
background: transparent;
|
|
227
|
+
color: var(--color-warning);
|
|
228
|
+
border-color: var(--color-warning);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.w-btn--dashed.w-btn--error {
|
|
232
|
+
background: transparent;
|
|
233
|
+
color: var(--color-danger);
|
|
234
|
+
border-color: var(--color-danger);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* ——— Text variant (no bg, no border, just colored text) ——— */
|
|
238
|
+
|
|
239
|
+
.w-btn--quaternary {
|
|
240
|
+
background: transparent;
|
|
241
|
+
border-color: transparent;
|
|
242
|
+
padding: 0 var(--spacing-sm);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.w-btn--quaternary.w-btn--primary {
|
|
246
|
+
color: var(--color-brand);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.w-btn--quaternary.w-btn--success {
|
|
250
|
+
color: var(--color-success);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.w-btn--quaternary.w-btn--info {
|
|
254
|
+
color: var(--color-info);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.w-btn--quaternary.w-btn--warning {
|
|
258
|
+
color: var(--color-warning);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.w-btn--quaternary.w-btn--error {
|
|
262
|
+
color: var(--color-danger);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.w-btn--quaternary.w-btn--default {
|
|
266
|
+
color: var(--color-text-primary);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.w-btn--quaternary.w-btn--tertiary {
|
|
270
|
+
color: var(--color-text-secondary);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* ——— Text prop (inline text, no bg / border / height) ——— */
|
|
274
|
+
|
|
275
|
+
.w-btn--text {
|
|
276
|
+
height: auto;
|
|
277
|
+
padding: 0;
|
|
278
|
+
border-color: transparent;
|
|
279
|
+
background: transparent;
|
|
280
|
+
border-radius: 0;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.w-btn--text.w-btn--size-default,
|
|
284
|
+
.w-btn--text.w-btn--size-medium,
|
|
285
|
+
.w-btn--text.w-btn--size-small {
|
|
286
|
+
height: auto;
|
|
287
|
+
padding: 0;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.w-btn--text.w-btn--primary {
|
|
291
|
+
color: var(--color-brand);
|
|
292
|
+
}
|
|
293
|
+
.w-btn--text.w-btn--success {
|
|
294
|
+
color: var(--color-success);
|
|
295
|
+
}
|
|
296
|
+
.w-btn--text.w-btn--info {
|
|
297
|
+
color: var(--color-info);
|
|
298
|
+
}
|
|
299
|
+
.w-btn--text.w-btn--warning {
|
|
300
|
+
color: var(--color-warning);
|
|
301
|
+
}
|
|
302
|
+
.w-btn--text.w-btn--error {
|
|
303
|
+
color: var(--color-danger);
|
|
304
|
+
}
|
|
305
|
+
.w-btn--text.w-btn--default {
|
|
306
|
+
color: var(--color-text-primary);
|
|
307
|
+
}
|
|
308
|
+
.w-btn--text.w-btn--tertiary {
|
|
309
|
+
color: var(--color-text-secondary);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.w-btn--text .w-btn__spinner {
|
|
313
|
+
border-color: rgba(0, 0, 0, 0.15);
|
|
314
|
+
border-top-color: currentColor;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.w-btn--text .w-btn__overlay {
|
|
318
|
+
display: none;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* ——— Sizes ——— */
|
|
322
|
+
|
|
323
|
+
.w-btn--size-default {
|
|
324
|
+
height: var(--w-btn-height);
|
|
325
|
+
font-size: var(--w-btn-font-size);
|
|
326
|
+
padding: 0 var(--spacing-xl);
|
|
327
|
+
border-radius: var(--w-btn-radius);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.w-btn--size-medium {
|
|
331
|
+
height: var(--w-btn-height-md);
|
|
332
|
+
font-size: var(--w-btn-font-size-md);
|
|
333
|
+
padding: 0 var(--spacing-lg);
|
|
334
|
+
border-radius: var(--w-btn-radius-md);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.w-btn--size-small {
|
|
338
|
+
height: var(--w-btn-height-sm);
|
|
339
|
+
font-size: var(--w-btn-font-size-sm);
|
|
340
|
+
padding: 0 var(--spacing-md);
|
|
341
|
+
border-radius: var(--w-btn-radius-sm);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* Circle */
|
|
345
|
+
.w-btn--circle {
|
|
346
|
+
width: var(--w-btn-height);
|
|
347
|
+
padding: 0;
|
|
348
|
+
border-radius: 50%;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.w-btn--circle.w-btn--size-medium {
|
|
352
|
+
width: var(--w-btn-height-md);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.w-btn--circle.w-btn--size-small {
|
|
356
|
+
width: var(--w-btn-height-sm);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/* Text variant size overrides — reduce horizontal padding */
|
|
360
|
+
.w-btn--quaternary.w-btn--size-medium {
|
|
361
|
+
padding: 0 var(--spacing-xs);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.w-btn--quaternary.w-btn--size-small {
|
|
365
|
+
padding: 0 var(--spacing-xs);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* Circle size overrides */
|
|
369
|
+
.w-btn--circle.w-btn--size-default {
|
|
370
|
+
width: var(--w-btn-height);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* ——— Press overlay ——— */
|
|
374
|
+
|
|
375
|
+
.w-btn__overlay {
|
|
376
|
+
position: absolute;
|
|
377
|
+
top: 0;
|
|
378
|
+
left: 0;
|
|
379
|
+
right: 0;
|
|
380
|
+
bottom: 0;
|
|
381
|
+
border-radius: inherit;
|
|
382
|
+
pointer-events: none;
|
|
383
|
+
opacity: 0;
|
|
384
|
+
transition: opacity 0.2s;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.w-btn--active .w-btn__overlay {
|
|
388
|
+
opacity: 1;
|
|
389
|
+
background: var(--color-press-overlay);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.w-btn--default.w-btn--active .w-btn__overlay,
|
|
393
|
+
.w-btn--tertiary.w-btn--active .w-btn__overlay,
|
|
394
|
+
.w-btn--secondary.w-btn--active .w-btn__overlay,
|
|
395
|
+
.w-btn--ghost.w-btn--active .w-btn__overlay,
|
|
396
|
+
.w-btn--dashed.w-btn--active .w-btn__overlay,
|
|
397
|
+
.w-btn--quaternary.w-btn--active .w-btn__overlay {
|
|
398
|
+
background: var(--color-press-overlay-light);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* ——— States ——— */
|
|
402
|
+
|
|
403
|
+
.w-btn--disabled {
|
|
404
|
+
opacity: 0.4;
|
|
405
|
+
pointer-events: none;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.w-btn--loading {
|
|
409
|
+
pointer-events: none;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/* ——— Loading spinner ——— */
|
|
413
|
+
|
|
414
|
+
.w-btn__spinner {
|
|
415
|
+
width: 36rpx;
|
|
416
|
+
height: 36rpx;
|
|
417
|
+
border: 4rpx solid rgba(255, 255, 255, 0.4);
|
|
418
|
+
border-top-color: #ffffff;
|
|
419
|
+
border-radius: 50%;
|
|
420
|
+
margin-right: var(--spacing-sm);
|
|
421
|
+
animation: w-spin 0.8s linear infinite;
|
|
422
|
+
flex-shrink: 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.w-btn--size-medium .w-btn__spinner {
|
|
426
|
+
width: 28rpx;
|
|
427
|
+
height: 28rpx;
|
|
428
|
+
border-width: 3rpx;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.w-btn--size-small .w-btn__spinner {
|
|
432
|
+
width: 22rpx;
|
|
433
|
+
height: 22rpx;
|
|
434
|
+
border-width: 2rpx;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* Dark spinner for non-white-text buttons */
|
|
438
|
+
.w-btn--default .w-btn__spinner,
|
|
439
|
+
.w-btn--tertiary .w-btn__spinner,
|
|
440
|
+
.w-btn--secondary .w-btn__spinner,
|
|
441
|
+
.w-btn--ghost .w-btn__spinner,
|
|
442
|
+
.w-btn--dashed .w-btn__spinner,
|
|
443
|
+
.w-btn--quaternary .w-btn__spinner {
|
|
444
|
+
border-color: rgba(0, 0, 0, 0.15);
|
|
445
|
+
border-top-color: currentColor;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
@keyframes w-spin {
|
|
449
|
+
to {
|
|
450
|
+
transform: rotate(360deg);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/* ——— Button group positioning — horizontal ——— */
|
|
455
|
+
|
|
456
|
+
.w-btn--group-first {
|
|
457
|
+
border-top-right-radius: 0;
|
|
458
|
+
border-bottom-right-radius: 0;
|
|
459
|
+
border-right-width: 0;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.w-btn--group-middle {
|
|
463
|
+
border-radius: 0;
|
|
464
|
+
border-right-width: 0;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.w-btn--group-last {
|
|
468
|
+
border-top-left-radius: 0;
|
|
469
|
+
border-bottom-left-radius: 0;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/* ——— Button group positioning — vertical ——— */
|
|
473
|
+
|
|
474
|
+
.w-btn--group-v-first {
|
|
475
|
+
border-bottom-left-radius: 0;
|
|
476
|
+
border-bottom-right-radius: 0;
|
|
477
|
+
border-bottom-width: 0;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.w-btn--group-v-middle {
|
|
481
|
+
border-radius: 0;
|
|
482
|
+
border-bottom-width: 0;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.w-btn--group-v-last {
|
|
486
|
+
border-top-left-radius: 0;
|
|
487
|
+
border-top-right-radius: 0;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/* Bring active button's border to front */
|
|
491
|
+
.w-btn--group-first.w-btn--active,
|
|
492
|
+
.w-btn--group-middle.w-btn--active,
|
|
493
|
+
.w-btn--group-last.w-btn--active,
|
|
494
|
+
.w-btn--group-v-first.w-btn--active,
|
|
495
|
+
.w-btn--group-v-middle.w-btn--active,
|
|
496
|
+
.w-btn--group-v-last.w-btn--active {
|
|
497
|
+
position: relative;
|
|
498
|
+
z-index: 1;
|
|
499
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<button
|
|
2
|
+
class="w-btn w-btn--{{type}} w-btn--size-{{_groupSize || size}} {{secondary ? 'w-btn--secondary' : ''}} {{tertiary ? 'w-btn--tertiary' : ''}} {{ghost ? 'w-btn--ghost' : ''}} {{dashed ? 'w-btn--dashed' : ''}} {{quaternary ? 'w-btn--quaternary' : ''}} {{text ? 'w-btn--text' : ''}} {{strong ? 'w-btn--strong' : ''}} {{round ? 'w-btn--round' : ''}} {{circle ? 'w-btn--circle' : ''}} {{block ? 'w-btn--block' : ''}} {{disabled ? 'w-btn--disabled' : ''}} {{loading ? 'w-btn--loading' : ''}} {{_groupClass}}"
|
|
3
|
+
style="{{_style}}"
|
|
4
|
+
hover-class="{{text ? '' : 'w-btn--active'}}"
|
|
5
|
+
hover-stay-time="70"
|
|
6
|
+
catchtap="handleTap"
|
|
7
|
+
open-type="{{openType}}"
|
|
8
|
+
form-type="{{formType}}"
|
|
9
|
+
bindgetphonenumber="handleGetPhoneNumber"
|
|
10
|
+
bindgetrealtimephonenumber="handleGetRealtimePhoneNumber"
|
|
11
|
+
bindchooseavatar="handleChooseAvatar"
|
|
12
|
+
bindgetuserinfo="handleUserInfo"
|
|
13
|
+
bindcontact="handleContact"
|
|
14
|
+
bindlaunchapp="handleLaunchApp"
|
|
15
|
+
bindopensetting="handleOpenSetting"
|
|
16
|
+
bindagreeprivacyauthorization="handleAgreePrivacyAuthorization"
|
|
17
|
+
>
|
|
18
|
+
<view wx:if="{{loading}}" class="w-btn__spinner"></view>
|
|
19
|
+
<view class="w-btn__overlay"></view>
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</button>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Component({
|
|
2
|
+
relations: {
|
|
3
|
+
'../button/button': {
|
|
4
|
+
type: 'descendant',
|
|
5
|
+
linked() {
|
|
6
|
+
this._updateChildren();
|
|
7
|
+
},
|
|
8
|
+
linkChanged() {
|
|
9
|
+
this._updateChildren();
|
|
10
|
+
},
|
|
11
|
+
unlinked() {
|
|
12
|
+
this._updateChildren();
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
properties: {
|
|
18
|
+
size: {
|
|
19
|
+
type: String,
|
|
20
|
+
value: '', // '' means use each button's own size
|
|
21
|
+
},
|
|
22
|
+
vertical: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
value: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
observers: {
|
|
29
|
+
'size, vertical'() {
|
|
30
|
+
this._updateChildren();
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
methods: {
|
|
35
|
+
_updateChildren() {
|
|
36
|
+
const children = this.getRelationNodes('../button/button');
|
|
37
|
+
const count = children.length;
|
|
38
|
+
const size = this.data.size;
|
|
39
|
+
const vertical = this.data.vertical;
|
|
40
|
+
|
|
41
|
+
children.forEach((child, i) => {
|
|
42
|
+
const position = i === 0 ? 'first' : i === count - 1 ? 'last' : 'middle';
|
|
43
|
+
child._setGroupContext({
|
|
44
|
+
position,
|
|
45
|
+
size,
|
|
46
|
+
vertical,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|