antd-mobile 5.5.1 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +5 -5
- package/2x/cjs/components/action-sheet/action-sheet.js +6 -46
- package/2x/cjs/components/action-sheet/index.d.ts +1 -1
- package/2x/cjs/components/badge/badge.js +1 -1
- package/2x/cjs/components/calendar/calendar.d.ts +4 -3
- package/2x/cjs/components/calendar/calendar.js +67 -56
- package/2x/cjs/components/calendar/convert.d.ts +2 -0
- package/2x/cjs/components/calendar/convert.js +22 -0
- package/2x/cjs/components/cascader-view/cascader-view.js +7 -0
- package/2x/cjs/components/checkbox/checkbox.js +4 -20
- package/2x/cjs/components/checkbox/native-input.d.ts +10 -0
- package/2x/cjs/components/checkbox/native-input.js +42 -0
- package/2x/cjs/components/dialog/index.d.ts +1 -1
- package/2x/cjs/components/dialog/show.d.ts +2 -4
- package/2x/cjs/components/dialog/show.js +9 -47
- package/2x/cjs/components/dot-loading/dot-loading.js +1 -2
- package/2x/cjs/components/empty/empty-icon.d.ts +3 -0
- package/2x/cjs/components/empty/empty-icon.js +37 -0
- package/2x/cjs/components/empty/empty.js +27 -15
- package/2x/cjs/components/error-block/error-block.css +1 -0
- package/2x/cjs/components/error-block/error-block.js +5 -8
- package/2x/cjs/components/error-block/images/busy.d.ts +1 -0
- package/2x/cjs/components/error-block/images/busy.js +102 -0
- package/2x/cjs/components/error-block/images/default.d.ts +1 -0
- package/2x/cjs/components/error-block/images/default.js +178 -0
- package/2x/cjs/components/error-block/images/disconnected.d.ts +1 -0
- package/2x/cjs/components/error-block/images/disconnected.js +135 -0
- package/2x/cjs/components/error-block/images/empty.d.ts +1 -0
- package/2x/cjs/components/error-block/images/empty.js +131 -0
- package/2x/cjs/components/error-block/images/index.d.ts +2 -0
- package/2x/cjs/components/error-block/images/index.js +22 -0
- package/2x/cjs/components/floating-bubble/floating-bubble.css +2 -1
- package/2x/cjs/components/floating-bubble/floating-bubble.d.ts +1 -1
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +4 -1
- package/2x/cjs/components/image-viewer/index.d.ts +1 -1
- package/2x/cjs/components/image-viewer/methods.d.ts +3 -7
- package/2x/cjs/components/image-viewer/methods.js +13 -79
- package/2x/cjs/components/modal/index.d.ts +1 -1
- package/2x/cjs/components/modal/show.d.ts +2 -4
- package/2x/cjs/components/modal/show.js +9 -47
- package/2x/cjs/components/picker/picker.js +6 -9
- package/2x/cjs/components/picker-view/columns-extend.d.ts +3 -0
- package/2x/cjs/components/picker-view/columns-extend.js +45 -0
- package/2x/cjs/components/picker-view/picker-view.d.ts +1 -0
- package/2x/cjs/components/picker-view/picker-view.js +14 -16
- package/2x/cjs/components/popover/popover.css +1 -0
- package/2x/cjs/components/popover/popover.js +1 -0
- package/2x/cjs/components/popover/temp-floating-ui.min.js +1 -430
- package/2x/cjs/components/radio/radio.js +4 -20
- package/2x/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/2x/cjs/components/tab-bar/tab-bar.d.ts +1 -1
- package/2x/cjs/components/tab-bar/tab-bar.js +1 -1
- package/2x/cjs/components/tree-select/tree-select.js +2 -2
- package/2x/cjs/utils/render-imperatively.d.ts +10 -0
- package/2x/cjs/utils/render-imperatively.js +68 -0
- package/2x/cjs/utils/with-cache.d.ts +1 -0
- package/2x/cjs/utils/with-cache.js +17 -0
- package/2x/es/components/action-sheet/action-sheet.d.ts +5 -5
- package/2x/es/components/action-sheet/action-sheet.js +5 -41
- package/2x/es/components/action-sheet/index.d.ts +1 -1
- package/2x/es/components/badge/badge.js +1 -1
- package/2x/es/components/calendar/calendar.d.ts +4 -3
- package/2x/es/components/calendar/calendar.js +67 -58
- package/2x/es/components/calendar/convert.d.ts +2 -0
- package/2x/es/components/calendar/convert.js +15 -0
- package/2x/es/components/cascader-view/cascader-view.js +7 -0
- package/2x/es/components/checkbox/checkbox.js +4 -21
- package/2x/es/components/checkbox/native-input.d.ts +10 -0
- package/2x/es/components/checkbox/native-input.js +28 -0
- package/2x/es/components/dialog/index.d.ts +1 -1
- package/2x/es/components/dialog/show.d.ts +2 -4
- package/2x/es/components/dialog/show.js +8 -44
- package/2x/es/components/dot-loading/dot-loading.js +1 -2
- package/2x/es/components/empty/empty-icon.d.ts +3 -0
- package/2x/es/components/empty/empty-icon.js +24 -0
- package/2x/es/components/empty/empty.js +27 -14
- package/2x/es/components/error-block/error-block.css +1 -0
- package/2x/es/components/error-block/error-block.js +4 -6
- package/2x/es/components/error-block/images/busy.d.ts +1 -0
- package/2x/es/components/error-block/images/busy.js +90 -0
- package/2x/es/components/error-block/images/default.d.ts +1 -0
- package/2x/es/components/error-block/images/default.js +166 -0
- package/2x/es/components/error-block/images/disconnected.d.ts +1 -0
- package/2x/es/components/error-block/images/disconnected.js +123 -0
- package/2x/es/components/error-block/images/empty.d.ts +1 -0
- package/2x/es/components/error-block/images/empty.js +119 -0
- package/2x/es/components/error-block/images/index.d.ts +2 -0
- package/2x/es/components/error-block/images/index.js +10 -0
- package/2x/es/components/floating-bubble/floating-bubble.css +2 -1
- package/2x/es/components/floating-bubble/floating-bubble.d.ts +1 -1
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +4 -1
- package/2x/es/components/image-viewer/index.d.ts +1 -1
- package/2x/es/components/image-viewer/methods.d.ts +3 -7
- package/2x/es/components/image-viewer/methods.js +12 -75
- package/2x/es/components/modal/index.d.ts +1 -1
- package/2x/es/components/modal/show.d.ts +2 -4
- package/2x/es/components/modal/show.js +8 -44
- package/2x/es/components/picker/picker.js +6 -8
- package/2x/es/components/picker-view/columns-extend.d.ts +3 -0
- package/2x/es/components/picker-view/columns-extend.js +34 -0
- package/2x/es/components/picker-view/picker-view.d.ts +1 -0
- package/2x/es/components/picker-view/picker-view.js +14 -15
- package/2x/es/components/popover/popover.css +1 -0
- package/2x/es/components/popover/popover.js +1 -0
- package/2x/es/components/popover/temp-floating-ui.min.js +1 -430
- package/2x/es/components/radio/radio.js +4 -21
- package/2x/es/components/search-bar/search-bar.d.ts +1 -1
- package/2x/es/components/tab-bar/tab-bar.d.ts +1 -1
- package/2x/es/components/tab-bar/tab-bar.js +1 -1
- package/2x/es/components/tree-select/tree-select.js +2 -2
- package/2x/es/utils/render-imperatively.d.ts +10 -0
- package/2x/es/utils/render-imperatively.js +53 -0
- package/2x/es/utils/with-cache.d.ts +1 -0
- package/2x/es/utils/with-cache.js +10 -0
- package/2x/package.json +2 -3
- package/cjs/components/action-sheet/action-sheet.d.ts +5 -5
- package/cjs/components/action-sheet/action-sheet.js +6 -46
- package/cjs/components/action-sheet/index.d.ts +1 -1
- package/cjs/components/badge/badge.js +1 -1
- package/cjs/components/calendar/calendar.d.ts +4 -3
- package/cjs/components/calendar/calendar.js +67 -56
- package/cjs/components/calendar/convert.d.ts +2 -0
- package/cjs/components/calendar/convert.js +22 -0
- package/cjs/components/cascader-view/cascader-view.js +7 -0
- package/cjs/components/checkbox/checkbox.js +4 -20
- package/cjs/components/checkbox/native-input.d.ts +10 -0
- package/cjs/components/checkbox/native-input.js +42 -0
- package/cjs/components/dialog/index.d.ts +1 -1
- package/cjs/components/dialog/show.d.ts +2 -4
- package/cjs/components/dialog/show.js +9 -47
- package/cjs/components/dot-loading/dot-loading.js +1 -2
- package/cjs/components/empty/empty-icon.d.ts +3 -0
- package/cjs/components/empty/empty-icon.js +37 -0
- package/cjs/components/empty/empty.js +27 -15
- package/cjs/components/error-block/error-block.css +1 -0
- package/cjs/components/error-block/error-block.js +5 -8
- package/cjs/components/error-block/images/busy.d.ts +1 -0
- package/cjs/components/error-block/images/busy.js +102 -0
- package/cjs/components/error-block/images/default.d.ts +1 -0
- package/cjs/components/error-block/images/default.js +178 -0
- package/cjs/components/error-block/images/disconnected.d.ts +1 -0
- package/cjs/components/error-block/images/disconnected.js +135 -0
- package/cjs/components/error-block/images/empty.d.ts +1 -0
- package/cjs/components/error-block/images/empty.js +131 -0
- package/cjs/components/error-block/images/index.d.ts +2 -0
- package/cjs/components/error-block/images/index.js +22 -0
- package/cjs/components/floating-bubble/floating-bubble.css +2 -1
- package/cjs/components/floating-bubble/floating-bubble.d.ts +1 -1
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +4 -1
- package/cjs/components/image-viewer/index.d.ts +1 -1
- package/cjs/components/image-viewer/methods.d.ts +3 -7
- package/cjs/components/image-viewer/methods.js +13 -79
- package/cjs/components/modal/index.d.ts +1 -1
- package/cjs/components/modal/show.d.ts +2 -4
- package/cjs/components/modal/show.js +9 -47
- package/cjs/components/picker/picker.js +6 -9
- package/cjs/components/picker-view/columns-extend.d.ts +3 -0
- package/cjs/components/picker-view/columns-extend.js +45 -0
- package/cjs/components/picker-view/picker-view.d.ts +1 -0
- package/cjs/components/picker-view/picker-view.js +14 -16
- package/cjs/components/popover/popover.css +1 -0
- package/cjs/components/popover/popover.js +1 -0
- package/cjs/components/popover/temp-floating-ui.min.js +1 -430
- package/cjs/components/radio/radio.js +4 -20
- package/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/cjs/components/tab-bar/tab-bar.d.ts +1 -1
- package/cjs/components/tab-bar/tab-bar.js +1 -1
- package/cjs/components/tree-select/tree-select.js +2 -2
- package/cjs/utils/render-imperatively.d.ts +10 -0
- package/cjs/utils/render-imperatively.js +68 -0
- package/cjs/utils/with-cache.d.ts +1 -0
- package/cjs/utils/with-cache.js +17 -0
- package/es/components/action-sheet/action-sheet.d.ts +5 -5
- package/es/components/action-sheet/action-sheet.js +5 -41
- package/es/components/action-sheet/index.d.ts +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/calendar/calendar.d.ts +4 -3
- package/es/components/calendar/calendar.js +67 -58
- package/es/components/calendar/convert.d.ts +2 -0
- package/es/components/calendar/convert.js +15 -0
- package/es/components/cascader-view/cascader-view.js +7 -0
- package/es/components/checkbox/checkbox.js +4 -21
- package/es/components/checkbox/native-input.d.ts +10 -0
- package/es/components/checkbox/native-input.js +28 -0
- package/es/components/dialog/index.d.ts +1 -1
- package/es/components/dialog/show.d.ts +2 -4
- package/es/components/dialog/show.js +8 -44
- package/es/components/dot-loading/dot-loading.js +1 -2
- package/es/components/empty/empty-icon.d.ts +3 -0
- package/es/components/empty/empty-icon.js +24 -0
- package/es/components/empty/empty.js +27 -14
- package/es/components/error-block/error-block.css +1 -0
- package/es/components/error-block/error-block.js +4 -6
- package/es/components/error-block/images/busy.d.ts +1 -0
- package/es/components/error-block/images/busy.js +90 -0
- package/es/components/error-block/images/default.d.ts +1 -0
- package/es/components/error-block/images/default.js +166 -0
- package/es/components/error-block/images/disconnected.d.ts +1 -0
- package/es/components/error-block/images/disconnected.js +123 -0
- package/es/components/error-block/images/empty.d.ts +1 -0
- package/es/components/error-block/images/empty.js +119 -0
- package/es/components/error-block/images/index.d.ts +2 -0
- package/es/components/error-block/images/index.js +10 -0
- package/es/components/floating-bubble/floating-bubble.css +2 -1
- package/es/components/floating-bubble/floating-bubble.d.ts +1 -1
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +4 -1
- package/es/components/image-viewer/index.d.ts +1 -1
- package/es/components/image-viewer/methods.d.ts +3 -7
- package/es/components/image-viewer/methods.js +12 -75
- package/es/components/modal/index.d.ts +1 -1
- package/es/components/modal/show.d.ts +2 -4
- package/es/components/modal/show.js +8 -44
- package/es/components/picker/picker.js +6 -8
- package/es/components/picker-view/columns-extend.d.ts +3 -0
- package/es/components/picker-view/columns-extend.js +34 -0
- package/es/components/picker-view/picker-view.d.ts +1 -0
- package/es/components/picker-view/picker-view.js +14 -15
- package/es/components/popover/popover.css +1 -0
- package/es/components/popover/popover.js +1 -0
- package/es/components/popover/temp-floating-ui.min.js +1 -430
- package/es/components/radio/radio.js +4 -21
- package/es/components/search-bar/search-bar.d.ts +1 -1
- package/es/components/tab-bar/tab-bar.d.ts +1 -1
- package/es/components/tab-bar/tab-bar.js +1 -1
- package/es/components/tree-select/tree-select.js +2 -2
- package/es/utils/render-imperatively.d.ts +10 -0
- package/es/utils/render-imperatively.js +53 -0
- package/es/utils/with-cache.d.ts +1 -0
- package/es/utils/with-cache.js +10 -0
- package/package.json +2 -3
- package/umd/antd-mobile.js +1 -1
- package/2x/assets/busy.svg +0 -42
- package/2x/assets/default.svg +0 -53
- package/2x/assets/disconnected.svg +0 -60
- package/2x/assets/empty-icon.svg +0 -18
- package/2x/assets/empty.svg +0 -52
- package/2x/cjs/assets/busy.svg +0 -42
- package/2x/cjs/assets/default.svg +0 -53
- package/2x/cjs/assets/disconnected.svg +0 -60
- package/2x/cjs/assets/empty-icon.svg +0 -18
- package/2x/cjs/assets/empty.svg +0 -52
- package/2x/cjs/components/error-block/error.d.ts +0 -1
- package/2x/cjs/components/error-block/error.js +0 -24
- package/2x/cjs/components/picker-view/use-columns.d.ts +0 -2
- package/2x/cjs/components/picker-view/use-columns.js +0 -18
- package/2x/cjs/components/picker-view/use-picker-value-extend.d.ts +0 -2
- package/2x/cjs/components/picker-view/use-picker-value-extend.js +0 -37
- package/2x/es/assets/busy.svg +0 -42
- package/2x/es/assets/default.svg +0 -53
- package/2x/es/assets/disconnected.svg +0 -60
- package/2x/es/assets/empty-icon.svg +0 -18
- package/2x/es/assets/empty.svg +0 -52
- package/2x/es/components/error-block/error.d.ts +0 -1
- package/2x/es/components/error-block/error.js +0 -10
- package/2x/es/components/picker-view/use-columns.d.ts +0 -2
- package/2x/es/components/picker-view/use-columns.js +0 -10
- package/2x/es/components/picker-view/use-picker-value-extend.d.ts +0 -2
- package/2x/es/components/picker-view/use-picker-value-extend.js +0 -26
- package/assets/busy.svg +0 -42
- package/assets/default.svg +0 -53
- package/assets/disconnected.svg +0 -60
- package/assets/empty-icon.svg +0 -18
- package/assets/empty.svg +0 -52
- package/cjs/assets/busy.svg +0 -42
- package/cjs/assets/default.svg +0 -53
- package/cjs/assets/disconnected.svg +0 -60
- package/cjs/assets/empty-icon.svg +0 -18
- package/cjs/assets/empty.svg +0 -52
- package/cjs/components/error-block/error.d.ts +0 -1
- package/cjs/components/error-block/error.js +0 -24
- package/cjs/components/picker-view/use-columns.d.ts +0 -2
- package/cjs/components/picker-view/use-columns.js +0 -18
- package/cjs/components/picker-view/use-picker-value-extend.d.ts +0 -2
- package/cjs/components/picker-view/use-picker-value-extend.js +0 -37
- package/es/assets/busy.svg +0 -42
- package/es/assets/default.svg +0 -53
- package/es/assets/disconnected.svg +0 -60
- package/es/assets/empty-icon.svg +0 -18
- package/es/assets/empty.svg +0 -52
- package/es/components/error-block/error.d.ts +0 -1
- package/es/components/error-block/error.js +0 -10
- package/es/components/picker-view/use-columns.d.ts +0 -2
- package/es/components/picker-view/use-columns.js +0 -10
- package/es/components/picker-view/use-picker-value-extend.d.ts +0 -2
- package/es/components/picker-view/use-picker-value-extend.js +0 -26
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.imageRecord = void 0;
|
|
7
|
+
|
|
8
|
+
var _default = require("./default");
|
|
9
|
+
|
|
10
|
+
var _disconnected = require("./disconnected");
|
|
11
|
+
|
|
12
|
+
var _empty = require("./empty");
|
|
13
|
+
|
|
14
|
+
var _busy = require("./busy");
|
|
15
|
+
|
|
16
|
+
const imageRecord = {
|
|
17
|
+
'default': _default.defaultImage,
|
|
18
|
+
'disconnected': _disconnected.disconnectedImage,
|
|
19
|
+
'empty': _empty.emptyImage,
|
|
20
|
+
'busy': _busy.busyImage
|
|
21
|
+
};
|
|
22
|
+
exports.imageRecord = imageRecord;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
--edge-distance: 0;
|
|
8
8
|
--size: 48px;
|
|
9
9
|
--border-radius: 50%;
|
|
10
|
+
--background: var(--adm-color-primary);
|
|
10
11
|
}
|
|
11
12
|
.adm-floating-bubble-boundary-outer {
|
|
12
13
|
position: fixed;
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
transition: opacity ease 0.15s;
|
|
41
42
|
user-select: none;
|
|
42
43
|
touch-action: none;
|
|
43
|
-
background: var(--
|
|
44
|
+
background: var(--background);
|
|
44
45
|
color: var(--adm-color-white);
|
|
45
46
|
border-radius: var(--border-radius);
|
|
46
47
|
z-index: var(--z-index);
|
|
@@ -4,5 +4,5 @@ export declare type FloatingBubbleProps = {
|
|
|
4
4
|
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
5
5
|
axis?: 'x' | 'y' | 'xy' | 'lock';
|
|
6
6
|
magnetic?: 'x' | 'y';
|
|
7
|
-
} & NativeProps<'--initial-position-left' | '--initial-position-right' | '--initial-position-top' | '--initial-position-bottom' | '--z-index' | '--edge-distance' | '--size' | '--border-radius'>;
|
|
7
|
+
} & NativeProps<'--initial-position-left' | '--initial-position-right' | '--initial-position-top' | '--initial-position-bottom' | '--z-index' | '--edge-distance' | '--size' | '--border-radius' | '--background'>;
|
|
8
8
|
export declare const FloatingBubble: FC<FloatingBubbleProps>;
|
|
@@ -7,7 +7,7 @@ import type { FormLayout } from './index';
|
|
|
7
7
|
declare type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
|
|
8
8
|
declare type ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;
|
|
9
9
|
declare type RcFieldProps = Omit<FieldProps, 'children'>;
|
|
10
|
-
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue'> & Pick<ListItemProps, 'style' | 'onClick' | 'extra' | 'arrow' | 'description'> & {
|
|
10
|
+
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue'> & Pick<ListItemProps, 'style' | 'onClick' | 'extra' | 'clickable' | 'arrow' | 'description'> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
help?: React.ReactNode;
|
|
13
13
|
hasFeedback?: boolean;
|
|
@@ -120,6 +120,7 @@ const FormItemLayout = props => {
|
|
|
120
120
|
}),
|
|
121
121
|
disabled: disabled,
|
|
122
122
|
onClick: props.onClick,
|
|
123
|
+
clickable: props.clickable,
|
|
123
124
|
arrow: arrow
|
|
124
125
|
}, _react.default.createElement("div", {
|
|
125
126
|
className: (0, _classnames.default)(`${classPrefix}-child`, `${classPrefix}-child-position-${childElementPosition}`)
|
|
@@ -155,9 +156,10 @@ const FormItem = props => {
|
|
|
155
156
|
onClick,
|
|
156
157
|
shouldUpdate,
|
|
157
158
|
dependencies,
|
|
159
|
+
clickable,
|
|
158
160
|
arrow
|
|
159
161
|
} = props,
|
|
160
|
-
fieldProps = (0, _tslib.__rest)(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "childElementPosition", "description", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "arrow"]);
|
|
162
|
+
fieldProps = (0, _tslib.__rest)(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "childElementPosition", "description", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "clickable", "arrow"]);
|
|
161
163
|
|
|
162
164
|
const {
|
|
163
165
|
validateTrigger: contextValidateTrigger
|
|
@@ -232,6 +234,7 @@ const FormItem = props => {
|
|
|
232
234
|
hidden: hidden,
|
|
233
235
|
layout: layout,
|
|
234
236
|
childElementPosition: childElementPosition,
|
|
237
|
+
clickable: clickable,
|
|
235
238
|
arrow: arrow
|
|
236
239
|
}, _react.default.createElement(_context.NoStyleItemContext.Provider, {
|
|
237
240
|
value: onSubMetaChange
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import './image-viewer.less';
|
|
3
3
|
import { showMultiImageViewer, showImageViewer, clearImageViewer } from './methods';
|
|
4
4
|
export type { ImageViewerProps, MultiImageViewerProps, MultiImageViewerRef, } from './image-viewer';
|
|
5
|
-
export type {
|
|
5
|
+
export type { ImageViewerShowHandler } from './methods';
|
|
6
6
|
declare const _default: import("react").FC<import("./image-viewer").ImageViewerProps> & {
|
|
7
7
|
Multi: import("react").ForwardRefExoticComponent<Omit<import("./image-viewer").ImageViewerProps, "image"> & {
|
|
8
8
|
images?: string[] | undefined;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { ImageViewerProps, MultiImageViewerProps } from './image-viewer';
|
|
2
|
-
export declare type
|
|
3
|
-
close: () => void;
|
|
4
|
-
};
|
|
5
|
-
export declare function showImageViewer(props: Omit<ImageViewerProps, 'visible'>): {
|
|
6
|
-
close: () => void;
|
|
7
|
-
};
|
|
8
|
-
export declare function showMultiImageViewer(props: Omit<MultiImageViewerProps, 'visible'>): {
|
|
2
|
+
export declare type ImageViewerShowHandler = {
|
|
9
3
|
close: () => void;
|
|
10
4
|
};
|
|
5
|
+
export declare function showImageViewer(props: Omit<ImageViewerProps, 'visible'>): ImageViewerShowHandler;
|
|
6
|
+
export declare function showMultiImageViewer(props: Omit<MultiImageViewerProps, 'visible'>): ImageViewerShowHandler;
|
|
11
7
|
export declare function clearImageViewer(): void;
|
|
@@ -7,106 +7,40 @@ exports.clearImageViewer = clearImageViewer;
|
|
|
7
7
|
exports.showImageViewer = showImageViewer;
|
|
8
8
|
exports.showMultiImageViewer = showMultiImageViewer;
|
|
9
9
|
|
|
10
|
-
var _react =
|
|
11
|
-
|
|
12
|
-
var _renderToBody = require("../../utils/render-to-body");
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
11
|
|
|
14
12
|
var _imageViewer = require("./image-viewer");
|
|
15
13
|
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
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); }
|
|
14
|
+
var _renderImperatively = require("../../utils/render-imperatively");
|
|
19
15
|
|
|
20
|
-
function
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
17
|
|
|
22
18
|
const handlerSet = new Set();
|
|
23
19
|
|
|
24
20
|
function showImageViewer(props) {
|
|
25
21
|
clearImageViewer();
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
(0, _react.useEffect)(() => {
|
|
29
|
-
setVisible(true);
|
|
30
|
-
}, []);
|
|
31
|
-
const isUnmountedRef = (0, _ahooks.useUnmountedRef)();
|
|
32
|
-
(0, _react.useImperativeHandle)(ref, () => ({
|
|
33
|
-
close: () => {
|
|
34
|
-
if (isUnmountedRef.current) return;
|
|
35
|
-
setVisible(false);
|
|
36
|
-
}
|
|
37
|
-
}));
|
|
38
|
-
return _react.default.createElement(_imageViewer.ImageViewer, Object.assign({}, props, {
|
|
39
|
-
visible: visible,
|
|
40
|
-
onClose: () => {
|
|
41
|
-
var _a;
|
|
42
|
-
|
|
43
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
44
|
-
setVisible(false);
|
|
45
|
-
},
|
|
46
|
-
afterClose: () => {
|
|
47
|
-
var _a;
|
|
48
|
-
|
|
49
|
-
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
50
|
-
unmount();
|
|
51
|
-
}
|
|
52
|
-
}));
|
|
53
|
-
});
|
|
54
|
-
const ref = (0, _react.createRef)();
|
|
55
|
-
const unmount = (0, _renderToBody.renderToBody)(_react.default.createElement(Wrapper, {
|
|
56
|
-
ref: ref
|
|
57
|
-
}));
|
|
58
|
-
const handler = {
|
|
59
|
-
close: () => {
|
|
22
|
+
const handler = (0, _renderImperatively.renderImperatively)(_react.default.createElement(_imageViewer.ImageViewer, Object.assign({}, props, {
|
|
23
|
+
afterClose: () => {
|
|
60
24
|
var _a;
|
|
61
25
|
|
|
62
|
-
|
|
26
|
+
handlerSet.delete(handler);
|
|
27
|
+
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
63
28
|
}
|
|
64
|
-
};
|
|
29
|
+
})));
|
|
65
30
|
handlerSet.add(handler);
|
|
66
31
|
return handler;
|
|
67
32
|
}
|
|
68
33
|
|
|
69
34
|
function showMultiImageViewer(props) {
|
|
70
35
|
clearImageViewer();
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
(0, _react.useEffect)(() => {
|
|
74
|
-
setVisible(true);
|
|
75
|
-
}, []);
|
|
76
|
-
const isUnmountedRef = (0, _ahooks.useUnmountedRef)();
|
|
77
|
-
(0, _react.useImperativeHandle)(ref, () => ({
|
|
78
|
-
close: () => {
|
|
79
|
-
if (isUnmountedRef.current) return;
|
|
80
|
-
setVisible(false);
|
|
81
|
-
}
|
|
82
|
-
}));
|
|
83
|
-
return _react.default.createElement(_imageViewer.MultiImageViewer, Object.assign({}, props, {
|
|
84
|
-
visible: visible,
|
|
85
|
-
onClose: () => {
|
|
86
|
-
var _a;
|
|
87
|
-
|
|
88
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
89
|
-
setVisible(false);
|
|
90
|
-
},
|
|
91
|
-
afterClose: () => {
|
|
92
|
-
var _a;
|
|
93
|
-
|
|
94
|
-
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
95
|
-
unmount();
|
|
96
|
-
}
|
|
97
|
-
}));
|
|
98
|
-
});
|
|
99
|
-
const ref = (0, _react.createRef)();
|
|
100
|
-
const unmount = (0, _renderToBody.renderToBody)(_react.default.createElement(Wrapper, {
|
|
101
|
-
ref: ref
|
|
102
|
-
}));
|
|
103
|
-
const handler = {
|
|
104
|
-
close: () => {
|
|
36
|
+
const handler = (0, _renderImperatively.renderImperatively)(_react.default.createElement(_imageViewer.MultiImageViewer, Object.assign({}, props, {
|
|
37
|
+
afterClose: () => {
|
|
105
38
|
var _a;
|
|
106
39
|
|
|
107
|
-
|
|
40
|
+
handlerSet.delete(handler);
|
|
41
|
+
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
108
42
|
}
|
|
109
|
-
};
|
|
43
|
+
})));
|
|
110
44
|
handlerSet.add(handler);
|
|
111
45
|
return handler;
|
|
112
46
|
}
|
|
@@ -6,7 +6,7 @@ import { confirm } from './confirm';
|
|
|
6
6
|
import { clear } from './clear';
|
|
7
7
|
export type { ModalProps } from './modal';
|
|
8
8
|
export type { Action } from './modal-action-button';
|
|
9
|
-
export type { ModalShowProps,
|
|
9
|
+
export type { ModalShowProps, ModalShowHandler } from './show';
|
|
10
10
|
export type { ModalAlertProps } from './alert';
|
|
11
11
|
export type { ModalConfirmProps } from './confirm';
|
|
12
12
|
declare const _default: import("react").FC<import("./modal").ModalProps> & {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ModalProps } from './modal';
|
|
2
2
|
export declare type ModalShowProps = Omit<ModalProps, 'visible'>;
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type ModalShowHandler = {
|
|
4
4
|
close: () => void;
|
|
5
5
|
};
|
|
6
6
|
export declare const closeFnSet: Set<() => void>;
|
|
7
|
-
export declare function show(props: ModalShowProps):
|
|
8
|
-
close: () => void;
|
|
9
|
-
};
|
|
7
|
+
export declare function show(props: ModalShowProps): ModalShowHandler;
|
|
@@ -6,64 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.closeFnSet = void 0;
|
|
7
7
|
exports.show = show;
|
|
8
8
|
|
|
9
|
-
var _react =
|
|
10
|
-
|
|
11
|
-
var _renderToBody = require("../../utils/render-to-body");
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
10
|
|
|
13
11
|
var _modal = require("./modal");
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
var _renderImperatively = require("../../utils/render-imperatively");
|
|
16
14
|
|
|
17
|
-
function
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
16
|
|
|
19
17
|
const closeFnSet = new Set();
|
|
20
18
|
exports.closeFnSet = closeFnSet;
|
|
21
19
|
|
|
22
20
|
function show(props) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
(0, _react.useEffect)(() => {
|
|
26
|
-
setVisible(true);
|
|
27
|
-
}, []);
|
|
28
|
-
|
|
29
|
-
function handleClose() {
|
|
30
|
-
var _a;
|
|
31
|
-
|
|
32
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
33
|
-
setVisible(false);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
(0, _react.useImperativeHandle)(ref, () => ({
|
|
37
|
-
close: handleClose
|
|
38
|
-
}));
|
|
39
|
-
|
|
40
|
-
function handleAfterClose() {
|
|
21
|
+
const handler = (0, _renderImperatively.renderImperatively)(_react.default.createElement(_modal.Modal, Object.assign({}, props, {
|
|
22
|
+
afterClose: () => {
|
|
41
23
|
var _a;
|
|
42
24
|
|
|
25
|
+
closeFnSet.delete(handler.close);
|
|
43
26
|
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
44
|
-
unmount();
|
|
45
|
-
closeFnSet.delete(close);
|
|
46
27
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onClose: handleClose,
|
|
51
|
-
afterClose: handleAfterClose
|
|
52
|
-
}));
|
|
53
|
-
});
|
|
54
|
-
const ref = (0, _react.createRef)();
|
|
55
|
-
const unmount = (0, _renderToBody.renderToBody)(_react.default.createElement(Wrapper, {
|
|
56
|
-
ref: ref
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
const close = () => {
|
|
60
|
-
var _a;
|
|
61
|
-
|
|
62
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
closeFnSet.add(close);
|
|
66
|
-
return {
|
|
67
|
-
close
|
|
68
|
-
};
|
|
28
|
+
})));
|
|
29
|
+
closeFnSet.add(handler.close);
|
|
30
|
+
return handler;
|
|
69
31
|
}
|
|
@@ -17,12 +17,10 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
17
17
|
|
|
18
18
|
var _pickerView = _interopRequireDefault(require("../picker-view"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _columnsExtend = require("../picker-view/columns-extend");
|
|
21
21
|
|
|
22
22
|
var _configProvider = require("../config-provider");
|
|
23
23
|
|
|
24
|
-
var _usePickerValueExtend = require("../picker-view/use-picker-value-extend");
|
|
25
|
-
|
|
26
24
|
var _ahooks = require("ahooks");
|
|
27
25
|
|
|
28
26
|
var _safeArea = _interopRequireDefault(require("../safe-area"));
|
|
@@ -52,12 +50,11 @@ const Picker = (0, _react.memo)(p => {
|
|
|
52
50
|
onChange: val => {
|
|
53
51
|
var _a;
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
const extend = (0, _columnsExtend.generateColumnsExtend)(props.columns, val);
|
|
54
|
+
(_a = props.onConfirm) === null || _a === void 0 ? void 0 : _a.call(props, val, extend);
|
|
56
55
|
}
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
const columns = (0, _useColumns.useColumns)(props.columns, value);
|
|
60
|
-
const generateValueExtend = (0, _usePickerValueExtend.usePickerValueExtend)(columns);
|
|
56
|
+
}));
|
|
57
|
+
const extend = (0, _columnsExtend.useColumnsExtend)(props.columns, value);
|
|
61
58
|
const [innerValue, setInnerValue] = (0, _react.useState)(value);
|
|
62
59
|
(0, _react.useEffect)(() => {
|
|
63
60
|
if (innerValue !== value) {
|
|
@@ -130,7 +127,7 @@ const Picker = (0, _react.memo)(p => {
|
|
|
130
127
|
position: 'bottom'
|
|
131
128
|
}));
|
|
132
129
|
|
|
133
|
-
return _react.default.createElement(_react.default.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props,
|
|
130
|
+
return _react.default.createElement(_react.default.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, extend.items));
|
|
134
131
|
});
|
|
135
132
|
exports.Picker = Picker;
|
|
136
133
|
Picker.displayName = 'Picker';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PickerViewProps, PickerValue, PickerValueExtend } from './picker-view';
|
|
2
|
+
export declare function generateColumnsExtend(rawColumns: PickerViewProps['columns'], val: PickerValue[]): PickerValueExtend;
|
|
3
|
+
export declare function useColumnsExtend(rawColumns: PickerViewProps['columns'], value: PickerValue[]): PickerValueExtend;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateColumnsExtend = generateColumnsExtend;
|
|
7
|
+
exports.useColumnsExtend = useColumnsExtend;
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
var _withCache = require("../../utils/with-cache");
|
|
12
|
+
|
|
13
|
+
function generateColumnsExtend(rawColumns, val) {
|
|
14
|
+
const columns = (0, _withCache.withCache)(() => {
|
|
15
|
+
const c = typeof rawColumns === 'function' ? rawColumns(val) : rawColumns;
|
|
16
|
+
return c.map(column => column.map(item => typeof item === 'string' ? {
|
|
17
|
+
label: item,
|
|
18
|
+
value: item
|
|
19
|
+
} : item));
|
|
20
|
+
});
|
|
21
|
+
const items = (0, _withCache.withCache)(() => {
|
|
22
|
+
return val.map((v, index) => {
|
|
23
|
+
var _a;
|
|
24
|
+
|
|
25
|
+
const column = columns()[index];
|
|
26
|
+
if (!column) return null;
|
|
27
|
+
return (_a = column.find(item => item.value === v)) !== null && _a !== void 0 ? _a : null;
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const extend = {
|
|
31
|
+
get columns() {
|
|
32
|
+
return columns();
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
get items() {
|
|
36
|
+
return items();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
};
|
|
40
|
+
return extend;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function useColumnsExtend(rawColumns, value) {
|
|
44
|
+
return (0, _react.useMemo)(() => generateColumnsExtend(rawColumns, value), [rawColumns, value]);
|
|
45
|
+
}
|
|
@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type PickerValue = string | null;
|
|
4
4
|
export declare type PickerValueExtend = {
|
|
5
|
+
columns: PickerColumnItem[][];
|
|
5
6
|
items: (PickerColumnItem | null)[];
|
|
6
7
|
};
|
|
7
8
|
export declare type PickerColumnItem = {
|
|
@@ -11,12 +11,10 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
11
11
|
|
|
12
12
|
var _wheel = require("./wheel");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _columnsExtend = require("./columns-extend");
|
|
15
15
|
|
|
16
16
|
var _nativeProps = require("../../utils/native-props");
|
|
17
17
|
|
|
18
|
-
var _usePickerValueExtend = require("./use-picker-value-extend");
|
|
19
|
-
|
|
20
18
|
var _ahooks = require("ahooks");
|
|
21
19
|
|
|
22
20
|
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); }
|
|
@@ -29,17 +27,7 @@ const defaultProps = {
|
|
|
29
27
|
};
|
|
30
28
|
const PickerView = (0, _react.memo)(p => {
|
|
31
29
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
32
|
-
const [innerValue, setInnerValue] = (0, _react.useState)(props.value === undefined ? props.defaultValue : props.value);
|
|
33
|
-
(0, _ahooks.useDebounceEffect)(() => {
|
|
34
|
-
var _a;
|
|
35
|
-
|
|
36
|
-
if (props.value === innerValue) return;
|
|
37
|
-
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerValue, generateValueExtend(innerValue));
|
|
38
|
-
}, [innerValue], {
|
|
39
|
-
wait: 0,
|
|
40
|
-
leading: false,
|
|
41
|
-
trailing: true
|
|
42
|
-
}); // Sync `value` to `innerValue`
|
|
30
|
+
const [innerValue, setInnerValue] = (0, _react.useState)(props.value === undefined ? props.defaultValue : props.value); // Sync `value` to `innerValue`
|
|
43
31
|
|
|
44
32
|
(0, _react.useEffect)(() => {
|
|
45
33
|
if (props.value === undefined) return; // Uncontrolled mode
|
|
@@ -58,8 +46,18 @@ const PickerView = (0, _react.memo)(p => {
|
|
|
58
46
|
window.clearTimeout(timeout);
|
|
59
47
|
};
|
|
60
48
|
}, [props.value, innerValue]);
|
|
61
|
-
const
|
|
62
|
-
const
|
|
49
|
+
const extend = (0, _columnsExtend.useColumnsExtend)(props.columns, innerValue);
|
|
50
|
+
const columns = extend.columns;
|
|
51
|
+
(0, _ahooks.useDebounceEffect)(() => {
|
|
52
|
+
var _a;
|
|
53
|
+
|
|
54
|
+
if (props.value === innerValue) return;
|
|
55
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerValue, extend);
|
|
56
|
+
}, [innerValue], {
|
|
57
|
+
wait: 0,
|
|
58
|
+
leading: false,
|
|
59
|
+
trailing: true
|
|
60
|
+
});
|
|
63
61
|
const handleSelect = (0, _react.useCallback)((val, index) => {
|
|
64
62
|
setInnerValue(prev => {
|
|
65
63
|
const next = [...prev];
|