@para-ui/core 3.0.103 → 3.0.105
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/DragVerify/index.js +63 -38
- package/Form/index.js +1 -1
- package/FormItem/index.js +1 -1
- package/README.md +10 -0
- package/Table/index.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/ComboSelect.js +1 -1
- package/umd/DragVerify.js +4 -4
- package/umd/DynamicMultiBox.js +1 -1
- package/umd/Form.js +1 -1
- package/umd/FormItem.js +1 -1
- package/umd/Table.js +1 -1
- /package/_verture/{index-b7e9c13a.js → index-effca97a.js} +0 -0
package/DragVerify/index.js
CHANGED
|
@@ -135,8 +135,8 @@ var DragVerify = function DragVerify(props) {
|
|
|
135
135
|
imgBg.style.display = 'inline-block';
|
|
136
136
|
if (!refDom.current) return;
|
|
137
137
|
var sliderImgEle = refDom.current.querySelector('.slider-img');
|
|
138
|
-
|
|
139
|
-
var b =
|
|
138
|
+
//const sliderImgEleRect = sliderImgEle?.getBoundingClientRect();
|
|
139
|
+
var b = sliderImgEle === null || sliderImgEle === void 0 ? void 0 : sliderImgEle.clientWidth;
|
|
140
140
|
constData.current.imgScale = a / b;
|
|
141
141
|
sliderImgEle === null || sliderImgEle === void 0 ? void 0 : sliderImgEle.append(imgMove);
|
|
142
142
|
imgMove.onload = function () {
|
|
@@ -163,50 +163,75 @@ var DragVerify = function DragVerify(props) {
|
|
|
163
163
|
var moveDomRect = moveDom.getBoundingClientRect();
|
|
164
164
|
var moveDomWidth = moveDomRect.width; // 移动箭头的框
|
|
165
165
|
var moveSliderWidth = moveSliderRect.width; // 进度条的宽
|
|
166
|
+
// 移动
|
|
167
|
+
var moveFunc = function moveFunc(event, e) {
|
|
168
|
+
var moveW = event.pageX - e.pageX; // 鼠标移动的距离
|
|
169
|
+
if (moveW < 0) moveW = 0;
|
|
170
|
+
if (moveW + moveDomWidth > imgBg.width) moveW = imgBg.width - moveDomWidth;
|
|
171
|
+
moveDom.style.left = "".concat(moveW - 1, "px");
|
|
172
|
+
// 加一防止滑块与进度条之间有间隙
|
|
173
|
+
moveProgress.style.width = "".concat(moveW < 2 ? 2 : moveW, "px");
|
|
174
|
+
// 进度条走过的比例
|
|
175
|
+
var ratio = moveW / (moveSliderWidth - moveDomWidth);
|
|
176
|
+
var imgMoveWidth = (imgBg.width - imgMove.width) * ratio;
|
|
177
|
+
imgMove.style.left = "".concat(imgMoveWidth, "px");
|
|
178
|
+
sliderText.innerHTML = '';
|
|
179
|
+
};
|
|
180
|
+
// 抬起
|
|
181
|
+
var endFunc = function endFunc() {
|
|
182
|
+
sliderBox.classList.remove("".concat(prefixCls, "-move"));
|
|
183
|
+
constData.current.padding = true;
|
|
184
|
+
var X = parseFloat(imgMove.style.left);
|
|
185
|
+
var handX = X * constData.current.imgScale;
|
|
186
|
+
sliderPosiCheck(handX, function (result) {
|
|
187
|
+
if (!result) {
|
|
188
|
+
// 错误
|
|
189
|
+
sliderBox.classList.add("".concat(prefixCls, "-error"));
|
|
190
|
+
constData.current.timerError = setTimeout(function () {
|
|
191
|
+
constData.current.padding = false;
|
|
192
|
+
reset();
|
|
193
|
+
sliderText.innerHTML = intl({
|
|
194
|
+
id: 'tryAgain'
|
|
195
|
+
}); // 再试一次
|
|
196
|
+
getImgInfoReq();
|
|
197
|
+
}, 1000);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
sliderBox.classList.add("".concat(prefixCls, "-success"));
|
|
201
|
+
/*constData.current.timerSuccess = setTimeout(() => {
|
|
202
|
+
//constData.current.padding = false;
|
|
203
|
+
//sliderBox.classList.remove(prefixCls + '-success');
|
|
204
|
+
}, 1000);*/
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
|
|
166
208
|
moveDom.onmousedown = function (e) {
|
|
167
209
|
if (constData.current.padding) return;
|
|
168
|
-
sliderBox.classList.add(prefixCls
|
|
210
|
+
sliderBox.classList.add("".concat(prefixCls, "-move"));
|
|
169
211
|
document.onmousemove = function (event) {
|
|
170
|
-
|
|
171
|
-
if (moveW < 0) moveW = 0;
|
|
172
|
-
if (moveW + moveDomWidth > imgBg.width) moveW = imgBg.width - moveDomWidth;
|
|
173
|
-
moveDom.style.left = moveW - 1 + 'px';
|
|
174
|
-
// 加一防止滑块与进度条之间有间隙
|
|
175
|
-
moveProgress.style.width = (moveW < 2 ? 2 : moveW) + 'px';
|
|
176
|
-
// 进度条走过的比例
|
|
177
|
-
var ratio = moveW / (moveSliderWidth - moveDomWidth);
|
|
178
|
-
var imgMoveWidth = (imgBg.width - imgMove.width) * ratio;
|
|
179
|
-
imgMove.style.left = imgMoveWidth + 'px';
|
|
180
|
-
sliderText.innerHTML = '';
|
|
212
|
+
moveFunc(event, e);
|
|
181
213
|
};
|
|
182
214
|
// 鼠标抬起
|
|
183
215
|
document.onmouseup = function () {
|
|
184
216
|
document.onmousemove = null;
|
|
185
217
|
document.onmouseup = null;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
sliderBox.classList.add(prefixCls + '-success');
|
|
205
|
-
/*constData.current.timerSuccess = setTimeout(() => {
|
|
206
|
-
//constData.current.padding = false;
|
|
207
|
-
//sliderBox.classList.remove(prefixCls + '-success');
|
|
208
|
-
}, 1000);*/
|
|
209
|
-
});
|
|
218
|
+
endFunc();
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
moveDom.ontouchstart = function (touchE) {
|
|
222
|
+
if (constData.current.padding) return;
|
|
223
|
+
var e = touchE.touches[0];
|
|
224
|
+
sliderBox.classList.add("".concat(prefixCls, "-move"));
|
|
225
|
+
// 鼠标移动
|
|
226
|
+
document.ontouchmove = function (touchEvent) {
|
|
227
|
+
var event = touchEvent.touches[0];
|
|
228
|
+
moveFunc(event, e);
|
|
229
|
+
};
|
|
230
|
+
// 鼠标抬起
|
|
231
|
+
document.ontouchend = function () {
|
|
232
|
+
document.ontouchmove = null;
|
|
233
|
+
document.ontouchend = null;
|
|
234
|
+
endFunc();
|
|
210
235
|
};
|
|
211
236
|
};
|
|
212
237
|
};
|
package/Form/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { _ as _slicedToArray } from '../_verture/slicedToArray-76060636.js';
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { DeepClone } from '@paraview/lib';
|
|
5
5
|
import React__default from 'react';
|
|
6
|
-
import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-
|
|
6
|
+
import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-effca97a.js';
|
|
7
7
|
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
8
8
|
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
9
9
|
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
package/FormItem/index.js
CHANGED
package/README.md
CHANGED
package/Table/index.js
CHANGED
|
@@ -2943,7 +2943,7 @@ var Table = function Table(propsInit) {
|
|
|
2943
2943
|
width: result.width
|
|
2944
2944
|
};
|
|
2945
2945
|
setHeadDataConfig(Object.assign({}, constData.current.headDataConfig)); // 设置表格列配置,被拖动的width
|
|
2946
|
-
handHeadDataCom(_toConsumableArray(
|
|
2946
|
+
handHeadDataCom(_toConsumableArray(headDataCom)); // 重新计算表格的最小宽度
|
|
2947
2947
|
// 本地记住拖动列宽度
|
|
2948
2948
|
setLocalStorageHeadCom({
|
|
2949
2949
|
headDataConfig: constData.current.headDataConfig,
|
package/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export { D as Dropdown } from './_verture/index-77f9e0fb.js';
|
|
|
22
22
|
export { default as DynamicMultiBox } from './DynamicMultiBox/index.js';
|
|
23
23
|
export { default as Empty } from './Empty/index.js';
|
|
24
24
|
export { default as Form } from './Form/index.js';
|
|
25
|
-
export { F as FormItem } from './_verture/index-
|
|
25
|
+
export { F as FormItem } from './_verture/index-effca97a.js';
|
|
26
26
|
export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-c04790c8.js';
|
|
27
27
|
export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
|
|
28
28
|
export { default as Help } from './Help/index.js';
|