efront 3.22.4 → 3.22.7
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/coms/kugou/dragview.js +1 -1
- package/coms/layer/glance.js +1 -1
- package/coms/zimoli/autodragchildren.js +70 -9
- package/coms/zimoli/autodragchildren_test.html +6 -2
- package/coms/zimoli/autodragchildren_test.js +17 -2
- package/coms/zimoli/autodragchildren_test.less +7 -2
- package/coms/zimoli/bindtouch.js +2 -2
- package/coms/zimoli/cloneVisible.js +4 -5
- package/coms/zimoli/color.js +4 -4
- package/coms/zimoli/drag.js +2 -3
- package/coms/zimoli/list.js +26 -20
- package/coms/zimoli/mark.js +5 -3
- package/coms/zimoli/random_test.js +1 -1
- package/coms/zimoli/refilm_test.html +18 -16
- package/coms/zimoli/refilm_test.less +9 -2
- package/coms/zimoli/resize.js +3 -1
- package/coms/zimoli/search.js +74 -16
- package/coms/zimoli/select.js +2 -1
- package/coms/zimoli/selectList.js +48 -5
- package/coms/zimoli/selectList.less +46 -0
- package/coms/zimoli/selectList_test.html +1 -1
- package/coms/zimoli/slider.js +1 -1
- package/coms/zimoli/test_scroll.js +17 -31
- package/coms/zimoli/vbox_test.js +1 -1
- package/package.json +1 -1
- package/public/efront.js +1 -1
|
@@ -2,7 +2,7 @@ var singleClick = function () {
|
|
|
2
2
|
var node = this.parentNode;
|
|
3
3
|
if (node.activeNode === this) return;
|
|
4
4
|
if (node.activeNode) {
|
|
5
|
-
if (node.activeNode.origin) node.activeNode.origin.selected = false;
|
|
5
|
+
if (isObject(node.activeNode.origin)) node.activeNode.origin.selected = false;
|
|
6
6
|
node.activeNode.removeAttribute("selected");
|
|
7
7
|
}
|
|
8
8
|
this.setAttribute("selected", "");
|
|
@@ -11,8 +11,9 @@ var singleClick = function () {
|
|
|
11
11
|
if (node.value === this.value) return;
|
|
12
12
|
node.value = this.value;
|
|
13
13
|
node.name = this.name;
|
|
14
|
-
if (this.origin) this.origin.selected = true;
|
|
14
|
+
if (isObject(this.origin)) this.origin.selected = true;
|
|
15
15
|
dispatch(node, "change");
|
|
16
|
+
if (getTargetIn(node, document.activeElement)) document.activeElement.blur();
|
|
16
17
|
};
|
|
17
18
|
var multipleClick = function () {
|
|
18
19
|
var node = this.parentNode;
|
|
@@ -25,10 +26,15 @@ var multipleClick = function () {
|
|
|
25
26
|
values.splice(index, 1);
|
|
26
27
|
this.removeAttribute("selected");
|
|
27
28
|
}
|
|
28
|
-
if (this.origin) this.origin.selected = true;
|
|
29
|
+
if (isObject(this.origin)) this.origin.selected = true;
|
|
29
30
|
dispatch(node, "change");
|
|
30
31
|
};
|
|
31
32
|
|
|
33
|
+
var searchinput = function () {
|
|
34
|
+
var ipt = document.createElement("input");
|
|
35
|
+
ipt.placeholder = '搜索';
|
|
36
|
+
return ipt;
|
|
37
|
+
};
|
|
32
38
|
|
|
33
39
|
function main() {
|
|
34
40
|
var children, multiple, addable, generator, page;
|
|
@@ -101,9 +107,46 @@ function main() {
|
|
|
101
107
|
|
|
102
108
|
|
|
103
109
|
var hasIcon = false, iconed = '';
|
|
110
|
+
|
|
111
|
+
if (children.length > 6) {
|
|
112
|
+
var ipt = searchinput()
|
|
113
|
+
page.insertBefore(ipt, page.firstChild);
|
|
114
|
+
var searchtext = function () {
|
|
115
|
+
if (this.value) children = searchResult;
|
|
116
|
+
else children = searchResult.source;
|
|
117
|
+
if (isMounted(this)) searchResult.search(this.value);
|
|
118
|
+
};
|
|
119
|
+
var searchResult = search(ipt.value, children, a => {
|
|
120
|
+
return isObject(a) ? getName(a) : String(a);
|
|
121
|
+
});
|
|
122
|
+
searchResult.callback = function () {
|
|
123
|
+
if (!searchResult.complete) {
|
|
124
|
+
page.setAttribute('searching', '');
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
if (searchResult.searchText && !searchResult.length) {
|
|
128
|
+
page.setAttribute('empty', '');
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
page.removeAttribute('empty');
|
|
132
|
+
}
|
|
133
|
+
page.removeAttribute('searching');
|
|
134
|
+
}
|
|
135
|
+
itemMap = Object.create(null);
|
|
136
|
+
page.clean();
|
|
137
|
+
page.go(0);
|
|
138
|
+
}
|
|
139
|
+
on('remove')(ipt, function () {
|
|
140
|
+
searchResult.abort();
|
|
141
|
+
});
|
|
142
|
+
on('input')(ipt, searchtext);
|
|
143
|
+
on('keyup')(ipt, searchtext);
|
|
144
|
+
on('change')(ipt, searchtext);
|
|
145
|
+
|
|
146
|
+
}
|
|
104
147
|
var page = list(page, function (i) {
|
|
105
148
|
if (i < 0 || i >= children.length) return;
|
|
106
|
-
return createItem(generator ? generator(i) : children[i]);
|
|
149
|
+
return createItem(generator ? generator(i, children[i]) : children[i]);
|
|
107
150
|
});
|
|
108
151
|
once("mounted")(page, function () {
|
|
109
152
|
var index = 0;
|
|
@@ -220,6 +263,6 @@ function main() {
|
|
|
220
263
|
};
|
|
221
264
|
bind('keydown.enter')(page, enter);
|
|
222
265
|
bind('keydown.space')(page, enter);
|
|
223
|
-
on('mousedown')(page, e => e.preventDefault());
|
|
266
|
+
on('mousedown')(page, e => !/^input$/i.test(e.target.tagName) && e.preventDefault());
|
|
224
267
|
return page;
|
|
225
268
|
}
|
|
@@ -78,4 +78,50 @@
|
|
|
78
78
|
vertical-align: top;
|
|
79
79
|
margin-left: 10px;
|
|
80
80
|
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&>input {
|
|
84
|
+
height: 28px;
|
|
85
|
+
line-height: 28px;
|
|
86
|
+
padding: 0 16px;
|
|
87
|
+
border: none;
|
|
88
|
+
appearance: none;
|
|
89
|
+
width: 100%;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
display: block;
|
|
93
|
+
position: sticky;
|
|
94
|
+
top: 0;
|
|
95
|
+
border-bottom: 1px solid #0006;
|
|
96
|
+
|
|
97
|
+
&:focus {
|
|
98
|
+
outline-offset: -1px;
|
|
99
|
+
outline: 1px solid #2ca2f9;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&[searching] {
|
|
104
|
+
&::before {
|
|
105
|
+
content: "正在搜索..";
|
|
106
|
+
position: absolute;
|
|
107
|
+
left: 0;
|
|
108
|
+
top: 0;
|
|
109
|
+
right: 0;
|
|
110
|
+
display: block;
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
text-align: right;
|
|
113
|
+
pointer-events: none;
|
|
114
|
+
padding: 0 16px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&[empty] {
|
|
119
|
+
background-color: #fff;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
b {
|
|
123
|
+
border: 1px solid #29e;
|
|
124
|
+
background-color: #29e2;
|
|
125
|
+
font-weight: 400;
|
|
126
|
+
border-radius: 2px;
|
|
81
127
|
}
|
package/coms/zimoli/slider.js
CHANGED
|
@@ -210,7 +210,7 @@ function slider(autoplay, circle = true) {
|
|
|
210
210
|
var deltax = event.clientX - saved_x;
|
|
211
211
|
var deltay = event.clientY - saved_y;
|
|
212
212
|
if (!direction) {
|
|
213
|
-
if (
|
|
213
|
+
if (!onclick.preventClick) return;
|
|
214
214
|
if (abs(deltay) - abs(deltax) > 0) { //垂直方向
|
|
215
215
|
direction = -1;
|
|
216
216
|
} else { //水平方向
|
|
@@ -7,50 +7,36 @@ function createTouchEvent(eventtype, extra = {}) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
function _test_scroll(
|
|
11
|
-
var
|
|
12
|
-
var
|
|
10
|
+
function _test_scroll() {
|
|
11
|
+
var banner = this;
|
|
12
|
+
var clientY = 2;
|
|
13
|
+
var touchstartEvent = createTouchEvent("touchstart", { clientY, clientX: 0 });
|
|
13
14
|
var deltaY = 100;
|
|
15
|
+
onclick.preventClick = true;
|
|
14
16
|
dispatch(banner, touchstartEvent);
|
|
15
17
|
var interval_handle = setInterval(function () {
|
|
16
|
-
clientY
|
|
17
|
-
var touchmoveEvent = createTouchEvent("touchmove", { clientY });
|
|
18
|
-
dispatch(
|
|
18
|
+
clientY += deltaY;
|
|
19
|
+
var touchmoveEvent = createTouchEvent("touchmove", { clientY, clientX: 0 });
|
|
20
|
+
dispatch(window, touchmoveEvent);
|
|
19
21
|
}, 10);
|
|
20
22
|
|
|
21
23
|
setTimeout(function () {
|
|
22
|
-
deltaY = -
|
|
23
|
-
},
|
|
24
|
+
deltaY = -2
|
|
25
|
+
}, 200);
|
|
24
26
|
setTimeout(function () {
|
|
25
|
-
deltaY =
|
|
27
|
+
deltaY = 5
|
|
26
28
|
}, 400);
|
|
27
|
-
setTimeout(function () {
|
|
28
|
-
deltaY = -10
|
|
29
|
-
}, 420);
|
|
30
|
-
setTimeout(function () {
|
|
31
|
-
deltaY = -50
|
|
32
|
-
}, 450);
|
|
33
|
-
setTimeout(function () {
|
|
34
|
-
deltaY = 50
|
|
35
|
-
}, 470);
|
|
36
|
-
setTimeout(function () {
|
|
37
|
-
deltaY = -100050
|
|
38
|
-
}, 480);
|
|
39
|
-
setTimeout(function () {
|
|
40
|
-
deltaY = +100050
|
|
41
|
-
}, 490);
|
|
42
29
|
setTimeout(function () {
|
|
43
30
|
clearInterval(interval_handle);
|
|
31
|
+
}, 510);
|
|
32
|
+
setTimeout(function () {
|
|
44
33
|
var touchendEvent = createTouchEvent("touchend");
|
|
34
|
+
touchendEvent.touches.pop();
|
|
45
35
|
dispatch(banner, touchendEvent);
|
|
46
|
-
},
|
|
36
|
+
}, 560);
|
|
47
37
|
}
|
|
48
38
|
|
|
49
|
-
function main(banner){
|
|
50
|
-
|
|
51
|
-
_test_scroll(banner);
|
|
52
|
-
}else{
|
|
53
|
-
on("append")(banner,_test_scroll);
|
|
54
|
-
}
|
|
39
|
+
function main(banner) {
|
|
40
|
+
oncemount(banner, _test_scroll);
|
|
55
41
|
|
|
56
42
|
}
|
package/coms/zimoli/vbox_test.js
CHANGED