@trionesdev/antd-mobile-react 0.0.2-beta.2 → 0.0.2-beta.20

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.
Files changed (262) hide show
  1. package/LICENSE +21 -21
  2. package/dist/ActionSheet/ActionSheet.d.ts +25 -0
  3. package/dist/ActionSheet/ActionSheet.js +77 -0
  4. package/dist/ActionSheet/index.d.ts +1 -1
  5. package/dist/ActionSheet/index.js +1 -1
  6. package/dist/ActionSheet/style.scss +52 -0
  7. package/dist/Avatar/demo/base.js +2 -2
  8. package/dist/Avatar/demo/style.scss +6 -6
  9. package/dist/Badge/demo/base.js +2 -2
  10. package/dist/Badge/demo/base.scss +6 -6
  11. package/dist/Button/button.d.ts +2 -1
  12. package/dist/Button/button.js +1 -1
  13. package/dist/Button/demo/base.js +2 -2
  14. package/dist/Button/style.scss +234 -232
  15. package/dist/Calendar/calendar-grid.d.ts +10 -9
  16. package/dist/Calendar/calendar-grid.js +41 -64
  17. package/dist/Calendar/calendar-header.d.ts +3 -2
  18. package/dist/Calendar/calendar-header.js +6 -6
  19. package/dist/Calendar/calendar-range.d.ts +4 -3
  20. package/dist/Calendar/calendar-range.js +12 -11
  21. package/dist/Calendar/calendar.d.ts +5 -4
  22. package/dist/Calendar/calendar.js +23 -14
  23. package/dist/Calendar/style.scss +85 -85
  24. package/dist/Calendar/touchable-calendar-grid.d.ts +6 -5
  25. package/dist/Calendar/touchable-calendar-grid.js +67 -59
  26. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +3 -2
  27. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +14 -28
  28. package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +3 -2
  29. package/dist/CalendarDatetimePicker/DateTimeSwitch.js +4 -3
  30. package/dist/CalendarDatetimePicker/demo/base.js +1 -1
  31. package/dist/CalendarDatetimePicker/style.scss +54 -54
  32. package/dist/CalendarDatetimePicker/types.d.ts +1 -1
  33. package/dist/CalendarDatetimePicker/types.js +1 -1
  34. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +11 -0
  35. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +61 -0
  36. package/dist/{Mask → CalendarDatetimePickerCell}/demo/base.js +9 -15
  37. package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
  38. package/dist/CalendarDatetimePickerCell/index.js +2 -0
  39. package/dist/CalendarDatetimePickerCell/style.scss +10 -0
  40. package/dist/CalendarDatetimePickerCell/types.d.ts +1 -0
  41. package/dist/CalendarDatetimePickerCell/types.js +1 -0
  42. package/dist/CalendarPicker/calendar-picker.js +2 -2
  43. package/dist/CalendarPicker/calendar-range-picker.d.ts +4 -4
  44. package/dist/CalendarPicker/calendar-range-picker.js +11 -9
  45. package/dist/CalendarPicker/demo/base.js +6 -6
  46. package/dist/CalendarPicker/index.d.ts +2 -2
  47. package/dist/CalendarPicker/index.js +3 -3
  48. package/dist/CalendarPicker/style.scss +31 -31
  49. package/dist/CalendarPicker/types.d.ts +8 -7
  50. package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +11 -0
  51. package/dist/CalendarPickerCell/CalendarPickerCell.js +54 -0
  52. package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +11 -0
  53. package/dist/CalendarPickerCell/CalendarRangePickerCell.js +56 -0
  54. package/dist/CalendarPickerCell/demo/base.d.ts +3 -0
  55. package/dist/CalendarPickerCell/demo/base.js +31 -0
  56. package/dist/CalendarPickerCell/index.d.ts +8 -0
  57. package/dist/CalendarPickerCell/index.js +5 -0
  58. package/dist/Card/demo/base.js +2 -2
  59. package/dist/Card/demo/base.scss +18 -18
  60. package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
  61. package/dist/CascaderPicker/cascader-picker.js +90 -0
  62. package/dist/CascaderPicker/demo/base.js +1 -4
  63. package/dist/CascaderPicker/index.d.ts +1 -1
  64. package/dist/CascaderPicker/index.js +1 -1
  65. package/dist/CascaderPicker/style.scss +45 -0
  66. package/dist/CascaderPickerCell/CascaderPickerCell.d.ts +21 -0
  67. package/dist/CascaderPickerCell/CascaderPickerCell.js +70 -0
  68. package/dist/CascaderPickerCell/demo/base.js +71 -0
  69. package/dist/CascaderPickerCell/index.d.ts +3 -0
  70. package/dist/CascaderPickerCell/index.js +2 -0
  71. package/dist/CascaderPickerCell/style.scss +24 -0
  72. package/dist/Cell/demo/base.js +41 -2
  73. package/dist/Checkbox/demo/base.js +11 -6
  74. package/dist/Checkbox/demo/disabled.js +2 -1
  75. package/dist/ConfigProvider/demo/base.js +2 -2
  76. package/dist/DemoBlock/index.d.ts +6 -0
  77. package/dist/DemoBlock/index.js +9 -2
  78. package/dist/DemoBlock/index.scss +20 -20
  79. package/dist/DemoDescription/index.scss +3 -3
  80. package/dist/Divider/demo/base.js +2 -2
  81. package/dist/Ellipsis/demo/base.js +2 -2
  82. package/dist/Empty/demo/base.js +2 -2
  83. package/dist/ErrorBlock/demo/base.js +2 -2
  84. package/dist/FetchPicker/FetchPicker.d.ts +113 -0
  85. package/dist/FetchPicker/FetchPicker.js +319 -0
  86. package/dist/FetchPicker/index.d.ts +4 -0
  87. package/dist/FetchPicker/index.js +3 -0
  88. package/dist/FetchPicker/styles.scss +118 -0
  89. package/dist/FloatButton/FloatButton.d.ts +21 -0
  90. package/dist/FloatButton/FloatButton.js +66 -0
  91. package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
  92. package/dist/FloatButton/FloatButtonGroup.js +120 -0
  93. package/dist/FloatButton/context.d.ts +13 -0
  94. package/dist/FloatButton/context.js +2 -0
  95. package/dist/FloatButton/demo/base.d.ts +3 -0
  96. package/dist/FloatButton/demo/base.js +10 -0
  97. package/dist/FloatButton/demo/group.d.ts +3 -0
  98. package/dist/FloatButton/demo/group.js +20 -0
  99. package/dist/FloatButton/demo/square.d.ts +3 -0
  100. package/dist/FloatButton/demo/square.js +12 -0
  101. package/dist/FloatButton/index.d.ts +10 -0
  102. package/dist/FloatButton/index.js +5 -0
  103. package/dist/FloatButton/style.scss +123 -0
  104. package/dist/Footer/demo/base.js +2 -2
  105. package/dist/Form/FormItem/form-item-content.d.ts +17 -0
  106. package/dist/Form/FormItem/form-item-content.js +39 -0
  107. package/dist/Form/FormItem/form-item-label.d.ts +13 -0
  108. package/dist/Form/FormItem/form-item-label.js +29 -0
  109. package/dist/Form/FormItem/form-item.d.ts +51 -0
  110. package/dist/Form/FormItem/form-item.js +74 -0
  111. package/dist/Form/FormItem/index.d.ts +5 -0
  112. package/dist/Form/FormItem/index.js +3 -0
  113. package/dist/Form/demo/input.js +7 -3
  114. package/dist/Form/demo/vertical.d.ts +3 -0
  115. package/dist/Form/demo/vertical.js +45 -0
  116. package/dist/Form/index.d.ts +9 -2
  117. package/dist/Form/index.js +5 -1
  118. package/dist/Form/style.scss +106 -0
  119. package/dist/FormCell/index.d.ts +3 -0
  120. package/dist/FormCell/index.js +2 -0
  121. package/dist/Grid/demo/base.js +2 -2
  122. package/dist/Grid/demo/base.scss +7 -7
  123. package/dist/Icon/demo/base.js +2 -2
  124. package/dist/Image/demo/base.js +2 -2
  125. package/dist/Image/demo/base.scss +4 -4
  126. package/dist/Image/style.scss +30 -30
  127. package/dist/ImagesPreview/ImagesPreview.js +2 -2
  128. package/dist/ImagesPreview/style.scss +34 -34
  129. package/dist/ImagesWall/CameraModal.js +2 -2
  130. package/dist/ImagesWall/style.scss +70 -70
  131. package/dist/Input/base-input.d.ts +13 -0
  132. package/dist/Input/base-input.js +41 -0
  133. package/dist/Input/demo/base.js +115 -13
  134. package/dist/Input/index.d.ts +14 -2
  135. package/dist/Input/index.js +11 -1
  136. package/dist/Input/index.scss +240 -0
  137. package/dist/Input/input-affix-wrapper.d.ts +13 -0
  138. package/dist/Input/input-affix-wrapper.js +37 -0
  139. package/dist/Input/input-opt.d.ts +16 -0
  140. package/dist/Input/input-opt.js +87 -0
  141. package/dist/Input/input-password.d.ts +7 -0
  142. package/dist/Input/input-password.js +48 -0
  143. package/dist/Input/input.d.ts +20 -0
  144. package/dist/Input/input.js +66 -0
  145. package/dist/Input/textarea.d.ts +15 -0
  146. package/dist/Input/textarea.js +51 -0
  147. package/dist/Input/types.d.ts +3 -0
  148. package/dist/Input/types.js +2 -0
  149. package/dist/Loading/DotLoading.d.ts +1 -0
  150. package/dist/Loading/DotLoading.js +1 -0
  151. package/dist/Loading/SpinLoading.d.ts +1 -0
  152. package/dist/Loading/SpinLoading.js +1 -0
  153. package/dist/Loading/demo/base.d.ts +3 -0
  154. package/dist/{SpinLoading → Loading}/demo/base.js +8 -2
  155. package/dist/Loading/demo/dot-loading.d.ts +3 -0
  156. package/dist/Loading/demo/dot-loading.js +25 -0
  157. package/dist/Loading/index.d.ts +5 -0
  158. package/dist/Loading/index.js +3 -0
  159. package/dist/NavBar/demo/base.scss +5 -5
  160. package/dist/NoticeBar/demo/base.js +2 -2
  161. package/dist/Overlay/Overlay.d.ts +16 -0
  162. package/dist/Overlay/Overlay.js +117 -0
  163. package/dist/Overlay/demo/base.d.ts +3 -0
  164. package/dist/Overlay/demo/base.js +27 -0
  165. package/dist/Overlay/index.d.ts +4 -0
  166. package/dist/Overlay/index.js +3 -0
  167. package/dist/Overlay/style.scss +20 -0
  168. package/dist/PageIndicator/demo/base.js +2 -2
  169. package/dist/Picker/index.d.ts +1 -1
  170. package/dist/Picker/index.js +1 -1
  171. package/dist/Picker/picker.d.ts +20 -0
  172. package/dist/Picker/picker.js +94 -0
  173. package/dist/Picker/style.scss +44 -0
  174. package/dist/PickerView/index.d.ts +2 -1
  175. package/dist/PickerView/index.js +1 -1
  176. package/dist/PickerView/picker-view-column-item.d.ts +7 -0
  177. package/dist/PickerView/picker-view-column-item.js +11 -0
  178. package/dist/PickerView/picker-view-column.d.ts +10 -0
  179. package/dist/PickerView/picker-view-column.js +117 -0
  180. package/dist/PickerView/picker-view.d.ts +12 -0
  181. package/dist/PickerView/picker-view.js +60 -0
  182. package/dist/PickerView/style.scss +72 -0
  183. package/dist/PickerView/types.d.ts +4 -0
  184. package/dist/PickerView/types.js +1 -0
  185. package/dist/Popup/demo/base.js +109 -27
  186. package/dist/Popup/index.d.ts +2 -1
  187. package/dist/Popup/index.js +2 -1
  188. package/dist/Popup/popup.d.ts +31 -0
  189. package/dist/Popup/popup.js +87 -0
  190. package/dist/Popup/style.scss +129 -0
  191. package/dist/Progress/index.d.ts +1 -1
  192. package/dist/Progress/index.js +1 -1
  193. package/dist/Radio/demo/base.js +2 -2
  194. package/dist/Radio/demo/base.scss +4 -4
  195. package/dist/Result/demo/base.js +2 -2
  196. package/dist/SafeArea/demo/base.scss +18 -18
  197. package/dist/ScrollView/index.d.ts +2 -1
  198. package/dist/ScrollView/index.js +1 -1
  199. package/dist/ScrollView/scroll-view.d.ts +4 -0
  200. package/dist/ScrollView/scroll-view.js +55 -0
  201. package/dist/ScrollView/style.scss +19 -0
  202. package/dist/ScrollView/types.d.ts +26 -0
  203. package/dist/ScrollView/types.js +1 -0
  204. package/dist/Segmented/demo/base.d.ts +3 -0
  205. package/dist/Segmented/demo/base.js +33 -0
  206. package/dist/Segmented/index.d.ts +3 -0
  207. package/dist/Segmented/index.js +2 -0
  208. package/dist/SideBar/index.d.ts +1 -1
  209. package/dist/SideBar/side-bar.js +6 -6
  210. package/dist/SideBar/style.scss +85 -85
  211. package/dist/Skeleton/demo/base.d.ts +3 -0
  212. package/dist/Skeleton/demo/base.js +8 -0
  213. package/dist/Skeleton/index.d.ts +3 -0
  214. package/dist/Skeleton/index.js +2 -0
  215. package/dist/Space/demo/base.js +2 -2
  216. package/dist/Stepper/demo/base.d.ts +3 -0
  217. package/dist/Stepper/demo/base.js +23 -0
  218. package/dist/Stepper/index.d.ts +3 -0
  219. package/dist/Stepper/index.js +2 -0
  220. package/dist/Swiper/style.scss +54 -54
  221. package/dist/Switch/demo/base.js +2 -2
  222. package/dist/TabBar/demo/base.js +2 -2
  223. package/dist/Tag/demo/base.js +2 -2
  224. package/dist/Tag/demo/style.scss +8 -8
  225. package/dist/Toast/style.scss +63 -63
  226. package/dist/Toast/toast-modal.js +4 -4
  227. package/dist/VerificationCodeInput/demo/base.js +2 -2
  228. package/dist/VerificationCodeInput/index.d.ts +2 -2
  229. package/dist/VerificationCodeInput/index.js +1 -1
  230. package/dist/VerificationCodeInput/style.scss +20 -0
  231. package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
  232. package/dist/VerificationCodeInput/verification-code-input.js +99 -0
  233. package/dist/WaterMark/demo/demo1.js +2 -2
  234. package/dist/WaterMark/demo/demo1.scss +6 -6
  235. package/dist/WaterMark/demo/demo2.js +2 -2
  236. package/dist/index.d.ts +33 -19
  237. package/dist/index.js +9 -2
  238. package/dist/style/variable.scss +1 -1
  239. package/dist/types.d.ts +0 -8
  240. package/dist/types.js +0 -1
  241. package/dist/utils/dayjs.d.ts +4 -0
  242. package/dist/utils/dayjs.js +42 -0
  243. package/dist/utils/type.js +36 -36
  244. package/dist/utils/use-isomorphic-update-layout-effect.d.ts +1 -1
  245. package/dist/utils/with-default-props.js +4 -4
  246. package/package.json +11 -16
  247. package/readme.md +43 -43
  248. package/dist/Mask/index.d.ts +0 -3
  249. package/dist/Mask/index.js +0 -2
  250. package/dist/Progress/Progress.d.ts +0 -37
  251. package/dist/Progress/Progress.js +0 -52
  252. package/dist/Progress/ProgressCircle.d.ts +0 -17
  253. package/dist/Progress/ProgressCircle.js +0 -148
  254. package/dist/Progress/ProgressLine.d.ts +0 -15
  255. package/dist/Progress/ProgressLine.js +0 -87
  256. package/dist/Progress/style.scss +0 -33
  257. package/dist/Progress/types.d.ts +0 -4
  258. package/dist/Progress/types.js +0 -2
  259. package/dist/SpinLoading/index.d.ts +0 -3
  260. package/dist/SpinLoading/index.js +0 -2
  261. /package/dist/{Mask → CalendarDatetimePickerCell}/demo/base.d.ts +0 -0
  262. /package/dist/{SpinLoading → CascaderPickerCell}/demo/base.d.ts +0 -0
@@ -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
- };
@@ -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
- }
@@ -1,4 +0,0 @@
1
- export type ProgressStatus = 'normal' | 'active' | 'success' | 'exception';
2
- export type PercentPositionAlign = 'start' | 'end';
3
- export declare const successColor = "#53C31B";
4
- export declare const exceptionColor = "#FF4D4F";
@@ -1,2 +0,0 @@
1
- export var successColor = "#53C31B";
2
- export var exceptionColor = "#FF4D4F";
@@ -1,3 +0,0 @@
1
- import { SpinLoading, SpinLoadingProps } from "@trionesdev/antd-mobile-base-react";
2
- export type { SpinLoadingProps };
3
- export default SpinLoading;
@@ -1,2 +0,0 @@
1
- import { SpinLoading } from "@trionesdev/antd-mobile-base-react";
2
- export default SpinLoading;