antd-mobile 5.18.0 → 5.21.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/2x/bundle/antd-mobile.cjs.js +47 -18976
- package/2x/bundle/antd-mobile.compatible.umd.js +25911 -0
- package/2x/bundle/antd-mobile.es.js +16358 -16685
- package/2x/bundle/antd-mobile.umd.js +64 -0
- package/2x/bundle/style.css +359 -273
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/cjs/components/button/button.js +1 -1
- package/2x/cjs/components/calendar/calendar.d.ts +1 -1
- package/2x/cjs/components/cascader/cascader.d.ts +2 -0
- package/2x/cjs/components/cascader/index.d.ts +1 -0
- package/2x/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/cjs/components/cascader-view/cascader-view.js +2 -1
- package/2x/cjs/components/dialog/show.d.ts +1 -1
- package/2x/cjs/components/form/context.d.ts +1 -1
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +3 -0
- package/2x/cjs/components/image/test/image.test.js +57 -8
- package/2x/cjs/components/image-viewer/slide.js +75 -56
- package/2x/cjs/components/input/input.js +9 -2
- package/2x/cjs/components/modal/show.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/cjs/components/passcode-input/index.d.ts +1 -1
- package/2x/cjs/components/passcode-input/passcode-input.css +12 -12
- package/2x/cjs/components/passcode-input/passcode-input.js +16 -8
- package/2x/cjs/components/picker-view/wheel.js +2 -0
- package/2x/cjs/components/rate/rate.css +4 -0
- package/2x/cjs/components/rate/rate.js +42 -13
- package/2x/cjs/components/result/result.d.ts +1 -1
- package/2x/cjs/components/result/result.js +7 -1
- package/2x/cjs/components/result-page/index.d.ts +7 -0
- package/2x/cjs/components/result-page/index.js +20 -0
- package/2x/cjs/components/result-page/result-page-card.d.ts +6 -0
- package/2x/cjs/components/result-page/result-page-card.js +24 -0
- package/2x/cjs/components/result-page/result-page.css +130 -0
- package/2x/cjs/components/result-page/result-page.d.ts +23 -0
- package/2x/cjs/components/result-page/result-page.js +108 -0
- package/2x/cjs/components/search-bar/search-bar.js +12 -2
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/cjs/components/swipe-action/swipe-action.js +34 -6
- package/2x/cjs/components/swiper/swiper.js +15 -1
- package/2x/cjs/index.d.ts +1 -0
- package/2x/cjs/index.js +8 -0
- package/2x/cjs/locales/base.d.ts +9 -0
- package/2x/cjs/locales/base.js +9 -0
- package/2x/cjs/locales/en-US.d.ts +9 -0
- package/2x/cjs/locales/es-ES.d.ts +9 -0
- package/2x/cjs/locales/fa-IR.d.ts +9 -0
- package/2x/cjs/locales/fr-FR.d.ts +9 -0
- package/2x/cjs/locales/id-ID.d.ts +9 -0
- package/2x/cjs/locales/id-ID.js +13 -0
- package/2x/cjs/locales/kk-KZ.d.ts +9 -0
- package/2x/cjs/locales/ko-KR.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.js +9 -0
- package/2x/cjs/locales/zh-HK.d.ts +9 -0
- package/2x/cjs/locales/zh-TW.d.ts +9 -0
- package/2x/cjs/utils/matrix.d.ts +10 -0
- package/2x/cjs/utils/matrix.js +60 -0
- package/2x/cjs/utils/use-resize-effect.js +3 -1
- package/2x/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/es/components/button/button.js +1 -1
- package/2x/es/components/calendar/calendar.d.ts +1 -1
- package/2x/es/components/cascader/cascader.d.ts +2 -0
- package/2x/es/components/cascader/index.d.ts +1 -0
- package/2x/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/es/components/cascader-view/cascader-view.js +2 -1
- package/2x/es/components/dialog/show.d.ts +1 -1
- package/2x/es/components/form/context.d.ts +1 -1
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +3 -0
- package/2x/es/components/image/test/image.test.js +54 -8
- package/2x/es/components/image-viewer/slide.js +73 -56
- package/2x/es/components/input/input.js +8 -2
- package/2x/es/components/modal/show.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/es/components/passcode-input/index.d.ts +1 -1
- package/2x/es/components/passcode-input/passcode-input.css +12 -12
- package/2x/es/components/passcode-input/passcode-input.js +15 -8
- package/2x/es/components/picker-view/wheel.js +2 -0
- package/2x/es/components/rate/rate.css +4 -0
- package/2x/es/components/rate/rate.js +36 -13
- package/2x/es/components/result/result.d.ts +1 -1
- package/2x/es/components/result/result.js +6 -1
- package/2x/es/components/result-page/index.d.ts +7 -0
- package/2x/es/components/result-page/index.js +7 -0
- package/2x/es/components/result-page/result-page-card.d.ts +6 -0
- package/2x/es/components/result-page/result-page-card.js +9 -0
- package/2x/es/components/result-page/result-page.css +130 -0
- package/2x/es/components/result-page/result-page.d.ts +23 -0
- package/2x/es/components/result-page/result-page.js +83 -0
- package/2x/es/components/search-bar/search-bar.js +12 -2
- package/2x/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/es/components/swipe-action/swipe-action.js +34 -6
- package/2x/es/components/swiper/swiper.js +15 -1
- package/2x/es/index.d.ts +1 -0
- package/2x/es/index.js +1 -0
- package/2x/es/locales/base.d.ts +9 -0
- package/2x/es/locales/base.js +9 -0
- package/2x/es/locales/en-US.d.ts +9 -0
- package/2x/es/locales/es-ES.d.ts +9 -0
- package/2x/es/locales/fa-IR.d.ts +9 -0
- package/2x/es/locales/fr-FR.d.ts +9 -0
- package/2x/es/locales/id-ID.d.ts +9 -0
- package/2x/es/locales/id-ID.js +13 -0
- package/2x/es/locales/kk-KZ.d.ts +9 -0
- package/2x/es/locales/ko-KR.d.ts +9 -0
- package/2x/es/locales/zh-CN.d.ts +9 -0
- package/2x/es/locales/zh-CN.js +9 -0
- package/2x/es/locales/zh-HK.d.ts +9 -0
- package/2x/es/locales/zh-TW.d.ts +9 -0
- package/2x/es/utils/matrix.d.ts +10 -0
- package/2x/es/utils/matrix.js +27 -0
- package/2x/es/utils/use-resize-effect.js +3 -1
- package/2x/package.json +6 -6
- package/2x/umd/antd-mobile.js +25911 -2
- package/bundle/antd-mobile.cjs.js +47 -18976
- package/bundle/antd-mobile.compatible.umd.js +25911 -0
- package/bundle/antd-mobile.es.js +16358 -16685
- package/bundle/antd-mobile.umd.js +64 -0
- package/bundle/style.css +1 -4088
- package/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/cjs/components/button/button.js +1 -1
- package/cjs/components/calendar/calendar.d.ts +1 -1
- package/cjs/components/cascader/cascader.d.ts +2 -0
- package/cjs/components/cascader/index.d.ts +1 -0
- package/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/cjs/components/cascader-view/cascader-view.js +2 -1
- package/cjs/components/dialog/show.d.ts +1 -1
- package/cjs/components/form/context.d.ts +1 -1
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +3 -0
- package/cjs/components/image/test/image.test.js +57 -8
- package/cjs/components/image-viewer/slide.js +75 -56
- package/cjs/components/input/input.js +9 -2
- package/cjs/components/modal/show.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.css +11 -14
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/cjs/components/passcode-input/index.d.ts +1 -1
- package/cjs/components/passcode-input/passcode-input.css +12 -12
- package/cjs/components/passcode-input/passcode-input.js +16 -8
- package/cjs/components/picker-view/wheel.js +2 -0
- package/cjs/components/rate/rate.css +4 -0
- package/cjs/components/rate/rate.js +42 -13
- package/cjs/components/result/result.d.ts +1 -1
- package/cjs/components/result/result.js +7 -1
- package/cjs/components/result-page/index.d.ts +7 -0
- package/cjs/components/result-page/index.js +20 -0
- package/cjs/components/result-page/result-page-card.d.ts +6 -0
- package/cjs/components/result-page/result-page-card.js +24 -0
- package/cjs/components/result-page/result-page.css +113 -0
- package/cjs/components/result-page/result-page.d.ts +23 -0
- package/cjs/components/result-page/result-page.js +108 -0
- package/cjs/components/search-bar/search-bar.js +12 -2
- package/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/cjs/components/swipe-action/swipe-action.js +34 -6
- package/cjs/components/swiper/swiper.js +15 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -0
- package/cjs/locales/base.d.ts +9 -0
- package/cjs/locales/base.js +9 -0
- package/cjs/locales/en-US.d.ts +9 -0
- package/cjs/locales/es-ES.d.ts +9 -0
- package/cjs/locales/fa-IR.d.ts +9 -0
- package/cjs/locales/fr-FR.d.ts +9 -0
- package/cjs/locales/id-ID.d.ts +9 -0
- package/cjs/locales/id-ID.js +13 -0
- package/cjs/locales/kk-KZ.d.ts +9 -0
- package/cjs/locales/ko-KR.d.ts +9 -0
- package/cjs/locales/zh-CN.d.ts +9 -0
- package/cjs/locales/zh-CN.js +9 -0
- package/cjs/locales/zh-HK.d.ts +9 -0
- package/cjs/locales/zh-TW.d.ts +9 -0
- package/cjs/utils/matrix.d.ts +10 -0
- package/cjs/utils/matrix.js +60 -0
- package/cjs/utils/use-resize-effect.js +3 -1
- package/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/es/components/button/button.js +1 -1
- package/es/components/calendar/calendar.d.ts +1 -1
- package/es/components/cascader/cascader.d.ts +2 -0
- package/es/components/cascader/index.d.ts +1 -0
- package/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/es/components/cascader-view/cascader-view.js +2 -1
- package/es/components/dialog/show.d.ts +1 -1
- package/es/components/form/context.d.ts +1 -1
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +3 -0
- package/es/components/image/test/image.test.js +54 -8
- package/es/components/image-viewer/slide.js +73 -56
- package/es/components/input/input.js +8 -2
- package/es/components/modal/show.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.css +11 -14
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.js +19 -17
- package/es/components/passcode-input/index.d.ts +1 -1
- package/es/components/passcode-input/passcode-input.css +12 -12
- package/es/components/passcode-input/passcode-input.js +15 -8
- package/es/components/picker-view/wheel.js +2 -0
- package/es/components/rate/rate.css +4 -0
- package/es/components/rate/rate.js +36 -13
- package/es/components/result/result.d.ts +1 -1
- package/es/components/result/result.js +6 -1
- package/es/components/result-page/index.d.ts +7 -0
- package/es/components/result-page/index.js +7 -0
- package/es/components/result-page/result-page-card.d.ts +6 -0
- package/es/components/result-page/result-page-card.js +9 -0
- package/es/components/result-page/result-page.css +113 -0
- package/es/components/result-page/result-page.d.ts +23 -0
- package/es/components/result-page/result-page.js +83 -0
- package/es/components/search-bar/search-bar.js +12 -2
- package/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/es/components/swipe-action/swipe-action.js +34 -6
- package/es/components/swiper/swiper.js +15 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/base.d.ts +9 -0
- package/es/locales/base.js +9 -0
- package/es/locales/en-US.d.ts +9 -0
- package/es/locales/es-ES.d.ts +9 -0
- package/es/locales/fa-IR.d.ts +9 -0
- package/es/locales/fr-FR.d.ts +9 -0
- package/es/locales/id-ID.d.ts +9 -0
- package/es/locales/id-ID.js +13 -0
- package/es/locales/kk-KZ.d.ts +9 -0
- package/es/locales/ko-KR.d.ts +9 -0
- package/es/locales/zh-CN.d.ts +9 -0
- package/es/locales/zh-CN.js +9 -0
- package/es/locales/zh-HK.d.ts +9 -0
- package/es/locales/zh-TW.d.ts +9 -0
- package/es/utils/matrix.d.ts +10 -0
- package/es/utils/matrix.js +27 -0
- package/es/utils/use-resize-effect.js +3 -1
- package/package.json +6 -6
- package/umd/antd-mobile.js +1 -1
- package/2x/umd/antd-mobile.js.LICENSE.txt +0 -35
|
@@ -65,8 +65,26 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
65
65
|
}
|
|
66
66
|
}), []);
|
|
67
67
|
const draggingRef = (0, _react.useRef)(false);
|
|
68
|
+
const dragCancelRef = (0, _react.useRef)(null);
|
|
69
|
+
|
|
70
|
+
function forceCancelDrag() {
|
|
71
|
+
var _a;
|
|
72
|
+
|
|
73
|
+
(_a = dragCancelRef.current) === null || _a === void 0 ? void 0 : _a.call(dragCancelRef);
|
|
74
|
+
draggingRef.current = false;
|
|
75
|
+
}
|
|
76
|
+
|
|
68
77
|
const bind = (0, _react2.useDrag)(state => {
|
|
69
|
-
|
|
78
|
+
var _a;
|
|
79
|
+
|
|
80
|
+
dragCancelRef.current = state.cancel;
|
|
81
|
+
if (!state.intentional) return;
|
|
82
|
+
|
|
83
|
+
if (state.down) {
|
|
84
|
+
draggingRef.current = true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!draggingRef.current) return;
|
|
70
88
|
const [offsetX] = state.offset;
|
|
71
89
|
|
|
72
90
|
if (state.last) {
|
|
@@ -82,9 +100,15 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
82
100
|
position = 0;
|
|
83
101
|
}
|
|
84
102
|
|
|
103
|
+
const targetX = (0, _nearest.nearest)([-rightWidth, 0, leftWidth], position);
|
|
85
104
|
api.start({
|
|
86
|
-
x:
|
|
105
|
+
x: targetX
|
|
87
106
|
});
|
|
107
|
+
|
|
108
|
+
if (targetX !== 0) {
|
|
109
|
+
(_a = p.onActionsReveal) === null || _a === void 0 ? void 0 : _a.call(p, targetX > 0 ? 'left' : 'right');
|
|
110
|
+
}
|
|
111
|
+
|
|
88
112
|
window.setTimeout(() => {
|
|
89
113
|
draggingRef.current = false;
|
|
90
114
|
});
|
|
@@ -109,17 +133,21 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
109
133
|
preventScroll: true,
|
|
110
134
|
pointer: {
|
|
111
135
|
touch: true
|
|
112
|
-
}
|
|
136
|
+
},
|
|
137
|
+
triggerAllEvents: true
|
|
113
138
|
});
|
|
114
139
|
|
|
115
140
|
function close() {
|
|
116
141
|
api.start({
|
|
117
142
|
x: 0
|
|
118
143
|
});
|
|
144
|
+
forceCancelDrag();
|
|
119
145
|
}
|
|
120
146
|
|
|
121
147
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
122
148
|
show: (side = 'right') => {
|
|
149
|
+
var _a;
|
|
150
|
+
|
|
123
151
|
if (side === 'right') {
|
|
124
152
|
api.start({
|
|
125
153
|
x: -getRightWidth()
|
|
@@ -129,6 +157,8 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
129
157
|
x: getLeftWidth()
|
|
130
158
|
});
|
|
131
159
|
}
|
|
160
|
+
|
|
161
|
+
(_a = p.onActionsReveal) === null || _a === void 0 ? void 0 : _a.call(p, side);
|
|
132
162
|
},
|
|
133
163
|
close
|
|
134
164
|
}));
|
|
@@ -200,9 +230,7 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
200
230
|
if (x.goal !== 0) {
|
|
201
231
|
e.preventDefault();
|
|
202
232
|
e.stopPropagation();
|
|
203
|
-
|
|
204
|
-
x: 0
|
|
205
|
-
});
|
|
233
|
+
close();
|
|
206
234
|
}
|
|
207
235
|
}
|
|
208
236
|
}, _react.default.createElement(_web.animated.div, {
|
|
@@ -141,7 +141,18 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
}), [count]);
|
|
144
|
+
const dragCancelRef = (0, _react.useRef)(null);
|
|
145
|
+
|
|
146
|
+
function forceCancelDrag() {
|
|
147
|
+
var _a;
|
|
148
|
+
|
|
149
|
+
(_a = dragCancelRef.current) === null || _a === void 0 ? void 0 : _a.call(dragCancelRef);
|
|
150
|
+
draggingRef.current = false;
|
|
151
|
+
}
|
|
152
|
+
|
|
144
153
|
const bind = (0, _react2.useDrag)(state => {
|
|
154
|
+
dragCancelRef.current = state.cancel;
|
|
155
|
+
if (!state.intentional) return;
|
|
145
156
|
const slidePixels = getSlidePixels();
|
|
146
157
|
if (!slidePixels) return;
|
|
147
158
|
const paramIndex = isVertical ? 1 : 0;
|
|
@@ -170,6 +181,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
170
181
|
const slidePixels = getSlidePixels();
|
|
171
182
|
return [position.get() / 100 * slidePixels, position.get() / 100 * slidePixels];
|
|
172
183
|
},
|
|
184
|
+
triggerAllEvents: true,
|
|
173
185
|
bounds: () => {
|
|
174
186
|
if (loop) return {};
|
|
175
187
|
const slidePixels = getSlidePixels();
|
|
@@ -233,7 +245,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
233
245
|
return () => {
|
|
234
246
|
window.clearInterval(interval);
|
|
235
247
|
};
|
|
236
|
-
}, [autoplay, autoplayInterval, dragging]);
|
|
248
|
+
}, [autoplay, autoplayInterval, dragging, count]);
|
|
237
249
|
|
|
238
250
|
function renderTrackInner() {
|
|
239
251
|
if (loop) {
|
|
@@ -284,6 +296,8 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
284
296
|
if (draggingRef.current) {
|
|
285
297
|
e.stopPropagation();
|
|
286
298
|
}
|
|
299
|
+
|
|
300
|
+
forceCancelDrag();
|
|
287
301
|
}
|
|
288
302
|
}, props.allowTouchMove ? bind() : {}), renderTrackInner()), props.indicator === undefined ? _react.default.createElement("div", {
|
|
289
303
|
className: `${classPrefix}-indicator`
|
package/2x/cjs/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export { default as PullToRefresh } from './components/pull-to-refresh';
|
|
|
56
56
|
export { default as Radio } from './components/radio';
|
|
57
57
|
export { default as Rate } from './components/rate';
|
|
58
58
|
export { default as Result } from './components/result';
|
|
59
|
+
export { default as ResultPage } from './components/result-page';
|
|
59
60
|
export { default as SafeArea } from './components/safe-area';
|
|
60
61
|
export { default as ScrollMask } from './components/scroll-mask';
|
|
61
62
|
export { default as SearchBar } from './components/search-bar';
|
package/2x/cjs/index.js
CHANGED
|
@@ -339,6 +339,12 @@ Object.defineProperty(exports, "Result", {
|
|
|
339
339
|
return _result.default;
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
|
+
Object.defineProperty(exports, "ResultPage", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function () {
|
|
345
|
+
return _resultPage.default;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
342
348
|
Object.defineProperty(exports, "SafeArea", {
|
|
343
349
|
enumerable: true,
|
|
344
350
|
get: function () {
|
|
@@ -610,6 +616,8 @@ var _rate = _interopRequireDefault(require("./components/rate"));
|
|
|
610
616
|
|
|
611
617
|
var _result = _interopRequireDefault(require("./components/result"));
|
|
612
618
|
|
|
619
|
+
var _resultPage = _interopRequireDefault(require("./components/result-page"));
|
|
620
|
+
|
|
613
621
|
var _safeArea = _interopRequireDefault(require("./components/safe-area"));
|
|
614
622
|
|
|
615
623
|
var _scrollMask = _interopRequireDefault(require("./components/scroll-mask"));
|
package/2x/cjs/locales/base.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ export declare const base: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/cjs/locales/base.js
CHANGED
|
@@ -100,17 +100,26 @@ const base = {
|
|
|
100
100
|
failedToLoad: 'Failed to load',
|
|
101
101
|
retry: 'Retry'
|
|
102
102
|
},
|
|
103
|
+
Input: {
|
|
104
|
+
clear: 'clear'
|
|
105
|
+
},
|
|
103
106
|
Mask: {
|
|
104
107
|
name: 'Mask'
|
|
105
108
|
},
|
|
106
109
|
Modal: {
|
|
107
110
|
ok: 'OK'
|
|
108
111
|
},
|
|
112
|
+
PasscodeInput: {
|
|
113
|
+
name: 'Passcode Input'
|
|
114
|
+
},
|
|
109
115
|
PullToRefresh: {
|
|
110
116
|
pulling: 'Scroll down to refresh',
|
|
111
117
|
canRelease: 'Release to refresh immediately',
|
|
112
118
|
complete: 'Refresh successful'
|
|
113
119
|
},
|
|
120
|
+
SearchBar: {
|
|
121
|
+
name: 'Search Bar'
|
|
122
|
+
},
|
|
114
123
|
Slider: {
|
|
115
124
|
name: 'Slider'
|
|
116
125
|
},
|
|
@@ -93,17 +93,26 @@ declare const enUS: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const esES: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const faIR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const frFR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const idID: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/cjs/locales/id-ID.js
CHANGED
|
@@ -115,6 +115,19 @@ const idID = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
115
115
|
pulling: 'Tarik ke bawah untuk menyegarkan',
|
|
116
116
|
canRelease: 'Lepaskan untuk menyegarkan segera',
|
|
117
117
|
complete: 'Segarkan berhasil'
|
|
118
|
+
},
|
|
119
|
+
SearchBar: {
|
|
120
|
+
name: 'Bilah Pencarian'
|
|
121
|
+
},
|
|
122
|
+
Slider: {
|
|
123
|
+
name: 'Penggeser'
|
|
124
|
+
},
|
|
125
|
+
Stepper: {
|
|
126
|
+
decrease: 'mengurangi',
|
|
127
|
+
increase: 'meningkat'
|
|
128
|
+
},
|
|
129
|
+
Switch: {
|
|
130
|
+
name: 'Mengalihkan'
|
|
118
131
|
}
|
|
119
132
|
});
|
|
120
133
|
var _default = idID;
|
|
@@ -93,17 +93,26 @@ declare const kkKZ: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const koKR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const zhCN: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/cjs/locales/zh-CN.js
CHANGED
|
@@ -105,17 +105,26 @@ const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
105
105
|
failedToLoad: '加载失败',
|
|
106
106
|
retry: '重新加载'
|
|
107
107
|
},
|
|
108
|
+
Input: {
|
|
109
|
+
clear: '清除'
|
|
110
|
+
},
|
|
108
111
|
Mask: {
|
|
109
112
|
name: '遮罩层'
|
|
110
113
|
},
|
|
111
114
|
Modal: {
|
|
112
115
|
ok: '我知道了'
|
|
113
116
|
},
|
|
117
|
+
PasscodeInput: {
|
|
118
|
+
name: '密码输入框'
|
|
119
|
+
},
|
|
114
120
|
PullToRefresh: {
|
|
115
121
|
pulling: '下拉刷新',
|
|
116
122
|
canRelease: '释放立即刷新',
|
|
117
123
|
complete: '刷新成功'
|
|
118
124
|
},
|
|
125
|
+
SearchBar: {
|
|
126
|
+
name: '搜索框'
|
|
127
|
+
},
|
|
119
128
|
Slider: {
|
|
120
129
|
name: '滑动输入条'
|
|
121
130
|
},
|
|
@@ -93,17 +93,26 @@ declare const zhHK: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const zhTW: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type Matrix = readonly [number, number, number, number, number, number];
|
|
2
|
+
export declare const create: () => Matrix;
|
|
3
|
+
export declare const getTranslateX: (m: Matrix) => number;
|
|
4
|
+
export declare const getTranslateY: (m: Matrix) => number;
|
|
5
|
+
export declare const getScaleX: (m: Matrix) => number;
|
|
6
|
+
export declare const getScaleY: (m: Matrix) => number;
|
|
7
|
+
export declare const translate: (m: Matrix, x: number, y: number) => Matrix;
|
|
8
|
+
export declare const scale: (m: Matrix, scaleX: number, scaleY?: number) => Matrix;
|
|
9
|
+
export declare const apply: (m: Matrix, [ox, oy]: [number, number]) => [number, number];
|
|
10
|
+
export declare const multiply: (m1: Matrix, m2: Matrix) => Matrix;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.translate = exports.scale = exports.multiply = exports.getTranslateY = exports.getTranslateX = exports.getScaleY = exports.getScaleX = exports.create = exports.apply = void 0;
|
|
7
|
+
|
|
8
|
+
const create = () => {
|
|
9
|
+
return [1, 0, 0, 1, 0, 0];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.create = create;
|
|
13
|
+
|
|
14
|
+
const getTranslateX = m => {
|
|
15
|
+
return m[4];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.getTranslateX = getTranslateX;
|
|
19
|
+
|
|
20
|
+
const getTranslateY = m => {
|
|
21
|
+
return m[5];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.getTranslateY = getTranslateY;
|
|
25
|
+
|
|
26
|
+
const getScaleX = m => {
|
|
27
|
+
return m[0];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.getScaleX = getScaleX;
|
|
31
|
+
|
|
32
|
+
const getScaleY = m => {
|
|
33
|
+
return m[3];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.getScaleY = getScaleY;
|
|
37
|
+
|
|
38
|
+
const translate = (m, x, y) => {
|
|
39
|
+
return multiply([1, 0, 0, 1, x, y], m);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.translate = translate;
|
|
43
|
+
|
|
44
|
+
const scale = (m, scaleX, scaleY = scaleX) => {
|
|
45
|
+
return multiply([scaleX, 0, 0, scaleY, 0, 0], m);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.scale = scale;
|
|
49
|
+
|
|
50
|
+
const apply = (m, [ox, oy]) => {
|
|
51
|
+
return [m[0] * ox + m[2] * oy + m[4], m[1] * ox + m[3] * oy + m[5]];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.apply = apply;
|
|
55
|
+
|
|
56
|
+
const multiply = (m1, m2) => {
|
|
57
|
+
return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.multiply = multiply;
|
|
@@ -14,11 +14,13 @@ function useResizeEffect(effect, targetRef) {
|
|
|
14
14
|
if (!target) return;
|
|
15
15
|
|
|
16
16
|
if (window.ResizeObserver) {
|
|
17
|
+
let animationFrame;
|
|
17
18
|
const observer = new ResizeObserver(() => {
|
|
18
|
-
fn(target);
|
|
19
|
+
animationFrame = window.requestAnimationFrame(() => fn(target));
|
|
19
20
|
});
|
|
20
21
|
observer.observe(target);
|
|
21
22
|
return () => {
|
|
23
|
+
window.cancelAnimationFrame(animationFrame);
|
|
22
24
|
observer.disconnect();
|
|
23
25
|
};
|
|
24
26
|
} else {
|
|
@@ -27,4 +27,4 @@ export declare const ActionSheet: FC<ActionSheetProps>;
|
|
|
27
27
|
export declare type ActionSheetShowHandler = {
|
|
28
28
|
close: () => void;
|
|
29
29
|
};
|
|
30
|
-
export declare function showActionSheet(props: Omit<ActionSheetProps, 'visible'>): ActionSheetShowHandler;
|
|
30
|
+
export declare function showActionSheet(props: Omit<ActionSheetProps, 'visible' | 'destroyOnClose' | 'forceRender'>): ActionSheetShowHandler;
|
|
@@ -68,5 +68,5 @@ export const Button = forwardRef((p, ref) => {
|
|
|
68
68
|
onTouchEnd: props.onTouchEnd
|
|
69
69
|
}, loading ? React.createElement("div", {
|
|
70
70
|
className: `${classPrefix}-loading-wrapper`
|
|
71
|
-
}, props.loadingIcon, props.loadingText) : props.children));
|
|
71
|
+
}, props.loadingIcon, props.loadingText) : React.createElement("span", null, props.children)));
|
|
72
72
|
});
|
|
@@ -15,7 +15,7 @@ export declare type CalendarProps = {
|
|
|
15
15
|
nextYearButton?: React.ReactNode;
|
|
16
16
|
onPageChange?: (year: number, month: number) => void;
|
|
17
17
|
weekStartsOn?: 'Monday' | 'Sunday';
|
|
18
|
-
renderLabel?: (date: Date) =>
|
|
18
|
+
renderLabel?: (date: Date) => React.ReactNode;
|
|
19
19
|
allowClear?: boolean;
|
|
20
20
|
max?: Date;
|
|
21
21
|
min?: Date;
|
|
@@ -23,6 +23,7 @@ export declare type CascaderProps = {
|
|
|
23
23
|
cancelText?: ReactNode;
|
|
24
24
|
children?: (items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode;
|
|
25
25
|
onTabsChange?: (index: number) => void;
|
|
26
|
+
activeIcon?: ReactNode;
|
|
26
27
|
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'destroyOnClose' | 'forceRender'> & NativeProps;
|
|
27
28
|
export declare const Cascader: React.ForwardRefExoticComponent<{
|
|
28
29
|
options: CascaderOption[];
|
|
@@ -39,6 +40,7 @@ export declare const Cascader: React.ForwardRefExoticComponent<{
|
|
|
39
40
|
cancelText?: ReactNode;
|
|
40
41
|
children?: ((items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode) | undefined;
|
|
41
42
|
onTabsChange?: ((index: number) => void) | undefined;
|
|
43
|
+
activeIcon?: ReactNode;
|
|
42
44
|
} & Pick<PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
43
45
|
className?: string | undefined;
|
|
44
46
|
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
@@ -18,6 +18,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
18
18
|
cancelText?: import("react").ReactNode;
|
|
19
19
|
children?: ((items: (import("../cascader-view").CascaderOption | null)[], actions: import("./cascader").CascaderActions) => import("react").ReactNode) | undefined;
|
|
20
20
|
onTabsChange?: ((index: number) => void) | undefined;
|
|
21
|
+
activeIcon?: import("react").ReactNode;
|
|
21
22
|
} & Pick<import("../popup").PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
22
23
|
className?: string | undefined;
|
|
23
24
|
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|