antd-mobile 5.0.0-rc.4 → 5.0.0-rc.8
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 +12 -1
- package/2x/cjs/components/checkbox/checkbox.css +1 -1
- package/2x/cjs/components/collapse/collapse.d.ts +2 -2
- package/2x/cjs/components/collapse/collapse.js +1 -1
- package/2x/cjs/components/date-picker/date-picker.js +1 -1
- package/2x/cjs/components/dialog/dialog.d.ts +1 -0
- package/2x/cjs/components/dialog/dialog.js +12 -7
- package/2x/cjs/components/form/form-item.css +1 -1
- package/2x/cjs/components/form/index.css +1 -1
- package/2x/cjs/components/image/lazy-detector.js +4 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +9 -3
- package/2x/cjs/components/image-viewer/slide.js +0 -5
- package/2x/cjs/components/index-bar/index-bar.css +1 -1
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +1 -1
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/list/list.css +5 -4
- package/2x/cjs/components/list/list.js +1 -3
- package/2x/cjs/components/mask/mask.js +3 -2
- package/2x/cjs/components/modal/modal.d.ts +1 -0
- package/2x/cjs/components/modal/modal.js +5 -3
- package/2x/cjs/components/notice-bar/notice-bar.css +1 -0
- package/2x/cjs/components/number-keyboard/number-keyboard.css +2 -2
- package/2x/cjs/components/number-keyboard/number-keyboard.js +1 -1
- package/2x/cjs/components/passcode-input/index.d.ts +4 -0
- package/2x/cjs/components/passcode-input/index.js +13 -0
- package/2x/cjs/components/passcode-input/passcode-input.css +166 -0
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +35 -0
- package/2x/cjs/components/passcode-input/passcode-input.js +169 -0
- package/2x/cjs/components/picker/picker.js +5 -3
- package/2x/cjs/components/picker-view/picker-view.css +46 -5
- package/2x/cjs/components/picker-view/picker-view.js +32 -22
- package/2x/cjs/components/picker-view/wheel.d.ts +10 -0
- package/{cjs/components/picker-view/column.js → 2x/cjs/components/picker-view/wheel.js} +74 -14
- package/2x/cjs/components/progress-bar/progress-bar.css +3 -1
- package/2x/cjs/components/progress-bar/progress-bar.d.ts +1 -1
- package/2x/cjs/components/radio/radio.css +1 -1
- package/2x/cjs/components/rate/rate.css +1 -0
- package/2x/cjs/components/search-bar/search-bar.css +5 -0
- package/2x/cjs/components/search-bar/search-bar.d.ts +3 -1
- package/2x/cjs/components/search-bar/search-bar.js +6 -5
- package/2x/cjs/components/side-bar/side-bar.css +2 -0
- package/2x/cjs/components/skeleton/index.d.ts +8 -0
- package/2x/cjs/components/skeleton/index.js +19 -0
- package/2x/cjs/components/skeleton/skeleton.css +45 -0
- package/2x/cjs/components/skeleton/skeleton.d.ts +15 -0
- package/2x/cjs/components/skeleton/skeleton.js +61 -0
- package/2x/cjs/components/stepper/stepper.d.ts +1 -0
- package/2x/cjs/components/stepper/stepper.js +4 -2
- package/2x/cjs/components/tab-bar/tab-bar.css +1 -1
- package/2x/cjs/components/tab-bar/tab-bar.d.ts +1 -0
- package/2x/cjs/components/tab-bar/tab-bar.js +24 -11
- package/2x/cjs/components/toast/index.d.ts +2 -1
- package/2x/cjs/components/toast/index.js +2 -1
- package/2x/cjs/components/toast/methods.d.ts +1 -0
- package/2x/cjs/components/toast/methods.js +18 -1
- package/2x/cjs/components/tree-select/tree-select.css +1 -0
- package/2x/cjs/components/virtual-input/virtual-input.js +1 -3
- package/2x/cjs/global/global.css +0 -4
- package/2x/cjs/index.d.ts +2 -0
- package/2x/cjs/index.js +16 -0
- package/2x/cjs/utils/use-mutation-effect.js +1 -1
- package/2x/cjs/utils/use-props-value.js +1 -1
- package/2x/cjs/utils/use-resize-effect.js +1 -1
- package/2x/es/components/checkbox/checkbox.css +1 -1
- package/2x/es/components/collapse/collapse.d.ts +2 -2
- package/2x/es/components/collapse/collapse.js +1 -1
- package/2x/es/components/date-picker/date-picker.js +2 -2
- package/2x/es/components/dialog/dialog.d.ts +1 -0
- package/2x/es/components/dialog/dialog.js +11 -7
- package/2x/es/components/form/form-item.css +1 -1
- package/2x/es/components/form/index.css +1 -1
- package/2x/es/components/image/lazy-detector.js +4 -1
- package/2x/es/components/image-uploader/image-uploader.js +10 -4
- package/2x/es/components/image-viewer/slide.js +0 -5
- package/2x/es/components/index-bar/index-bar.css +1 -1
- package/2x/es/components/infinite-scroll/infinite-scroll.js +2 -2
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/list/list.css +5 -4
- package/2x/es/components/list/list.js +1 -3
- package/2x/es/components/mask/mask.js +3 -2
- package/2x/es/components/modal/modal.d.ts +1 -0
- package/2x/es/components/modal/modal.js +5 -3
- package/2x/es/components/notice-bar/notice-bar.css +1 -0
- package/2x/es/components/number-keyboard/number-keyboard.css +2 -2
- package/2x/es/components/number-keyboard/number-keyboard.js +2 -2
- package/2x/es/components/passcode-input/index.d.ts +4 -0
- package/2x/es/components/passcode-input/index.js +3 -0
- package/2x/es/components/passcode-input/passcode-input.css +166 -0
- package/2x/es/components/passcode-input/passcode-input.d.ts +35 -0
- package/2x/es/components/passcode-input/passcode-input.js +149 -0
- package/2x/es/components/picker/picker.js +6 -4
- package/2x/es/components/picker-view/picker-view.css +46 -5
- package/2x/es/components/picker-view/picker-view.js +33 -23
- package/2x/es/components/picker-view/wheel.d.ts +10 -0
- package/{es/components/picker-view/column.js → 2x/es/components/picker-view/wheel.js} +71 -12
- package/2x/es/components/progress-bar/progress-bar.css +3 -1
- package/2x/es/components/progress-bar/progress-bar.d.ts +1 -1
- package/2x/es/components/radio/radio.css +1 -1
- package/2x/es/components/rate/rate.css +1 -0
- package/2x/es/components/search-bar/search-bar.css +5 -0
- package/2x/es/components/search-bar/search-bar.d.ts +3 -1
- package/2x/es/components/search-bar/search-bar.js +6 -5
- package/2x/es/components/side-bar/side-bar.css +2 -0
- package/2x/es/components/skeleton/index.d.ts +8 -0
- package/2x/es/components/skeleton/index.js +7 -0
- package/2x/es/components/skeleton/skeleton.css +45 -0
- package/2x/es/components/skeleton/skeleton.d.ts +15 -0
- package/2x/es/components/skeleton/skeleton.js +36 -0
- package/2x/es/components/stepper/stepper.d.ts +1 -0
- package/2x/es/components/stepper/stepper.js +4 -2
- package/2x/es/components/tab-bar/tab-bar.css +1 -1
- package/2x/es/components/tab-bar/tab-bar.d.ts +1 -0
- package/2x/es/components/tab-bar/tab-bar.js +22 -11
- package/2x/es/components/toast/index.d.ts +2 -1
- package/2x/es/components/toast/index.js +3 -2
- package/2x/es/components/toast/methods.d.ts +1 -0
- package/2x/es/components/toast/methods.js +16 -1
- package/2x/es/components/tree-select/tree-select.css +1 -0
- package/2x/es/components/virtual-input/virtual-input.js +1 -3
- package/2x/es/global/global.css +0 -4
- package/2x/es/index.d.ts +2 -0
- package/2x/es/index.js +2 -0
- package/2x/es/utils/use-mutation-effect.js +2 -2
- package/2x/es/utils/use-props-value.js +2 -2
- package/2x/es/utils/use-resize-effect.js +2 -2
- package/2x/package.json +4 -4
- package/README.md +12 -1
- package/cjs/components/checkbox/checkbox.css +1 -1
- package/cjs/components/collapse/collapse.d.ts +2 -2
- package/cjs/components/collapse/collapse.js +1 -1
- package/cjs/components/date-picker/date-picker.js +1 -1
- package/cjs/components/dialog/dialog.d.ts +1 -0
- package/cjs/components/dialog/dialog.js +12 -7
- package/cjs/components/form/form-item.css +1 -1
- package/cjs/components/form/index.css +1 -1
- package/cjs/components/image/lazy-detector.js +4 -1
- package/cjs/components/image-uploader/image-uploader.js +9 -3
- package/cjs/components/image-viewer/slide.js +0 -5
- package/cjs/components/index-bar/index-bar.css +1 -1
- package/cjs/components/infinite-scroll/infinite-scroll.js +1 -1
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/list/list.css +4 -3
- package/cjs/components/list/list.js +1 -3
- package/cjs/components/mask/mask.js +3 -2
- package/cjs/components/modal/modal.d.ts +1 -0
- package/cjs/components/modal/modal.js +5 -3
- package/cjs/components/notice-bar/notice-bar.css +1 -0
- package/cjs/components/number-keyboard/number-keyboard.css +2 -2
- package/cjs/components/number-keyboard/number-keyboard.js +1 -1
- package/cjs/components/passcode-input/index.d.ts +4 -0
- package/cjs/components/passcode-input/index.js +13 -0
- package/cjs/components/passcode-input/passcode-input.css +136 -0
- package/cjs/components/passcode-input/passcode-input.d.ts +35 -0
- package/cjs/components/passcode-input/passcode-input.js +169 -0
- package/cjs/components/picker/picker.js +5 -3
- package/cjs/components/picker-view/picker-view.css +40 -5
- package/cjs/components/picker-view/picker-view.js +32 -22
- package/cjs/components/picker-view/wheel.d.ts +10 -0
- package/{2x/cjs/components/picker-view/column.js → cjs/components/picker-view/wheel.js} +74 -14
- package/cjs/components/progress-bar/progress-bar.css +3 -1
- package/cjs/components/progress-bar/progress-bar.d.ts +1 -1
- package/cjs/components/radio/radio.css +1 -1
- package/cjs/components/rate/rate.css +1 -0
- package/cjs/components/search-bar/search-bar.css +4 -0
- package/cjs/components/search-bar/search-bar.d.ts +3 -1
- package/cjs/components/search-bar/search-bar.js +6 -5
- package/cjs/components/side-bar/side-bar.css +2 -0
- package/cjs/components/skeleton/index.d.ts +8 -0
- package/cjs/components/skeleton/index.js +19 -0
- package/cjs/components/skeleton/skeleton.css +39 -0
- package/cjs/components/skeleton/skeleton.d.ts +15 -0
- package/cjs/components/skeleton/skeleton.js +61 -0
- package/cjs/components/stepper/stepper.d.ts +1 -0
- package/cjs/components/stepper/stepper.js +4 -2
- package/cjs/components/tab-bar/tab-bar.css +1 -1
- package/cjs/components/tab-bar/tab-bar.d.ts +1 -0
- package/cjs/components/tab-bar/tab-bar.js +24 -11
- package/cjs/components/toast/index.d.ts +2 -1
- package/cjs/components/toast/index.js +2 -1
- package/cjs/components/toast/methods.d.ts +1 -0
- package/cjs/components/toast/methods.js +18 -1
- package/cjs/components/tree-select/tree-select.css +1 -0
- package/cjs/components/virtual-input/virtual-input.js +1 -3
- package/cjs/global/global.css +0 -3
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +16 -0
- package/cjs/utils/use-mutation-effect.js +1 -1
- package/cjs/utils/use-props-value.js +1 -1
- package/cjs/utils/use-resize-effect.js +1 -1
- package/es/components/checkbox/checkbox.css +1 -1
- package/es/components/collapse/collapse.d.ts +2 -2
- package/es/components/collapse/collapse.js +1 -1
- package/es/components/date-picker/date-picker.js +2 -2
- package/es/components/dialog/dialog.d.ts +1 -0
- package/es/components/dialog/dialog.js +11 -7
- package/es/components/form/form-item.css +1 -1
- package/es/components/form/index.css +1 -1
- package/es/components/image/lazy-detector.js +4 -1
- package/es/components/image-uploader/image-uploader.js +10 -4
- package/es/components/image-viewer/slide.js +0 -5
- package/es/components/index-bar/index-bar.css +1 -1
- package/es/components/infinite-scroll/infinite-scroll.js +2 -2
- package/es/components/input/input.d.ts +2 -2
- package/es/components/list/list.css +4 -3
- package/es/components/list/list.js +1 -3
- package/es/components/mask/mask.js +3 -2
- package/es/components/modal/modal.d.ts +1 -0
- package/es/components/modal/modal.js +5 -3
- package/es/components/notice-bar/notice-bar.css +1 -0
- package/es/components/number-keyboard/number-keyboard.css +2 -2
- package/es/components/number-keyboard/number-keyboard.js +2 -2
- package/es/components/passcode-input/index.d.ts +4 -0
- package/es/components/passcode-input/index.js +3 -0
- package/es/components/passcode-input/passcode-input.css +136 -0
- package/es/components/passcode-input/passcode-input.d.ts +35 -0
- package/es/components/passcode-input/passcode-input.js +149 -0
- package/es/components/picker/picker.js +6 -4
- package/es/components/picker-view/picker-view.css +40 -5
- package/es/components/picker-view/picker-view.js +33 -23
- package/es/components/picker-view/wheel.d.ts +10 -0
- package/{2x/es/components/picker-view/column.js → es/components/picker-view/wheel.js} +71 -12
- package/es/components/progress-bar/progress-bar.css +3 -1
- package/es/components/progress-bar/progress-bar.d.ts +1 -1
- package/es/components/radio/radio.css +1 -1
- package/es/components/rate/rate.css +1 -0
- package/es/components/search-bar/search-bar.css +4 -0
- package/es/components/search-bar/search-bar.d.ts +3 -1
- package/es/components/search-bar/search-bar.js +6 -5
- package/es/components/side-bar/side-bar.css +2 -0
- package/es/components/skeleton/index.d.ts +8 -0
- package/es/components/skeleton/index.js +7 -0
- package/es/components/skeleton/skeleton.css +39 -0
- package/es/components/skeleton/skeleton.d.ts +15 -0
- package/es/components/skeleton/skeleton.js +36 -0
- package/es/components/stepper/stepper.d.ts +1 -0
- package/es/components/stepper/stepper.js +4 -2
- package/es/components/tab-bar/tab-bar.css +1 -1
- package/es/components/tab-bar/tab-bar.d.ts +1 -0
- package/es/components/tab-bar/tab-bar.js +22 -11
- package/es/components/toast/index.d.ts +2 -1
- package/es/components/toast/index.js +3 -2
- package/es/components/toast/methods.d.ts +1 -0
- package/es/components/toast/methods.js +16 -1
- package/es/components/tree-select/tree-select.css +1 -0
- package/es/components/virtual-input/virtual-input.js +1 -3
- package/es/global/global.css +0 -3
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/utils/use-mutation-effect.js +2 -2
- package/es/utils/use-props-value.js +2 -2
- package/es/utils/use-resize-effect.js +2 -2
- package/package.json +4 -4
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/picker-view/column.d.ts +0 -9
- package/2x/es/components/picker-view/column.d.ts +0 -9
- package/cjs/components/picker-view/column.d.ts +0 -9
- package/es/components/picker-view/column.d.ts +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { memo, useEffect, useState } from 'react';
|
|
1
|
+
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { mergeProps } from '../../utils/with-default-props';
|
|
3
|
-
import {
|
|
3
|
+
import { Wheel } from './wheel';
|
|
4
4
|
import { useColumns } from './use-columns';
|
|
5
5
|
import { withNativeProps } from '../../utils/native-props';
|
|
6
6
|
import { usePickerValueExtend } from './use-picker-value-extend';
|
|
@@ -32,35 +32,45 @@ export var PickerView = /*#__PURE__*/memo(function (p) {
|
|
|
32
32
|
|
|
33
33
|
if (props.value === innerValue) return;
|
|
34
34
|
setInnerValue(props.value);
|
|
35
|
-
}, [props.value]);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
}, [props.value]);
|
|
36
|
+
useEffect(function () {
|
|
37
|
+
if (props.value === innerValue) return;
|
|
38
|
+
var timeout = window.setTimeout(function () {
|
|
39
|
+
if (props.value !== undefined && props.value !== innerValue) {
|
|
40
|
+
setInnerValue(props.value);
|
|
41
|
+
}
|
|
42
|
+
}, 1000);
|
|
43
|
+
return function () {
|
|
44
|
+
window.clearTimeout(timeout);
|
|
45
|
+
};
|
|
46
|
+
}, [props.value, innerValue]);
|
|
46
47
|
var columns = useColumns(props.columns, innerValue);
|
|
47
48
|
var generateValueExtend = usePickerValueExtend(columns);
|
|
49
|
+
var handleSelect = useCallback(function (val, index) {
|
|
50
|
+
setInnerValue(function (prev) {
|
|
51
|
+
var next = [].concat(prev);
|
|
52
|
+
next[index] = val;
|
|
53
|
+
return next;
|
|
54
|
+
});
|
|
55
|
+
}, []);
|
|
48
56
|
return withNativeProps(props, /*#__PURE__*/React.createElement("div", {
|
|
49
57
|
className: "" + classPrefix
|
|
50
58
|
}, columns.map(function (column, index) {
|
|
51
|
-
return /*#__PURE__*/React.createElement(
|
|
59
|
+
return /*#__PURE__*/React.createElement(Wheel, {
|
|
52
60
|
key: index,
|
|
61
|
+
index: index,
|
|
53
62
|
column: column,
|
|
54
63
|
value: innerValue[index],
|
|
55
|
-
onSelect:
|
|
56
|
-
var nextInnerValue = [].concat(innerValue);
|
|
57
|
-
nextInnerValue[index] = val;
|
|
58
|
-
setInnerValue(nextInnerValue);
|
|
59
|
-
}
|
|
64
|
+
onSelect: handleSelect
|
|
60
65
|
});
|
|
61
66
|
}), /*#__PURE__*/React.createElement("div", {
|
|
62
|
-
className: classPrefix + "-mask
|
|
67
|
+
className: classPrefix + "-mask"
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: classPrefix + "-mask-top"
|
|
70
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: classPrefix + "-mask-middle"
|
|
63
72
|
}), /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: classPrefix + "-mask
|
|
65
|
-
})));
|
|
66
|
-
});
|
|
73
|
+
className: classPrefix + "-mask-bottom"
|
|
74
|
+
}))));
|
|
75
|
+
});
|
|
76
|
+
PickerView.displayName = 'PickerView';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PickerColumnItem, PickerValue } from './index';
|
|
3
|
+
interface Props {
|
|
4
|
+
index: number;
|
|
5
|
+
column: PickerColumnItem[];
|
|
6
|
+
value: PickerValue;
|
|
7
|
+
onSelect: (value: PickerValue, index: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Wheel: React.NamedExoticComponent<Props>;
|
|
10
|
+
export {};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import React, { useLayoutEffect, useRef } from 'react';
|
|
1
|
+
import React, { memo, useLayoutEffect, useRef } from 'react';
|
|
2
2
|
import { useSpring, animated } from '@react-spring/web';
|
|
3
3
|
import { useDrag } from '@use-gesture/react';
|
|
4
4
|
import { convertPx } from '../../utils/convert-px';
|
|
5
5
|
import { rubberbandIfOutOfBounds } from '../../utils/rubberband';
|
|
6
6
|
import { bound } from '../../utils/bound';
|
|
7
|
+
import isEqual from 'lodash/isEqual';
|
|
7
8
|
var classPrefix = "adm-picker-view";
|
|
8
|
-
export var
|
|
9
|
+
export var Wheel = /*#__PURE__*/memo(function (props) {
|
|
9
10
|
var itemHeight = convertPx(34);
|
|
10
11
|
var value = props.value,
|
|
11
|
-
onSelect = props.onSelect,
|
|
12
12
|
column = props.column;
|
|
13
13
|
|
|
14
|
+
function onSelect(val) {
|
|
15
|
+
props.onSelect(val, props.index);
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
var _useSpring = useSpring(function () {
|
|
15
19
|
return {
|
|
16
20
|
from: {
|
|
@@ -36,20 +40,20 @@ export var Column = function Column(props) {
|
|
|
36
40
|
var finalPosition = targetIndex * -itemHeight;
|
|
37
41
|
api.start({
|
|
38
42
|
y: finalPosition,
|
|
39
|
-
immediate: y.
|
|
43
|
+
immediate: y.goal !== finalPosition
|
|
40
44
|
});
|
|
41
45
|
}, [value, column]);
|
|
42
46
|
useLayoutEffect(function () {
|
|
43
47
|
if (column.length === 0) {
|
|
44
48
|
if (value !== null) {
|
|
45
|
-
|
|
49
|
+
onSelect(null);
|
|
46
50
|
}
|
|
47
51
|
} else {
|
|
48
52
|
if (!column.some(function (item) {
|
|
49
53
|
return item.value === value;
|
|
50
54
|
})) {
|
|
51
55
|
var firstItem = column[0];
|
|
52
|
-
|
|
56
|
+
onSelect(firstItem.value);
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
}, [column, value]);
|
|
@@ -59,7 +63,9 @@ export var Column = function Column(props) {
|
|
|
59
63
|
api.start({
|
|
60
64
|
y: finalPosition
|
|
61
65
|
});
|
|
62
|
-
|
|
66
|
+
var item = column[index];
|
|
67
|
+
if (!item) return;
|
|
68
|
+
onSelect(item.value);
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
var bind = useDrag(function (state) {
|
|
@@ -70,7 +76,7 @@ export var Column = function Column(props) {
|
|
|
70
76
|
if (state.last) {
|
|
71
77
|
draggingRef.current = false;
|
|
72
78
|
var position = state.offset[1] + state.velocity[1] * state.direction[1] * 50;
|
|
73
|
-
var targetIndex = -Math.round(bound(position, min, max) / itemHeight);
|
|
79
|
+
var targetIndex = min < max ? -Math.round(bound(position, min, max) / itemHeight) : 0;
|
|
74
80
|
scrollSelect(targetIndex);
|
|
75
81
|
} else {
|
|
76
82
|
var _position = state.offset[1];
|
|
@@ -88,14 +94,53 @@ export var Column = function Column(props) {
|
|
|
88
94
|
touch: true
|
|
89
95
|
}
|
|
90
96
|
});
|
|
97
|
+
var selectedIndex = null;
|
|
98
|
+
|
|
99
|
+
function renderAccessible() {
|
|
100
|
+
if (selectedIndex === null) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
var current = column[selectedIndex];
|
|
105
|
+
var previousIndex = selectedIndex - 1;
|
|
106
|
+
var nextIndex = selectedIndex + 1;
|
|
107
|
+
var previous = column[previousIndex];
|
|
108
|
+
var next = column[nextIndex];
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: 'adm-picker-view-column-accessible'
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: 'adm-picker-view-column-accessible-current',
|
|
113
|
+
role: 'button',
|
|
114
|
+
"aria-label": current ? "\u5F53\u524D\u9009\u62E9\u7684\u662F\uFF1A" + current.label : '当前未选择'
|
|
115
|
+
}, "-"), /*#__PURE__*/React.createElement("div", null, previous && /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: 'adm-picker-view-column-accessible-button',
|
|
117
|
+
onClick: function onClick() {
|
|
118
|
+
scrollSelect(previousIndex);
|
|
119
|
+
},
|
|
120
|
+
role: 'button',
|
|
121
|
+
"aria-label": "\u9009\u62E9\u4E0A\u4E00\u9879\uFF1A" + previous.label
|
|
122
|
+
}, "-")), /*#__PURE__*/React.createElement("div", null, next && /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
className: 'adm-picker-view-column-accessible-button',
|
|
124
|
+
onClick: function onClick() {
|
|
125
|
+
scrollSelect(nextIndex);
|
|
126
|
+
},
|
|
127
|
+
role: 'button',
|
|
128
|
+
"aria-label": "\u9009\u62E9\u4E0B\u4E00\u9879\uFF1A" + next.label
|
|
129
|
+
}, "-")));
|
|
130
|
+
}
|
|
131
|
+
|
|
91
132
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
92
133
|
className: classPrefix + "-column"
|
|
93
134
|
}, bind()), /*#__PURE__*/React.createElement(animated.div, {
|
|
94
135
|
style: {
|
|
95
136
|
y: y
|
|
96
137
|
},
|
|
97
|
-
className: classPrefix + "-column-wheel"
|
|
138
|
+
className: classPrefix + "-column-wheel",
|
|
139
|
+
"aria-hidden": true
|
|
98
140
|
}, column.map(function (item, index) {
|
|
141
|
+
var selected = props.value === item.value;
|
|
142
|
+
if (selected) selectedIndex = index;
|
|
143
|
+
|
|
99
144
|
function handleClick() {
|
|
100
145
|
draggingRef.current = false;
|
|
101
146
|
scrollSelect(index);
|
|
@@ -103,10 +148,24 @@ export var Column = function Column(props) {
|
|
|
103
148
|
|
|
104
149
|
return /*#__PURE__*/React.createElement("div", {
|
|
105
150
|
key: item.value,
|
|
151
|
+
"data-selected": item.value === value,
|
|
106
152
|
className: classPrefix + "-column-item",
|
|
107
|
-
onClick: handleClick
|
|
153
|
+
onClick: handleClick,
|
|
154
|
+
"aria-hidden": !selected,
|
|
155
|
+
"aria-label": selected ? 'active' : ''
|
|
108
156
|
}, /*#__PURE__*/React.createElement("div", {
|
|
109
157
|
className: classPrefix + "-column-item-label"
|
|
110
158
|
}, item.label));
|
|
111
|
-
})));
|
|
112
|
-
}
|
|
159
|
+
})), renderAccessible());
|
|
160
|
+
}, function (prev, next) {
|
|
161
|
+
if (prev.index !== next.index) return false;
|
|
162
|
+
if (prev.value !== next.value) return false;
|
|
163
|
+
if (prev.onSelect !== next.onSelect) return false;
|
|
164
|
+
|
|
165
|
+
if (!isEqual(prev.column, next.column)) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return true;
|
|
170
|
+
});
|
|
171
|
+
Wheel.displayName = 'Wheel';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
.adm-progress-bar {
|
|
2
2
|
--track-width: var(--adm-progress-bar-track-width, 6px);
|
|
3
|
+
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
3
4
|
--fill-color: var(--adm-progress-bar-fill-color, #1677ff);
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.adm-progress-bar-trail {
|
|
7
|
-
background:
|
|
8
|
+
background: var(--track-color);
|
|
9
|
+
overflow: hidden;
|
|
8
10
|
height: var(--track-width);
|
|
9
11
|
border-radius: var(--track-width);
|
|
10
12
|
}
|
|
@@ -2,5 +2,5 @@ import { FC } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ProgressBarProps = {
|
|
4
4
|
percent?: number;
|
|
5
|
-
} & NativeProps<'--track-width' | '--fill-color'>;
|
|
5
|
+
} & NativeProps<'--track-width' | '--track-color' | '--fill-color'>;
|
|
6
6
|
export declare const ProgressBar: FC<ProgressBarProps>;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
flex: auto;
|
|
30
30
|
padding: 8px 16px 8px 8px;
|
|
31
31
|
height: 56px;
|
|
32
|
+
box-sizing: border-box;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-input-wrapper {
|
|
@@ -40,6 +41,10 @@
|
|
|
40
41
|
line-height: 38px;
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-search-bar-input-without-icon {
|
|
45
|
+
padding-left: 16px;
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
.adm-search-bar .adm-search-bar-suffix {
|
|
44
49
|
flex: none;
|
|
45
50
|
margin-left: 32px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { InputRef, InputProps } from '../input';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
export declare type SearchBarRef = InputRef;
|
|
@@ -10,6 +10,7 @@ export declare type SearchBarProps = Pick<InputProps, 'onFocus' | 'onBlur' | 'on
|
|
|
10
10
|
clearable?: boolean;
|
|
11
11
|
showCancelButton?: boolean | ((focus: boolean, value: string) => boolean);
|
|
12
12
|
cancelText?: string;
|
|
13
|
+
icon?: ReactNode;
|
|
13
14
|
clearOnCancel?: boolean;
|
|
14
15
|
onSearch?: (val: string) => void;
|
|
15
16
|
onChange?: (val: string) => void;
|
|
@@ -23,6 +24,7 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
23
24
|
clearable?: boolean | undefined;
|
|
24
25
|
showCancelButton?: boolean | ((focus: boolean, value: string) => boolean) | undefined;
|
|
25
26
|
cancelText?: string | undefined;
|
|
27
|
+
icon?: ReactNode;
|
|
26
28
|
clearOnCancel?: boolean | undefined;
|
|
27
29
|
onSearch?: ((val: string) => void) | undefined;
|
|
28
30
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -11,10 +11,11 @@ var defaultProps = {
|
|
|
11
11
|
clearable: true,
|
|
12
12
|
showCancelButton: false,
|
|
13
13
|
defaultValue: '',
|
|
14
|
-
clearOnCancel: true
|
|
14
|
+
clearOnCancel: true,
|
|
15
|
+
icon: /*#__PURE__*/React.createElement(SearchOutline, null)
|
|
15
16
|
};
|
|
16
17
|
export var SearchBar = /*#__PURE__*/forwardRef(function (p, ref) {
|
|
17
|
-
var _classNames;
|
|
18
|
+
var _classNames, _classNames2;
|
|
18
19
|
|
|
19
20
|
var _useConfig = useConfig(),
|
|
20
21
|
locale = _useConfig.locale;
|
|
@@ -87,11 +88,11 @@ export var SearchBar = /*#__PURE__*/forwardRef(function (p, ref) {
|
|
|
87
88
|
className: classNames(classPrefix, (_classNames = {}, _classNames[classPrefix + "-active"] = hasFocus, _classNames))
|
|
88
89
|
}, /*#__PURE__*/React.createElement("div", {
|
|
89
90
|
className: classPrefix + "-input-box"
|
|
90
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
}, props.icon && /*#__PURE__*/React.createElement("div", {
|
|
91
92
|
className: classPrefix + "-input-box-icon"
|
|
92
|
-
},
|
|
93
|
+
}, props.icon), /*#__PURE__*/React.createElement(Input, {
|
|
93
94
|
ref: inputRef,
|
|
94
|
-
className: classPrefix + "-input",
|
|
95
|
+
className: classNames(classPrefix + "-input", (_classNames2 = {}, _classNames2[classPrefix + "-input-without-icon"] = !props.icon, _classNames2)),
|
|
95
96
|
value: value,
|
|
96
97
|
onChange: setValue,
|
|
97
98
|
maxLength: props.maxLength,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
--item-border-radius: 16px;
|
|
5
5
|
width: var(--width);
|
|
6
6
|
height: var(--height);
|
|
7
|
+
box-sizing: border-box;
|
|
7
8
|
font-size: 30px;
|
|
8
9
|
overflow-y: auto;
|
|
9
10
|
transform: translateZ(0);
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
display: flex;
|
|
15
16
|
align-items: center;
|
|
16
17
|
min-height: 100px;
|
|
18
|
+
box-sizing: border-box;
|
|
17
19
|
padding: 12px 44px;
|
|
18
20
|
position: relative;
|
|
19
21
|
cursor: pointer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './skeleton.less';
|
|
3
|
+
export type { SkeletonProps, SkeletonTitleProps } from './skeleton';
|
|
4
|
+
declare const _default: import("react").FC<import("./skeleton").SkeletonProps> & {
|
|
5
|
+
Title: import("react").FC<import("./skeleton").SkeletonTitleProps>;
|
|
6
|
+
Paragraph: import("react").FC<import("./skeleton").SkeletonParagraphProps>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./skeleton.css";
|
|
2
|
+
import { Skeleton, SkeletonParagraph, SkeletonTitle } from './skeleton';
|
|
3
|
+
import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component';
|
|
4
|
+
export default attachPropertiesToComponent(Skeleton, {
|
|
5
|
+
Title: SkeletonTitle,
|
|
6
|
+
Paragraph: SkeletonParagraph
|
|
7
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.adm-skeleton {
|
|
2
|
+
--width: 100%;
|
|
3
|
+
--height: 0;
|
|
4
|
+
--border-radius: 0;
|
|
5
|
+
background-color: rgba(190, 190, 190, 0.2);
|
|
6
|
+
border-radius: var(--border-radius);
|
|
7
|
+
width: var(--width);
|
|
8
|
+
height: var(--height);
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.adm-skeleton.adm-skeleton-animated {
|
|
13
|
+
background: linear-gradient(90deg, rgba(190, 190, 190, 0.2) 25%, rgba(129, 129, 129, 0.24) 37%, rgba(190, 190, 190, 0.2) 63%);
|
|
14
|
+
background-size: 400% 100%;
|
|
15
|
+
animation: adm-skeleton-loading 1.4s ease infinite;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.adm-skeleton.adm-skeleton-title {
|
|
19
|
+
--width: 45%;
|
|
20
|
+
--height: 64px;
|
|
21
|
+
--border-radius: 4px;
|
|
22
|
+
margin-bottom: 32px;
|
|
23
|
+
margin-top: 32px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.adm-skeleton.adm-skeleton-paragraph-line {
|
|
27
|
+
--height: 36px;
|
|
28
|
+
--border-radius: 4px;
|
|
29
|
+
margin-top: 24px;
|
|
30
|
+
margin-bottom: 24px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.adm-skeleton.adm-skeleton-paragraph-line:last-child {
|
|
34
|
+
--width: 65%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@keyframes adm-skeleton-loading {
|
|
38
|
+
0% {
|
|
39
|
+
background-position: 100% 50%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
100% {
|
|
43
|
+
background-position: 0 50%;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
export declare type SkeletonProps = {
|
|
4
|
+
animated?: boolean;
|
|
5
|
+
} & NativeProps<'--width' | '--height' | '--border-radius'>;
|
|
6
|
+
export declare const Skeleton: FC<SkeletonProps>;
|
|
7
|
+
export declare type SkeletonTitleProps = {
|
|
8
|
+
animated?: boolean;
|
|
9
|
+
} & NativeProps;
|
|
10
|
+
export declare const SkeletonTitle: FC<SkeletonTitleProps>;
|
|
11
|
+
export declare type SkeletonParagraphProps = {
|
|
12
|
+
animated?: boolean;
|
|
13
|
+
lineCount?: number;
|
|
14
|
+
} & NativeProps;
|
|
15
|
+
export declare const SkeletonParagraph: FC<SkeletonParagraphProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { generateIntArray } from '../../utils/generate-int-array';
|
|
5
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
6
|
+
var classPrefix = 'adm-skeleton';
|
|
7
|
+
export var Skeleton = function Skeleton(props) {
|
|
8
|
+
var _classNames;
|
|
9
|
+
|
|
10
|
+
return withNativeProps(props, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: classNames(classPrefix, (_classNames = {}, _classNames[classPrefix + "-animated"] = props.animated, _classNames))
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
export var SkeletonTitle = function SkeletonTitle(props) {
|
|
15
|
+
return withNativeProps(props, /*#__PURE__*/React.createElement(Skeleton, {
|
|
16
|
+
animated: props.animated,
|
|
17
|
+
className: classPrefix + "-title"
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
var defaultSkeletonParagraphProps = {
|
|
21
|
+
lineCount: 3
|
|
22
|
+
};
|
|
23
|
+
export var SkeletonParagraph = function SkeletonParagraph(p) {
|
|
24
|
+
var props = mergeProps(defaultSkeletonParagraphProps, p);
|
|
25
|
+
var keys = generateIntArray(1, props.lineCount);
|
|
26
|
+
var node = /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: classPrefix + "-paragraph"
|
|
28
|
+
}, keys.map(function (key) {
|
|
29
|
+
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
30
|
+
key: key,
|
|
31
|
+
animated: props.animated,
|
|
32
|
+
className: classPrefix + "-paragraph-line"
|
|
33
|
+
});
|
|
34
|
+
}));
|
|
35
|
+
return withNativeProps(props, node);
|
|
36
|
+
};
|
|
@@ -9,6 +9,7 @@ export declare type StepperProps = Pick<InputProps, 'onFocus' | 'onBlur'> & {
|
|
|
9
9
|
step?: number;
|
|
10
10
|
digits?: number;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
inputReadOnly?: boolean;
|
|
12
13
|
onChange?: (value: number) => void;
|
|
13
14
|
} & NativeProps<'--height' | '--input-width' | '--input-font-size' | '--border-radius' | '--border' | '--border-inner' | '--active-border' | '--button-font-size' | '--button-background-color' | '--button-width' | '--input-font-color' | '--button-text-color'>;
|
|
14
15
|
export declare const Stepper: FC<StepperProps>;
|
|
@@ -20,7 +20,8 @@ export var Stepper = function Stepper(p) {
|
|
|
20
20
|
var disabled = props.disabled,
|
|
21
21
|
step = props.step,
|
|
22
22
|
max = props.max,
|
|
23
|
-
min = props.min
|
|
23
|
+
min = props.min,
|
|
24
|
+
inputReadOnly = props.inputReadOnly;
|
|
24
25
|
|
|
25
26
|
var _usePropsValue = usePropsValue(props),
|
|
26
27
|
value = _usePropsValue[0],
|
|
@@ -113,7 +114,8 @@ export var Stepper = function Stepper(p) {
|
|
|
113
114
|
|
|
114
115
|
setHasFocus(false);
|
|
115
116
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
116
|
-
}
|
|
117
|
+
},
|
|
118
|
+
readOnly: inputReadOnly
|
|
117
119
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
118
120
|
className: classPrefix + "-plus",
|
|
119
121
|
onClick: handlePlus,
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { withNativeProps } from '../../utils/native-props';
|
|
4
|
+
import { mergeProps } from '../../utils/with-default-props';
|
|
4
5
|
import Badge from '../badge';
|
|
6
|
+
import SafeArea from '../safe-area';
|
|
5
7
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
8
|
export var TabBarItem = function TabBarItem() {
|
|
7
9
|
return null;
|
|
8
10
|
};
|
|
9
|
-
|
|
11
|
+
var classPrefix = "adm-tab-bar";
|
|
12
|
+
var defaultProps = {
|
|
13
|
+
safeArea: false
|
|
14
|
+
};
|
|
15
|
+
export var TabBar = function TabBar(p) {
|
|
10
16
|
var _a;
|
|
11
17
|
|
|
18
|
+
var props = mergeProps(defaultProps, p);
|
|
12
19
|
var firstActiveKey = null;
|
|
13
20
|
var items = [];
|
|
14
21
|
React.Children.forEach(props.children, function (child, index) {
|
|
@@ -32,28 +39,32 @@ export var TabBar = function TabBar(props) {
|
|
|
32
39
|
setActiveKey = _usePropsValue[1];
|
|
33
40
|
|
|
34
41
|
return withNativeProps(props, /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className:
|
|
42
|
+
className: classPrefix
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: classPrefix + "-wrap"
|
|
36
45
|
}, items.map(function (item) {
|
|
46
|
+
var _classNames;
|
|
47
|
+
|
|
37
48
|
var active = item.key === activeKey;
|
|
38
49
|
|
|
39
50
|
function renderContent() {
|
|
40
51
|
var iconElement = item.props.icon && /*#__PURE__*/React.createElement("div", {
|
|
41
|
-
className:
|
|
52
|
+
className: classPrefix + "-item-icon"
|
|
42
53
|
}, typeof item.props.icon === 'function' ? item.props.icon(active) : item.props.icon);
|
|
43
54
|
var titleElement = item.props.title && /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className:
|
|
55
|
+
className: classPrefix + "-item-title"
|
|
45
56
|
}, item.props.title);
|
|
46
57
|
|
|
47
58
|
if (iconElement) {
|
|
48
59
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Badge, {
|
|
49
60
|
content: item.props.badge,
|
|
50
|
-
className:
|
|
61
|
+
className: classPrefix + "-icon-badge"
|
|
51
62
|
}, iconElement), titleElement);
|
|
52
63
|
} else if (titleElement) {
|
|
53
|
-
return /*#__PURE__*/React.createElement(
|
|
64
|
+
return /*#__PURE__*/React.createElement(Badge, {
|
|
54
65
|
content: item.props.badge,
|
|
55
|
-
className:
|
|
56
|
-
}, titleElement)
|
|
66
|
+
className: classPrefix + "-title-badge"
|
|
67
|
+
}, titleElement);
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
return null;
|
|
@@ -66,9 +77,9 @@ export var TabBar = function TabBar(props) {
|
|
|
66
77
|
if (key === undefined || key === null) return;
|
|
67
78
|
setActiveKey(key.toString());
|
|
68
79
|
},
|
|
69
|
-
className: classNames(
|
|
70
|
-
'adm-tab-bar-item-active': active
|
|
71
|
-
})
|
|
80
|
+
className: classNames(classPrefix + "-item", (_classNames = {}, _classNames[classPrefix + "-item-active"] = active, _classNames))
|
|
72
81
|
}, renderContent()));
|
|
82
|
+
})), props.safeArea && /*#__PURE__*/React.createElement(SafeArea, {
|
|
83
|
+
position: 'bottom'
|
|
73
84
|
})));
|
|
74
85
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import './toast.less';
|
|
2
|
-
import { clear, show } from './methods';
|
|
2
|
+
import { clear, show, config } from './methods';
|
|
3
3
|
export type { ToastShowProps } from './methods';
|
|
4
4
|
declare const Toast: {
|
|
5
5
|
show: typeof show;
|
|
6
6
|
clear: typeof clear;
|
|
7
|
+
config: typeof config;
|
|
7
8
|
};
|
|
8
9
|
export default Toast;
|
|
@@ -2,3 +2,4 @@ import { ToastProps } from './toast';
|
|
|
2
2
|
export declare type ToastShowProps = Omit<ToastProps, 'visible'>;
|
|
3
3
|
export declare function show(p: ToastShowProps | string): void;
|
|
4
4
|
export declare function clear(): void;
|
|
5
|
+
export declare function config(val: Pick<ToastProps, 'duration' | 'position' | 'maskClickable'>): void;
|
|
@@ -14,7 +14,9 @@ function unmount(container) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
var defaultProps = {
|
|
17
|
-
duration: 2000
|
|
17
|
+
duration: 2000,
|
|
18
|
+
position: 'center',
|
|
19
|
+
maskClickable: true
|
|
18
20
|
};
|
|
19
21
|
export function show(p) {
|
|
20
22
|
var props = mergeProps(defaultProps, typeof p === 'string' ? {
|
|
@@ -74,4 +76,17 @@ export function clear() {
|
|
|
74
76
|
if (!container) break;
|
|
75
77
|
unmount(container);
|
|
76
78
|
}
|
|
79
|
+
}
|
|
80
|
+
export function config(val) {
|
|
81
|
+
if (val.duration !== undefined) {
|
|
82
|
+
defaultProps.duration = val.duration;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (val.position !== undefined) {
|
|
86
|
+
defaultProps.position = val.position;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (val.maskClickable !== undefined) {
|
|
90
|
+
defaultProps.maskClickable = val.maskClickable;
|
|
91
|
+
}
|
|
77
92
|
}
|