zartui 0.1.82 → 0.1.85
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/es/dropdown-item/index.css +1 -1
- package/es/dropdown-item/index.js +133 -35
- package/es/dropdown-item/index.less +27 -1
- package/es/dropdown-item/style/index.js +1 -0
- package/es/dropdown-item/style/less.js +1 -0
- package/es/dropdown-menu/index.js +2 -1
- package/es/index.js +1 -1
- package/es/media-picker/index.js +11 -6
- package/lib/dropdown-item/index.css +1 -1
- package/lib/dropdown-item/index.js +134 -35
- package/lib/dropdown-item/index.less +27 -1
- package/lib/dropdown-item/style/index.js +1 -0
- package/lib/dropdown-item/style/less.js +1 -0
- package/lib/dropdown-menu/index.js +2 -1
- package/lib/index.css +1 -1
- package/lib/index.js +1 -1
- package/lib/media-picker/index.js +11 -6
- package/lib/zart.js +147 -43
- package/lib/zart.min.js +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
.zt-dropdown-item{position:fixed;right:0;left:0;z-index:10;overflow:hidden}.zt-dropdown-item__icon{display:block;line-height:inherit;font-size:24px}.zt-dropdown-item .zt-cell::after{border:none}.zt-dropdown-item__option{text-align:left;font-size:14px;padding-left:0}.zt-dropdown-item__option--active{color:#0091fa}.zt-dropdown-item__option--active .zt-dropdown-item__icon{color:#0091fa}.zt-dropdown-item--up{top:0}.zt-dropdown-item--down{bottom:0}.zt-dropdown-item__content{position:absolute;max-height:80%;padding-left:16px;box-sizing:border-box}
|
|
1
|
+
.zt-dropdown-item{position:fixed;right:0;left:0;z-index:10;overflow:hidden}.zt-dropdown-item__icon{display:block;line-height:inherit;font-size:24px}.zt-dropdown-item .zt-cell::after{border:none}.zt-dropdown-item__option{text-align:left;font-size:14px;padding-left:0}.zt-dropdown-item__option--active{color:#0091fa}.zt-dropdown-item__option--active .zt-dropdown-item__icon{color:#0091fa}.zt-dropdown-item--up{top:0}.zt-dropdown-item--down{bottom:0}.zt-dropdown-item__content,.zt-dropdown-item__content.zt-popup{position:absolute;max-height:80%;padding-left:16px;box-sizing:border-box}.button{width:100%;height:44px;display:-webkit-box;display:-webkit-flex;display:flex;border-top:1px solid rgba(0,0,0,.05)}.button-reset{width:50%;font-family:PingFangSC-Regular;font-weight:400;font-size:16px;color:#ff9623;text-align:center;padding-top:11px}.button-confirm{width:50%;background-color:#0091fa;font-family:PingFangSC-Semibold;font-weight:600;font-size:16px;color:#f5f5fa;text-align:center;padding-top:11px}
|
|
@@ -8,6 +8,7 @@ import { ChildrenMixin } from '../mixins/relation'; // Components
|
|
|
8
8
|
import Cell from '../cell';
|
|
9
9
|
import Icon from '../icon';
|
|
10
10
|
import Popup from '../popup';
|
|
11
|
+
import Checkbox from '../checkbox';
|
|
11
12
|
|
|
12
13
|
var _createNamespace = createNamespace('dropdown-item'),
|
|
13
14
|
createComponent = _createNamespace[0],
|
|
@@ -31,6 +32,14 @@ export default createComponent({
|
|
|
31
32
|
lazyRender: {
|
|
32
33
|
type: Boolean,
|
|
33
34
|
default: true
|
|
35
|
+
},
|
|
36
|
+
multiSelect: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
placeholder: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '未选择'
|
|
34
43
|
}
|
|
35
44
|
},
|
|
36
45
|
data: function data() {
|
|
@@ -48,10 +57,25 @@ export default createComponent({
|
|
|
48
57
|
return this.title;
|
|
49
58
|
}
|
|
50
59
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
if (this.multiSelect) {
|
|
61
|
+
if (this.value.length) {
|
|
62
|
+
var value = '';
|
|
63
|
+
this.options.forEach(function (item) {
|
|
64
|
+
if (_this.value.indexOf(item.value) >= 0) {
|
|
65
|
+
value += item.text + '、';
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
value = value.substr(0, value.length - 1);
|
|
69
|
+
return value;
|
|
70
|
+
} else {
|
|
71
|
+
return this.placeholder;
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
var match = this.options.filter(function (option) {
|
|
75
|
+
return option.value === _this.value;
|
|
76
|
+
});
|
|
77
|
+
return match.length ? match[0].text : '';
|
|
78
|
+
}
|
|
55
79
|
}
|
|
56
80
|
},
|
|
57
81
|
watch: {
|
|
@@ -108,6 +132,30 @@ export default createComponent({
|
|
|
108
132
|
if (this.getContainer) {
|
|
109
133
|
event.stopPropagation();
|
|
110
134
|
}
|
|
135
|
+
},
|
|
136
|
+
select: function select(value) {
|
|
137
|
+
if (this.value.indexOf(value) >= 0) {
|
|
138
|
+
this.value.splice(this.value.indexOf(value), 1);
|
|
139
|
+
} else {
|
|
140
|
+
this.value.push(value);
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
isSelect: function isSelect(value) {
|
|
144
|
+
if (this.value.indexOf(value) >= 0) {
|
|
145
|
+
return true;
|
|
146
|
+
} else {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
reset: function reset() {
|
|
151
|
+
this.showPopup = false;
|
|
152
|
+
this.$emit('input', []);
|
|
153
|
+
this.$emit('reset', []);
|
|
154
|
+
},
|
|
155
|
+
confirm: function confirm() {
|
|
156
|
+
this.showPopup = false;
|
|
157
|
+
this.$emit('input', this.value);
|
|
158
|
+
this.$emit('change', this.value);
|
|
111
159
|
}
|
|
112
160
|
},
|
|
113
161
|
render: function render() {
|
|
@@ -122,40 +170,73 @@ export default createComponent({
|
|
|
122
170
|
direction = _this$parent.direction,
|
|
123
171
|
activeColor = _this$parent.activeColor,
|
|
124
172
|
closeOnClickOverlay = _this$parent.closeOnClickOverlay;
|
|
125
|
-
var Options
|
|
126
|
-
var active = option.value === _this3.value;
|
|
127
|
-
return h(Cell, {
|
|
128
|
-
"attrs": {
|
|
129
|
-
"clickable": true,
|
|
130
|
-
"icon": option.icon,
|
|
131
|
-
"title": option.text
|
|
132
|
-
},
|
|
133
|
-
"key": option.value,
|
|
134
|
-
"class": "half-border-bottom " + bem('option', {
|
|
135
|
-
active: active
|
|
136
|
-
}),
|
|
137
|
-
"style": {
|
|
138
|
-
color: active ? activeColor : ''
|
|
139
|
-
},
|
|
140
|
-
"on": {
|
|
141
|
-
"click": function click() {
|
|
142
|
-
_this3.showPopup = false;
|
|
173
|
+
var Options;
|
|
143
174
|
|
|
144
|
-
|
|
145
|
-
|
|
175
|
+
if (this.multiSelect) {
|
|
176
|
+
Options = this.options.map(function (option, index) {
|
|
177
|
+
var active = _this3.value.indexOf(option.value) >= 0;
|
|
178
|
+
return h(Cell, {
|
|
179
|
+
"attrs": {
|
|
180
|
+
"clickable": true,
|
|
181
|
+
"icon": option.icon,
|
|
182
|
+
"title": option.text
|
|
183
|
+
},
|
|
184
|
+
"key": option.value,
|
|
185
|
+
"class": index === _this3.options.length - 1 ? bem('option', {
|
|
186
|
+
active: active
|
|
187
|
+
}) : "half-border-bottom " + bem('option', {
|
|
188
|
+
active: active
|
|
189
|
+
}),
|
|
190
|
+
"style": "padding-left: 16px",
|
|
191
|
+
"on": {
|
|
192
|
+
"click": function click() {
|
|
193
|
+
_this3.select(option.value);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}, [h(Checkbox, {
|
|
197
|
+
"style": "padding:0;position: absolute;right: 0px;",
|
|
198
|
+
"attrs": {
|
|
199
|
+
"value": _this3.isSelect(option.value)
|
|
200
|
+
}
|
|
201
|
+
})]);
|
|
202
|
+
});
|
|
203
|
+
} else {
|
|
204
|
+
Options = this.options.map(function (option) {
|
|
205
|
+
var active = option.value === _this3.value;
|
|
206
|
+
return h(Cell, {
|
|
207
|
+
"attrs": {
|
|
208
|
+
"clickable": true,
|
|
209
|
+
"icon": option.icon,
|
|
210
|
+
"title": option.text
|
|
211
|
+
},
|
|
212
|
+
"key": option.value,
|
|
213
|
+
"class": "half-border-bottom " + bem('option', {
|
|
214
|
+
active: active
|
|
215
|
+
}),
|
|
216
|
+
"style": {
|
|
217
|
+
color: active ? activeColor : ''
|
|
218
|
+
},
|
|
219
|
+
"on": {
|
|
220
|
+
"click": function click() {
|
|
221
|
+
_this3.showPopup = false;
|
|
222
|
+
|
|
223
|
+
if (option.value !== _this3.value) {
|
|
224
|
+
_this3.$emit('input', option.value);
|
|
146
225
|
|
|
147
|
-
|
|
226
|
+
_this3.$emit('change', option.value);
|
|
227
|
+
}
|
|
148
228
|
}
|
|
149
229
|
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
})
|
|
158
|
-
}
|
|
230
|
+
}, [active && h(Icon, {
|
|
231
|
+
"class": bem('icon'),
|
|
232
|
+
"attrs": {
|
|
233
|
+
"color": activeColor,
|
|
234
|
+
"name": "correct-checked"
|
|
235
|
+
}
|
|
236
|
+
})]);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
159
240
|
var style = {
|
|
160
241
|
zIndex: zIndex
|
|
161
242
|
};
|
|
@@ -189,6 +270,7 @@ export default createComponent({
|
|
|
189
270
|
"closeOnClickOverlay": closeOnClickOverlay
|
|
190
271
|
},
|
|
191
272
|
"class": bem('content'),
|
|
273
|
+
"style": this.multiSelect ? "padding-left: 0px" : "",
|
|
192
274
|
"on": {
|
|
193
275
|
"open": this.onOpen,
|
|
194
276
|
"close": this.onClose,
|
|
@@ -205,6 +287,22 @@ export default createComponent({
|
|
|
205
287
|
_this3.showPopup = $$v;
|
|
206
288
|
}
|
|
207
289
|
}
|
|
208
|
-
}, [Options,
|
|
290
|
+
}, [Options, h("div", {
|
|
291
|
+
"class": "button",
|
|
292
|
+
"directives": [{
|
|
293
|
+
name: "show",
|
|
294
|
+
value: this.multiSelect
|
|
295
|
+
}]
|
|
296
|
+
}, [h("div", {
|
|
297
|
+
"class": "button-reset",
|
|
298
|
+
"on": {
|
|
299
|
+
"click": this.reset
|
|
300
|
+
}
|
|
301
|
+
}, ["\u91CD\u7F6E"]), h("div", {
|
|
302
|
+
"class": "button-confirm",
|
|
303
|
+
"on": {
|
|
304
|
+
"click": this.confirm
|
|
305
|
+
}
|
|
306
|
+
}, ["\u786E\u5B9A"])]), this.slots('default')])])]);
|
|
209
307
|
}
|
|
210
308
|
});
|
|
@@ -39,10 +39,36 @@
|
|
|
39
39
|
bottom: 0;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
&__content {
|
|
42
|
+
&__content, &__content.zt-popup {
|
|
43
43
|
position: absolute;
|
|
44
44
|
max-height: @dropdown-menu-content-max-height;
|
|
45
45
|
padding-left: @padding-md;
|
|
46
46
|
box-sizing: border-box;
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
.button{
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 44px;
|
|
53
|
+
display: flex;
|
|
54
|
+
border-top: 1px solid rgba(0,0,0,0.05);
|
|
55
|
+
}
|
|
56
|
+
.button-reset{
|
|
57
|
+
width: 50%;
|
|
58
|
+
font-family: PingFangSC-Regular;
|
|
59
|
+
font-weight: 400;
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
color: #FF9623;
|
|
62
|
+
text-align: center;
|
|
63
|
+
padding-top: 11px;
|
|
48
64
|
}
|
|
65
|
+
.button-confirm{
|
|
66
|
+
width: 50%;
|
|
67
|
+
background-color: #0091FA;
|
|
68
|
+
font-family: PingFangSC-Semibold;
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
color: #F5F5FA;
|
|
72
|
+
text-align: center;
|
|
73
|
+
padding-top: 11px;
|
|
74
|
+
}
|
|
@@ -117,7 +117,8 @@ export default createComponent({
|
|
|
117
117
|
color: item.showPopup ? _this.activeColor : ''
|
|
118
118
|
}
|
|
119
119
|
}, [h("div", {
|
|
120
|
-
"class": "zt-ellipsis"
|
|
120
|
+
"class": "zt-ellipsis",
|
|
121
|
+
"style": "padding-right: 10px"
|
|
121
122
|
}, [item.slots('title') || item.displayTitle, item.slots('icon') || h(Icon, {
|
|
122
123
|
"class": bem('icon'),
|
|
123
124
|
"attrs": {
|
package/es/index.js
CHANGED
|
@@ -74,7 +74,7 @@ import Tabs from './tabs';
|
|
|
74
74
|
import Tag from './tag';
|
|
75
75
|
import Toast from './toast';
|
|
76
76
|
import Uploader from './uploader';
|
|
77
|
-
var version = '0.1.
|
|
77
|
+
var version = '0.1.85';
|
|
78
78
|
|
|
79
79
|
function install(Vue) {
|
|
80
80
|
var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Toast, Uploader];
|
package/es/media-picker/index.js
CHANGED
|
@@ -596,10 +596,14 @@ export default createComponent({
|
|
|
596
596
|
startPosition: imageIndex
|
|
597
597
|
});
|
|
598
598
|
} else if (media.type === MediaType.AUDIO || media.type === MediaType.VIDEO) {
|
|
599
|
-
|
|
600
|
-
|
|
599
|
+
if (!media.file && !media.url) {
|
|
600
|
+
Toast('文件参数缺失');
|
|
601
|
+
} else {
|
|
602
|
+
this.mediaTypeToPlay = media.type;
|
|
603
|
+
this.mediaUrlToPlay = media.url || (URL || webkitURL).createObjectURL(media.file); // this.mediaUrlToPlay = 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
|
|
601
604
|
|
|
602
|
-
|
|
605
|
+
this.mediaPlayerVisible = true;
|
|
606
|
+
}
|
|
603
607
|
} else if (media.type === MediaType.FILE) {
|
|
604
608
|
Toast('暂不支持此类文件的预览');
|
|
605
609
|
}
|
|
@@ -927,8 +931,9 @@ export default createComponent({
|
|
|
927
931
|
}, [_this8.renderMediaThumbnail(media), _this8.genThumbnailMask(media), deleteIcon]);
|
|
928
932
|
});
|
|
929
933
|
},
|
|
930
|
-
|
|
931
|
-
|
|
934
|
+
selectAction: function selectAction(action) {
|
|
935
|
+
this.actionVisible = false;
|
|
936
|
+
action.func && action.func();
|
|
932
937
|
}
|
|
933
938
|
},
|
|
934
939
|
render: function render() {
|
|
@@ -959,7 +964,7 @@ export default createComponent({
|
|
|
959
964
|
"close-on-click-action": true
|
|
960
965
|
},
|
|
961
966
|
"on": {
|
|
962
|
-
"select": this.
|
|
967
|
+
"select": this.selectAction
|
|
963
968
|
},
|
|
964
969
|
"model": {
|
|
965
970
|
value: _this9.actionVisible,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zt-dropdown-item{position:fixed;right:0;left:0;z-index:10;overflow:hidden}.zt-dropdown-item__icon{display:block;line-height:inherit;font-size:24px}.zt-dropdown-item .zt-cell::after{border:none}.zt-dropdown-item__option{text-align:left;font-size:14px;padding-left:0}.zt-dropdown-item__option--active{color:#0091fa}.zt-dropdown-item__option--active .zt-dropdown-item__icon{color:#0091fa}.zt-dropdown-item--up{top:0}.zt-dropdown-item--down{bottom:0}.zt-dropdown-item__content{position:absolute;max-height:80%;padding-left:16px;box-sizing:border-box}
|
|
1
|
+
.zt-dropdown-item{position:fixed;right:0;left:0;z-index:10;overflow:hidden}.zt-dropdown-item__icon{display:block;line-height:inherit;font-size:24px}.zt-dropdown-item .zt-cell::after{border:none}.zt-dropdown-item__option{text-align:left;font-size:14px;padding-left:0}.zt-dropdown-item__option--active{color:#0091fa}.zt-dropdown-item__option--active .zt-dropdown-item__icon{color:#0091fa}.zt-dropdown-item--up{top:0}.zt-dropdown-item--down{bottom:0}.zt-dropdown-item__content,.zt-dropdown-item__content.zt-popup{position:absolute;max-height:80%;padding-left:16px;box-sizing:border-box}.button{width:100%;height:44px;display:-webkit-box;display:-webkit-flex;display:flex;border-top:1px solid rgba(0,0,0,.05)}.button-reset{width:50%;font-family:PingFangSC-Regular;font-weight:400;font-size:16px;color:#ff9623;text-align:center;padding-top:11px}.button-confirm{width:50%;background-color:#0091fa;font-family:PingFangSC-Semibold;font-weight:600;font-size:16px;color:#f5f5fa;text-align:center;padding-top:11px}
|
|
@@ -19,6 +19,8 @@ var _icon = _interopRequireDefault(require("../icon"));
|
|
|
19
19
|
|
|
20
20
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
21
21
|
|
|
22
|
+
var _checkbox = _interopRequireDefault(require("../checkbox"));
|
|
23
|
+
|
|
22
24
|
// Utils
|
|
23
25
|
// Mixins
|
|
24
26
|
// Components
|
|
@@ -44,6 +46,14 @@ var _default2 = createComponent({
|
|
|
44
46
|
lazyRender: {
|
|
45
47
|
type: Boolean,
|
|
46
48
|
default: true
|
|
49
|
+
},
|
|
50
|
+
multiSelect: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
placeholder: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: '未选择'
|
|
47
57
|
}
|
|
48
58
|
},
|
|
49
59
|
data: function data() {
|
|
@@ -61,10 +71,25 @@ var _default2 = createComponent({
|
|
|
61
71
|
return this.title;
|
|
62
72
|
}
|
|
63
73
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
if (this.multiSelect) {
|
|
75
|
+
if (this.value.length) {
|
|
76
|
+
var value = '';
|
|
77
|
+
this.options.forEach(function (item) {
|
|
78
|
+
if (_this.value.indexOf(item.value) >= 0) {
|
|
79
|
+
value += item.text + '、';
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
value = value.substr(0, value.length - 1);
|
|
83
|
+
return value;
|
|
84
|
+
} else {
|
|
85
|
+
return this.placeholder;
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
var match = this.options.filter(function (option) {
|
|
89
|
+
return option.value === _this.value;
|
|
90
|
+
});
|
|
91
|
+
return match.length ? match[0].text : '';
|
|
92
|
+
}
|
|
68
93
|
}
|
|
69
94
|
},
|
|
70
95
|
watch: {
|
|
@@ -121,6 +146,30 @@ var _default2 = createComponent({
|
|
|
121
146
|
if (this.getContainer) {
|
|
122
147
|
event.stopPropagation();
|
|
123
148
|
}
|
|
149
|
+
},
|
|
150
|
+
select: function select(value) {
|
|
151
|
+
if (this.value.indexOf(value) >= 0) {
|
|
152
|
+
this.value.splice(this.value.indexOf(value), 1);
|
|
153
|
+
} else {
|
|
154
|
+
this.value.push(value);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
isSelect: function isSelect(value) {
|
|
158
|
+
if (this.value.indexOf(value) >= 0) {
|
|
159
|
+
return true;
|
|
160
|
+
} else {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
reset: function reset() {
|
|
165
|
+
this.showPopup = false;
|
|
166
|
+
this.$emit('input', []);
|
|
167
|
+
this.$emit('reset', []);
|
|
168
|
+
},
|
|
169
|
+
confirm: function confirm() {
|
|
170
|
+
this.showPopup = false;
|
|
171
|
+
this.$emit('input', this.value);
|
|
172
|
+
this.$emit('change', this.value);
|
|
124
173
|
}
|
|
125
174
|
},
|
|
126
175
|
render: function render() {
|
|
@@ -135,40 +184,73 @@ var _default2 = createComponent({
|
|
|
135
184
|
direction = _this$parent.direction,
|
|
136
185
|
activeColor = _this$parent.activeColor,
|
|
137
186
|
closeOnClickOverlay = _this$parent.closeOnClickOverlay;
|
|
138
|
-
var Options
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
187
|
+
var Options;
|
|
188
|
+
|
|
189
|
+
if (this.multiSelect) {
|
|
190
|
+
Options = this.options.map(function (option, index) {
|
|
191
|
+
var active = _this3.value.indexOf(option.value) >= 0;
|
|
192
|
+
return h(_cell.default, {
|
|
193
|
+
"attrs": {
|
|
194
|
+
"clickable": true,
|
|
195
|
+
"icon": option.icon,
|
|
196
|
+
"title": option.text
|
|
197
|
+
},
|
|
198
|
+
"key": option.value,
|
|
199
|
+
"class": index === _this3.options.length - 1 ? bem('option', {
|
|
200
|
+
active: active
|
|
201
|
+
}) : "half-border-bottom " + bem('option', {
|
|
202
|
+
active: active
|
|
203
|
+
}),
|
|
204
|
+
"style": "padding-left: 16px",
|
|
205
|
+
"on": {
|
|
206
|
+
"click": function click() {
|
|
207
|
+
_this3.select(option.value);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}, [h(_checkbox.default, {
|
|
211
|
+
"style": "padding:0;position: absolute;right: 0px;",
|
|
212
|
+
"attrs": {
|
|
213
|
+
"value": _this3.isSelect(option.value)
|
|
214
|
+
}
|
|
215
|
+
})]);
|
|
216
|
+
});
|
|
217
|
+
} else {
|
|
218
|
+
Options = this.options.map(function (option) {
|
|
219
|
+
var active = option.value === _this3.value;
|
|
220
|
+
return h(_cell.default, {
|
|
221
|
+
"attrs": {
|
|
222
|
+
"clickable": true,
|
|
223
|
+
"icon": option.icon,
|
|
224
|
+
"title": option.text
|
|
225
|
+
},
|
|
226
|
+
"key": option.value,
|
|
227
|
+
"class": "half-border-bottom " + bem('option', {
|
|
228
|
+
active: active
|
|
229
|
+
}),
|
|
230
|
+
"style": {
|
|
231
|
+
color: active ? activeColor : ''
|
|
232
|
+
},
|
|
233
|
+
"on": {
|
|
234
|
+
"click": function click() {
|
|
235
|
+
_this3.showPopup = false;
|
|
156
236
|
|
|
157
|
-
|
|
158
|
-
|
|
237
|
+
if (option.value !== _this3.value) {
|
|
238
|
+
_this3.$emit('input', option.value);
|
|
159
239
|
|
|
160
|
-
|
|
240
|
+
_this3.$emit('change', option.value);
|
|
241
|
+
}
|
|
161
242
|
}
|
|
162
243
|
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
})
|
|
171
|
-
}
|
|
244
|
+
}, [active && h(_icon.default, {
|
|
245
|
+
"class": bem('icon'),
|
|
246
|
+
"attrs": {
|
|
247
|
+
"color": activeColor,
|
|
248
|
+
"name": "correct-checked"
|
|
249
|
+
}
|
|
250
|
+
})]);
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
172
254
|
var style = {
|
|
173
255
|
zIndex: zIndex
|
|
174
256
|
};
|
|
@@ -202,6 +284,7 @@ var _default2 = createComponent({
|
|
|
202
284
|
"closeOnClickOverlay": closeOnClickOverlay
|
|
203
285
|
},
|
|
204
286
|
"class": bem('content'),
|
|
287
|
+
"style": this.multiSelect ? "padding-left: 0px" : "",
|
|
205
288
|
"on": {
|
|
206
289
|
"open": this.onOpen,
|
|
207
290
|
"close": this.onClose,
|
|
@@ -218,7 +301,23 @@ var _default2 = createComponent({
|
|
|
218
301
|
_this3.showPopup = $$v;
|
|
219
302
|
}
|
|
220
303
|
}
|
|
221
|
-
}, [Options,
|
|
304
|
+
}, [Options, h("div", {
|
|
305
|
+
"class": "button",
|
|
306
|
+
"directives": [{
|
|
307
|
+
name: "show",
|
|
308
|
+
value: this.multiSelect
|
|
309
|
+
}]
|
|
310
|
+
}, [h("div", {
|
|
311
|
+
"class": "button-reset",
|
|
312
|
+
"on": {
|
|
313
|
+
"click": this.reset
|
|
314
|
+
}
|
|
315
|
+
}, ["\u91CD\u7F6E"]), h("div", {
|
|
316
|
+
"class": "button-confirm",
|
|
317
|
+
"on": {
|
|
318
|
+
"click": this.confirm
|
|
319
|
+
}
|
|
320
|
+
}, ["\u786E\u5B9A"])]), this.slots('default')])])]);
|
|
222
321
|
}
|
|
223
322
|
});
|
|
224
323
|
|
|
@@ -39,10 +39,36 @@
|
|
|
39
39
|
bottom: 0;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
&__content {
|
|
42
|
+
&__content, &__content.zt-popup {
|
|
43
43
|
position: absolute;
|
|
44
44
|
max-height: @dropdown-menu-content-max-height;
|
|
45
45
|
padding-left: @padding-md;
|
|
46
46
|
box-sizing: border-box;
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
.button{
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 44px;
|
|
53
|
+
display: flex;
|
|
54
|
+
border-top: 1px solid rgba(0,0,0,0.05);
|
|
55
|
+
}
|
|
56
|
+
.button-reset{
|
|
57
|
+
width: 50%;
|
|
58
|
+
font-family: PingFangSC-Regular;
|
|
59
|
+
font-weight: 400;
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
color: #FF9623;
|
|
62
|
+
text-align: center;
|
|
63
|
+
padding-top: 11px;
|
|
48
64
|
}
|
|
65
|
+
.button-confirm{
|
|
66
|
+
width: 50%;
|
|
67
|
+
background-color: #0091FA;
|
|
68
|
+
font-family: PingFangSC-Semibold;
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
color: #F5F5FA;
|
|
72
|
+
text-align: center;
|
|
73
|
+
padding-top: 11px;
|
|
74
|
+
}
|
|
@@ -2,6 +2,7 @@ require('../../style/base.css');
|
|
|
2
2
|
require('../../overlay/index.css');
|
|
3
3
|
require('../../info/index.css');
|
|
4
4
|
require('../../icon/index.css');
|
|
5
|
+
require('../../checkbox/index.css');
|
|
5
6
|
require('../../cell/index.css');
|
|
6
7
|
require('../../popup/index.css');
|
|
7
8
|
require('../index.css');
|
|
@@ -2,6 +2,7 @@ require('../../style/base.less');
|
|
|
2
2
|
require('../../overlay/index.less');
|
|
3
3
|
require('../../info/index.less');
|
|
4
4
|
require('../../icon/index.less');
|
|
5
|
+
require('../../checkbox/index.less');
|
|
5
6
|
require('../../cell/index.less');
|
|
6
7
|
require('../../popup/index.less');
|
|
7
8
|
require('../index.less');
|
|
@@ -128,7 +128,8 @@ var _default = createComponent({
|
|
|
128
128
|
color: item.showPopup ? _this.activeColor : ''
|
|
129
129
|
}
|
|
130
130
|
}, [h("div", {
|
|
131
|
-
"class": "zt-ellipsis"
|
|
131
|
+
"class": "zt-ellipsis",
|
|
132
|
+
"style": "padding-right: 10px"
|
|
132
133
|
}, [item.slots('title') || item.displayTitle, item.slots('icon') || h(_icon.default, {
|
|
133
134
|
"class": bem('icon'),
|
|
134
135
|
"attrs": {
|