Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DiDi
cube-ui
提交
6460953e
C
cube-ui
项目概览
DiDi
/
cube-ui
9 个月 前同步成功
通知
34
Star
9078
Fork
1508
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cube-ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6460953e
编写于
4月 29, 2020
作者:
D
dolymood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build: package
上级
c6af758b
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
134 addition
and
113 deletion
+134
-113
lib/cascade-picker/cascade-picker.min.js
lib/cascade-picker/cascade-picker.min.js
+1
-1
lib/cascade-picker/index.js
lib/cascade-picker/index.js
+18
-15
lib/cube.min.js
lib/cube.min.js
+1
-1
lib/date-picker/date-picker.min.js
lib/date-picker/date-picker.min.js
+1
-1
lib/date-picker/index.js
lib/date-picker/index.js
+18
-15
lib/index.js
lib/index.js
+19
-16
lib/picker/index.js
lib/picker/index.js
+18
-15
lib/picker/picker.min.js
lib/picker/picker.min.js
+1
-1
lib/segment-picker/index.js
lib/segment-picker/index.js
+18
-15
lib/segment-picker/segment-picker.min.js
lib/segment-picker/segment-picker.min.js
+1
-1
lib/select/index.js
lib/select/index.js
+18
-15
lib/select/select.min.js
lib/select/select.min.js
+1
-1
lib/time-picker/index.js
lib/time-picker/index.js
+18
-15
lib/time-picker/time-picker.min.js
lib/time-picker/time-picker.min.js
+1
-1
未找到文件。
lib/cascade-picker/cascade-picker.min.js
浏览文件 @
6460953e
此差异已折叠。
点击以展开。
lib/cascade-picker/index.js
浏览文件 @
6460953e
...
...
@@ -7109,7 +7109,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
index
=
this
.
wheels
[
i
].
getSelectedIndex
(
);
var
index
=
this
.
_getSelectIndex
(
this
.
wheels
[
i
]
);
this
.
_indexes
[
i
]
=
index
;
var
value
=
null
;
...
...
@@ -7261,20 +7261,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
useTransition
:
_constants
.
USE_TRANSITION
});
wheel
.
on
(
'
scrollEnd
'
,
function
()
{
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
var
y
=
wheel
.
y
;
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
selectedIndex
);
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
_this6
.
_getSelectIndex
(
wheel
));
});
}
else
{
this
.
wheels
[
i
].
refresh
();
...
...
@@ -7300,6 +7287,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return
data
[
0
][
this
.
orderKey
];
}
return
0
;
},
_getSelectIndex
:
function
_getSelectIndex
(
wheel
)
{
var
y
=
wheel
.
y
;
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
return
selectedIndex
;
}
},
beforeDestroy
:
function
beforeDestroy
()
{
...
...
lib/cube.min.js
浏览文件 @
6460953e
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
lib/date-picker/date-picker.min.js
浏览文件 @
6460953e
此差异已折叠。
点击以展开。
lib/date-picker/index.js
浏览文件 @
6460953e
...
...
@@ -7170,7 +7170,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
index
=
this
.
wheels
[
i
].
getSelectedIndex
(
);
var
index
=
this
.
_getSelectIndex
(
this
.
wheels
[
i
]
);
this
.
_indexes
[
i
]
=
index
;
var
value
=
null
;
...
...
@@ -7322,20 +7322,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
useTransition
:
_constants
.
USE_TRANSITION
});
wheel
.
on
(
'
scrollEnd
'
,
function
()
{
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
var
y
=
wheel
.
y
;
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
selectedIndex
);
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
_this6
.
_getSelectIndex
(
wheel
));
});
}
else
{
this
.
wheels
[
i
].
refresh
();
...
...
@@ -7361,6 +7348,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return
data
[
0
][
this
.
orderKey
];
}
return
0
;
},
_getSelectIndex
:
function
_getSelectIndex
(
wheel
)
{
var
y
=
wheel
.
y
;
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
return
selectedIndex
;
}
},
beforeDestroy
:
function
beforeDestroy
()
{
...
...
lib/index.js
浏览文件 @
6460953e
...
...
@@ -7286,7 +7286,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
var Cube = {
version: "1.12.3
7
",
version: "1.12.3
8
",
install: install,
BScroll: _module.BetterScroll,
createAPI: _module.createAPI
...
...
@@ -11822,7 +11822,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
for (var i = 0; i < length; i++) {
var index = this.
wheels[i].getSelectedIndex(
);
var index = this.
_getSelectIndex(this.wheels[i]
);
this._indexes[i] = index;
var value = null;
...
...
@@ -11974,20 +11974,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
useTransition: _constants.USE_TRANSITION
});
wheel.on('scrollEnd', function () {
var selectedIndex = void 0;
if (_constants.USE_TRANSITION) {
selectedIndex = wheel.getSelectedIndex();
} else {
var y = wheel.y;
if (y > wheel.minScrollY) {
selectedIndex = 0;
} else if (y < wheel.maxScrollY) {
selectedIndex = wheel.items.length - 1;
} else {
selectedIndex = Math.round(Math.abs(y / wheel.itemHeight));
}
}
_this6.$emit(EVENT_CHANGE, i, selectedIndex);
_this6.$emit(EVENT_CHANGE, i, _this6._getSelectIndex(wheel));
});
} else {
this.wheels[i].refresh();
...
...
@@ -12013,6 +12000,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return data[0][this.orderKey];
}
return 0;
},
_getSelectIndex: function _getSelectIndex(wheel) {
var y = wheel.y;
var selectedIndex = void 0;
if (_constants.USE_TRANSITION) {
selectedIndex = wheel.getSelectedIndex();
} else {
if (y > wheel.minScrollY) {
selectedIndex = 0;
} else if (y < wheel.maxScrollY) {
selectedIndex = wheel.items.length - 1;
} else {
selectedIndex = Math.round(Math.abs(y / wheel.itemHeight));
}
}
return selectedIndex;
}
},
beforeDestroy: function beforeDestroy() {
...
...
lib/picker/index.js
浏览文件 @
6460953e
...
...
@@ -7109,7 +7109,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
index
=
this
.
wheels
[
i
].
getSelectedIndex
(
);
var
index
=
this
.
_getSelectIndex
(
this
.
wheels
[
i
]
);
this
.
_indexes
[
i
]
=
index
;
var
value
=
null
;
...
...
@@ -7261,20 +7261,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
useTransition
:
_constants
.
USE_TRANSITION
});
wheel
.
on
(
'
scrollEnd
'
,
function
()
{
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
var
y
=
wheel
.
y
;
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
selectedIndex
);
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
_this6
.
_getSelectIndex
(
wheel
));
});
}
else
{
this
.
wheels
[
i
].
refresh
();
...
...
@@ -7300,6 +7287,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return
data
[
0
][
this
.
orderKey
];
}
return
0
;
},
_getSelectIndex
:
function
_getSelectIndex
(
wheel
)
{
var
y
=
wheel
.
y
;
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
return
selectedIndex
;
}
},
beforeDestroy
:
function
beforeDestroy
()
{
...
...
lib/picker/picker.min.js
浏览文件 @
6460953e
此差异已折叠。
点击以展开。
lib/segment-picker/index.js
浏览文件 @
6460953e
...
...
@@ -7109,7 +7109,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
index
=
this
.
wheels
[
i
].
getSelectedIndex
(
);
var
index
=
this
.
_getSelectIndex
(
this
.
wheels
[
i
]
);
this
.
_indexes
[
i
]
=
index
;
var
value
=
null
;
...
...
@@ -7261,20 +7261,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
useTransition
:
_constants
.
USE_TRANSITION
});
wheel
.
on
(
'
scrollEnd
'
,
function
()
{
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
var
y
=
wheel
.
y
;
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
selectedIndex
);
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
_this6
.
_getSelectIndex
(
wheel
));
});
}
else
{
this
.
wheels
[
i
].
refresh
();
...
...
@@ -7300,6 +7287,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return
data
[
0
][
this
.
orderKey
];
}
return
0
;
},
_getSelectIndex
:
function
_getSelectIndex
(
wheel
)
{
var
y
=
wheel
.
y
;
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
return
selectedIndex
;
}
},
beforeDestroy
:
function
beforeDestroy
()
{
...
...
lib/segment-picker/segment-picker.min.js
浏览文件 @
6460953e
此差异已折叠。
点击以展开。
lib/select/index.js
浏览文件 @
6460953e
...
...
@@ -7109,7 +7109,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
index
=
this
.
wheels
[
i
].
getSelectedIndex
(
);
var
index
=
this
.
_getSelectIndex
(
this
.
wheels
[
i
]
);
this
.
_indexes
[
i
]
=
index
;
var
value
=
null
;
...
...
@@ -7261,20 +7261,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
useTransition
:
_constants
.
USE_TRANSITION
});
wheel
.
on
(
'
scrollEnd
'
,
function
()
{
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
var
y
=
wheel
.
y
;
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
selectedIndex
);
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
_this6
.
_getSelectIndex
(
wheel
));
});
}
else
{
this
.
wheels
[
i
].
refresh
();
...
...
@@ -7300,6 +7287,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return
data
[
0
][
this
.
orderKey
];
}
return
0
;
},
_getSelectIndex
:
function
_getSelectIndex
(
wheel
)
{
var
y
=
wheel
.
y
;
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
return
selectedIndex
;
}
},
beforeDestroy
:
function
beforeDestroy
()
{
...
...
lib/select/select.min.js
浏览文件 @
6460953e
此差异已折叠。
点击以展开。
lib/time-picker/index.js
浏览文件 @
6460953e
...
...
@@ -7170,7 +7170,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
index
=
this
.
wheels
[
i
].
getSelectedIndex
(
);
var
index
=
this
.
_getSelectIndex
(
this
.
wheels
[
i
]
);
this
.
_indexes
[
i
]
=
index
;
var
value
=
null
;
...
...
@@ -7322,20 +7322,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
useTransition
:
_constants
.
USE_TRANSITION
});
wheel
.
on
(
'
scrollEnd
'
,
function
()
{
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
var
y
=
wheel
.
y
;
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
selectedIndex
);
_this6
.
$emit
(
EVENT_CHANGE
,
i
,
_this6
.
_getSelectIndex
(
wheel
));
});
}
else
{
this
.
wheels
[
i
].
refresh
();
...
...
@@ -7361,6 +7348,22 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return
data
[
0
][
this
.
orderKey
];
}
return
0
;
},
_getSelectIndex
:
function
_getSelectIndex
(
wheel
)
{
var
y
=
wheel
.
y
;
var
selectedIndex
=
void
0
;
if
(
_constants
.
USE_TRANSITION
)
{
selectedIndex
=
wheel
.
getSelectedIndex
();
}
else
{
if
(
y
>
wheel
.
minScrollY
)
{
selectedIndex
=
0
;
}
else
if
(
y
<
wheel
.
maxScrollY
)
{
selectedIndex
=
wheel
.
items
.
length
-
1
;
}
else
{
selectedIndex
=
Math
.
round
(
Math
.
abs
(
y
/
wheel
.
itemHeight
));
}
}
return
selectedIndex
;
}
},
beforeDestroy
:
function
beforeDestroy
()
{
...
...
lib/time-picker/time-picker.min.js
浏览文件 @
6460953e
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录