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
|
@@ -2,28 +2,29 @@ import React, { ReactElement } from 'react';
|
|
|
2
2
|
import type { TooltipProps } from 'rc-tooltip/lib/Tooltip';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { GetContainer } from '../../utils/render-to-container';
|
|
6
|
+
export declare type PopoverProps = {
|
|
7
|
+
getContainer?: GetContainer;
|
|
7
8
|
destroyOnHide?: boolean;
|
|
8
9
|
children: ReactElement;
|
|
9
10
|
mode?: 'light' | 'dark';
|
|
10
11
|
trigger?: 'click';
|
|
11
|
-
placement
|
|
12
|
+
placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
12
13
|
stopPropagation?: PropagationEvent[];
|
|
13
|
-
|
|
14
|
+
content: React.ReactNode;
|
|
15
|
+
} & Pick<TooltipProps, 'defaultVisible' | 'visible' | 'onVisibleChange' | 'align'> & NativeProps<'--z-index'>;
|
|
14
16
|
export declare type PopoverRef = {
|
|
15
17
|
show: () => void;
|
|
16
18
|
hide: () => void;
|
|
17
19
|
visible: boolean;
|
|
18
20
|
};
|
|
19
21
|
export declare const Popover: React.ForwardRefExoticComponent<{
|
|
20
|
-
getContainer?: (() => HTMLElement) | undefined;
|
|
22
|
+
getContainer?: HTMLElement | (() => HTMLElement) | null | undefined;
|
|
21
23
|
destroyOnHide?: boolean | undefined;
|
|
22
24
|
children: ReactElement;
|
|
23
25
|
mode?: "dark" | "light" | undefined;
|
|
24
26
|
trigger?: "click" | undefined;
|
|
25
|
-
placement
|
|
27
|
+
placement?: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | undefined;
|
|
26
28
|
stopPropagation?: "click"[] | undefined;
|
|
27
|
-
} & Pick<TooltipProps, "visible" | "zIndex" | "align" | "defaultVisible" | "onVisibleChange" | "overlayStyle" | "overlayClassName"> & NativeProps<"--z-index"> & {
|
|
28
29
|
content: React.ReactNode;
|
|
29
|
-
} & React.RefAttributes<PopoverRef>>;
|
|
30
|
+
} & Pick<TooltipProps, "visible" | "align" | "defaultVisible" | "onVisibleChange"> & NativeProps<"--z-index"> & React.RefAttributes<PopoverRef>>;
|
|
@@ -17,6 +17,8 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
17
17
|
|
|
18
18
|
var _withStopPropagation = require("../../utils/with-stop-propagation");
|
|
19
19
|
|
|
20
|
+
var _arrow = require("./arrow");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
24
|
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); }
|
|
@@ -24,11 +26,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
24
26
|
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; }
|
|
25
27
|
|
|
26
28
|
const classPrefix = `adm-popover`;
|
|
27
|
-
const enterClassName = 'entering';
|
|
28
|
-
const leaveClassName = 'leaving';
|
|
29
29
|
const defaultProps = {
|
|
30
|
+
placement: 'top',
|
|
30
31
|
defaultVisible: false,
|
|
31
|
-
stopPropagation: ['click']
|
|
32
|
+
stopPropagation: ['click'],
|
|
33
|
+
getContainer: () => document.body
|
|
32
34
|
};
|
|
33
35
|
const Popover = (0, _react.forwardRef)((p, ref) => {
|
|
34
36
|
var _a;
|
|
@@ -53,27 +55,19 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
|
|
|
53
55
|
className: `${classPrefix}-inner-content`
|
|
54
56
|
}, props.content));
|
|
55
57
|
return _react.default.createElement(_rcTooltip.default, Object.assign({}, props, {
|
|
56
|
-
|
|
58
|
+
placement: props.placement,
|
|
59
|
+
align: props.align,
|
|
60
|
+
overlayClassName: (0, _classnames.default)(`${classPrefix}-${mode}`, props.className),
|
|
61
|
+
overlayStyle: props.style,
|
|
57
62
|
destroyTooltipOnHide: props.destroyOnHide,
|
|
58
63
|
prefixCls: classPrefix,
|
|
59
64
|
getTooltipContainer: props.getContainer || (() => document.body),
|
|
60
65
|
visible: visible,
|
|
61
|
-
arrowContent: _react.default.createElement(
|
|
62
|
-
className: `${classPrefix}-arrow-
|
|
66
|
+
arrowContent: _react.default.createElement(_arrow.Arrow, {
|
|
67
|
+
className: `${classPrefix}-arrow-icon`
|
|
63
68
|
}),
|
|
64
69
|
onVisibleChange: setVisible,
|
|
65
70
|
trigger: (_a = props.trigger) !== null && _a !== void 0 ? _a : [],
|
|
66
|
-
motion: {
|
|
67
|
-
motionName: {
|
|
68
|
-
appear: enterClassName,
|
|
69
|
-
appearActive: enterClassName,
|
|
70
|
-
enter: enterClassName,
|
|
71
|
-
enterActive: enterClassName,
|
|
72
|
-
leaveActive: leaveClassName,
|
|
73
|
-
leave: leaveClassName
|
|
74
|
-
},
|
|
75
|
-
motionDeadline: 200
|
|
76
|
-
},
|
|
77
71
|
overlay: overlay
|
|
78
72
|
}), props.children);
|
|
79
73
|
});
|
|
@@ -18,18 +18,15 @@
|
|
|
18
18
|
border: 2px solid var(--adm-color-light);
|
|
19
19
|
border-radius: var(--icon-size);
|
|
20
20
|
box-sizing: border-box;
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
align-items: center;
|
|
24
21
|
width: var(--icon-size);
|
|
25
22
|
height: var(--icon-size);
|
|
26
|
-
color:
|
|
23
|
+
color: var(--adm-color-white);
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
.adm-radio .adm-radio-icon
|
|
26
|
+
.adm-radio .adm-radio-icon > svg {
|
|
30
27
|
display: block;
|
|
31
|
-
width:
|
|
32
|
-
height:
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
.adm-radio.adm-radio-block {
|
|
@@ -70,9 +70,7 @@ const Radio = p => {
|
|
|
70
70
|
|
|
71
71
|
return _react.default.createElement("div", {
|
|
72
72
|
className: `${classPrefix}-icon`
|
|
73
|
-
}, checked && _react.default.createElement(_checkIcon.CheckIcon,
|
|
74
|
-
className: `${classPrefix}-icon-checked`
|
|
75
|
-
}));
|
|
73
|
+
}, checked && _react.default.createElement(_checkIcon.CheckIcon, null));
|
|
76
74
|
};
|
|
77
75
|
|
|
78
76
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
.adm-selector {
|
|
2
|
-
--color:
|
|
2
|
+
--color: #f5f5f5;
|
|
3
3
|
--checked-color: #e7f1ff;
|
|
4
|
+
--text-color: var(--adm-color-text);
|
|
5
|
+
--checked-text-color: var(--adm-color-primary);
|
|
6
|
+
--border: none;
|
|
7
|
+
--checked-border: none;
|
|
8
|
+
--border-radius: 4px;
|
|
9
|
+
--padding: 16px 32px;
|
|
4
10
|
overflow: hidden;
|
|
5
11
|
font-size: 30px;
|
|
6
12
|
line-height: 1.4;
|
|
@@ -11,11 +17,12 @@
|
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
.adm-selector-item {
|
|
14
|
-
padding:
|
|
20
|
+
padding: var(--padding);
|
|
15
21
|
position: relative;
|
|
16
|
-
background-color:
|
|
17
|
-
border
|
|
18
|
-
|
|
22
|
+
background-color: var(--color);
|
|
23
|
+
border: var(--border);
|
|
24
|
+
border-radius: var(--border-radius);
|
|
25
|
+
color: var(--text-color);
|
|
19
26
|
opacity: 1;
|
|
20
27
|
cursor: pointer;
|
|
21
28
|
display: inline-block;
|
|
@@ -31,8 +38,9 @@
|
|
|
31
38
|
|
|
32
39
|
.adm-selector-item-active,
|
|
33
40
|
.adm-selector-item-multiple-active {
|
|
34
|
-
color: var(--
|
|
41
|
+
color: var(--checked-text-color);
|
|
35
42
|
background-color: var(--checked-color);
|
|
43
|
+
border: var(--checked-border);
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
.adm-selector-item .adm-selector-check-mark-wrapper {
|
|
@@ -16,5 +16,6 @@ export declare type SelectorProps<V> = {
|
|
|
16
16
|
onChange?: (v: V[], extend: {
|
|
17
17
|
items: SelectorOption<V>[];
|
|
18
18
|
}) => void;
|
|
19
|
-
|
|
19
|
+
showCheckMark?: boolean;
|
|
20
|
+
} & NativeProps<'--color' | '--checked-color' | '--text-color' | '--checked-text-color' | '--border' | '--checked-border' | '--border-radius' | '--padding'>;
|
|
20
21
|
export declare const Selector: <V extends string | number>(p: SelectorProps<V>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
@@ -28,7 +28,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
28
|
const classPrefix = `adm-selector`;
|
|
29
29
|
const defaultProps = {
|
|
30
30
|
multiple: false,
|
|
31
|
-
defaultValue: []
|
|
31
|
+
defaultValue: [],
|
|
32
|
+
showCheckMark: true
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const Selector = p => {
|
|
@@ -74,7 +75,7 @@ const Selector = p => {
|
|
|
74
75
|
}
|
|
75
76
|
}, option.label, option.description && _react.default.createElement("div", {
|
|
76
77
|
className: `${classPrefix}-item-description`
|
|
77
|
-
}, option.description), active && _react.default.createElement("div", {
|
|
78
|
+
}, option.description), active && props.showCheckMark && _react.default.createElement("div", {
|
|
78
79
|
className: `${classPrefix}-check-mark-wrapper`
|
|
79
80
|
}, _react.default.createElement(_checkMark.CheckMark, null)));
|
|
80
81
|
});
|
|
@@ -212,7 +212,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
212
212
|
swipeNext,
|
|
213
213
|
swipePrev
|
|
214
214
|
}));
|
|
215
|
-
(0,
|
|
215
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
216
216
|
const maxIndex = validChildren.length - 1;
|
|
217
217
|
|
|
218
218
|
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 {
|
|
@@ -163,7 +163,7 @@ const Tabs = p => {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
(0,
|
|
166
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
167
167
|
animate(true);
|
|
168
168
|
}, []);
|
|
169
169
|
(0, _ahooks.useUpdateLayoutEffect)(() => {
|
|
@@ -197,7 +197,7 @@ const Tabs = p => {
|
|
|
197
197
|
trailing: true,
|
|
198
198
|
leading: true
|
|
199
199
|
});
|
|
200
|
-
(0,
|
|
200
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
201
201
|
updateMask(true);
|
|
202
202
|
}, []);
|
|
203
203
|
return (0, _nativeProps.withNativeProps)(props, _react.default.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;
|
|
@@ -5,18 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TextArea = void 0;
|
|
7
7
|
|
|
8
|
-
var _tslib = require("tslib");
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
9
|
|
|
12
|
-
var
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
13
11
|
|
|
14
12
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
15
13
|
|
|
16
14
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
15
|
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
16
|
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); }
|
|
21
17
|
|
|
22
18
|
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; }
|
|
@@ -31,16 +27,10 @@ const defaultProps = {
|
|
|
31
27
|
const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
32
28
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
33
29
|
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onChange: outerOnChange,
|
|
39
|
-
rows: rows,
|
|
40
|
-
autoSize: autoSize,
|
|
41
|
-
showCount
|
|
42
|
-
} = props,
|
|
43
|
-
textAreaProps = (0, _tslib.__rest)(props, ["className", "style", "defaultValue", "value", "onChange", "rows", "autoSize", "showCount"]);
|
|
30
|
+
autoSize,
|
|
31
|
+
showCount,
|
|
32
|
+
maxLength
|
|
33
|
+
} = props;
|
|
44
34
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
45
35
|
const nativeTextAreaRef = (0, _react.useRef)(null);
|
|
46
36
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
@@ -80,40 +70,59 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
80
70
|
|
|
81
71
|
textArea.style.height = `${height}px`;
|
|
82
72
|
}, [value, autoSize]);
|
|
73
|
+
const compositingRef = (0, _react.useRef)(false);
|
|
83
74
|
let count;
|
|
75
|
+
const valueLength = [...value].length;
|
|
84
76
|
|
|
85
77
|
if (typeof showCount === 'function') {
|
|
86
|
-
count = showCount(
|
|
78
|
+
count = showCount(valueLength, maxLength);
|
|
87
79
|
} else if (showCount) {
|
|
88
80
|
count = _react.default.createElement("div", {
|
|
89
81
|
className: `${classPrefix}-count`
|
|
90
|
-
},
|
|
82
|
+
}, maxLength === undefined ? valueLength : valueLength + '/' + maxLength);
|
|
91
83
|
}
|
|
92
84
|
|
|
93
|
-
return _react.default.createElement("div", {
|
|
94
|
-
className:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
className: classPrefix,
|
|
100
|
-
rows: rows,
|
|
85
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
86
|
+
className: classPrefix
|
|
87
|
+
}, _react.default.createElement("textarea", {
|
|
88
|
+
ref: nativeTextAreaRef,
|
|
89
|
+
className: `${classPrefix}-element`,
|
|
90
|
+
rows: props.rows,
|
|
101
91
|
value: value,
|
|
92
|
+
placeholder: props.placeholder,
|
|
102
93
|
onChange: e => {
|
|
103
|
-
|
|
94
|
+
let v = e.target.value;
|
|
95
|
+
|
|
96
|
+
if (maxLength && !compositingRef.current) {
|
|
97
|
+
v = [...v].slice(0, maxLength).join('');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
setValue(v);
|
|
104
101
|
},
|
|
105
|
-
|
|
102
|
+
id: props.id,
|
|
103
|
+
onCompositionStart: e => {
|
|
106
104
|
var _a;
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
compositingRef.current = true;
|
|
107
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
109
108
|
},
|
|
110
|
-
|
|
109
|
+
onCompositionEnd: e => {
|
|
111
110
|
var _a;
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
compositingRef.current = false;
|
|
113
|
+
|
|
114
|
+
if (maxLength) {
|
|
115
|
+
setValue([...value].slice(0, maxLength).join(''));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
114
119
|
},
|
|
115
|
-
|
|
116
|
-
|
|
120
|
+
autoComplete: props.autoComplete,
|
|
121
|
+
disabled: props.disabled,
|
|
122
|
+
readOnly: props.readOnly,
|
|
123
|
+
onFocus: props.onFocus,
|
|
124
|
+
onBlur: props.onBlur
|
|
125
|
+
}), count));
|
|
117
126
|
});
|
|
118
127
|
exports.TextArea = TextArea;
|
|
119
128
|
TextArea.defaultProps = defaultProps;
|
|
@@ -17,6 +17,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
17
17
|
|
|
18
18
|
var _antdMobileIcons = require("antd-mobile-icons");
|
|
19
19
|
|
|
20
|
+
var _ahooks = require("ahooks");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
24
|
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); }
|
|
@@ -47,7 +49,7 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
47
49
|
content.scrollLeft = content.clientWidth;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
(0,
|
|
52
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
51
53
|
scrollToEnd();
|
|
52
54
|
}, [value]);
|
|
53
55
|
(0, _react.useEffect)(() => {
|
|
@@ -12,7 +12,7 @@ const defaultRoot = _canUseDom.canUseDom ? window : undefined;
|
|
|
12
12
|
|
|
13
13
|
function isElement(node) {
|
|
14
14
|
const ELEMENT_NODE_TYPE = 1;
|
|
15
|
-
return node.
|
|
15
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
16
16
|
} // https://github.com/youzan/vant/issues/3823
|
|
17
17
|
|
|
18
18
|
|
|
@@ -10,7 +10,7 @@ var _react = require("react");
|
|
|
10
10
|
function useRefState(initialState) {
|
|
11
11
|
const [state, setState] = (0, _react.useState)(initialState);
|
|
12
12
|
const ref = (0, _react.useRef)(state);
|
|
13
|
-
(0, _react.
|
|
13
|
+
(0, _react.useEffect)(() => {
|
|
14
14
|
ref.current = state;
|
|
15
15
|
}, [state]);
|
|
16
16
|
return [state, setState, ref];
|
|
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useResizeEffect = useResizeEffect;
|
|
7
7
|
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _ahooks = require("ahooks");
|
|
11
9
|
|
|
12
10
|
function useResizeEffect(effect, targetRef) {
|
|
13
11
|
const fn = (0, _ahooks.useMemoizedFn)(effect);
|
|
14
|
-
(0,
|
|
12
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
15
13
|
const target = targetRef.current;
|
|
16
14
|
if (!target) return;
|
|
17
15
|
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useTabListScroll = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _web = require("@react-spring/web");
|
|
11
9
|
|
|
12
10
|
var _useMutationEffect = require("./use-mutation-effect");
|
|
@@ -49,7 +47,7 @@ const useTabListScroll = (targetRef, activeIndex) => {
|
|
|
49
47
|
});
|
|
50
48
|
}
|
|
51
49
|
|
|
52
|
-
(0,
|
|
50
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
53
51
|
animate(true);
|
|
54
52
|
}, []);
|
|
55
53
|
(0, _ahooks.useUpdateLayoutEffect)(() => {
|
|
@@ -4,24 +4,28 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.adm-badge {
|
|
7
|
-
display: inline-
|
|
8
|
-
color: #fff;
|
|
9
|
-
font-weight: normal;
|
|
10
|
-
text-align: center;
|
|
7
|
+
display: inline-flex;
|
|
11
8
|
vertical-align: middle;
|
|
12
|
-
box-sizing:
|
|
13
|
-
min-width: 32px;
|
|
9
|
+
box-sizing: content-box;
|
|
14
10
|
border-radius: 200px;
|
|
15
|
-
padding: 0 8px;
|
|
16
|
-
font-size: 18px;
|
|
17
|
-
line-height: 28px;
|
|
18
|
-
white-space: nowrap;
|
|
19
11
|
background-color: var(--color);
|
|
20
12
|
--right: 0;
|
|
21
13
|
--top: 0;
|
|
22
14
|
--color: var(--adm-badge-color, #ff411c);
|
|
23
15
|
}
|
|
24
16
|
|
|
17
|
+
.adm-badge-content {
|
|
18
|
+
color: #fff;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
min-width: 16px;
|
|
21
|
+
padding: 2px 8px;
|
|
22
|
+
font-size: 18px;
|
|
23
|
+
line-height: 24px;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
font-weight: normal;
|
|
26
|
+
text-align: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
.adm-badge-fixed {
|
|
26
30
|
position: absolute;
|
|
27
31
|
right: var(--right);
|
|
@@ -34,4 +38,8 @@
|
|
|
34
38
|
width: 20px;
|
|
35
39
|
height: 20px;
|
|
36
40
|
border-radius: 10px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.adm-badge-bordered {
|
|
44
|
+
border: solid 2px var(--adm-color-white);
|
|
37
45
|
}
|
|
@@ -10,16 +10,15 @@ export const Badge = props => {
|
|
|
10
10
|
children
|
|
11
11
|
} = props;
|
|
12
12
|
const isDot = content === dot;
|
|
13
|
-
const badgeCls = classNames(classPrefix, {
|
|
14
|
-
[`${classPrefix}-fixed`]: !!children,
|
|
15
|
-
[`${classPrefix}-dot`]: isDot
|
|
16
|
-
});
|
|
13
|
+
const badgeCls = classNames(classPrefix, !!children && `${classPrefix}-fixed`, isDot && `${classPrefix}-dot`, props.bordered && `${classPrefix}-bordered`);
|
|
17
14
|
const element = content ? withNativeProps(props, React.createElement("div", {
|
|
18
15
|
className: badgeCls,
|
|
19
16
|
style: {
|
|
20
17
|
'--color': color
|
|
21
18
|
}
|
|
22
|
-
}, !isDot &&
|
|
19
|
+
}, !isDot && React.createElement("div", {
|
|
20
|
+
className: `${classPrefix}-content`
|
|
21
|
+
}, content))) : null;
|
|
23
22
|
return children ? React.createElement("div", {
|
|
24
23
|
className: `${classPrefix}-wrap`
|
|
25
24
|
}, 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: 14px 24px;
|
|
16
16
|
margin: 0;
|
|
17
|
-
font-size:
|
|
17
|
+
font-size: 34px;
|
|
18
18
|
line-height: 1.4;
|
|
19
19
|
text-align: center;
|
|
20
20
|
border: var(--border-width) var(--border-style) var(--border-color);
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
.adm-button:not(.adm-button-default).adm-button-fill-none {
|
|
72
72
|
--text-color: var(--color);
|
|
73
73
|
--background-color: transparent;
|
|
74
|
-
--border-
|
|
74
|
+
--border-width: 0;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
.adm-button-primary {
|