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,53 @@
|
|
|
1
|
+
Component({
|
|
2
|
+
properties: {
|
|
3
|
+
active: {
|
|
4
|
+
type: String,
|
|
5
|
+
value: '',
|
|
6
|
+
},
|
|
7
|
+
items: {
|
|
8
|
+
type: Array,
|
|
9
|
+
value: [],
|
|
10
|
+
},
|
|
11
|
+
activeColor: {
|
|
12
|
+
type: String,
|
|
13
|
+
value: '',
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
type: String,
|
|
17
|
+
value: '',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
data: {
|
|
22
|
+
_style: '',
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
observers: {
|
|
26
|
+
'activeColor, color': function (activeColor, color) {
|
|
27
|
+
let style = '';
|
|
28
|
+
if (activeColor) {
|
|
29
|
+
style += `--tab-bar-active-bg: ${activeColor};`;
|
|
30
|
+
}
|
|
31
|
+
if (color) {
|
|
32
|
+
style += `--tab-bar-color: ${color};`;
|
|
33
|
+
}
|
|
34
|
+
this.setData({ _style: style });
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
methods: {
|
|
39
|
+
onTabTap(e) {
|
|
40
|
+
const { key } = e.currentTarget.dataset;
|
|
41
|
+
if (key === this.data.active) return;
|
|
42
|
+
|
|
43
|
+
const item = this.data.items.find((i) => i.key === key);
|
|
44
|
+
if (!item) return;
|
|
45
|
+
|
|
46
|
+
if (item.url) {
|
|
47
|
+
wx.redirectTo({ url: item.url });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
this.triggerEvent('change', { key, item });
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@import '../../styles/iconfont.scss';
|
|
2
|
+
|
|
3
|
+
.w-tab-bar {
|
|
4
|
+
position: fixed;
|
|
5
|
+
bottom: env(safe-area-inset-bottom);
|
|
6
|
+
left: var(--tab-bar-margin);
|
|
7
|
+
right: var(--tab-bar-margin);
|
|
8
|
+
padding: var(--spacing-xs) var(--spacing-xs) calc(var(--spacing-xs));
|
|
9
|
+
background: var(--tab-bar-bg);
|
|
10
|
+
border-radius: var(--tab-bar-radius);
|
|
11
|
+
box-shadow: var(--tab-bar-shadow);
|
|
12
|
+
z-index: var(--tab-bar-z-index);
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
box-sizing: content-box;
|
|
16
|
+
margin-bottom: var(--spacing-sm);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.w-tab-bar__item {
|
|
20
|
+
flex: 1;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
gap: 4rpx;
|
|
26
|
+
padding: var(--spacing-sm) 0;
|
|
27
|
+
color: var(--tab-bar-color);
|
|
28
|
+
border-radius: var(--tab-bar-radius);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.w-tab-bar__icon {
|
|
32
|
+
font-size: var(--tab-bar-icon-size);
|
|
33
|
+
transition: color 0.2s;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.w-tab-bar__label {
|
|
37
|
+
font-size: var(--tab-bar-label-size);
|
|
38
|
+
line-height: 1.2;
|
|
39
|
+
transition: color 0.2s;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Active state */
|
|
43
|
+
.w-tab-bar__item--active {
|
|
44
|
+
background-color: var(--tab-bar-active-bg);
|
|
45
|
+
|
|
46
|
+
.w-tab-bar__icon {
|
|
47
|
+
color: var(--tab-bar-active-color);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.w-tab-bar__label {
|
|
51
|
+
color: var(--tab-bar-active-color);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<view class="w-tab-bar" style="{{_style}}">
|
|
2
|
+
<view
|
|
3
|
+
wx:for="{{items}}"
|
|
4
|
+
wx:key="key"
|
|
5
|
+
class="w-tab-bar__item {{item.key === active ? 'w-tab-bar__item--active' : ''}}"
|
|
6
|
+
data-key="{{item.key}}"
|
|
7
|
+
bindtap="onTabTap"
|
|
8
|
+
>
|
|
9
|
+
<view wx:if="{{item.icon}}" class="iconfont icon-{{item.icon}} w-tab-bar__icon"></view>
|
|
10
|
+
<text class="w-tab-bar__label">{{item.label}}</text>
|
|
11
|
+
</view>
|
|
12
|
+
</view>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Component({
|
|
2
|
+
properties: {
|
|
3
|
+
type: {
|
|
4
|
+
type: String,
|
|
5
|
+
value: 'default', // 'default' | 'primary' | 'success' | 'info' | 'warning' | 'error'
|
|
6
|
+
},
|
|
7
|
+
size: {
|
|
8
|
+
type: String,
|
|
9
|
+
value: 'medium', // small | medium | large
|
|
10
|
+
},
|
|
11
|
+
closable: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
value: false,
|
|
14
|
+
},
|
|
15
|
+
disabled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
value: false,
|
|
18
|
+
},
|
|
19
|
+
checkable: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
value: false,
|
|
22
|
+
},
|
|
23
|
+
checked: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
value: false,
|
|
26
|
+
},
|
|
27
|
+
round: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
value: false,
|
|
30
|
+
},
|
|
31
|
+
bordered: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
value: true,
|
|
34
|
+
},
|
|
35
|
+
strong: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
value: false,
|
|
38
|
+
},
|
|
39
|
+
color: {
|
|
40
|
+
type: String,
|
|
41
|
+
value: '',
|
|
42
|
+
},
|
|
43
|
+
textColor: {
|
|
44
|
+
type: String,
|
|
45
|
+
value: '',
|
|
46
|
+
},
|
|
47
|
+
borderColor: {
|
|
48
|
+
type: String,
|
|
49
|
+
value: '',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
data: {
|
|
54
|
+
_style: '',
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
observers: {
|
|
58
|
+
'color, textColor, borderColor'(color, textColor, borderColor) {
|
|
59
|
+
const parts = [];
|
|
60
|
+
if (color) {
|
|
61
|
+
parts.push(`background-color: ${color}`);
|
|
62
|
+
}
|
|
63
|
+
if (textColor) {
|
|
64
|
+
parts.push(`color: ${textColor}`);
|
|
65
|
+
}
|
|
66
|
+
if (borderColor) {
|
|
67
|
+
parts.push(`border-color: ${borderColor}`);
|
|
68
|
+
}
|
|
69
|
+
this.setData({ _style: parts.join('; ') });
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
methods: {
|
|
74
|
+
handleTap() {
|
|
75
|
+
if (this.data.disabled) return;
|
|
76
|
+
if (this.data.checkable) {
|
|
77
|
+
this.triggerEvent('update:checked', { checked: !this.data.checked });
|
|
78
|
+
}
|
|
79
|
+
this.triggerEvent('tap');
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
handleClose(e) {
|
|
83
|
+
if (this.data.disabled) return;
|
|
84
|
+
this.triggerEvent('close');
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
@import '../../styles/iconfont.scss';
|
|
2
|
+
|
|
3
|
+
.w-tag {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
height: var(--w-tag-height-md);
|
|
7
|
+
padding: 0 var(--spacing-sm);
|
|
8
|
+
border-radius: var(--w-tag-radius);
|
|
9
|
+
font-size: var(--w-tag-font-size);
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
border: 2rpx solid transparent;
|
|
14
|
+
transition: opacity 0.2s;
|
|
15
|
+
line-height: 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ——— Sizes ——— */
|
|
19
|
+
|
|
20
|
+
.w-tag--size-small {
|
|
21
|
+
height: var(--w-tag-height-sm);
|
|
22
|
+
padding: 0 var(--spacing-xs);
|
|
23
|
+
font-size: 22rpx;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.w-tag--size-medium {
|
|
27
|
+
height: var(--w-tag-height-md);
|
|
28
|
+
padding: 0 var(--spacing-sm);
|
|
29
|
+
font-size: var(--w-tag-font-size);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.w-tag--size-large {
|
|
33
|
+
height: var(--w-tag-height-lg);
|
|
34
|
+
padding: 0 var(--spacing-md);
|
|
35
|
+
font-size: var(--font-size-md);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Round */
|
|
39
|
+
.w-tag--round {
|
|
40
|
+
border-radius: 9999rpx;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Strong */
|
|
44
|
+
.w-tag--strong {
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* ——— Type colors (filled style) ——— */
|
|
49
|
+
|
|
50
|
+
.w-tag--default {
|
|
51
|
+
background: var(--color-bg-base);
|
|
52
|
+
color: var(--color-text-primary);
|
|
53
|
+
border-color: var(--color-separator);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.w-tag--primary {
|
|
57
|
+
background: rgba(7, 193, 96, 0.1);
|
|
58
|
+
color: var(--color-brand);
|
|
59
|
+
border-color: rgba(7, 193, 96, 0.3);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.w-tag--success {
|
|
63
|
+
background: rgba(116, 182, 0, 0.1);
|
|
64
|
+
color: var(--color-success);
|
|
65
|
+
border-color: rgba(116, 182, 0, 0.3);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.w-tag--info {
|
|
69
|
+
background: rgba(16, 174, 255, 0.1);
|
|
70
|
+
color: var(--color-info);
|
|
71
|
+
border-color: rgba(16, 174, 255, 0.3);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.w-tag--warning {
|
|
75
|
+
background: rgba(250, 157, 59, 0.1);
|
|
76
|
+
color: var(--color-warning);
|
|
77
|
+
border-color: rgba(250, 157, 59, 0.3);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.w-tag--error {
|
|
81
|
+
background: rgba(250, 81, 81, 0.1);
|
|
82
|
+
color: var(--color-danger);
|
|
83
|
+
border-color: rgba(250, 81, 81, 0.3);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Borderless */
|
|
87
|
+
.w-tag--borderless {
|
|
88
|
+
border-color: transparent;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* ——— States ——— */
|
|
92
|
+
|
|
93
|
+
.w-tag--disabled {
|
|
94
|
+
opacity: 0.4;
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.w-tag--active {
|
|
99
|
+
opacity: 0.7;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ——— Checkable ——— */
|
|
103
|
+
|
|
104
|
+
.w-tag--checked {
|
|
105
|
+
background: var(--color-brand);
|
|
106
|
+
color: #ffffff;
|
|
107
|
+
border-color: var(--color-brand);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.w-tag--unchecked {
|
|
111
|
+
background: transparent;
|
|
112
|
+
color: var(--color-text-secondary);
|
|
113
|
+
border-color: var(--color-separator);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.w-tag--unchecked.w-tag--borderless {
|
|
117
|
+
border-color: transparent;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* ——— Close button ——— */
|
|
121
|
+
|
|
122
|
+
.w-tag__close {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
margin-left: var(--spacing-xs);
|
|
127
|
+
width: 28rpx;
|
|
128
|
+
height: 28rpx;
|
|
129
|
+
border-radius: 50%;
|
|
130
|
+
transition: background 0.2s;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.w-tag__close-icon {
|
|
134
|
+
font-size: 20rpx;
|
|
135
|
+
line-height: 1;
|
|
136
|
+
color: currentColor;
|
|
137
|
+
opacity: 0.6;
|
|
138
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<view
|
|
2
|
+
class="w-tag {{checkable ? '' : 'w-tag--' + type}} w-tag--size-{{size}} {{round ? 'w-tag--round' : ''}} {{bordered ? '' : 'w-tag--borderless'}} {{strong ? 'w-tag--strong' : ''}} {{disabled ? 'w-tag--disabled' : ''}} {{checkable ? 'w-tag--checkable' : ''}} {{checkable && checked ? 'w-tag--checked' : ''}} {{checkable && !checked ? 'w-tag--unchecked' : ''}}"
|
|
3
|
+
style="{{_style}}"
|
|
4
|
+
hover-class="{{disabled ? '' : 'w-tag--active'}}"
|
|
5
|
+
hover-stay-time="70"
|
|
6
|
+
bindtap="handleTap"
|
|
7
|
+
>
|
|
8
|
+
<slot></slot>
|
|
9
|
+
<view wx:if="{{closable && !disabled}}" class="w-tag__close" catchtap="handleClose">
|
|
10
|
+
<text class="w-tag__close-icon iconfont icon-close"></text>
|
|
11
|
+
</view>
|
|
12
|
+
</view>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const formField = require('../../behaviors/formField');
|
|
2
|
+
|
|
3
|
+
Component({
|
|
4
|
+
behaviors: ['wx://form-field', formField],
|
|
5
|
+
|
|
6
|
+
relations: {
|
|
7
|
+
'../form-item/form-item': {
|
|
8
|
+
type: 'ancestor',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
properties: {
|
|
13
|
+
value: { type: String, value: '' },
|
|
14
|
+
placeholder: { type: String, value: '' },
|
|
15
|
+
disabled: { type: Boolean, value: false },
|
|
16
|
+
maxlength: { type: Number, value: 140 },
|
|
17
|
+
showWordLimit: { type: Boolean, value: false },
|
|
18
|
+
autoHeight: { type: Boolean, value: false },
|
|
19
|
+
rows: { type: Number, value: 3 },
|
|
20
|
+
size: { type: String, value: '' },
|
|
21
|
+
status: { type: String, value: '' },
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
data: {
|
|
25
|
+
_focused: false,
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
methods: {
|
|
29
|
+
handleInput(e) {
|
|
30
|
+
const val = e.detail.value;
|
|
31
|
+
this.triggerEvent('update:value', { value: val });
|
|
32
|
+
this._notifyChange();
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
handleFocus(e) {
|
|
36
|
+
this.setData({ _focused: true });
|
|
37
|
+
this.triggerEvent('focus', e.detail);
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
handleBlur(e) {
|
|
41
|
+
this.setData({ _focused: false });
|
|
42
|
+
this.triggerEvent('blur', e.detail);
|
|
43
|
+
this._notifyBlur();
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.w-textarea {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
padding: var(--spacing-sm) var(--spacing-md);
|
|
5
|
+
background: var(--color-input-bg);
|
|
6
|
+
border: 2rpx solid var(--color-input-border);
|
|
7
|
+
border-radius: var(--radius-md);
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
transition: border-color 0.2s;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.w-textarea--size-small {
|
|
13
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
14
|
+
font-size: var(--font-size-sm);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.w-textarea--focus {
|
|
18
|
+
border-color: var(--color-input-border-focus);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.w-textarea--disabled {
|
|
22
|
+
background: var(--color-input-bg-disabled);
|
|
23
|
+
opacity: 0.6;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.w-textarea--error {
|
|
27
|
+
border-color: var(--color-input-border-error);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.w-textarea--warning {
|
|
31
|
+
border-color: var(--color-input-border-warning);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.w-textarea__native {
|
|
35
|
+
width: 100%;
|
|
36
|
+
font-size: inherit;
|
|
37
|
+
color: var(--color-text-primary);
|
|
38
|
+
background: transparent;
|
|
39
|
+
line-height: 1.5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.w-textarea__placeholder {
|
|
43
|
+
color: var(--color-text-placeholder);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.w-textarea__count {
|
|
47
|
+
font-size: var(--font-size-sm);
|
|
48
|
+
color: var(--color-text-secondary);
|
|
49
|
+
text-align: right;
|
|
50
|
+
margin-top: var(--spacing-xs);
|
|
51
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<view
|
|
2
|
+
class="w-textarea w-textarea--size-{{size || _formItemSize || 'medium'}} {{(disabled || _formItemDisabled) ? 'w-textarea--disabled' : ''}} {{_focused ? 'w-textarea--focus' : ''}} {{status === 'error' ? 'w-textarea--error' : ''}} {{status === 'warning' ? 'w-textarea--warning' : ''}}"
|
|
3
|
+
>
|
|
4
|
+
<textarea
|
|
5
|
+
class="w-textarea__native"
|
|
6
|
+
value="{{value}}"
|
|
7
|
+
placeholder="{{placeholder}}"
|
|
8
|
+
placeholder-class="w-textarea__placeholder"
|
|
9
|
+
disabled="{{disabled || _formItemDisabled}}"
|
|
10
|
+
maxlength="{{maxlength}}"
|
|
11
|
+
auto-height="{{autoHeight}}"
|
|
12
|
+
style="min-height: {{rows * 40}}rpx;"
|
|
13
|
+
bindinput="handleInput"
|
|
14
|
+
bindfocus="handleFocus"
|
|
15
|
+
bindblur="handleBlur"
|
|
16
|
+
/>
|
|
17
|
+
<view wx:if="{{showWordLimit && maxlength > 0}}" class="w-textarea__count">
|
|
18
|
+
{{value.length}}/{{maxlength}}
|
|
19
|
+
</view>
|
|
20
|
+
</view>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export const light = {
|
|
2
|
+
// Brand & Semantic Colors
|
|
3
|
+
'--color-brand': '#07c160',
|
|
4
|
+
'--color-danger': '#fa5151',
|
|
5
|
+
'--color-info': '#10aeff',
|
|
6
|
+
'--color-warning': '#fa9d3b',
|
|
7
|
+
'--color-success': '#74b600',
|
|
8
|
+
|
|
9
|
+
// Background
|
|
10
|
+
'--color-bg-page': '#ededed',
|
|
11
|
+
'--color-bg-base': '#f7f7f7',
|
|
12
|
+
'--color-bg-elevated': '#ffffff',
|
|
13
|
+
|
|
14
|
+
// Text
|
|
15
|
+
'--color-text-primary': 'rgba(0, 0, 0, 0.9)',
|
|
16
|
+
'--color-text-secondary': 'rgba(0, 0, 0, 0.5)',
|
|
17
|
+
'--color-text-placeholder': 'rgba(0, 0, 0, 0.3)',
|
|
18
|
+
'--color-text-disabled': 'rgba(0, 0, 0, 0.1)',
|
|
19
|
+
|
|
20
|
+
// Separator & Overlay
|
|
21
|
+
'--color-separator': 'rgba(0, 0, 0, 0.1)',
|
|
22
|
+
'--color-press-overlay': 'rgba(0, 0, 0, 0.1)',
|
|
23
|
+
'--color-press-overlay-light': 'rgba(0, 0, 0, 0.06)',
|
|
24
|
+
|
|
25
|
+
// Shadows
|
|
26
|
+
'--shadow-float': '0 4rpx 20rpx rgba(0, 0, 0, 0.15)',
|
|
27
|
+
'--shadow-card-hover': '0 8rpx 32rpx rgba(0, 0, 0, 0.12)',
|
|
28
|
+
|
|
29
|
+
// Component-Level
|
|
30
|
+
'--w-input-bg': '#ffffff',
|
|
31
|
+
'--w-input-border': 'rgba(0, 0, 0, 0.1)',
|
|
32
|
+
'--w-input-border-focus': '#07c160',
|
|
33
|
+
'--w-switch-bg': 'rgba(0, 0, 0, 0.12)',
|
|
34
|
+
'--w-switch-checked-bg': '#07c160',
|
|
35
|
+
'--w-card-bg': '#ffffff',
|
|
36
|
+
'--w-card-border-color': 'rgba(0, 0, 0, 0.1)',
|
|
37
|
+
'--w-drawer-bg': '#ffffff',
|
|
38
|
+
'--w-drawer-mask-bg': 'rgba(0, 0, 0, 0.45)',
|
|
39
|
+
'--w-list-bg': '#ffffff',
|
|
40
|
+
'--w-list-border': 'rgba(0, 0, 0, 0.1)',
|
|
41
|
+
'--w-list-hover-bg': '#f7f7f7',
|
|
42
|
+
'--w-divider-color': 'rgba(0, 0, 0, 0.1)',
|
|
43
|
+
'--w-avatar-bg': 'rgba(0, 0, 0, 0.08)',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const dark = {
|
|
47
|
+
// Brand & Semantic Colors
|
|
48
|
+
'--color-brand': '#74a800',
|
|
49
|
+
'--color-danger': '#cf4444',
|
|
50
|
+
'--color-info': '#0d8ccc',
|
|
51
|
+
'--color-warning': '#cc7d2e',
|
|
52
|
+
'--color-success': '#5e9200',
|
|
53
|
+
|
|
54
|
+
// Background
|
|
55
|
+
'--color-bg-page': '#111111',
|
|
56
|
+
'--color-bg-base': '#1a1a1a',
|
|
57
|
+
'--color-bg-elevated': '#2c2c2c',
|
|
58
|
+
|
|
59
|
+
// Text
|
|
60
|
+
'--color-text-primary': 'rgba(255, 255, 255, 0.9)',
|
|
61
|
+
'--color-text-secondary': 'rgba(255, 255, 255, 0.5)',
|
|
62
|
+
'--color-text-placeholder': 'rgba(255, 255, 255, 0.3)',
|
|
63
|
+
'--color-text-disabled': 'rgba(255, 255, 255, 0.1)',
|
|
64
|
+
|
|
65
|
+
// Separator & Overlay
|
|
66
|
+
'--color-separator': 'rgba(255, 255, 255, 0.1)',
|
|
67
|
+
'--color-press-overlay': 'rgba(255, 255, 255, 0.1)',
|
|
68
|
+
'--color-press-overlay-light': 'rgba(255, 255, 255, 0.06)',
|
|
69
|
+
|
|
70
|
+
// Shadows
|
|
71
|
+
'--shadow-float': '0 4rpx 20rpx rgba(0, 0, 0, 0.4)',
|
|
72
|
+
'--shadow-card-hover': '0 8rpx 32rpx rgba(0, 0, 0, 0.35)',
|
|
73
|
+
|
|
74
|
+
// Component-Level
|
|
75
|
+
'--w-input-bg': '#2c2c2c',
|
|
76
|
+
'--w-input-border': 'rgba(255, 255, 255, 0.15)',
|
|
77
|
+
'--w-input-border-focus': '#74a800',
|
|
78
|
+
'--w-switch-bg': 'rgba(255, 255, 255, 0.16)',
|
|
79
|
+
'--w-switch-checked-bg': '#74a800',
|
|
80
|
+
'--w-card-bg': '#2c2c2c',
|
|
81
|
+
'--w-card-border-color': 'rgba(255, 255, 255, 0.1)',
|
|
82
|
+
'--w-drawer-bg': '#2c2c2c',
|
|
83
|
+
'--w-drawer-mask-bg': 'rgba(0, 0, 0, 0.6)',
|
|
84
|
+
'--w-list-bg': '#2c2c2c',
|
|
85
|
+
'--w-list-border': 'rgba(255, 255, 255, 0.1)',
|
|
86
|
+
'--w-list-hover-bg': 'rgba(255, 255, 255, 0.06)',
|
|
87
|
+
'--w-divider-color': 'rgba(255, 255, 255, 0.1)',
|
|
88
|
+
'--w-avatar-bg': 'rgba(255, 255, 255, 0.12)',
|
|
89
|
+
|
|
90
|
+
// Component-specific dark overrides
|
|
91
|
+
'--color-avatar-bg': 'rgba(255, 255, 255, 0.12)',
|
|
92
|
+
'--color-switch-bg': 'rgba(255, 255, 255, 0.16)',
|
|
93
|
+
'--color-checkbox-check': '#ffffff',
|
|
94
|
+
'--color-rate-inactive': 'rgba(255, 255, 255, 0.16)',
|
|
95
|
+
'--color-upload-bg': 'rgba(255, 255, 255, 0.08)',
|
|
96
|
+
'--color-upload-mask': 'rgba(0, 0, 0, 0.7)',
|
|
97
|
+
'--color-upload-progress-track': 'rgba(255, 255, 255, 0.1)',
|
|
98
|
+
'--color-date-range-bg': 'rgba(116, 168, 0, 0.15)',
|
|
99
|
+
'--navbar-bg': '#000000',
|
|
100
|
+
'--tab-bar-active-bg': 'rgba(255, 255, 255, 0.15)',
|
|
101
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Component({
|
|
2
|
+
properties: {
|
|
3
|
+
theme: {
|
|
4
|
+
type: Object,
|
|
5
|
+
value: {},
|
|
6
|
+
},
|
|
7
|
+
themeOverrides: {
|
|
8
|
+
type: Object,
|
|
9
|
+
value: {},
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
observers: {
|
|
14
|
+
'theme, themeOverrides': function (theme, themeOverrides) {
|
|
15
|
+
const merged = Object.assign({}, theme || {}, themeOverrides || {});
|
|
16
|
+
const keys = Object.keys(merged);
|
|
17
|
+
if (!keys.length) {
|
|
18
|
+
this.setData({ themeStyle: '' });
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const themeStyle = keys
|
|
22
|
+
.map((k) => {
|
|
23
|
+
const key = k.startsWith('--') ? k : `--${k}`;
|
|
24
|
+
return `${key}: ${merged[k]}`;
|
|
25
|
+
})
|
|
26
|
+
.join('; ');
|
|
27
|
+
this.setData({ themeStyle });
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
data: {
|
|
32
|
+
themeStyle: '',
|
|
33
|
+
},
|
|
34
|
+
});
|