@arco-design/mobile-react 2.26.0 → 2.27.0
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 +18 -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 +276 -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 +1793 -483
- package/dist/index.min.js +4 -4
- 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 +254 -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
package/cjs/picker-view/index.js
CHANGED
@@ -82,7 +82,7 @@ var PickerView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
82
82
|
var wrapperRef = (0, _react.useRef)(null);
|
83
83
|
var domRef = (0, _react.useRef)(null);
|
84
84
|
var barRef = (0, _react.useRef)(null);
|
85
|
-
var scrollValueRef = (0,
|
85
|
+
var scrollValueRef = (0, _helpers.useLatestRef)(scrollValue);
|
86
86
|
var pickerCellsRef = (0, _react.useRef)([]);
|
87
87
|
var cascaderRef = (0, _react.useRef)(null);
|
88
88
|
var innerData = (0, _react.useMemo)(function () {
|
@@ -115,20 +115,19 @@ var PickerView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
115
115
|
|
116
116
|
return newData;
|
117
117
|
}, [data]);
|
118
|
-
(0, _react.useEffect)(function () {
|
119
|
-
scrollValueRef.current = scrollValue;
|
120
|
-
}, [scrollValue]);
|
121
118
|
|
122
119
|
var getAllColumnValues = function getAllColumnValues() {
|
123
|
-
return scrollValueRef.current;
|
120
|
+
return scrollValueRef.current || [];
|
124
121
|
};
|
125
122
|
|
126
123
|
function getColumnValue(index) {
|
124
|
+
var _scrollValueRef$curre;
|
125
|
+
|
127
126
|
if (index === void 0) {
|
128
127
|
index = 0;
|
129
128
|
}
|
130
129
|
|
131
|
-
return scrollValueRef.current[index];
|
130
|
+
return (_scrollValueRef$curre = scrollValueRef.current) == null ? void 0 : _scrollValueRef$curre[index];
|
132
131
|
}
|
133
132
|
|
134
133
|
function getCellMovingStatus() {
|
@@ -164,25 +163,17 @@ var PickerView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
164
163
|
};
|
165
164
|
});
|
166
165
|
|
167
|
-
function
|
166
|
+
function _onValueChange(val, index, newData) {
|
168
167
|
setScrollValue(val);
|
169
168
|
|
170
169
|
if (onPickerChange) {
|
171
|
-
onPickerChange(val, index);
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
function _onValueChange(val, index) {
|
176
|
-
setScrollValue(val);
|
177
|
-
|
178
|
-
if (onPickerChange) {
|
179
|
-
onPickerChange(val, index);
|
170
|
+
onPickerChange(val, index, newData);
|
180
171
|
}
|
181
172
|
}
|
182
173
|
|
183
174
|
(0, _react.useEffect)(function () {
|
184
175
|
setScrollValue(value);
|
185
|
-
}, [value
|
176
|
+
}, [value]);
|
186
177
|
var updateWrapperHeight = (0, _react.useCallback)(function () {
|
187
178
|
if (wrapperRef && wrapperRef.current) {
|
188
179
|
setWrapperHeight(wrapperRef.current.offsetHeight);
|
@@ -226,7 +217,6 @@ var PickerView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
226
217
|
data: data,
|
227
218
|
selectedValue: scrollValue,
|
228
219
|
onValueChange: _onValueChange,
|
229
|
-
onPickerChange: _onPickerChange,
|
230
220
|
clickable: clickable,
|
231
221
|
itemHeight: itemHeight,
|
232
222
|
wrapperHeight: wrapperHeight,
|
@@ -240,8 +230,7 @@ var PickerView = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
240
230
|
data: innerData,
|
241
231
|
itemHeight: itemHeight,
|
242
232
|
selectedValue: scrollValue,
|
243
|
-
onValueChange: _onValueChange
|
244
|
-
onPickerChange: _onPickerChange
|
233
|
+
onValueChange: _onValueChange
|
245
234
|
}, innerData.map(function (item, index) {
|
246
235
|
return /*#__PURE__*/_react.default.createElement(_pickerCell.default, {
|
247
236
|
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
|
@@ -80,29 +80,29 @@ var useSliderEvents = function useSliderEvents(_ref) {
|
|
80
80
|
return function (realTimeValue) {
|
81
81
|
setValueGroup(realTimeValue);
|
82
82
|
};
|
83
|
-
}
|
84
|
-
var index = Math.abs(valueGroup[0] - start) < Math.abs(valueGroup[1] - start) ? 0 : 1;
|
85
|
-
|
86
|
-
var handleValue = function handleValue(realTimeValue) {
|
87
|
-
setValueGroup(function (passValueGroup) {
|
88
|
-
if (typeof passValueGroup === 'number') {
|
89
|
-
return [passValueGroup, realTimeValue];
|
90
|
-
}
|
91
|
-
|
92
|
-
var newValueGroup = [].concat(passValueGroup);
|
93
|
-
newValueGroup[index] = realTimeValue;
|
94
|
-
return newValueGroup;
|
95
|
-
});
|
96
|
-
};
|
83
|
+
}
|
97
84
|
|
98
|
-
|
99
|
-
setCommonIsTouching(index);
|
100
|
-
handleValue(start);
|
101
|
-
setIsTouching(IsTouchingStatus.Moving);
|
102
|
-
}
|
85
|
+
var index = Math.abs(valueGroup[0] - start) < Math.abs(valueGroup[1] - start) ? 0 : 1;
|
103
86
|
|
104
|
-
|
87
|
+
var handleValue = function handleValue(realTimeValue) {
|
88
|
+
setValueGroup(function (passValueGroup) {
|
89
|
+
if (typeof passValueGroup === 'number') {
|
90
|
+
return [passValueGroup, realTimeValue];
|
91
|
+
}
|
92
|
+
|
93
|
+
var newValueGroup = [].concat(passValueGroup);
|
94
|
+
newValueGroup[index] = realTimeValue;
|
95
|
+
return newValueGroup;
|
96
|
+
});
|
97
|
+
};
|
98
|
+
|
99
|
+
if (isTouching) {
|
100
|
+
setCommonIsTouching(index);
|
101
|
+
handleValue(start);
|
102
|
+
setIsTouching(IsTouchingStatus.Moving);
|
105
103
|
}
|
104
|
+
|
105
|
+
return handleValue;
|
106
106
|
}, [touchStartPosition, getValueFromPosition]);
|
107
107
|
(0, _react.useEffect)(function () {
|
108
108
|
var _lineRef$current;
|
package/cjs/sticky/index.js
CHANGED
@@ -95,8 +95,8 @@ var Sticky = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
95
95
|
var containerTop = containerRect.top,
|
96
96
|
containerBottom = containerRect.bottom,
|
97
97
|
containerHeight = containerRect.height;
|
98
|
-
var disFromTop = placeholderClientRect.top - containerTop;
|
99
|
-
var disFromBottom = placeholderClientRect.top + calculatedHeight - containerBottom;
|
98
|
+
var disFromTop = Math.round(placeholderClientRect.top - containerTop);
|
99
|
+
var disFromBottom = Math.round(placeholderClientRect.top + calculatedHeight - containerBottom);
|
100
100
|
var topFollowDifference = followBottom - followOffset - calculatedHeight - topOffset - containerTop;
|
101
101
|
var bottomFollowDifference = containerHeight - followTop - followOffset - calculatedHeight - bottomOffset;
|
102
102
|
setWasSticky(Boolean(isStickyRef.current));
|
package/cjs/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';
|