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,250 @@
|
|
|
1
|
+
@import '../../styles/iconfont.scss';
|
|
2
|
+
|
|
3
|
+
/* Trigger */
|
|
4
|
+
.w-tree-select__trigger {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
min-height: var(--size-input-height);
|
|
8
|
+
padding: 0 var(--spacing-md);
|
|
9
|
+
background: var(--color-input-bg);
|
|
10
|
+
border: 2rpx solid var(--color-input-border);
|
|
11
|
+
border-radius: var(--radius-md);
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
transition: border-color 0.2s;
|
|
14
|
+
gap: var(--spacing-xs);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.w-tree-select--has-tags {
|
|
18
|
+
flex-wrap: wrap;
|
|
19
|
+
padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) var(--spacing-xs);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.w-tree-select--size-medium.w-tree-select__trigger {
|
|
23
|
+
min-height: var(--size-input-height-md);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.w-tree-select--size-small.w-tree-select__trigger {
|
|
27
|
+
min-height: var(--size-input-height-sm);
|
|
28
|
+
padding: 0 var(--spacing-sm);
|
|
29
|
+
font-size: var(--font-size-sm);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.w-tree-select--disabled {
|
|
33
|
+
background: var(--color-input-bg-disabled);
|
|
34
|
+
opacity: 0.6;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.w-tree-select--error {
|
|
38
|
+
border-color: var(--color-input-border-error);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.w-tree-select--warning {
|
|
42
|
+
border-color: var(--color-input-border-warning);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.w-tree-select__text {
|
|
46
|
+
flex: 1;
|
|
47
|
+
min-width: 0;
|
|
48
|
+
color: var(--color-text-primary);
|
|
49
|
+
font-size: inherit;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.w-tree-select__placeholder {
|
|
56
|
+
flex: 1;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
color: var(--color-text-placeholder);
|
|
59
|
+
font-size: inherit;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.w-tree-select__icon {
|
|
63
|
+
flex-shrink: 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.w-tree-select__arrow-icon {
|
|
69
|
+
font-size: 28rpx;
|
|
70
|
+
color: var(--color-text-secondary);
|
|
71
|
+
line-height: 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.w-tree-select__clear {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 36rpx;
|
|
79
|
+
height: 36rpx;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.w-tree-select__clear-icon {
|
|
84
|
+
width: 28rpx;
|
|
85
|
+
height: 28rpx;
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
background: var(--color-text-placeholder);
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
font-size: 16rpx;
|
|
92
|
+
color: var(--color-bg-elevated);
|
|
93
|
+
line-height: 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Tags */
|
|
97
|
+
.w-tree-select__tags {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-wrap: wrap;
|
|
100
|
+
flex: 1;
|
|
101
|
+
min-width: 0;
|
|
102
|
+
gap: var(--spacing-xs);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.w-tree-select__tag {
|
|
106
|
+
display: inline-flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
height: var(--size-tag-height-sm);
|
|
109
|
+
padding: 0 var(--spacing-sm);
|
|
110
|
+
background: var(--color-bg-base);
|
|
111
|
+
border-radius: var(--radius-sm);
|
|
112
|
+
font-size: 22rpx;
|
|
113
|
+
color: var(--color-text-primary);
|
|
114
|
+
gap: 4rpx;
|
|
115
|
+
max-width: 240rpx;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.w-tree-select__tag--overflow {
|
|
119
|
+
background: var(--color-bg-base);
|
|
120
|
+
color: var(--color-text-secondary);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.w-tree-select__tag-text {
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
text-overflow: ellipsis;
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.w-tree-select__tag-close {
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
flex-shrink: 0;
|
|
134
|
+
width: 24rpx;
|
|
135
|
+
height: 24rpx;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.w-tree-select__tag-close-icon {
|
|
139
|
+
width: 20rpx;
|
|
140
|
+
height: 20rpx;
|
|
141
|
+
border-radius: 50%;
|
|
142
|
+
background: var(--color-text-placeholder);
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
font-size: 12rpx;
|
|
147
|
+
color: var(--color-bg-elevated);
|
|
148
|
+
line-height: 1;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Panel */
|
|
152
|
+
.w-tree-select__panel {
|
|
153
|
+
background: var(--color-bg-elevated);
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
height: 100%;
|
|
157
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.w-tree-select__panel--full {
|
|
161
|
+
height: 100vh;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.w-tree-select__header {
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
justify-content: space-between;
|
|
168
|
+
padding: var(--spacing-md) var(--spacing-lg);
|
|
169
|
+
border-bottom: 1rpx solid var(--color-separator);
|
|
170
|
+
flex-shrink: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.w-tree-select__btn {
|
|
174
|
+
font-size: var(--font-size-md);
|
|
175
|
+
color: var(--color-text-secondary);
|
|
176
|
+
min-width: 80rpx;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.w-tree-select__btn--primary {
|
|
180
|
+
color: var(--color-brand);
|
|
181
|
+
font-weight: 500;
|
|
182
|
+
text-align: right;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.w-tree-select__title {
|
|
186
|
+
font-size: var(--font-size-lg);
|
|
187
|
+
font-weight: 500;
|
|
188
|
+
color: var(--color-text-primary);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Search */
|
|
192
|
+
.w-tree-select__search {
|
|
193
|
+
padding: var(--spacing-sm) var(--spacing-lg);
|
|
194
|
+
flex-shrink: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.w-tree-select__search-input {
|
|
198
|
+
width: 100%;
|
|
199
|
+
height: 64rpx;
|
|
200
|
+
padding: 0 var(--spacing-md);
|
|
201
|
+
background: var(--color-bg-base);
|
|
202
|
+
border-radius: var(--radius-md);
|
|
203
|
+
font-size: var(--font-size-md);
|
|
204
|
+
box-sizing: border-box;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Selected tags in full mode */
|
|
208
|
+
.w-tree-select__selected {
|
|
209
|
+
display: flex;
|
|
210
|
+
flex-wrap: wrap;
|
|
211
|
+
gap: var(--spacing-xs);
|
|
212
|
+
padding: var(--spacing-sm) var(--spacing-lg);
|
|
213
|
+
border-bottom: 1rpx solid var(--color-separator);
|
|
214
|
+
flex-shrink: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.w-tree-select__selected-tag {
|
|
218
|
+
display: inline-flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
height: var(--size-tag-height-sm);
|
|
221
|
+
padding: 0 var(--spacing-sm);
|
|
222
|
+
background: rgba(7, 193, 96, 0.1);
|
|
223
|
+
border-radius: var(--radius-sm);
|
|
224
|
+
font-size: 22rpx;
|
|
225
|
+
color: var(--color-brand);
|
|
226
|
+
gap: 4rpx;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.w-tree-select__selected-tag-text {
|
|
230
|
+
overflow: hidden;
|
|
231
|
+
text-overflow: ellipsis;
|
|
232
|
+
white-space: nowrap;
|
|
233
|
+
max-width: 200rpx;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.w-tree-select__selected-tag-close {
|
|
237
|
+
display: flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: center;
|
|
240
|
+
width: 24rpx;
|
|
241
|
+
height: 24rpx;
|
|
242
|
+
font-size: 16rpx;
|
|
243
|
+
color: var(--color-brand);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* Body (scroll area) */
|
|
247
|
+
.w-tree-select__body {
|
|
248
|
+
flex: 1;
|
|
249
|
+
min-height: 0;
|
|
250
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<view class="w-tree-select">
|
|
2
|
+
<!-- Trigger -->
|
|
3
|
+
<view
|
|
4
|
+
class="w-tree-select__trigger w-tree-select--size-{{size || _formItemSize || 'medium'}} {{(disabled || _formItemDisabled) ? 'w-tree-select--disabled' : ''}} {{readonly ? 'w-tree-select--readonly' : ''}} {{status === 'error' ? 'w-tree-select--error' : ''}} {{status === 'warning' ? 'w-tree-select--warning' : ''}} {{(multiple || checkable) && _selectedTags.length ? 'w-tree-select--has-tags' : ''}}"
|
|
5
|
+
bindtap="handleTap"
|
|
6
|
+
>
|
|
7
|
+
<!-- Multi: tags -->
|
|
8
|
+
<view wx:if="{{(multiple || checkable) && _selectedTags.length}}" class="w-tree-select__tags">
|
|
9
|
+
<view wx:for="{{_selectedTags}}" wx:key="value" class="w-tree-select__tag">
|
|
10
|
+
<text class="w-tree-select__tag-text">{{item.label}}</text>
|
|
11
|
+
<view
|
|
12
|
+
wx:if="{{!disabled && !_formItemDisabled && !readonly}}"
|
|
13
|
+
class="w-tree-select__tag-close"
|
|
14
|
+
catchtap="handleTagRemove"
|
|
15
|
+
data-value="{{item.value}}"
|
|
16
|
+
>
|
|
17
|
+
<text class="w-tree-select__tag-close-icon iconfont icon-close"></text>
|
|
18
|
+
</view>
|
|
19
|
+
</view>
|
|
20
|
+
<view wx:if="{{_overflowCount > 0}}" class="w-tree-select__tag w-tree-select__tag--overflow">
|
|
21
|
+
<text class="w-tree-select__tag-text">+{{_overflowCount}}</text>
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
<!-- Multi: placeholder -->
|
|
25
|
+
<text wx:elif="{{multiple || checkable}}" class="w-tree-select__placeholder"
|
|
26
|
+
>{{placeholder}}</text
|
|
27
|
+
>
|
|
28
|
+
<!-- Single: display text -->
|
|
29
|
+
<text wx:elif="{{_displayText}}" class="w-tree-select__text">{{_displayText}}</text>
|
|
30
|
+
<text wx:else class="w-tree-select__placeholder">{{placeholder}}</text>
|
|
31
|
+
|
|
32
|
+
<!-- Clear / Arrow -->
|
|
33
|
+
<view
|
|
34
|
+
wx:if="{{clearable && (_displayText || _selectedTags.length) && !disabled && !_formItemDisabled && !readonly}}"
|
|
35
|
+
class="w-tree-select__clear"
|
|
36
|
+
catchtap="handleTriggerClear"
|
|
37
|
+
>
|
|
38
|
+
<text class="w-tree-select__clear-icon iconfont icon-close"></text>
|
|
39
|
+
</view>
|
|
40
|
+
<view wx:else class="w-tree-select__icon">
|
|
41
|
+
<text class="w-tree-select__arrow-icon iconfont icon-down"></text>
|
|
42
|
+
</view>
|
|
43
|
+
</view>
|
|
44
|
+
|
|
45
|
+
<!-- Popup -->
|
|
46
|
+
<w-drawer
|
|
47
|
+
show="{{_visible}}"
|
|
48
|
+
placement="bottom"
|
|
49
|
+
round="{{mode !== 'full'}}"
|
|
50
|
+
height="{{mode === 'full' ? '100%' : '60vh'}}"
|
|
51
|
+
bind:update:show="handleDrawerClose"
|
|
52
|
+
bind:afterenter="handleDrawerAfterEnter"
|
|
53
|
+
>
|
|
54
|
+
<view class="w-tree-select__panel {{mode === 'full' ? 'w-tree-select__panel--full' : ''}}">
|
|
55
|
+
<!-- Header -->
|
|
56
|
+
<view class="w-tree-select__header">
|
|
57
|
+
<view class="w-tree-select__btn" bindtap="handleCancel">
|
|
58
|
+
{{mode === 'full' ? '关闭' : '取消'}}
|
|
59
|
+
</view>
|
|
60
|
+
<view class="w-tree-select__title">{{title || '请选择'}}</view>
|
|
61
|
+
<view class="w-tree-select__btn w-tree-select__btn--primary" bindtap="handleConfirm">
|
|
62
|
+
确定
|
|
63
|
+
</view>
|
|
64
|
+
</view>
|
|
65
|
+
|
|
66
|
+
<!-- Search -->
|
|
67
|
+
<view wx:if="{{filterable}}" class="w-tree-select__search">
|
|
68
|
+
<input
|
|
69
|
+
class="w-tree-select__search-input"
|
|
70
|
+
placeholder="搜索"
|
|
71
|
+
value="{{_searchPattern}}"
|
|
72
|
+
bindinput="handleSearchInput"
|
|
73
|
+
confirm-type="search"
|
|
74
|
+
/>
|
|
75
|
+
</view>
|
|
76
|
+
|
|
77
|
+
<!-- Selected tags in full mode -->
|
|
78
|
+
<view
|
|
79
|
+
wx:if="{{mode === 'full' && (multiple || checkable) && _selectedTags.length}}"
|
|
80
|
+
class="w-tree-select__selected"
|
|
81
|
+
>
|
|
82
|
+
<view wx:for="{{_selectedTags}}" wx:key="value" class="w-tree-select__selected-tag">
|
|
83
|
+
<text class="w-tree-select__selected-tag-text">{{item.label}}</text>
|
|
84
|
+
<view
|
|
85
|
+
class="w-tree-select__selected-tag-close"
|
|
86
|
+
catchtap="handleTagRemove"
|
|
87
|
+
data-value="{{item.value}}"
|
|
88
|
+
>
|
|
89
|
+
<text class="iconfont icon-close"></text>
|
|
90
|
+
</view>
|
|
91
|
+
</view>
|
|
92
|
+
</view>
|
|
93
|
+
|
|
94
|
+
<!-- Tree -->
|
|
95
|
+
<scroll-view class="w-tree-select__body" scroll-y>
|
|
96
|
+
<w-tree
|
|
97
|
+
class="w-tree-select__tree"
|
|
98
|
+
data="{{data}}"
|
|
99
|
+
checkable="{{checkable}}"
|
|
100
|
+
selectable="{{!checkable}}"
|
|
101
|
+
multiple="{{multiple}}"
|
|
102
|
+
cascade="{{cascade}}"
|
|
103
|
+
check-strategy="{{checkStrategy}}"
|
|
104
|
+
pattern="{{_searchPattern}}"
|
|
105
|
+
accordion="{{accordion}}"
|
|
106
|
+
show-line="{{showLine}}"
|
|
107
|
+
key-field="{{keyField}}"
|
|
108
|
+
label-field="{{labelField}}"
|
|
109
|
+
children-field="{{childrenField}}"
|
|
110
|
+
default-expand-all="{{defaultExpandAll}}"
|
|
111
|
+
check-on-click="{{checkable}}"
|
|
112
|
+
bind:update:selected-keys="handleTreeSelect"
|
|
113
|
+
bind:update:checked-keys="handleTreeCheck"
|
|
114
|
+
/>
|
|
115
|
+
</scroll-view>
|
|
116
|
+
</view>
|
|
117
|
+
</w-drawer>
|
|
118
|
+
</view>
|