@arco-design/mobile-react 2.26.0 → 2.27.1
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/CHANGELOG.md +29 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/form/form-item.js +4 -2
- package/cjs/icon/IconHeart/index.js +1 -1
- package/cjs/icon/IconKeyboard/index.d.ts +7 -0
- package/cjs/icon/IconKeyboard/index.js +48 -0
- package/cjs/icon/IconKeyboardDelete/index.d.ts +7 -0
- package/cjs/icon/IconKeyboardDelete/index.js +44 -0
- package/cjs/icon/IconMinus/index.js +1 -1
- package/cjs/icon/IconMore/index.js +1 -1
- package/cjs/icon/IconNotice/index.js +1 -1
- package/cjs/icon/IconNoticeOff/index.js +1 -1
- package/cjs/icon/IconPlay/index.js +1 -1
- package/cjs/icon/IconSetting/index.js +2 -2
- package/cjs/icon/IconSound/index.js +1 -1
- package/cjs/icon/IconStar/index.js +1 -1
- package/cjs/icon/IconStarFill/index.js +1 -1
- package/cjs/icon/IconTriDown/index.js +1 -1
- package/cjs/icon/IconTriUp/index.js +1 -1
- package/cjs/icon/IconUpload/index.js +1 -1
- package/cjs/icon/IconWarnCircle/index.js +1 -1
- package/cjs/icon/IconWarnCircleFill/index.js +1 -1
- package/cjs/icon/index.d.ts +2 -0
- package/cjs/icon/index.js +12 -2
- package/cjs/image-picker/style/css/index.d.ts +1 -0
- package/cjs/image-picker/style/css/index.js +2 -0
- package/cjs/image-picker/style/index.d.ts +1 -0
- package/cjs/image-picker/style/index.js +2 -0
- package/cjs/index-bar/context.d.ts +3 -0
- package/cjs/index-bar/context.js +15 -0
- package/cjs/index-bar/demo/style/css/mobile.css +23 -0
- package/cjs/index-bar/demo/style/mobile.less +26 -0
- package/cjs/index-bar/group.d.ts +3 -0
- package/cjs/index-bar/group.js +101 -0
- package/cjs/index-bar/index.d.ts +15 -0
- package/cjs/index-bar/index.js +274 -0
- package/cjs/index-bar/side-bar.d.ts +3 -0
- package/cjs/index-bar/side-bar.js +102 -0
- package/cjs/index-bar/style/css/index.css +164 -0
- package/cjs/index-bar/style/css/index.d.ts +3 -0
- package/cjs/index-bar/style/css/index.js +7 -0
- package/cjs/index-bar/style/index.d.ts +3 -0
- package/cjs/index-bar/style/index.js +7 -0
- package/cjs/index-bar/style/index.less +122 -0
- package/cjs/index-bar/type.d.ts +195 -0
- package/cjs/index-bar/type.js +3 -0
- package/cjs/index-bar/utils.d.ts +6 -0
- package/cjs/index-bar/utils.js +68 -0
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +9 -1
- package/cjs/keyboard/demo/style/css/mobile.css +4 -0
- package/cjs/keyboard/demo/style/mobile.less +8 -0
- package/cjs/keyboard/index.d.ts +13 -0
- package/cjs/keyboard/index.js +270 -0
- package/cjs/keyboard/style/css/index.css +93 -0
- package/cjs/keyboard/style/css/index.d.ts +3 -0
- package/cjs/keyboard/style/css/index.js +7 -0
- package/cjs/keyboard/style/index.d.ts +3 -0
- package/cjs/keyboard/style/index.js +7 -0
- package/cjs/keyboard/style/index.less +80 -0
- package/cjs/keyboard/type.d.ts +102 -0
- package/cjs/keyboard/type.js +3 -0
- package/cjs/picker/index.js +3 -39
- package/cjs/picker/type.d.ts +1 -1
- package/cjs/picker-view/components/cascader.d.ts +2 -3
- package/cjs/picker-view/components/cascader.js +8 -6
- package/cjs/picker-view/components/multi-picker.d.ts +2 -3
- package/cjs/picker-view/components/multi-picker.js +31 -35
- package/cjs/picker-view/components/picker-cell.d.ts +1 -1
- package/cjs/picker-view/components/picker-cell.js +5 -7
- package/cjs/picker-view/index.d.ts +1 -1
- package/cjs/picker-view/index.js +9 -20
- package/cjs/picker-view/type.d.ts +2 -2
- package/cjs/slider/hooks/useSliderEvents.js +20 -20
- package/cjs/sticky/index.js +2 -2
- package/cjs/style.d.ts +2 -0
- package/cjs/style.js +4 -0
- package/dist/index.js +1172 -444
- package/dist/index.min.js +5 -5
- package/dist/style.css +215 -1
- package/dist/style.min.css +1 -1
- package/esm/form/form-item.js +4 -2
- package/esm/icon/IconHeart/index.js +1 -1
- package/esm/icon/IconKeyboard/index.d.ts +7 -0
- package/esm/icon/IconKeyboard/index.js +37 -0
- package/esm/icon/IconKeyboardDelete/index.d.ts +7 -0
- package/esm/icon/IconKeyboardDelete/index.js +33 -0
- package/esm/icon/IconMinus/index.js +1 -1
- package/esm/icon/IconMore/index.js +1 -1
- package/esm/icon/IconNotice/index.js +1 -1
- package/esm/icon/IconNoticeOff/index.js +1 -1
- package/esm/icon/IconPlay/index.js +1 -1
- package/esm/icon/IconSetting/index.js +2 -2
- package/esm/icon/IconSound/index.js +1 -1
- package/esm/icon/IconStar/index.js +1 -1
- package/esm/icon/IconStarFill/index.js +1 -1
- package/esm/icon/IconTriDown/index.js +1 -1
- package/esm/icon/IconTriUp/index.js +1 -1
- package/esm/icon/IconUpload/index.js +1 -1
- package/esm/icon/IconWarnCircle/index.js +1 -1
- package/esm/icon/IconWarnCircleFill/index.js +1 -1
- package/esm/icon/index.d.ts +2 -0
- package/esm/icon/index.js +2 -0
- package/esm/image-picker/style/css/index.d.ts +1 -0
- package/esm/image-picker/style/css/index.js +1 -0
- package/esm/image-picker/style/index.d.ts +1 -0
- package/esm/image-picker/style/index.js +1 -0
- package/esm/index-bar/context.d.ts +3 -0
- package/esm/index-bar/context.js +8 -0
- package/esm/index-bar/demo/style/css/mobile.css +23 -0
- package/esm/index-bar/demo/style/mobile.less +26 -0
- package/esm/index-bar/group.d.ts +3 -0
- package/esm/index-bar/group.js +83 -0
- package/esm/index-bar/index.d.ts +15 -0
- package/esm/index-bar/index.js +253 -0
- package/esm/index-bar/side-bar.d.ts +3 -0
- package/esm/index-bar/side-bar.js +90 -0
- package/esm/index-bar/style/css/index.css +164 -0
- package/esm/index-bar/style/css/index.d.ts +3 -0
- package/esm/index-bar/style/css/index.js +3 -0
- package/esm/index-bar/style/index.d.ts +3 -0
- package/esm/index-bar/style/index.js +3 -0
- package/esm/index-bar/style/index.less +122 -0
- package/esm/index-bar/type.d.ts +195 -0
- package/esm/index-bar/type.js +1 -0
- package/esm/index-bar/utils.d.ts +6 -0
- package/esm/index-bar/utils.js +53 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/keyboard/demo/style/css/mobile.css +4 -0
- package/esm/keyboard/demo/style/mobile.less +8 -0
- package/esm/keyboard/index.d.ts +13 -0
- package/esm/keyboard/index.js +243 -0
- package/esm/keyboard/style/css/index.css +93 -0
- package/esm/keyboard/style/css/index.d.ts +3 -0
- package/esm/keyboard/style/css/index.js +3 -0
- package/esm/keyboard/style/index.d.ts +3 -0
- package/esm/keyboard/style/index.js +3 -0
- package/esm/keyboard/style/index.less +80 -0
- package/esm/keyboard/type.d.ts +102 -0
- package/esm/keyboard/type.js +1 -0
- package/esm/picker/index.js +3 -40
- package/esm/picker/type.d.ts +1 -1
- package/esm/picker-view/components/cascader.d.ts +2 -3
- package/esm/picker-view/components/cascader.js +8 -6
- package/esm/picker-view/components/multi-picker.d.ts +2 -3
- package/esm/picker-view/components/multi-picker.js +31 -34
- package/esm/picker-view/components/picker-cell.d.ts +1 -1
- package/esm/picker-view/components/picker-cell.js +5 -7
- package/esm/picker-view/index.d.ts +1 -1
- package/esm/picker-view/index.js +10 -21
- package/esm/picker-view/type.d.ts +2 -2
- package/esm/slider/hooks/useSliderEvents.js +20 -20
- package/esm/sticky/index.js +2 -2
- package/esm/style.d.ts +2 -0
- package/esm/style.js +2 -0
- package/package.json +3 -3
- package/tokens/app/arcodesign/default/css-variables.less +43 -0
- package/tokens/app/arcodesign/default/index.d.ts +43 -0
- package/tokens/app/arcodesign/default/index.js +43 -0
- package/tokens/app/arcodesign/default/index.json +516 -0
- package/tokens/app/arcodesign/default/index.less +43 -0
- package/umd/form/form-item.js +4 -2
- package/umd/icon/IconHeart/index.js +1 -1
- package/umd/icon/IconKeyboard/index.d.ts +7 -0
- package/umd/icon/IconKeyboard/index.js +56 -0
- package/umd/icon/IconKeyboardDelete/index.d.ts +7 -0
- package/umd/icon/IconKeyboardDelete/index.js +52 -0
- package/umd/icon/IconMinus/index.js +1 -1
- package/umd/icon/IconMore/index.js +1 -1
- package/umd/icon/IconNotice/index.js +1 -1
- package/umd/icon/IconNoticeOff/index.js +1 -1
- package/umd/icon/IconPlay/index.js +1 -1
- package/umd/icon/IconSetting/index.js +2 -2
- package/umd/icon/IconSound/index.js +1 -1
- package/umd/icon/IconStar/index.js +1 -1
- package/umd/icon/IconStarFill/index.js +1 -1
- package/umd/icon/IconTriDown/index.js +1 -1
- package/umd/icon/IconTriUp/index.js +1 -1
- package/umd/icon/IconUpload/index.js +1 -1
- package/umd/icon/IconWarnCircle/index.js +1 -1
- package/umd/icon/IconWarnCircleFill/index.js +1 -1
- package/umd/icon/index.d.ts +2 -0
- package/umd/icon/index.js +12 -6
- package/umd/image-picker/style/css/index.d.ts +1 -0
- package/umd/image-picker/style/css/index.js +4 -4
- package/umd/image-picker/style/index.d.ts +1 -0
- package/umd/image-picker/style/index.js +4 -4
- package/umd/index-bar/context.d.ts +3 -0
- package/umd/index-bar/context.js +26 -0
- package/umd/index-bar/demo/style/css/mobile.css +23 -0
- package/umd/index-bar/demo/style/mobile.less +26 -0
- package/umd/index-bar/group.d.ts +3 -0
- package/umd/index-bar/group.js +107 -0
- package/umd/index-bar/index.d.ts +15 -0
- package/umd/index-bar/index.js +274 -0
- package/umd/index-bar/side-bar.d.ts +3 -0
- package/umd/index-bar/side-bar.js +113 -0
- package/umd/index-bar/style/css/index.css +164 -0
- package/umd/index-bar/style/css/index.d.ts +3 -0
- package/umd/index-bar/style/css/index.js +15 -0
- package/umd/index-bar/style/index.d.ts +3 -0
- package/umd/index-bar/style/index.js +15 -0
- package/umd/index-bar/style/index.less +122 -0
- package/umd/index-bar/type.d.ts +195 -0
- package/umd/index-bar/type.js +17 -0
- package/umd/index-bar/utils.d.ts +6 -0
- package/umd/index-bar/utils.js +78 -0
- package/umd/index.d.ts +2 -0
- package/umd/index.js +9 -5
- package/umd/keyboard/demo/style/css/mobile.css +4 -0
- package/umd/keyboard/demo/style/mobile.less +8 -0
- package/umd/keyboard/index.d.ts +13 -0
- package/umd/keyboard/index.js +271 -0
- package/umd/keyboard/style/css/index.css +93 -0
- package/umd/keyboard/style/css/index.d.ts +3 -0
- package/umd/keyboard/style/css/index.js +15 -0
- package/umd/keyboard/style/index.d.ts +3 -0
- package/umd/keyboard/style/index.js +15 -0
- package/umd/keyboard/style/index.less +80 -0
- package/umd/keyboard/type.d.ts +102 -0
- package/umd/keyboard/type.js +17 -0
- package/umd/picker/index.js +3 -39
- package/umd/picker/type.d.ts +1 -1
- package/umd/picker-view/components/cascader.d.ts +2 -3
- package/umd/picker-view/components/cascader.js +8 -6
- package/umd/picker-view/components/multi-picker.d.ts +2 -3
- package/umd/picker-view/components/multi-picker.js +31 -35
- package/umd/picker-view/components/picker-cell.d.ts +1 -1
- package/umd/picker-view/components/picker-cell.js +5 -7
- package/umd/picker-view/index.d.ts +1 -1
- package/umd/picker-view/index.js +9 -20
- package/umd/picker-view/type.d.ts +2 -2
- package/umd/slider/hooks/useSliderEvents.js +20 -20
- package/umd/sticky/index.js +2 -2
- package/umd/style.d.ts +2 -0
- package/umd/style.js +4 -4
@@ -9,11 +9,10 @@ export interface CascaderProps {
|
|
9
9
|
disabled: boolean;
|
10
10
|
itemHeight: number;
|
11
11
|
wrapperHeight: number;
|
12
|
-
selectedValue
|
12
|
+
selectedValue?: ValueType[];
|
13
13
|
rows?: number;
|
14
14
|
hideEmptyCols?: boolean;
|
15
|
-
onValueChange?: (value: ValueType[], index: number) => void;
|
16
|
-
onPickerChange?: (value: ValueType[], index: number) => void;
|
15
|
+
onValueChange?: (value: ValueType[], index: number, data: PickerData[]) => void;
|
17
16
|
touchToStop?: boolean | number;
|
18
17
|
}
|
19
18
|
export interface CascaderRef {
|
@@ -36,7 +36,6 @@
|
|
36
36
|
wrapperHeight = props.wrapperHeight,
|
37
37
|
rows = props.rows,
|
38
38
|
hideEmptyCols = props.hideEmptyCols,
|
39
|
-
onPickerChange = props.onPickerChange,
|
40
39
|
onValueChange = props.onValueChange,
|
41
40
|
_props$selectedValue = props.selectedValue,
|
42
41
|
selectedValue = _props$selectedValue === void 0 ? [] : _props$selectedValue,
|
@@ -61,7 +60,7 @@
|
|
61
60
|
});
|
62
61
|
}
|
63
62
|
|
64
|
-
function _onValueChange(value, index) {
|
63
|
+
function _onValueChange(value, index, newData) {
|
65
64
|
var children = (0, _mobileUtils.arrayTreeFilter)(data, function (item, level) {
|
66
65
|
return level <= index && item.value === value[level];
|
67
66
|
});
|
@@ -71,15 +70,19 @@
|
|
71
70
|
for (i = index + 1; i < cols && child && child.children; i++) {
|
72
71
|
child = child.children[0];
|
73
72
|
value[i] = child.value;
|
73
|
+
newData[i] = child;
|
74
74
|
}
|
75
75
|
|
76
76
|
value.length = i;
|
77
|
-
|
77
|
+
newData.length = i;
|
78
|
+
onValueChange == null ? void 0 : onValueChange(value, index, newData);
|
78
79
|
}
|
79
80
|
|
80
81
|
function _formatData() {
|
81
82
|
var childrenTree = (0, _mobileUtils.arrayTreeFilter)(data, function (item, level) {
|
82
|
-
return item.value === selectedValue[level];
|
83
|
+
return item.value === (selectedValue == null ? void 0 : selectedValue[level]);
|
84
|
+
}, {
|
85
|
+
fallbackChildIndex: 0
|
83
86
|
}).map(function (item) {
|
84
87
|
return item.children;
|
85
88
|
});
|
@@ -104,8 +107,7 @@
|
|
104
107
|
data: formatData,
|
105
108
|
selectedValue: selectedValue,
|
106
109
|
itemHeight: itemHeight,
|
107
|
-
onValueChange: _onValueChange
|
108
|
-
onPickerChange: onPickerChange
|
110
|
+
onValueChange: _onValueChange
|
109
111
|
}, formatData.map(function (item, index) {
|
110
112
|
return /*#__PURE__*/_react.default.createElement(_pickerCell.default, {
|
111
113
|
key: index + "_picker_cell_cascader",
|
@@ -3,10 +3,9 @@ import { PickerData, ValueType } from '../type';
|
|
3
3
|
export interface MultiPickerProps {
|
4
4
|
prefixCls: string;
|
5
5
|
data: PickerData[][];
|
6
|
-
selectedValue
|
6
|
+
selectedValue?: ValueType[];
|
7
7
|
children: any;
|
8
8
|
itemHeight: number;
|
9
|
-
onValueChange: (value: ValueType[], index: number) => void;
|
10
|
-
onPickerChange?: (value: ValueType[], index: number) => void;
|
9
|
+
onValueChange: (value: ValueType[], index: number, data: PickerData[]) => void;
|
11
10
|
}
|
12
11
|
export default function MultiPicker(props: MultiPickerProps): JSX.Element;
|
@@ -22,60 +22,56 @@
|
|
22
22
|
function MultiPicker(props) {
|
23
23
|
var prefixCls = props.prefixCls,
|
24
24
|
onValueChange = props.onValueChange,
|
25
|
-
onPickerChange = props.onPickerChange,
|
26
25
|
children = props.children,
|
27
26
|
itemHeight = props.itemHeight,
|
28
27
|
selectedValue = props.selectedValue,
|
29
28
|
data = props.data;
|
30
29
|
|
31
|
-
function
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
return
|
38
|
-
return item && item[0] && item[0].value;
|
39
|
-
});
|
40
|
-
}
|
41
|
-
|
42
|
-
if (!children) {
|
43
|
-
return [];
|
44
|
-
}
|
45
|
-
|
46
|
-
return _react.default.Children.map(children, function (child) {
|
47
|
-
var childrenArray = _react.default.Children.toArray(child.children || child.props.children);
|
48
|
-
|
49
|
-
return childrenArray && childrenArray[0] && childrenArray[0].props.value;
|
30
|
+
function getCurrentData() {
|
31
|
+
return (data || []).map(function (item, itemIndex) {
|
32
|
+
var curSelected = selectedValue == null ? void 0 : selectedValue[itemIndex];
|
33
|
+
var cur = curSelected ? (item || []).find(function (i) {
|
34
|
+
return i.value === curSelected;
|
35
|
+
}) : undefined;
|
36
|
+
return cur || (item == null ? void 0 : item[0]);
|
50
37
|
});
|
51
38
|
}
|
52
39
|
|
53
|
-
function onChange(
|
54
|
-
var
|
40
|
+
function onChange(_ref) {
|
41
|
+
var index = _ref.index,
|
42
|
+
value = _ref.value,
|
43
|
+
changedData = _ref.changedData,
|
44
|
+
callback = _ref.callback;
|
45
|
+
var newData = getCurrentData().concat();
|
46
|
+
newData[index] = changedData;
|
47
|
+
var newValue = newData.map(function (d) {
|
48
|
+
return d == null ? void 0 : d.value;
|
49
|
+
});
|
55
50
|
newValue[index] = value;
|
56
51
|
|
57
52
|
if (callback) {
|
58
|
-
callback(newValue, index);
|
53
|
+
callback(newValue, index, newData);
|
59
54
|
}
|
60
55
|
}
|
61
56
|
|
62
|
-
function _onValueChange(value, index) {
|
63
|
-
onChange(
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
function _onValueChange(value, index, changedData) {
|
58
|
+
onChange({
|
59
|
+
index: index,
|
60
|
+
value: value,
|
61
|
+
callback: onValueChange,
|
62
|
+
changedData: changedData
|
63
|
+
});
|
68
64
|
}
|
69
65
|
|
70
66
|
function renderChild() {
|
71
|
-
var
|
67
|
+
var curData = getCurrentData();
|
68
|
+
var value = curData.map(function (d) {
|
69
|
+
return d == null ? void 0 : d.value;
|
70
|
+
});
|
72
71
|
return _react.default.Children.map(children, function (col, index) {
|
73
72
|
return /*#__PURE__*/_react.default.cloneElement(col, {
|
74
|
-
|
75
|
-
return
|
76
|
-
},
|
77
|
-
onValueChange: function onValueChange(val) {
|
78
|
-
return _onValueChange(val, index);
|
73
|
+
onValueChange: function onValueChange(val, changedData) {
|
74
|
+
return _onValueChange(val, index, changedData);
|
79
75
|
},
|
80
76
|
selectedValue: value[index]
|
81
77
|
});
|
@@ -8,7 +8,7 @@ export interface PickerCellProps {
|
|
8
8
|
itemHeight: number;
|
9
9
|
wrapperHeight: number;
|
10
10
|
selectedValue?: ValueType;
|
11
|
-
onValueChange?: (value: ValueType) => void;
|
11
|
+
onValueChange?: (value: ValueType, data: PickerData) => void;
|
12
12
|
disabled: boolean;
|
13
13
|
hideEmptyCols?: boolean;
|
14
14
|
/**
|
@@ -92,17 +92,15 @@
|
|
92
92
|
// index有改变时再抛出
|
93
93
|
// @en Throws again when index changes
|
94
94
|
if (currentIndex !== nowItemIndex) {
|
95
|
-
setCurrentIndex(nowItemIndex);
|
96
|
-
var
|
95
|
+
setCurrentIndex(Math.max(nowItemIndex, 0));
|
96
|
+
var newData = data[nowItemIndex];
|
97
|
+
var newValue = newData == null ? void 0 : newData.value;
|
97
98
|
|
98
99
|
if (newValue !== currentValue) {
|
99
|
-
// if (!('selectedValue' in props)) {
|
100
|
-
// setCurrentValue(newValue);
|
101
|
-
// }
|
102
100
|
setCurrentValue(newValue);
|
103
101
|
|
104
102
|
if (onValueChange) {
|
105
|
-
onValueChange(newValue);
|
103
|
+
onValueChange(newValue, newData);
|
106
104
|
}
|
107
105
|
}
|
108
106
|
}
|
@@ -347,7 +345,7 @@
|
|
347
345
|
var curIndex = data.findIndex(function (item) {
|
348
346
|
return item.value === selectedValue;
|
349
347
|
});
|
350
|
-
setCurrentIndex(curIndex);
|
348
|
+
setCurrentIndex(Math.max(curIndex, 0));
|
351
349
|
|
352
350
|
if (curIndex >= 0) {
|
353
351
|
_scrollToIndexWithChange(curIndex);
|
@@ -25,7 +25,7 @@ export interface PickerViewRef {
|
|
25
25
|
* 获取第 n 列的值
|
26
26
|
* @en Get the value of the nth column
|
27
27
|
*/
|
28
|
-
getColumnValue: (index: number) => ValueType;
|
28
|
+
getColumnValue: (index: number) => ValueType | undefined;
|
29
29
|
/**
|
30
30
|
* 手动更新元素布局
|
31
31
|
* @en Manually update the element layout
|
package/umd/picker-view/index.js
CHANGED
@@ -78,7 +78,7 @@
|
|
78
78
|
var wrapperRef = (0, _react.useRef)(null);
|
79
79
|
var domRef = (0, _react.useRef)(null);
|
80
80
|
var barRef = (0, _react.useRef)(null);
|
81
|
-
var scrollValueRef = (0,
|
81
|
+
var scrollValueRef = (0, _helpers.useLatestRef)(scrollValue);
|
82
82
|
var pickerCellsRef = (0, _react.useRef)([]);
|
83
83
|
var cascaderRef = (0, _react.useRef)(null);
|
84
84
|
var innerData = (0, _react.useMemo)(function () {
|
@@ -111,20 +111,19 @@
|
|
111
111
|
|
112
112
|
return newData;
|
113
113
|
}, [data]);
|
114
|
-
(0, _react.useEffect)(function () {
|
115
|
-
scrollValueRef.current = scrollValue;
|
116
|
-
}, [scrollValue]);
|
117
114
|
|
118
115
|
var getAllColumnValues = function getAllColumnValues() {
|
119
|
-
return scrollValueRef.current;
|
116
|
+
return scrollValueRef.current || [];
|
120
117
|
};
|
121
118
|
|
122
119
|
function getColumnValue(index) {
|
120
|
+
var _scrollValueRef$curre;
|
121
|
+
|
123
122
|
if (index === void 0) {
|
124
123
|
index = 0;
|
125
124
|
}
|
126
125
|
|
127
|
-
return scrollValueRef.current[index];
|
126
|
+
return (_scrollValueRef$curre = scrollValueRef.current) == null ? void 0 : _scrollValueRef$curre[index];
|
128
127
|
}
|
129
128
|
|
130
129
|
function getCellMovingStatus() {
|
@@ -160,25 +159,17 @@
|
|
160
159
|
};
|
161
160
|
});
|
162
161
|
|
163
|
-
function
|
162
|
+
function _onValueChange(val, index, newData) {
|
164
163
|
setScrollValue(val);
|
165
164
|
|
166
165
|
if (onPickerChange) {
|
167
|
-
onPickerChange(val, index);
|
168
|
-
}
|
169
|
-
}
|
170
|
-
|
171
|
-
function _onValueChange(val, index) {
|
172
|
-
setScrollValue(val);
|
173
|
-
|
174
|
-
if (onPickerChange) {
|
175
|
-
onPickerChange(val, index);
|
166
|
+
onPickerChange(val, index, newData);
|
176
167
|
}
|
177
168
|
}
|
178
169
|
|
179
170
|
(0, _react.useEffect)(function () {
|
180
171
|
setScrollValue(value);
|
181
|
-
}, [value
|
172
|
+
}, [value]);
|
182
173
|
var updateWrapperHeight = (0, _react.useCallback)(function () {
|
183
174
|
if (wrapperRef && wrapperRef.current) {
|
184
175
|
setWrapperHeight(wrapperRef.current.offsetHeight);
|
@@ -222,7 +213,6 @@
|
|
222
213
|
data: data,
|
223
214
|
selectedValue: scrollValue,
|
224
215
|
onValueChange: _onValueChange,
|
225
|
-
onPickerChange: _onPickerChange,
|
226
216
|
clickable: clickable,
|
227
217
|
itemHeight: itemHeight,
|
228
218
|
wrapperHeight: wrapperHeight,
|
@@ -236,8 +226,7 @@
|
|
236
226
|
data: innerData,
|
237
227
|
itemHeight: itemHeight,
|
238
228
|
selectedValue: scrollValue,
|
239
|
-
onValueChange: _onValueChange
|
240
|
-
onPickerChange: _onPickerChange
|
229
|
+
onValueChange: _onValueChange
|
241
230
|
}, innerData.map(function (item, index) {
|
242
231
|
return /*#__PURE__*/_react.default.createElement(_pickerCell.default, {
|
243
232
|
key: index + "_picker_cell_normal",
|
@@ -52,12 +52,12 @@ export interface PickerViewProps {
|
|
52
52
|
* 值, 格式是[value1, value2, value3], 对应数据源的相应级层value
|
53
53
|
* @en Value, the format is [value1, value2, value3], corresponding to the corresponding level value of the data source
|
54
54
|
*/
|
55
|
-
value
|
55
|
+
value?: ValueType[];
|
56
56
|
/**
|
57
57
|
* 每列数据选择变化后的回调函数
|
58
58
|
* @en The callback function after each column data selection changes
|
59
59
|
*/
|
60
|
-
onPickerChange?: (value: ValueType[], index: number) => void;
|
60
|
+
onPickerChange?: (value: ValueType[], index: number, data: PickerData[]) => void;
|
61
61
|
/**
|
62
62
|
* 每列样式
|
63
63
|
* @en Stylesheet per column
|
@@ -88,29 +88,29 @@
|
|
88
88
|
return function (realTimeValue) {
|
89
89
|
setValueGroup(realTimeValue);
|
90
90
|
};
|
91
|
-
}
|
92
|
-
var index = Math.abs(valueGroup[0] - start) < Math.abs(valueGroup[1] - start) ? 0 : 1;
|
93
|
-
|
94
|
-
var handleValue = function handleValue(realTimeValue) {
|
95
|
-
setValueGroup(function (passValueGroup) {
|
96
|
-
if (typeof passValueGroup === 'number') {
|
97
|
-
return [passValueGroup, realTimeValue];
|
98
|
-
}
|
99
|
-
|
100
|
-
var newValueGroup = [].concat(passValueGroup);
|
101
|
-
newValueGroup[index] = realTimeValue;
|
102
|
-
return newValueGroup;
|
103
|
-
});
|
104
|
-
};
|
91
|
+
}
|
105
92
|
|
106
|
-
|
107
|
-
setCommonIsTouching(index);
|
108
|
-
handleValue(start);
|
109
|
-
setIsTouching(IsTouchingStatus.Moving);
|
110
|
-
}
|
93
|
+
var index = Math.abs(valueGroup[0] - start) < Math.abs(valueGroup[1] - start) ? 0 : 1;
|
111
94
|
|
112
|
-
|
95
|
+
var handleValue = function handleValue(realTimeValue) {
|
96
|
+
setValueGroup(function (passValueGroup) {
|
97
|
+
if (typeof passValueGroup === 'number') {
|
98
|
+
return [passValueGroup, realTimeValue];
|
99
|
+
}
|
100
|
+
|
101
|
+
var newValueGroup = [].concat(passValueGroup);
|
102
|
+
newValueGroup[index] = realTimeValue;
|
103
|
+
return newValueGroup;
|
104
|
+
});
|
105
|
+
};
|
106
|
+
|
107
|
+
if (isTouching) {
|
108
|
+
setCommonIsTouching(index);
|
109
|
+
handleValue(start);
|
110
|
+
setIsTouching(IsTouchingStatus.Moving);
|
113
111
|
}
|
112
|
+
|
113
|
+
return handleValue;
|
114
114
|
}, [touchStartPosition, getValueFromPosition]);
|
115
115
|
(0, _react.useEffect)(function () {
|
116
116
|
var _lineRef$current;
|
package/umd/sticky/index.js
CHANGED
@@ -99,8 +99,8 @@
|
|
99
99
|
var containerTop = containerRect.top,
|
100
100
|
containerBottom = containerRect.bottom,
|
101
101
|
containerHeight = containerRect.height;
|
102
|
-
var disFromTop = placeholderClientRect.top - containerTop;
|
103
|
-
var disFromBottom = placeholderClientRect.top + calculatedHeight - containerBottom;
|
102
|
+
var disFromTop = Math.round(placeholderClientRect.top - containerTop);
|
103
|
+
var disFromBottom = Math.round(placeholderClientRect.top + calculatedHeight - containerBottom);
|
104
104
|
var topFollowDifference = followBottom - followOffset - calculatedHeight - topOffset - containerTop;
|
105
105
|
var bottomFollowDifference = containerHeight - followTop - followOffset - calculatedHeight - bottomOffset;
|
106
106
|
setWasSticky(Boolean(isStickyRef.current));
|
package/umd/style.d.ts
CHANGED
@@ -27,6 +27,8 @@ import './grid/style';
|
|
27
27
|
import './image/style';
|
28
28
|
import './show-monitor/style';
|
29
29
|
import './image-preview/style';
|
30
|
+
import './index-bar/style';
|
31
|
+
import './keyboard/style';
|
30
32
|
import './load-more/style';
|
31
33
|
import './loading/style';
|
32
34
|
import './masking/style';
|
package/umd/style.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
(function (global, factory) {
|
2
2
|
if (typeof define === "function" && define.amd) {
|
3
|
-
define(["../style/public.less", "./button/style", "./action-sheet/style", "./avatar/style", "./badge/style", "./carousel/style", "./cell/style", "./checkbox/style", "./circle-progress/style", "./collapse/style", "./context-provider/style", "./count-down/style", "./date-picker/style", "./divider/style", "./dialog/style", "./dropdown/style", "./dropdown-menu/style", "./ellipsis/style", "./form/style", "./input/style", "./textarea/style", "./radio/style", "./image-picker/style", "./rate/style", "./slider/style", "./grid/style", "./image/style", "./show-monitor/style", "./image-preview/style", "./load-more/style", "./loading/style", "./masking/style", "./nav-bar/style", "./notice-bar/style", "./notify/style", "./pagination/style", "./picker/style", "./picker-view/style", "./popover/style", "./popup/style", "./popup-swiper/style", "./portal/style", "./progress/style", "./pull-refresh/style", "./search-bar/style", "./stepper/style", "./steps/style", "./sticky/style", "./swipe-action/style", "./swipe-load/style", "./switch/style", "./tab-bar/style", "./tabs/style", "./tag/style", "./toast/style", "./transition/style"], factory);
|
3
|
+
define(["../style/public.less", "./button/style", "./action-sheet/style", "./avatar/style", "./badge/style", "./carousel/style", "./cell/style", "./checkbox/style", "./circle-progress/style", "./collapse/style", "./context-provider/style", "./count-down/style", "./date-picker/style", "./divider/style", "./dialog/style", "./dropdown/style", "./dropdown-menu/style", "./ellipsis/style", "./form/style", "./input/style", "./textarea/style", "./radio/style", "./image-picker/style", "./rate/style", "./slider/style", "./grid/style", "./image/style", "./show-monitor/style", "./image-preview/style", "./index-bar/style", "./keyboard/style", "./load-more/style", "./loading/style", "./masking/style", "./nav-bar/style", "./notice-bar/style", "./notify/style", "./pagination/style", "./picker/style", "./picker-view/style", "./popover/style", "./popup/style", "./popup-swiper/style", "./portal/style", "./progress/style", "./pull-refresh/style", "./search-bar/style", "./stepper/style", "./steps/style", "./sticky/style", "./swipe-action/style", "./swipe-load/style", "./switch/style", "./tab-bar/style", "./tabs/style", "./tag/style", "./toast/style", "./transition/style"], factory);
|
4
4
|
} else if (typeof exports !== "undefined") {
|
5
|
-
factory(require("../style/public.less"), require("./button/style"), require("./action-sheet/style"), require("./avatar/style"), require("./badge/style"), require("./carousel/style"), require("./cell/style"), require("./checkbox/style"), require("./circle-progress/style"), require("./collapse/style"), require("./context-provider/style"), require("./count-down/style"), require("./date-picker/style"), require("./divider/style"), require("./dialog/style"), require("./dropdown/style"), require("./dropdown-menu/style"), require("./ellipsis/style"), require("./form/style"), require("./input/style"), require("./textarea/style"), require("./radio/style"), require("./image-picker/style"), require("./rate/style"), require("./slider/style"), require("./grid/style"), require("./image/style"), require("./show-monitor/style"), require("./image-preview/style"), require("./load-more/style"), require("./loading/style"), require("./masking/style"), require("./nav-bar/style"), require("./notice-bar/style"), require("./notify/style"), require("./pagination/style"), require("./picker/style"), require("./picker-view/style"), require("./popover/style"), require("./popup/style"), require("./popup-swiper/style"), require("./portal/style"), require("./progress/style"), require("./pull-refresh/style"), require("./search-bar/style"), require("./stepper/style"), require("./steps/style"), require("./sticky/style"), require("./swipe-action/style"), require("./swipe-load/style"), require("./switch/style"), require("./tab-bar/style"), require("./tabs/style"), require("./tag/style"), require("./toast/style"), require("./transition/style"));
|
5
|
+
factory(require("../style/public.less"), require("./button/style"), require("./action-sheet/style"), require("./avatar/style"), require("./badge/style"), require("./carousel/style"), require("./cell/style"), require("./checkbox/style"), require("./circle-progress/style"), require("./collapse/style"), require("./context-provider/style"), require("./count-down/style"), require("./date-picker/style"), require("./divider/style"), require("./dialog/style"), require("./dropdown/style"), require("./dropdown-menu/style"), require("./ellipsis/style"), require("./form/style"), require("./input/style"), require("./textarea/style"), require("./radio/style"), require("./image-picker/style"), require("./rate/style"), require("./slider/style"), require("./grid/style"), require("./image/style"), require("./show-monitor/style"), require("./image-preview/style"), require("./index-bar/style"), require("./keyboard/style"), require("./load-more/style"), require("./loading/style"), require("./masking/style"), require("./nav-bar/style"), require("./notice-bar/style"), require("./notify/style"), require("./pagination/style"), require("./picker/style"), require("./picker-view/style"), require("./popover/style"), require("./popup/style"), require("./popup-swiper/style"), require("./portal/style"), require("./progress/style"), require("./pull-refresh/style"), require("./search-bar/style"), require("./stepper/style"), require("./steps/style"), require("./sticky/style"), require("./swipe-action/style"), require("./swipe-load/style"), require("./switch/style"), require("./tab-bar/style"), require("./tabs/style"), require("./tag/style"), require("./toast/style"), require("./transition/style"));
|
6
6
|
} else {
|
7
7
|
var mod = {
|
8
8
|
exports: {}
|
9
9
|
};
|
10
|
-
factory(global._public, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style);
|
10
|
+
factory(global._public, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style, global.style);
|
11
11
|
global.style = mod.exports;
|
12
12
|
}
|
13
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_public, _style, _style2, _style3, _style4, _style5, _style6, _style7, _style8, _style9, _style10, _style11, _style12, _style13, _style14, _style15, _style16, _style17, _style18, _style19, _style20, _style21, _style22, _style23, _style24, _style25, _style26, _style27, _style28, _style29, _style30, _style31, _style32, _style33, _style34, _style35, _style36, _style37, _style38, _style39, _style40, _style41, _style42, _style43, _style44, _style45, _style46, _style47, _style48, _style49, _style50, _style51, _style52, _style53, _style54, _style55) {
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_public, _style, _style2, _style3, _style4, _style5, _style6, _style7, _style8, _style9, _style10, _style11, _style12, _style13, _style14, _style15, _style16, _style17, _style18, _style19, _style20, _style21, _style22, _style23, _style24, _style25, _style26, _style27, _style28, _style29, _style30, _style31, _style32, _style33, _style34, _style35, _style36, _style37, _style38, _style39, _style40, _style41, _style42, _style43, _style44, _style45, _style46, _style47, _style48, _style49, _style50, _style51, _style52, _style53, _style54, _style55, _style56, _style57) {
|
14
14
|
"use strict";
|
15
15
|
});
|