@trionesdev/antd-mobile-react 0.0.2-beta.2 → 0.0.2-beta.21
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/dist/ActionSheet/ActionSheet.d.ts +25 -0
- package/dist/ActionSheet/ActionSheet.js +77 -0
- package/dist/ActionSheet/index.d.ts +1 -1
- package/dist/ActionSheet/index.js +1 -1
- package/dist/ActionSheet/style.scss +52 -0
- package/dist/Button/button.d.ts +2 -1
- package/dist/Button/button.js +1 -1
- package/dist/Button/style.scss +41 -39
- package/dist/Calendar/calendar-grid.d.ts +10 -9
- package/dist/Calendar/calendar-grid.js +41 -64
- package/dist/Calendar/calendar-header.d.ts +3 -2
- package/dist/Calendar/calendar-header.js +6 -6
- package/dist/Calendar/calendar-range.d.ts +4 -3
- package/dist/Calendar/calendar-range.js +12 -11
- package/dist/Calendar/calendar.d.ts +5 -4
- package/dist/Calendar/calendar.js +23 -14
- package/dist/Calendar/style.scss +4 -4
- package/dist/Calendar/touchable-calendar-grid.d.ts +6 -5
- package/dist/Calendar/touchable-calendar-grid.js +58 -50
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +3 -2
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +14 -28
- package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +3 -2
- package/dist/CalendarDatetimePicker/DateTimeSwitch.js +4 -3
- package/dist/CalendarDatetimePicker/demo/base.js +1 -1
- package/dist/CalendarDatetimePicker/style.scss +9 -9
- package/dist/CalendarDatetimePicker/types.d.ts +1 -1
- package/dist/CalendarDatetimePicker/types.js +1 -1
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +11 -0
- package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +61 -0
- package/dist/{Mask → CalendarDatetimePickerCell}/demo/base.js +9 -15
- package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
- package/dist/CalendarDatetimePickerCell/index.js +2 -0
- package/dist/CalendarDatetimePickerCell/style.scss +10 -0
- package/dist/CalendarDatetimePickerCell/types.d.ts +1 -0
- package/dist/CalendarDatetimePickerCell/types.js +1 -0
- package/dist/CalendarPicker/calendar-picker.js +2 -2
- package/dist/CalendarPicker/calendar-range-picker.d.ts +4 -4
- package/dist/CalendarPicker/calendar-range-picker.js +11 -9
- package/dist/CalendarPicker/demo/base.js +6 -6
- package/dist/CalendarPicker/index.d.ts +2 -2
- package/dist/CalendarPicker/index.js +3 -3
- package/dist/CalendarPicker/style.scss +5 -5
- package/dist/CalendarPicker/types.d.ts +8 -7
- package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +11 -0
- package/dist/CalendarPickerCell/CalendarPickerCell.js +54 -0
- package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +11 -0
- package/dist/CalendarPickerCell/CalendarRangePickerCell.js +56 -0
- package/dist/CalendarPickerCell/demo/base.d.ts +3 -0
- package/dist/CalendarPickerCell/demo/base.js +31 -0
- package/dist/CalendarPickerCell/index.d.ts +8 -0
- package/dist/CalendarPickerCell/index.js +5 -0
- package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
- package/dist/CascaderPicker/cascader-picker.js +90 -0
- package/dist/CascaderPicker/demo/base.js +1 -4
- package/dist/CascaderPicker/index.d.ts +1 -1
- package/dist/CascaderPicker/index.js +1 -1
- package/dist/CascaderPicker/style.scss +45 -0
- package/dist/CascaderPickerCell/CascaderPickerCell.d.ts +21 -0
- package/dist/CascaderPickerCell/CascaderPickerCell.js +70 -0
- package/dist/CascaderPickerCell/demo/base.js +71 -0
- package/dist/CascaderPickerCell/index.d.ts +3 -0
- package/dist/CascaderPickerCell/index.js +2 -0
- package/dist/CascaderPickerCell/style.scss +24 -0
- package/dist/Cell/demo/base.js +41 -2
- package/dist/Checkbox/demo/base.js +9 -4
- package/dist/Checkbox/demo/disabled.js +2 -1
- package/dist/DemoBlock/index.d.ts +6 -0
- package/dist/DemoBlock/index.js +9 -2
- package/dist/FetchPicker/FetchPicker.d.ts +113 -0
- package/dist/FetchPicker/FetchPicker.js +319 -0
- package/dist/FetchPicker/index.d.ts +4 -0
- package/dist/FetchPicker/index.js +3 -0
- package/dist/FetchPicker/styles.scss +118 -0
- package/dist/FloatButton/FloatButton.d.ts +21 -0
- package/dist/FloatButton/FloatButton.js +66 -0
- package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
- package/dist/FloatButton/FloatButtonGroup.js +120 -0
- package/dist/FloatButton/context.d.ts +13 -0
- package/dist/FloatButton/context.js +2 -0
- package/dist/FloatButton/demo/base.d.ts +3 -0
- package/dist/FloatButton/demo/base.js +10 -0
- package/dist/FloatButton/demo/group.d.ts +3 -0
- package/dist/FloatButton/demo/group.js +20 -0
- package/dist/FloatButton/demo/square.d.ts +3 -0
- package/dist/FloatButton/demo/square.js +12 -0
- package/dist/FloatButton/index.d.ts +10 -0
- package/dist/FloatButton/index.js +5 -0
- package/dist/FloatButton/style.scss +123 -0
- package/dist/Form/FormItem/form-item-content.d.ts +17 -0
- package/dist/Form/FormItem/form-item-content.js +39 -0
- package/dist/Form/FormItem/form-item-label.d.ts +13 -0
- package/dist/Form/FormItem/form-item-label.js +29 -0
- package/dist/Form/FormItem/form-item.d.ts +51 -0
- package/dist/Form/FormItem/form-item.js +74 -0
- package/dist/Form/FormItem/index.d.ts +5 -0
- package/dist/Form/FormItem/index.js +3 -0
- package/dist/Form/demo/input.js +7 -3
- package/dist/Form/demo/vertical.d.ts +3 -0
- package/dist/Form/demo/vertical.js +45 -0
- package/dist/Form/index.d.ts +9 -2
- package/dist/Form/index.js +5 -1
- package/dist/Form/style.scss +106 -0
- package/dist/FormCell/index.d.ts +3 -0
- package/dist/FormCell/index.js +2 -0
- package/dist/ImagesPreview/ImagesPreview.js +2 -2
- package/dist/ImagesWall/CameraModal.js +2 -2
- package/dist/ImagesWall/style.scss +4 -4
- package/dist/Input/base-input.d.ts +13 -0
- package/dist/Input/base-input.js +41 -0
- package/dist/Input/demo/base.js +113 -11
- package/dist/Input/index.d.ts +14 -2
- package/dist/Input/index.js +11 -1
- package/dist/Input/index.scss +240 -0
- package/dist/Input/input-affix-wrapper.d.ts +13 -0
- package/dist/Input/input-affix-wrapper.js +37 -0
- package/dist/Input/input-opt.d.ts +16 -0
- package/dist/Input/input-opt.js +87 -0
- package/dist/Input/input-password.d.ts +7 -0
- package/dist/Input/input-password.js +48 -0
- package/dist/Input/input.d.ts +20 -0
- package/dist/Input/input.js +66 -0
- package/dist/Input/textarea.d.ts +15 -0
- package/dist/Input/textarea.js +51 -0
- package/dist/Input/types.d.ts +3 -0
- package/dist/Input/types.js +2 -0
- package/dist/Loading/DotLoading.d.ts +1 -0
- package/dist/Loading/DotLoading.js +1 -0
- package/dist/Loading/SpinLoading.d.ts +1 -0
- package/dist/Loading/SpinLoading.js +1 -0
- package/dist/Loading/demo/base.d.ts +3 -0
- package/dist/{SpinLoading → Loading}/demo/base.js +8 -2
- package/dist/Loading/demo/dot-loading.d.ts +3 -0
- package/dist/Loading/demo/dot-loading.js +25 -0
- package/dist/Loading/index.d.ts +5 -0
- package/dist/Loading/index.js +3 -0
- package/dist/Overlay/Overlay.d.ts +16 -0
- package/dist/Overlay/Overlay.js +117 -0
- package/dist/Overlay/demo/base.d.ts +3 -0
- package/dist/Overlay/demo/base.js +27 -0
- package/dist/Overlay/index.d.ts +4 -0
- package/dist/Overlay/index.js +3 -0
- package/dist/Overlay/style.scss +20 -0
- package/dist/Picker/index.d.ts +1 -1
- package/dist/Picker/index.js +1 -1
- package/dist/Picker/picker.d.ts +20 -0
- package/dist/Picker/picker.js +94 -0
- package/dist/Picker/style.scss +44 -0
- package/dist/PickerView/index.d.ts +2 -1
- package/dist/PickerView/index.js +1 -1
- package/dist/PickerView/picker-view-column-item.d.ts +7 -0
- package/dist/PickerView/picker-view-column-item.js +11 -0
- package/dist/PickerView/picker-view-column.d.ts +10 -0
- package/dist/PickerView/picker-view-column.js +117 -0
- package/dist/PickerView/picker-view.d.ts +12 -0
- package/dist/PickerView/picker-view.js +60 -0
- package/dist/PickerView/style.scss +72 -0
- package/dist/PickerView/types.d.ts +4 -0
- package/dist/PickerView/types.js +1 -0
- package/dist/Popup/demo/base.js +107 -25
- package/dist/Popup/index.d.ts +2 -1
- package/dist/Popup/index.js +2 -1
- package/dist/Popup/popup.d.ts +31 -0
- package/dist/Popup/popup.js +87 -0
- package/dist/Popup/style.scss +129 -0
- package/dist/Progress/index.d.ts +1 -1
- package/dist/Progress/index.js +1 -1
- package/dist/Radio/demo/base.js +2 -2
- package/dist/ScrollView/index.d.ts +2 -1
- package/dist/ScrollView/index.js +1 -1
- package/dist/ScrollView/scroll-view.d.ts +4 -0
- package/dist/ScrollView/scroll-view.js +55 -0
- package/dist/ScrollView/style.scss +19 -0
- package/dist/ScrollView/types.d.ts +26 -0
- package/dist/ScrollView/types.js +1 -0
- package/dist/Segmented/demo/base.d.ts +3 -0
- package/dist/Segmented/demo/base.js +33 -0
- package/dist/Segmented/index.d.ts +3 -0
- package/dist/Segmented/index.js +2 -0
- package/dist/SideBar/index.d.ts +1 -1
- package/dist/SideBar/style.scss +6 -6
- package/dist/Skeleton/demo/base.d.ts +3 -0
- package/dist/Skeleton/demo/base.js +8 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +2 -0
- package/dist/Stepper/demo/base.d.ts +3 -0
- package/dist/Stepper/demo/base.js +23 -0
- package/dist/Stepper/index.d.ts +3 -0
- package/dist/Stepper/index.js +2 -0
- package/dist/Swiper/style.scss +1 -1
- package/dist/Toast/toast-modal.js +4 -4
- package/dist/VerificationCodeInput/demo/base.js +2 -2
- package/dist/VerificationCodeInput/index.d.ts +2 -2
- package/dist/VerificationCodeInput/index.js +1 -1
- package/dist/VerificationCodeInput/style.scss +20 -0
- package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
- package/dist/VerificationCodeInput/verification-code-input.js +99 -0
- package/dist/index.d.ts +33 -19
- package/dist/index.js +9 -2
- package/dist/types.d.ts +0 -8
- package/dist/types.js +0 -1
- package/dist/utils/dayjs.d.ts +4 -0
- package/dist/utils/dayjs.js +42 -0
- package/dist/utils/use-isomorphic-update-layout-effect.d.ts +1 -1
- package/package.json +11 -16
- package/dist/Mask/index.d.ts +0 -3
- package/dist/Mask/index.js +0 -2
- package/dist/Progress/Progress.d.ts +0 -37
- package/dist/Progress/Progress.js +0 -52
- package/dist/Progress/ProgressCircle.d.ts +0 -17
- package/dist/Progress/ProgressCircle.js +0 -148
- package/dist/Progress/ProgressLine.d.ts +0 -15
- package/dist/Progress/ProgressLine.js +0 -87
- package/dist/Progress/style.scss +0 -33
- package/dist/Progress/types.d.ts +0 -4
- package/dist/Progress/types.js +0 -2
- package/dist/SpinLoading/index.d.ts +0 -3
- package/dist/SpinLoading/index.js +0 -2
- /package/dist/{Mask → CalendarDatetimePickerCell}/demo/base.d.ts +0 -0
- /package/dist/{SpinLoading → CascaderPickerCell}/demo/base.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export type ScrollEvent = {
|
|
3
|
+
target?: any;
|
|
4
|
+
detail: {
|
|
5
|
+
deltaX?: number;
|
|
6
|
+
deltaY?: number;
|
|
7
|
+
scrollLeft?: number;
|
|
8
|
+
scrollTop?: number;
|
|
9
|
+
scrollHeight?: number;
|
|
10
|
+
scrollWidth?: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type ScrollViewProps = {
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
onScroll?: (e: ScrollEvent) => void;
|
|
18
|
+
showScrollbar?: boolean;
|
|
19
|
+
scrollX?: boolean;
|
|
20
|
+
scrollY?: boolean;
|
|
21
|
+
scrollTop?: number;
|
|
22
|
+
upperThreshold?: number;
|
|
23
|
+
lowerThreshold?: number;
|
|
24
|
+
onScrollToUpper?: () => void;
|
|
25
|
+
onScrollToLower?: () => void;
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Segmented } from "@trionesdev/antd-mobile-base-react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { DemoBlock } from "../../DemoBlock";
|
|
4
|
+
export default (function () {
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DemoBlock, {
|
|
6
|
+
title: "\u57FA\u672C\u4F7F\u7528"
|
|
7
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
8
|
+
options: [{
|
|
9
|
+
label: '选项1',
|
|
10
|
+
value: '1'
|
|
11
|
+
}, {
|
|
12
|
+
label: '选项2',
|
|
13
|
+
value: '2'
|
|
14
|
+
}, {
|
|
15
|
+
label: '选项3',
|
|
16
|
+
value: '3'
|
|
17
|
+
}]
|
|
18
|
+
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
19
|
+
title: "block \u5C5E\u6027\u4F7F\u5176\u9002\u5408\u7236\u5143\u7D20\u5BBD\u5EA6"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
21
|
+
block: true,
|
|
22
|
+
options: [{
|
|
23
|
+
label: '选项1',
|
|
24
|
+
value: '1'
|
|
25
|
+
}, {
|
|
26
|
+
label: '选项2',
|
|
27
|
+
value: '2'
|
|
28
|
+
}, {
|
|
29
|
+
label: '选项3',
|
|
30
|
+
value: '3'
|
|
31
|
+
}]
|
|
32
|
+
})));
|
|
33
|
+
});
|
package/dist/SideBar/index.d.ts
CHANGED
package/dist/SideBar/style.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../style/variable" as
|
|
1
|
+
@use "../style/variable" as variable;
|
|
2
2
|
|
|
3
3
|
$trionesSideBarCls: 'triones-antm-sidebar';
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ $trionesSideBarCls: 'triones-antm-sidebar';
|
|
|
9
9
|
|
|
10
10
|
&-tabs {
|
|
11
11
|
min-width: 0;
|
|
12
|
-
background-color:
|
|
12
|
+
background-color: variable.$trionesColorFill;
|
|
13
13
|
overflow: auto;
|
|
14
14
|
scrollbar-width: thin;
|
|
15
15
|
flex-shrink: 0;
|
|
@@ -17,12 +17,12 @@ $trionesSideBarCls: 'triones-antm-sidebar';
|
|
|
17
17
|
|
|
18
18
|
&-tab {
|
|
19
19
|
cursor: pointer;
|
|
20
|
-
padding:
|
|
21
|
-
color:
|
|
20
|
+
padding: variable.$trionesPadding variable.$trionesPadding;
|
|
21
|
+
color: variable.$trionesColorTextSecondary;
|
|
22
22
|
|
|
23
23
|
&-active {
|
|
24
|
-
color:
|
|
25
|
-
background-color:
|
|
24
|
+
color: variable.$trionesColorPrimaryText;
|
|
25
|
+
background-color: variable.$trionesColorBgBase;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DemoBlock } from "../../DemoBlock";
|
|
3
|
+
import { Skeleton } from "../../index";
|
|
4
|
+
export default (function () {
|
|
5
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DemoBlock, {
|
|
6
|
+
title: "\u57FA\u7840\u7528\u6CD5"
|
|
7
|
+
}, /*#__PURE__*/React.createElement(Skeleton, null)));
|
|
8
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Skeleton } from '@trionesdev/antd-mobile-base-react';
|
|
2
|
+
export type { SkeletonAvatarProps, SkeletonAvatarShape, SkeletonAvatarSize, SkeletonBlockType, SkeletonButtonProps, SkeletonButtonShape, SkeletonInputProps, SkeletonParagraphProps, SkeletonProps, SkeletonTitleProps, } from '@trionesdev/antd-mobile-base-react';
|
|
3
|
+
export default Skeleton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Stepper from "../index";
|
|
3
|
+
import { DemoBlock } from "../../DemoBlock";
|
|
4
|
+
export default (function () {
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DemoBlock, {
|
|
6
|
+
title: "\u57FA\u672C\u4F7F\u7528"
|
|
7
|
+
}, /*#__PURE__*/React.createElement(Stepper, null)), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
8
|
+
title: "\u6700\u5927\u503C\u6700\u5C0F\u503C"
|
|
9
|
+
}, /*#__PURE__*/React.createElement(Stepper, {
|
|
10
|
+
min: 0,
|
|
11
|
+
max: 10
|
|
12
|
+
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
13
|
+
title: "\u57FA\u672C\u4F7F\u7528"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(Stepper, {
|
|
15
|
+
max: 10
|
|
16
|
+
})), /*#__PURE__*/React.createElement(DemoBlock, {
|
|
17
|
+
title: "\u5360\u6EE1"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Stepper, {
|
|
19
|
+
block: true,
|
|
20
|
+
min: 0,
|
|
21
|
+
max: 10
|
|
22
|
+
})));
|
|
23
|
+
});
|
package/dist/Swiper/style.scss
CHANGED
|
@@ -12,9 +12,9 @@ import { memo, useEffect, useMemo, useRef, useState } from "react";
|
|
|
12
12
|
import classNames from "classnames";
|
|
13
13
|
import React from "react";
|
|
14
14
|
import "./style.scss";
|
|
15
|
-
import Mask from "../Mask";
|
|
16
|
-
import { CheckOutline, CloseOutline } from "../../../antd-mobile-icons-react";
|
|
17
15
|
import { SpinLoading } from "../index";
|
|
16
|
+
import Overlay from "../Overlay";
|
|
17
|
+
import { CheckOutline, CloseOutline } from "@trionesdev/antd-mobile-icons-react";
|
|
18
18
|
var toastCls = "triones-antm-toast";
|
|
19
19
|
export var ToastModal = /*#__PURE__*/memo(function (_ref) {
|
|
20
20
|
var open = _ref.open,
|
|
@@ -84,10 +84,10 @@ export var ToastModal = /*#__PURE__*/memo(function (_ref) {
|
|
|
84
84
|
return '50%';
|
|
85
85
|
}
|
|
86
86
|
}, [position]);
|
|
87
|
-
return /*#__PURE__*/React.createElement(
|
|
87
|
+
return /*#__PURE__*/React.createElement(Overlay, {
|
|
88
88
|
className: maskClassName,
|
|
89
89
|
open: internalOpen,
|
|
90
|
-
|
|
90
|
+
onClick: function onClick() {
|
|
91
91
|
if (maskClosable) {
|
|
92
92
|
setInternalOpen(false);
|
|
93
93
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import VerificationCodeInput from "../index";
|
|
3
3
|
export default (function () {
|
|
4
4
|
return /*#__PURE__*/React.createElement("div", {
|
|
5
5
|
style: {
|
|
6
6
|
backgroundColor: 'rgb(244 244 244)'
|
|
7
7
|
}
|
|
8
|
-
}, /*#__PURE__*/React.createElement(
|
|
8
|
+
}, /*#__PURE__*/React.createElement(VerificationCodeInput, {
|
|
9
9
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"
|
|
10
10
|
}));
|
|
11
11
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { VerificationCodeInput,
|
|
2
|
-
export type {
|
|
1
|
+
import { VerificationCodeInput, VerificationCodeInputProps } from "./verification-code-input";
|
|
2
|
+
export type { VerificationCodeInputProps };
|
|
3
3
|
export default VerificationCodeInput;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VerificationCodeInput } from "
|
|
1
|
+
import { VerificationCodeInput } from "./verification-code-input";
|
|
2
2
|
export default VerificationCodeInput;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@use "../style/variable" as variable;
|
|
2
|
+
|
|
3
|
+
$verificationCodeInputCls: 'triones-antm-verification-code-input';
|
|
4
|
+
|
|
5
|
+
.#{$verificationCodeInputCls} {
|
|
6
|
+
&-send {
|
|
7
|
+
padding-inline: variable.$trionesPaddingContentHorizontal;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
|
|
10
|
+
&:hover {
|
|
11
|
+
color: variable.$trionesColorPrimary;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-counting {
|
|
16
|
+
padding-inline: variable.$trionesPaddingContentHorizontal;
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
color: variable.$trionesColorTextDisabled;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { InputProps } from '..';
|
|
3
|
+
import './style.scss';
|
|
4
|
+
export type VerificationCodeInputProps = Omit<InputProps, 'suffix'> & {
|
|
5
|
+
/**
|
|
6
|
+
* @description 发送文本
|
|
7
|
+
* @default 获取验证码
|
|
8
|
+
*/
|
|
9
|
+
sendText?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @description 重新发送文本
|
|
12
|
+
* @default 重新发送
|
|
13
|
+
*/
|
|
14
|
+
resendText?: string;
|
|
15
|
+
/**
|
|
16
|
+
* @description 等待时间
|
|
17
|
+
*/
|
|
18
|
+
waitSeconds?: number;
|
|
19
|
+
/**
|
|
20
|
+
* @description 发送事件
|
|
21
|
+
*/
|
|
22
|
+
onSend?: () => Promise<boolean>;
|
|
23
|
+
};
|
|
24
|
+
export declare const VerificationCodeInput: FC<VerificationCodeInputProps>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["sendText", "resendText", "waitSeconds", "onSend"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
5
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
17
|
+
import Input from "../Input";
|
|
18
|
+
import "./style.scss";
|
|
19
|
+
export var VerificationCodeInput = function VerificationCodeInput(_ref) {
|
|
20
|
+
var _ref$sendText = _ref.sendText,
|
|
21
|
+
sendText = _ref$sendText === void 0 ? '获取验证码' : _ref$sendText,
|
|
22
|
+
_ref$resendText = _ref.resendText,
|
|
23
|
+
resendText = _ref$resendText === void 0 ? '重新发送' : _ref$resendText,
|
|
24
|
+
_ref$waitSeconds = _ref.waitSeconds,
|
|
25
|
+
waitSeconds = _ref$waitSeconds === void 0 ? 60 : _ref$waitSeconds,
|
|
26
|
+
onSend = _ref.onSend,
|
|
27
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
var _useState = useState(false),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
send = _useState2[0],
|
|
31
|
+
setSend = _useState2[1];
|
|
32
|
+
var _useState3 = useState(0),
|
|
33
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
+
seconds = _useState4[0],
|
|
35
|
+
setSeconds = _useState4[1];
|
|
36
|
+
var secondsRef = useRef(0);
|
|
37
|
+
var timer = useRef(null);
|
|
38
|
+
useEffect(function () {
|
|
39
|
+
if (seconds < 1) {
|
|
40
|
+
clearTimeout(timer.current);
|
|
41
|
+
timer.current = null;
|
|
42
|
+
} else {
|
|
43
|
+
setSend(true);
|
|
44
|
+
}
|
|
45
|
+
}, [seconds]);
|
|
46
|
+
useEffect(function () {
|
|
47
|
+
return function () {
|
|
48
|
+
clearTimeout(timer.current);
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
var prefixCls = 'triones-antm-verification-code-input';
|
|
52
|
+
var handleSuffix = function handleSuffix() {
|
|
53
|
+
if (seconds > 0) {
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: classNames("".concat(prefixCls, "-counting"))
|
|
56
|
+
}, seconds, "s");
|
|
57
|
+
}
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: classNames("".concat(prefixCls, "-send")),
|
|
60
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
61
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
62
|
+
while (1) switch (_context.prev = _context.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
if (timer.current) {
|
|
65
|
+
_context.next = 9;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
_context.t0 = onSend === undefined;
|
|
69
|
+
if (_context.t0) {
|
|
70
|
+
_context.next = 6;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
_context.next = 5;
|
|
74
|
+
return onSend === null || onSend === void 0 ? void 0 : onSend();
|
|
75
|
+
case 5:
|
|
76
|
+
_context.t0 = _context.sent;
|
|
77
|
+
case 6:
|
|
78
|
+
if (!_context.t0) {
|
|
79
|
+
_context.next = 9;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
secondsRef.current = waitSeconds;
|
|
83
|
+
timer.current = setInterval(function () {
|
|
84
|
+
secondsRef.current = secondsRef.current - 1;
|
|
85
|
+
setSeconds(secondsRef.current);
|
|
86
|
+
}, 1000);
|
|
87
|
+
case 9:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context.stop();
|
|
90
|
+
}
|
|
91
|
+
}, _callee);
|
|
92
|
+
}))
|
|
93
|
+
}, send ? resendText : sendText);
|
|
94
|
+
};
|
|
95
|
+
return /*#__PURE__*/React.createElement(Input, _extends({}, props, {
|
|
96
|
+
className: classNames(prefixCls, props.className),
|
|
97
|
+
suffix: handleSuffix()
|
|
98
|
+
}));
|
|
99
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as ActionSheet } from
|
|
1
|
+
export { default as ActionSheet } from './ActionSheet';
|
|
2
2
|
export type { ActionSheetProps } from './ActionSheet';
|
|
3
3
|
export { default as Alert } from './Alert';
|
|
4
4
|
export type { AlertProps } from './Alert';
|
|
@@ -12,22 +12,28 @@ export { default as Calendar, CalendarGrid, TouchableCalendarGrid, } from './Cal
|
|
|
12
12
|
export type { CalendarGridProps, CalendarProps } from './Calendar';
|
|
13
13
|
export { default as CalendarDatetimePicker } from './CalendarDatetimePicker';
|
|
14
14
|
export type { CalendarDatetimePickerProps } from './CalendarDatetimePicker';
|
|
15
|
+
export { default as CalendarDatetimePickerCell } from './CalendarDatetimePickerCell';
|
|
16
|
+
export type { CalendarDatetimePickerCellProps } from './CalendarDatetimePickerCell';
|
|
15
17
|
export { default as CalendarPicker } from './CalendarPicker';
|
|
16
18
|
export type { CalendarPickerProps } from './CalendarPicker';
|
|
19
|
+
export { default as CalendarPickerCell } from './CalendarPickerCell';
|
|
20
|
+
export type { CalendarPickerCellProps, CalendarRangePickerCellProps, } from './CalendarPickerCell';
|
|
17
21
|
export { default as Card } from './Card';
|
|
18
22
|
export type { CardProps } from './Card';
|
|
23
|
+
export { default as CascaderPickerCell } from './CascaderPickerCell';
|
|
24
|
+
export type { CascaderPickerCellProps } from './CascaderPickerCell';
|
|
19
25
|
export { default as CascaderPicker } from './CascaderPicker';
|
|
20
26
|
export type { CascaderPickerProps } from './CascaderPicker';
|
|
21
27
|
export { default as CascaderView } from './CascaderView';
|
|
22
28
|
export type { CascaderViewProps } from './CascaderView';
|
|
23
29
|
export { default as Cell } from './Cell';
|
|
24
|
-
export type {
|
|
30
|
+
export type { CellGroupProps, CellProps } from './Cell';
|
|
25
31
|
export { default as Checkbox } from './Checkbox';
|
|
26
32
|
export type { CheckboxProps } from './Checkbox';
|
|
27
33
|
export { default as ConfigProvider } from './ConfigProvider';
|
|
28
34
|
export type { ConfigProviderProps } from './ConfigProvider';
|
|
29
|
-
export { default as Descriptions } from
|
|
30
|
-
export type { DescriptionsProps } from
|
|
35
|
+
export { default as Descriptions } from './Descriptions';
|
|
36
|
+
export type { DescriptionsProps } from './Descriptions';
|
|
31
37
|
export { default as Divider } from './Divider';
|
|
32
38
|
export type { DividerProps } from './Divider';
|
|
33
39
|
export { default as Ellipsis } from './Ellipsis';
|
|
@@ -35,35 +41,37 @@ export type { EllipsisProps } from './Ellipsis';
|
|
|
35
41
|
export { default as Empty } from './Empty';
|
|
36
42
|
export type { EmptyProps } from './Empty';
|
|
37
43
|
export { default as ErrorBlock } from './ErrorBlock';
|
|
38
|
-
export type {
|
|
44
|
+
export type { ErrorBlockProps, ErrorBlockStatus } from './ErrorBlock';
|
|
45
|
+
export { default as FloatButton } from './FloatButton';
|
|
46
|
+
export type { FloatButtonGroupProps, FloatButtonProps } from './FloatButton';
|
|
39
47
|
export { default as Footer } from './Footer';
|
|
40
48
|
export type { FooterProps } from './Footer';
|
|
41
49
|
export { default as Form } from './Form';
|
|
42
|
-
export type { FormItemProps, FormProps } from './Form';
|
|
50
|
+
export type { FormItemProps, FormProps, FormInstance } from './Form';
|
|
43
51
|
export { default as Grid } from './Grid';
|
|
44
|
-
export type {
|
|
52
|
+
export type { GridItemProps, GridProps } from './Grid';
|
|
45
53
|
export { default as Image } from './Image';
|
|
46
|
-
export type { ImageProps } from
|
|
54
|
+
export type { ImageProps } from './Image';
|
|
47
55
|
export { default as ImagesPreview } from './ImagesPreview';
|
|
48
56
|
export type { ImagePreviewProps } from './ImagesPreview';
|
|
49
57
|
export { default as ImagesWall } from './ImagesWall';
|
|
50
|
-
export type {
|
|
58
|
+
export type { ImagesWallItemProps, ImagesWallProps } from './ImagesWall';
|
|
51
59
|
export { default as Input } from './Input';
|
|
52
|
-
export type { InputOPTProps, InputPasswordProps, InputProps, InputTextareaProps } from './Input';
|
|
60
|
+
export type { InputOPTProps, InputPasswordProps, InputProps, InputTextareaProps, } from './Input';
|
|
53
61
|
export { default as InputNumber } from './InputNumber';
|
|
54
62
|
export type { InputNumberProps } from './InputNumber';
|
|
55
|
-
export { default as Mask } from "./Mask";
|
|
56
|
-
export type { MaskProps } from "./Mask";
|
|
57
63
|
export { default as NavBar } from './NavBar';
|
|
58
64
|
export type { NavBarProps } from './NavBar';
|
|
59
65
|
export { default as NoticeBar } from './NoticeBar';
|
|
60
66
|
export type { NoticeBarProps } from './NoticeBar';
|
|
67
|
+
export { default as Overlay } from './Overlay';
|
|
68
|
+
export type { OverlayProps } from './Overlay';
|
|
61
69
|
export { default as PageIndicator } from './PageIndicator';
|
|
62
70
|
export type { PageIndicatorProps } from './PageIndicator';
|
|
63
71
|
export { default as Picker } from './Picker';
|
|
64
72
|
export type { PickerProps } from './Picker';
|
|
65
73
|
export { default as PickerView } from './PickerView';
|
|
66
|
-
export type {
|
|
74
|
+
export type { PickerColumnOption, PickerViewProps } from './PickerView';
|
|
67
75
|
export { default as Popup } from './Popup';
|
|
68
76
|
export type { PopupProps } from './Popup';
|
|
69
77
|
export { default as Progress } from './Progress';
|
|
@@ -80,16 +88,22 @@ export { default as Scaffold } from './Scaffold';
|
|
|
80
88
|
export type { ScaffoldProps } from './Scaffold';
|
|
81
89
|
export { default as ScrollView } from './ScrollView';
|
|
82
90
|
export type { ScrollViewProps } from './ScrollView';
|
|
91
|
+
export { default as Segmented } from './Segmented';
|
|
92
|
+
export type { SegmentedProps } from './Segmented';
|
|
83
93
|
export { default as SideBar } from './SideBar';
|
|
84
94
|
export type { SideBarProps } from './SideBar';
|
|
95
|
+
export { default as Skeleton } from './Skeleton';
|
|
96
|
+
export type { SkeletonAvatarProps, SkeletonAvatarShape, SkeletonAvatarSize, SkeletonBlockType, SkeletonButtonProps, SkeletonButtonShape, SkeletonInputProps, SkeletonParagraphProps, SkeletonProps, SkeletonTitleProps, } from './Skeleton';
|
|
85
97
|
export { default as Space } from './Space';
|
|
86
98
|
export type { SpaceProps } from './Space';
|
|
87
|
-
export {
|
|
88
|
-
export type { SpinLoadingProps } from './
|
|
89
|
-
export { default as
|
|
99
|
+
export { SpinLoading, DotLoading } from './Loading';
|
|
100
|
+
export type { SpinLoadingProps, DotLoadingProps } from './Loading';
|
|
101
|
+
export { default as Stepper } from './Stepper';
|
|
102
|
+
export type { StepperProps } from './Stepper';
|
|
103
|
+
export { default as Swiper } from './Swiper';
|
|
90
104
|
export type { SwiperProps } from './Swiper';
|
|
91
|
-
export { default as Steps } from
|
|
92
|
-
export type {
|
|
105
|
+
export { default as Steps } from './Steps';
|
|
106
|
+
export type { StepsItemProps, StepsProps } from './Steps';
|
|
93
107
|
export { default as Switch } from './Switch';
|
|
94
108
|
export type { SwitchProps } from './Switch';
|
|
95
109
|
export { default as TabBar } from './TabBar';
|
|
@@ -101,6 +115,6 @@ export type { ToastProps } from './Toast';
|
|
|
101
115
|
export { default as Tabs } from './Tabs';
|
|
102
116
|
export type { TabsProps } from './Tabs';
|
|
103
117
|
export { default as VerificationCodeInput } from './VerificationCodeInput';
|
|
104
|
-
export type {
|
|
118
|
+
export type { VerificationCodeInputProps } from './VerificationCodeInput';
|
|
105
119
|
export { default as WaterMark } from './WaterMark';
|
|
106
120
|
export type { WaterMarkProps } from './WaterMark';
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,11 @@ export { default as Badge } from "./Badge";
|
|
|
5
5
|
export { default as Button } from "./Button";
|
|
6
6
|
export { default as Calendar, CalendarGrid, TouchableCalendarGrid } from "./Calendar";
|
|
7
7
|
export { default as CalendarDatetimePicker } from "./CalendarDatetimePicker";
|
|
8
|
+
export { default as CalendarDatetimePickerCell } from "./CalendarDatetimePickerCell";
|
|
8
9
|
export { default as CalendarPicker } from "./CalendarPicker";
|
|
10
|
+
export { default as CalendarPickerCell } from "./CalendarPickerCell";
|
|
9
11
|
export { default as Card } from "./Card";
|
|
12
|
+
export { default as CascaderPickerCell } from "./CascaderPickerCell";
|
|
10
13
|
export { default as CascaderPicker } from "./CascaderPicker";
|
|
11
14
|
export { default as CascaderView } from "./CascaderView";
|
|
12
15
|
export { default as Cell } from "./Cell";
|
|
@@ -17,6 +20,7 @@ export { default as Divider } from "./Divider";
|
|
|
17
20
|
export { default as Ellipsis } from "./Ellipsis";
|
|
18
21
|
export { default as Empty } from "./Empty";
|
|
19
22
|
export { default as ErrorBlock } from "./ErrorBlock";
|
|
23
|
+
export { default as FloatButton } from "./FloatButton";
|
|
20
24
|
export { default as Footer } from "./Footer";
|
|
21
25
|
export { default as Form } from "./Form";
|
|
22
26
|
export { default as Grid } from "./Grid";
|
|
@@ -25,9 +29,9 @@ export { default as ImagesPreview } from "./ImagesPreview";
|
|
|
25
29
|
export { default as ImagesWall } from "./ImagesWall";
|
|
26
30
|
export { default as Input } from "./Input";
|
|
27
31
|
export { default as InputNumber } from "./InputNumber";
|
|
28
|
-
export { default as Mask } from "./Mask";
|
|
29
32
|
export { default as NavBar } from "./NavBar";
|
|
30
33
|
export { default as NoticeBar } from "./NoticeBar";
|
|
34
|
+
export { default as Overlay } from "./Overlay";
|
|
31
35
|
export { default as PageIndicator } from "./PageIndicator";
|
|
32
36
|
export { default as Picker } from "./Picker";
|
|
33
37
|
export { default as PickerView } from "./PickerView";
|
|
@@ -39,9 +43,12 @@ export { default as Result } from "./Result";
|
|
|
39
43
|
export { default as SafeArea } from "./SafeArea";
|
|
40
44
|
export { default as Scaffold } from "./Scaffold";
|
|
41
45
|
export { default as ScrollView } from "./ScrollView";
|
|
46
|
+
export { default as Segmented } from "./Segmented";
|
|
42
47
|
export { default as SideBar } from "./SideBar";
|
|
48
|
+
export { default as Skeleton } from "./Skeleton";
|
|
43
49
|
export { default as Space } from "./Space";
|
|
44
|
-
export {
|
|
50
|
+
export { SpinLoading, DotLoading } from "./Loading";
|
|
51
|
+
export { default as Stepper } from "./Stepper";
|
|
45
52
|
export { default as Swiper } from "./Swiper";
|
|
46
53
|
export { default as Steps } from "./Steps";
|
|
47
54
|
export { default as Switch } from "./Switch";
|
package/dist/types.d.ts
CHANGED
package/dist/types.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import dayjs, { OpUnitType } from "dayjs";
|
|
2
|
+
export declare const toDayjsArray: (dateArr?: (dayjs.Dayjs | Date)[]) => dayjs.Dayjs[] | undefined;
|
|
3
|
+
export declare const isSame: (x?: dayjs.Dayjs | Date, y?: dayjs.Dayjs | Date, unit?: OpUnitType) => boolean;
|
|
4
|
+
export declare const isSameArray: (x?: (dayjs.Dayjs | Date)[], y?: (dayjs.Dayjs | Date)[], unit?: OpUnitType) => boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import { isEmpty, isNil } from "lodash-es";
|
|
3
|
+
export var toDayjsArray = function toDayjsArray(dateArr) {
|
|
4
|
+
if (isNil(dateArr)) {
|
|
5
|
+
return dateArr;
|
|
6
|
+
}
|
|
7
|
+
if (isEmpty(dateArr)) {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
return dateArr === null || dateArr === void 0 ? void 0 : dateArr.map(function (date) {
|
|
11
|
+
if (isNil(date)) {
|
|
12
|
+
return date;
|
|
13
|
+
} else {
|
|
14
|
+
return dayjs(date);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export var isSame = function isSame(x, y, unit) {
|
|
19
|
+
if (isNil(x) && isNil(y)) {
|
|
20
|
+
return true;
|
|
21
|
+
} else if (isNil(x) && !isNil(y)) {
|
|
22
|
+
return false;
|
|
23
|
+
} else if (!isNil(x) && isNil(y)) {
|
|
24
|
+
return false;
|
|
25
|
+
} else {
|
|
26
|
+
var _dayjs;
|
|
27
|
+
return Boolean((_dayjs = dayjs(x)) === null || _dayjs === void 0 ? void 0 : _dayjs.isSame(y, unit));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export var isSameArray = function isSameArray(x, y, unit) {
|
|
31
|
+
var xa = x !== null && x !== void 0 ? x : [];
|
|
32
|
+
var ya = y !== null && y !== void 0 ? y : [];
|
|
33
|
+
if (xa.length === 0 && ya.length === 0) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
if (xa.length !== ya.length) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return xa.every(function (date, index) {
|
|
40
|
+
return isSame(date, ya[index], unit);
|
|
41
|
+
});
|
|
42
|
+
};
|