@arco-design/mobile-react 2.31.2 → 2.31.4
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 +22 -0
- package/README.en-US.md +3 -3
- package/README.md +3 -3
- package/cjs/action-sheet/style/css/index.css +2 -2
- package/cjs/avatar/style/css/index.css +2 -2
- package/cjs/badge/style/css/index.css +2 -2
- package/cjs/button/style/css/index.css +2 -2
- package/cjs/carousel/style/css/index.css +2 -2
- package/cjs/cell/style/css/index.css +2 -2
- package/cjs/checkbox/style/css/index.css +2 -2
- package/cjs/circle-progress/style/css/index.css +2 -2
- package/cjs/collapse/style/css/index.css +2 -2
- package/cjs/count-down/style/css/index.css +2 -2
- package/cjs/date-picker/index.js +7 -7
- package/cjs/date-picker/style/css/index.css +2 -2
- package/cjs/date-picker/type.d.ts +7 -1
- package/cjs/dialog/style/css/index.css +2 -2
- package/cjs/divider/style/css/index.css +2 -2
- package/cjs/dropdown/style/css/index.css +2 -2
- package/cjs/dropdown-menu/style/css/index.css +2 -2
- package/cjs/ellipsis/style/css/index.css +2 -2
- package/cjs/form/form-item.d.ts +0 -3
- package/cjs/form/form-item.js +19 -30
- package/cjs/form/index.js +6 -2
- package/cjs/form/linked-container.d.ts +8 -0
- package/cjs/form/linked-container.js +72 -0
- package/cjs/form/style/css/index.css +2 -2
- package/cjs/form/style/index.less +3 -3
- package/cjs/form/type.d.ts +7 -11
- package/cjs/form/useForm.js +36 -48
- package/cjs/grid/style/css/index.css +2 -2
- package/cjs/image/style/css/index.css +2 -2
- package/cjs/image-picker/style/css/index.css +2 -2
- package/cjs/image-preview/style/css/index.css +2 -2
- package/cjs/index-bar/style/css/index.css +2 -2
- package/cjs/input/style/css/index.css +2 -2
- package/cjs/keyboard/style/css/index.css +2 -2
- package/cjs/load-more/style/css/index.css +2 -2
- package/cjs/loading/style/css/index.css +2 -2
- package/cjs/masking/style/css/index.css +2 -2
- package/cjs/nav-bar/style/css/index.css +2 -2
- package/cjs/notice-bar/style/css/index.css +2 -2
- package/cjs/notify/style/css/index.css +2 -2
- package/cjs/pagination/style/css/index.css +2 -2
- package/cjs/picker/index.js +1 -1
- package/cjs/picker/style/css/index.css +2 -2
- package/cjs/picker-view/style/css/index.css +2 -2
- package/cjs/popover/style/css/index.css +2 -2
- package/cjs/popover/style/css/menu.css +2 -2
- package/cjs/popup/style/css/index.css +2 -2
- package/cjs/popup-swiper/style/css/index.css +2 -2
- package/cjs/progress/style/css/index.css +2 -2
- package/cjs/pull-refresh/style/css/index.css +2 -2
- package/cjs/radio/style/css/index.css +2 -2
- package/cjs/rate/style/css/index.css +2 -2
- package/cjs/search-bar/style/css/index.css +2 -2
- package/cjs/skeleton/style/css/index.css +2 -2
- package/cjs/slider/style/css/index.css +2 -2
- package/cjs/stepper/hooks/useInputEvent.d.ts +1 -0
- package/cjs/stepper/hooks/useInputEvent.js +3 -2
- package/cjs/stepper/hooks/useValue.d.ts +1 -0
- package/cjs/stepper/hooks/useValue.js +2 -1
- package/cjs/stepper/index.js +3 -1
- package/cjs/stepper/style/css/index.css +2 -2
- package/cjs/steps/style/css/index.css +2 -2
- package/cjs/sticky/style/css/index.css +2 -2
- package/cjs/swipe-action/style/css/index.css +2 -2
- package/cjs/swipe-load/style/css/index.css +2 -2
- package/cjs/switch/style/css/index.css +2 -2
- package/cjs/tab-bar/style/css/index.css +2 -2
- package/cjs/tabs/style/css/index.css +2 -2
- package/cjs/tag/style/css/index.css +2 -2
- package/cjs/textarea/style/css/index.css +2 -2
- package/cjs/toast/style/css/index.css +2 -2
- package/cjs/transition/style/css/index.css +2 -2
- package/cjs/uploader/style/css/index.css +2 -2
- package/dist/index.js +1832 -1831
- package/dist/index.min.js +4 -4
- package/dist/style.css +114 -114
- package/esm/action-sheet/style/css/index.css +2 -2
- package/esm/avatar/style/css/index.css +2 -2
- package/esm/badge/style/css/index.css +2 -2
- package/esm/button/style/css/index.css +2 -2
- package/esm/carousel/style/css/index.css +2 -2
- package/esm/cell/style/css/index.css +2 -2
- package/esm/checkbox/style/css/index.css +2 -2
- package/esm/circle-progress/style/css/index.css +2 -2
- package/esm/collapse/style/css/index.css +2 -2
- package/esm/count-down/style/css/index.css +2 -2
- package/esm/date-picker/index.js +8 -8
- package/esm/date-picker/style/css/index.css +2 -2
- package/esm/date-picker/type.d.ts +7 -1
- package/esm/dialog/style/css/index.css +2 -2
- package/esm/divider/style/css/index.css +2 -2
- package/esm/dropdown/style/css/index.css +2 -2
- package/esm/dropdown-menu/style/css/index.css +2 -2
- package/esm/ellipsis/style/css/index.css +2 -2
- package/esm/form/form-item.d.ts +0 -3
- package/esm/form/form-item.js +14 -25
- package/esm/form/index.js +7 -3
- package/esm/form/linked-container.d.ts +8 -0
- package/esm/form/linked-container.js +54 -0
- package/esm/form/style/css/index.css +2 -2
- package/esm/form/style/index.less +3 -3
- package/esm/form/type.d.ts +7 -11
- package/esm/form/useForm.js +31 -42
- package/esm/grid/style/css/index.css +2 -2
- package/esm/image/style/css/index.css +2 -2
- package/esm/image-picker/style/css/index.css +2 -2
- package/esm/image-preview/style/css/index.css +2 -2
- package/esm/index-bar/style/css/index.css +2 -2
- package/esm/input/style/css/index.css +2 -2
- package/esm/keyboard/style/css/index.css +2 -2
- package/esm/load-more/style/css/index.css +2 -2
- package/esm/loading/style/css/index.css +2 -2
- package/esm/masking/style/css/index.css +2 -2
- package/esm/nav-bar/style/css/index.css +2 -2
- package/esm/notice-bar/style/css/index.css +2 -2
- package/esm/notify/style/css/index.css +2 -2
- package/esm/pagination/style/css/index.css +2 -2
- package/esm/picker/index.js +1 -1
- package/esm/picker/style/css/index.css +2 -2
- package/esm/picker-view/style/css/index.css +2 -2
- package/esm/popover/style/css/index.css +2 -2
- package/esm/popover/style/css/menu.css +2 -2
- package/esm/popup/style/css/index.css +2 -2
- package/esm/popup-swiper/style/css/index.css +2 -2
- package/esm/progress/style/css/index.css +2 -2
- package/esm/pull-refresh/style/css/index.css +2 -2
- package/esm/radio/style/css/index.css +2 -2
- package/esm/rate/style/css/index.css +2 -2
- package/esm/search-bar/style/css/index.css +2 -2
- package/esm/skeleton/style/css/index.css +2 -2
- package/esm/slider/style/css/index.css +2 -2
- package/esm/stepper/hooks/useInputEvent.d.ts +1 -0
- package/esm/stepper/hooks/useInputEvent.js +3 -2
- package/esm/stepper/hooks/useValue.d.ts +1 -0
- package/esm/stepper/hooks/useValue.js +2 -1
- package/esm/stepper/index.js +3 -1
- package/esm/stepper/style/css/index.css +2 -2
- package/esm/steps/style/css/index.css +2 -2
- package/esm/sticky/style/css/index.css +2 -2
- package/esm/swipe-action/style/css/index.css +2 -2
- package/esm/swipe-load/style/css/index.css +2 -2
- package/esm/switch/style/css/index.css +2 -2
- package/esm/tab-bar/style/css/index.css +2 -2
- package/esm/tabs/style/css/index.css +2 -2
- package/esm/tag/style/css/index.css +2 -2
- package/esm/textarea/style/css/index.css +2 -2
- package/esm/toast/style/css/index.css +2 -2
- package/esm/transition/style/css/index.css +2 -2
- package/esm/uploader/style/css/index.css +2 -2
- package/package.json +3 -3
- package/style/css/public.css +2 -2
- package/tokens/mixin/index.less +2 -2
- package/umd/action-sheet/style/css/index.css +2 -2
- package/umd/avatar/style/css/index.css +2 -2
- package/umd/badge/style/css/index.css +2 -2
- package/umd/button/style/css/index.css +2 -2
- package/umd/carousel/style/css/index.css +2 -2
- package/umd/cell/style/css/index.css +2 -2
- package/umd/checkbox/style/css/index.css +2 -2
- package/umd/circle-progress/style/css/index.css +2 -2
- package/umd/collapse/style/css/index.css +2 -2
- package/umd/count-down/style/css/index.css +2 -2
- package/umd/date-picker/index.js +7 -7
- package/umd/date-picker/style/css/index.css +2 -2
- package/umd/date-picker/type.d.ts +7 -1
- package/umd/dialog/style/css/index.css +2 -2
- package/umd/divider/style/css/index.css +2 -2
- package/umd/dropdown/style/css/index.css +2 -2
- package/umd/dropdown-menu/style/css/index.css +2 -2
- package/umd/ellipsis/style/css/index.css +2 -2
- package/umd/form/form-item.d.ts +0 -3
- package/umd/form/form-item.js +19 -34
- package/umd/form/index.js +6 -2
- package/umd/form/linked-container.d.ts +8 -0
- package/umd/form/linked-container.js +78 -0
- package/umd/form/style/css/index.css +2 -2
- package/umd/form/style/index.less +3 -3
- package/umd/form/type.d.ts +7 -11
- package/umd/form/useForm.js +38 -50
- package/umd/grid/style/css/index.css +2 -2
- package/umd/image/style/css/index.css +2 -2
- package/umd/image-picker/style/css/index.css +2 -2
- package/umd/image-preview/style/css/index.css +2 -2
- package/umd/index-bar/style/css/index.css +2 -2
- package/umd/input/style/css/index.css +2 -2
- package/umd/keyboard/style/css/index.css +2 -2
- package/umd/load-more/style/css/index.css +2 -2
- package/umd/loading/style/css/index.css +2 -2
- package/umd/masking/style/css/index.css +2 -2
- package/umd/nav-bar/style/css/index.css +2 -2
- package/umd/notice-bar/style/css/index.css +2 -2
- package/umd/notify/style/css/index.css +2 -2
- package/umd/pagination/style/css/index.css +2 -2
- package/umd/picker/index.js +1 -1
- package/umd/picker/style/css/index.css +2 -2
- package/umd/picker-view/style/css/index.css +2 -2
- package/umd/popover/style/css/index.css +2 -2
- package/umd/popover/style/css/menu.css +2 -2
- package/umd/popup/style/css/index.css +2 -2
- package/umd/popup-swiper/style/css/index.css +2 -2
- package/umd/progress/style/css/index.css +2 -2
- package/umd/pull-refresh/style/css/index.css +2 -2
- package/umd/radio/style/css/index.css +2 -2
- package/umd/rate/style/css/index.css +2 -2
- package/umd/search-bar/style/css/index.css +2 -2
- package/umd/skeleton/style/css/index.css +2 -2
- package/umd/slider/style/css/index.css +2 -2
- package/umd/stepper/hooks/useInputEvent.d.ts +1 -0
- package/umd/stepper/hooks/useInputEvent.js +3 -2
- package/umd/stepper/hooks/useValue.d.ts +1 -0
- package/umd/stepper/hooks/useValue.js +2 -1
- package/umd/stepper/index.js +3 -1
- package/umd/stepper/style/css/index.css +2 -2
- package/umd/steps/style/css/index.css +2 -2
- package/umd/sticky/style/css/index.css +2 -2
- package/umd/swipe-action/style/css/index.css +2 -2
- package/umd/swipe-load/style/css/index.css +2 -2
- package/umd/switch/style/css/index.css +2 -2
- package/umd/tab-bar/style/css/index.css +2 -2
- package/umd/tabs/style/css/index.css +2 -2
- package/umd/tag/style/css/index.css +2 -2
- package/umd/textarea/style/css/index.css +2 -2
- package/umd/toast/style/css/index.css +2 -2
- package/umd/transition/style/css/index.css +2 -2
- package/umd/uploader/style/css/index.css +2 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,28 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [2.31.4](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.31.3...@arco-design/mobile-react@2.31.4) (2024-06-26)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* stepper controlled value ([4f8d060](https://github.com/arco-design/arco-design-mobile/commit/4f8d0603c3e292a337b0be09266a360d7e91e943))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
## [2.31.3](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.31.2...@arco-design/mobile-react@2.31.3) (2024-05-11)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* `Form` optimize "initialValues" and picker form item logic & add `DatePicker` default linked container ([#261](https://github.com/arco-design/arco-design-mobile/issues/261)) ([790ba3a](https://github.com/arco-design/arco-design-mobile/commit/790ba3a9dc4b289a20ddd18b5c11e2855bc6a8bd))
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
6
28
|
## [2.31.2](https://github.com/arco-design/arco-design-mobile/compare/@arco-design/mobile-react@2.31.1...@arco-design/mobile-react@2.31.2) (2024-04-19)
|
7
29
|
|
8
30
|
|
package/README.en-US.md
CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="_b
|
|
59
59
|
React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">Click here</a>**
|
60
60
|
|
61
61
|
```
|
62
|
-
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.31.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.31.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.31.3/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.31.3/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## Full import
|
@@ -247,7 +247,7 @@ lessOptions: {
|
|
247
247
|
|
248
248
|
## Using components on PC
|
249
249
|
|
250
|
-
Only touch-related events are monitored and processed in the component. If you need to use the component on the PC side, you can import `touch2mouse.js` provided by this component library to be compatible with mouse event processing:
|
250
|
+
Only touch-related events are monitored and processed in the component. If you need to use the component on the PC side, you can import `touch2mouse.js` provided by this component library to be compatible with mouse event processing (Note: After importing this file, the following mouse events will be blocked: mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover and mouseup, and the page content cannot be selected):
|
251
251
|
|
252
252
|
```js
|
253
253
|
import '@arco-design/mobile-react/tools/touch2mouse';
|
package/README.md
CHANGED
@@ -59,8 +59,8 @@ React & ReactDOM: **<a href="https://reactjs.org/docs/cdn-links.html" target="
|
|
59
59
|
React Transition Group: **<a href="https://reactcommunity.org/react-transition-group/" target="_blank">戳这里获取</a>**
|
60
60
|
|
61
61
|
```
|
62
|
-
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.31.
|
63
|
-
<script src="https://unpkg.com/@arco-design/mobile-react@2.31.
|
62
|
+
<link ref="stylesheet" href="https://unpkg.com/@arco-design/mobile-react@2.31.3/dist/style.min.css">
|
63
|
+
<script src="https://unpkg.com/@arco-design/mobile-react@2.31.3/dist/index.min.js"></script>
|
64
64
|
```
|
65
65
|
|
66
66
|
## 引入全部
|
@@ -245,7 +245,7 @@ lessOptions: {
|
|
245
245
|
|
246
246
|
## 在 PC 端使用组件
|
247
247
|
|
248
|
-
组件中仅监听及处理 touch 相关事件,如需在 PC 端使用组件,可引入本组件库提供的 touch2mouse.js 以兼容 mouse
|
248
|
+
组件中仅监听及处理 touch 相关事件,如需在 PC 端使用组件,可引入本组件库提供的 touch2mouse.js 以兼容 mouse 事件处理(注意:引入该文件后将阻止如下鼠标事件:mousedown、mouseenter、mouseleave、mousemove、mouseout、mouseover和mouseup,页面内容无法被选中):
|
249
249
|
|
250
250
|
```js
|
251
251
|
import '@arco-design/mobile-react/tools/touch2mouse';
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
package/cjs/date-picker/index.js
CHANGED
@@ -30,18 +30,14 @@ Object.keys(_type).forEach(function (key) {
|
|
30
30
|
if (key in exports && exports[key] === _type[key]) return;
|
31
31
|
exports[key] = _type[key];
|
32
32
|
});
|
33
|
-
var _excluded = ["currentTs", "className", "visible", "onOk", "onChange", "onValueChange", "mode", "typeArr", "minTs", "maxTs", "formatter", "valueFilter", "columnsProcessor", "touchToStop", "useUTC"];
|
33
|
+
var _excluded = ["currentTs", "className", "visible", "onOk", "onChange", "onValueChange", "mode", "typeArr", "minTs", "maxTs", "formatter", "valueFilter", "columnsProcessor", "touchToStop", "useUTC", "renderLinkedContainer"];
|
34
34
|
|
35
35
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
36
36
|
|
37
37
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
38
38
|
|
39
39
|
var allTypes = ['year', 'month', 'date', 'hour', 'minute', 'second'];
|
40
|
-
|
41
|
-
var defaultFormatter = function defaultFormatter(value) {
|
42
|
-
return value < 10 ? "0" + value : String(value);
|
43
|
-
};
|
44
|
-
|
40
|
+
var defaultFormatter = _mobileUtils.formatDateNumber;
|
45
41
|
var YEAR = 12 * 30 * 24 * 60 * 60 * 1000;
|
46
42
|
exports.YEAR = YEAR;
|
47
43
|
var initMinDate = Date.now() - 10 * YEAR;
|
@@ -75,6 +71,7 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
75
71
|
touchToStop = props.touchToStop,
|
76
72
|
_props$useUTC = props.useUTC,
|
77
73
|
useUTC = _props$useUTC === void 0 ? false : _props$useUTC,
|
74
|
+
renderLinkedContainer = props.renderLinkedContainer,
|
78
75
|
otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
79
76
|
var currentTs = Math.min(maxTs, Math.max(minTs, userSetCurrentTs));
|
80
77
|
|
@@ -346,7 +343,10 @@ var DatePicker = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
346
343
|
value: value,
|
347
344
|
onPickerChange: _handlePickerChange,
|
348
345
|
onOk: _handlePickerConfirm,
|
349
|
-
touchToStop: touchToStop
|
346
|
+
touchToStop: touchToStop,
|
347
|
+
renderLinkedContainer: renderLinkedContainer ? function () {
|
348
|
+
return renderLinkedContainer(currentTs, keyOptions);
|
349
|
+
} : undefined
|
350
350
|
}));
|
351
351
|
});
|
352
352
|
});
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
1
2
|
import { PickerProps } from '../picker';
|
2
3
|
import { PickerData } from '../picker-view';
|
3
4
|
export declare type ItemType = 'year' | 'month' | 'date' | 'hour' | 'minute' | 'second';
|
@@ -34,7 +35,7 @@ export interface IDateObj {
|
|
34
35
|
second: number;
|
35
36
|
}
|
36
37
|
export declare type mode = 'date' | 'time' | 'datetime';
|
37
|
-
export interface DatePickerProps extends Omit<PickerProps, 'data' | 'cascade' | 'cols' | 'value' | 'onChange' | 'onPickerChange' | 'onOk'> {
|
38
|
+
export interface DatePickerProps extends Omit<PickerProps, 'data' | 'cascade' | 'cols' | 'value' | 'onChange' | 'onPickerChange' | 'onOk' | 'renderLinkedContainer'> {
|
38
39
|
/**
|
39
40
|
* 点击选中时执行的回调
|
40
41
|
* @en Callback when clicking OK
|
@@ -105,4 +106,9 @@ export interface DatePickerProps extends Omit<PickerProps, 'data' | 'cascade' |
|
|
105
106
|
* @en Selector list item intervention to insert custom options.
|
106
107
|
*/
|
107
108
|
columnsProcessor?: (columns: PickerData[][], currentDateObj: IDateObj) => PickerData[][];
|
109
|
+
/**
|
110
|
+
* 将选择器的展现隐藏状态及选中值的展示与某个容器关联,传入后将同时渲染该容器和选择器组件,此时选择器组件的 visible 和 onHide 属性可不传,点击该容器会唤起选择器
|
111
|
+
* @en Associate the hidden state of the picker and the display of the selected value with a container. After passing it in, the container and the picker component will be rendered at the same time. At this time, the visible and onHide attributes of the picker component are optional values. Clicking the container will evoke the picker
|
112
|
+
*/
|
113
|
+
renderLinkedContainer?: (currentTs: number, itemTypes: ItemType[]) => ReactNode;
|
108
114
|
}
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* @param @rules {en} customized rewrite rules, default to initial
|
107
107
|
* @example
|
108
108
|
* ```
|
109
|
-
* @import '@arco-design/mobile-
|
109
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
110
110
|
*
|
111
111
|
* .demo {
|
112
112
|
* .set-prop-with-rtl(right, auto);
|
@@ -122,7 +122,7 @@
|
|
122
122
|
* @param @value {en} css property value
|
123
123
|
* @example
|
124
124
|
* ```
|
125
|
-
* @import '@arco-design/mobile-
|
125
|
+
* @import '@arco-design/mobile-react/style/mixin.less';
|
126
126
|
*
|
127
127
|
* .demo {
|
128
128
|
* .set-value-with-rtl(text-align, left);
|
package/cjs/form/form-item.d.ts
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { FormItemProps, FormItemRef } from './type';
|
3
|
-
export declare function DefaultPickerLinkedContainer({ value }: {
|
4
|
-
value: (string | number)[];
|
5
|
-
}): JSX.Element;
|
6
3
|
declare const _default: React.ForwardRefExoticComponent<FormItemProps & React.RefAttributes<FormItemRef>>;
|
7
4
|
export default _default;
|
package/cjs/form/form-item.js
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
-
exports.DefaultPickerLinkedContainer = DefaultPickerLinkedContainer;
|
7
6
|
exports.default = void 0;
|
8
7
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
@@ -16,6 +15,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
16
15
|
|
17
16
|
var _mobileUtils = require("@arco-design/mobile-utils");
|
18
17
|
|
18
|
+
var _es6Promise = require("es6-promise");
|
19
|
+
|
19
20
|
var _formItemContext = require("./form-item-context");
|
20
21
|
|
21
22
|
var _contextProvider = require("../context-provider");
|
@@ -24,27 +25,14 @@ var _type = require("./type");
|
|
24
25
|
|
25
26
|
var _utils = require("./utils");
|
26
27
|
|
28
|
+
var _linkedContainer = require("./linked-container");
|
29
|
+
|
27
30
|
var _excluded = ["label", "field", "disabled", "layout", "style", "extra", "requiredIcon", "rules", "className"];
|
28
31
|
|
29
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
30
33
|
|
31
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
32
35
|
|
33
|
-
function DefaultPickerLinkedContainer(_ref) {
|
34
|
-
var value = _ref.value;
|
35
|
-
|
36
|
-
var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
|
37
|
-
prefixCls = _useContext.prefixCls,
|
38
|
-
locale = _useContext.locale;
|
39
|
-
|
40
|
-
var className = prefixCls + "-form-picker-link-container";
|
41
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
42
|
-
className: className
|
43
|
-
}, value && value.length ? value.join('-') : /*#__PURE__*/_react.default.createElement("span", {
|
44
|
-
className: className + "-placeholder"
|
45
|
-
}, locale == null ? void 0 : locale.Form.pickerDefaultHint));
|
46
|
-
}
|
47
|
-
|
48
36
|
var FormItemInner = /*#__PURE__*/function (_PureComponent) {
|
49
37
|
(0, _inheritsLoose2.default)(FormItemInner, _PureComponent);
|
50
38
|
|
@@ -58,14 +46,14 @@ var FormItemInner = /*#__PURE__*/function (_PureComponent) {
|
|
58
46
|
_this._errors = [];
|
59
47
|
_this._touched = false;
|
60
48
|
|
61
|
-
_this.onValueChange = function (
|
49
|
+
_this.onValueChange = function (curValue, preValue) {
|
62
50
|
_this._touched = true;
|
63
51
|
var shouldUpdate = _this.props.shouldUpdate;
|
64
52
|
|
65
53
|
if (typeof shouldUpdate === 'function') {
|
66
54
|
shouldUpdate({
|
67
|
-
|
68
|
-
|
55
|
+
preValue: preValue,
|
56
|
+
curValue: curValue
|
69
57
|
}) && _this.forceUpdate();
|
70
58
|
return;
|
71
59
|
}
|
@@ -98,7 +86,7 @@ var FormItemInner = /*#__PURE__*/function (_PureComponent) {
|
|
98
86
|
var fieldValidator = new _mobileUtils.Validator((_Validator = {}, _Validator[field] = rules, _Validator), {
|
99
87
|
validateMessages: validateMessages
|
100
88
|
});
|
101
|
-
return new Promise(function (resolve) {
|
89
|
+
return new _es6Promise.Promise(function (resolve) {
|
102
90
|
var _fieldValidator$valid;
|
103
91
|
|
104
92
|
fieldValidator.validate((_fieldValidator$valid = {}, _fieldValidator$valid[field] = value, _fieldValidator$valid), function (errorsMap) {
|
@@ -124,7 +112,7 @@ var FormItemInner = /*#__PURE__*/function (_PureComponent) {
|
|
124
112
|
});
|
125
113
|
}
|
126
114
|
|
127
|
-
return Promise.resolve({
|
115
|
+
return _es6Promise.Promise.resolve({
|
128
116
|
errors: [],
|
129
117
|
warnings: [],
|
130
118
|
value: value,
|
@@ -275,9 +263,10 @@ var FormItemInner = /*#__PURE__*/function (_PureComponent) {
|
|
275
263
|
currentTs: getFieldValue(field),
|
276
264
|
onChange: this.innerTriggerFunctionWithValueFirst,
|
277
265
|
disabled: this.props.disabled,
|
278
|
-
renderLinkedContainer: ((_children$props7 = children.props) == null ? void 0 : _children$props7.renderLinkedContainer) || function (
|
279
|
-
return /*#__PURE__*/_react.default.createElement(
|
280
|
-
|
266
|
+
renderLinkedContainer: ((_children$props7 = children.props) == null ? void 0 : _children$props7.renderLinkedContainer) || function (ts, types) {
|
267
|
+
return /*#__PURE__*/_react.default.createElement(_linkedContainer.DefaultDatePickerLinkedContainer, {
|
268
|
+
ts: ts,
|
269
|
+
types: types
|
281
270
|
});
|
282
271
|
}
|
283
272
|
};
|
@@ -289,7 +278,7 @@ var FormItemInner = /*#__PURE__*/function (_PureComponent) {
|
|
289
278
|
onChange: this.innerTriggerFunctionWithValueFirst,
|
290
279
|
disabled: this.props.disabled,
|
291
280
|
renderLinkedContainer: ((_children$props8 = children.props) == null ? void 0 : _children$props8.renderLinkedContainer) || function (val) {
|
292
|
-
return /*#__PURE__*/_react.default.createElement(DefaultPickerLinkedContainer, {
|
281
|
+
return /*#__PURE__*/_react.default.createElement(_linkedContainer.DefaultPickerLinkedContainer, {
|
293
282
|
value: val
|
294
283
|
});
|
295
284
|
}
|
@@ -357,12 +346,12 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
357
346
|
className = _props$className === void 0 ? '' : _props$className,
|
358
347
|
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
359
348
|
|
360
|
-
var
|
361
|
-
prefixCls =
|
349
|
+
var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
|
350
|
+
prefixCls = _useContext.prefixCls;
|
362
351
|
|
363
|
-
var
|
364
|
-
layout =
|
365
|
-
propsDisabled =
|
352
|
+
var _useContext2 = (0, _react.useContext)(_formItemContext.FormItemContext),
|
353
|
+
layout = _useContext2.layout,
|
354
|
+
propsDisabled = _useContext2.disabled;
|
366
355
|
|
367
356
|
var _useState = (0, _react.useState)(null),
|
368
357
|
errors = _useState[0],
|
package/cjs/form/index.js
CHANGED
@@ -51,6 +51,7 @@ var Form = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
51
51
|
onSubmitFailed = props.onSubmitFailed,
|
52
52
|
disabled = props.disabled;
|
53
53
|
var domRef = (0, _react.useRef)(null);
|
54
|
+
var initRef = (0, _react.useRef)(false);
|
54
55
|
|
55
56
|
var _useForm = (0, _useForm2.default)(formInstance),
|
56
57
|
form = _useForm[0];
|
@@ -64,9 +65,12 @@ var Form = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
64
65
|
onSubmit: onSubmit,
|
65
66
|
onSubmitFailed: onSubmitFailed
|
66
67
|
});
|
67
|
-
|
68
|
+
|
69
|
+
if (!initRef.current) {
|
68
70
|
setInitialValues(initialValues || {});
|
69
|
-
|
71
|
+
initRef.current = true;
|
72
|
+
}
|
73
|
+
|
70
74
|
(0, _react.useImperativeHandle)(ref, function () {
|
71
75
|
return {
|
72
76
|
dom: domRef.current,
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare function DefaultPickerLinkedContainer({ value }: {
|
3
|
+
value: (string | number)[];
|
4
|
+
}): JSX.Element;
|
5
|
+
export declare function DefaultDatePickerLinkedContainer({ ts, types }: {
|
6
|
+
ts: number;
|
7
|
+
types: string[];
|
8
|
+
}): JSX.Element;
|