@trionesdev/antd-mobile-react 0.0.2-beta.0 → 0.0.2-beta.10
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/LICENSE +21 -21
- 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/Avatar/demo/base.js +2 -2
- package/dist/Avatar/demo/style.scss +6 -6
- package/dist/Badge/demo/base.js +2 -2
- package/dist/Badge/demo/base.scss +6 -6
- package/dist/Button/demo/base.js +2 -2
- package/dist/Button/style.scss +234 -231
- package/dist/Calendar/calendar-grid.js +2 -2
- package/dist/Calendar/calendar-range.js +2 -2
- package/dist/Calendar/calendar.js +2 -1
- package/dist/Calendar/style.scss +85 -85
- package/dist/Calendar/touchable-calendar-grid.js +9 -9
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +5 -6
- package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +37 -132
- package/dist/CalendarDatetimePicker/demo/base.js +5 -21
- package/dist/CalendarDatetimePicker/index.d.ts +2 -2
- package/dist/CalendarDatetimePicker/style.scss +10 -54
- package/dist/CalendarDatetimePicker/types.d.ts +0 -4
- package/dist/CalendarDatetimePicker/types.js +1 -6
- package/dist/CalendarDatetimePopup/CalendarDatetimePopup.d.ts +10 -0
- package/dist/CalendarDatetimePopup/CalendarDatetimePopup.js +136 -0
- package/dist/CalendarDatetimePopup/demo/base.js +41 -0
- package/dist/CalendarDatetimePopup/index.d.ts +3 -0
- package/dist/CalendarDatetimePopup/index.js +2 -0
- package/dist/CalendarDatetimePopup/style.scss +54 -0
- package/dist/CalendarDatetimePopup/types.d.ts +5 -0
- package/dist/CalendarDatetimePopup/types.js +6 -0
- package/dist/CalendarPopup/calendar-popup.d.ts +4 -0
- package/dist/{CalendarPicker/calendar-picker.js → CalendarPopup/calendar-popup.js} +2 -2
- package/dist/CalendarPopup/calendar-range-popup.d.ts +4 -0
- package/dist/{CalendarPicker/calendar-range-picker.js → CalendarPopup/calendar-range-popup.js} +8 -7
- package/dist/{CalendarPicker → CalendarPopup}/demo/base.js +3 -3
- package/dist/CalendarPopup/index.d.ts +9 -0
- package/dist/CalendarPopup/index.js +5 -0
- package/dist/CalendarPopup/style.scss +31 -0
- package/dist/{CalendarPicker → CalendarPopup}/types.d.ts +2 -2
- package/dist/Card/demo/base.js +2 -2
- package/dist/Card/demo/base.scss +18 -18
- package/dist/CascaderPicker/CascaderPicker.d.ts +25 -0
- package/dist/CascaderPicker/CascaderPicker.js +78 -0
- package/dist/CascaderPicker/demo/base.js +6 -18
- package/dist/CascaderPicker/index.d.ts +1 -1
- package/dist/CascaderPicker/index.js +1 -1
- package/dist/CascaderPicker/style.scss +24 -0
- package/dist/CascaderPopup/cascader-popup.d.ts +27 -0
- package/dist/CascaderPopup/cascader-popup.js +90 -0
- package/dist/CascaderPopup/demo/base.d.ts +3 -0
- package/dist/CascaderPopup/demo/base.js +82 -0
- package/dist/CascaderPopup/index.d.ts +3 -0
- package/dist/CascaderPopup/index.js +2 -0
- package/dist/CascaderPopup/style.scss +45 -0
- package/dist/Cell/demo/base.js +41 -2
- package/dist/Checkbox/demo/base.js +11 -6
- package/dist/Checkbox/demo/disabled.js +2 -1
- package/dist/ConfigProvider/demo/base.js +2 -2
- package/dist/DemoBlock/index.d.ts +6 -0
- package/dist/DemoBlock/index.js +9 -2
- package/dist/DemoBlock/index.scss +20 -20
- package/dist/DemoDescription/index.scss +3 -3
- package/dist/Divider/demo/base.js +2 -2
- package/dist/Ellipsis/demo/base.js +2 -2
- package/dist/Empty/demo/base.js +2 -2
- package/dist/ErrorBlock/demo/base.js +2 -2
- package/dist/Footer/demo/base.js +2 -2
- package/dist/Form/FormItem/form-item-input.d.ts +15 -0
- package/dist/Form/FormItem/form-item-input.js +39 -0
- package/dist/Form/FormItem/form-item-label.d.ts +13 -0
- package/dist/Form/FormItem/form-item-label.js +27 -0
- package/dist/Form/FormItem/form-item.d.ts +22 -0
- package/dist/Form/FormItem/form-item.js +73 -0
- package/dist/Form/FormItem/index.d.ts +5 -0
- package/dist/Form/FormItem/index.js +3 -0
- package/dist/Form/demo/input.js +1 -1
- package/dist/Form/index.d.ts +8 -1
- package/dist/Form/index.js +5 -1
- package/dist/Form/style.scss +67 -0
- package/dist/Grid/demo/base.js +2 -2
- package/dist/Grid/demo/base.scss +7 -7
- package/dist/Icon/demo/base.js +4 -4
- package/dist/Image/demo/base.js +2 -2
- package/dist/Image/demo/base.scss +4 -4
- package/dist/Image/style.scss +30 -30
- package/dist/ImagesPreview/ImagesPreview.js +2 -2
- package/dist/ImagesPreview/style.scss +34 -34
- package/dist/ImagesWall/CameraModal.js +2 -2
- package/dist/ImagesWall/ImagesWall.js +1 -1
- package/dist/ImagesWall/style.scss +70 -70
- package/dist/Input/base-input.d.ts +13 -0
- package/dist/Input/base-input.js +41 -0
- package/dist/Input/demo/base.js +89 -13
- package/dist/Input/index.d.ts +14 -2
- package/dist/Input/index.js +11 -1
- package/dist/Input/index.scss +223 -0
- package/dist/Input/input-affix-wrapper.d.ts +11 -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 +18 -0
- package/dist/Input/input.js +63 -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/NavBar/demo/base.scss +5 -5
- package/dist/NoticeBar/demo/base.js +2 -2
- 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/{Mask → Overlay}/demo/base.js +14 -16
- package/dist/Overlay/index.d.ts +4 -0
- package/dist/Overlay/index.js +3 -0
- package/dist/Overlay/style.scss +20 -0
- package/dist/PageIndicator/demo/base.js +2 -2
- package/dist/Picker/index.d.ts +1 -1
- package/dist/Picker/index.js +1 -1
- package/dist/Picker/picker.d.ts +19 -0
- package/dist/Picker/picker.js +97 -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 +109 -27
- 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/Radio/demo/base.scss +4 -4
- package/dist/Result/demo/base.js +2 -2
- package/dist/SafeArea/demo/base.scss +18 -18
- 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/SideBar/index.d.ts +1 -1
- package/dist/SideBar/side-bar.js +6 -6
- package/dist/SideBar/style.scss +85 -85
- package/dist/Space/demo/base.js +2 -2
- package/dist/Swiper/style.scss +54 -54
- package/dist/Switch/demo/base.js +2 -2
- package/dist/TabBar/demo/base.js +2 -2
- package/dist/Tag/demo/base.js +2 -2
- package/dist/Tag/demo/style.scss +8 -8
- package/dist/Toast/style.scss +63 -63
- 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/WaterMark/demo/demo1.js +2 -2
- package/dist/WaterMark/demo/demo1.scss +6 -6
- package/dist/WaterMark/demo/demo2.js +2 -2
- package/dist/index.d.ts +9 -7
- package/dist/index.js +4 -3
- package/dist/style/variable.scss +1 -0
- package/dist/types.d.ts +0 -8
- package/dist/types.js +0 -1
- package/dist/utils/type.js +36 -36
- package/dist/utils/use-isomorphic-update-layout-effect.d.ts +1 -1
- package/dist/utils/with-default-props.js +4 -4
- package/package.json +13 -14
- package/readme.md +43 -43
- package/dist/CalendarPicker/calendar-picker.d.ts +0 -4
- package/dist/CalendarPicker/calendar-range-picker.d.ts +0 -4
- package/dist/CalendarPicker/index.d.ts +0 -9
- package/dist/CalendarPicker/index.js +0 -5
- package/dist/CalendarPicker/style.scss +0 -31
- 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/{CalendarDatetimePicker → CalendarDatetimePopup}/DateTimeSwitch.d.ts +0 -0
- /package/dist/{CalendarDatetimePicker → CalendarDatetimePopup}/DateTimeSwitch.js +0 -0
- /package/dist/{CalendarPicker → CalendarDatetimePopup}/demo/base.d.ts +0 -0
- /package/dist/{Mask → CalendarPopup}/demo/base.d.ts +0 -0
- /package/dist/{CalendarPicker → CalendarPopup}/types.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trionesdev/antd-mobile-react",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.10",
|
|
4
4
|
"description": "antd mobile react ",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
19
19
|
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
20
20
|
"prepublishOnly": "father doctor && npm run build",
|
|
21
|
-
"publish": "npm publish --registry=https://registry.npmjs.org/",
|
|
21
|
+
"publish": "npm publish --tag latest --registry=https://registry.npmjs.org/",
|
|
22
22
|
"publishOnly": "npm publish --ignore-scripts --registry=https://registry.npmjs.org/"
|
|
23
23
|
},
|
|
24
24
|
"authors": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"classnames": "^2.5.1",
|
|
58
|
-
"lodash": "^4.17.21",
|
|
58
|
+
"lodash-es": "^4.17.21",
|
|
59
59
|
"react": ">=16.9.0",
|
|
60
60
|
"react-dom": ">=16.9.0",
|
|
61
61
|
"staged-components": "^1.1.3"
|
|
@@ -66,19 +66,20 @@
|
|
|
66
66
|
"@trionesdev/antd-mobile-base-react": "workspace:*",
|
|
67
67
|
"@trionesdev/antd-mobile-icons-react": "workspace:*",
|
|
68
68
|
"@types/crypto-js": "^4.2.2",
|
|
69
|
-
"@types/lodash": "^4.17.
|
|
69
|
+
"@types/lodash-es": "^4.17.12",
|
|
70
70
|
"@types/react": "^18.0.0",
|
|
71
71
|
"@types/react-dom": "^18.0.0",
|
|
72
|
+
"@types/uuid": "^10.0.0",
|
|
72
73
|
"@umijs/lint": "^4.0.0",
|
|
73
74
|
"classnames": "^2.5.1",
|
|
74
75
|
"cross-env": "^7.0.3",
|
|
75
|
-
"dumi": "2.4.
|
|
76
|
+
"dumi": "2.4.21",
|
|
76
77
|
"dumi-theme-mobile": "^2.3.5",
|
|
77
78
|
"eslint": "^8.23.0",
|
|
78
|
-
"father": "^4.
|
|
79
|
+
"father": "^4.6.9",
|
|
79
80
|
"husky": "^8.0.1",
|
|
80
81
|
"lint-staged": "^13.0.3",
|
|
81
|
-
"lodash": "^4.17.
|
|
82
|
+
"lodash-es": "^4.17.23",
|
|
82
83
|
"prettier": "^3.4.2",
|
|
83
84
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
84
85
|
"prettier-plugin-packagejson": "^2.5.6",
|
|
@@ -88,17 +89,15 @@
|
|
|
88
89
|
"stylelint": "^16.12.0"
|
|
89
90
|
},
|
|
90
91
|
"dependencies": {
|
|
91
|
-
"@trionesdev/antd-mobile-base-react": "^0.0.2-beta.
|
|
92
|
-
"@types/uuid": "^10.0.0",
|
|
92
|
+
"@trionesdev/antd-mobile-base-react": "^0.0.2-beta.10",
|
|
93
93
|
"ahooks": "^3.8.4",
|
|
94
94
|
"crypto-js": "^4.2.0",
|
|
95
|
-
"
|
|
96
|
-
"rc-
|
|
97
|
-
"runes2": "^1.1.4"
|
|
95
|
+
"dayjs": "^1.11.19",
|
|
96
|
+
"rc-field-form": "^2.7.0"
|
|
98
97
|
},
|
|
99
98
|
"optionalDependencies": {
|
|
100
99
|
"@trionesdev/antd-mobile-base-react": "workspace:*",
|
|
101
|
-
"@trionesdev/antd-mobile-icons-react": "0.0.2-beta.
|
|
100
|
+
"@trionesdev/antd-mobile-icons-react": "0.0.2-beta.9"
|
|
102
101
|
},
|
|
103
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "c062f3bd8651ea933f9385279c05a1ab0245b2b8"
|
|
104
103
|
}
|
package/readme.md
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
# @trionesdev/antd-taro-react
|
|
2
|
-
|
|
3
|
-
[](https://npmjs.org/package/@trionesdev/antd-mobile-react)
|
|
4
|
+
[](https://npmjs.org/package/@trionesdev/antd-mobile-react)
|
|
5
|
+
|
|
6
|
+
antd mobile react
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
TODO
|
|
11
|
+
|
|
12
|
+
## Options
|
|
13
|
+
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Development
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# install dependencies
|
|
20
|
+
$ pnpm install
|
|
21
|
+
|
|
22
|
+
# develop library by docs demo
|
|
23
|
+
$ pnpm start
|
|
24
|
+
|
|
25
|
+
# build library source code
|
|
26
|
+
$ pnpm run build
|
|
27
|
+
|
|
28
|
+
# build library source code in watch mode
|
|
29
|
+
$ pnpm run build:watch
|
|
30
|
+
|
|
31
|
+
# build docs
|
|
32
|
+
$ pnpm run docs:build
|
|
33
|
+
|
|
34
|
+
# Locally preview the production build.
|
|
35
|
+
$ pnpm run docs:preview
|
|
36
|
+
|
|
37
|
+
# check your project for potential problems
|
|
38
|
+
$ pnpm run doctor
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## LICENSE
|
|
42
|
+
|
|
43
|
+
MIT
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CalendarPicker as InternalCalendarPicker } from "./calendar-picker";
|
|
2
|
-
import { CalendarRangePicker } from "./calendar-range-picker";
|
|
3
|
-
import { CalendarPickerProps } from "./types";
|
|
4
|
-
type CompoundedComponent = typeof InternalCalendarPicker & {
|
|
5
|
-
Range: typeof CalendarRangePicker;
|
|
6
|
-
};
|
|
7
|
-
declare const CalendarPicker: CompoundedComponent;
|
|
8
|
-
export type { CalendarPickerProps };
|
|
9
|
-
export default CalendarPicker;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
@import "@trionesdev/antd-mobile-base-react/dist/style/variable";
|
|
2
|
-
|
|
3
|
-
$calendarPickerCls: 'triones-antm-calendar-picker';
|
|
4
|
-
|
|
5
|
-
.#{$calendarPickerCls} {
|
|
6
|
-
border-top-left-radius: $trionesBorderRadius;
|
|
7
|
-
border-top-right-radius: $trionesBorderRadius;
|
|
8
|
-
|
|
9
|
-
&-header {
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: space-between;
|
|
12
|
-
border-bottom: 1Px solid $trionesBorderColor;
|
|
13
|
-
padding: 4Px;
|
|
14
|
-
&-button {
|
|
15
|
-
padding: 8Px 12Px;
|
|
16
|
-
|
|
17
|
-
&-cancel {
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&-ok {
|
|
21
|
-
color: $trionesColorPrimary;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&-body {
|
|
29
|
-
pointer-events: unset;
|
|
30
|
-
}
|
|
31
|
-
}
|
package/dist/Mask/index.d.ts
DELETED
package/dist/Mask/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import "./style.scss";
|
|
3
|
-
import { PercentPositionAlign, ProgressStatus } from "./types";
|
|
4
|
-
import { Size } from "@trionesdev/antd-mobile-base-react";
|
|
5
|
-
export type ProgressProps = {
|
|
6
|
-
/**
|
|
7
|
-
* @description 内容的模板函数
|
|
8
|
-
* @default percent => `${percent}%`
|
|
9
|
-
*/
|
|
10
|
-
format?: (percent: number) => string;
|
|
11
|
-
type?: 'line' | 'circle';
|
|
12
|
-
/**
|
|
13
|
-
* @description 百分比
|
|
14
|
-
* @default 0
|
|
15
|
-
*/
|
|
16
|
-
percent?: number;
|
|
17
|
-
size?: Size;
|
|
18
|
-
/**
|
|
19
|
-
* @description 是否显示进度数值或状态图标
|
|
20
|
-
* @default true
|
|
21
|
-
*/
|
|
22
|
-
showInfo?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* @description 未完成的分段的颜色
|
|
25
|
-
*/
|
|
26
|
-
railColor?: string;
|
|
27
|
-
/**
|
|
28
|
-
* @description 进度条的色彩
|
|
29
|
-
*/
|
|
30
|
-
strokeColor?: string;
|
|
31
|
-
status?: ProgressStatus;
|
|
32
|
-
/**
|
|
33
|
-
* @description 进度数值位置
|
|
34
|
-
*/
|
|
35
|
-
percentPositionAlign?: PercentPositionAlign;
|
|
36
|
-
};
|
|
37
|
-
export declare const Progress: FC<ProgressProps>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ProgressCircle } from "./ProgressCircle";
|
|
3
|
-
import "./style.scss";
|
|
4
|
-
import { ProgressLine } from "./ProgressLine";
|
|
5
|
-
import { exceptionColor, successColor } from "./types";
|
|
6
|
-
export var Progress = function Progress(_ref) {
|
|
7
|
-
var format = _ref.format,
|
|
8
|
-
_ref$type = _ref.type,
|
|
9
|
-
type = _ref$type === void 0 ? 'line' : _ref$type,
|
|
10
|
-
_ref$percent = _ref.percent,
|
|
11
|
-
percent = _ref$percent === void 0 ? 0 : _ref$percent,
|
|
12
|
-
_ref$size = _ref.size,
|
|
13
|
-
size = _ref$size === void 0 ? 'middle' : _ref$size,
|
|
14
|
-
_ref$showInfo = _ref.showInfo,
|
|
15
|
-
showInfo = _ref$showInfo === void 0 ? true : _ref$showInfo,
|
|
16
|
-
_ref$railColor = _ref.railColor,
|
|
17
|
-
railColor = _ref$railColor === void 0 ? '#E5E5E5' : _ref$railColor,
|
|
18
|
-
_ref$strokeColor = _ref.strokeColor,
|
|
19
|
-
strokeColor = _ref$strokeColor === void 0 ? '#1777FF' : _ref$strokeColor,
|
|
20
|
-
status = _ref.status,
|
|
21
|
-
percentPositionAlign = _ref.percentPositionAlign;
|
|
22
|
-
var handleComputedStrokeColor = function handleComputedStrokeColor() {
|
|
23
|
-
if (status === 'exception') {
|
|
24
|
-
return exceptionColor;
|
|
25
|
-
}
|
|
26
|
-
if (percent >= 100) {
|
|
27
|
-
return successColor;
|
|
28
|
-
}
|
|
29
|
-
return strokeColor;
|
|
30
|
-
};
|
|
31
|
-
if (type === 'line') {
|
|
32
|
-
return /*#__PURE__*/React.createElement(ProgressLine, {
|
|
33
|
-
format: format,
|
|
34
|
-
percent: percent,
|
|
35
|
-
size: size,
|
|
36
|
-
railColor: railColor,
|
|
37
|
-
strokeColor: handleComputedStrokeColor(),
|
|
38
|
-
status: status,
|
|
39
|
-
showInfo: showInfo,
|
|
40
|
-
percentPositionAlign: percentPositionAlign
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return /*#__PURE__*/React.createElement(ProgressCircle, {
|
|
44
|
-
format: format,
|
|
45
|
-
percent: percent,
|
|
46
|
-
size: size,
|
|
47
|
-
railColor: railColor,
|
|
48
|
-
strokeColor: handleComputedStrokeColor(),
|
|
49
|
-
showInfo: showInfo,
|
|
50
|
-
status: status
|
|
51
|
-
});
|
|
52
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { Size } from "@trionesdev/antd-mobile-base-react";
|
|
3
|
-
import './style.scss';
|
|
4
|
-
import { ProgressStatus } from "./types";
|
|
5
|
-
type ProcessCircleProps = {
|
|
6
|
-
format?: (percent: number) => string;
|
|
7
|
-
percent?: number;
|
|
8
|
-
strokeWidth?: number;
|
|
9
|
-
size?: Size;
|
|
10
|
-
showInfo?: boolean;
|
|
11
|
-
railColor?: string;
|
|
12
|
-
strokeColor?: string;
|
|
13
|
-
strokeLineCap?: 'butt' | 'round' | 'square';
|
|
14
|
-
status?: ProgressStatus;
|
|
15
|
-
};
|
|
16
|
-
export declare const ProgressCircle: FC<ProcessCircleProps>;
|
|
17
|
-
export {};
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import React, { memo, useEffect, useMemo, useRef } from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import "./style.scss";
|
|
4
|
-
import { CheckOutline, CloseOutline } from "@trionesdev/antd-mobile-icons-react";
|
|
5
|
-
import { exceptionColor, successColor } from "./types";
|
|
6
|
-
export var ProgressCircle = /*#__PURE__*/memo(function (_ref) {
|
|
7
|
-
var format = _ref.format,
|
|
8
|
-
_ref$percent = _ref.percent,
|
|
9
|
-
percent = _ref$percent === void 0 ? 0 : _ref$percent,
|
|
10
|
-
_ref$strokeWidth = _ref.strokeWidth,
|
|
11
|
-
strokeWidth = _ref$strokeWidth === void 0 ? 6 : _ref$strokeWidth,
|
|
12
|
-
_ref$size = _ref.size,
|
|
13
|
-
size = _ref$size === void 0 ? 'middle' : _ref$size,
|
|
14
|
-
_ref$showInfo = _ref.showInfo,
|
|
15
|
-
showInfo = _ref$showInfo === void 0 ? true : _ref$showInfo,
|
|
16
|
-
_ref$railColor = _ref.railColor,
|
|
17
|
-
railColor = _ref$railColor === void 0 ? '#E5E5E5' : _ref$railColor,
|
|
18
|
-
_ref$strokeColor = _ref.strokeColor,
|
|
19
|
-
strokeColor = _ref$strokeColor === void 0 ? '#1777FF' : _ref$strokeColor,
|
|
20
|
-
_ref$strokeLineCap = _ref.strokeLineCap,
|
|
21
|
-
strokeLineCap = _ref$strokeLineCap === void 0 ? 'round' : _ref$strokeLineCap,
|
|
22
|
-
status = _ref.status;
|
|
23
|
-
var clsPrefix = 'triones-antm-progress-circle';
|
|
24
|
-
var canvasRef = useRef();
|
|
25
|
-
var computedWidth = useMemo(function () {
|
|
26
|
-
switch (size) {
|
|
27
|
-
case 'small':
|
|
28
|
-
return 50;
|
|
29
|
-
case 'middle':
|
|
30
|
-
return 100;
|
|
31
|
-
case 'large':
|
|
32
|
-
return 150;
|
|
33
|
-
default:
|
|
34
|
-
return size || 50;
|
|
35
|
-
}
|
|
36
|
-
}, [size]);
|
|
37
|
-
var computedHeight = useMemo(function () {
|
|
38
|
-
switch (size) {
|
|
39
|
-
case 'small':
|
|
40
|
-
return 50;
|
|
41
|
-
case 'middle':
|
|
42
|
-
return 100;
|
|
43
|
-
case 'large':
|
|
44
|
-
return 150;
|
|
45
|
-
default:
|
|
46
|
-
return 50;
|
|
47
|
-
}
|
|
48
|
-
}, [size]);
|
|
49
|
-
var style = {
|
|
50
|
-
width: computedWidth,
|
|
51
|
-
height: computedHeight
|
|
52
|
-
};
|
|
53
|
-
var computedSize = function computedSize() {
|
|
54
|
-
var iconSize = (computedWidth - strokeWidth) / 2 / 3;
|
|
55
|
-
if (iconSize < 24) {
|
|
56
|
-
return 24;
|
|
57
|
-
}
|
|
58
|
-
return iconSize;
|
|
59
|
-
};
|
|
60
|
-
var handleIndicator = function handleIndicator() {
|
|
61
|
-
var iconSize = computedSize();
|
|
62
|
-
var indicatorColor = '#333';
|
|
63
|
-
if (status === 'exception') {
|
|
64
|
-
indicatorColor = exceptionColor;
|
|
65
|
-
}
|
|
66
|
-
if (percent >= 100) {
|
|
67
|
-
indicatorColor = successColor;
|
|
68
|
-
}
|
|
69
|
-
if (format) {
|
|
70
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
style: {
|
|
72
|
-
color: indicatorColor,
|
|
73
|
-
fontSize: iconSize
|
|
74
|
-
}
|
|
75
|
-
}, format(percent));
|
|
76
|
-
}
|
|
77
|
-
if (status === 'exception') {
|
|
78
|
-
return /*#__PURE__*/React.createElement(CloseOutline, {
|
|
79
|
-
style: {
|
|
80
|
-
color: indicatorColor,
|
|
81
|
-
fontSize: iconSize
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
if (percent >= 100) {
|
|
86
|
-
return /*#__PURE__*/React.createElement(CheckOutline, {
|
|
87
|
-
style: {
|
|
88
|
-
color: indicatorColor,
|
|
89
|
-
fontSize: iconSize
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
94
|
-
style: {
|
|
95
|
-
color: indicatorColor,
|
|
96
|
-
fontSize: iconSize
|
|
97
|
-
}
|
|
98
|
-
}, percent, "%");
|
|
99
|
-
};
|
|
100
|
-
var handleDraw = function handleDraw() {
|
|
101
|
-
var width = computedWidth;
|
|
102
|
-
var height = computedHeight;
|
|
103
|
-
var centerX = width / 2;
|
|
104
|
-
var centerY = height / 2;
|
|
105
|
-
var radius = (Math.min(width, height) - strokeWidth) / 2;
|
|
106
|
-
console.log(centerX, centerY, radius);
|
|
107
|
-
var sweepAngle = (percent ? percent / 100 : 0) * 2 * Math.PI;
|
|
108
|
-
var startAngle = -Math.PI / 2; // 从顶部开始
|
|
109
|
-
|
|
110
|
-
var ctx = canvasRef.current.getContext('2d');
|
|
111
|
-
ctx.width = width;
|
|
112
|
-
ctx.height = height;
|
|
113
|
-
ctx.clearRect(0, 0, computedWidth, computedHeight);
|
|
114
|
-
|
|
115
|
-
//region 画背景圈
|
|
116
|
-
ctx.beginPath();
|
|
117
|
-
ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
|
|
118
|
-
ctx.strokeStyle = railColor;
|
|
119
|
-
ctx.lineWidth = strokeWidth;
|
|
120
|
-
ctx.stroke();
|
|
121
|
-
//endregion
|
|
122
|
-
|
|
123
|
-
//region 画进度圈
|
|
124
|
-
ctx.beginPath();
|
|
125
|
-
ctx.arc(centerX, centerY, radius, startAngle, startAngle + sweepAngle);
|
|
126
|
-
ctx.strokeStyle = strokeColor;
|
|
127
|
-
ctx.lineWidth = strokeWidth;
|
|
128
|
-
ctx.lineCap = strokeLineCap;
|
|
129
|
-
ctx.stroke();
|
|
130
|
-
//endregion
|
|
131
|
-
};
|
|
132
|
-
useEffect(function () {
|
|
133
|
-
console.log(canvasRef.current);
|
|
134
|
-
if (canvasRef.current) {
|
|
135
|
-
handleDraw();
|
|
136
|
-
}
|
|
137
|
-
}, [percent, canvasRef.current]);
|
|
138
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
139
|
-
className: classNames("".concat(clsPrefix)),
|
|
140
|
-
style: style
|
|
141
|
-
}, /*#__PURE__*/React.createElement("canvas", {
|
|
142
|
-
ref: canvasRef,
|
|
143
|
-
width: computedWidth,
|
|
144
|
-
height: computedHeight
|
|
145
|
-
}), showInfo && computedWidth > 20 && /*#__PURE__*/React.createElement("div", {
|
|
146
|
-
className: "".concat(clsPrefix, "-indicator")
|
|
147
|
-
}, handleIndicator()));
|
|
148
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Size } from "@trionesdev/antd-mobile-base-react";
|
|
2
|
-
import { FC } from "react";
|
|
3
|
-
import { PercentPositionAlign, ProgressStatus } from "./types";
|
|
4
|
-
type ProgressLineProps = {
|
|
5
|
-
format?: (percent: number) => string;
|
|
6
|
-
percent?: number;
|
|
7
|
-
size?: Size;
|
|
8
|
-
showInfo?: boolean;
|
|
9
|
-
railColor?: string;
|
|
10
|
-
strokeColor?: string;
|
|
11
|
-
status?: ProgressStatus;
|
|
12
|
-
percentPositionAlign?: PercentPositionAlign;
|
|
13
|
-
};
|
|
14
|
-
export declare const ProgressLine: FC<ProgressLineProps>;
|
|
15
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import { exceptionColor, successColor } from "./types";
|
|
4
|
-
import { CloseCircleFill, CheckCircleFill } from "@trionesdev/antd-mobile-icons-react";
|
|
5
|
-
export var ProgressLine = function ProgressLine(_ref) {
|
|
6
|
-
var format = _ref.format,
|
|
7
|
-
_ref$percent = _ref.percent,
|
|
8
|
-
percent = _ref$percent === void 0 ? 0 : _ref$percent,
|
|
9
|
-
_ref$size = _ref.size,
|
|
10
|
-
size = _ref$size === void 0 ? 'middle' : _ref$size,
|
|
11
|
-
_ref$showInfo = _ref.showInfo,
|
|
12
|
-
showInfo = _ref$showInfo === void 0 ? true : _ref$showInfo,
|
|
13
|
-
_ref$railColor = _ref.railColor,
|
|
14
|
-
railColor = _ref$railColor === void 0 ? '#E5E5E5' : _ref$railColor,
|
|
15
|
-
_ref$strokeColor = _ref.strokeColor,
|
|
16
|
-
strokeColor = _ref$strokeColor === void 0 ? '#1777FF' : _ref$strokeColor,
|
|
17
|
-
status = _ref.status,
|
|
18
|
-
_ref$percentPositionA = _ref.percentPositionAlign,
|
|
19
|
-
percentPositionAlign = _ref$percentPositionA === void 0 ? 'end' : _ref$percentPositionA;
|
|
20
|
-
var clsPrefix = 'triones-antm-progress-line';
|
|
21
|
-
var handleComputeLineHeight = function handleComputeLineHeight() {
|
|
22
|
-
switch (size) {
|
|
23
|
-
case 'small':
|
|
24
|
-
return 6;
|
|
25
|
-
case 'middle':
|
|
26
|
-
return 8;
|
|
27
|
-
case 'large':
|
|
28
|
-
return 12;
|
|
29
|
-
default:
|
|
30
|
-
return size || 8;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var handleComputeInfoHeight = function handleComputeInfoHeight() {
|
|
34
|
-
var lineHeight = handleComputeLineHeight();
|
|
35
|
-
if (lineHeight <= 8) {
|
|
36
|
-
return 12;
|
|
37
|
-
} else if (lineHeight <= 12) {
|
|
38
|
-
return 14;
|
|
39
|
-
} else {
|
|
40
|
-
return 16;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var handleIndicator = function handleIndicator() {
|
|
44
|
-
if (format) {
|
|
45
|
-
return /*#__PURE__*/React.createElement("div", null, format(percent));
|
|
46
|
-
}
|
|
47
|
-
if (status === 'exception') {
|
|
48
|
-
return /*#__PURE__*/React.createElement(CloseCircleFill, {
|
|
49
|
-
style: {
|
|
50
|
-
color: exceptionColor,
|
|
51
|
-
fontSize: handleComputeInfoHeight()
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
if (percent >= 100) {
|
|
56
|
-
return /*#__PURE__*/React.createElement(CheckCircleFill, {
|
|
57
|
-
style: {
|
|
58
|
-
color: successColor,
|
|
59
|
-
fontSize: handleComputeInfoHeight()
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
style: {
|
|
65
|
-
fontSize: handleComputeInfoHeight()
|
|
66
|
-
}
|
|
67
|
-
}, percent, "%");
|
|
68
|
-
};
|
|
69
|
-
var info = /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: classNames("".concat(clsPrefix, "-indicator"))
|
|
71
|
-
}, handleIndicator());
|
|
72
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className: classNames(clsPrefix)
|
|
74
|
-
}, showInfo && percentPositionAlign === 'start' && info, /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: classNames("".concat(clsPrefix, "-rail")),
|
|
76
|
-
style: {
|
|
77
|
-
backgroundColor: railColor
|
|
78
|
-
}
|
|
79
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
80
|
-
className: classNames("".concat(clsPrefix, "-track")),
|
|
81
|
-
style: {
|
|
82
|
-
width: "".concat(percent, "%"),
|
|
83
|
-
backgroundColor: strokeColor,
|
|
84
|
-
height: handleComputeLineHeight()
|
|
85
|
-
}
|
|
86
|
-
})), showInfo && percentPositionAlign === 'end' && info);
|
|
87
|
-
};
|
package/dist/Progress/style.scss
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
$progressLineCls: 'triones-antm-progress-line';
|
|
2
|
-
$progressCircleCls: 'triones-antm-progress-circle';
|
|
3
|
-
|
|
4
|
-
.#{$progressLineCls}{
|
|
5
|
-
width: 100%;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
gap: 4Px;
|
|
9
|
-
&-rail{
|
|
10
|
-
flex: 1 auto;
|
|
11
|
-
border-radius: 90Px;
|
|
12
|
-
}
|
|
13
|
-
&-track{
|
|
14
|
-
border-radius: 90Px;
|
|
15
|
-
}
|
|
16
|
-
&-indicator{}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.#{$progressCircleCls} {
|
|
20
|
-
position: relative;
|
|
21
|
-
&-indicator {
|
|
22
|
-
position: absolute;
|
|
23
|
-
inset-block-start: 50%;
|
|
24
|
-
inset-inline-start: 0;
|
|
25
|
-
width: 100%;
|
|
26
|
-
margin: 0;
|
|
27
|
-
padding: 0;
|
|
28
|
-
line-height: 1;
|
|
29
|
-
white-space: normal;
|
|
30
|
-
text-align: center;
|
|
31
|
-
transform: translatey(-50%);
|
|
32
|
-
}
|
|
33
|
-
}
|
package/dist/Progress/types.d.ts
DELETED
package/dist/Progress/types.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|