antd-mobile 5.0.0-rc.22 → 5.0.0-rc.26
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/README.md +7 -6
- package/2x/cjs/components/badge/badge.css +18 -10
- package/2x/cjs/components/badge/badge.d.ts +1 -0
- package/2x/cjs/components/badge/badge.js +4 -5
- package/2x/cjs/components/button/button.css +3 -3
- package/2x/cjs/components/calendar/calendar.js +3 -1
- package/2x/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/2x/cjs/components/checkbox/check-icon.js +4 -13
- package/2x/cjs/components/checkbox/checkbox.css +5 -14
- package/2x/cjs/components/checkbox/checkbox.js +3 -5
- package/2x/cjs/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/2x/cjs/components/checkbox/indeterminate-icon.js +24 -0
- package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/2x/cjs/components/ellipsis/ellipsis.js +3 -1
- package/2x/cjs/components/floating-bubble/floating-bubble.css +1 -0
- package/2x/cjs/components/floating-panel/floating-panel.d.ts +7 -5
- package/2x/cjs/components/floating-panel/floating-panel.js +11 -1
- package/2x/cjs/components/form/form-item.css +3 -2
- package/2x/cjs/components/form/form-item.d.ts +2 -2
- package/2x/cjs/components/form/form-item.js +9 -5
- package/2x/cjs/components/form/form.css +3 -3
- package/2x/cjs/components/form/form.d.ts +5 -4
- package/2x/cjs/components/form/index.css +6 -5
- package/2x/cjs/components/form/index.d.ts +5 -4
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -1
- package/2x/cjs/components/image-viewer/image-viewer.d.ts +8 -2
- package/2x/cjs/components/image-viewer/image-viewer.js +19 -6
- package/2x/cjs/components/image-viewer/index.d.ts +6 -2
- package/2x/cjs/components/image-viewer/slide.js +2 -1
- package/2x/cjs/components/image-viewer/slides.d.ts +7 -3
- package/2x/cjs/components/image-viewer/slides.js +18 -11
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/input/input.js +7 -3
- package/2x/cjs/components/list/list.css +2 -6
- package/2x/cjs/components/modal/modal.css +25 -20
- package/2x/cjs/components/modal/modal.js +8 -12
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +2 -2
- package/2x/cjs/components/picker/picker.css +10 -2
- package/2x/cjs/components/picker/picker.d.ts +1 -1
- package/2x/cjs/components/picker-view/picker-view.css +4 -2
- package/2x/cjs/components/picker-view/picker-view.d.ts +1 -1
- package/2x/cjs/components/picker-view/wheel.js +5 -3
- package/2x/cjs/components/popover/arrow.d.ts +3 -0
- package/2x/cjs/components/popover/arrow.js +26 -0
- package/2x/cjs/components/popover/index.d.ts +7 -15
- package/2x/cjs/components/popover/index.js +4 -2
- package/2x/cjs/components/popover/popover-menu.css +63 -0
- package/2x/cjs/components/popover/popover-menu.d.ts +20 -0
- package/{cjs/components/popover/pop-menu.js → 2x/cjs/components/popover/popover-menu.js} +23 -26
- package/2x/cjs/components/popover/popover.css +90 -318
- package/2x/cjs/components/popover/popover.d.ts +9 -8
- package/2x/cjs/components/popover/popover.js +11 -17
- package/2x/cjs/components/radio/radio.css +4 -7
- package/2x/cjs/components/radio/radio.js +1 -3
- package/2x/cjs/components/search-bar/search-bar.css +1 -1
- package/2x/cjs/components/selector/selector.css +14 -6
- package/2x/cjs/components/selector/selector.d.ts +2 -1
- package/2x/cjs/components/selector/selector.js +3 -2
- package/2x/cjs/components/swiper/swiper.js +1 -1
- package/2x/cjs/components/switch/switch.css +8 -3
- package/2x/cjs/components/tabs/tabs.js +2 -2
- package/2x/cjs/components/text-area/text-area.css +9 -9
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +41 -32
- package/2x/cjs/components/virtual-input/virtual-input.js +3 -1
- package/2x/cjs/utils/get-scroll-parent.js +1 -1
- package/2x/cjs/utils/use-ref-state.js +1 -1
- package/2x/cjs/utils/use-resize-effect.js +1 -3
- package/2x/cjs/utils/use-tab-list-scroll.js +1 -3
- package/2x/es/components/badge/badge.css +18 -10
- package/2x/es/components/badge/badge.d.ts +1 -0
- package/2x/es/components/badge/badge.js +4 -5
- package/2x/es/components/button/button.css +3 -3
- package/2x/es/components/calendar/calendar.js +3 -2
- package/2x/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/2x/es/components/checkbox/check-icon.js +4 -13
- package/2x/es/components/checkbox/checkbox.css +5 -14
- package/2x/es/components/checkbox/checkbox.js +2 -5
- package/2x/es/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/2x/es/components/checkbox/indeterminate-icon.js +10 -0
- package/2x/es/components/date-picker/date-picker.d.ts +1 -1
- package/2x/es/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/2x/es/components/ellipsis/ellipsis.js +3 -2
- package/2x/es/components/floating-bubble/floating-bubble.css +1 -0
- package/2x/es/components/floating-panel/floating-panel.d.ts +7 -5
- package/2x/es/components/floating-panel/floating-panel.js +9 -1
- package/2x/es/components/form/form-item.css +3 -2
- package/2x/es/components/form/form-item.d.ts +2 -2
- package/2x/es/components/form/form-item.js +9 -5
- package/2x/es/components/form/form.css +3 -3
- package/2x/es/components/form/form.d.ts +5 -4
- package/2x/es/components/form/index.css +6 -5
- package/2x/es/components/form/index.d.ts +5 -4
- package/2x/es/components/image-uploader/image-uploader.js +3 -3
- package/2x/es/components/image-viewer/image-viewer.d.ts +8 -2
- package/2x/es/components/image-viewer/image-viewer.js +15 -4
- package/2x/es/components/image-viewer/index.d.ts +6 -2
- package/2x/es/components/image-viewer/slide.js +2 -1
- package/2x/es/components/image-viewer/slides.d.ts +7 -3
- package/2x/es/components/image-viewer/slides.js +19 -10
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/input/input.js +7 -4
- package/2x/es/components/list/list.css +2 -6
- package/2x/es/components/modal/modal.css +25 -20
- package/2x/es/components/modal/modal.js +8 -12
- package/2x/es/components/passcode-input/passcode-input.d.ts +2 -2
- package/2x/es/components/picker/picker.css +10 -2
- package/2x/es/components/picker/picker.d.ts +1 -1
- package/2x/es/components/picker-view/picker-view.css +4 -2
- package/2x/es/components/picker-view/picker-view.d.ts +1 -1
- package/2x/es/components/picker-view/wheel.js +5 -4
- package/2x/es/components/popover/arrow.d.ts +3 -0
- package/2x/es/components/popover/arrow.js +12 -0
- package/2x/es/components/popover/index.d.ts +7 -15
- package/2x/es/components/popover/index.js +3 -2
- package/2x/es/components/popover/popover-menu.css +63 -0
- package/2x/es/components/popover/popover-menu.d.ts +20 -0
- package/2x/es/components/popover/popover-menu.js +52 -0
- package/2x/es/components/popover/popover.css +90 -318
- package/2x/es/components/popover/popover.d.ts +9 -8
- package/2x/es/components/popover/popover.js +10 -17
- package/2x/es/components/radio/radio.css +4 -7
- package/2x/es/components/radio/radio.js +1 -3
- package/2x/es/components/search-bar/search-bar.css +1 -1
- package/2x/es/components/selector/selector.css +14 -6
- package/2x/es/components/selector/selector.d.ts +2 -1
- package/2x/es/components/selector/selector.js +3 -2
- package/2x/es/components/swiper/swiper.js +3 -3
- package/2x/es/components/switch/switch.css +8 -3
- package/2x/es/components/tabs/tabs.js +4 -4
- package/2x/es/components/text-area/text-area.css +9 -9
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +41 -31
- package/2x/es/components/virtual-input/virtual-input.js +3 -2
- package/2x/es/utils/get-scroll-parent.js +1 -1
- package/2x/es/utils/use-ref-state.js +2 -2
- package/2x/es/utils/use-resize-effect.js +2 -3
- package/2x/es/utils/use-tab-list-scroll.js +2 -3
- package/2x/package.json +4 -4
- package/README.md +7 -6
- package/cjs/components/badge/badge.css +16 -10
- package/cjs/components/badge/badge.d.ts +1 -0
- package/cjs/components/badge/badge.js +4 -5
- package/cjs/components/button/button.css +3 -3
- package/cjs/components/calendar/calendar.js +3 -1
- package/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/cjs/components/checkbox/check-icon.js +4 -13
- package/cjs/components/checkbox/checkbox.css +5 -13
- package/cjs/components/checkbox/checkbox.js +3 -5
- package/cjs/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/cjs/components/checkbox/indeterminate-icon.js +24 -0
- package/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/cjs/components/ellipsis/ellipsis.js +3 -1
- package/cjs/components/floating-bubble/floating-bubble.css +1 -0
- package/cjs/components/floating-panel/floating-panel.d.ts +7 -5
- package/cjs/components/floating-panel/floating-panel.js +11 -1
- package/cjs/components/form/form-item.css +3 -2
- package/cjs/components/form/form-item.d.ts +2 -2
- package/cjs/components/form/form-item.js +9 -5
- package/cjs/components/form/form.css +3 -3
- package/cjs/components/form/form.d.ts +5 -4
- package/cjs/components/form/index.css +6 -5
- package/cjs/components/form/index.d.ts +5 -4
- package/cjs/components/image-uploader/image-uploader.js +1 -1
- package/cjs/components/image-viewer/image-viewer.d.ts +8 -2
- package/cjs/components/image-viewer/image-viewer.js +19 -6
- package/cjs/components/image-viewer/index.d.ts +6 -2
- package/cjs/components/image-viewer/slide.js +2 -1
- package/cjs/components/image-viewer/slides.d.ts +7 -3
- package/cjs/components/image-viewer/slides.js +18 -11
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/input/input.js +7 -3
- package/cjs/components/list/list.css +2 -5
- package/cjs/components/modal/modal.css +23 -19
- package/cjs/components/modal/modal.js +8 -12
- package/cjs/components/passcode-input/passcode-input.d.ts +2 -2
- package/cjs/components/picker/picker.css +9 -2
- package/cjs/components/picker/picker.d.ts +1 -1
- package/cjs/components/picker-view/picker-view.css +4 -2
- package/cjs/components/picker-view/picker-view.d.ts +1 -1
- package/cjs/components/picker-view/wheel.js +5 -3
- package/cjs/components/popover/arrow.d.ts +3 -0
- package/cjs/components/popover/arrow.js +26 -0
- package/cjs/components/popover/index.d.ts +7 -15
- package/cjs/components/popover/index.js +4 -2
- package/cjs/components/popover/popover-menu.css +52 -0
- package/cjs/components/popover/popover-menu.d.ts +20 -0
- package/{2x/cjs/components/popover/pop-menu.js → cjs/components/popover/popover-menu.js} +23 -26
- package/cjs/components/popover/popover.css +83 -276
- package/cjs/components/popover/popover.d.ts +9 -8
- package/cjs/components/popover/popover.js +11 -17
- package/cjs/components/radio/radio.css +4 -7
- package/cjs/components/radio/radio.js +1 -3
- package/cjs/components/search-bar/search-bar.css +1 -1
- package/cjs/components/selector/selector.css +14 -6
- package/cjs/components/selector/selector.d.ts +2 -1
- package/cjs/components/selector/selector.js +3 -2
- package/cjs/components/swiper/swiper.js +1 -1
- package/cjs/components/switch/switch.css +8 -3
- package/cjs/components/tabs/tabs.js +2 -2
- package/cjs/components/text-area/text-area.css +9 -9
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +41 -32
- package/cjs/components/virtual-input/virtual-input.js +3 -1
- package/cjs/utils/get-scroll-parent.js +1 -1
- package/cjs/utils/use-ref-state.js +1 -1
- package/cjs/utils/use-resize-effect.js +1 -3
- package/cjs/utils/use-tab-list-scroll.js +1 -3
- package/es/components/badge/badge.css +16 -10
- package/es/components/badge/badge.d.ts +1 -0
- package/es/components/badge/badge.js +4 -5
- package/es/components/button/button.css +3 -3
- package/es/components/calendar/calendar.js +3 -2
- package/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/es/components/checkbox/check-icon.js +4 -13
- package/es/components/checkbox/checkbox.css +5 -13
- package/es/components/checkbox/checkbox.js +2 -5
- package/es/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/es/components/checkbox/indeterminate-icon.js +10 -0
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/es/components/ellipsis/ellipsis.js +3 -2
- package/es/components/floating-bubble/floating-bubble.css +1 -0
- package/es/components/floating-panel/floating-panel.d.ts +7 -5
- package/es/components/floating-panel/floating-panel.js +9 -1
- package/es/components/form/form-item.css +3 -2
- package/es/components/form/form-item.d.ts +2 -2
- package/es/components/form/form-item.js +9 -5
- package/es/components/form/form.css +3 -3
- package/es/components/form/form.d.ts +5 -4
- package/es/components/form/index.css +6 -5
- package/es/components/form/index.d.ts +5 -4
- package/es/components/image-uploader/image-uploader.js +3 -3
- package/es/components/image-viewer/image-viewer.d.ts +8 -2
- package/es/components/image-viewer/image-viewer.js +15 -4
- package/es/components/image-viewer/index.d.ts +6 -2
- package/es/components/image-viewer/slide.js +2 -1
- package/es/components/image-viewer/slides.d.ts +7 -3
- package/es/components/image-viewer/slides.js +19 -10
- package/es/components/input/input.d.ts +2 -2
- package/es/components/input/input.js +7 -4
- package/es/components/list/list.css +2 -5
- package/es/components/modal/modal.css +23 -19
- package/es/components/modal/modal.js +8 -12
- package/es/components/passcode-input/passcode-input.d.ts +2 -2
- package/es/components/picker/picker.css +9 -2
- package/es/components/picker/picker.d.ts +1 -1
- package/es/components/picker-view/picker-view.css +4 -2
- package/es/components/picker-view/picker-view.d.ts +1 -1
- package/es/components/picker-view/wheel.js +5 -4
- package/es/components/popover/arrow.d.ts +3 -0
- package/es/components/popover/arrow.js +12 -0
- package/es/components/popover/index.d.ts +7 -15
- package/es/components/popover/index.js +3 -2
- package/es/components/popover/popover-menu.css +52 -0
- package/es/components/popover/popover-menu.d.ts +20 -0
- package/es/components/popover/popover-menu.js +52 -0
- package/es/components/popover/popover.css +83 -276
- package/es/components/popover/popover.d.ts +9 -8
- package/es/components/popover/popover.js +10 -17
- package/es/components/radio/radio.css +4 -7
- package/es/components/radio/radio.js +1 -3
- package/es/components/search-bar/search-bar.css +1 -1
- package/es/components/selector/selector.css +14 -6
- package/es/components/selector/selector.d.ts +2 -1
- package/es/components/selector/selector.js +3 -2
- package/es/components/swiper/swiper.js +3 -3
- package/es/components/switch/switch.css +8 -3
- package/es/components/tabs/tabs.js +4 -4
- package/es/components/text-area/text-area.css +9 -9
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +41 -31
- package/es/components/virtual-input/virtual-input.js +3 -2
- package/es/utils/get-scroll-parent.js +1 -1
- package/es/utils/use-ref-state.js +2 -2
- package/es/utils/use-resize-effect.js +2 -3
- package/es/utils/use-tab-list-scroll.js +2 -3
- package/package.json +4 -4
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/popover/animation.css +0 -111
- package/2x/cjs/components/popover/pop-menu.d.ts +0 -28
- package/2x/es/components/popover/animation.css +0 -111
- package/2x/es/components/popover/pop-menu.d.ts +0 -28
- package/2x/es/components/popover/pop-menu.js +0 -54
- package/cjs/components/popover/animation.css +0 -96
- package/cjs/components/popover/pop-menu.d.ts +0 -28
- package/es/components/popover/animation.css +0 -96
- package/es/components/popover/pop-menu.d.ts +0 -28
- package/es/components/popover/pop-menu.js +0 -54
|
@@ -10,7 +10,8 @@ import { CheckMark } from './check-mark';
|
|
|
10
10
|
const classPrefix = `adm-selector`;
|
|
11
11
|
const defaultProps = {
|
|
12
12
|
multiple: false,
|
|
13
|
-
defaultValue: []
|
|
13
|
+
defaultValue: [],
|
|
14
|
+
showCheckMark: true
|
|
14
15
|
};
|
|
15
16
|
export const Selector = p => {
|
|
16
17
|
const props = mergeProps(defaultProps, p);
|
|
@@ -55,7 +56,7 @@ export const Selector = p => {
|
|
|
55
56
|
}
|
|
56
57
|
}, option.label, option.description && React.createElement("div", {
|
|
57
58
|
className: `${classPrefix}-item-description`
|
|
58
|
-
}, option.description), active && React.createElement("div", {
|
|
59
|
+
}, option.description), active && props.showCheckMark && React.createElement("div", {
|
|
59
60
|
className: `${classPrefix}-check-mark-wrapper`
|
|
60
61
|
}, React.createElement(CheckMark, null)));
|
|
61
62
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, useEffect, useImperativeHandle,
|
|
1
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -10,7 +10,7 @@ import PageIndicator from '../page-indicator';
|
|
|
10
10
|
import { staged } from 'staged-components';
|
|
11
11
|
import { useRefState } from '../../utils/use-ref-state';
|
|
12
12
|
import { bound } from '../../utils/bound';
|
|
13
|
-
import { useUpdateEffect } from 'ahooks';
|
|
13
|
+
import { useIsomorphicLayoutEffect, useUpdateEffect } from 'ahooks';
|
|
14
14
|
const defaultProps = {
|
|
15
15
|
defaultIndex: 0,
|
|
16
16
|
allowTouchMove: true,
|
|
@@ -184,7 +184,7 @@ export const Swiper = forwardRef(staged((p, ref) => {
|
|
|
184
184
|
swipeNext,
|
|
185
185
|
swipePrev
|
|
186
186
|
}));
|
|
187
|
-
|
|
187
|
+
useIsomorphicLayoutEffect(() => {
|
|
188
188
|
const maxIndex = validChildren.length - 1;
|
|
189
189
|
|
|
190
190
|
if (current > maxIndex) {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
.adm-switch {
|
|
8
8
|
--checked-color: var(--adm-color-primary);
|
|
9
|
-
--height:
|
|
10
|
-
--width:
|
|
9
|
+
--height: 62px;
|
|
10
|
+
--width: 102px;
|
|
11
11
|
--border-width: 4px;
|
|
12
12
|
display: inline-block;
|
|
13
13
|
vertical-align: middle;
|
|
@@ -69,9 +69,14 @@
|
|
|
69
69
|
.adm-switch-inner {
|
|
70
70
|
position: relative;
|
|
71
71
|
z-index: 1;
|
|
72
|
-
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
align-items: center;
|
|
75
|
+
margin: 0 16px 0 calc(var(--height) - var(--border-width) + 8px);
|
|
76
|
+
height: 100%;
|
|
73
77
|
color: var(--adm-color-weak);
|
|
74
78
|
transition: margin 200ms;
|
|
79
|
+
font-size: 30px;
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
.adm-switch.adm-switch-checked .adm-switch-checkbox {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useRef
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useSpring, animated } from '@react-spring/web';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
5
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
6
|
import { bound } from '../../utils/bound';
|
|
7
|
-
import { useUpdateLayoutEffect, useThrottleFn } from 'ahooks';
|
|
7
|
+
import { useUpdateLayoutEffect, useThrottleFn, useIsomorphicLayoutEffect } from 'ahooks';
|
|
8
8
|
import { useMutationEffect } from '../../utils/use-mutation-effect';
|
|
9
9
|
import { useResizeEffect } from '../../utils/use-resize-effect';
|
|
10
10
|
import { mergeProps } from '../../utils/with-default-props';
|
|
@@ -134,7 +134,7 @@ export const Tabs = p => {
|
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
useIsomorphicLayoutEffect(() => {
|
|
138
138
|
animate(true);
|
|
139
139
|
}, []);
|
|
140
140
|
useUpdateLayoutEffect(() => {
|
|
@@ -168,7 +168,7 @@ export const Tabs = p => {
|
|
|
168
168
|
trailing: true,
|
|
169
169
|
leading: true
|
|
170
170
|
});
|
|
171
|
-
|
|
171
|
+
useIsomorphicLayoutEffect(() => {
|
|
172
172
|
updateMask(true);
|
|
173
173
|
}, []);
|
|
174
174
|
return withNativeProps(props, React.createElement("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.adm-text-area
|
|
1
|
+
.adm-text-area {
|
|
2
2
|
--font-size: 34px;
|
|
3
3
|
--color: var(--adm-color-text);
|
|
4
4
|
--placeholder-color: var(--adm-color-light);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
max-height: 100%;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.adm-text-area {
|
|
11
|
+
.adm-text-area-element {
|
|
12
12
|
font-family: var(--adm-font-family);
|
|
13
13
|
resize: none;
|
|
14
14
|
flex: auto;
|
|
@@ -29,35 +29,35 @@
|
|
|
29
29
|
min-height: 1.5em;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.adm-text-area::placeholder {
|
|
32
|
+
.adm-text-area-element::placeholder {
|
|
33
33
|
color: var(--placeholder-color);
|
|
34
34
|
font-family: inherit;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.adm-text-area:-webkit-autofill {
|
|
37
|
+
.adm-text-area-element:-webkit-autofill {
|
|
38
38
|
background-color: transparent;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.adm-text-area:disabled {
|
|
41
|
+
.adm-text-area-element:disabled {
|
|
42
42
|
color: var(--disabled-color);
|
|
43
43
|
cursor: not-allowed;
|
|
44
44
|
opacity: 1;
|
|
45
45
|
-webkit-text-fill-color: var(--disabled-color);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.adm-text-area:read-only {
|
|
48
|
+
.adm-text-area-element:read-only {
|
|
49
49
|
cursor: default;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.adm-text-area:invalid {
|
|
52
|
+
.adm-text-area-element:invalid {
|
|
53
53
|
box-shadow: none;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.adm-text-area::-ms-clear {
|
|
56
|
+
.adm-text-area-element::-ms-clear {
|
|
57
57
|
display: none;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.adm-text-area[readonly] {
|
|
60
|
+
.adm-text-area-element[readonly] {
|
|
61
61
|
pointer-events: none;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
|
-
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
5
5
|
onChange?: (val: string) => void;
|
|
6
6
|
value?: string;
|
|
7
7
|
defaultValue?: string;
|
|
@@ -20,7 +20,7 @@ export declare type TextAreaRef = {
|
|
|
20
20
|
focus: () => void;
|
|
21
21
|
blur: () => void;
|
|
22
22
|
};
|
|
23
|
-
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
23
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
24
24
|
onChange?: ((val: string) => void) | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
4
3
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
5
4
|
import { mergeProps } from '../../utils/with-default-props';
|
|
6
5
|
const classPrefix = 'adm-text-area';
|
|
@@ -12,19 +11,11 @@ const defaultProps = {
|
|
|
12
11
|
};
|
|
13
12
|
export const TextArea = forwardRef((p, ref) => {
|
|
14
13
|
const props = mergeProps(defaultProps, p);
|
|
15
|
-
|
|
16
14
|
const {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onChange: outerOnChange,
|
|
22
|
-
rows: rows,
|
|
23
|
-
autoSize: autoSize,
|
|
24
|
-
showCount
|
|
25
|
-
} = props,
|
|
26
|
-
textAreaProps = __rest(props, ["className", "style", "defaultValue", "value", "onChange", "rows", "autoSize", "showCount"]);
|
|
27
|
-
|
|
15
|
+
autoSize,
|
|
16
|
+
showCount,
|
|
17
|
+
maxLength
|
|
18
|
+
} = props;
|
|
28
19
|
const [value, setValue] = usePropsValue(props);
|
|
29
20
|
const nativeTextAreaRef = useRef(null);
|
|
30
21
|
useImperativeHandle(ref, () => ({
|
|
@@ -64,39 +55,58 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
64
55
|
|
|
65
56
|
textArea.style.height = `${height}px`;
|
|
66
57
|
}, [value, autoSize]);
|
|
58
|
+
const compositingRef = useRef(false);
|
|
67
59
|
let count;
|
|
60
|
+
const valueLength = [...value].length;
|
|
68
61
|
|
|
69
62
|
if (typeof showCount === 'function') {
|
|
70
|
-
count = showCount(
|
|
63
|
+
count = showCount(valueLength, maxLength);
|
|
71
64
|
} else if (showCount) {
|
|
72
65
|
count = React.createElement("div", {
|
|
73
66
|
className: `${classPrefix}-count`
|
|
74
|
-
},
|
|
67
|
+
}, maxLength === undefined ? valueLength : valueLength + '/' + maxLength);
|
|
75
68
|
}
|
|
76
69
|
|
|
77
|
-
return React.createElement("div", {
|
|
78
|
-
className:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
className: classPrefix,
|
|
84
|
-
rows: rows,
|
|
70
|
+
return withNativeProps(props, React.createElement("div", {
|
|
71
|
+
className: classPrefix
|
|
72
|
+
}, React.createElement("textarea", {
|
|
73
|
+
ref: nativeTextAreaRef,
|
|
74
|
+
className: `${classPrefix}-element`,
|
|
75
|
+
rows: props.rows,
|
|
85
76
|
value: value,
|
|
77
|
+
placeholder: props.placeholder,
|
|
86
78
|
onChange: e => {
|
|
87
|
-
|
|
79
|
+
let v = e.target.value;
|
|
80
|
+
|
|
81
|
+
if (maxLength && !compositingRef.current) {
|
|
82
|
+
v = [...v].slice(0, maxLength).join('');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
setValue(v);
|
|
88
86
|
},
|
|
89
|
-
|
|
87
|
+
id: props.id,
|
|
88
|
+
onCompositionStart: e => {
|
|
90
89
|
var _a;
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
compositingRef.current = true;
|
|
92
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
93
93
|
},
|
|
94
|
-
|
|
94
|
+
onCompositionEnd: e => {
|
|
95
95
|
var _a;
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
compositingRef.current = false;
|
|
98
|
+
|
|
99
|
+
if (maxLength) {
|
|
100
|
+
setValue([...value].slice(0, maxLength).join(''));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
98
104
|
},
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
autoComplete: props.autoComplete,
|
|
106
|
+
disabled: props.disabled,
|
|
107
|
+
readOnly: props.readOnly,
|
|
108
|
+
onFocus: props.onFocus,
|
|
109
|
+
onBlur: props.onBlur
|
|
110
|
+
}), count));
|
|
101
111
|
});
|
|
102
112
|
TextArea.defaultProps = defaultProps;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { forwardRef, useEffect, useImperativeHandle,
|
|
1
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
2
2
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { CloseCircleFill } from 'antd-mobile-icons';
|
|
7
|
+
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
7
8
|
const classPrefix = 'adm-virtual-input';
|
|
8
9
|
const defaultProps = {
|
|
9
10
|
defaultValue: ''
|
|
@@ -28,7 +29,7 @@ export const VirtualInput = forwardRef((p, ref) => {
|
|
|
28
29
|
content.scrollLeft = content.clientWidth;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
useIsomorphicLayoutEffect(() => {
|
|
32
33
|
scrollToEnd();
|
|
33
34
|
}, [value]);
|
|
34
35
|
useEffect(() => {
|
|
@@ -4,7 +4,7 @@ const defaultRoot = canUseDom ? window : undefined;
|
|
|
4
4
|
|
|
5
5
|
function isElement(node) {
|
|
6
6
|
const ELEMENT_NODE_TYPE = 1;
|
|
7
|
-
return node.
|
|
7
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
8
8
|
} // https://github.com/youzan/vant/issues/3823
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
export function useRefState(initialState) {
|
|
3
3
|
const [state, setState] = useState(initialState);
|
|
4
4
|
const ref = useRef(state);
|
|
5
|
-
|
|
5
|
+
useEffect(() => {
|
|
6
6
|
ref.current = state;
|
|
7
7
|
}, [state]);
|
|
8
8
|
return [state, setState, ref];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemoizedFn } from 'ahooks';
|
|
1
|
+
import { useIsomorphicLayoutEffect, useMemoizedFn } from 'ahooks';
|
|
3
2
|
export function useResizeEffect(effect, targetRef) {
|
|
4
3
|
const fn = useMemoizedFn(effect);
|
|
5
|
-
|
|
4
|
+
useIsomorphicLayoutEffect(() => {
|
|
6
5
|
const target = targetRef.current;
|
|
7
6
|
if (!target) return;
|
|
8
7
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react';
|
|
2
1
|
import { useSpring } from '@react-spring/web';
|
|
3
2
|
import { useMutationEffect } from './use-mutation-effect';
|
|
4
3
|
import { bound } from './bound';
|
|
5
|
-
import { useUpdateLayoutEffect } from 'ahooks';
|
|
4
|
+
import { useIsomorphicLayoutEffect, useUpdateLayoutEffect } from 'ahooks';
|
|
6
5
|
export const useTabListScroll = (targetRef, activeIndex) => {
|
|
7
6
|
const [{
|
|
8
7
|
scrollLeft
|
|
@@ -37,7 +36,7 @@ export const useTabListScroll = (targetRef, activeIndex) => {
|
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
useIsomorphicLayoutEffect(() => {
|
|
41
40
|
animate(true);
|
|
42
41
|
}, []);
|
|
43
42
|
useUpdateLayoutEffect(() => {
|
package/2x/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.26",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@react-spring/web": "^9.4.2",
|
|
6
|
-
"@types/resize-observer-browser": "^0.1.
|
|
7
|
-
"@use-gesture/react": "^10.2.
|
|
8
|
-
"ahooks": "^3.1.
|
|
6
|
+
"@types/resize-observer-browser": "^0.1.7",
|
|
7
|
+
"@use-gesture/react": "^10.2.5",
|
|
8
|
+
"ahooks": "^3.1.9",
|
|
9
9
|
"antd-mobile-icons": "^0.2.2",
|
|
10
10
|
"antd-mobile-v5-count": "^1.0.1",
|
|
11
11
|
"classnames": "^2.3.1",
|
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
<img src="https://gw.alipayobjects.com/mdn/rms_ee68a8/afts/img/A*
|
|
1
|
+
<img src="https://gw.alipayobjects.com/mdn/rms_ee68a8/afts/img/A*8HtNS4uMKkAAAAAAAAAAAAAAARQnAQ" alt="logo" width="100%" />
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-

|
|
6
|
+

|
|
6
7
|

|
|
7
8
|
[](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Average time to resolve an issue')
|
|
8
9
|
[](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Percentage of issues still open')
|
|
9
10
|

|
|
11
|
+
[](https://codecov.io/gh/ant-design/ant-design-mobile)
|
|
10
12
|

|
|
11
13
|
|
|
12
14
|
```bash
|
|
@@ -20,17 +22,16 @@ $ yarn add antd-mobile@next
|
|
|
20
22
|
- **Atomic**: The function of each component, neither more nor less, is exactly what you need.
|
|
21
23
|
- **Fluent**: With smooth gestures and delicate animation, it helps the product create the ultimate experience.
|
|
22
24
|
|
|
23
|
-
v5(Poplar) is the next major version of antd-mobile, we recommend using it instead of v2.
|
|
24
|
-
|
|
25
25
|
You can also play with antd-mobile just in browser with [Codesandbox](https://codesandbox.io/s/antd-mobile-snrxr?file=/package.json). No need to prepare development environment.
|
|
26
26
|
|
|
27
27
|
If you found bugs or would like to request some new features, please consider opening an [issue](https://github.com/ant-design/ant-design-mobile/issues/new).
|
|
28
28
|
|
|
29
29
|
If you have some question about how to use ant-mobile, you can start a [discussion thread](https://github.com/ant-design/ant-design-mobile/discussions).
|
|
30
30
|
|
|
31
|
-
Feel free to join
|
|
31
|
+
And we also have some community groups here. Feel free to join us:
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
- [DingDing](https://gw.alipayobjects.com/mdn/rms_25513e/afts/img/A*hBjlR4nUWjkAAAAAAAAAAAAAARQnAQ)
|
|
34
|
+
- [Discord](https://discord.gg/jmNvw4WFYn)
|
|
34
35
|
|
|
35
36
|
---
|
|
36
37
|
|
|
@@ -3,23 +3,26 @@
|
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
5
5
|
.adm-badge {
|
|
6
|
-
display: inline-
|
|
7
|
-
color: #fff;
|
|
8
|
-
font-weight: normal;
|
|
9
|
-
text-align: center;
|
|
6
|
+
display: inline-flex;
|
|
10
7
|
vertical-align: middle;
|
|
11
|
-
box-sizing:
|
|
12
|
-
min-width: 16px;
|
|
8
|
+
box-sizing: content-box;
|
|
13
9
|
border-radius: 100px;
|
|
14
|
-
padding: 0 4px;
|
|
15
|
-
font-size: 9px;
|
|
16
|
-
line-height: 14px;
|
|
17
|
-
white-space: nowrap;
|
|
18
10
|
background-color: var(--color);
|
|
19
11
|
--right: 0;
|
|
20
12
|
--top: 0;
|
|
21
13
|
--color: var(--adm-badge-color, #ff411c);
|
|
22
14
|
}
|
|
15
|
+
.adm-badge-content {
|
|
16
|
+
color: #fff;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
min-width: 8px;
|
|
19
|
+
padding: 1px 4px;
|
|
20
|
+
font-size: 9px;
|
|
21
|
+
line-height: 12px;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
font-weight: normal;
|
|
24
|
+
text-align: center;
|
|
25
|
+
}
|
|
23
26
|
.adm-badge-fixed {
|
|
24
27
|
position: absolute;
|
|
25
28
|
right: var(--right);
|
|
@@ -32,3 +35,6 @@
|
|
|
32
35
|
height: 10px;
|
|
33
36
|
border-radius: 5px;
|
|
34
37
|
}
|
|
38
|
+
.adm-badge-bordered {
|
|
39
|
+
border: solid 1px var(--adm-color-white);
|
|
40
|
+
}
|
|
@@ -24,16 +24,15 @@ const Badge = props => {
|
|
|
24
24
|
children
|
|
25
25
|
} = props;
|
|
26
26
|
const isDot = content === dot;
|
|
27
|
-
const badgeCls = (0, _classnames.default)(classPrefix, {
|
|
28
|
-
[`${classPrefix}-fixed`]: !!children,
|
|
29
|
-
[`${classPrefix}-dot`]: isDot
|
|
30
|
-
});
|
|
27
|
+
const badgeCls = (0, _classnames.default)(classPrefix, !!children && `${classPrefix}-fixed`, isDot && `${classPrefix}-dot`, props.bordered && `${classPrefix}-bordered`);
|
|
31
28
|
const element = content ? (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
32
29
|
className: badgeCls,
|
|
33
30
|
style: {
|
|
34
31
|
'--color': color
|
|
35
32
|
}
|
|
36
|
-
}, !isDot &&
|
|
33
|
+
}, !isDot && _react.default.createElement("div", {
|
|
34
|
+
className: `${classPrefix}-content`
|
|
35
|
+
}, content))) : null;
|
|
37
36
|
return children ? _react.default.createElement("div", {
|
|
38
37
|
className: `${classPrefix}-wrap`
|
|
39
38
|
}, children, element) : element;
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
display: inline-block;
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
height: auto;
|
|
15
|
-
padding:
|
|
15
|
+
padding: 7px 12px;
|
|
16
16
|
margin: 0;
|
|
17
|
-
font-size:
|
|
17
|
+
font-size: 17px;
|
|
18
18
|
line-height: 1.4;
|
|
19
19
|
text-align: center;
|
|
20
20
|
border: var(--border-width) var(--border-style) var(--border-color);
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
.adm-button:not(.adm-button-default).adm-button-fill-none {
|
|
64
64
|
--text-color: var(--color);
|
|
65
65
|
--background-color: transparent;
|
|
66
|
-
--border-
|
|
66
|
+
--border-width: 0px;
|
|
67
67
|
}
|
|
68
68
|
.adm-button-primary {
|
|
69
69
|
--color: var(--adm-color-primary);
|
|
@@ -23,6 +23,8 @@ var _configProvider = require("../config-provider");
|
|
|
23
23
|
|
|
24
24
|
var _isoWeek = _interopRequireDefault(require("dayjs/plugin/isoWeek"));
|
|
25
25
|
|
|
26
|
+
var _ahooks = require("ahooks");
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -91,7 +93,7 @@ const Calendar = p => {
|
|
|
91
93
|
}, [props.selectionMode, props.value, props.defaultValue]);
|
|
92
94
|
const [begin, setBegin] = (0, _react.useState)(null);
|
|
93
95
|
const [end, setEnd] = (0, _react.useState)(null);
|
|
94
|
-
(0,
|
|
96
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
95
97
|
setBegin(dateRange[0] ? (0, _dayjs.default)(dateRange[0]) : null);
|
|
96
98
|
setEnd(dateRange[1] ? (0, _dayjs.default)(dateRange[1]) : null);
|
|
97
99
|
}, [dateRange[0], dateRange[1]]);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { NativeProps } from '../../utils/native-props';
|
|
3
2
|
import type { PickerViewProps } from '../picker-view';
|
|
4
3
|
import type { CascadePickerOption } from '../cascade-picker';
|
|
5
4
|
export declare type CascadePickerViewProps = Omit<PickerViewProps, 'columns'> & {
|
|
6
5
|
options: CascadePickerOption[];
|
|
7
|
-
}
|
|
6
|
+
};
|
|
8
7
|
export declare const CascadePickerView: FC<CascadePickerViewProps>;
|
|
@@ -15,19 +15,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
15
15
|
|
|
16
16
|
const CheckIcon = (0, _react.memo)(props => {
|
|
17
17
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
|
|
18
|
-
viewBox: '0 0
|
|
19
|
-
}, _react.default.createElement("g", {
|
|
20
|
-
stroke: 'none',
|
|
21
|
-
strokeWidth: '1',
|
|
22
|
-
fill: 'none',
|
|
23
|
-
fillRule: 'evenodd'
|
|
24
|
-
}, _react.default.createElement("g", {
|
|
25
|
-
transform: 'translate(-35.000000, -40.000000)',
|
|
26
|
-
fill: 'currentColor'
|
|
27
|
-
}, _react.default.createElement("g", {
|
|
28
|
-
transform: 'translate(24.000000, 26.000000)'
|
|
18
|
+
viewBox: '0 0 40 40'
|
|
29
19
|
}, _react.default.createElement("path", {
|
|
30
|
-
d: '
|
|
31
|
-
|
|
20
|
+
d: 'M31.5541766,15 L28.0892433,15 L28.0892434,15 C27.971052,15 27.8576674,15.044522 27.7740471,15.1239792 L18.2724722,24.1625319 L13.2248725,19.3630279 L13.2248725,19.3630279 C13.1417074,19.2834412 13.0287551,19.2384807 12.9107898,19.2380079 L9.44474455,19.2380079 L9.44474454,19.2380079 C9.19869815,19.2384085 8.99957935,19.4284738 9,19.66253 C9,19.7747587 9.04719253,19.8823283 9.13066188,19.9616418 L17.0907466,27.5338228 C17.4170809,27.8442545 17.8447695,28 18.2713393,28 L18.2980697,28 C18.7168464,27.993643 19.133396,27.8378975 19.4530492,27.5338228 L31.8693384,15.7236361 L31.8693384,15.7236361 C32.0434167,15.5582251 32.0435739,15.2898919 31.8696892,15.1242941 C31.7860402,15.0446329 31.6725052,15 31.5541421,15 L31.5541766,15 Z',
|
|
21
|
+
fill: 'currentColor'
|
|
22
|
+
})));
|
|
32
23
|
});
|
|
33
24
|
exports.CheckIcon = CheckIcon;
|
|
@@ -16,16 +16,14 @@
|
|
|
16
16
|
border: 1px solid var(--adm-color-light);
|
|
17
17
|
border-radius: var(--icon-size);
|
|
18
18
|
box-sizing: border-box;
|
|
19
|
-
display: flex;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
align-items: center;
|
|
22
19
|
width: var(--icon-size);
|
|
23
20
|
height: var(--icon-size);
|
|
24
|
-
color:
|
|
21
|
+
color: var(--adm-color-white);
|
|
25
22
|
}
|
|
26
|
-
.adm-checkbox .adm-checkbox-icon
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
.adm-checkbox .adm-checkbox-icon > svg {
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
29
27
|
}
|
|
30
28
|
.adm-checkbox.adm-checkbox-block {
|
|
31
29
|
display: flex;
|
|
@@ -52,12 +50,6 @@
|
|
|
52
50
|
background-color: #ffffff;
|
|
53
51
|
color: var(--adm-color-primary);
|
|
54
52
|
}
|
|
55
|
-
.adm-checkbox.adm-checkbox-indeterminate .adm-checkbox-indeterminate-checked {
|
|
56
|
-
width: 60%;
|
|
57
|
-
height: 60%;
|
|
58
|
-
border-radius: 100%;
|
|
59
|
-
background-color: currentColor;
|
|
60
|
-
}
|
|
61
53
|
.adm-checkbox-content {
|
|
62
54
|
flex: 0 1 auto;
|
|
63
55
|
font-size: var(--font-size);
|
|
@@ -21,6 +21,8 @@ var _devLog = require("../../utils/dev-log");
|
|
|
21
21
|
|
|
22
22
|
var _checkIcon = require("./check-icon");
|
|
23
23
|
|
|
24
|
+
var _indeterminateIcon = require("./indeterminate-icon");
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -85,11 +87,7 @@ const Checkbox = p => {
|
|
|
85
87
|
|
|
86
88
|
return _react.default.createElement("div", {
|
|
87
89
|
className: `${classPrefix}-icon`
|
|
88
|
-
}, props.indeterminate ? _react.default.createElement(
|
|
89
|
-
className: `${classPrefix}-indeterminate-checked`
|
|
90
|
-
}) : checked && _react.default.createElement(_checkIcon.CheckIcon, {
|
|
91
|
-
className: `${classPrefix}-icon-checked`
|
|
92
|
-
}));
|
|
90
|
+
}, props.indeterminate ? _react.default.createElement(_indeterminateIcon.IndeterminateIcon, null) : checked && _react.default.createElement(_checkIcon.CheckIcon, null));
|
|
93
91
|
};
|
|
94
92
|
|
|
95
93
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
|